/* Geist, served from this site (SIL Open Font License, see fonts/OFL.txt) */
@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Shared shell for every page: clean white page, slim nav with game tabs, one game card. */
:root {
  --bg: #FFFFFF;
  --soft: #F4F4F5;
  --ink: #0A0A0B;
  --ink-2: #6B6B73;
  --line: rgba(10, 10, 11, 0.08);
  --font: "Geist", system-ui, -apple-system, sans-serif;
  --good: #16A34A;
  --bad: #EF4444;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.35, .5, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(100% - 32px, 1180px);
  height: 68px;
  margin: 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.03em; }
.brand-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: #FFFFFF;
  /* The Kwiz blue (as on Instagram), with the light top edge and shadow of the game tiles */
  background: linear-gradient(165deg, #4D8DFF, #1E4FE0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(0, 0, 0, 0.14), 0 1px 1px rgba(10, 10, 11, 0.12), 0 4px 10px -4px #1E4FE0; }
.brand-mark svg { width: 15px; height: 15px; }
.tabs { display: flex; gap: 20px; margin: 0; padding: 0; list-style: none; }
.tabs a { position: relative; display: inline-block; padding: 6px 0; color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; transition: color 150ms ease; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--ink); }
.nav-end { margin-left: auto; color: var(--ink-2); font-size: 14px; }

/* The game card: everything happens inside it */
.stage-wrap { flex: 1; display: grid; place-items: start center; padding: 4px 12px 16px; }
.gamecard {
  position: relative;
  width: min(100%, 460px);
  height: min(820px, calc(100dvh - 104px));
  min-height: 580px;
  border-radius: 32px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 30px 70px -34px rgba(10, 10, 11, 0.45), 0 0 0 1px rgba(10, 10, 11, 0.04);
}

/* A game that owns the screen on wide displays; phones keep the full-height card */
.gamecard.wide { width: min(100%, 1400px); height: clamp(600px, calc(100dvh - 92px), 940px); }
.stage-wrap:has(.wide) { padding: 0 16px 12px; }

/* Buttons */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -0.015em;
  text-decoration: none;
  cursor: pointer;
  /* Floats on a soft shadow; lifts on hover and gives a little when pressed */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 2px rgba(10, 10, 11, 0.14), 0 10px 24px -12px rgba(10, 10, 11, 0.45);
  transition: transform 280ms var(--spring), box-shadow 220ms var(--ease), background-color 160ms ease;
}
.pill:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 4px rgba(10, 10, 11, 0.12), 0 16px 30px -14px rgba(10, 10, 11, 0.5); }
.pill:active { transform: scale(0.97); transition-duration: 80ms; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(10, 10, 11, 0.16); }
.pill.white { background: #FFFFFF; color: var(--ink); }
.pill.black { background: var(--ink); color: #FFFFFF; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 2px rgba(10, 10, 11, 0.3), 0 10px 24px -12px rgba(10, 10, 11, 0.6); }
.pill.glass { background: rgba(255, 255, 255, 0.16); color: currentColor; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pill.glass:hover { background: rgba(255, 255, 255, 0.24); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5); }
.pill.glass:active { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4); }

/* Footer */
.foot {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
  padding: 10px 0 18px;
  color: var(--ink-2);
  font-size: 12px;
}
.foot a { color: inherit; text-decoration: none; white-space: nowrap; }
.foot a:hover { color: var(--ink); }

@media (max-width: 520px) {
  .nav { gap: 14px; height: 60px; }
  .nav nav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
  .nav nav::-webkit-scrollbar { display: none; }
  .tabs { gap: 16px; padding-right: 24px; }
  .tabs a { white-space: nowrap; }
  .brand { font-size: 0; gap: 0; }
  .nav-end { display: none; }
  .stage-wrap { padding: 0 8px 12px; }
  /* The card is exactly the screen below the top bar, never taller: anything taller pushes the buttons off the
     bottom, and many Android phones (bigger system text, three-button bar) leave only 520-600px. */
  .gamecard, .gamecard.wide { height: calc(100dvh - 76px); min-height: 440px; border-radius: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Text link at the right of the nav */
.nav-link { margin-left: auto; color: var(--ink-2); font-size: 15px; font-weight: 500; text-decoration: none; transition: color 150ms ease; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--ink); }
.nav-link + .sound { margin-left: 8px; }
@media (max-width: 520px) { .nav-link { display: none; } .nav-link + .sound { margin-left: auto; } }

/* Sound toggle in the nav */
.sound { display: grid; place-items: center; width: 36px; height: 36px; margin-left: auto; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; transition: background-color 150ms ease, color 150ms ease; }
.sound:hover { background: var(--soft); color: var(--ink); }
.sound svg { width: 20px; height: 20px; }
.sound + .nav-end { margin-left: 4px; }

/* Small stat chips: streak, best */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; }
.chip svg { width: 14px; height: 14px; }
.chip.hot { background: #FF5A1F; color: #FFFFFF; }
.chip.gold { background: #FFD23F; color: #1A1300; }

/* Particles and floating text */
.spark { position: absolute; z-index: 9; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 2px; pointer-events: none; animation: spark 850ms cubic-bezier(.15,.7,.3,1) forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(0.3); opacity: 0; } }
.float { position: absolute; z-index: 9; font-weight: 800; font-size: 22px; letter-spacing: -0.03em; white-space: nowrap; pointer-events: none; transform: translate(-50%, -50%); animation: float-up 1050ms cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes float-up { 0% { opacity: 0; transform: translate(-50%, -20%) scale(0.6); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } 30% { transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -190%); } }

/* ---------- Game icons, used in the nav and around the site ---------- */
.nav-i { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; }
.nav-i svg { width: 18px; height: 18px; }
.nav-i.house, .nav-i.help { background: var(--soft); color: var(--ink); }
/* Game tiles: a soft gradient of the game's colour, a light top edge and a shadow, like an app icon.
   The same colours draw each game's favicon (TILE in build/shell.py). */
.nav-i:is(.higher, .price, .window, .sort, .lock, .onestar, .stack, .live) {
  background: linear-gradient(165deg, var(--t), var(--b));
  color: #FFFFFF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(0, 0, 0, 0.14), 0 1px 1px rgba(10, 10, 11, 0.12), 0 4px 10px -4px var(--b);
}
.nav-i:is(.higher, .price, .window, .sort, .lock, .onestar, .stack, .live) svg { width: 58%; height: 58%; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.16)); }
.nav-i .a { fill: var(--acc, currentColor); }
.nav-i.higher { --t: #FF7A3D; --b: #EE4710; }
.nav-i.price { --t: #16946B; --b: #095A41; }
.nav-i.window { --t: #F2634F; --b: #CF3824; }
.nav-i.sort { --t: #FFD95E; --b: #F4AC00; color: #2B1E00; }
.nav-i.sort svg { filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35)); }
.nav-i.lock { --t: #18A094; --b: #0A645D; --acc: #F7C548; }
.nav-i.onestar { --t: #8D72FB; --b: #5737E6; --acc: #FFD03D; }
.nav-i.stack { --t: #F8659F; --b: #D42B76; }
.nav-i.live { --t: #4D8DFF; --b: #1E4FE0; --acc: #FFD03D; }

/* Top bar (phones and tablets): text tabs only; the logo is the way home */
.tabs .nav-i, .nav-link .nav-i, .sound-label, .t-head { display: none; }

/* ---------- Sidebar on wide screens: one kind of row for everything ---------- */
@media (min-width: 1180px) {
  body { padding-left: 240px; }
  .nav {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 240px;
    height: auto;
    margin: 0;
    padding: 24px 16px 20px;
    border-right: 1px solid var(--line);
    background: var(--bg);
  }
  /* The name sits apart from the games: bigger, heavier, its own space */
  .brand { gap: 10px; margin: 0 0 30px; padding: 4px 8px; font-size: 28px; font-weight: 900; letter-spacing: -0.06em; transition: opacity 150ms ease; }
  .brand:hover { opacity: 0.75; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .brand-mark svg { width: 17px; height: 17px; }
  .t-head { display: block; padding: 0 12px 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
  .tabs { flex-direction: column; gap: 4px; }
  .tabs .nav-i, .nav-link .nav-i, .sound-label { display: grid; }
  .sound-label { display: inline; }
  .tabs a, .nav-link, .sound {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 6px 12px 6px 7px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 150ms ease, transform 150ms ease;
  }
  .tabs a:hover, .nav-link:hover, .sound:hover { background: var(--soft); color: var(--ink); }
  .tabs a:active, .nav-link:active, .sound:active { transform: scale(0.98); }
  .tabs a[aria-current="page"], .nav-link[aria-current="page"] { background: var(--soft); font-weight: 800; }
  .tabs a[aria-current="page"]::after { content: none; }
  .nav-link[aria-current="page"] .nav-i.help { background: #FFFFFF; }
  .nav-link { margin-top: auto; }
  .nav-link + .sound { margin-left: 0; }
  .sound svg { box-sizing: border-box; width: 36px; height: 36px; padding: 9px; border-radius: 11px; background: var(--soft); color: var(--ink); }
  .nav-end { display: none; }
  /* Without a top bar the game card gets the full height */
  .stage-wrap:has(.wide) { padding: 16px 20px; }
  .gamecard.wide { height: clamp(600px, calc(100dvh - 72px), 960px); }
}

/* The archive panel (assets/archive.js). Tinted with the card's own text colour, so it suits every game. */
.arch { display: flex; flex-direction: column; grid-column: 1 / -1; min-width: 0; }
.arch-kicker { margin: 0; font-size: 15px; font-weight: 700; opacity: 0.8; }
.arch-title { margin: 4px 0 8px; font-size: clamp(30px, 3.4cqw, 44px); font-weight: 800; line-height: 1; letter-spacing: -0.05em; }
.arch-sub { max-width: 34ch; margin: 0 0 16px; font-size: 16px; font-weight: 500; line-height: 1.45; opacity: 0.85; }
.days { display: grid; gap: 8px; max-width: 460px; max-height: 50cqh; margin: 0 0 10px; padding: 0 4px 0 0; overflow-y: auto; list-style: none; }
.d-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 0 10px 0 16px; border: 0; border-radius: 16px; background: color-mix(in srgb, currentColor 13%, transparent); color: inherit; font: inherit; font-size: 16px; text-align: left; cursor: pointer; transition: background-color 150ms ease; }
.d-row:hover { background: color-mix(in srgb, currentColor 22%, transparent); }
.d-row.done, .d-row.done:hover { background: color-mix(in srgb, currentColor 13%, transparent); cursor: default; }
.d-no { font-weight: 800; }
.d-date { opacity: 0.75; font-weight: 500; }
.d-tag { margin-left: auto; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, currentColor 16%, transparent); font-size: 14px; font-weight: 700; white-space: nowrap; }
.d-tag.go { background: #FFFFFF; color: #0A0A0B; }
.arch-back { align-self: flex-start; padding: 10px 0; border: 0; background: none; color: inherit; font: inherit; font-size: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* Share sheet: the result card, drawn on the player's device (assets/share.js) */
.share-sheet { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(10, 10, 11, 0); transition: background 0.22s ease; }
.share-sheet[hidden] { display: none; }
.share-sheet.open { background: rgba(10, 10, 11, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.share-box { position: relative; display: grid; gap: 18px; justify-items: center; opacity: 0; transform: translateY(28px) scale(0.9) rotate(-3deg); transition: transform 0.5s cubic-bezier(0.2, 1.4, 0.4, 1), opacity 0.2s ease; }
.share-sheet.open .share-box { opacity: 1; transform: none; }
.share-card { display: block; width: min(84vw, calc((100dvh - 170px) * 0.8), 400px); height: auto; aspect-ratio: 4 / 5; border-radius: 28px; box-shadow: 0 36px 70px -24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.12); }
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.share-actions [hidden] { display: none; }
.share-x { position: absolute; top: -14px; right: -14px; z-index: 1; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #FFFFFF; color: var(--ink); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3); cursor: pointer; }
.share-x svg { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { .share-box { transform: none; transition: opacity 0.2s ease; } }

/* ---------- Finishing touches: calmer labels and steps, depth and a faint grain. On top of each game's own styles. ---------- */
/* Labels: small, spaced capitals, one style everywhere */
.gamecard :is(.kicker, .s-kicker), .arch-kicker, .home .kicker, .t-head {
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.4;
}
/* Big titles keep their weight, with a touch more air between the letters */
.gamecard :is(.title, .s-title) { letter-spacing: -0.06em; }
.gamecard .lede { letter-spacing: -0.01em; text-wrap: pretty; }

/* How-to steps: a quiet list with hairlines instead of a row of bubbles */
.gamecard .how { display: grid; gap: 0; max-width: 340px; margin: 6px 0 24px; padding: 0; list-style: none; border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent); }
.gamecard .how li { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-radius: 0; background: none; border-bottom: 1px solid color-mix(in srgb, currentColor 16%, transparent); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: normal; }
.gamecard .how-i { display: grid; place-items: center; flex: none; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 8px; background: color-mix(in srgb, currentColor 9%, transparent); color: inherit; font-size: 12px; font-weight: 800; }
.gamecard .how-i svg { width: 14px; height: 14px; }
/* Short phones (most of them, once the browser's own bars take their share): a tighter list, so the play button fits */
@media (max-width: 899px) and (max-height: 780px) {
  .gamecard .how { margin: 4px 0 14px; }
  .gamecard .how li { padding: 8px 2px; }
}

/* Stat chips: lighter, with a hairline edge */
.chip { padding: 7px 12px; font-weight: 650; letter-spacing: -0.01em; background: rgba(255, 255, 255, 0.18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22); }
.chip.hot, .chip.gold { box-shadow: none; }

/* Depth: a layered shadow under every card, and a faint grain so flat colour looks printed rather than plastic */
.gamecard { box-shadow: 0 1px 2px rgba(10, 10, 11, 0.06), 0 24px 48px -28px rgba(10, 10, 11, 0.4), 0 60px 110px -60px rgba(10, 10, 11, 0.45), 0 0 0 1px rgba(10, 10, 11, 0.04); }
.gamecard::before, .home .card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.22; mix-blend-mode: overlay;
}

/* Sidebar: lighter labels, a crisper current page */
@media (min-width: 1180px) {
  .tabs a, .nav-link, .sound { font-weight: 550; letter-spacing: -0.015em; transition: background-color 150ms ease, transform 280ms var(--spring); }
  .tabs a:hover .nav-i { transform: rotate(-6deg) scale(1.06); }
  .nav-i { transition: transform 280ms var(--spring); }
  .nav-i.house, .nav-i.help { box-shadow: none; }
  .tabs a[aria-current="page"], .nav-link[aria-current="page"] { font-weight: 700; }
  .t-head { padding: 0 12px 10px; color: var(--ink-2); }
}
::selection { background: #FFD23F; color: var(--ink); }

/* Moving between pages crossfades instead of flashing (browsers that support it; others just load the page) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 260ms; animation-timing-function: var(--ease); }
}

/* Button labels stay on one line; on phones a row of buttons wraps, each filling its row */
.pill { white-space: nowrap; }
@media (max-width: 520px) {
  .gamecard :is(.actions, .s-actions) { display: flex; flex-wrap: wrap; }
  .gamecard :is(.actions, .s-actions) > .pill { flex: 1 1 auto; }
}

/* ---------- Your stats (assets/stats.js): four numbers and one chart, nothing else ---------- */
.stats-open { border: 0; background: none; font-family: inherit; cursor: pointer; }
.nav-link + .stats-open { margin-left: 18px; }
.stats-open + .sound { margin-left: 8px; }
@media (max-width: 520px) {
  /* Phones: just the chart icon, next to the sound button */
  .nav-link.stats-open { display: grid; place-items: center; width: 36px; height: 36px; margin-left: auto; border-radius: 50%; color: var(--ink-2); }
  .stats-open > span:last-child { display: none; }
  .stats-open .nav-i { display: grid; width: auto; height: auto; background: none; }
  .stats-open + .sound { margin-left: 0; }
}
@media (min-width: 1180px) {
  .nav-link + .stats-open, .stats-open + .sound { margin: 0; }
}
.stats-chip { border: 0; color: inherit; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; transition: background-color 150ms ease, transform 280ms var(--spring); }
.stats-chip:hover { background: rgba(255, 255, 255, 0.3); transform: translateY(-1px); }

.stats-sheet { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(10, 10, 11, 0); transition: background 0.22s ease; }
.stats-sheet[hidden] { display: none; }
.stats-sheet.open { background: rgba(10, 10, 11, 0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.stats-box { position: relative; width: min(400px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px 24px 20px; border-radius: 28px; background: #FFFFFF; color: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(10, 10, 11, 0.55), 0 0 0 1px rgba(10, 10, 11, 0.05); opacity: 0; transform: translateY(20px) scale(0.96); transition: transform 0.45s var(--spring), opacity 0.2s ease; }
.stats-sheet.open .stats-box { opacity: 1; transform: none; }
.stats-x { top: 16px; right: 16px; width: 34px; height: 34px; background: var(--soft); box-shadow: none; }
.stats-x:hover { background: #E8E8EB; }
.stats-head { display: flex; align-items: center; gap: 14px; padding-right: 40px; }
.stats-tile .nav-i { width: 46px; height: 46px; border-radius: 14px; }
.stats-k { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.stats-head h2 { margin: 3px 0 0; font-size: 26px; font-weight: 750; line-height: 1; letter-spacing: -0.04em; }
.stats-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 22px 0; padding: 16px 0; border-block: 1px solid var(--line); }
.stats-nums div { display: flex; flex-direction: column-reverse; align-items: center; gap: 5px; text-align: center; }
.stats-nums dd { margin: 0; font-size: 26px; font-weight: 750; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-nums dt { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
@media (max-width: 420px) { .stats-nums dt { letter-spacing: 0.05em; } .stats-box { padding: 22px 18px 18px; } }
.stats-chart h3 { margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.stats-chart ol { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.stats-chart li { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.stats-sheet[data-game="higher"] .stats-chart li { grid-template-columns: 128px minmax(0, 1fr); }
.stats-chart li span { overflow: hidden; color: var(--ink-2); white-space: nowrap; text-overflow: ellipsis; }
.stats-chart i { display: flex; align-items: center; justify-content: flex-end; box-sizing: border-box; min-width: 28px; width: var(--w); height: 26px; padding: 0 9px; border-radius: 8px;
  background: color-mix(in srgb, var(--c) 28%, #FFFFFF); color: var(--ink); font-style: normal; transition: width 0.7s var(--ease) 0.1s; }
.stats-sheet:not(.open) .stats-chart i { width: 28px; }
.stats-chart li.today i { background: var(--c); color: var(--on, #FFFFFF); }
.stats-chart li.none i { background: var(--soft); color: var(--ink-2); }
.stats-chart b { font-size: 12px; font-weight: 750; }
.stats-chart li.empty { display: block; padding: 18px 16px; border-radius: 14px; background: var(--soft); color: var(--ink-2); font-weight: 500; text-align: center; }
.stats-next { margin: 20px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); text-align: center; }
.stats-next b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.stats-sheet[data-game="higher"] { --c: #EE4710; }
.stats-sheet[data-game="price"] { --c: #0B6B4F; }
.stats-sheet[data-game="window"] { --c: #E0412F; }
.stats-sheet[data-game="sort"] { --c: #F4AC00; --on: #2B1E00; }
.stats-sheet[data-game="lock"] { --c: #0E7C74; }
.stats-sheet[data-game="onestar"] { --c: #6C4CF1; }
.stats-sheet[data-game="stack"] { --c: #E83E8C; }
@media (prefers-reduced-motion: reduce) { .stats-box { transform: none; } }
@media (min-width: 521px) and (max-width: 1179px) {
  /* Tablets: one tidy line. The game list scrolls if it has to, "Your stats" is just its icon. */
  .nav nav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); }
  .nav nav::-webkit-scrollbar { display: none; }
  .tabs { padding-right: 24px; }
  .tabs a, .nav-link, .nav-end { white-space: nowrap; }
  .nav-link { margin-left: 0; }
  .nav-link.stats-open { display: grid; place-items: center; width: 36px; height: 36px; margin-left: 6px; border-radius: 50%; color: var(--ink-2); }
  .stats-open > span:last-child { display: none; }
  .stats-open .nav-i { display: grid; width: auto; height: auto; background: none; }
  .stats-open + .sound { margin-left: 0; }
}
