:root {
  --bg: #130b23;
  --gold: #ffca42;
  --coral: #ff8b42;
  --aqua: #7ce8ff;
  --pink: #ff8ad8;
  --text: #fffaf1;
  --muted: #f0e5ff;
  --ink: #3f1a10;
  --shadow: 0 18px 40px rgba(19, 11, 35, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  background:
    radial-gradient(circle at top, rgba(127, 76, 255, 0.35), transparent 34%),
    linear-gradient(180deg, #3e1782 0%, #130b23 100%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: "Bubblegum Sans", cursive;
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
}

.play-shell {
  width: min(1100px, calc(100% - 24px));
  margin: 0 auto;
}

.play-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 8px;
}

.play-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Bubblegum Sans", cursive;
  font-size: 1.35rem;
}

.play-brand img { width: 44px; height: 44px; }

.play-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-weight: 700;
  color: var(--muted);
}

.btn, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

.btn {
  background: linear-gradient(135deg, var(--gold), var(--coral));
  color: var(--ink);
  box-shadow: 0 12px 24px rgba(255, 202, 66, 0.25);
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  color: white;
}

.game-stage {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: #0a3a4a;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.12);
  aspect-ratio: 16 / 10;
  max-height: min(72vh, 720px);
}

.game-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.hud {
  position: absolute;
  inset: 12px 12px auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
  z-index: 3;
}

.hud-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(13, 9, 26, 0.62);
  border: 1px solid rgba(255,255,255,0.14);
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 7, 28, 0.55);
  z-index: 4;
}

.overlay[hidden] { display: none; }

.overlay-card {
  width: min(520px, 100%);
  text-align: center;
  padding: 28px 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: var(--shadow);
}

.overlay-card p { color: var(--muted); }

.overlay-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.stars { font-size: 2rem; letter-spacing: 0.2em; color: var(--gold); margin: 10px 0; }

.keep-prize {
  margin: 16px auto 0;
  width: min(220px, 100%);
  padding: 12px;
  border-radius: 18px;
  background: rgba(13, 9, 26, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.keep-prize img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin: 0 auto 8px;
}

.keep-serial {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: #fff3cc !important;
}

.keeps-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.keep-card {
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  text-align: center;
}

.keep-card img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin: 0 auto 8px;
}

.keep-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.keep-card span {
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  color: #fff3cc;
}

.keeps-empty { color: var(--muted); }

.kicker {
  color: var(--aqua);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.series-grid, .game-grid {
  display: grid;
  gap: 16px;
}

.series-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.game-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.tile {
  display: block;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  min-height: 44px;
}

.tile-art {
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 30% 20%, rgba(124,232,255,0.35), transparent 40%),
    linear-gradient(180deg, #2a7d8c, #74c0e3 55%, #f6e5b1);
}

.tile-art img { width: 100%; height: 100%; object-fit: cover; }

.tile-body { padding: 14px; }
.tile-body p { margin: 8px 0 0; color: var(--muted); }
.tile.soon { opacity: 0.72; }

.coming {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff3cc;
}

@media (max-width: 800px) {
  .series-grid { grid-template-columns: 1fr; }
  .game-stage { aspect-ratio: 3 / 4; max-height: 78vh; }
}
