/* ============================================================
   WalkingDays - style.css (v2, third pass)
   The page is one walk, morning to night. See README
   "デザイン方針（第3版）" for the reasoning.

   Rules this file keeps:
   - Type: Bongo-8 Mono only. Sizes and line-heights are
     multiples of 8 (the font's native grid is 8 units/em).
   - Art: only app assets, shown at whole-number scale
     (--k = 1 on phones, 2 on wide screens), pixelated.
   - Color: text windows are ink + paper only. Every other
     fill is a color sampled from the scene it sits under.
   - No gradients, no blur, no translucency, no rounded corners.
   ============================================================ */

@font-face {
  font-family: "Bongo8";
  src: url("../fonts/Bongo-8 Mono.ttf") format("truetype");
  font-display: block;
}

:root {
  /* Windows: two colors, nothing else. */
  --ink:   #101030; /* ParadeBG_Default night sky - where the walk ends */
  --paper: #e0d0b0; /* CH100 "Sunny" coat highlight - who you walk with */
  --white: #ffffff; /* the app's HUD digits */

  /* Scale: 1 native art pixel = --k CSS px. */
  --k: 1;
  --tile-w: calc(576px * var(--k));
  --tile-h: calc(324px * var(--k));

  --gutter: 16px;
  --font: "Bongo8", ui-monospace, monospace;
}
@media (min-width: 960px) {
  :root { --k: 2; --gutter: 32px; }
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 32px;
  color: var(--paper);
  background: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: never;
}
.js body { padding-bottom: 44px; } /* room for the walk track */
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: normal; }
button { font: inherit; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { text-decoration: none; }

/* One focus ring for every surface: paper ring inside an ink ring. */
:focus-visible {
  outline: 4px solid var(--paper);
  outline-offset: 0;
  box-shadow: 0 0 0 8px var(--ink);
}

.skip-link {
  position: absolute; left: 16px; top: -64px; z-index: 100;
  background: var(--paper); color: var(--ink);
  padding: 8px 16px;
}
.skip-link:focus { top: 16px; }

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

.wrap {
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- Header ---- */
.site-header { background: var(--ink); border-bottom: 4px solid var(--paper); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 16px; padding-bottom: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 16px;
  font-size: 24px; line-height: 32px; text-decoration: none;
}
.brand img { width: 32px; height: 32px; }
/* .lang-menu (header) and .lang-switch (footer) base layout - v2 colors
   and the double-outline text treatment are added in the CJK language
   overrides section at the end of this file, alongside the fonts. */
.lang-menu { position: relative; font-size: 16px; line-height: 24px; }
.lang-menu summary {
  display: flex; align-items: center; gap: 8px;
  list-style: none; cursor: pointer;
  padding: 0 8px; height: 32px;
  border: 4px solid var(--paper);
  color: var(--paper);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary svg { flex-shrink: 0; }
.lang-menu[open] summary { background: var(--paper); color: var(--ink); }
.lang-menu ul {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 200;
  margin: 0; padding: 4px;
  min-width: 140px;
  background: var(--ink);
  border: 4px solid var(--paper);
}
.lang-menu li { margin: 0; }
.lang-menu a {
  display: flex; align-items: center; min-height: 32px;
  padding: 0 8px; white-space: nowrap; text-decoration: none;
  color: var(--paper);
}
.lang-menu a:hover, .lang-menu a:focus-visible { background: var(--paper); color: var(--ink); }
.lang-menu a[aria-current="page"] { color: var(--v2-gold, #ffcc33); }
.lang-switch {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  margin-top: 16px; font-size: 16px; line-height: 24px;
}
.lang-switch a { color: var(--paper); text-decoration: none; }
.lang-switch a:hover, .lang-switch a:focus-visible { text-decoration: underline; }
.lang-switch a[aria-current="page"] { color: var(--v2-gold, #ffcc33); }

/* ============================================================
   Scenes. A scene = a stage (layered art) + its ground (a flat
   band in the stage's own ground color) holding the windows.
   ============================================================ */
.scene {
  position: relative;
  background: var(--ground);
  padding-bottom: 64px;
}
.scene--morning { --ground: #1f7f41; --sky: #026493; }
.scene--dusk    { --ground: #667a40; --sky: #376e95; }
.scene--night   { --ground: #002341; --sky: #002140; }
.scene--parade  { --ground: #101030; --sky: #101030; }
.scene--season[data-season="autumn"]   { --ground: #6d4728; --sky: #a5c7c9; }
.scene--season[data-season="summer"]   { --ground: #345948; --sky: #6cc2d9; }
.scene--season[data-season="winter"]   { --ground: #576498; --sky: #7c9bad; }
.scene--season[data-season="mountain"] { --ground: #4f8a8a; --sky: #9cd8fa; }

.stage {
  position: relative;
  height: var(--tile-h);
  overflow: hidden;
  background-color: var(--sky);
}
.layer {
  position: absolute; inset: 0;
  background-repeat: repeat-x;
  background-size: var(--tile-w) var(--tile-h);
  background-position: 0 0;
  image-rendering: pixelated;
}

/* Windows climb onto the bottom of the stage they belong to. */
.ground {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 32px;
  margin-top: -32px;
}
@media (min-width: 960px) {
  .ground { margin-top: -96px; gap: 48px; }
}

/* ============================================================
   The message window. Ink fill, paper rule inset 8px, notched
   corners - the 8-bit dialog box, drawn in CSS (the app's own
   purchased frame images are not used; see README).
   ============================================================ */
.win {
  position: relative;
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  padding: 32px 24px;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px),
                     calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}
.win::before {
  content: "";
  position: absolute; inset: 8px;
  border: 4px solid var(--paper);
  pointer-events: none;
}
.win > * + * { margin-top: 16px; }
@media (min-width: 960px) {
  .win { padding: 40px 40px; }
}
.win--hero  { max-width: 640px; }
.win--menu  { max-width: 640px; }
.win--short { max-width: 560px; }
.win--wide  { max-width: 800px; }

.win h2 { font-size: 24px; line-height: 32px; }
.win h3 { font-size: 16px; line-height: 32px; }
@media (min-width: 960px) {
  .win h2 { font-size: 32px; line-height: 40px; }
  .win h3 { font-size: 24px; line-height: 32px; }
}
.fine { font-size: 16px; line-height: 24px; }

/* A heading that sits on the ground by itself: a one-line window. */
.plate {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-size: 24px; line-height: 32px;
  padding: 8px 16px;
  border: 4px solid var(--paper);
  outline: 4px solid var(--ink);
}
@media (min-width: 960px) { .plate { font-size: 32px; line-height: 40px; } }

/* Menu list with the stepped cursor. */
.menu li { position: relative; padding-left: 32px; }
.menu li::before {
  /* a 4px pixel, box-shadowed into a stepped right-pointing cursor */
  content: "";
  position: absolute; left: 0; 
  width: 4px; height: 4px;
  background: var(--paper);
  box-shadow:
    0 4px var(--paper), 0 8px var(--paper), 0 12px var(--paper), 0 16px var(--paper), 0 20px var(--paper),
    4px 4px var(--paper), 4px 8px var(--paper), 4px 12px var(--paper), 4px 16px var(--paper),
    8px 8px var(--paper), 8px 12px var(--paper);
  top: 4px;
}

/* ---- Screenshots (all placeholders for now) ---- */
.shot img {
  width: 100%;
  border: 4px solid var(--paper);
  background: var(--paper);
}
.shot figcaption { font-size: 16px; line-height: 24px; margin-top: 8px; }
.shot__empty {
  display: flex; align-items: center; justify-content: center; text-align: center;
  aspect-ratio: 16 / 9;
  padding: 16px;
  border: 4px dashed var(--paper);
  font-size: 16px; line-height: 24px;
}

/* ---- Keys: the app's square HUD buttons, drawn in CSS ---- */
.key {
  min-width: 56px; min-height: 48px;
  padding: 4px 8px;
  font-size: 24px; line-height: 32px;
  color: var(--ink);
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  border-radius: 0;
  cursor: pointer;
}
.key:active { transform: translateY(4px); box-shadow: none; }
.key:focus-visible { box-shadow: 0 0 0 8px var(--ink); }
.key[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--paper); }
.key--wide { font-size: 16px; line-height: 24px; padding: 8px 12px; }

/* ---- Badges ---- */
.badges { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.badges img { height: 40px; width: auto; }

/* ---- Dogs: CH100 sprite sheets, 8 cells of 48x48 ---- */
.dog {
  --s: 2;
  --n: 7; --dur: 1.05s;
  width: calc(48px * var(--s));
  height: calc(48px * var(--s));
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: calc(384px * var(--s)) calc(48px * var(--s));
  image-rendering: pixelated;
}
/* frame counts and timing straight from CharacterCatalog.plist */
.dog[data-act="walk"] { --n: 7; --dur: 1.05s; }
.dog[data-act="sit"]  { --n: 5; --dur: 1s; }
.dog[data-act="jump"] { --n: 6; --dur: 0.6s; }
.dog[data-act="jump"][data-dog="d"],
.dog[data-act="jump"][data-dog="e"] { --n: 5; --dur: 0.5s; }
/* "Lying" (the app's Stopping status: Ready and the rest): 4 frames at
   0.3 s, played once - the dog settles and stays down. The last cell is
   the resting pose, so it is also the still shown without animation. */
.dog[data-act="lie"]  { --n: 4; --dur: 1.2s; background-position-x: calc(-48px * var(--s) * 3); }
.dog[data-dog="a"][data-act="lie"]  { background-image: url("../img/app/dogs/a-lie.png"); }
.dog[data-dog="b"][data-act="lie"]  { background-image: url("../img/app/dogs/b-lie.png"); }
.dog[data-dog="c"][data-act="lie"]  { background-image: url("../img/app/dogs/c-lie.png"); }
.dog[data-dog="d"][data-act="lie"]  { background-image: url("../img/app/dogs/d-lie.png"); }
.dog[data-dog="e"][data-act="lie"]  { background-image: url("../img/app/dogs/e-lie.png"); }

.dog[data-dog="a"][data-act="walk"] { background-image: url("../img/app/dogs/a-walk.png"); }
.dog[data-dog="a"][data-act="sit"]  { background-image: url("../img/app/dogs/a-sit.png"); }
.dog[data-dog="a"][data-act="jump"] { background-image: url("../img/app/dogs/a-jump.png"); }
.dog[data-dog="b"][data-act="walk"] { background-image: url("../img/app/dogs/b-walk.png"); }
.dog[data-dog="b"][data-act="sit"]  { background-image: url("../img/app/dogs/b-sit.png"); }
.dog[data-dog="b"][data-act="jump"] { background-image: url("../img/app/dogs/b-jump.png"); }
.dog[data-dog="c"][data-act="walk"] { background-image: url("../img/app/dogs/c-walk.png"); }
.dog[data-dog="c"][data-act="sit"]  { background-image: url("../img/app/dogs/c-sit.png"); }
.dog[data-dog="c"][data-act="jump"] { background-image: url("../img/app/dogs/c-jump.png"); }
.dog[data-dog="d"][data-act="walk"] { background-image: url("../img/app/dogs/d-walk.png"); }
.dog[data-dog="d"][data-act="sit"]  { background-image: url("../img/app/dogs/d-sit.png"); }
.dog[data-dog="d"][data-act="jump"] { background-image: url("../img/app/dogs/d-jump.png"); }
.dog[data-dog="e"][data-act="walk"] { background-image: url("../img/app/dogs/e-walk.png"); }
.dog[data-dog="e"][data-act="sit"]  { background-image: url("../img/app/dogs/e-sit.png"); }
.dog[data-dog="e"][data-act="jump"] { background-image: url("../img/app/dogs/e-jump.png"); }

@keyframes frames {
  to { background-position-x: calc(-48px * var(--s) * var(--n)); }
}
@keyframes frames-once {
  from { background-position-x: 0; }
  to { background-position-x: calc(-48px * var(--s) * (var(--n) - 1)); }
}
@keyframes pan {
  to { background-position-x: calc(-1 * var(--tile-w)); }
}
@media (prefers-reduced-motion: no-preference) {
  .dog { animation: frames var(--dur) steps(var(--n)) infinite; }
  .dog[data-act="lie"] { animation: frames-once var(--dur) steps(3) 1 forwards; }
  /* Hero only: the app at rest - layers drift at their own speeds. */
  .stage--auto .layer:nth-child(2) { animation: pan 240s linear infinite; }
  .stage--auto .layer:nth-child(3) { animation: pan 64s linear infinite; }
  .stage--auto .layer:nth-child(4) { animation: pan 16s linear infinite; }
}

/* ============================================================
   06:00 Morning (hero)
   ============================================================ */
.hero { padding-top: 0; }
.dog--hero {
  --s: calc(3 * var(--k));
  position: absolute;
  left: max(8px, 6%);
  /* feet (sprite row 36 of 48) land 16 art-px above the stage bottom */
  bottom: calc(var(--k) * -17px);
}

/* ---- Title logo: centered, as large as fits, whole multiples of
   137px only (duo, no dog, with the POMO/DORO ribbon: the 1x file
   is 137x114; height follows the image). Source is the 1x file, so
   the browser's nearest-neighbour upscale is exact whenever N x DPR
   is an integer.
     < 960px  : 274px (2x)  on a 324px stage (3x = 342 tall won't fit)
     >= 960   : 685px (5x)  on a 648px stage (570 tall; 6x = 684 tall won't fit) */
.hero__title {
  position: absolute; top: 0; left: 0; right: 0;
  height: var(--tile-h);
  display: flex; justify-content: center; align-items: flex-start;
  pointer-events: none;
}
.hero__logo {
  max-width: none;
  width: 274px; height: auto;
  margin-top: 16px;
  image-rendering: pixelated;
}
@media (min-width: 960px) {
  .hero__logo { width: 685px; margin-top: 24px; }
}

/* ---- HUD timer: an ink bar right under the stage, at every width.
   Big white digits on the left, -5 / +5 on the right. ---- */
.hud {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  background: var(--ink);
  border-bottom: 4px solid var(--paper);
  padding: 16px max(var(--gutter), calc((100% - 1152px) / 2 + var(--gutter)));
}
.hud { flex-wrap: wrap; }
.hud__time {
  color: var(--white);
  font-size: 40px; line-height: 48px; /* 5 chars = 200px: fits 343px with the keys */
}
.hud__keys { gap: 16px; }
.hud__keys .key { min-width: 48px; padding: 4px; font-size: 16px; line-height: 32px; } /* 48px wide */
@media (min-width: 400px) { .hud__time { font-size: 48px; line-height: 48px; } }
@media (min-width: 600px) { .hud__time { font-size: 64px; line-height: 64px; } .hud__keys .key { min-width: 56px; padding: 4px 8px; font-size: 24px; } }
@media (min-width: 960px) {
  .hud { padding-top: 24px; padding-bottom: 24px; }
  .hud__time { font-size: 96px; line-height: 96px; }
  .hud__keys .key { min-width: 80px; min-height: 64px; font-size: 32px; line-height: 40px; }
}

.win--hero h1 { font-size: 32px; line-height: 40px; }
.win--hero > p { font-size: 16px; line-height: 32px; }
.win--hero .badges { margin-top: 24px; }
.hero__win { position: relative; z-index: 2; margin-top: 16px; }
@media (min-width: 960px) {
  .win--hero h1 { font-size: 40px; line-height: 48px; }
  .win--hero > p { font-size: 24px; line-height: 32px; }
  /* title screen: tagline window centered under the logo */
  .hero__win { margin-top: 40px; display: flex; justify-content: center; }
}
/* A scene with no stage of its own (the loop and the options continue
   the morning ground): nothing to climb onto, so no negative margin. */
.scene--flat { padding-top: 0; }
.scene--flat .ground { margin-top: 0; }
@media (min-width: 960px) { .scene--flat .ground { margin-top: 0; } }

/* Step / item number chip */
.step__n {
  display: inline-block; width: 32px; text-align: center;
  background: var(--paper); color: var(--ink);
  margin-right: 8px;
}

/* ---- Seasons ---- */
.picker { margin-top: 24px; }
.picker__label { font-size: 16px; line-height: 24px; margin-bottom: 8px; }
.picker__keys { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---- Dusk: records ---- */
.win--split { max-width: 960px; }
@media (min-width: 720px) {
  .win--split { display: grid; grid-template-columns: 1fr minmax(0, 360px); gap: 40px; align-items: center; }
  .win--split > * + * { margin-top: 0; }
}

/* ============================================================
   The parade. ParadeBG_Default is not a tiling image, so it is
   shown as what it is - the app's screen - at whole-number scale,
   edge to edge on phones and framed on wide screens.
   ============================================================ */
.parade-screen { display: flex; justify-content: center; }
.stage--parade {
  width: 100%;
  max-width: var(--tile-w);
  background: var(--ink) url("../img/app/parade.png") 50% 0 / var(--tile-w) var(--tile-h) no-repeat;
  image-rendering: pixelated;
}
@media (min-width: 1216px) {
  .parade-screen { padding-top: 64px; }
  .stage--parade { max-width: calc(var(--tile-w) + 8px); height: calc(var(--tile-h) + 8px); border: 4px solid var(--paper); }
}
.cast {
  position: absolute; left: 0; right: 0;
  bottom: calc(var(--k) * 24px);
  display: flex; justify-content: center;
}
.dog--cast {
  --s: calc(2 * var(--k));
  /* cells are 48 wide but the dogs are ~24: let them stand close */
  margin: 0 calc(-12px * var(--s)) calc(-11px * var(--s));
}
.scene--parade .ground { margin-top: 32px; }
@media (min-width: 960px) { .scene--parade .ground { margin-top: 48px; } }
.names { font-size: 16px; line-height: 24px; }

.news dt {
  display: inline-block;
  background: var(--paper); color: var(--ink);
  padding: 0 8px;
  font-size: 16px; line-height: 32px;
}
.news dd { margin: 8px 0 32px; }
.news dd:last-child { margin-bottom: 0; }
.news dd > * + * { margin-top: 8px; }
.news .shot { max-width: 480px; margin-top: 16px; }

/* ============================================================
   The walk track. Fixed to the bottom of the window once the
   hero has scrolled away. Ticks are minutes, like the app's
   ruler; the box on the right is the time left.
   ============================================================ */
.track { display: none; }
.js .track {
  display: flex;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: 44px;
  background: var(--ink);
  border-top: 4px solid var(--paper);
  transform: translateY(calc(100% + 64px));
  transition: transform 0.2s steps(4);
}
.js .track.is-on { transform: none; }
.track__lane { position: relative; flex: 1; margin: 0 16px; }
.track__ticks span {
  position: absolute; top: 4px;
  left: calc(var(--p) * (100% - 96px) + 46px);
  transform: translateX(-50%);
  font-family: "Bongo8", ui-monospace, monospace; /* minute numbers - see .hud__time */
  font-size: 16px; line-height: 24px;
}
.track__ticks span::before {
  content: ""; position: absolute; left: 50%; top: -8px;
  width: 4px; height: 4px; margin-left: -2px;
  background: var(--paper);
}
.dog--track {
  --s: 2;
  position: absolute;
  left: calc(var(--p, 0) * (100% - 96px));
  /* feet on the paper rule: 11 empty rows x 2 = 22px below the feet */
  bottom: calc(100% + 4px - 22px);
}
.track__time {
  flex: none; width: 96px;
  border-left: 4px solid var(--paper);
  text-align: center;
  font-size: 24px; line-height: 40px;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--ink);
  border-top: 4px solid var(--paper);
  padding: 40px 0 48px;
  font-size: 16px; line-height: 24px;
}
.footer-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 24px 32px;
}
.footer-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.footer-brand img { width: 142px; height: 16px; image-rendering: pixelated; }
.made-in { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.made-in svg { height: 24px; width: auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-legal { margin-top: 24px; max-width: 48em; }

@media (prefers-reduced-motion: reduce) {
  .js .track { transition: none; }
}

/* -5 / +5 only work with JS. */
.hud__keys { display: none; }
.js .hud__keys { display: flex; }

/* v2 store screenshots in portrait: keep them phone-sized inside wide windows */
.shot--portrait { max-width: 320px; }

/* ============================================================
   v2 menu language (design layer). Everything below only overrides.
   Taken from the app's own v2 menu code (iOS/Menu/MenuTop/
   MenuLayoutView.swift, BasicViews/PixelHeaderView.swift) and the
   v2 store shots (5_iPhone HOME menu, 4 Characters, 1 walking, 3/6 sheets):
   - grounds: 2-tone checkerboard, 8px cells (MenuCheckerBackground)
   - windows: white 4px frame with stepped (notched) pixel corners
     (PixelRect pixel 3 / steps 2), dark group-tinted fill (sampled)
   - titles: per-item colors (PixelHeaderView.headerTextColor), black
     line + light rim + drop (PixelEdgedText + shadow x/y)
   - body text: white with a 1-dot drop to the lower right
   - -5/+5: the walking screen's red control bar
   Colors:
     panels (sampled, 5_iPhone)  walk #15694f  settings #3d4a49  info #545066
     frame / rim                 #ffffff / #e5e5e5     line #000000
     window tab title            #ffcc33 (MenuCommandWindow title, 1.0/0.80/0.20)
     item colors (headerTextColor of headerColor):
       timer #f7a869  record #459292  walkers #a074c4  plus #e07cb3
       config #7397e0  news #5da367  credit #9a7651  default #f7c765
     control bar #c24739 / divider #9d3e30   digits #4de640
     chips: selected #ffd933, unselected walkers #8042b3
   Contrast (WCAG): white body text on panels 6.6 / 9.2 / 7.7 : 1.
   Titles are read through their outline: fill vs black line >= 4.9 : 1,
   light rim vs panel >= 5.3 : 1. Hard edges only - no blur, no alpha.
   ============================================================ */
:root {
  /* 1 outline "dot" = the font's own native pixel, as a fraction of 1em.
     Bongo-8 and marukiya both measure to a 1/8em grid (see README "フォント"),
     so the default below covers English and ja. ko (Galmuri11-Bold, 1/12em)
     and zh (BoutiqueBitmap9x9, 1/10em) override it under :lang() below, so
     the outline/drop stay on each font's own pixel grid instead of Bongo-8's. */
  --dot: 0.125em;
  --v2-line: #000000;
  --v2-rim: #e5e5e5;
  --v2-drop: #000000;
  --v2-frame-c: #ffffff;
  --v2-walk: #15694f;
  --v2-settings: #3d4a49;
  --v2-info: #545066;
  --v2-gold: #ffcc33;
  --v2-green: #4de640;
  --v2-red: #c24739;
  --v2-red-dk: #9d3e30;
  --c-timer: #f7a869;
  --c-record: #459292;
  --c-walkers: #a074c4;
  --c-plus: #e07cb3;
  --c-config: #7397e0;
  --c-news: #5da367;
  --c-default: #f7c765;
  /* text outline in font pixels (Bongo-8 is an 8px grid, 1 dot = 0.125em):
     line 1 dot, rim 1 dot, then a 1-dot drop of the whole outlined shape
     to the lower right, so the shadow hugs the rim like the app's captions. */
  --v2-text:
    calc(var(--dot) * -1) calc(var(--dot) * -1) var(--v2-line),
    0 calc(var(--dot) * -1) var(--v2-line),
    var(--dot) calc(var(--dot) * -1) var(--v2-line),
    calc(var(--dot) * -1) 0 var(--v2-line),
    var(--dot) 0 var(--v2-line),
    calc(var(--dot) * -1) var(--dot) var(--v2-line),
    0 var(--dot) var(--v2-line),
    var(--dot) var(--dot) var(--v2-line),
    calc(var(--dot) * -2) calc(var(--dot) * -2) var(--v2-rim),
    calc(var(--dot) * -1) calc(var(--dot) * -2) var(--v2-rim),
    0 calc(var(--dot) * -2) var(--v2-rim),
    var(--dot) calc(var(--dot) * -2) var(--v2-rim),
    calc(var(--dot) * 2) calc(var(--dot) * -2) var(--v2-rim),
    calc(var(--dot) * -2) calc(var(--dot) * -1) var(--v2-rim),
    calc(var(--dot) * 2) calc(var(--dot) * -1) var(--v2-rim),
    calc(var(--dot) * -2) 0 var(--v2-rim),
    calc(var(--dot) * 2) 0 var(--v2-rim),
    calc(var(--dot) * -2) var(--dot) var(--v2-rim),
    calc(var(--dot) * 2) var(--dot) var(--v2-rim),
    calc(var(--dot) * -2) calc(var(--dot) * 2) var(--v2-rim),
    calc(var(--dot) * -1) calc(var(--dot) * 2) var(--v2-rim),
    0 calc(var(--dot) * 2) var(--v2-rim),
    var(--dot) calc(var(--dot) * 2) var(--v2-rim),
    calc(var(--dot) * 2) calc(var(--dot) * 2) var(--v2-rim),
    calc(var(--dot) * 3) calc(var(--dot) * -1) var(--v2-drop),
    calc(var(--dot) * 3) 0 var(--v2-drop),
    calc(var(--dot) * 3) var(--dot) var(--v2-drop),
    calc(var(--dot) * 3) calc(var(--dot) * 2) var(--v2-drop),
    calc(var(--dot) * -1) calc(var(--dot) * 3) var(--v2-drop),
    0 calc(var(--dot) * 3) var(--v2-drop),
    var(--dot) calc(var(--dot) * 3) var(--v2-drop),
    calc(var(--dot) * 2) calc(var(--dot) * 3) var(--v2-drop),
    calc(var(--dot) * 3) calc(var(--dot) * 3) var(--v2-drop);
  /* a black 1-dot outline only (small UI text) */
  --v2-line-only:
    calc(var(--dot) * -1) calc(var(--dot) * -1) var(--v2-line), 0 calc(var(--dot) * -1) var(--v2-line), var(--dot) calc(var(--dot) * -1) var(--v2-line),
    calc(var(--dot) * -1) 0 var(--v2-line), var(--dot) 0 var(--v2-line),
    calc(var(--dot) * -1) var(--dot) var(--v2-line), 0 var(--dot) var(--v2-line), var(--dot) var(--dot) var(--v2-line);
  /* stepped pixel corners: 2 steps of 4px (PixelRect pixel 3, steps 2) */
  --v2-notch: polygon(
    0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0,
    calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px));
  /* the 4 inner corner pixels that join the stepped frame (solid fills, not gradients) */
  --v2-corners:
    linear-gradient(var(--v2-frame-c), var(--v2-frame-c)) 0 0 / 4px 4px no-repeat,
    linear-gradient(var(--v2-frame-c), var(--v2-frame-c)) 100% 0 / 4px 4px no-repeat,
    linear-gradient(var(--v2-frame-c), var(--v2-frame-c)) 0 100% / 4px 4px no-repeat,
    linear-gradient(var(--v2-frame-c), var(--v2-frame-c)) 100% 100% / 4px 4px no-repeat;
}

/* ---- Grounds: the menu's 2-tone checkerboard, in each scene's own
   ground color (so the page still darkens morning -> night). 8px cells. */
.scene {
  --ground-2: color-mix(in srgb, var(--ground) 88%, #ffffff);
  background-color: var(--ground);
  background-image: repeating-conic-gradient(var(--ground-2) 0% 25%, var(--ground) 0% 50%);
  background-size: 16px 16px;
}

/* ---- Windows: white stepped frame, dark group-tinted fill ---- */
.win {
  --panel: var(--v2-walk);
  --title: var(--v2-gold);
  background: var(--v2-corners), var(--panel);
  color: #ffffff;
  border: 4px solid var(--v2-frame-c);
  clip-path: var(--v2-notch);
  box-shadow: none;
  text-shadow: var(--dot) var(--dot) var(--v2-drop);
}
.win::before { content: none; }
.win a { color: #ffffff; }

/* Group tints, like the app's WALK / SETTINGS / INFO windows */
.scene--season .win, .scene--dusk .win, .win--opt { --panel: var(--v2-settings); }
.scene--night .win, .scene--parade .win { --panel: var(--v2-info); }

/* Title colors per window, from the app's per-item palette */
.win--hero                              { --title: var(--v2-gold); }
.win--menu                              { --title: var(--c-plus); }
.win--loop                              { --title: var(--c-default); }
.win--opt-timer                         { --title: var(--c-timer); }
.win--opt-adjust                        { --title: var(--c-config); }
.win--opt-stop                          { --title: var(--c-record); }
.win--opt-walkers                       { --title: var(--c-walkers); }
.win--opt-plus                          { --title: var(--c-plus); }
.scene--season .win                     { --title: var(--c-default); }
.scene--dusk .win                       { --title: var(--c-record); }
.scene--night .win                      { --title: var(--c-walkers); }
/* The first parade-ground window (the arrival windowno dedicated class,
   and shares .win--wide with the trailing "What's new" window) is pinned
   by position; the rest are addressed by their own id/class so moving
   "What it won't ask of you" (.win--menu) into this ground doesn't shift
   anyone else's color via sibling-counting. "What's new" has no rule of
   its own and keeps the base .win default (--v2-gold). */
.scene--parade .ground > .win:nth-child(1) { --title: var(--c-timer); }
#plus                                      { --title: var(--c-plus); }
.win--cta                                  { --title: var(--c-news); }

.win h1, .win h2, .loop-steps h3, .win--opt h3 {
  color: var(--title);
  text-shadow: var(--v2-text);
  padding: 0 calc(var(--dot) * 3) calc(var(--dot) * 3) calc(var(--dot) * 2); /* room for rim and drop: paint only */
}
.news h3 { color: #ffffff; }

/* Menu cursor: the app's yellow right carat */
.win .menu li::before {
  background: var(--v2-gold);
  box-shadow:
    0 4px var(--v2-gold), 0 8px var(--v2-gold), 0 12px var(--v2-gold), 0 16px var(--v2-gold), 0 20px var(--v2-gold),
    4px 4px var(--v2-gold), 4px 8px var(--v2-gold), 4px 12px var(--v2-gold), 4px 16px var(--v2-gold),
    8px 8px var(--v2-gold), 8px 12px var(--v2-gold);
}

/* ---- Section label as a tab (the app's WALK / SETTINGS / INFO):
   outlined gold text standing on the ground, no box ---- */
.plate {
  background: none;
  border: 0;
  outline: 0;
  box-shadow: none;
  color: var(--v2-gold);
  text-shadow: var(--v2-text);
  padding: 0 calc(var(--dot) * 3) calc(var(--dot) * 3) calc(var(--dot) * 2);
}

/* ---- Chips: number and version tags ---- */
.step__n, .news dt {
  background: var(--v2-gold);
  color: var(--v2-line);
  font-family: "Bongo8", ui-monospace, monospace; /* step/version numbers - see .hud__time */
  text-shadow: none;
  box-shadow: 0 0 0 2px var(--v2-line), 0 0 0 4px var(--v2-rim);
}
.step__n { margin: 0 16px 0 4px; }

/* ---- Screenshots: the app's character cards (gold frame, black line) ---- */
.shot img {
  border: 4px solid var(--v2-gold);
  background: var(--v2-line);
  box-shadow: 0 0 0 4px var(--v2-line);
}

/* ---- HUD bar under the hero: a settings-tint bar ruled in white ---- */
.hud {
  background: var(--v2-settings);
  border-top: 4px solid var(--v2-frame-c);
  border-bottom: 4px solid var(--v2-frame-c);
  box-shadow: none;
}
.hud__time {
  color: var(--v2-green);
  /* digits stay Bongo-8 in every language, like the app's StandardFont-based
     CountdownPanel/ClockPanel (LocalizedFont is only for language text) */
  font-family: "Bongo8", ui-monospace, monospace;
  text-shadow: var(--v2-text); /* scales with the digits: --dot is 1 native pixel */
  padding: calc(var(--dot) * 2) 0 calc(var(--dot) * 3); /* outline/drop are paint only, no layout width */
}

/* -5 / +5: the walking screen's red control bar - stepped white frame, divided keys */
.hud__keys {
  --v2-frame-c: var(--v2-rim);
  gap: 0;
  background: var(--v2-corners), var(--v2-red);
  border: 4px solid var(--v2-rim);
  clip-path: var(--v2-notch);
  box-shadow: none;
}
.hud__keys .key {
  background: var(--v2-red);
  color: #ffffff; /* 4.9:1 on the red */
  border: 0;
  box-shadow: none;
  /* -5 / +5: digits, stay Bongo-8 - see .hud__time */
  font-family: "Bongo8", ui-monospace, monospace;
  text-shadow: var(--v2-line-only);
}
.hud__keys .key + .key { border-left: 4px solid var(--v2-red-dk); }
.hud__keys .key:active { transform: none; background: var(--v2-red-dk); }
.hud__keys .key:focus-visible { outline-offset: -8px; box-shadow: none; }

/* ---- Season picker: the Characters screen's PICK MODE chips ---- */
.key--wide {
  --v2-frame-c: #ffffff;
  background: var(--v2-corners), #8042b3; /* white text 6.9:1 */
  color: #ffffff;
  border: 4px solid #ffffff;
  clip-path: var(--v2-notch);
  box-shadow: none;
  text-shadow: none;
  margin: 0;
}
.key--wide:active { transform: translateY(4px); }
.key--wide[aria-pressed="true"] { background: var(--v2-corners), #ffd933; color: var(--v2-line); }
.key--wide:focus-visible { outline-offset: -8px; box-shadow: none; }

/* ---- Walk track: same bar as the HUD ---- */
.js .track {
  background: var(--v2-settings);
  border-top: 4px solid var(--v2-frame-c);
  box-shadow: none;
}
.track__time {
  border-left: 4px solid var(--v2-frame-c);
  color: var(--v2-green);
  font-family: "Bongo8", ui-monospace, monospace; /* digits - see .hud__time */
  text-shadow: var(--v2-line-only);
}

/* ---- Legal pages (privacy.html / terms.html): one long window on the
   night ground. Sizes stay on the 8px font grid. */
.legal-page { background-color: var(--v2-panel, #323638); }
.legal { padding: 48px 0 96px; }
.legal .win { max-width: 800px; margin: 0 auto; }
.legal h1 { font-size: 32px; line-height: 40px; margin: 0 0 8px; }
.legal h2 { font-size: 24px; line-height: 32px; margin: 40px 0 16px; }
.legal p, .legal li { font-size: 16px; line-height: 32px; }
.legal ul { margin: 0; padding-left: 24px; list-style: square; }
.legal li + li { margin-top: 8px; }
.legal a { color: var(--v2-gold, #ffcc33); text-decoration: underline; text-underline-offset: 4px; }
@media (min-width: 960px) {
  .legal { padding: 64px 0 128px; }
  .legal h1 { font-size: 40px; line-height: 48px; }
}

/* ---- v2 skin for .lang-menu / .lang-switch: same stepped-corner window
   system and double outline as the rest of the v2 block above. The
   dropdown is an INFO-tinted window (language is "about the site", like
   News/About/Credit); the current language reads in gold through a
   1-dot outline, matching small UI text elsewhere (.hud__keys .key). ---- */
.lang-menu summary {
  background: var(--v2-corners), var(--v2-info);
  border: 4px solid var(--v2-frame-c);
  clip-path: var(--v2-notch);
  color: #ffffff;
  text-shadow: var(--v2-line-only);
}
.lang-menu[open] summary { background: var(--v2-corners), var(--v2-info); color: #ffffff; }
.lang-menu ul {
  background: var(--v2-corners), var(--v2-info);
  border: 4px solid var(--v2-frame-c);
  clip-path: var(--v2-notch);
}
.lang-menu a { color: #ffffff; text-shadow: var(--v2-line-only); }
.lang-menu a:hover, .lang-menu a:focus-visible { background: rgba(255, 255, 255, 0.2); color: #ffffff; }
.lang-menu a[aria-current="page"] { color: var(--v2-gold); }
.lang-switch a { color: var(--paper); text-shadow: var(--v2-line-only); }
.lang-switch a[aria-current="page"] { color: var(--v2-gold); }

[hidden] { display: none !important; }

/* ============================================================
   The loop (section #loop) and the options (section #custom).
   Same morning ground as the hero; the app's own grouping:
   the walk itself in a WALK-tinted window, the options in
   SETTINGS-tinted windows. See index.html for the state table.
   ============================================================ */

/* A line of plain text standing on the checker ground, under a tab title. */
.lede {
  max-width: 40em;
  color: #ffffff;
  text-shadow: var(--v2-line-only);
}
.plate + .lede { margin-top: -16px; }

/* ---- The demo screen: the app's walking screen, framed like the
   parade screen (white 4px frame), art at whole-number scale. ---- */
.demo { width: 100%; max-width: calc(var(--tile-w) + 8px); }
.screen {
  position: relative;
  height: calc(var(--tile-h) + 8px);
  overflow: hidden;
  background-color: var(--sky);
  border: 4px solid var(--v2-frame-c);
}
/* a hard cut to night between the demo's days (no fade: 8-bit scene change) */
.demo.is-night .screen { background-color: var(--ink); }
.demo.is-night .screen > * { visibility: hidden; }

/* the big digits, Bongo-8 in every language (the app's StandardFont) */
.demo__clock {
  position: absolute; left: 0; right: 0;
  top: calc(80px * var(--k));
  text-align: center;
  color: var(--v2-green);
  font-family: "Bongo8", ui-monospace, monospace;
  font-size: calc(48px * var(--k)); line-height: calc(48px * var(--k));
  text-shadow: var(--v2-text);
}
/* today's row of tomatoes, under the digits as in the app */
.demo__row {
  position: absolute; left: 0; right: 0;
  top: calc(144px * var(--k));
  display: flex; justify-content: center; gap: calc(4px * var(--k));
  font-size: calc(24px * var(--k)); line-height: calc(32px * var(--k));
}
.demo__row span { display: inline-block; }
@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); }
  100% { transform: scale(1); }
}
/* taken / today's checkpoint, top left, as on the app's trophy button:
   white, green once reached */
.demo__quota {
  position: absolute; top: 8px; left: 8px;
  color: #ffffff;
  font-family: "Bongo8", ui-monospace, monospace;
  font-size: calc(16px * var(--k)); line-height: calc(24px * var(--k));
  text-shadow: var(--v2-line-only);
}
.demo__quota.is-reached { color: var(--v2-green); }
/* "Start!" (rises, as the app's floating label) / "Finished!" (holds) */
.demo__float {
  position: absolute; left: 0; right: 0;
  top: calc(32px * var(--k));
  text-align: center;
  font-size: 24px; line-height: 32px;
  text-shadow: var(--v2-text);
}
.demo__float.is-start { color: var(--v2-green); }
.demo__float.is-finished { color: #d94db3; } /* FinishedPanel's magenta (0.85, 0.3, 0.7) */
@keyframes rise {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(calc(-24px * var(--k))); opacity: 0; }
}
/* the rest: the BreakDialog's count, under the row. Nudged right of
   center (as is the bar below) so the resting dog at the left edge is
   never covered on a phone-wide screen. */
.demo__rest {
  position: absolute; left: calc(50% + 24px * var(--k));
  top: calc(184px * var(--k));
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 16px 8px;
  background: var(--v2-corners), var(--v2-settings);
  border: 4px solid var(--v2-frame-c);
  clip-path: var(--v2-notch);
  text-shadow: var(--dot) var(--dot) var(--v2-drop);
}
.demo__rest-tag { color: #ffffff; font-size: 16px; line-height: 24px; white-space: nowrap; }
.demo__rest-time {
  color: var(--v2-gold);
  font-family: "Bongo8", ui-monospace, monospace;
  font-size: calc(32px * var(--k)); line-height: calc(40px * var(--k));
  text-shadow: var(--v2-line-only);
}
.demo__rest.is-done .demo__rest-time { color: #ffffff; }
/* the dog: same size as the hero's, feet on the same ground line */
.dog--demo {
  --s: calc(3 * var(--k));
  position: absolute;
  left: var(--x, 0px);
  bottom: calc(var(--k) * -17px);
}
/* the control bar: -5 / +5 / skip / play, the walking screen's bar */
.bar {
  --v2-frame-c: var(--v2-rim);
  position: absolute; left: calc(50% + 48px * var(--k)); bottom: calc(12px * var(--k));
  transform: translateX(-50%);
  display: flex;
  background: var(--v2-corners), var(--v2-red);
  border: 4px solid var(--v2-rim);
  clip-path: var(--v2-notch);
}
.bar__key {
  display: flex; align-items: center; justify-content: center;
  min-width: calc(48px * var(--k)); height: calc(40px * var(--k));
  color: #ffffff;
  font-family: "Bongo8", ui-monospace, monospace;
  font-size: calc(16px * var(--k)); line-height: calc(32px * var(--k));
  text-shadow: var(--v2-line-only);
}
.bar__key + .bar__key { border-left: 4px solid var(--v2-red-dk); }
.bar__key.is-pressed { background: var(--v2-red-dk); }
/* pixel glyphs for the icon keys (Bongo-8 has no arrows): stepped
   triangles and bars on a 4px grid, like the menu cursor */
.glyph { display: block; --u: calc(4px * var(--k)); background: #ffffff; }
.glyph--play {
  width: calc(var(--u) * 5); height: calc(var(--u) * 9);
  clip-path: polygon(0 0, 20% 0, 20% 11.1%, 40% 11.1%, 40% 22.2%, 60% 22.2%, 60% 33.3%, 80% 33.3%, 80% 44.4%,
                     100% 44.4%, 100% 55.6%, 80% 55.6%, 80% 66.7%, 60% 66.7%, 60% 77.8%, 40% 77.8%, 40% 88.9%, 20% 88.9%, 20% 100%, 0 100%);
}
.glyph--pause { position: relative; width: calc(var(--u) * 6); height: calc(var(--u) * 8); background: none; }
.glyph--pause::before, .glyph--pause::after {
  content: ""; position: absolute; top: 0; bottom: 0;
  width: calc(var(--u) * 2); background: #ffffff;
}
.glyph--pause::before { left: 0; }
.glyph--pause::after { right: 0; }
.glyph--skip { position: relative; width: calc(var(--u) * 8); height: calc(var(--u) * 7); background: none; }
.glyph--skip::before, .glyph--skip::after {
  content: ""; position: absolute; top: 0; height: 100%;
  width: calc(var(--u) * 4); background: #ffffff;
  clip-path: polygon(0 0, 25% 0, 25% 14.3%, 50% 14.3%, 50% 28.6%, 75% 28.6%, 75% 42.9%, 100% 42.9%,
                     100% 57.1%, 75% 57.1%, 75% 71.4%, 50% 71.4%, 50% 85.7%, 25% 85.7%, 25% 100%, 0 100%);
}
.glyph--skip::before { left: 0; }
.glyph--skip::after { right: 0; }
.bar__key--play .glyph--pause { display: none; }
.demo.is-walking .bar__key--play .glyph--play { display: none; }
.demo.is-walking .bar__key--play .glyph--pause { display: block; }
/* the caption under the screen: the current step's title, kept in
   sync by js/loop.js; not shown without JS or with reduced motion */
.demo__caption {
  min-height: 48px;
  padding: 8px 16px;
  background: var(--v2-corners), var(--v2-settings);
  border: 4px solid var(--v2-frame-c); border-top: 0;
  color: #ffffff;
  text-shadow: var(--dot) var(--dot) var(--v2-drop);
}
.demo__caption:empty, .demo.is-static .demo__caption { display: none; }
html:not(.js) .demo__caption { display: none; }

/* ---- The five steps, as one WALK window with a row per step: the
   dog's pose, the title, the line. On phones the line runs under the
   dog too (the window is only ~300px inside); from 960px it sits in
   the text column. Titles take the app's item colors, one per step. ---- */
.win--loop { max-width: 800px; }
.loop-steps li {
  display: grid;
  grid-template-columns: calc(48px * var(--k)) 1fr;
  gap: 0 12px;
  align-items: center;
  padding: 8px 0 8px 12px;
}
.loop-steps li + li { border-top: 4px solid color-mix(in srgb, var(--panel) 70%, #000000); }
.loop-steps li.is-now { box-shadow: inset 8px 0 0 var(--v2-gold); }
.loop-steps h3 { grid-column: 2; }
.loop-steps p { grid-column: 1 / -1; margin-top: 8px; }
.dog--step { --s: var(--k); grid-column: 1; grid-row: 1; }
.loop-steps li:nth-child(1) { --title: var(--c-timer); }
.loop-steps li:nth-child(2) { --title: var(--c-record); }
.loop-steps li:nth-child(3) { --title: var(--c-news); }
.loop-steps li:nth-child(4) { --title: var(--c-config); }
.loop-steps li:nth-child(5) { --title: var(--c-default); }
@media (min-width: 960px) {
  .loop-steps li { gap: 0 24px; padding-left: 16px; align-items: start; }
  .loop-steps p { grid-column: 2; margin-top: 0; }
  .dog--step { grid-row: 1 / span 2; }
}

/* ---- Options: SETTINGS-tinted windows, two columns on wide screens ---- */
.options { display: grid; gap: 24px; width: 100%; }
.win--opt { max-width: 640px; }
.win--opt .shot { margin-bottom: 16px; }
.win--opt .shot--portrait { max-width: 240px; }
.win--opt div > * + * { margin-top: 8px; }
@media (min-width: 720px) {
  .options { grid-template-columns: 1fr 1fr; gap: 32px; }
  .win--opt { max-width: none; }
}
@media (min-width: 960px) {
  .options { gap: 48px; }
}

/* ============================================================
   CJK languages (ja / ko / zh-Hans / zh-Hant). Fonts are the app's own
   per-language fonts (WalkingDaysMobile/Classes/Font/LocalizedFont.swift):
     ja        marukiya                   (app scale 1.20)
     ko        Galmuri11-Bold             (app scale 1.00)
     zh-Hans/Hant  BoutiqueBitmap9x9 Bold  (app scale 1.00)
   Subsetted to the characters each language's generated pages use, plus
   ASCII; see fonts/ and tools/subset-fonts.mjs. Digits/timer/version
   numbers stay Bongo-8 in every language, same as the app's StandardFont
   (CountdownPanel, ClockPanel, ScaleLabelManager, BarButtonNode) - see the
   font-family pins on .hud__time, .hud__keys .key, .track__time,
   .track__ticks span, .step__n and .news dt above.

   Each font's native pixel grid was measured the same way as Bongo-8
   (README "ピクセルグリッドの計測"): unitsPerEm and glyph bbox/advance
   extents reduce to a clean N-per-em grid.
     marukiya            unitsPerEm 1000, grid 1000/8  = 1/8 em  (same as Bongo-8)
     Galmuri11-Bold       unitsPerEm 1200, grid 1200/12 = 1/12 em
     BoutiqueBitmap9x9    unitsPerEm 1000, grid 1000/10 = 1/10 em
   --dot (the outline/drop unit used by --v2-text/--v2-line-only above) is
   overridden per language so the pixel outline stays on each font's own
   grid instead of Bongo-8's. Every font-size/line-height below is a whole
   multiple of its language's grid: English px -> (ja, ko, zh) px, rounded
   to the nearest multiple (ties and the smallest/body tier round up, so
   CJK body text never ends up smaller than the English baseline):
     16 -> 16, 24, 20      24 -> 32, 24, 30      32 -> 40, 36, 40
     40 -> 48, 48, 40      48 -> 56, 48, 50
   ============================================================ */
@font-face {
  font-family: "Marukiya";
  src: url("../fonts/marukiya.ja.woff2") format("woff2");
  font-display: block;
}
@font-face {
  font-family: "Galmuri11Bold";
  src: url("../fonts/galmuri11-bold.ko.woff2") format("woff2");
  font-display: block;
}
@font-face {
  font-family: "BoutiqueBitmap9x9Hans";
  src: url("../fonts/boutiquebitmap9x9-bold.zh-hans.woff2") format("woff2");
  font-display: block;
}
@font-face {
  font-family: "BoutiqueBitmap9x9Hant";
  src: url("../fonts/boutiquebitmap9x9-bold.zh-hant.woff2") format("woff2");
  font-display: block;
}
:root:lang(ja) { --font: "Marukiya", "Bongo8", sans-serif; }
:root:lang(ko) { --font: "Galmuri11Bold", "Bongo8", sans-serif; --dot: 0.0833em; }
:root:lang(zh-Hans) { --font: "BoutiqueBitmap9x9Hans", "Bongo8", sans-serif; --dot: 0.1em; }
:root:lang(zh-Hant) { --font: "BoutiqueBitmap9x9Hant", "Bongo8", sans-serif; --dot: 0.1em; }

/* Group A (16/32): running text */
:lang(ja) body, :lang(ja) .win h3, :lang(ja) .win--hero > p, :lang(ja) .legal p, :lang(ja) .legal li
  { font-size: 16px; line-height: 40px; }
:lang(ko) body, :lang(ko) .win h3, :lang(ko) .win--hero > p, :lang(ko) .legal p, :lang(ko) .legal li
  { font-size: 24px; line-height: 36px; }
:lang(zh-Hans) body, :lang(zh-Hans) .win h3, :lang(zh-Hans) .win--hero > p, :lang(zh-Hans) .legal p, :lang(zh-Hans) .legal li,
:lang(zh-Hant) body, :lang(zh-Hant) .win h3, :lang(zh-Hant) .win--hero > p, :lang(zh-Hant) .legal p, :lang(zh-Hant) .legal li
  { font-size: 20px; line-height: 40px; }

/* Group B (24/32): h2-weight headings (and the demo's Start!/Finished! label) */
:lang(ja) .brand, :lang(ja) .win h2, :lang(ja) .plate, :lang(ja) .legal h2, :lang(ja) .demo__float
  { font-size: 32px; line-height: 40px; }
:lang(ko) .brand, :lang(ko) .win h2, :lang(ko) .plate, :lang(ko) .legal h2, :lang(ko) .demo__float
  { font-size: 24px; line-height: 36px; }
:lang(zh-Hans) .brand, :lang(zh-Hans) .win h2, :lang(zh-Hans) .plate, :lang(zh-Hans) .legal h2, :lang(zh-Hans) .demo__float,
:lang(zh-Hant) .brand, :lang(zh-Hant) .win h2, :lang(zh-Hant) .plate, :lang(zh-Hant) .legal h2, :lang(zh-Hant) .demo__float
  { font-size: 30px; line-height: 40px; }

/* Group C (16/24): fine print and small UI labels */
:lang(ja) .fine, :lang(ja) .shot figcaption, :lang(ja) .shot__empty, :lang(ja) .key--wide, :lang(ja) .demo__rest-tag,
:lang(ja) .picker__label, :lang(ja) .names, :lang(ja) .site-footer, :lang(ja) .lang-menu, :lang(ja) .lang-switch
  { font-size: 16px; line-height: 32px; }
:lang(ko) .fine, :lang(ko) .shot figcaption, :lang(ko) .shot__empty, :lang(ko) .key--wide, :lang(ko) .demo__rest-tag,
:lang(ko) .picker__label, :lang(ko) .names, :lang(ko) .site-footer, :lang(ko) .lang-menu, :lang(ko) .lang-switch
  { font-size: 24px; line-height: 24px; }
:lang(zh-Hans) .fine, :lang(zh-Hans) .shot figcaption, :lang(zh-Hans) .shot__empty, :lang(zh-Hans) .key--wide, :lang(zh-Hans) .demo__rest-tag,
:lang(zh-Hans) .picker__label, :lang(zh-Hans) .names, :lang(zh-Hans) .site-footer, :lang(zh-Hans) .lang-menu, :lang(zh-Hans) .lang-switch,
:lang(zh-Hant) .fine, :lang(zh-Hant) .shot figcaption, :lang(zh-Hant) .shot__empty, :lang(zh-Hant) .key--wide, :lang(zh-Hant) .demo__rest-tag,
:lang(zh-Hant) .picker__label, :lang(zh-Hant) .names, :lang(zh-Hant) .site-footer, :lang(zh-Hant) .lang-menu, :lang(zh-Hant) .lang-switch
  { font-size: 20px; line-height: 30px; }

/* Group D (32/40): h1-weight headings, mobile */
:lang(ja) .win--hero h1, :lang(ja) .legal h1 { font-size: 40px; line-height: 48px; }
:lang(ko) .win--hero h1, :lang(ko) .legal h1 { font-size: 36px; line-height: 48px; }
:lang(zh-Hans) .win--hero h1, :lang(zh-Hans) .legal h1,
:lang(zh-Hant) .win--hero h1, :lang(zh-Hant) .legal h1 { font-size: 40px; line-height: 40px; }

@media (min-width: 960px) {
  /* Group E (32/40 @960): h2-weight headings (and the demo's Start!/Finished! label) */
  :lang(ja) .win h2, :lang(ja) .plate, :lang(ja) .demo__float { font-size: 40px; line-height: 48px; }
  :lang(ko) .win h2, :lang(ko) .plate, :lang(ko) .demo__float { font-size: 36px; line-height: 48px; }
  :lang(zh-Hans) .win h2, :lang(zh-Hans) .plate, :lang(zh-Hans) .demo__float,
  :lang(zh-Hant) .win h2, :lang(zh-Hant) .plate, :lang(zh-Hant) .demo__float { font-size: 40px; line-height: 40px; }

  /* Group F (24/32 @960): secondary text that grows on wide screens */
  :lang(ja) .win h3, :lang(ja) .win--hero > p { font-size: 32px; line-height: 40px; }
  :lang(ko) .win h3, :lang(ko) .win--hero > p { font-size: 24px; line-height: 36px; }
  :lang(zh-Hans) .win h3, :lang(zh-Hans) .win--hero > p,
  :lang(zh-Hant) .win h3, :lang(zh-Hant) .win--hero > p { font-size: 30px; line-height: 40px; }

  /* Group G (40/48 @960): h1-weight headings, desktop */
  :lang(ja) .win--hero h1, :lang(ja) .legal h1 { font-size: 48px; line-height: 56px; }
  :lang(ko) .win--hero h1, :lang(ko) .legal h1 { font-size: 48px; line-height: 48px; }
  :lang(zh-Hans) .win--hero h1, :lang(zh-Hans) .legal h1,
  :lang(zh-Hant) .win--hero h1, :lang(zh-Hant) .legal h1 { font-size: 40px; line-height: 50px; }
}

/* ---- ja legal-body exception (privacy.html / terms.html only) ----
   i18n/ja.json keeps real kanji in the privacy/terms body paragraphs
   and list items, for legal accuracy (everywhere else on the site is
   kana-only, see the ja.json rewrite). marukiya has no kanji at all,
   so those characters were falling back to the browser's generic
   "sans-serif" mid-paragraph, and the pixel outline/drop shadow
   (--v2-text / the .win text-shadow, sized to marukiya's own 1/8em
   grid) looked broken on top of that fallback glyph.
   Fix, scoped to :lang(ja) .legal--kanji p/li (privacy and terms only;
   credits is kana-only and stays in marukiya - headings keep the
   outline): drop the pixel font entirely for just this run of text
   (no point starting with Marukiya when every sentence needs kanji
   it can't draw) in favor of a real Japanese sans stack, and turn the
   shadow off so the fallback glyphs render clean instead of outlined. */
:lang(ja) .legal--kanji p, :lang(ja) .legal--kanji li {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic Medium",
    "Yu Gothic", "Noto Sans JP", "Meiryo", sans-serif;
  text-shadow: none;
}

/* Language names in the header menu and footer switcher. Each page's
   pixel font is subset to that page's language only (and marukiya has no
   kanji at all), so "日本語" / "한국어" / "简体中文" / "繁體中文" can't be drawn
   by it. Latin "English" stays in Bongo-8; the other names fall back to
   the system's font for their script, without the pixel outline. */
.lang-menu summary span,
.lang-menu a[lang],
.lang-switch a[lang] {
  font-family: "Bongo8", -apple-system, "Hiragino Sans", "Apple SD Gothic Neo",
               "PingFang SC", "PingFang TC", "Noto Sans CJK JP", sans-serif;
  text-shadow: none;
}

/* The app's own tomato (Trophies/TR100/71: 16x16 dots, stored at 3x),
   copied at 1x and only ever shown at whole multiples of 16px. */
img.tomato {
  display: inline-block;
  width: 16px; height: 16px;
  vertical-align: -2px;
  image-rendering: pixelated;
}
h1 img.tomato, h2 img.tomato { width: 32px; height: 32px; vertical-align: -4px; }
.demo__row img {
  display: block;
  width: calc(32px * var(--k)); height: calc(32px * var(--k));
  image-rendering: pixelated;
}
