/* ==========================================================================
   NEONDROME — Arcade Portal
   Aesthetic: retro-futuristic synthwave CRT arcade.
   Single cohesive neon palette (aqua-mint primary + hot magenta accent +
   violet depth + amber highlight) on near-black. System-font typography
   pushed to have character. Zero external requests.
   ========================================================================== */

:root {
  /* ---- surfaces ---- */
  --bg-0:  #04060c;
  --bg-1:  #070a14;
  --bg-2:  #0b1120;
  --panel: rgba(10, 16, 30, 0.62);
  --line:  rgba(43, 245, 200, 0.14);
  --line-strong: rgba(43, 245, 200, 0.34);

  /* ---- neon palette ---- */
  --neon:     #2bf5c8;   /* primary aqua-mint */
  --neon-brt: #a6fff0;
  --neon-dim: rgba(43, 245, 200, 0.55);
  --accent:   #ff2e97;   /* hot magenta */
  --accent-brt:#ff8fc7;
  --violet:   #7c5cff;   /* tertiary depth */
  --violet-brt:#b4a4ff;
  --amber:    #ffd34e;   /* highlight / best score */

  /* ---- ink ---- */
  --ink:      #d6efe9;
  --ink-soft: rgba(214, 239, 233, 0.56);
  --ink-faint:rgba(214, 239, 233, 0.30);

  /* ---- type ---- */
  --display: "Helvetica Neue", "Arial Narrow", "Franklin Gothic Medium",
             "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, "Cascadia Mono",
          "DejaVu Sans Mono", "Roboto Mono", Consolas, monospace;

  --shadow-deep: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- atmospheric backdrop: dual radial glow + perspective grid + grain ---- */
.atmos {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 12% -8%, rgba(43,245,200,0.12), transparent 52%),
    radial-gradient(110% 70% at 92% 6%, rgba(255,46,151,0.10), transparent 55%),
    radial-gradient(120% 90% at 50% 120%, rgba(124,92,255,0.14), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 60%);
}
/* horizon grid floor */
.atmos::before {
  content: "";
  position: absolute; left: -20%; right: -20%; bottom: 0; height: 46vh;
  background-image:
    linear-gradient(rgba(43,245,200,0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43,245,200,0.10) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(40vh) rotateX(66deg);
  transform-origin: bottom center;
  mask-image: linear-gradient(transparent, #000 55%, transparent);
  opacity: 0.5;
  animation: grid-flow 6s linear infinite;
}
@keyframes grid-flow { to { background-position: 0 46px, 0 0; } }

/* scanlines + grain */
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,0.15) 3px);
  mix-blend-mode: multiply; opacity: 0.42;
  animation: scan 9s linear infinite;
}
@keyframes scan { to { background-position: 0 6px; } }

.wrap { position: relative; z-index: 1; }
.shell { width: min(1180px, 92vw); margin: 0 auto; }

/* ==========================================================================
   NAV
   ========================================================================== */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(4,6,12,0.86), rgba(4,6,12,0.4));
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 20px;
}
.logo { display: flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }
.logo .bolt {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: linear-gradient(160deg, rgba(43,245,200,0.16), rgba(255,46,151,0.10));
  box-shadow: inset 0 0 16px rgba(43,245,200,0.16), 0 0 20px -6px rgba(43,245,200,0.5);
}
.logo .bolt svg { width: 17px; height: 17px; filter: drop-shadow(0 0 4px var(--neon)); }
.logo .word {
  font-family: var(--display); font-weight: 800; font-style: italic;
  font-size: 20px; letter-spacing: -0.02em; text-transform: uppercase;
  color: var(--neon-brt); text-shadow: 0 0 14px rgba(43,245,200,0.5);
}
.logo .word b { color: var(--accent); text-shadow: 0 0 14px rgba(255,46,151,0.6); }

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; position: relative;
  padding: 6px 0; transition: color 0.2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--neon); box-shadow: 0 0 8px var(--neon); transition: width 0.28s;
}
.nav-links a:hover { color: var(--neon-brt); }
.nav-links a:hover::after { width: 100%; }

.nav-right { display: flex; align-items: center; gap: 14px; }
.mute-btn {
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  display: grid; place-items: center; color: var(--neon-dim);
  border: 1px solid var(--line); background: rgba(43,245,200,0.04);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.mute-btn:hover { color: var(--neon-brt); border-color: var(--line-strong); }
.mute-btn svg { width: 18px; height: 18px; }
.mute-btn .off { display: none; }
.mute-btn.muted .on { display: none; }
.mute-btn.muted .off { display: block; }

.cta {
  font-family: var(--mono); font-weight: 700; font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase; cursor: pointer;
  color: var(--bg-0); padding: 12px 22px; border: none; border-radius: 999px;
  background: linear-gradient(180deg, var(--neon-brt), var(--neon));
  box-shadow: 0 0 22px rgba(43,245,200,0.5), inset 0 1px 0 rgba(255,255,255,0.6);
  transition: transform 0.14s, box-shadow 0.2s;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 0 34px rgba(43,245,200,0.8), inset 0 1px 0 rgba(255,255,255,0.6); }
.cta:active { transform: translateY(0) scale(0.97); }

.nav-toggle { display: none; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero { position: relative; padding: clamp(48px, 9vh, 110px) 0 clamp(40px, 7vh, 80px); }
.hero-grid {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: center;
}
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 10.5px; letter-spacing: 0.4em; text-transform: uppercase;
  color: var(--neon-dim); margin-bottom: 22px;
  opacity: 0; animation: rise 0.7s 0.05s cubic-bezier(.2,.8,.2,1) forwards;
}
.kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--neon);
  box-shadow: 0 0 10px var(--neon); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.hero h1 {
  font-family: var(--display); font-weight: 800; font-style: italic;
  text-transform: uppercase; letter-spacing: -0.03em; line-height: 0.86;
  font-size: clamp(52px, 11vw, 138px);
  color: var(--neon-brt); text-shadow: 0 0 18px rgba(43,245,200,0.45), 0 0 60px rgba(43,245,200,0.25);
}
.hero h1 .l { display: block; opacity: 0; transform: translateY(28px); }
.hero h1 .l1 { animation: rise 0.8s 0.12s cubic-bezier(.2,.8,.2,1) forwards; }
.hero h1 .l2 { animation: rise 0.8s 0.22s cubic-bezier(.2,.8,.2,1) forwards; }
.hero h1 .glow-a {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(255,46,151,0.55), 0 0 60px rgba(255,46,151,0.3);
  -webkit-text-stroke: 0;
}
.hero h1 .outline {
  color: transparent; -webkit-text-stroke: 2px var(--violet-brt);
  text-shadow: 0 0 30px rgba(124,92,255,0.5);
}

.hero-sub {
  margin: 26px 0 30px; max-width: 46ch; font-size: 14px; line-height: 1.85;
  color: var(--ink-soft);
  opacity: 0; animation: rise 0.8s 0.34s cubic-bezier(.2,.8,.2,1) forwards;
}
.hero-actions {
  display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px;
  opacity: 0; animation: rise 0.8s 0.44s cubic-bezier(.2,.8,.2,1) forwards;
}
.btn {
  font-family: var(--mono); font-weight: 700; font-size: 12px;
  letter-spacing: 0.2em; text-transform: uppercase; cursor: pointer;
  padding: 16px 30px; border-radius: 999px; border: none;
  display: inline-flex; align-items: center; gap: 10px;
  transition: transform 0.14s, box-shadow 0.2s, border-color 0.2s, color 0.2s;
}
.btn.primary {
  color: var(--bg-0);
  background: linear-gradient(180deg, var(--neon-brt), var(--neon));
  box-shadow: 0 0 26px rgba(43,245,200,0.5), inset 0 1px 0 rgba(255,255,255,0.6);
}
.btn.primary:hover { transform: translateY(-3px); box-shadow: 0 0 42px rgba(43,245,200,0.85), inset 0 1px 0 rgba(255,255,255,0.6); }
.btn.ghost {
  color: var(--neon-brt); background: rgba(43,245,200,0.04);
  border: 1px solid var(--line-strong);
}
.btn.ghost:hover { transform: translateY(-3px); border-color: var(--neon); box-shadow: 0 0 26px -6px rgba(43,245,200,0.6); }
.btn:active { transform: translateY(0) scale(0.97); }

.hero-stats {
  display: flex; gap: 30px; flex-wrap: wrap;
  padding-top: 26px; border-top: 1px solid var(--line);
  opacity: 0; animation: rise 0.8s 0.56s cubic-bezier(.2,.8,.2,1) forwards;
}
.hero-stats .stat .n {
  font-family: var(--display); font-weight: 800; font-style: italic;
  font-size: 30px; letter-spacing: -0.02em; color: var(--neon-brt);
  text-shadow: 0 0 16px rgba(43,245,200,0.4); line-height: 1;
}
.hero-stats .stat .n.a { color: var(--accent-brt); text-shadow: 0 0 16px rgba(255,46,151,0.4); }
.hero-stats .stat .n.v { color: var(--violet-brt); text-shadow: 0 0 16px rgba(124,92,255,0.4); }
.hero-stats .stat .k {
  font-size: 9px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ink-soft); margin-top: 8px;
}

/* floating cabinet emblem (right column) */
.hero-visual { position: relative; height: 380px; opacity: 0; animation: rise 1s 0.5s cubic-bezier(.2,.8,.2,1) forwards; }
.float-icon {
  position: absolute; width: 92px; height: 92px; border-radius: 20px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, rgba(11,17,32,0.9), rgba(4,6,12,0.7));
  box-shadow: var(--shadow-deep), inset 0 0 24px rgba(43,245,200,0.06);
  animation: bob 5s ease-in-out infinite;
}
.float-icon svg { width: 44px; height: 44px; }
.float-icon.f1 { top: 6%;  left: 8%;  animation-delay: 0s;   }
.float-icon.f2 { top: 2%;  right: 6%; animation-delay: -1.2s; }
.float-icon.f3 { bottom: 14%; left: 2%; animation-delay: -2.4s; }
.float-icon.f4 { bottom: 4%;  right: 14%; animation-delay: -3.6s; }
.float-icon.core {
  top: 38%; left: 42%; width: 132px; height: 132px; border-radius: 28px;
  border-color: var(--accent); animation-delay: -0.6s;
  box-shadow: var(--shadow-deep), 0 0 50px -8px rgba(255,46,151,0.5), inset 0 0 30px rgba(255,46,151,0.1);
}
.float-icon.core svg { width: 66px; height: 66px; }
@keyframes bob { 50% { transform: translateY(-16px); } }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ==========================================================================
   SECTION HEADING
   ========================================================================== */
.section { padding: clamp(50px, 8vh, 96px) 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 40px; flex-wrap: wrap; }
.sec-head .tag {
  font-size: 10px; letter-spacing: 0.4em; text-transform: uppercase;
  color: var(--accent-brt); margin-bottom: 14px;
}
.sec-head h2 {
  font-family: var(--display); font-weight: 800; font-style: italic;
  text-transform: uppercase; letter-spacing: -0.02em; line-height: 0.92;
  font-size: clamp(34px, 6vw, 66px); color: var(--neon-brt);
  text-shadow: 0 0 18px rgba(43,245,200,0.35);
}
.sec-head .note { max-width: 34ch; font-size: 12px; color: var(--ink-soft); letter-spacing: 0.02em; }

/* ==========================================================================
   GAME CARDS
   ========================================================================== */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  position: relative; border-radius: 18px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel);
  box-shadow: var(--shadow-deep);
  transition: transform 0.28s cubic-bezier(.2,.8,.2,1), border-color 0.28s, box-shadow 0.28s;
  isolation: isolate;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(120% 90% at 50% -20%, rgba(43,245,200,0.12), transparent 55%);
  opacity: 0; transition: opacity 0.3s;
}
.card:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: var(--shadow-deep), 0 0 44px -14px rgba(43,245,200,0.55); }
.card:hover::before { opacity: 1; }
.card-thumb { position: relative; aspect-ratio: 16 / 10; background: radial-gradient(120% 120% at 50% 0%, var(--bg-2), var(--bg-0) 70%); }
.card-thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-thumb .scan { position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,0.16) 3px); opacity: 0.4; }
.card-body { padding: 18px 20px 22px; position: relative; z-index: 3; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-body h3 {
  font-family: var(--display); font-weight: 800; font-style: italic;
  font-size: 26px; letter-spacing: -0.01em; text-transform: uppercase;
  color: var(--neon-brt); text-shadow: 0 0 14px rgba(43,245,200,0.4);
}
.card .cat {
  font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-brt); padding: 5px 10px; border-radius: 999px;
  border: 1px solid rgba(255,46,151,0.3); background: rgba(255,46,151,0.07); white-space: nowrap;
}
.card .desc { font-size: 12px; color: var(--ink-soft); margin-bottom: 16px; min-height: 2.6em; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card .best {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint);
}
.card .best b { color: var(--amber); font-size: 13px; text-shadow: 0 0 10px rgba(255,211,78,0.4); }
.card .play {
  font-family: var(--mono); font-weight: 700; font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--bg-0);
  padding: 10px 20px; border-radius: 999px; border: none; cursor: pointer;
  background: linear-gradient(180deg, var(--neon-brt), var(--neon));
  box-shadow: 0 0 18px rgba(43,245,200,0.4), inset 0 1px 0 rgba(255,255,255,0.6);
  transition: transform 0.14s, box-shadow 0.2s;
}
.card:hover .play { box-shadow: 0 0 30px rgba(43,245,200,0.7), inset 0 1px 0 rgba(255,255,255,0.6); }
.card .play:active { transform: scale(0.95); }

/* accent variants per card */
.card.v-accent .card-thumb .scan { }
.card.v-accent .cat { color: var(--neon-brt); border-color: rgba(43,245,200,0.3); background: rgba(43,245,200,0.07); }
.card.v-violet h3 { color: var(--violet-brt); text-shadow: 0 0 14px rgba(124,92,255,0.45); }
.card.v-violet:hover { box-shadow: var(--shadow-deep), 0 0 44px -14px rgba(124,92,255,0.55); }

/* ==========================================================================
   RANKINGS
   ========================================================================== */
.ranks { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel); }
.rank-row {
  display: grid; grid-template-columns: 46px 1.4fr 1fr auto;
  align-items: center; gap: 16px; padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}
.rank-row:last-child { border-bottom: none; }
.rank-row:hover { background: rgba(43,245,200,0.03); }
.rank-row.head { background: rgba(43,245,200,0.04); }
.rank-row.head span { font-size: 9.5px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--ink-soft); }
.rank-ix {
  font-family: var(--display); font-weight: 800; font-style: italic; font-size: 22px;
  color: var(--violet-brt); text-shadow: 0 0 12px rgba(124,92,255,0.4);
}
.rank-name { display: flex; align-items: center; gap: 12px; }
.rank-name .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(43,245,200,0.05); }
.rank-name .ico svg { width: 20px; height: 20px; }
.rank-name b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 17px;
  text-transform: uppercase; color: var(--neon-brt); letter-spacing: -0.01em; }
.rank-cat { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.rank-score { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 26px;
  color: var(--amber); text-shadow: 0 0 14px rgba(255,211,78,0.4); font-variant-numeric: tabular-nums; }
.rank-score.empty { color: var(--ink-faint); text-shadow: none; }

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.feat {
  border: 1px solid var(--line); border-radius: 16px; padding: 26px; background: var(--panel);
  transition: transform 0.28s, border-color 0.28s;
}
.feat:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.feat .fi { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 18px;
  border: 1px solid var(--line-strong); background: linear-gradient(160deg, rgba(43,245,200,0.14), rgba(124,92,255,0.08));
  box-shadow: inset 0 0 18px rgba(43,245,200,0.1); }
.feat .fi svg { width: 24px; height: 24px; filter: drop-shadow(0 0 5px var(--neon)); }
.feat h4 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 19px;
  text-transform: uppercase; color: var(--neon-brt); margin-bottom: 8px; letter-spacing: -0.01em; }
.feat p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.75; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer { border-top: 1px solid var(--line); padding: 40px 0; margin-top: 30px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer .tiny { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }

/* ==========================================================================
   GAME MODAL
   ========================================================================== */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2,4,9,0.82); backdrop-filter: blur(8px);
  animation: fade 0.3s ease; }
@keyframes fade { from { opacity: 0; } }
.modal-shell {
  position: relative; z-index: 2; width: min(680px, 96vw); max-height: 94vh;
  display: flex; flex-direction: column;
  border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  box-shadow: var(--shadow-deep), 0 0 60px -18px rgba(43,245,200,0.5);
  animation: pop 0.34s cubic-bezier(.2,1.1,.3,1);
}
@keyframes pop { from { opacity: 0; transform: scale(0.94) translateY(12px); } }
.modal-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(43,245,200,0.05), transparent);
}
.modal-bar .mtitle { display: flex; align-items: center; gap: 12px; }
.modal-bar .mtitle .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); background: rgba(43,245,200,0.06); }
.modal-bar .mtitle .ico svg { width: 20px; height: 20px; }
.modal-bar .mtitle b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 20px;
  text-transform: uppercase; color: var(--neon-brt); letter-spacing: -0.01em; text-shadow: 0 0 12px rgba(43,245,200,0.4); }
.modal-bar .mtitle span { font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-soft); display: block; margin-top: 2px; }
.modal-close {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-brt); padding: 9px 14px; border-radius: 9px; cursor: pointer;
  border: 1px solid rgba(255,46,151,0.34); background: rgba(255,46,151,0.07);
  transition: background 0.2s, transform 0.12s;
}
.modal-close:hover { background: rgba(255,46,151,0.16); }
.modal-close:active { transform: scale(0.95); }
.game-root { padding: 18px; overflow: auto; }

/* ==========================================================================
   SHARED GAME UI (used by mounted games)
   ========================================================================== */
.g-hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.g-stats { display: flex; gap: 10px; }
.g-stat { min-width: 78px; padding: 8px 12px; border-radius: 10px; text-align: right;
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(43,245,200,0.05), transparent);
  box-shadow: inset 0 0 14px rgba(43,245,200,0.05); }
.g-stat .l { font-size: 8px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 3px; }
.g-stat .v { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 22px;
  color: var(--neon-brt); text-shadow: 0 0 10px rgba(43,245,200,0.4); font-variant-numeric: tabular-nums; line-height: 1; }
.g-stat.best .v { color: var(--amber); text-shadow: 0 0 10px rgba(255,211,78,0.45); }
.g-stat .v.bump { animation: bump 0.34s cubic-bezier(.3,1.6,.5,1); }
@keyframes bump { 0%{transform:scale(1);} 40%{transform:scale(1.28);} 100%{transform:scale(1);} }

.g-field {
  position: relative; border-radius: 14px; padding: 3px;
  background: linear-gradient(145deg, rgba(43,245,200,0.42), rgba(43,245,200,0.03) 42%, rgba(255,46,151,0.3));
  box-shadow: 0 18px 50px -22px rgba(0,0,0,0.9), 0 0 48px -18px rgba(43,245,200,0.35);
}
.g-field-inner { position: relative; border-radius: 11px; overflow: hidden;
  background: radial-gradient(120% 120% at 50% 0%, var(--bg-2), var(--bg-0) 72%); }
.g-field-inner canvas { display: block; width: 100%; }

.g-overlay {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 22px;
  background: radial-gradient(120% 120% at 50% 42%, rgba(4,6,12,0.5), rgba(4,6,12,0.92));
  backdrop-filter: blur(3px); transition: opacity 0.3s, transform 0.3s;
}
.g-overlay.hidden { opacity: 0; pointer-events: none; transform: scale(1.02); }
.g-otitle { font-family: var(--display); font-style: italic; font-weight: 800; text-transform: uppercase;
  font-size: clamp(28px, 7vw, 46px); letter-spacing: -0.02em; line-height: 0.9; color: var(--neon-brt);
  text-shadow: 0 0 12px rgba(43,245,200,0.5), 0 0 34px rgba(43,245,200,0.3); }
.g-otitle.dead { color: var(--accent-brt); text-shadow: 0 0 12px rgba(255,46,151,0.5), 0 0 34px rgba(255,46,151,0.3); }
.g-otitle.win { color: var(--amber); text-shadow: 0 0 12px rgba(255,211,78,0.5), 0 0 34px rgba(255,211,78,0.3); }
.g-osub { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); max-width: 32ch; line-height: 1.9; }
.g-final { font-size: 12px; letter-spacing: 0.12em; color: var(--ink); }
.g-final b { font-family: var(--display); font-style: italic; color: var(--neon-brt); font-size: 30px; }
.g-btn {
  font-family: var(--mono); font-weight: 700; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bg-0); padding: 14px 30px; border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, var(--neon-brt), var(--neon));
  box-shadow: 0 0 22px rgba(43,245,200,0.5), inset 0 1px 0 rgba(255,255,255,0.6);
  transition: transform 0.14s, box-shadow 0.2s;
}
.g-btn:hover { transform: translateY(-2px); box-shadow: 0 0 34px rgba(43,245,200,0.8), inset 0 1px 0 rgba(255,255,255,0.6); }
.g-btn:active { transform: translateY(0) scale(0.97); }
.g-keys { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.g-key { font-size: 9px; letter-spacing: 0.14em; padding: 5px 9px; border-radius: 6px; color: var(--neon-dim);
  border: 1px solid var(--line); background: rgba(43,245,200,0.04); }

.g-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.g-hint { font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.g-tbtn { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--neon-dim); padding: 9px 16px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(43,245,200,0.04);
  transition: color 0.18s, border-color 0.18s, background 0.18s; }
.g-tbtn:hover { color: var(--neon-brt); border-color: var(--line-strong); background: rgba(43,245,200,0.09); }
.g-tbtn:active { transform: scale(0.96); }

/* d-pad (touch) */
.g-dpad { display: none; justify-content: center; margin-top: 12px; }
.g-dpad-grid { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(3, 56px); gap: 8px; }
.g-dbtn { display: grid; place-items: center; border-radius: 13px; cursor: pointer; user-select: none; color: var(--neon);
  border: 1px solid var(--line-strong); background: linear-gradient(180deg, rgba(43,245,200,0.1), rgba(43,245,200,0.02));
  box-shadow: inset 0 0 16px rgba(43,245,200,0.08); transition: transform 0.08s, background 0.15s; }
.g-dbtn:active, .g-dbtn.hit { background: linear-gradient(180deg, rgba(43,245,200,0.32), rgba(43,245,200,0.1));
  box-shadow: inset 0 0 20px rgba(43,245,200,0.3), 0 0 16px rgba(43,245,200,0.35); transform: scale(0.94); }
.g-dbtn svg { width: 24px; height: 24px; filter: drop-shadow(0 0 5px rgba(43,245,200,0.7)); }
.g-du { grid-area: 1/2; } .g-dl { grid-area: 2/1; } .g-dr { grid-area: 2/3; } .g-dd { grid-area: 3/2; }
.g-dc { grid-area: 2/2; border-style: dashed; border-color: rgba(255,46,151,0.3); color: var(--accent); }
.g-dc svg { filter: drop-shadow(0 0 5px rgba(255,46,151,0.7)); }
@media (hover: none), (max-width: 620px) { .g-dpad.show { display: flex; } .g-hint { display: none; } }

/* ---- 2048 board (DOM tiles) ---- */
.b2048 { position: relative; width: 100%; aspect-ratio: 1/1; }
.b2048 .cellbg { position: absolute; border-radius: 10px; background: rgba(43,245,200,0.05);
  border: 1px solid rgba(43,245,200,0.08); }
.b2048 .tile { position: absolute; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--display); font-style: italic; font-weight: 800; letter-spacing: -0.02em;
  transition: transform 0.12s cubic-bezier(.3,.9,.3,1); will-change: transform; }
.b2048 .tile .tn { text-shadow: 0 0 12px rgba(0,0,0,0.4); }
.b2048 .tile.spawn { animation: t-spawn 0.18s ease; }
.b2048 .tile.merge { animation: t-merge 0.2s cubic-bezier(.3,1.6,.4,1); }
@keyframes t-spawn { from { transform: scale(0.2); } }
@keyframes t-merge { 0%{ } 40%{ transform: scale(1.16);} 100%{ } }

/* ---- memory board ---- */
.memgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
.memcard { position: relative; aspect-ratio: 1/1; cursor: pointer; perspective: 700px; }
.memcard .inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.42s cubic-bezier(.3,.9,.3,1); }
.memcard.flip .inner, .memcard.matched .inner { transform: rotateY(180deg); }
.memcard .face { position: absolute; inset: 0; border-radius: 12px; display: grid; place-items: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.memcard .back {
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, rgba(11,17,32,0.95), rgba(4,6,12,0.8));
  box-shadow: inset 0 0 20px rgba(43,245,200,0.08); }
.memcard .back svg { width: 40%; height: 40%; opacity: 0.4; filter: drop-shadow(0 0 5px var(--neon)); }
.memcard .front { transform: rotateY(180deg);
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, rgba(43,245,200,0.12), rgba(124,92,255,0.08));
  box-shadow: inset 0 0 22px rgba(43,245,200,0.14); }
.memcard .front svg { width: 52%; height: 52%; }
.memcard.matched { cursor: default; }
.memcard.matched .front { border-color: var(--amber); box-shadow: inset 0 0 24px rgba(255,211,78,0.2), 0 0 22px -6px rgba(255,211,78,0.5);
  animation: m-pop 0.4s ease; }
@keyframes m-pop { 40% { transform: scale(1.06); } }
.memcard:hover:not(.matched):not(.flip) .back { border-color: var(--neon); box-shadow: inset 0 0 24px rgba(43,245,200,0.18); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-toggle { display: grid; }
  .rank-row { grid-template-columns: 34px 1fr auto; }
  .rank-cat { display: none; }
  .hero-stats { gap: 22px; }
}
@media (max-width: 420px) {
  .cta { padding: 10px 16px; }
  .g-stat { min-width: 66px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.05ms !important; }
  .kicker, .hero h1 .l, .hero-sub, .hero-actions, .hero-stats, .hero-visual { opacity: 1 !important; transform: none !important; }
}
