/* =========================================================
   FULL PAGE BACKGROUND FIX (prevents "boxed" look)
   ========================================================= */
html, body {
  height: 100%;
  margin: 0;
  background: #0f1317;
  overflow-x: hidden;   /* prevent horizontal scroll from board on narrow viewports */
}
body{
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(88,255,160,.10), transparent 55%),
    radial-gradient(900px 700px at 90% 20%, rgba(180,107,255,.10), transparent 55%),
    linear-gradient(180deg, #0b0f13, #0f1317);
}

/* =========================================================
   Grow 4096 — v2 (scoped, mobile-first, tile-label fixed)
   ========================================================= */

.grow4096{
  --outer-bg: #0f1317;
  --outer-glow-1: rgba(88,255,160,.10);
  --outer-glow-2: rgba(180,107,255,.10);

  --bg0:#08110b;
  --bg1:#0f1a12;
  --text:#d8ffe0;
  --muted:rgba(216,255,224,.72);

  --gap:12px;
  --radius:18px;
  --cell:86px;

  /* Tile label sizing — driven entirely by --cell so it always fits */
  --tile-emoji-size: calc(var(--cell) * 0.30);
  --tile-name-size:  calc(var(--cell) * 0.13);

  color: var(--text);
  overscroll-behavior: none;
  position: relative;
  width: 100%;
  padding: 28px 16px;
  background:
    radial-gradient(1200px 800px at 20% 10%, var(--outer-glow-1), transparent 55%),
    radial-gradient(900px 700px at 90% 20%, var(--outer-glow-2), transparent 55%),
    linear-gradient(180deg, #0b0f13, var(--outer-bg));
}

.grow4096 *{ box-sizing:border-box; }

/* ── App surface ── */
.grow4096 .g-app{
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 16px 24px;
  border-radius: 22px;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(88,255,160,.10), transparent 55%),
    radial-gradient(900px 700px at 90% 20%, rgba(180,107,255,.10), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  border: 1px solid rgba(216,255,224,.12);
  box-shadow: 0 30px 90px rgba(0,0,0,.22);
}

/* ── Header ── */
.grow4096 .g-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  background: rgba(10,18,12,.42);
  border: 1px solid rgba(216,255,224,.10);
  border-radius: 18px;
  padding: 12px 14px;
  margin-bottom: 14px;
  backdrop-filter: blur(8px);
}

.grow4096 .g-brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  flex:1 1 auto;
}

.grow4096 .g-logo{
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  width:120px;
}
.grow4096 .g-logo img{
  width:100%;
  height:auto;
  object-fit:contain;
  display:block;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.35));
}

.grow4096 .g-title h1{
  margin:0;
  font-size:clamp(18px, 3vw, 28px);
  letter-spacing:.2px;
}
.grow4096 .g-title p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:12px;
  line-height:1.3;
}

/* HUD — pills + buttons always wrap cleanly on small screens */
.grow4096 .g-hud{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
  flex:0 0 auto;
}

.grow4096 .g-pill{
  background: rgba(10,18,12,.65);
  border:1px solid rgba(216,255,224,.14);
  padding:8px 12px;
  border-radius:999px;
  font-weight:800;
  font-size:13px;
  white-space:nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  backdrop-filter: blur(6px);
}

/* Move-counter pill (same style, labelled) */
.grow4096 .g-pill-moves{
  background: rgba(10,18,12,.65);
  border:1px solid rgba(180,107,255,.22);
  padding:8px 12px;
  border-radius:999px;
  font-weight:800;
  font-size:13px;
  white-space:nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  backdrop-filter: blur(6px);
  color: rgba(216,200,255,.90);
}

.grow4096 .g-btn{
  appearance:none;
  border:1px solid rgba(216,255,224,.20);
  background: linear-gradient(180deg, rgba(38,96,58,.9), rgba(22,56,34,.9));
  color:var(--text);
  padding:9px 13px;
  border-radius:14px;
  font-weight:900;
  font-size:13px;
  cursor:pointer;
  white-space:nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.26);
  transition: transform .10s ease, filter .10s ease, box-shadow .10s ease;
}
.grow4096 .g-btn:hover{
  filter:brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0,0,0,.32);
}
.grow4096 .g-btn:active{ transform: translateY(0) scale(.98); }

.grow4096 .g-btn-primary{
  background: linear-gradient(180deg, rgba(118,255,178,.95), rgba(42,150,88,.92));
  color:#06110b;
  border-color: rgba(255,255,255,.18);
}
.grow4096 .g-btn-ghost{
  background: rgba(10,18,12,.38);
  border-color: rgba(216,255,224,.14);
}

/* Undo button — amber accent */
.grow4096 .g-btn-undo{
  background: linear-gradient(180deg, rgba(255,200,80,.20), rgba(180,120,10,.22));
  border-color: rgba(255,200,80,.30);
  color: rgba(255,220,120,1);
}
.grow4096 .g-btn-undo:disabled{
  opacity:.35;
  cursor:not-allowed;
  transform:none !important;
  filter:none !important;
}

/* ── Layout ── */
.grow4096 .g-layout{
  display:grid;
  grid-template-columns: 1fr 320px;
  gap:14px;
}
@media (max-width: 900px){
  .grow4096 .g-layout{ grid-template-columns: 1fr; }
}

/* ── Cards ── */
.grow4096 .g-card{
  background: linear-gradient(180deg, rgba(19,33,23,.92), rgba(11,20,14,.92));
  border:1px solid rgba(216,255,224,.12);
  border-radius: var(--radius);
  box-shadow: 0 20px 70px rgba(0,0,0,.22);
  backdrop-filter: blur(8px);
}

.grow4096 .g-boardShell{
  padding:14px;
  display:flex;
  flex-direction:column;
  align-items:center;
}

.grow4096 .g-boardWrap{
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
}

/* ── Board ── */
.grow4096 .g-board{
  position:relative;
  /* Board is exactly 4 cells + 3 gaps wide, plus 1px padding on each side */
  width:  calc(var(--cell)*4 + var(--gap)*3 + 2px);
  height: calc(var(--cell)*4 + var(--gap)*3 + 2px);
  border-radius: calc(var(--radius) - 4px);
  background: rgba(20,36,24,.75);
  overflow:hidden;
  touch-action: none;
  padding: 1px;   /* thin inner border feel */
}

.grow4096 .g-bgGrid{
  position:absolute;
  inset:1px;                            /* match board padding */
  display:grid;
  grid-template-columns: repeat(4, var(--cell));
  grid-template-rows:    repeat(4, var(--cell));
  gap: var(--gap);
}

.grow4096 .g-bgCell{
  background: rgba(12,21,14,.40);
  border-radius:14px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.04),
    inset 0 -10px 24px rgba(0,0,0,.22);
}

.grow4096 .g-tiles{ position:absolute; inset:1px; }  /* match board padding */

/* ── Tiles ── */
.grow4096 .g-tile{
  position:absolute;
  width: var(--cell);
  height: var(--cell);
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  user-select:none;
  overflow:hidden;            /* clips label if something still overflows */

  transform: translate(
    calc(var(--c) * (var(--cell) + var(--gap))),
    calc(var(--r) * (var(--cell) + var(--gap)))
  );

  /* ✅ ANIMATION FIX: spring-like cubic-bezier, slightly longer for smoothness */
  transition: transform 160ms cubic-bezier(.25,.85,.25,1.05);
  will-change: transform;

  box-shadow:
    0 10px 26px rgba(0,0,0,.32),
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 0 0 1px rgba(255,255,255,.05);
}

/* =========================================================
   TILE LABEL — vertical stack (emoji on top, name below)
   This prevents the emoji+name from overflowing the tile.
   ========================================================= */
.grow4096 .g-tileLabel{
  display: flex;
  flex-direction: column;      /* ← stack vertically */
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 100%;
  padding: 6px 4px;
  text-align: center;
  line-height: 1;
  pointer-events:none;
}

.grow4096 .g-tileLabel .g-emoji{
  /* Clamp: never smaller than 14px, never bigger than 38px */
  font-size: clamp(14px, var(--tile-emoji-size), 38px);
  line-height: 1;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.40));
}

.grow4096 .g-tileLabel .g-name{
  font-size: clamp(8px, var(--tile-name-size), 15px);
  font-weight: 800;
  letter-spacing: .1px;
  line-height: 1.1;
  /* Allow 2 lines on large tiles, truncate on tiny cells */
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 90%;
  text-shadow: 0 1px 4px rgba(0,0,0,.28);
}

/* =========================================================
   ANIMATIONS — fixed so translate is preserved during keyframes
   ========================================================= */

/* Spawn: pop in from 0.75 scale */
.grow4096 .g-spawn{
  animation: g-pop 180ms cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes g-pop{
  0%{
    transform: translate(
      calc(var(--c) * (var(--cell) + var(--gap))),
      calc(var(--r) * (var(--cell) + var(--gap)))
    ) scale(0.75);
    opacity: 0.6;
  }
  100%{
    transform: translate(
      calc(var(--c) * (var(--cell) + var(--gap))),
      calc(var(--r) * (var(--cell) + var(--gap)))
    ) scale(1);
    opacity: 1;
  }
}

/* Merge: springy bump — overshoots then settles */
.grow4096 .g-merge{
  animation: g-bump 220ms cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes g-bump{
  0%{
    transform: translate(
      calc(var(--c) * (var(--cell) + var(--gap))),
      calc(var(--r) * (var(--cell) + var(--gap)))
    ) scale(1);
  }
  45%{
    transform: translate(
      calc(var(--c) * (var(--cell) + var(--gap))),
      calc(var(--r) * (var(--cell) + var(--gap)))
    ) scale(1.18);
  }
  100%{
    transform: translate(
      calc(var(--c) * (var(--cell) + var(--gap))),
      calc(var(--r) * (var(--cell) + var(--gap)))
    ) scale(1);
  }
}

/* ── Overlay (Game Over / Win) ── */
.grow4096 .g-overlay{
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(12px);
  z-index: 50;
  border-radius: inherit;
}
.grow4096 .g-overlay.show{ display: flex; }

.grow4096 .g-overlayCard{
  width: min(340px, 92%);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(17,26,19,.96), rgba(9,14,10,.94));
  border: 1px solid rgba(216,255,224,.18);
  box-shadow: 0 24px 80px rgba(0,0,0,.70);
  text-align: center;
}
.grow4096 .g-overlayTitle{
  font-weight: 950;
  font-size: 17px;
  margin-bottom: 6px;
}
.grow4096 .g-overlayMsg{
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 12px;
}
.grow4096 .g-overlayActions{
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Hint bar ── */
.grow4096 .g-hint{
  margin-top:10px;
  text-align:center;
  color:var(--muted);
  font-size:12px;
}
.grow4096 .g-kbd{
  display:inline-block;
  padding:2px 7px;
  border-radius:999px;
  border:1px solid rgba(216,255,224,.18);
  background: rgba(10,18,12,.5);
  font-weight:800;
  font-size:11px;
  margin: 0 2px;
}

/* ── Leaderboard / Sidebar ── */
.grow4096 .g-leaderboard{ padding:14px; display:flex; flex-direction:column; gap:0; }
.grow4096 .g-leaderTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:0;
}
.grow4096 .g-leaderTop h2{ margin:0; font-size:16px; }

.grow4096 .g-lbMeta{
  margin:8px 0 10px;
  color:var(--muted);
  font-size:12px;
}

.grow4096 .g-lbList{
  margin:0;
  padding:0;
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.grow4096 .g-lbList li{
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px 10px;
  border-radius:12px;
  background: rgba(12,18,14,.42);
  border:1px solid rgba(216,255,224,.10);
}
.grow4096 .g-lbRank{
  flex: 0 0 20px;
  font-size:12px;
  font-weight:900;
  color:var(--muted);
  text-align:center;
}
.grow4096 .g-lbName{
  flex:1;
  font-weight:800;
  font-size:13px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.grow4096 .g-lbScore{ font-weight:950; font-size:13px; white-space:nowrap; }

.grow4096 .g-lbEmpty{
  margin-top:10px;
  color:var(--muted);
  font-size:13px;
}

.grow4096 .g-lbTools{
  margin-top:12px;
  display:flex;
  justify-content:flex-end;
}

/* ── Move history panel ── */
.grow4096 .g-moveHistory{
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid rgba(216,255,224,.08);
}
.grow4096 .g-moveHistoryTitle{
  font-size:13px;
  font-weight:900;
  color:var(--muted);
  margin-bottom:8px;
}
.grow4096 .g-moveList{
  display:flex;
  flex-direction:column;
  gap:5px;
}
.grow4096 .g-moveItem{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:5px 8px;
  border-radius:10px;
  background: rgba(10,16,12,.38);
  border:1px solid rgba(216,255,224,.07);
  font-size:12px;
  color:var(--muted);
  gap:8px;
}
.grow4096 .g-moveItem:first-child{
  border-color: rgba(118,255,178,.20);
  color:var(--text);
}
.grow4096 .g-moveDir{
  font-weight:900;
  font-size:14px;
  flex:0 0 auto;
}
.grow4096 .g-moveScore{
  font-weight:800;
  flex:1;
  text-align:right;
}
.grow4096 .g-moveDelta{
  font-size:11px;
  color: rgba(118,255,178,.80);
  flex:0 0 auto;
  min-width:32px;
  text-align:right;
}

/* ── Modals ── */
.grow4096 .g-modal{ position:fixed; inset:0; display:none; z-index:9999; }
.grow4096 .g-modal.show{ display:flex; align-items:center; justify-content:center; }
.grow4096 .g-modalBackdrop{ position:absolute; inset:0; background: rgba(0,0,0,.62); backdrop-filter: blur(12px); }
.grow4096 .g-modalCard{
  position:relative;
  width:min(440px, 92vw);
  background: linear-gradient(180deg, rgba(17,26,19,.96), rgba(9,14,10,.94));
  border:1px solid rgba(216,255,224,.18);
  border-radius:18px;
  box-shadow: 0 28px 90px rgba(0,0,0,.75);
  padding:16px;
  max-height: 88vh;
  overflow:auto;
}
.grow4096 .g-modalHeader{ display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:12px; }
.grow4096 .g-modalHeader h3{ margin:0; font-size:17px; }

.grow4096 .g-iconBtn{
  border:1px solid rgba(216,255,224,.18);
  background: rgba(10,18,12,.4);
  color:var(--text);
  border-radius:12px;
  width:36px; height:36px;
  cursor:pointer;
  font-weight:950;
  font-size:14px;
  display:flex; align-items:center; justify-content:center;
}
.grow4096 .g-iconBtn-sm{ width:32px; height:32px; font-size:13px; }

.grow4096 .g-form{ display:flex; flex-direction:column; gap:12px; }
.grow4096 .g-label{ display:flex; flex-direction:column; gap:6px; font-weight:850; font-size:13px; }
.grow4096 .g-input{
  width:100%;
  padding:11px 12px;
  border-radius:13px;
  border:1px solid rgba(216,255,224,.18);
  background: rgba(8,14,10,.65);
  color:var(--text);
  outline:none;
  font-size:15px;
  transition: border-color .15s, box-shadow .15s;
}
.grow4096 .g-input:focus{
  border-color: rgba(118,255,178,.55);
  box-shadow: 0 0 0 3px rgba(118,255,178,.12);
}
.grow4096 .g-formRow{ display:flex; justify-content:space-between; align-items:center; gap:10px; color:var(--muted); font-size:13px; }
.grow4096 .g-scorePreview{ font-weight:950; color:var(--text); }
.grow4096 .g-actions{ display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; }
.grow4096 .g-note{ color:var(--muted); font-size:12px; line-height:1.35; min-height:16px; }
.grow4096 .g-eventBody{ color: var(--muted); font-size: 14px; line-height: 1.5; padding: 4px 0 12px; }

/* ── Debug Remote ── */
.grow4096 .g-debug{
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(340px, calc(100vw - 24px));
  background: linear-gradient(180deg, rgba(17,26,19,.96), rgba(9,14,10,.94));
  border: 1px solid rgba(216,255,224,.18);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
  padding: 12px;
  z-index: 9998;
  display: none;
}
.grow4096 .g-debug.show{ display:block; }
.grow4096 .g-debugHeader{ display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:10px; }
.grow4096 .g-debugTitle{ font-weight:950; letter-spacing:.2px; font-size:14px; }
.grow4096 .g-debugRow{ margin-bottom:10px; }
.grow4096 .g-label-sm{ font-size:12px; }
.grow4096 .g-input-sm{ padding:9px 10px; border-radius:12px; font-size:13px; }
.grow4096 .g-debugActions{ display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; }
.grow4096 .g-debugHint{ margin-top: 6px; font-size: 11px; color: var(--muted); }

/* ── Responsive ── */
@media (max-width: 900px){
  .grow4096 .g-layout{ grid-template-columns: 1fr; }
}

@media (max-width: 600px){
  .grow4096{ padding: 14px 8px; }
  .grow4096 .g-app{ padding: 12px 10px 16px; border-radius: 16px; }
  .grow4096 .g-header{ padding: 10px 12px; gap:10px; }
  .grow4096 .g-logo{ width:115px; }
  .grow4096 .g-title h1{ font-size:18px; }
  .grow4096 .g-title p{ display:none; }
  .grow4096 .g-hud{ gap:6px; }
  .grow4096 .g-pill, .grow4096 .g-pill-moves{ padding:7px 10px; font-size:12px; }
  .grow4096 .g-btn{ padding:8px 10px; font-size:12px; }
  .grow4096 .g-hint{ display:none; }   /* redundant on touch devices */
  .grow4096 .g-debug{ right: 10px; bottom: 10px; }

  /* Tighter tile labels on small phones */
  .grow4096{
    --tile-emoji-size: calc(var(--cell) * 0.28);
    --tile-name-size:  calc(var(--cell) * 0.12);
  }
}

/* ── Board fits phones 390–460px wide + HUD fix ── */
/* Available ≈ vw − 64px (outer + app + shell padding).           */
/* cell=74 gap=10 → board = 4×74 + 3×10 + 2 = 328px, safe at 392px+ */
@media (max-width: 460px){
  .grow4096{
    --cell: 74px;
    --gap:  10px;
  }

  /* HUD: force its own full-width row so pills + buttons wrap cleanly.
     Row 1: [Scor] [Record] [Mutări] [↩ Anulează]
     Row 2: [Restart]   ← isolated so it can't be tapped by accident
     "Trimite scorul" is hidden here — it's always available in the game-over overlay. */
  .grow4096 .g-hud{
    width: 100%;
    justify-content: flex-end;
    column-gap: 6px;
    row-gap: 10px;
  }
  .grow4096 #g-submit{ display: none; }
}

/* ── Board fits phones 360–389px wide ── */
/* cell=66 gap=8 → board = 4×66 + 3×8 + 2 = 290px, safe at 354px+ */
@media (max-width: 389px){
  .grow4096{
    --cell: 66px;
    --gap:  8px;
  }
  .grow4096 .g-logo{ width:80px; }
  .grow4096 .g-title h1{ font-size:15px; }
}

/* ── Very small phones (< 360px) ── */
@media (max-width: 359px){
  .grow4096{
    --cell: 60px;
    --gap:  7px;
  }
  .grow4096 .g-app{ padding: 8px 6px 12px; }
  .grow4096 .g-boardShell{ padding: 10px; }
}

@media (prefers-reduced-motion: reduce){
  .grow4096 .g-btn,
  .grow4096 .g-tile{ transition:none !important; }
  .grow4096 .g-spawn,
  .grow4096 .g-merge{ animation:none !important; }
}

/* =========================================================
   v3 additions: particles canvas, progress bar, fact ticker,
   tile glow, win confetti
   ========================================================= */

/* ── Particle canvas — sits over the board, pointer-events off ── */
.grow4096 .g-particles{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  border-radius: inherit;
}

/* ── Tile glow — added via JS data-tier attribute ── */
.grow4096 .g-tile[data-tier="low"]   { box-shadow: 0 8px 22px rgba(0,0,0,.30), 0 0 0 1px rgba(255,255,255,.05); }
.grow4096 .g-tile[data-tier="mid"]   { box-shadow: 0 10px 28px rgba(255,212,80,.18),  0 0 14px rgba(255,212,80,.12),  inset 0 1px 0 rgba(255,255,255,.12); }
.grow4096 .g-tile[data-tier="high"]  { box-shadow: 0 10px 32px rgba(255,140,80,.22),  0 0 20px rgba(255,140,80,.18),  inset 0 1px 0 rgba(255,255,255,.14); }
.grow4096 .g-tile[data-tier="ultra"] { box-shadow: 0 12px 40px rgba(180,107,255,.35), 0 0 28px rgba(180,107,255,.28), inset 0 1px 0 rgba(255,255,255,.18); }

/* Glow pulse on merge */
.grow4096 .g-tile.g-merge[data-tier="mid"]  { animation: g-bump 220ms cubic-bezier(.34,1.56,.64,1) both, g-glow-mid  280ms ease-out both; }
.grow4096 .g-tile.g-merge[data-tier="high"] { animation: g-bump 220ms cubic-bezier(.34,1.56,.64,1) both, g-glow-high 280ms ease-out both; }
.grow4096 .g-tile.g-merge[data-tier="ultra"]{ animation: g-bump 220ms cubic-bezier(.34,1.56,.64,1) both, g-glow-ultra 300ms ease-out both; }

@keyframes g-glow-mid{
  0%  { filter: brightness(1.35) saturate(1.4); }
  100%{ filter: brightness(1)    saturate(1);   }
}
@keyframes g-glow-high{
  0%  { filter: brightness(1.50) saturate(1.6); }
  100%{ filter: brightness(1)    saturate(1);   }
}
@keyframes g-glow-ultra{
  0%  { filter: brightness(1.70) saturate(1.8); }
  100%{ filter: brightness(1)    saturate(1);   }
}

/* ── Stage progress bar ── */
.grow4096 .g-progress{
  width: 100%;
  max-width: calc(var(--cell)*4 + var(--gap)*3 + 2px);
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(10,18,12,.55);
  border: 1px solid rgba(216,255,224,.10);
  backdrop-filter: blur(6px);
}

.grow4096 .g-progressHeader{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}

.grow4096 .g-progressLabel{
  font-weight: 900;
  font-size: 13px;
  color: var(--text);
}

.grow4096 .g-progressNext{
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grow4096 .g-progressTrack{
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(216,255,224,.08);
  overflow: hidden;
  position: relative;
}

.grow4096 .g-progressFill{
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3a7548, #76ffb2, #b46bff);
  background-size: 200% 100%;
  background-position: 0% 0%;
  transition: width 400ms cubic-bezier(.25,.85,.25,1.05), background-position 600ms ease;
  position: relative;
}

/* Shimmer on the fill */
.grow4096 .g-progressFill::after{
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.22) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: g-shimmer 2.2s linear infinite;
  border-radius: inherit;
}
@keyframes g-shimmer{
  0%  { background-position: -100% 0; }
  100%{ background-position:  200% 0; }
}

/* Stage dot indicators below the track */
.grow4096 .g-progressStages{
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  gap: 2px;
}

.grow4096 .g-progressDot{
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(216,255,224,.15);
  transition: background 300ms, transform 300ms;
  flex: 0 0 auto;
  cursor: default;
  position: relative;
}
.grow4096 .g-progressDot.reached{
  background: rgba(118,255,178,.70);
  transform: scale(1.25);
}
.grow4096 .g-progressDot.current{
  background: #76ffb2;
  box-shadow: 0 0 6px rgba(118,255,178,.8);
  transform: scale(1.45);
}

/* ── Fact ticker ── */
.grow4096 .g-factTicker{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(10,18,12,.50);
  border: 1px solid rgba(216,255,224,.09);
  backdrop-filter: blur(6px);
  min-height: 48px;
}

.grow4096 .g-factIcon{
  font-size: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.4));
}

.grow4096 .g-factText{
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  transition: opacity 500ms ease;
}
.grow4096 .g-factText.fade-out{ opacity: 0; }
.grow4096 .g-factText.fade-in { opacity: 1; }

/* ── Win confetti overlay (full-page fixed) ── */
.grow4096-confetti{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
  overflow: hidden;
}
.grow4096-confetti .g-cc{
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  opacity: 0;
  animation: g-confetti-fall var(--dur,1.8s) var(--delay,0s) ease-in forwards;
}
@keyframes g-confetti-fall{
  0%  { transform: translateY(-20px) rotate(0deg)   scale(1);   opacity: 1; }
  80% { opacity: 1; }
  100%{ transform: translateY(110vh) rotate(720deg) scale(0.6); opacity: 0; }
}


/* =========================================================
   v4: Age gate, "remove me" button layout
   ========================================================= */

/* Age gate card — centered, no close button */
.grow4096 .g-ageGate{
  z-index: 99999;
  background: rgba(0,0,0,.80);
  backdrop-filter: blur(16px);
}

.grow4096 .g-ageCard{
  text-align: center;
  max-width: 400px;
  padding: 28px 24px;
}

.grow4096 .g-ageLogo{
  margin: 0 auto 16px;
  width: 110px;
}
.grow4096 .g-ageLogo img{
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.grow4096 .g-ageTitle{
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 950;
}

.grow4096 .g-ageMsg{
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 20px;
}

.grow4096 .g-ageActions{
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.grow4096 .g-ageFine{
  font-size: 10px;
  color: rgba(216,255,224,.38);
  line-height: 1.4;
  margin: 0;
}

/* ── Restart row — sits below the fact ticker ── */
.grow4096 .g-restartRow{
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px 14px;
}

.grow4096 .g-btn-restart{
  background: linear-gradient(180deg, rgba(60,20,20,.9), rgba(35,10,10,.9));
  border-color: rgba(255,100,100,.25);
  color: rgba(255,160,160,.95);
}
.grow4096 .g-btn-restart:hover{
  border-color: rgba(255,100,100,.45);
}

/* "Remove me" button sits beside clear LB — flex wrap handles it */
.grow4096 .g-lbTools{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}

