:root {
  --bg: #0a0612;
  --ink: #f6f2ff;
  --ink-dim: #b8acd6;
  --violet: #7c3aed;
  --violet-2: #a855f7;
  --hot: #ff3df0;
  --acid: #c8ff3d;
  --cyan: #3df0ff;
  --line: rgba(255,255,255,0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(124,58,237,0.35), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(255,61,240,0.18), transparent 60%),
    radial-gradient(900px 600px at 50% 110%, rgba(61,240,255,0.10), transparent 60%),
    var(--bg);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.04'/></svg>");
  opacity: 0.4;
}

/* ── STAGE ── */
.stage {
  position: relative;
  z-index: 3;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 36px;
  gap: 18px;
  min-height: 0;
}

/* ── TOP BAR ── */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand .logo-img {
  display: block;
  height: 56px;
  width: auto;
}

.brand .divider {
  width: 1px;
  height: 32px;
  background: var(--line);
  margin: 0 6px;
}

.brand .tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.live {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.03);
}

.live .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 12px var(--acid);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  50% { opacity: 0.4; }
}

/* ── HEADLINE ── */
.headline {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: end;
  padding: 4px 4px 8px;
}

.headline h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(44px, 5.4vw, 86px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}

.headline h1 .stroke {
  -webkit-text-stroke: 2px var(--ink);
  color: transparent;
  font-style: italic;
  font-family: 'Bricolage Grotesque', serif;
}

.headline h1 .grad {
  background: linear-gradient(95deg, var(--hot), var(--violet-2), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.headline .sub {
  color: var(--ink-dim);
  font-size: 17px;
  line-height: 1.5;
  max-width: 460px;
  padding-bottom: 8px;
}

.headline .sub strong {
  color: var(--ink);
  font-weight: 600;
}

/* ── GAME GRID ── */
.games {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  min-height: 0;
}

.game {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(20,12,38,0.5);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  min-height: 0;
  text-decoration: none;
  color: inherit;
}

.game:hover {
  transform: translateY(-6px);
  border-color: rgba(168,85,247,0.6);
  box-shadow: 0 30px 80px -30px rgba(168,85,247,0.5);
}

.game:hover .play {
  transform: scale(1);
  opacity: 1;
}

.game .num {
  position: absolute;
  top: 14px;
  left: 18px;
  z-index: 3;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 0 8px rgba(0,0,0,0.6);
}

.game .difficulty {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 3;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.45);
  letter-spacing: 0.1em;
}

.game .visual {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
  border-bottom: 1px solid var(--line);
}

.game .play {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 3;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ink);
  color: #0a0612;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  transform: scale(0.85);
  opacity: 0.85;
  transition: all .25s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.game .body {
  padding: 16px 22px 20px;
}

.game .kind {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--violet-2);
}

.game h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 6px 0 8px;
}

.game p {
  font-size: 14px;
  color: var(--ink-dim);
  line-height: 1.5;
  margin: 0;
}

/* ── GAME 1 — Dodge ── */
.vis-dodge {
  background: linear-gradient(180deg, #6e9bd0 0%, #a8b8d0 100%);
}

.vis-dodge .silhouette {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 55%;
  aspect-ratio: 1;
  border-radius: 50% 50% 40% 40%;
  background:
    radial-gradient(circle at 50% 38%, #2a1f12 0 30%, transparent 31%),
    linear-gradient(180deg, #3a2616 0%, #1d130a 100%);
}

.vis-dodge .silhouette::before {
  content: "";
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  height: 30%;
  background: #1a1208;
  border-radius: 50% 50% 0 0;
}

.vis-dodge .cube {
  position: absolute;
  width: 56px;
  height: 56px;
  border: 3px solid var(--hot);
  box-shadow: 0 0 24px var(--hot);
  animation: float 3s ease-in-out infinite;
}

.vis-dodge .c1 { top: 22%; left: 16%; transform: rotate(20deg); }
.vis-dodge .c2 { top: 14%; right: 20%; transform: rotate(-15deg); animation-delay: 0.6s; width: 40px; height: 40px; border-color: var(--cyan); box-shadow: 0 0 24px var(--cyan); }
.vis-dodge .c3 { top: 42%; left: 60%; transform: rotate(35deg); width: 32px; height: 32px; animation-delay: 1.2s; border-color: var(--acid); box-shadow: 0 0 18px var(--acid); }

@keyframes float {
  50% { transform: translateY(-12px) rotate(45deg); }
}

/* ── GAME 2 — Fruit ── */
.vis-fruit {
  background: linear-gradient(180deg, #1a0f2e 0%, #2d1854 100%);
  position: relative;
}

.vis-fruit .fruit {
  position: absolute;
  border-radius: 50%;
  box-shadow: inset -10px -10px 24px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
}

.vis-fruit .f1 { width: 80px; height: 80px; background: radial-gradient(circle at 35% 30%, #ff6b3d, #c8331c); top: 50%; left: 16%; animation: arc1 4s ease-in-out infinite; }
.vis-fruit .f2 { width: 64px; height: 64px; background: radial-gradient(circle at 35% 30%, #c8ff6b, #5a8a1c); top: 25%; left: 48%; animation: arc1 4s ease-in-out infinite; animation-delay: 1.5s; }
.vis-fruit .f3 { width: 70px; height: 70px; background: radial-gradient(circle at 35% 30%, #ff5fb5, #8a1e5c); top: 42%; right: 14%; animation: arc1 4s ease-in-out infinite; animation-delay: 2.8s; }

@keyframes arc1 {
  50% { transform: translateY(-30px) rotate(180deg); }
  100% { transform: translateY(0) rotate(360deg); }
}

.vis-fruit .slice {
  position: absolute;
  height: 3px;
  background: linear-gradient(90deg, transparent, white, transparent);
  box-shadow: 0 0 18px white;
  transform: rotate(-25deg);
  top: 40%;
  left: 8%;
  right: 8%;
  animation: slash 3s ease-in-out infinite;
}

@keyframes slash {
  0%, 70% { opacity: 0; transform: rotate(-25deg) scaleX(0); }
  75%      { opacity: 1; transform: rotate(-25deg) scaleX(1); }
  100%     { opacity: 0; transform: rotate(-25deg) scaleX(1); }
}

.vis-fruit .hand {
  position: absolute;
  bottom: 14px;
  left: 18px;
  font-size: 64px;
  transform: rotate(-20deg);
}

/* ── GAME 3 — Puzzle ── */
.vis-puzzle {
  background: linear-gradient(180deg, #6890b8 0%, #b0c8d8 100%);
  display: grid;
  place-items: center;
  padding: 24px;
}

.vis-puzzle .grid-wrap {
  width: min(75%, 240px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  background: rgba(0,0,0,0.2);
  padding: 4px;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.vis-puzzle .tile {
  background: linear-gradient(135deg, #d4a888 0%, #b88560 100%);
  border-radius: 4px;
}

.vis-puzzle .tile.dragging {
  transform: translate(8px, -6px) rotate(-3deg);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  z-index: 2;
}

/* ── FOOTER STRIP ── */
.footer-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 4px;
  border-top: 1px solid var(--line);
}

.footer-strip .hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
}

.footer-strip .arrow-up {
  color: var(--violet-2);
  font-size: 10px;
}

.footer-strip .talk {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  transition: background .2s, border-color .2s;
}

.footer-strip .talk:hover {
  background: rgba(124,58,237,0.15);
  border-color: var(--violet-2);
}

.footer-strip .talk .arrow {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--violet);
  display: grid;
  place-items: center;
  font-size: 12px;
}

/* ── MODAL ── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(5,3,12,0.85);
  backdrop-filter: blur(20px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.modal-bg.open { display: flex; }

.modal {
  width: 100%;
  max-width: 720px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(500px 300px at 100% 0%, rgba(124,58,237,0.3), transparent 60%),
    rgba(20,12,38,0.95);
  padding: 40px;
  text-align: center;
  position: relative;
}

.modal .close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
}

.modal .icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 36px;
  background: linear-gradient(135deg, var(--violet), var(--hot));
  box-shadow: 0 0 40px rgba(168,85,247,0.5);
}

.modal h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 44px;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 16px;
}

.modal p {
  color: var(--ink-dim);
  font-size: 17px;
  line-height: 1.55;
  margin: 0 auto 28px;
  max-width: 480px;
}

.modal .actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.modal .btn-p {
  background: var(--ink);
  color: #0a0612;
  border: 0;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.modal .btn-p .arrow {
  background: var(--violet);
  color: var(--ink);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.modal .btn-g {
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .games { grid-template-columns: 1fr; }
  body, html { overflow: auto; }
  .stage { height: auto; min-height: 100vh; }
}
