/* rightnow.fun: shared styles (hub, game pages, plain pages)
   One display font (Bricolage Grotesque), one sans (Inter), one brand accent (ultramarine).
   Hub cards and the featured slot also get a per-game accent from games.js as --g / --g-ink. */

:root {
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --accent: #2f4de0;          /* fills, large type */
  --accent-ink: #ffffff;      /* text placed on --accent */
  --radius: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 48px);

  /* light (default) */
  --bg: #f7f6f3;
  --surface: #ffffff;
  --quiet: rgba(17, 17, 19, .04);  /* barely-there fill for clue rows */
  --quieter: rgba(17, 17, 19, .022); /* even fainter fill for "soon" tiles */
  --text: #111113;
  --muted: #5c5c66;
  --faint: #6b6b74;
  --line: rgba(17, 17, 19, .09);
  --accent-text: #2a45cc;     /* accent for small text: AA on light bg */
  --shadow: 0 1px 2px rgba(17, 17, 19, .04), 0 24px 48px -24px rgba(17, 17, 19, .18);
  --shadow-lift: 0 2px 4px rgba(17, 17, 19, .05), 0 28px 56px -24px rgba(17, 17, 19, .26);
  --blob: 22%;                /* strength of the accent glow behind the hero */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0f;
    --surface: #17171b;
    --quiet: rgba(255, 255, 255, .045);
    --quieter: rgba(255, 255, 255, .025);
    --text: #f4f3ef;
    --muted: #a3a3ad;
    --faint: #8a8a94;
    --line: rgba(255, 255, 255, .08);
    --accent: #8fa3ff;
    --accent-ink: #0d0f1f;
    --accent-text: #9aadff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 24px 48px -24px rgba(0, 0, 0, .7);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 28px 56px -24px rgba(0, 0, 0, .85);
    --blob: 20%;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d0d0f;
  --surface: #17171b;
  --quiet: rgba(255, 255, 255, .045);
  --quieter: rgba(255, 255, 255, .025);
  --text: #f4f3ef;
  --muted: #a3a3ad;
  --faint: #8a8a94;
  --line: rgba(255, 255, 255, .08);
  --accent: #8fa3ff;
  --accent-ink: #0d0f1f;
  --accent-text: #9aadff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 24px 48px -24px rgba(0, 0, 0, .7);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 28px 56px -24px rgba(0, 0, 0, .85);
  --blob: 20%;
  color-scheme: dark;
}

/* per-game accent (set inline by main.js as --g-l/--g-d and matching ink colours) */
.game, .hp-slide, .hp-dot, .day-row, .blob, .today-bar > li { --g: var(--g-l, var(--accent)); --g-ink: var(--g-ink-l, var(--accent-ink)); }
:root[data-theme="dark"] :is(.game, .hp-slide, .hp-dot, .day-row, .blob, .today-bar > li) { --g: var(--g-d, var(--accent)); --g-ink: var(--g-ink-d, var(--accent-ink)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.game, .hp-slide, .hp-dot, .day-row, .blob, .today-bar > li) { --g: var(--g-d, var(--accent)); --g-ink: var(--g-ink-d, var(--accent-ink)); }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}

main { flex: 1; }
.hub-main { position: relative; isolation: isolate; display: flex; flex-direction: column; }

/* background: faint dots plus one soft glow per live game in its accent (blobs are added by main.js) */
.hub-bg {
  position: absolute;
  inset: 0 0 auto 0;
  height: min(980px, 100%);
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(transparent, #000 150px 60%, transparent);
  mask-image: linear-gradient(transparent, #000 150px 60%, transparent);
}
.hub-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--text) 14%, transparent) 1px, transparent 1.4px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 65% 25%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 65% at 65% 25%, #000, transparent 75%);
}
.blob {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--g) var(--blob), transparent), transparent);
}
.b1 { width: 640px; height: 640px; right: -140px; top: -60px; }
.b2 { width: 560px; height: 560px; left: -200px; top: 200px; }
.b3 { width: 480px; height: 480px; left: 38%; top: 420px; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0;
}

p { margin: 0; }
a { color: inherit; }
svg { display: block; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 16px; }

.accent-text { color: var(--accent); }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: background-color .35s var(--ease);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.04em;
  line-height: 1;
}
.logo-mark {
  width: 26px; height: 26px;
  flex: none;
  transition: transform .4s var(--ease);
}
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }
.logo-dot { color: var(--accent); }
.logo-small { font-size: 1.2rem; }
.logo-small .logo-mark { width: 22px; height: 22px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 40px;
  height: 40px;
  padding: 0 6px;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: default;
}
.streak[hidden] { display: none; }
.streak-count { font-weight: 600; }
.streak-label { color: var(--muted); }
.streak-flame { font-size: 1.1rem; line-height: 1; transform-origin: 50% 90%; }
.streak:hover .streak-flame { animation: flicker .9s ease-in-out infinite; }

@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(0); }
  30% { transform: scale(1.08, .96) rotate(-4deg); }
  60% { transform: scale(.96, 1.06) rotate(3deg); }
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.theme-toggle:hover { background: var(--quiet); transform: rotate(12deg); }
.theme-toggle svg {
  grid-area: 1 / 1;
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  transition: opacity .3s var(--ease), transform .4s var(--ease);
}
.theme-toggle .icon-moon { fill: currentColor; stroke: none; }
/* show the icon for the theme you'd switch TO */
.icon-sun { opacity: 0; transform: rotate(-90deg) scale(.6); }
.icon-moon { opacity: 1; transform: none; }
:root[data-theme="dark"] .icon-sun { opacity: 1; transform: none; }
:root[data-theme="dark"] .icon-moon { opacity: 0; transform: rotate(90deg) scale(.6); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { opacity: 1; transform: none; }
  :root:not([data-theme="light"]) .icon-moon { opacity: 0; transform: rotate(90deg) scale(.6); }
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 56px;
  padding-top: clamp(20px, 3vw, 44px);
  padding-bottom: clamp(36px, 4vw, 56px);
}

.hero-title {
  font-size: clamp(3rem, 9vw, 5.75rem);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -0.05em;
}
.ht-line { display: block; }

.hero-sub {
  margin-top: 28px;
  max-width: 30rem;
  font-size: clamp(1.075rem, 1.5vw, 1.25rem);
  color: var(--muted);
}

/* the countdown, always in view at the top of the hero */
.clock-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  height: 36px;
  margin-bottom: 24px;
  padding: 0 14px 0 11px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line), 0 6px 16px -10px rgba(17, 17, 19, .25);
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.clock-pill[hidden] { display: none; }
.clock-pill svg {
  flex: none;
  width: 17px; height: 17px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.clock-pill time {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* everything played: the countdown is the headline */
.ht-clock { white-space: nowrap; font-variant-numeric: tabular-nums; }
.is-all-done .hero-title { font-size: clamp(2rem, 8.4vw, 3.4rem); }

/* today's progress across every live daily */
.today {
  max-width: 35rem;
  margin-top: 32px;
}
.today[hidden] { display: none; }
.today-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}
.today-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.today-date { font-size: .85rem; color: var(--muted); }
.today-bar {
  display: flex;
  gap: 4px;
  height: 8px;
  margin: 10px 0 12px;
  padding: 0;
  list-style: none;
}
.today-bar > li {
  flex: 1;
  border-radius: 999px;
  background: var(--line);
  transition: background-color .4s var(--ease);
}
.today-bar > li.is-done { background: var(--g); }
.today-line {
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.today-line strong { color: var(--text); font-weight: 600; }
.today-plain[hidden] { display: none; }

/* "Your day": each game's result and streak, and the one share button */
.day-card {
  padding: 12px 16px 4px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.day-card[hidden] { display: none; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 .9rem var(--font-sans);
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.share-btn svg {
  flex: none;
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.share-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--accent) 90%, transparent); }
.share-btn:active { transform: scale(.97); transition-duration: .1s; }
.day-list { margin: 6px 0 0; padding: 0; list-style: none; }
.day-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
.day-row:first-child { border-top: 0; }
.day-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px; height: 28px;
  border-radius: 9px;
  background: var(--g);
  color: var(--g-ink);
}
.day-icon svg { width: 18px; height: 18px; }
.day-icon .g-emoji { font-size: 1rem; }
.day-name { font-weight: 600; }
.day-result {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-left: auto;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.day-row.is-done .day-result { color: var(--text); font-weight: 500; }
.day-row .game-streak { flex: none; font-size: .85rem; }
@media (max-width: 560px) {
  .day-result { flex: 0 0 auto; justify-content: flex-end; }
  .day-row .game-streak { flex-basis: 100%; margin-left: 38px; }
}
.day-copy {
  display: block;
  width: 100%;
  margin: 4px 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--quiet);
  color: var(--text);
  font: .85rem/1.4 var(--font-sans);
  resize: none;
}
.day-copy[hidden] { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  height: 56px;
  margin-top: 28px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease);
}
.btn > span { overflow: hidden; text-overflow: ellipsis; }
.btn svg {
  flex: none;
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s var(--ease);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -16px color-mix(in srgb, var(--accent) 90%, transparent);
}
.btn:hover svg { transform: translateX(4px); }
.btn:active { transform: none; }
/* everything played: the button steps back to a quiet "past days" link */
.btn.is-done { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.btn.is-done:hover { box-shadow: var(--shadow-lift); }

/* ---------- featured games (hero-preview): a small carousel ---------- */

.hero-preview { width: 100%; max-width: 420px; }
.hero-preview[hidden] { display: none; }
.hp-track { display: grid; touch-action: pan-y; }

/* every slide sits in the same grid cell, so the card is as tall as the tallest one and never jumps */
.hp-slide {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateX(14px);
  transition: opacity .45s var(--ease), transform .45s var(--ease), visibility 0s .45s, box-shadow .25s var(--ease), background-color .35s var(--ease);
}
.hp-slide.is-before { transform: translateX(-14px); }
.hp-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
.hp-slide.is-active:hover,
.hp-slide.is-active:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-lift), 0 0 0 1.5px color-mix(in srgb, var(--g) 30%, transparent); }
.hp-slide:focus-visible { border-radius: var(--radius); }
.hp-slide.is-active:active { transform: scale(.99); transition-duration: .1s; }

.hp-dots { display: flex; justify-content: center; gap: 2px; margin-top: 8px; }
.hp-dot {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.hp-dot span {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 22%, transparent);
  transition: width .35s var(--ease), background-color .35s var(--ease);
}
.hp-dot:hover span { background: color-mix(in srgb, var(--text) 40%, transparent); }
.hp-dot.is-active span { width: 24px; background: var(--g); }

/* a finished game shows the player's own result instead of a demo */
.hp-done { display: grid; flex: 1; align-content: center; gap: 8px; padding: 6px 0; }
.hp-done-k {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.hp-done-main {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 8vw, 2.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.hp-done-streak { font-size: .95rem; font-weight: 600; color: var(--muted); }

.hp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.hp-game {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}
.hp-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--g);
  color: var(--g-ink);
}
.hp-icon svg { width: 19px; height: 19px; }
.hp-num {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--quiet);
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.hp-stage {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Rows keep their space, so the card holds its final height (no layout shift).
   Clues not yet revealed show as empty slots; guesses fade in between them. */
.hp-stage > li,
.hp-v,
.hp-clue::after { transition: opacity .5s var(--ease), transform .5s var(--ease); }
.hp-stage.is-playing > .hp-guess:not(.is-in) { opacity: 0; transform: translateY(6px); }
.hp-stage.is-playing > .hp-clue:not(.is-in) .hp-v { opacity: 0; transform: translateY(4px); }
.hp-stage.is-playing > .hp-clue:not(.is-in)::after { opacity: 1; }
.hp-stage.is-instant > li,
.hp-stage.is-instant .hp-v,
.hp-stage.is-instant .hp-clue::after { transition: none; }

.hp-clue {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--quiet);
  font-size: .925rem;
}
.hp-k {
  flex: none;
  min-width: 74px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.hp-v { font-weight: 600; }
.hp-clue::after {
  content: "";
  position: absolute;
  left: 100px; /* row padding + key width + gap */
  top: 50%;
  width: 44%;
  height: 8px;
  margin-top: -4px;
  border-radius: 999px;
  background: var(--line);
  opacity: 0;
  pointer-events: none;
}

.hp-guess {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  font-size: .85rem;
  font-weight: 600;
}
.hp-year { font-variant-numeric: tabular-nums; color: var(--muted); }
.hp-fb {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
}
.hp-guess.is-correct .hp-year { color: var(--text); }
.hp-guess.is-correct .hp-fb { background: var(--g, var(--accent)); color: var(--g-ink, var(--accent-ink)); }
.hp-guess.is-correct.is-in .hp-fb { animation: pop .5s var(--ease); }

@keyframes pop {
  0% { transform: scale(.8); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* featured game without a demo: its tagline, large */
.feature-tagline {
  margin: 28px 0 10px;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
}
.feature-blurb { color: var(--muted); }

.hp-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: auto;
  padding-top: 16px;
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.hp-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
}
.hp-go svg {
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s var(--ease);
}
.hp-slide:hover .hp-go svg { transform: translateX(3px); }
@media (min-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 72px; }
  .hero-title { font-size: clamp(3rem, 6vw, 5.75rem); }
  .hero-preview { justify-self: end; }
  .is-all-done .hero-title { font-size: clamp(2.4rem, 4vw, 3.6rem); }
}

/* ---------- games ---------- */

.games { padding-bottom: clamp(48px, 6vw, 80px); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  margin-bottom: 24px;
}
.section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  letter-spacing: -0.04em;
}
.section-sub { color: var(--muted); font-size: .95rem; }

/* Fills the row: 1 game + the placeholder sit side by side, 3+ wrap into columns of at least 290px */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .35s var(--ease);
}
.game:not(.is-soon, .is-placeholder):hover,
.game:not(.is-soon, .is-placeholder):focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift), 0 0 0 1.5px color-mix(in srgb, var(--g) 32%, transparent), 0 22px 44px -26px color-mix(in srgb, var(--g) 60%, transparent);
}
.game:not(.is-soon, .is-placeholder):active { transform: translateY(-1px) scale(.99); transition-duration: .1s; }

.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.game-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--g);
  color: var(--g-ink);
  transition: transform .4s var(--ease);
}
.game-icon svg { width: 28px; height: 28px; }
.g-emoji { font-size: 1.6rem; line-height: 1; }
.game:hover .game-icon { transform: rotate(-6deg); }
.game-day {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--quiet);
  font-size: .8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.game-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.game-link { text-decoration: none; }
.game-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.game-tagline { margin-top: 4px; color: var(--muted); }

.game-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 18px;
  font-size: .9rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.game-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.game.is-done .game-state,
.game.is-started .game-state { color: var(--text); }
.game-streak[hidden] { display: none; }
.game-streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
}
.game-cta,
.game-alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .2s var(--ease);
}
.game-cta { background: var(--g); color: var(--g-ink); }
.game-cta svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s var(--ease);
}
/* the whole card is the main link; the secondary link sits above it */
.game-cta::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.game:hover .game-cta svg { transform: translateX(3px); }
.game.is-done .game-cta { background: color-mix(in srgb, var(--g) 14%, var(--surface)); color: var(--text); }
.game-alt {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 1.5px var(--line);
  color: var(--text);
}
.game-alt:hover { background: var(--quiet); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text) 30%, transparent); }

/* announced games and the "more coming" placeholder: quiet, not links */
.game.is-soon,
.game.is-placeholder { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.game.is-placeholder { box-shadow: none; border: 1.5px dashed color-mix(in srgb, var(--text) 18%, transparent); }
.game.is-soon .game-icon { background: color-mix(in srgb, var(--g) 16%, transparent); color: var(--text); }
.game.is-soon .game-day { background: color-mix(in srgb, var(--g) 12%, transparent); color: var(--text); }
.game.is-placeholder .game-icon { background: transparent; border: 1.5px dashed color-mix(in srgb, var(--text) 24%, transparent); color: var(--muted); }
.game.is-placeholder .game-icon svg { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.game.is-placeholder .game-name { color: var(--muted); }
.game.is-placeholder .game-alt { align-self: flex-start; margin-top: auto; }
.game.is-placeholder .game-tagline { margin-bottom: 22px; }

.noscript { margin-top: 16px; color: var(--muted); }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 32px;
  padding-block: 32px;
}
.footer-brand { display: grid; gap: 8px; }
.footer-tag { color: var(--muted); font-size: .9rem; }
.footer-side { display: grid; gap: 8px; justify-items: end; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-links a {
  padding: 4px 0;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s var(--ease);
}
.footer-games a { color: var(--faint); font-size: .85rem; }
.footer-links a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.footer-note { color: var(--faint); font-size: .8rem; }
.footer-link { color: inherit; text-underline-offset: 3px; }

/* ---------- plain pages (privacy, 404) ---------- */

.page { max-width: calc(680px + var(--gutter) * 2); padding-top: clamp(24px, 4vw, 48px); padding-bottom: clamp(56px, 8vw, 96px); }
.page h1 { margin-bottom: 12px; font-size: clamp(2.25rem, 6vw, 3.5rem); font-weight: 800; letter-spacing: -0.05em; }
.page h2 { margin: 36px 0 8px; font-size: 1.35rem; letter-spacing: -0.03em; }
.page p, .page li { color: var(--muted); line-height: 1.6; }
.page p + p { margin-top: 12px; }
.page ul { display: grid; gap: 8px; margin: 12px 0 0; padding-left: 1.25em; }
.page a:not(.btn) { color: var(--accent-text); text-underline-offset: 3px; }
.page strong { color: var(--text); font-weight: 600; }
.page-lede { font-size: 1.15rem; }
.page-404 { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; }
.page-404 .code { font-family: var(--font-display); font-weight: 800; font-size: clamp(6rem, 24vw, 12rem); line-height: .85; letter-spacing: -0.07em; color: var(--accent); }
.page-404 .btn { margin-top: 28px; align-self: flex-start; }

/* ---------- game pages: back link ---------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  transition: color .2s var(--ease);
}
.back-link:hover { color: var(--text); }
.back-link svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 2.25;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .25s var(--ease);
}
.back-link:hover svg { transform: translateX(-4px); }

/* ---------- small screens ---------- */

/* On narrow screens the games come before the featured card: the hero's two children
   join the main column directly, so CSS order can slot the Games section between them.
   The hero is kept short so the first game card is on screen without scrolling. */
@media (max-width: 720px) {
  .hero { display: contents; }
  .hero-copy { order: 1; padding: 14px var(--gutter) 20px; }
  .clock-pill { margin-bottom: 14px; }
  .hero-title { font-size: clamp(2.1rem, 9.8vw, 2.9rem); }
  .hero-sub { margin-top: 10px; font-size: .98rem; line-height: 1.45; }
  .today { margin-top: 18px; }
  .today-bar { margin: 8px 0 8px; }
  /* the cards right below carry the play buttons */
  .hero .btn { display: none; }
  .games { order: 2; padding-bottom: 16px; }
  .section-head { margin-bottom: 14px; }
  .section-title { font-size: 1.6rem; }
  .section-sub { display: none; }
  .hero-preview { order: 3; width: auto; max-width: none; margin: 24px var(--gutter) 44px; }
  .b1 { width: 420px; height: 420px; right: -160px; top: -40px; }
  .b2 { width: 380px; height: 380px; left: -200px; top: 260px; }
  .b3 { display: none; }
}

@media (max-width: 560px) {
  .header-inner { height: 64px; }
  .logo { font-size: 1.2rem; gap: 8px; }
  .logo-mark { width: 22px; height: 22px; }
  .hp-slide { padding: 20px; }
  .game { padding: 18px 20px; }
  .game-head { margin-bottom: 12px; }
  .game-status { margin-top: 12px; }
  .game-actions { padding-top: 16px; }
  .footer-inner { flex-direction: column; gap: 16px; padding-block: 26px; }
  .footer-side { justify-items: start; }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes rise-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes settle {
    from { transform: translateY(10px) scale(.985); }
    to { transform: none; }
  }
  @keyframes drift {
    to { transform: translate3d(36px, 28px, 0) scale(1.08); }
  }
  .hero-title, .hero-sub, .section-head, .clock-pill {
    animation: rise-in .26s var(--ease) backwards;
  }
  /* Keep the primary action and loaded tiles visible throughout their entrance (they only slide). */
  .hero .btn, .today, .hero-preview { animation: settle .3s var(--ease) backwards; }
  .games-grid > .game { animation: settle .4s var(--ease) backwards; }
  .games-grid > .game:nth-child(1) { animation-delay: 90ms; }
  .games-grid > .game:nth-child(2) { animation-delay: 160ms; }
  .games-grid > .game:nth-child(3) { animation-delay: 230ms; }
  .games-grid > .game:nth-child(n+4) { animation-delay: 300ms; }
  .hero-sub { animation-delay: 45ms; }
  .today { animation-delay: 90ms; }
  .hero-preview { animation-delay: 150ms; }
  .section-head { animation-delay: 190ms; }
  .blob { animation: drift 24s ease-in-out infinite alternate; }
  .b2 { animation-duration: 30s; animation-direction: alternate-reverse; }
  .b3 { animation-duration: 36s; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
