/* sushigod page CSS, loaded after the taste kit (assets/*). DESIGN.md is the source of every value.
   Only what the kit lacks: the self-hosted faces, the dealt :root, the halo mark, game zones, sprites
   with live-text signs, the hero window's scene, and per-group panel heights. */

/* ---------- faces (self-hosted; no third-party requests) */
@font-face { font-family: "Epilogue"; src: url("/fonts/epilogue-latin-var.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Jersey 10"; src: url("/fonts/Jersey10-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }

/* ---------- the dealt palette and pairing (start.mjs css --page gaming --palette plum-black-pink --type epilogue --radius round),
   kept as printed; the one change: --font-mono drops JetBrains Mono so the site loads two families (DESIGN.md section 3) */
:root {
  --p-bg: #0d060b; --p-surface: #1b0e17; --p-ink: #ffffff; --p-muted: #9a8f97;
  --p-accent: #ff488b; --p-accent-ink: #0d060b; --p-action: #ff488b; --p-action-ink: #0d060b;
  --p-inv-bg: #ffffff; --p-inv-surface: #ebebeb; --p-inv-ink: #0d060b; --p-inv-muted: #5e575c;
  --p-inv-accent: #ff488b; --p-inv-accent-ink: #0d060b; --p-inv-action: #ff488b; --p-inv-action-ink: #0d060b;
  --font-display: "Epilogue", system-ui, sans-serif;
  --font-text: "Epilogue", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 400;
  --display-tracking: -0.035em;
  --display-tracking-xl: -0.045em;
  --ly-scale: 0.97;
  --ground-bg: #1b0e17;
  --sign-ink: #3b1d10;
}

/* ---------- the halo mark: the dealt arc, set as a halo over the wordmark's end (the "god") */
.halo { display: inline-flex; align-items: flex-end; position: relative; padding-top: .34em; font-weight: 500; letter-spacing: -0.04em; }
.halo::before { content: ""; position: absolute; right: .04em; top: 0; width: .86em; height: .4em; border: .1em solid var(--p-accent); border-bottom: 0; border-radius: 1em 1em 0 0; }
.nav__logo .halo { font-size: 22px; }
.footer__mark .halo { font-size: inherit; }

/* ---------- the nav's language word stays one word */
.nav__lang { white-space: nowrap; }

/* ---------- game zones: everything a game brings, scoped by [data-game] (set from its content file) */
[data-game] { --g-font: var(--game-font, var(--font-display)); }
[data-game] .g-name, [data-game] .g-h { font-family: var(--g-font); font-weight: 400; letter-spacing: 0; }
html[data-buttons="solid"] .btn--primary { box-shadow: 0 4px 0 #a3204f; }
html[data-buttons="solid"] .btn--secondary { box-shadow: 0 4px 0 #000; }
html[data-buttons="solid"] .btn:active { box-shadow: 0 1px 0 #000; }
.ground-inverse .btn--secondary { box-shadow: 0 4px 0 #c9c3c6; }
.badge { display: inline-flex; align-items: center; height: 28px; padding: 0 var(--s-3); border-radius: 99px; font: 500 13px/1 var(--font-text); background: var(--g-accent, var(--p-accent)); color: #0d060b; }
.status-pill { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--s-3); border-radius: 99px; font: 500 14px/1.2 var(--font-text); background: var(--g-accent); color: #0d060b; }

/* ---------- pixel art: integer scales only, never smoothed */
.px, .sushi img, .scene > img { image-rendering: pixelated; }

/* ---------- a sprite with a blank sign; the sum on it is live text */
.sushi { --sushi: var(--sushi-default, 128px); position: relative; display: block; aspect-ratio: 1; width: var(--sushi); flex: none; }
.sushi > img { display: block; width: 100%; height: 100%; }
.sushi .sign { position: absolute; display: grid; place-items: center;
  font: 400 calc(var(--sushi, 128px) * .21)/1 "Jersey 10", ui-monospace, monospace; color: var(--sign-ink); white-space: nowrap; }

/* ---------- the home hero's window: SushiBrain being played, a 4 s loop (kit hero--centred holds it) */
.hero--centred .hero__window { --ground-bg: color-mix(in oklab, var(--p-accent) 14%, var(--p-bg)); border: 1px solid color-mix(in oklab, var(--p-accent) 30%, transparent); border-bottom: 0; }
.gwin { background: var(--g-ground); border: 1px solid rgb(255 255 255 / .14); border-radius: var(--r-md); overflow: hidden; box-shadow: 0 24px 48px rgb(13 6 11 / .5); }
.gwin__bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: 10px var(--s-4); font: 500 13px/1.2 var(--font-text); color: var(--p-muted); background: var(--p-bg); }
.gwin__bar b { color: var(--p-ink); font-weight: 500; }
.scene { position: relative; height: 300px; overflow: hidden; }
.scene > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 55%; }
.hud { position: absolute; left: var(--s-4); right: var(--s-4); top: var(--s-3); display: flex; justify-content: space-between; align-items: center;
  font: 400 26px/1 "Jersey 10", ui-monospace, monospace; color: #fff; text-shadow: 0 2px 0 #000; }
.hud__hearts { display: flex; gap: 4px; }
.hud__hearts img { width: 32px; height: 32px; }
.typed { position: absolute; left: 50%; bottom: var(--s-4); transform: translateX(-50%); min-width: 120px; text-align: center;
  font: 400 34px/1 "Jersey 10", ui-monospace, monospace; color: var(--g-accent); background: rgb(13 6 11 / .86); padding: 6px 18px; border-radius: 10px; }
.scene .sushi { position: absolute; top: 0; }
.scene .s1 { --sushi: 128px; left: calc(50% - 64px); }
.scene .s2 { --sushi: 96px; left: 14%; top: 56px; }
.scene .s3 { --sushi: 96px; right: 13%; top: 20px; }
/* the round plays once (4 s) on load and rests on its finished picture (the sum answered, "56 ✓");
   the pointer on the window plays it again (house rule 5: loops restart on hover) */
.loop .s1 { animation: g-fall 3.2s steps(16) .4s 1 both; }
.loop .s2 { animation: g-drift 3.2s steps(16) .4s 1 both; }
.loop .s3 { animation: g-drift 3.2s steps(16) .4s 1 both; }
.loop .typed::after { content: "56 ✓"; animation: g-type 3.2s steps(1) .4s 1 both; }
@media (prefers-reduced-motion: no-preference) {
  .hero__window:hover .loop .s1 { animation-name: g-fall-again; }
  .hero__window:hover .loop .s2, .hero__window:hover .loop .s3 { animation-name: g-drift-again; }
  .hero__window:hover .loop .typed::after { animation-name: g-type-again; }
}
@keyframes g-fall { 0% { transform: translateY(-24px) scale(1); opacity: 1 } 70% { transform: translateY(84px) scale(1) } 80% { transform: translateY(90px) scale(1.15); opacity: 1 } 92%, 100% { transform: translateY(90px) scale(0); opacity: 0 } }
@keyframes g-fall-again { 0% { transform: translateY(-24px) scale(1); opacity: 1 } 70% { transform: translateY(84px) scale(1) } 80% { transform: translateY(90px) scale(1.15); opacity: 1 } 92%, 100% { transform: translateY(90px) scale(0); opacity: 0 } }
@keyframes g-drift { 0% { transform: translateY(0) } 100% { transform: translateY(56px) } }
@keyframes g-drift-again { 0% { transform: translateY(0) } 100% { transform: translateY(56px) } }
@keyframes g-type { 0% { content: "" } 30% { content: "5" } 55% { content: "56" } 80%, 100% { content: "56 ✓" } }
@keyframes g-type-again { 0% { content: "" } 30% { content: "5" } 55% { content: "56" } 80%, 100% { content: "56 ✓" } }
@media (prefers-reduced-motion: reduce) {
  .loop .s1, .loop .s2, .loop .s3 { animation: none; }
  .loop .typed::after { animation: none; content: "56 ✓"; }
}
@media (max-width: 639px) {
  .scene { height: 210px; }
  .scene .s2, .scene .s3, .gwin__bar span:last-child { display: none; }
  .scene .s1 { --sushi: 96px; left: calc(50% - 48px); }
  .hud { font-size: 20px; } .hud__hearts img { width: 24px; height: 24px; }
  .typed { font-size: 26px; min-width: 96px; }
}

/* ---------- game tile (home and /games): the game's art fills the tile; words in an opaque box */
.gtile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 520px; padding: var(--s-5);
  border-radius: var(--r-lg); overflow: hidden; border: 1px solid rgb(255 255 255 / .14); color: var(--p-ink); text-decoration: none; background: var(--g-ground); }
.gtile > .gtile__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; }
.gtile__box { position: relative; background: var(--p-bg); border-radius: var(--r-md); padding: var(--s-5) var(--s-6); max-width: 480px; display: grid; gap: var(--s-2); justify-items: start; }
.gtile__box .g-name { font-size: 36px; line-height: 1; margin: var(--s-1) 0 0; }
.gtile__box p { color: var(--p-ink); margin: 0; }
.gtile__box .link { margin-top: var(--s-2); color: var(--g-accent); }
.gtile .sushi { position: absolute; right: var(--s-6); top: var(--s-6); --sushi: 128px; }
.nexttile { display: flex; flex-direction: column; justify-content: space-between; min-height: 520px; padding: var(--s-6); border-radius: var(--r-lg); background: var(--p-surface); border: 1px dashed rgb(255 255 255 / .2); }
.nexttile .halo { font-size: 32px; align-self: flex-start; }
.nexttile__mark { flex: 1; display: grid; place-items: center; min-height: 120px; }
.nexttile__mark .halo { font-size: clamp(56px, 6vw, 88px); align-self: center; color: #7d717a; } /* 4.0:1 on the tile: a quiet mark that still passes large-text contrast */
.nexttile h3 { margin: 0 0 var(--s-2); font-size: var(--t-h3); }
.nexttile p { color: var(--p-ink); margin: 0; }
.hero--centred .hero__lead { color: var(--ink); }
@media (max-width: 1023px) { .gtile, .nexttile { min-height: 360px; } .gtile .sushi { --sushi: 96px; right: var(--s-4); top: var(--s-4); } }
@media (max-width: 639px) { .gtile { min-height: 420px; padding: var(--s-3); } .gtile__box { padding: var(--s-4); } .gtile__box .g-name { font-size: 26px; } .nexttile { min-height: 240px; } }

/* ---------- the parents' section (home): the real start screen beside the facts */
.menushot { width: 100%; max-width: 330px; aspect-ratio: 660 / 1434; object-fit: cover; object-position: top; border-radius: var(--r-lg); border: 1px solid var(--line); display: block; }
.facts-list { display: grid; gap: var(--s-4); margin: 0; padding: 0; list-style: none; }
.facts-list li { display: grid; gap: var(--s-1); padding-bottom: var(--s-4); border-bottom: 1px solid var(--line); }
.facts-list h3 { font: 500 var(--t-lead)/1.35 var(--font-text); letter-spacing: 0; margin: 0; }
.facts-list p { margin: 0; color: var(--ink); max-width: 56ch; }

/* ---------- the game page */
.hero--photo[data-game] .hero__text { --muted: var(--p-muted); }
.hero--photo .g-name { font-size: clamp(56px, 6vw + 8px, 96px); line-height: .95; max-width: none; }
.hero--photo .g-genre { display: block; font: 500 var(--t-lead)/1.3 var(--font-text); letter-spacing: 0; color: var(--p-ink); margin-top: var(--s-2); }
.crumb { font: 500 13px/1.2 var(--font-text); color: var(--p-muted); margin: 0 0 var(--s-3); }
.crumb a { color: var(--p-muted); }
.hero--photo .hero__sushi { position: absolute; z-index: 1; left: 33%; top: 34%; --sushi: 192px; }
@media (max-width: 1023px) { .hero--photo .hero__sushi { --sushi: 128px; top: calc(var(--nav) + 24px); left: auto; right: 8%; } }

.play-card { background: var(--g-ground); border: 1px solid rgb(255 255 255 / .14); border-radius: var(--r-lg); padding: var(--s-6); display: grid; justify-items: center; gap: var(--s-4); text-align: center; position: relative; overflow: hidden; }
.play-card > .play-card__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 70%; opacity: .35; }
.play-card > * { position: relative; }
.play-card .sushi { --sushi: 176px; }
.play-card .sushi.pop { animation: s-pop .45s steps(4) forwards; }
@keyframes s-pop { 50% { transform: scale(1.15) } 100% { transform: scale(0); opacity: 0 } }
.answer { display: flex; gap: var(--s-2); width: 100%; max-width: 340px; }
.answer input { flex: 1; min-width: 0; height: 56px; font: 400 36px/1 "Jersey 10", ui-monospace, monospace; text-align: center;
  background: var(--p-bg); color: var(--p-ink); border: 2px solid #3a2230; border-radius: var(--r-sm); padding: 0 var(--s-3); }
.answer input:focus-visible { border-color: var(--g-accent); outline: 2px solid var(--g-accent); outline-offset: 2px; }
.answer input { height: 48px; font-size: 32px; }
.answer-label { font: 500 14px/1.3 var(--font-text); color: var(--p-ink); margin: 0 0 calc(-1 * var(--s-2)); }
.answer-msg { width: 100%; min-height: 1.5em; margin: 0; font: 500 16px/1.5 var(--font-text); color: var(--p-ink); }
.answer-msg b { color: var(--g-accent); font-weight: 500; }
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-4); }
.steps li { font-size: 18px; line-height: 1.55; }
.step-n { font: 400 28px/1 "Jersey 10", ui-monospace, monospace; color: var(--g-accent); margin-right: var(--s-3); vertical-align: -2px; }
@media (prefers-reduced-motion: reduce) { .play-card .sushi.pop { animation: none; } }
@media (max-width: 639px) { .play-card { padding: var(--s-4); } .play-card .sushi { --sushi: 128px; } }

.levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gutter); margin: 0; padding: 0; list-style: none; }
.levels li { display: grid; gap: var(--s-2); align-content: start; padding-top: var(--s-4); border-top: 1px solid var(--line); }
.levels .sushi { --sushi: 128px; margin: 0 0 var(--s-2); }
.levels .level-name { margin: 0; font-size: 36px; line-height: 1; }
.levels p { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); margin-top: var(--s-8); }
.stat .t-small { margin-top: var(--s-1); }
@media (max-width: 1023px) { .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); } .levels .sushi { --sushi: 96px; } }
@media (max-width: 639px) { .levels li { padding-top: var(--s-3); } .levels .sushi { --sushi: 64px; margin: 0 0 var(--s-1); } .levels .level-name { font-size: 28px; } .stats { margin-top: var(--s-5); } }

/* ---------- plain pages (Support, Privacy, Games index): one reading column */
.prose { max-width: 68ch; }
.prose h2 { font-size: var(--t-h3); margin: var(--s-8) 0 var(--s-3); }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { font-size: 17px; line-height: 1.65; }
.prose ul { padding-left: 1.2em; }
.todo { outline: 2px dashed #ff8a7a; outline-offset: 2px; }

/* footer legal row: each item its own flex item, so a wrapped link starts on the left line */
.footer__legal .legal-links { display: inline-flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); }

/* the centred hero h1: wide enough that a 36-character headline (heroes.json maxChars) stays on two lines */
.hero--centred h1 { max-width: 20ch; }

/* game hero on a phone: a shorter picture and no breadcrumb, so the main button is on the first screen */
@media (max-width: 639px) {
  .hero--photo[data-game] { --photo: 30svh; }
  .hero--photo[data-game] .crumb { display: none; }
}
