:root{
  --ink:#111;
  --muted:#5a5a5a;
  --line:#e2e2e2;
  --card:#ffffff;
  --radius:18px;

  /* GAME COLORS */
  --wordle:#86efac;      /* lighter green */
  --connections:#8b5cf6; /* purple */
  --strands:#2dd4bf;     /* turquoise */
  --mini:#3b82f6;        /* blue */

  /* hero accents */
  --pink:#ff4d6d;
  --yellow:#ffd166;

  /* mobile sizing */
  --pad: 14px;
  --max: 980px;
}

/* Base */
*{box-sizing:border-box}
html,body{margin:0; padding:0}
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color:var(--ink);
  background:#fff;
  -webkit-text-size-adjust: 100%;
}
a{color:inherit}
button, input{font: inherit}

/* Top bar */
.topbar{
  position:sticky;
  top:0;
  background:rgba(255,255,255,.95);
  border-bottom:1px solid var(--line);
  z-index:10;
}
.topbar-inner{
  max-width:var(--max);
  margin:auto;
  padding:12px var(--pad);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
.nyt-brand{
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight:800;
  text-decoration:none;
  color:inherit;
}
.nyt-games{margin-left:6px}
.edition-pill{
  border-radius:999px;
  padding:6px 10px;
  font-size:13px;
  border:1px solid var(--line);
  white-space:nowrap;
}

/* Layout */
.shell{
  max-width:var(--max);
  margin:auto;
  padding: var(--pad);
  display:grid;
  gap:16px;
}
.pagehead .headline{
  font-family: Georgia, serif;
  font-size: clamp(30px, 6vw, 44px);
  margin:0;
  line-height:1.06;
}
.dek{
  margin:8px 0 0;
  color:var(--muted);
  max-width:75ch;
  font-size: 15px;
}

/* Buttons: bigger tap targets */
.btn, button.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--line);
  text-decoration:none;
  font-weight:700;
  color:inherit;
  background:#fff;
  min-height:44px;     /* mobile tap target */
}
.btn.primary{
  background:#111;
  color:#fff;
  border-color:#111;
}
.btn.unlocked{
  background:#111;
  color:#fff;
  border-color:#111;
}
.btn:active{transform:translateY(1px)}

/* HERO — FLEX so counter can sit far right on desktop */
.hero{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:16px;
  border-radius:var(--radius);
  border:1px solid var(--line);
  background:
    radial-gradient(1000px 260px at 5% 0%, rgba(255,77,109,.18), transparent 60%),
    radial-gradient(900px 260px at 55% 10%, rgba(139,92,246,.16), transparent 60%),
    radial-gradient(900px 260px at 95% 0%, rgba(255,209,102,.22), transparent 60%),
    linear-gradient(180deg, #ffffff, #fbfbfb);
}
.hero-left{flex:1; min-width:0;}
.hero-right{margin-left:auto; display:flex; justify-content:flex-end;}
.hero-kicker{
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
}
.hero-title{
  font-family: Georgia, serif;
  font-size: clamp(22px, 4vw, 28px);
  font-weight:800;
  margin-top:2px;
}
.hero-desc{color:var(--muted); margin:8px 0 0}
.hero-actions{
  margin-top:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Counter box */
.statbox{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px 14px;
  text-align:center;
  background:#fff;
  min-width: 150px;
}
.statnum{
  font-family: Georgia, serif;
  font-size:28px;
  font-weight:900;
  line-height:1;
}
.statlabel{
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
}

/* Game grid */
.grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
}
.gamecard{
  position:relative;
  padding:14px;
  border-radius:var(--radius);
  border:1px solid var(--line);
  text-decoration:none;
  color:inherit;
  background:var(--card);
  overflow:hidden;
  min-height: 120px;
}
.card-title{
  font-family: Georgia, serif;
  font-weight:900;
  font-size:18px;
}
.card-desc{color:var(--muted); margin:10px 0 0}
.card-meta{font-size:12px; color:var(--muted); margin-top:10px}

/* Color per card (HOME ONLY) — order: Wordle, Connections, Strands, Mini */
body.home .grid .gamecard:nth-child(1){--c:var(--wordle)}
body.home .grid .gamecard:nth-child(2){--c:var(--connections)}
body.home .grid .gamecard:nth-child(3){--c:var(--strands)}
body.home .grid .gamecard:nth-child(4){--c:var(--mini)}
body.home .gamecard::before{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, transparent), transparent 65%);
  pointer-events:none;
}
body.home .gamecard::after{
  content:"";
  position:absolute;
  top:0; left:0; right:0;
  height:6px;
  background:var(--c);
}

/* Footer */
.footer{padding-bottom:18px}
.fineprint{font-size:12px; color:var(--muted); margin:0}

/* Utility */
.hidden{display:none !important}

/* MOBILE BREAKPOINTS */
@media (max-width: 900px){
  .grid{grid-template-columns:repeat(2,1fr)}
  .hero{
    flex-direction:column;
    align-items:stretch;
  }
  .hero-right{
    margin-left:0;
    justify-content:flex-start;  /* stack under content */
  }
  .statbox{min-width: 0; width: fit-content;}
}
@media (max-width: 520px){
  .grid{grid-template-columns:1fr}
  .gamecard{min-height: 110px}
  .edition-pill{font-size:12px}
}
/* ===== Mobile vertical tightening ===== */
@media (max-width: 520px){
  /* Overall page padding */
  .shell{
    padding-top: 8px;
    padding-bottom: 8px;
  }

  /* Header spacing */
  .pagehead{
    margin-bottom: 6px;
  }
  .pagehead .headline{
    font-size: 30px;
    margin-bottom: 2px;
  }
  .pagehead .dek{
    font-size: 13px;
    margin-top: 0;
  }

  /* Board tighter */
  .board{
    gap: 6px;
  }
  .row{
    gap: 6px;
  }
  .tile{
    font-size: 18px;
    border-radius: 10px;
  }

  /* Keyboard tighter but still tappable */
  .kbd{
    gap: 6px;
    margin-top: 4px;
  }
  .kbdrow{
    gap: 5px;
  }
  .key{
    min-height: 40px;
    padding: 10px 0;
    font-size: 14px;
    border-radius: 10px;
  }

  /* Buttons / notes */
  .note{
    font-size: 11px;
  }
}
