*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-deep: #0c0618;
  --bg-mid: #15082a;
  --purple: #7b3dff;
  --pink: #ff4da6;
  --pink-hot: #ff2d87;
  --text: #f4f0ff;
  --muted: #a89bc4;
  --card: rgba(22, 10, 42, 0.75);
  --card-border: rgba(180, 120, 255, 0.25);
  --gradient: linear-gradient(90deg, var(--pink-hot), var(--purple));
  --glow: 0 0 40px rgba(123, 61, 255, 0.55), 0 0 80px rgba(255, 77, 166, 0.25);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--pink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* Starfield */
.stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(123, 61, 255, 0.35), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 20%, rgba(255, 77, 166, 0.15), transparent),
    radial-gradient(ellipse 40% 30% at 10% 60%, rgba(80, 40, 180, 0.2), transparent),
    linear-gradient(180deg, #0a0414 0%, #12082a 45%, #0c0618 100%);
}

.stars::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 30% 65%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 70% 15%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 85% 55%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 50% 90%, rgba(255, 255, 255, 0.5), transparent);
  opacity: 0.8;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 2rem;
  max-width: 1280px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
}

.logo-die {
  font-size: 1.75rem;
  filter: drop-shadow(0 0 8px rgba(255, 77, 166, 0.6));
}

.logo-text {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  position: relative;
  padding-bottom: 0.25rem;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--gradient);
  border-radius: 2px;
}

.btn-surprise {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 2px solid rgba(180, 120, 255, 0.6);
  background: rgba(30, 12, 55, 0.6);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.btn-surprise:hover {
  border-color: var(--pink);
  box-shadow: 0 0 20px rgba(255, 77, 166, 0.35);
  transform: translateY(-1px);
}

.header-surprise {
  display: none;
}

@media (min-width: 900px) {
  .header-surprise {
    display: inline-flex;
  }
}

/* Hero */
.hero {
  padding: 2rem 2rem 4rem;
  max-width: 1280px;
  margin: 0 auto;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr 1.05fr;
    gap: 2rem;
  }
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--pink);
  border: 1px solid rgba(255, 77, 166, 0.4);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 77, 166, 0.08);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 28rem;
  margin-bottom: 1.5rem;
}

.btn-play-now {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.2rem;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: 0 12px 40px rgba(255, 45, 135, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-play-now:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 50px rgba(255, 45, 135, 0.55);
  text-decoration: none;
}

.redirect-note {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.redirect-note a {
  color: var(--pink);
}

.ext {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Hero visual / frame */
.hero-visual {
  position: relative;
  text-align: center;
}

.pick-sticker {
  position: absolute;
  top: -0.5rem;
  right: 5%;
  font-family: "Comic Sans MS", "Segoe UI", cursive;
  font-size: 1.35rem;
  color: #fff;
  transform: rotate(8deg);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.frame-glow {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.game-frame {
  position: relative;
  flex: 1;
  max-width: 420px;
  aspect-ratio: 4 / 3;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 3px solid rgba(200, 120, 255, 0.8);
  box-shadow: var(--glow);
  background: linear-gradient(145deg, #1a0a30, #2a1050);
}

.frame-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.frame-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 4rem;
  background: linear-gradient(160deg, #2a1050, #4a2080);
}

.frame-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(12, 6, 24, 0.85);
  color: var(--muted);
  font-size: 0.9rem;
}

.loader-die {
  font-size: 2.5rem;
  animation: bounce 0.8s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.frame-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.frame-arrow:hover {
  background: rgba(255, 77, 166, 0.4);
  transform: scale(1.08);
}

.frame-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.dot.active {
  background: var(--pink);
  box-shadow: 0 0 10px var(--pink);
}

/* Wave */
.wave-divider {
  height: 80px;
  background: var(--bg-mid);
  clip-path: ellipse(120% 100% at 50% 100%);
  margin-top: -1px;
}

/* About */
.about {
  background: var(--bg-mid);
  padding: 3rem 2rem 4rem;
}

.about-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .about-grid {
    grid-template-columns: 1.2fr 0.8fr 1fr;
    align-items: center;
  }
}

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--pink);
  margin-bottom: 0.5rem;
}

.about-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.about-desc {
  color: #c8bddf;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  max-width: 36rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(40, 18, 70, 0.9);
  border: 1px solid var(--card-border);
  color: #d4c4f0;
}

.about-mascot {
  display: flex;
  justify-content: center;
}

.mascot-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 200, 100, 0.3), transparent),
    linear-gradient(145deg, #3d1f6e, #1a0a30);
  display: grid;
  place-items: center;
  font-size: 5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.stats-card {
  background: rgba(12, 6, 28, 0.85);
  border: 1px solid var(--card-border);
  border-radius: 1.25rem;
  padding: 1.25rem 1.5rem;
  backdrop-filter: blur(12px);
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-icon {
  font-size: 1.25rem;
  width: 2rem;
  text-align: center;
}

.stat-row div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 600;
}

/* Love section */
.love {
  padding: 3rem 2rem 2rem;
  max-width: 1280px;
  margin: 0 auto;
}

.section-heading {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--pink);
  margin-bottom: 2rem;
}

.love-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.love-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 1.15rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  backdrop-filter: blur(8px);
  transition: transform 0.2s, border-color 0.2s;
}

.love-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 77, 166, 0.45);
}

.love-icon {
  font-size: 2.25rem;
  display: block;
  margin-bottom: 0.75rem;
}

.love-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.love-card p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.love-trail {
  position: relative;
  height: 48px;
  margin-top: 1.5rem;
  display: none;
}

@media (min-width: 768px) {
  .love-trail {
    display: block;
  }
}

.trail-line {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  border-top: 2px dashed rgba(255, 200, 100, 0.4);
}

.trail-monkey {
  position: absolute;
  left: 45%;
  top: 20%;
  font-size: 1.5rem;
  animation: walk 4s ease-in-out infinite;
}

@keyframes walk {
  0%, 100% { left: 15%; }
  50% { left: 75%; }
}

/* CTA */
.cta-block {
  text-align: center;
  padding: 2rem 2rem 4rem;
  max-width: 640px;
  margin: 0 auto;
}

.cta-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.cta-sub {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.btn-surprise-lg {
  padding: 1rem 2.5rem;
  font-size: 1rem;
  font-weight: 700;
  background: var(--gradient);
  border: none;
  color: #fff;
  box-shadow: 0 12px 36px rgba(255, 45, 135, 0.4);
}

/* Footer */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2rem;
  background: rgba(8, 4, 16, 0.9);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-brand .logo-text {
  display: block;
  margin-top: 0.25rem;
}

.footer-tag {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.social {
  display: flex;
  gap: 0.75rem;
}

.social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--text);
}

.social a:hover {
  background: rgba(255, 77, 166, 0.25);
}

.footer-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-pad {
  font-size: 2rem;
}

/* Error toast */
.error-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(180, 40, 80, 0.95);
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 100;
}

.error-toast button {
  font: inherit;
  font-weight: 700;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  text-decoration: underline;
  margin-left: 0.35rem;
}

/* Games page shared */
.page-header {
  text-align: center;
  padding: 3rem 2rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--muted);
}

.catalog {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 2rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.game-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--glow);
  text-decoration: none;
}

.game-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.game-card .thumb-fallback {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  background: linear-gradient(160deg, #2a1050, #1a0a30);
}

.game-card .card-body {
  padding: 1rem;
}

.game-card h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.game-card p {
  font-size: 0.82rem;
  color: var(--muted);
}

.game-card .play-hint {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pink);
}

.catalog-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--muted);
}
