/* rastegar.se — editorial, illustrated, quiet.
   Full-bleed scenes, a serif that carries the voice, and white space doing
   most of the work. Every illustration is drawn by hand in SVG or CSS.
   Mobile first. */

/* ------------------------------------------------------------------ fonts */
@font-face {
  font-family: 'Noto Serif Display';
  src: url('/static/fonts/noto-serif-display.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Great Vibes';
  src: url('/static/fonts/great-vibes.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ----------------------------------------------------------------- tokens */
:root {
  --ink: #16120f;
  --ink-soft: #6d635b;
  --hair: rgba(22, 18, 15, .14);
  --paper: #ffffff;
  --sand: #f7f2ec;
  --tan: #c9a582;
  --red: #ff2d55;
  --red-deep: #cf0035;
  --serif: 'Noto Serif Display', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1180px;
  --measure: 64ch;
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
p { margin: 0 0 1.15em; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.01em;
  margin: 0 0 .55em;
}

.kicker, .eyebrow {
  display: block; font-family: var(--sans); font-size: .72rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--ink-soft);
  margin: 0 0 .9rem;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--ink); color: #fff; padding: .6rem 1rem; }
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* --------------------------------------------------------------- masthead */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}
.masthead__inner {
  max-width: var(--wrap); margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .85rem 1.25rem;
}
/* The wordmark: a script name, a hairline, and the domain underneath in
   letterspaced capitals. Sized so the hairline never touches the descenders. */
.logo { display: inline-block; text-decoration: none; line-height: 1; padding: .1rem 0; }
.logo__script {
  display: block; font-family: 'Great Vibes', 'Snell Roundhand', cursive;
  font-size: 1.9rem; line-height: 1.05; letter-spacing: .01em;
  padding: 0 .3rem .05rem 0;
}
.logo__rule { display: block; height: 1px; background: var(--tan); margin: .12rem 0 .22rem; }
.logo__domain {
  display: block; font-family: var(--sans); font-size: .53rem; font-weight: 600;
  letter-spacing: .34em; text-transform: uppercase; color: var(--ink-soft);
  padding-left: .1em;
}
.logo:hover .logo__rule { background: var(--red); }
@media (min-width: 800px) {
  .logo__script { font-size: 2.1rem; }
  .logo__domain { font-size: .56rem; }
}

/* 44px square: the smallest thing a thumb should be asked to hit. It measured
   37 by 41 before, which is a miss waiting to happen on the one control every
   phone visitor needs. */
.menu-toggle {
  background: none; border: 0; padding: 0; cursor: pointer; color: inherit;
  min-width: 44px; min-height: 44px; display: grid; place-items: center;
}
.menu-toggle__bars { display: block; width: 24px; }
.menu-toggle__bars i {
  display: block; height: 1.5px; background: currentColor; margin: 6px 0;
  transition: transform .2s ease, opacity .2s ease;
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bars i:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars i:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars i:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.sitenav { display: none; width: 100%; order: 3; padding: .4rem 0 .6rem; }
.sitenav.open { display: block; }
.sitenav a {
  display: block; padding: .75rem .1rem; text-decoration: none;
  font-size: .78rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  border-bottom: 1px solid var(--hair);
}
.sitenav a.active { color: var(--red); }

@media (min-width: 800px) {
  .menu-toggle { display: none; }
  .sitenav { display: flex; width: auto; order: 0; padding: 0; gap: 2rem; }
  .sitenav a { border: 0; padding: .2rem 0; position: relative; }
  .sitenav a::after {
    content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1px;
    background: var(--ink); transition: right .25s ease;
  }
  .sitenav a:hover::after, .sitenav a.active::after { right: 0; }
}

/* ----------------------------------------------------------------- layout */
main { display: block; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.measure { max-width: var(--measure); margin-left: auto; margin-right: auto; }
/* Vertical only. Every .section in the templates also carries .wrap, and a
   `padding: 4rem 0` shorthand here silently resets .wrap's side padding —
   which put the body text flush against the screen edge on phones. */
.section { padding-block: 4rem; }
.section--tight { padding-block: 2.5rem; }
.full { width: 100vw; margin-left: calc(50% - 50vw); }
.center { text-align: center; }

.section-head { text-align: center; margin: 0 auto 2.4rem; max-width: 46ch; }
.section-head h2 { font-size: clamp(1.7rem, 4.2vw, 2.6rem); margin-bottom: .5rem; }
.section-head p { color: var(--ink-soft); margin: 0; }
.rule { width: 46px; height: 1px; background: var(--tan); margin: 1.3rem auto; border: 0; }

/* ------------------------------------------------------------------- hero */
.hero {
  position: relative; min-height: 78vh; display: grid; align-items: end;
  background: #1b4a86 url('/static/img/scene-dawn.svg') center / cover no-repeat;
  color: #fff;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,14,30,.42) 0%, rgba(12,14,30,0) 34%, rgba(12,14,30,.5) 100%);
}
.hero__inner {
  position: relative; z-index: 2; max-width: var(--wrap); margin: 0 auto;
  padding: 8rem 1.5rem 4.5rem; text-align: center; width: 100%;
}
.hero .kicker { color: rgba(255,255,255,.82); }
.hero__title {
  font-size: clamp(2.6rem, 8vw, 5.2rem); margin: 0 0 .35em; color: #fff;
  text-shadow: 0 2px 30px rgba(10,12,26,.45);
}
.hero__tagline {
  font-size: clamp(1rem, 2.2vw, 1.2rem); max-width: 40ch; margin: 0 auto 2rem;
  color: rgba(255,255,255,.92);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
/* Stacked, the two buttons were 204px and 212px wide — an eight-pixel ragged
   edge down the middle of the first thing anyone sees. Give them one width. */
@media (max-width: 520px) {
  .hero__cta { flex-direction: column; align-items: center; }
  .hero__cta .btn { width: min(260px, 100%); text-align: center; }
}

/* full-bleed illustrated band used between sections */
.band {
  position: relative; padding: 5rem 1.5rem; color: #fff; text-align: center;
  background: #3a2a52 url('/static/img/scene-dusk.svg') center / cover no-repeat;
}
.band::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,16,32,.5), rgba(20,16,32,.3));
}
.band__inner { position: relative; z-index: 2; max-width: 54ch; margin: 0 auto; }
.band h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); color: #fff; }
.band p { color: rgba(255,255,255,.9); }
.band .kicker { color: rgba(255,255,255,.75); }
/* The practical line under the pitch: quieter than the pitch, still readable
   against the scene behind it. */
.band__note { font-size: .92rem; color: rgba(255,255,255,.72); max-width: 46ch; margin: 0 auto 1.6rem; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-block; font-family: var(--sans); font-size: .78rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; text-decoration: none;
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
  padding: .95rem 1.7rem; cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover, .btn:focus-visible { background: var(--red); border-color: var(--red); color: #fff; }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn--ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn--small { padding: .6rem 1.1rem; font-size: .7rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.linkrow { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; justify-content: center; }
/* Stacked, buttons of different word lengths leave a ragged edge down the
   middle. Give them one width, the same as the hero's pair. */
@media (max-width: 520px) {
  .linkrow { flex-direction: column; align-items: center; }
  .linkrow .btn { width: min(260px, 100%); text-align: center; }
}

.more {
  display: inline-flex; align-items: center; gap: .5rem; text-decoration: none;
  font-size: .74rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  border-bottom: 1px solid var(--tan); padding-bottom: .25rem;
}
.more:hover { border-color: var(--ink); }
.more--block { margin: 2.2rem auto 0; display: table; }

/* --------------------------------------------------------------- pagehead */
.pagehead { text-align: center; padding: 4.5rem 1.25rem 2.5rem; max-width: 46ch; margin: 0 auto; }
.pagehead__title { font-size: clamp(2.2rem, 6vw, 3.6rem); margin-bottom: .4rem; }
.pagehead__sub { color: var(--ink-soft); margin: 0; }
.pagehead--game { padding-bottom: 1.5rem; }
.pagehead__title--huge { font-size: clamp(4rem, 18vw, 8rem); }

/* The base every .panel--* modifier overrides. It has to sit ABOVE all of
   them: modifier and base weigh the same to the cascade, so whichever is
   written last wins. Written below the game shelf, this rule put a hairline
   box and 28px of padding back on cards that had asked for neither. */
.panel { background: var(--paper); border: 1px solid var(--hair); padding: 1.75rem; }

/* ------------------------------------------------------------ game shelf */
.grid { display: grid; gap: 2.2rem 1.6rem; }
.grid--games { grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid--games { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 940px) { .grid--games { grid-template-columns: repeat(3, 1fr); } }

.panel--game { display: block; text-decoration: none; color: inherit; position: relative; border: 0; padding: 0; }
.game-card__art {
  display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden;
  font-family: var(--serif); font-size: 3.4rem; color: rgba(255,255,255,.92);
  background: linear-gradient(165deg, #4f92c9, #1b4a86);
  transition: transform .5s ease;
}
.panel--game:nth-child(4n+2) .game-card__art { background: linear-gradient(165deg, #eb9a72, #a9718c); }
.panel--game:nth-child(4n+3) .game-card__art { background: linear-gradient(165deg, #7fb99a, #24564f); }
.panel--game:nth-child(4n+4) .game-card__art { background: linear-gradient(165deg, #b8617a, #3a2a52); }
.panel--game:hover .game-card__art { transform: scale(1.035); }
.game-card__art img { width: 100%; height: 100%; object-fit: cover; }
.game-card__text { display: block; padding: 1rem .1rem 0; }
.game-card__text .kicker { margin-bottom: .45rem; }
.game-card__title { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.32rem; line-height: 1.25; }
.game-card__tagline { display: block; color: var(--ink-soft); font-size: .95rem; margin-top: .3rem; }
.panel--game:hover .game-card__title { text-decoration: underline; text-underline-offset: 4px; }

/* ------------------------------------------------------------- text cards */
.panel--intro, .panel--note { border: 0; padding: 0; }
.panel--status { background: var(--sand); border: 0; border-left: 2px solid var(--tan); padding: 1.5rem 1.75rem; }
.cardlink { text-decoration: none; display: block; }
.stack > * + * { margin-top: 2rem; }

/* ---------------------------------------------------------------- devlog */
.feed { display: grid; gap: 0; max-width: 760px; margin: 0 auto; }
.panel--post { border: 0; border-top: 1px solid var(--hair); padding: 2rem 0; }
.feed .cardlink:first-child .panel--post { border-top: 0; }
.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .7rem;
  font-size: .7rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: .7rem;
}
.post-meta time { color: var(--ink); }
.chip { color: var(--tan); }
.panel--post h2 { font-size: clamp(1.35rem, 3.2vw, 1.85rem); margin-bottom: .5rem; }
.panel--post p { color: var(--ink-soft); margin-bottom: .8rem; }
.posthead { text-align: center; max-width: 46ch; margin: 0 auto 2.5rem; }
.posthead .post-meta { justify-content: center; }
.posthead__title { font-size: clamp(2rem, 5.5vw, 3.2rem); }

/* ----------------------------------------------------------------- prose */
.prose { max-width: var(--measure); margin: 0 auto; font-size: 1.06rem; }
.prose--wide { max-width: 760px; }
/* About and Controls on a game page are h2 now — they hung off the page's h1
   as h3 and h4, which left a hole in the outline a screen reader reads out. */
.prose h2 { font-size: 1.5rem; margin-top: 2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.5rem; margin-top: 2em; }
.prose h3:first-child { margin-top: 0; }
.prose h4 { font-size: 1.15rem; margin-top: 1.8em; }
.prose a { color: var(--ink); text-decoration-color: var(--tan); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--red); }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin-bottom: .45em; }
.prose blockquote {
  margin: 1.8em 0; padding: 0 0 0 1.4rem; border-left: 2px solid var(--tan);
  font-family: var(--serif); font-size: 1.15em; font-style: italic; color: var(--ink);
}
.prose code { font-family: var(--mono); font-size: .86em; background: var(--sand); padding: .12em .4em; }
.prose pre { background: var(--ink); color: #f6f1ea; padding: 1.2rem; overflow-x: auto; }
.prose pre code { background: none; color: inherit; }
.tone-rule { border: 0; height: 1px; background: var(--hair); margin: 2.4em 0; }
.spoiler-warning {
  font-size: .72rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--red-deep); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
  padding: .7rem 0; margin: 1.4rem 0;
}

/* ------------------------------------------------------------- anime page */
.panel--series { border: 0; border-top: 1px solid var(--hair); padding: 2.5rem 0 0; }
.series__head { text-align: center; max-width: 44ch; margin: 0 auto 2rem; }
.series__head h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: .4rem; }
.series__verdict { color: var(--ink-soft); margin: 0; }
.entries { list-style: none; margin: 0 auto 1.6rem; padding: 0; max-width: 760px; display: grid; gap: 1.6rem; }
@media (min-width: 700px) { .entries { grid-template-columns: 1fr 1fr; gap: 1.8rem 2.4rem; } }
.entry__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; justify-content: space-between; }
.entry h3 { margin: 0 0 .15em; font-size: 1.12rem; }
.stars { color: var(--tan); letter-spacing: .12em; font-size: .9rem; }
.entry__status {
  display: inline-block; font-size: .64rem; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: .35rem;
}
.status--watching { color: var(--red); }
.status--dropped { opacity: .5; }
.entry p { margin: .2em 0 0; font-size: .96rem; color: var(--ink-soft); }
.panel--series .btn { margin: 0 auto; display: table; }

/* ------------------------------------------------------------------ game */
.section--game { padding-block: 1rem 2rem; }
.panel--stage { border: 0; padding: 0; background: none; }
#game-root { position: relative; }

/* Dashh is a whole WebGL page of its own, so it runs in a frame on a black
   stage rather than in the paper panels the canvas games use. */
.dashh { position: relative; background: #05060c; border: 1px solid var(--hair); }
.dashh__frame { display: block; width: 100%; aspect-ratio: 16 / 10; border: 0; }

/* Fullscreen: the frame drops its aspect ratio and takes the whole screen,
   because the game letterboxes itself and reflows its own HUD. */
#game-root:fullscreen .dashh,
#game-root:-webkit-full-screen .dashh,
#game-root.fs-fallback .dashh { width: 100%; height: 100%; border: 0; }
#game-root:fullscreen .dashh__frame,
#game-root:-webkit-full-screen .dashh__frame,
#game-root.fs-fallback .dashh__frame { aspect-ratio: auto; height: 100%; }

/* A phone gets a tap-to-start card rather than a heavy 3D page loading itself
   over mobile data the moment the page opens. */
.dashh__notice { display: none; }
@media (pointer: coarse) {
  .dashh__notice {
    display: grid; gap: 1.2rem; justify-items: center; text-align: center;
    padding: 2.8rem 1.5rem; color: rgba(246,241,234,.9);
  }
  .dashh__notice p { margin: 0; font-size: .95rem; line-height: 1.6; }
  .dashh__notice strong { color: #fff; }
  .dashh__frame, .dashh__full { display: none; }
  .dashh.is-open .dashh__notice { display: none; }
  .dashh.is-open .dashh__frame, .dashh.is-open .dashh__full { display: block; }
  .dashh__frame { aspect-ratio: 3 / 4; }
  /* the game centres its own stats along the top, so keep out of that lane */
  .dashh__full { right: auto; left: .7rem; font-size: .6rem; padding: .4rem .7rem; }
}

.grid--split { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .grid--split { grid-template-columns: 1.6fr 1fr; align-items: start; } }
.controls { list-style: none; padding: 0; }
.controls li { border-bottom: 1px solid var(--hair); padding: .55rem 0; font-size: .96rem; }
.controls li:last-child { border: 0; }
kbd { font-family: var(--mono); font-size: .82em; background: var(--sand); padding: .1em .4em; }

.stage { position: relative; background: #fff; border: 1px solid var(--hair); min-height: 420px; display: flex; flex-direction: column; }
.stage--arcade { min-height: 0; }
.stage__hud {
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  background: var(--ink); color: #f6f1ea; padding: .6rem .9rem;
  font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
}
.stage__hud strong { font-family: var(--serif); font-size: 1.1rem; letter-spacing: 0; }
.hud__timer.low { color: #ff8aa4; }
.stage__body { flex: 1; padding: 1.6rem; display: flex; flex-direction: column; justify-content: center; }
.stage__overlay {
  position: absolute; inset: 0; background: rgba(22,18,15,.94); color: #fff;
  display: grid; align-content: center; justify-items: center; text-align: center;
  padding: 1.6rem; gap: .9rem; z-index: 5; overflow-y: auto;
}
/* A list longer than the stage must grow downwards; centred content that
   overflows loses its own first row off the top edge. */
.stage__overlay--list { align-content: start; }
.stage__overlay h2 { font-size: clamp(1.6rem, 6vw, 2.4rem); color: #fff; margin: 0; }
.stage__overlay .big { font-family: var(--serif); font-size: clamp(2.6rem, 13vw, 4.4rem); color: var(--tan); line-height: 1; }
.stage__overlay p { margin: 0; color: rgba(255,255,255,.85); }
.hidden { display: none !important; }

/* quiz */
.difficulties { display: grid; gap: .8rem; }
.difficulty {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  width: 100%; text-align: left; cursor: pointer;
  /* Explicit, because the dojo lists its drills inside the overlay, where the
     inherited colour is the same white the card is painted with. */
  color: var(--ink);
  background: #fff; border: 1px solid var(--hair); padding: 1rem 1.1rem;
  font-family: var(--serif); font-weight: 700; font-size: 1.15rem;
  transition: border-color .2s ease, background .2s ease;
}
.difficulty small {
  display: block; margin-top: .25rem; font-family: var(--sans); font-weight: 400;
  font-size: .84rem; line-height: 1.5; color: var(--ink-soft);
}
.difficulty > span:last-child {
  white-space: nowrap; align-self: center; font-family: var(--sans); font-size: .7rem;
  font-weight: 600; letter-spacing: .18em; color: var(--tan);
}
.difficulty:hover { border-color: var(--ink); background: var(--sand); }
.quiz__question { font-family: var(--serif); font-size: clamp(1.3rem, 4.4vw, 1.7rem); line-height: 1.3; margin: 0 0 1.2rem; }
.quiz__progress { font-size: .68rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .5rem; }
.quiz__options { display: grid; gap: .6rem; }
.quiz__option {
  text-align: left; cursor: pointer; padding: .85rem 1rem;
  background: #fff; border: 1px solid var(--hair); font-size: 1rem;
  transition: border-color .15s ease, background .15s ease;
}
.quiz__option:hover:not([disabled]) { border-color: var(--ink); background: var(--sand); }
.quiz__option.correct { background: var(--ink); color: #fff; border-color: var(--ink); }
.quiz__option.wrong { background: var(--red); color: #fff; border-color: var(--red); }
.quiz__option[disabled] { cursor: default; }
.quiz__feedback { margin-top: 1rem; min-height: 1.5em; font-size: .96rem; color: var(--ink-soft); }
.quiz__feedback b { color: var(--ink); }
.quiz__review { list-style: none; padding: 0; margin: 1.2rem 0 0; text-align: left; max-height: 40vh; overflow-y: auto; }
.quiz__review li { border-top: 1px solid rgba(255,255,255,.15); padding: .6rem 0; font-size: .9rem; }
.quiz__review .mark { color: var(--tan); }

/* arcade */
.arcade { position: relative; background: #fff; border: 1px solid var(--hair); }
.arcade canvas { width: 100%; height: auto; display: block; touch-action: none; }

/* ---------------------------------------------------------- keyboard dojo */
/* Hairlines and paper like everything else, with red saved for the one key
   you are meant to press next. */
.stage--dojo { min-height: 0; }
.dojo { gap: 1.1rem; }
.dojo__stat { display: flex; align-items: baseline; gap: .4rem; }

.dojo__text {
  font-family: var(--mono); font-size: clamp(1rem, 4.2vw, 1.25rem); line-height: 2;
  height: 6em; overflow: hidden; position: relative; user-select: none;
  border-bottom: 1px solid var(--hair);
}
.dojo__scroll { transition: transform .15s ease; }
.dojo__word { display: inline-block; white-space: pre; }
.dojo__ch { color: rgba(22, 18, 15, .32); }
.dojo__ch.is-right { color: var(--ink); }
.dojo__ch.is-wrong { color: #fff; background: var(--red); }
.dojo__ch.is-current { color: #fff; background: var(--ink); }

.dojo__hint {
  margin: 0; min-height: 1.4em; color: var(--ink-soft);
  font-size: .7rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
}

.dojo__hands { display: flex; justify-content: center; gap: 1.8rem; }
.dojo__hand { display: flex; align-items: flex-end; gap: 5px; }
.dojo__hand--right { flex-direction: row-reverse; }
.dojo__finger, .dojo__thumb {
  width: 13px; background: transparent;
  border: 1.5px solid rgba(22, 18, 15, .3); border-radius: 7px 7px 2px 2px;
}
.dojo__thumb { width: 20px; height: 12px; border-radius: 6px; margin-left: 5px; }
.dojo__hand--right .dojo__thumb { margin: 0 5px 0 0; }
.dojo__finger.is-next, .dojo__thumb.is-next { background: var(--red); border-color: var(--red); }

.dojo__kb { display: flex; flex-direction: column; gap: 5px; }
.dojo__kb.is-hidden { visibility: hidden; }
.dojo__kbrow { display: flex; gap: 5px; }
.dojo__key {
  flex: 1 1 0; min-width: 0; height: 40px; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--hair);
  font-family: var(--mono); font-size: .78rem; line-height: 1;
}
.dojo__key small { font-size: .58rem; color: var(--ink-soft); }
.dojo__key--mod { background: var(--sand); color: var(--ink-soft); font-size: .58rem; }
/* The two bumps your index fingers hunt for on a real keyboard. */
.dojo__key.is-home::after {
  content: ""; position: absolute; bottom: 5px; width: 11px; height: 1.5px; background: var(--tan);
}
.dojo__key.is-next { background: var(--red); border-color: var(--red); color: #fff; }
.dojo__key.is-next small { color: rgba(255, 255, 255, .8); }
.dojo__key.is-wrong { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Off screen but focusable, so tapping the stage on a phone raises its keyboard. */
.dojo__input { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.dojo__opts { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; }
.dojo__toggle {
  cursor: pointer; background: transparent; border: 1px solid var(--hair); padding: .3rem .7rem;
  font-size: .66rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  transition: border-color .2s ease, background .2s ease;
}
.dojo__toggle:hover { border-color: var(--ink); background: var(--sand); }
.dojo__check {
  display: flex; align-items: center; gap: .45rem; cursor: pointer; color: var(--ink-soft);
  font-size: .66rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
}
/* The typist's own board, drawn on the dark overlay rather than on paper. */
.dojo__board { width: 100%; max-width: 22rem; text-align: left; }
.dojo__board h3 {
  margin: 0 0 .5rem; color: rgba(255, 255, 255, .75); font-family: var(--sans);
  font-size: .66rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
}
.dojo__board ol { list-style: none; padding: 0; margin: 0; counter-reset: rank; }
.dojo__board li {
  display: flex; align-items: baseline; gap: .8rem; padding: .4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, .15); font-size: .92rem; color: #fff;
}
.dojo__board li::before {
  counter-increment: rank; content: counter(rank);
  font-family: var(--serif); font-size: .92rem; color: var(--tan); min-width: 1.4em;
}
.dojo__board .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dojo__board .pts { font-family: var(--serif); font-size: 1.05rem; }
.dojo__board li.mine { color: var(--tan); }
.dojo__board .scoreboard__empty { color: rgba(255, 255, 255, .7); }

.dojo__worst { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; justify-content: center; }
.dojo__worst code { font-family: var(--mono); font-size: .85rem; background: var(--red); color: #fff; padding: .12em .5em; }
.dojo__note { font-size: .88rem; max-width: 38ch; }

@media (max-width: 420px) {
  .dojo__kb, .dojo__kbrow { gap: 3px; }
  .dojo__key { height: 32px; font-size: .68rem; }
  .dojo__key small { display: none; }
  /* Tab, Caps, Enter and friends are never the answer — reclaim their width
     for the keys that are. */
  .dojo__key--extra { display: none; }
  .dojo__key--mod { flex-grow: 1.7; font-size: .5rem; }
}

/* ---------------------------------------------------------------- kana dojo */
/* Same paper-and-hairline furniture as the keyboard dojo. The kana itself is
   the hero, so it gets the size and the system's own Japanese fonts. */
.stage--kana { min-height: 0; }
.kana { gap: 1rem; text-align: center; }
.kana [lang="ja"], .kana__prompt, .kana__cards {
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Noto Sans JP', var(--sans);
}
.kana__stat { display: flex; align-items: baseline; gap: .4rem; }
.kana__prompt { font-size: clamp(3.4rem, 16vw, 5.2rem); font-weight: 600; line-height: 1.2; min-height: 1.2em; }
.kana__prompt--small { font-size: clamp(2rem, 9vw, 3rem); }
.kana__sub { margin: 0; font-size: .9rem; color: var(--ink-soft); min-height: 1.4em; }
.kana__choices { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.kana__choice {
  cursor: pointer; padding: .9rem .6rem; background: #fff; border: 1px solid var(--hair);
  font-size: 1.3rem; line-height: 1.2;
  transition: border-color .15s ease, background .15s ease;
}
.kana__choice small { display: block; font-size: .6rem; color: var(--ink-soft); letter-spacing: .16em; }
.kana__choice:hover:not([disabled]) { border-color: var(--ink); background: var(--sand); }
.kana__choice.is-right { background: var(--ink); color: #fff; border-color: var(--ink); }
.kana__choice.is-right small { color: rgba(255,255,255,.7); }
.kana__choice.is-wrong { background: var(--red); color: #fff; border-color: var(--red); }
.kana__choice.is-wrong small { color: rgba(255,255,255,.7); }
.kana__choice[disabled] { cursor: default; }
.kana__write input {
  width: min(300px, 100%); margin: 0 auto; padding: .8rem .9rem; text-align: center;
  font-size: 1.2rem; background: #fff; border: 1px solid var(--hair);
}
.kana__write input:focus { border-color: var(--ink); outline: none; }
.kana__feedback { margin: 0; min-height: 1.5em; font-size: 1rem; color: var(--ink-soft); }
.kana__feedback.is-right { color: var(--ink); }
.kana__feedback.is-wrong { color: var(--red-deep); }
.kana__cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: .6rem; }
.kana__card { background: #fff; border: 1px solid var(--hair); padding: .6rem .3rem; cursor: pointer; }
.kana__card:hover { border-color: var(--ink); background: var(--sand); }
.kana__glyph { display: block; font-size: 1.7rem; line-height: 1.3; }
.kana__card--word .kana__glyph { font-size: 1.15rem; }
.kana__card small { color: var(--ink-soft); font-size: .74rem; }
.kana__opts { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; justify-content: center; margin-top: .9rem; }
.kana__toggle {
  cursor: pointer; background: transparent; border: 1px solid var(--hair); padding: .3rem .7rem;
  font-size: .66rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  transition: border-color .2s ease, background .2s ease;
}
.kana__toggle:hover { border-color: var(--ink); background: var(--sand); }
.kana__check {
  display: flex; align-items: center; gap: .45rem; cursor: pointer; color: var(--ink-soft);
  font-size: .66rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
}
.kana__worst { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; justify-content: center; }
.kana__worst code {
  font-family: 'Hiragino Sans', 'Yu Gothic', 'Noto Sans JP', var(--mono);
  font-size: .85rem; background: var(--red); color: #fff; padding: .12em .5em;
}
.kana__note { font-size: .88rem; max-width: 44ch; }

@media (max-width: 420px) {
  .kana__choices { gap: .5rem; }
  .kana__choice { font-size: 1.1rem; padding: .7rem .4rem; }
  .kana__cards { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
}

/* ------------------------------------------------------------ scoreboard */
/* The run summary the game hands out when you die, below the frame. Dashh
   draws its own world, so this is the one part of it the site styles. */
.dashh__result { background: var(--sand); padding: 1.5rem 1.75rem; margin-top: .8rem; text-align: center; }
.dashh__result-line {
  font-size: .72rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 .3rem;
}
.dashh__result .big { font-family: var(--serif); font-size: 2.6rem; line-height: 1; margin: 0 0 1rem; }
.dashh__result .score-submit { max-width: 22rem; margin: 0 auto; }

.panel--scores { background: var(--sand); border: 0; padding: 1.75rem; }
.panel--scores h2 { font-size: 1.2rem; }
.scoreboard ol { list-style: none; padding: 0; margin: 0; counter-reset: rank; }
.scoreboard li {
  display: flex; align-items: baseline; gap: .8rem; padding: .55rem 0;
  border-bottom: 1px solid var(--hair); font-size: .95rem;
}
.scoreboard li::before {
  counter-increment: rank; content: counter(rank);
  font-family: var(--serif); font-size: .95rem; color: var(--tan); min-width: 1.6em;
}
.scoreboard .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoreboard .pts { font-family: var(--serif); font-weight: 700; }
.scoreboard__empty { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.scoreboard li.mine { color: var(--red-deep); }

/* ----------------------------------------------------------------- forms */
form label {
  display: block; font-size: .7rem; font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; margin: 1.2rem 0 .4rem; color: var(--ink-soft);
}
form input[type="text"], form textarea {
  /* colour is set explicitly: inside the dark game-over overlay these would
     otherwise inherit white text onto a white field and vanish. */
  width: 100%; padding: .8rem .9rem; background: #fff; color: var(--ink);
  border: 1px solid var(--hair); font-size: 16px;
}
form input[type="text"]::placeholder, form textarea::placeholder { color: #9c938a; }
.score-submit { width: 100%; max-width: 320px; }
.score-submit form { display: block; }
.score-submit label { margin-top: 0; color: rgba(255,255,255,.75); }
form input[type="text"]:focus, form textarea:focus { border-color: var(--ink); outline: none; }
form textarea { resize: vertical; }
.counter { font-size: .72rem; text-align: right; margin: .4rem 0 1rem; color: var(--ink-soft); }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.form-status { margin-top: 1rem; font-size: .92rem; min-height: 1.4em; }
.form-status.error { color: var(--red-deep); }
.entries-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.6rem; }
.gb-entry { border-top: 1px solid var(--hair); padding-top: 1.2rem; }
.gb-entry__head { display: flex; gap: .8rem; align-items: baseline; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.gb-entry__name { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; letter-spacing: 0; text-transform: none; color: var(--ink); }
.gb-entry p { margin: .4em 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.panel--form, .panel--entries { border: 0; padding: 0; }

/* ---------------------------------------------------------------- footer */
.footer { background: var(--ink); color: #efe8df; margin-top: 4rem; }
.footer__inner { max-width: var(--wrap); margin: 0 auto; padding: 3.5rem 1.25rem; text-align: center; }
.footer__line { font-family: var(--serif); font-size: 1.35rem; margin: 0 0 .6rem; }
.footer__small { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(239,232,223,.6); margin: 0; }
.footer a { color: #efe8df; text-decoration-color: var(--tan); }

/* ----------------------------------------------------------------- padel */
.countdown { text-align: center; }
.countdown__state {
  font-size: .72rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 1.4rem;
}
.countdown__clock {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 1rem 1.6rem; margin-bottom: 1.2rem;
}
.countdown__clock[hidden] { display: none; }
.countdown__unit { display: block; min-width: 3.6rem; }
.countdown__unit b {
  display: block; font-family: var(--serif); font-weight: 700;
  font-size: clamp(2.6rem, 12vw, 4.6rem); line-height: 1;
  /* Tabular figures, or the seconds shove the minutes sideways every tick. */
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.countdown__unit small {
  display: block; margin-top: .5rem;
  font-size: .62rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-soft);
}
.countdown__fallback { color: var(--ink-soft); margin: 0; font-size: .95rem; }
.countdown.is-close .countdown__unit b { color: var(--red); }
.countdown.is-live .countdown__state, .countdown.is-done .countdown__state {
  font-family: var(--serif); font-size: clamp(1.8rem, 7vw, 3rem);
  letter-spacing: -.01em; text-transform: none; color: var(--ink); margin-bottom: .8rem;
}
.countdown.is-live .countdown__state { color: var(--red); }

/* Vincent, stuck around the margins. The page is a centred column with a lot
   of white either side of it, and that white is where these live — never over
   the type. Rotated a degree or two each so they read as pasted on rather
   than placed. */
.padel { position: relative; }
.vinne { position: absolute; z-index: 1; pointer-events: none; }
.vinne img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--hair);
  /* A snapshot has a back. This is the white edge of it. */
  padding: 5px; background: var(--paper);
}
/* All four hang from the top. Anchoring some of them to the bottom instead
   made them collide the moment the page changed height — which it does, every
   second, as the clock counts down a digit. */
.vinne--a { width: 88px; top: 2.5rem;  left: 4%;  transform: rotate(-6deg); }
.vinne--b { width: 66px; top: 10rem;   right: 9%; transform: rotate(5deg); }
.vinne--c { width: 96px; top: 21rem;   left: 8%;  transform: rotate(3deg); }
.vinne--d { width: 74px; top: 20rem;   right: 5%; transform: rotate(-8deg); }

/* Wider still, and the margins can take bigger ones further out. */
@media (min-width: 1100px) {
  .vinne--a { width: 116px; left: 7%; }
  .vinne--b { width: 88px;  right: 12%; }
  .vinne--c { width: 124px; left: 12%; }
  .vinne--d { width: 96px;  right: 7%; }
}

/* On a phone there are no margins to hide in. Two of them, small, tucked into
   the corners the layout leaves empty — the rest would land on the words. */
@media (max-width: 720px) {
  .vinne--b, .vinne--d { display: none; }
  .vinne--a { width: 58px; top: 1rem; left: 3%; }
  /* Into the flow, below the headline. The headline runs the full width of a
     phone and rewraps at every size, so any fixed offset lands on a word at
     some width — 360 and 414 both did. */
  .vinne--c {
    position: static; display: block; width: 64px;
    margin: 0 4% 3.5rem auto;
  }
}

/* The one line under the clock. It is the whole paragraph, so it gets to be
   the size of one — swap the wording in the front matter of padel.md. */
.shout {
  text-align: center; margin: 0 auto; max-width: 20ch;
  font-family: var(--serif); font-weight: 700; line-height: 1.05;
  letter-spacing: -.01em;
  font-size: clamp(2.2rem, 9vw, 4.2rem);
}

.proof { margin: 0; text-align: center; }
.proof img { margin: 0 auto; max-width: min(480px, 100%); height: auto; }
.proof figcaption {
  margin-top: .9rem; color: var(--ink-soft); font-size: .9rem;
}

/* ---------------------------------------------------------------- mascot */
/* The little chase along the bottom of the window. Built entirely by
   static/js/mascot.js; nothing here runs on its own. */
.mascot {
  position: fixed; left: 0; right: 0; bottom: 0; height: 60px;
  z-index: 40; overflow: hidden;
  pointer-events: none;                 /* the page underneath keeps working */
  transition: opacity .35s ease;
}
/* Out of the way while the page is moving under it. */
.mascot.is-away { opacity: 0; }
.mascot__actor { position: absolute; left: 0; bottom: 4px; pointer-events: none; }
.mascot__svg { overflow: visible; display: block; }

/* Only the figure itself takes a tap — a transparent patch cut to its own
   size, so the mascot can never sit on top of a link and swallow it. */
.mascot__hit { pointer-events: auto; cursor: pointer; }

.mascot__limb, .mascot__body {
  fill: none; stroke: var(--ink); stroke-width: 2.1;
  stroke-linecap: round; stroke-linejoin: round;
}
.mascot__limb--back { stroke: var(--ink-soft); }
.mascot__head { fill: var(--ink); }
/* Both figures carry a headband; only the one who is *it* wears it. */
.mascot__band { stroke: none; stroke-width: 2.6; stroke-linecap: round; }
.is-it .mascot__band { stroke: var(--red); }

/* Whoever is *it* wears the red, the same red the app uses for it. */
.is-it .mascot__body, .is-it .mascot__limb { stroke: var(--red); }
.is-it .mascot__limb--back { stroke: rgba(255, 45, 85, .5); }
.is-it .mascot__head { fill: var(--red); }

.mascot__puff {
  position: absolute; bottom: 40px; left: 0;
  font-family: var(--sans); font-size: .6rem; font-weight: 700;
  letter-spacing: .18em; color: var(--red);
  opacity: 0; transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
}
.mascot__puff.is-on { opacity: 1; transform: translateY(0); }

/* Walking onto the dark footer, the ink figure would simply vanish. It picks
   up a chalk line instead. Toggled from JS when the footer reaches the strip. */
.mascot.on-dark .mascot__limb, .mascot.on-dark .mascot__body { stroke: #efe8df; }
.mascot.on-dark .mascot__limb--back { stroke: rgba(239, 232, 223, .55); }
.mascot.on-dark .mascot__head { fill: #efe8df; }
.mascot.on-dark .is-it .mascot__body,
.mascot.on-dark .is-it .mascot__limb { stroke: #ff6b88; }
.mascot.on-dark .is-it .mascot__head { fill: #ff6b88; }
.mascot.on-dark .mascot__puff { color: #ff6b88; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .mascot { display: none; }
}

/* ------------------------------------------------------------ fullscreen */
.stage-tools { display: flex; justify-content: flex-end; margin-bottom: .6rem; }
.fs-toggle {
  background: none; border: 1px solid var(--hair); color: var(--ink-soft);
  font-size: .68rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  padding: .5rem .9rem; cursor: pointer; transition: border-color .2s ease, color .2s ease;
}
.fs-toggle:hover { border-color: var(--ink); color: var(--ink); }

/* The CSS fallback for browsers that will not put a div fullscreen — iOS. */
#game-root.fs-fallback {
  position: fixed; inset: 0; z-index: 200; background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}
body.fs-locked { overflow: hidden; }

#game-root:fullscreen { background: var(--ink); display: flex; align-items: center; justify-content: center; }
#game-root:-webkit-full-screen { background: var(--ink); display: flex; align-items: center; justify-content: center; }

/* Inside fullscreen the stage fills what it can and the canvas is letterboxed
   rather than stretched, so every aspect ratio stays honest. */
#game-root:fullscreen .stage,
#game-root:-webkit-full-screen .stage,
#game-root.fs-fallback .stage {
  width: 100%; height: 100%; max-width: 1400px; border: 0;
  display: flex; flex-direction: column; background: var(--ink);
}
#game-root:fullscreen .arcade,
#game-root:-webkit-full-screen .arcade,
#game-root.fs-fallback .arcade {
  flex: 1; min-height: 0; border: 0; background: transparent;
  display: flex; align-items: center; justify-content: center;
}
#game-root:fullscreen .arcade canvas,
#game-root:-webkit-full-screen .arcade canvas,
#game-root.fs-fallback .arcade canvas {
  width: auto; height: auto; max-width: 100%; max-height: 100%;
}
#game-root:fullscreen .stage__body,
#game-root:-webkit-full-screen .stage__body,
#game-root.fs-fallback .stage__body {
  overflow-y: auto; max-width: 720px; width: 100%; margin: 0 auto;
  background: #fff;
}
#game-root:fullscreen .stage__hud,
#game-root:-webkit-full-screen .stage__hud,
#game-root.fs-fallback .stage__hud { font-size: .8rem; padding: .8rem 1.1rem; }

.fs-exit {
  position: absolute; top: .7rem; right: .7rem; z-index: 20;
  background: rgba(255,255,255,.9); color: var(--ink); border: 0;
  font-size: .64rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  padding: .45rem .8rem; cursor: pointer; display: none;
}
#game-root:fullscreen .fs-exit,
#game-root:-webkit-full-screen .fs-exit,
#game-root.fs-fallback .fs-exit { display: block; }

/* --------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; margin: 1.8em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .96rem; }
.prose th, .prose td {
  text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--hair);
  vertical-align: top;
}
.prose th {
  font-family: var(--sans); font-size: .68rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft);
  border-bottom-color: var(--ink);
}
.prose tbody tr:last-child td { border-bottom: 0; }
