/* Four Hundred Millimetres
   Layout concept: every photo sits inside a viewfinder frame (corner brackets, mono readout strip).
   Photo first, always dark. The games are numbered as frames (01, 02 ...) because they are a real sequence.
   Type: condensed display like the engraving on a lens barrel, a plain humanist body, mono for the readouts. */

:root {
  color-scheme: dark;

  --bg: #0d0e0b;
  --surface: #161812;
  --surface-2: #1e211a;
  --line: #2c3025;
  --text: #ece9de;
  --soft: #cdcabd;
  --muted: #a3a493;
  --accent: #f0a92e;
  --accent-ink: #1b1406;
  --good: #7fcf9f;
  --bad: #e47a62;
  --lens-red: #d6283c;

  /* The Latin fonts have no Chinese characters, so the stacks end with common Chinese system fonts. */
  --font-display: "Big Shoulders Display", "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", monospace;

  --gutter: clamp(16px, 4vw, 32px);
  --maxw: 1160px;
  --radius: 4px;

  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Top bar ---------- */
.topbar { min-height: 49px; border-bottom: 1px solid var(--line); }
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 6px 24px; padding-block: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font: 800 1.1rem/1 var(--font-display); letter-spacing: .07em; text-transform: uppercase;
}
.lens {
  position: relative; width: 22px; height: 22px; flex: none;
  border-radius: 50%; border: 2px solid var(--text);
}
.lens::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  border: 2px solid var(--lens-red);
}
.topbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 0 22px; }
.lang { display: inline-flex; gap: 2px; }
.lang button {
  padding: .6rem .55rem; border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer;
  color: var(--muted); font: 500 .72rem/1 var(--font-mono); letter-spacing: .08em;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 0 22px; }
.nav a {
  padding: .6rem 0; border-bottom: 2px solid transparent; text-decoration: none; color: var(--muted);
  font: 500 .72rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"], .nav a[aria-current="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Type ---------- */
.eyebrow {
  margin: 0; color: var(--accent);
  font: 500 .74rem/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase;
}
h1 {
  margin: 0; text-wrap: balance;
  font: 800 clamp(3rem, 9.5vw, 6.5rem)/.9 var(--font-display); letter-spacing: .005em; text-transform: uppercase;
}
.h2 {
  margin: 0; text-wrap: balance;
  font: 800 clamp(1.9rem, 4.4vw, 2.9rem)/1 var(--font-display); letter-spacing: .01em; text-transform: uppercase;
}
.h3 {
  margin: 0 0 10px; color: var(--accent);
  font: 500 .74rem/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase;
}
.lede { margin: 0; max-width: 62ch; color: var(--soft); font-size: clamp(1.05rem, 2.2vw, 1.25rem); }

.page-head { display: grid; gap: 12px; padding-block: clamp(28px, 5vw, 56px) clamp(16px, 3vw, 28px); }

/* ---------- Viewfinder frame ---------- */
.frame { margin: 0; display: grid; gap: 8px; }
.hud {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; color: var(--muted);
  font: 500 .72rem/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
}
.vf { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; }
.vf > img { width: 100%; }
.vf::after {
  content: ""; position: absolute; inset: 12px; z-index: 3; pointer-events: none;
  --c: rgba(236, 233, 222, .6); --l: 24px; --w: 2px;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) 0 0 / var(--w) var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--w) var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / var(--w) var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--w) var(--l) no-repeat;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: .8rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); text-decoration: none;
  font: 600 .92rem/1 var(--font-body);
}
.btn:hover { border-color: var(--muted); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { border-color: var(--text); }
.link-btn {
  justify-self: start; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--muted); text-decoration: underline; text-underline-offset: 3px;
  font: 500 .85rem/1.2 var(--font-body);
}
.link-btn:hover { color: var(--text); }

/* ---------- Home ---------- */
/* The title sits over the empty sky and earth on the left, so the lioness stays clear. */
.hero { position: relative; }
.hero-photo { position: relative; width: 100%; aspect-ratio: 2 / 1; max-height: 640px; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 55% 55%; }
.hero-photo::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(13, 14, 11, .92) 0%, rgba(13, 14, 11, .62) 34%, rgba(13, 14, 11, 0) 60%),
    linear-gradient(180deg, rgba(13, 14, 11, 0) 70%, var(--bg) 100%);
}
.hero-copy { position: absolute; inset: 0; z-index: 4; display: flex; align-items: flex-end; pointer-events: none; }
.hero-copy .wrap { max-width: none; padding-inline: clamp(16px, 4vw, 56px); padding-bottom: clamp(28px, 5vw, 56px); }
.hero-text { display: grid; gap: 14px; max-width: min(29vw, 480px); pointer-events: auto; }
.hero-text h1 { font-size: clamp(2.6rem, 6vw, 5.4rem); }
.hero-text .eyebrow { text-wrap: balance; }      /* a long line breaks into two even lines, not one word on its own */
@media (max-width: 860px) {
  .hero-photo { aspect-ratio: 4 / 3; max-height: none; }
  .hero-photo::before { background: linear-gradient(180deg, rgba(13, 14, 11, 0) 60%, var(--bg) 100%); }
  .hero-copy { position: static; display: block; }
  .hero-copy .wrap { padding-top: 8px; padding-bottom: 28px; }
  .hero-text { max-width: none; }
  .hero-text h1 { font-size: clamp(2.8rem, 13vw, 4.4rem); }
}
@media (min-width: 560px) and (max-width: 860px) { .hero-photo { aspect-ratio: 16 / 9; } }

.frames-section { padding-block: clamp(32px, 6vw, 56px) clamp(40px, 7vw, 72px); scroll-margin-top: 8px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 20px; }
.frames { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s;
}
.card:hover { border-color: var(--accent); }
.card-photo { aspect-ratio: 4 / 3; overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-photo img { transform: scale(1.04); }
.card-body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 18px 18px 20px; }
.card-body h2 { margin: 0; font: 800 2rem/1 var(--font-display); letter-spacing: .01em; text-transform: uppercase; }
.card-body p { margin: 0; color: var(--soft); }
.card-body .eyebrow { margin-bottom: 2px; }
.card-cta {
  margin-top: auto; padding-top: 10px; color: var(--accent);
  font: 500 .78rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
}

/* ---------- Game: spot ---------- */
.game { display: grid; gap: 20px; padding-bottom: clamp(32px, 6vw, 64px); }
/* ---------- Zoomable photo ---------- */
.stage-slot { position: relative; width: 100%; aspect-ratio: var(--ar, 3 / 2); }
.zoomable {
  position: absolute; inset: 0; background: #000; user-select: none; -webkit-user-select: none;
  touch-action: pan-y; -webkit-tap-highlight-color: transparent;
}
.zoomable > img {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none;
  object-fit: contain; transform-origin: 0 0; pointer-events: none; -webkit-user-drag: none;
}
.zoomable.is-zoomed, .zoomable.is-expanded { touch-action: none; }
.zoomable.is-zoomed { cursor: grab; }
.zoomable.is-dragging { cursor: grabbing; }
.stage, .stage.is-zoomed { cursor: crosshair; }
.stage.is-dragging { cursor: grabbing; }
.zoomable.is-expanded { position: fixed; inset: 0; z-index: 1000; border-radius: 0; cursor: grab; }
.zoomable.is-expanded:focus-visible { outline-offset: -4px; }
.stage.is-expanded { cursor: crosshair; }
html.zoom-lock { overflow: hidden; }
.marks { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }

/* Drawing on the photo (Blowing in the Wind) */
.zoomable.is-drawing, .zoomable.is-drawing.is-zoomed, .zoomable.is-drawing.is-expanded { cursor: crosshair; touch-action: none; }
.ink { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
.ink path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ink .line-under { stroke: rgba(13, 14, 11, .55); stroke-width: 6; }
.ink .line { stroke: var(--accent); stroke-width: 3; }
.ink .drool-glow { stroke: rgba(127, 207, 159, .35); stroke-width: 11; }
.ink .drool { stroke: var(--good); stroke-width: 3; }
.ink .drool.hint { stroke-width: 2.5; stroke-dasharray: 7 7; }
.zoom-hud .seg button { background: rgba(13, 14, 11, .6); }

/* Camera readout, like the strip along the bottom of a viewfinder */
.readout {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 18px; margin-inline: auto; width: max-content;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; max-width: calc(100% - 28px);
  padding: 6px 12px; border-radius: 2px; background: rgba(13, 14, 11, .62); color: var(--text); pointer-events: none;
  font: 500 .72rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.zoomable.is-expanded .readout { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
.readout.top { top: 18px; bottom: auto; }
.zoomable.is-expanded .readout.top { top: calc(74px + env(safe-area-inset-top, 0px)); bottom: auto; }   /* below the full-screen status box */
@media (max-width: 600px) {
  .readout { bottom: 14px; gap: 4px 10px; padding: 5px 9px; font-size: .62rem; letter-spacing: .04em; }
  .zoomable.is-expanded .readout { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

.zoom-ctl { display: inline-flex; gap: 4px; }
.hud .zoom-ctl { margin-left: auto; }
.zoom-ctl button {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; cursor: pointer;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font: 500 1.15rem/1 var(--font-mono);
}
.zoom-ctl button:hover { border-color: var(--muted); }
.zoom-ctl svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.zoom-ctl .zr { font-size: .68rem; letter-spacing: 0; }
.zoomable > .zoom-ctl {
  position: absolute; z-index: 5; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.zoomable > .zoom-ctl button { width: 44px; height: 44px; background: rgba(13, 14, 11, .8); border-color: rgba(236, 233, 222, .3); }
.zoom-hud { display: none; }
.is-expanded .zoom-hud:not(:empty) {
  display: flex; align-items: center; gap: 12px; position: absolute; z-index: 5;
  left: calc(16px + env(safe-area-inset-left, 0px)); top: calc(16px + env(safe-area-inset-top, 0px));
  max-width: calc(100% - 32px); padding: 8px 10px; border-radius: var(--radius);
  background: rgba(13, 14, 11, .8); border: 1px solid rgba(236, 233, 222, .3); font-size: .9rem; line-height: 1.3;
}
.zoom-hud .btn { padding: .5rem .8rem; font-size: .8rem; }
@media (max-width: 600px) {
  .zoom-ctl button { width: 40px; height: 40px; }
}

.mark {
  position: absolute; z-index: 2; min-width: 40px; min-height: 40px; transform: translate(-50%, -50%);
  --c: var(--accent); pointer-events: none;
}
.mark i {
  position: absolute; width: min(20px, 34%); aspect-ratio: 1; border: 0 solid var(--c);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, .95));
}
.mark i:nth-of-type(1) { left: 0; top: 0; border-left-width: 3px; border-top-width: 3px; }
.mark i:nth-of-type(2) { right: 0; top: 0; border-right-width: 3px; border-top-width: 3px; }
.mark i:nth-of-type(3) { left: 0; bottom: 0; border-left-width: 3px; border-bottom-width: 3px; }
.mark i:nth-of-type(4) { right: 0; bottom: 0; border-right-width: 3px; border-bottom-width: 3px; }
.mark b {
  position: absolute; left: -3px; bottom: 100%; margin-bottom: 4px; padding: 3px 6px 2px;
  background: var(--c); color: var(--accent-ink); border-radius: 2px;
  font: 600 .7rem/1 var(--font-mono); letter-spacing: .06em; white-space: nowrap;
}
.mark[data-state="shown"] { --c: var(--muted); }
.mark.new { animation: lock .55s cubic-bezier(.2, .8, .2, 1); }
@keyframes lock {
  from { opacity: 0; transform: translate(-50%, -50%) scale(1.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.miss {
  position: absolute; z-index: 2; width: 44px; height: 44px; pointer-events: none;
  border: 2px solid rgba(236, 233, 222, .9); transform: translate(-50%, -50%);
  animation: miss .7s ease-out forwards;
}
@keyframes miss {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
}
.pulse {
  position: absolute; z-index: 2; width: 18%; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  border: 2px solid var(--accent); transform: translate(-50%, -50%);
  animation: pulse 1.3s ease-out 3 forwards;
}
@keyframes pulse {
  from { opacity: .95; transform: translate(-50%, -50%) scale(.3); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.25); }
}

.statusbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.status { flex: 1 1 260px; min-width: 0; margin: 0; }
.count {
  margin: 0; color: var(--muted);
  font: 500 .78rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.count strong { color: var(--accent); font: 800 1.6rem/1 var(--font-display); letter-spacing: .02em; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.slots {
  display: grid; gap: 16px; margin: 0; padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.slot {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.slot[data-state="found"] { border-color: var(--accent); }
.slot-thumb {
  position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3;
  background-color: var(--surface-2); background-repeat: no-repeat; border-bottom: 1px solid var(--line);
}
.slot-thumb .n { font: 800 4.5rem/1 var(--font-display); color: var(--line); }
.slot:not([data-state="hidden"]) .slot-thumb .n { display: none; }
.slot-tag {
  position: absolute; left: 10px; top: 10px; padding: 4px 7px 3px; border-radius: 2px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 .68rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
}
.slot[data-state="shown"] .slot-tag { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.slot-body { display: grid; flex: 1; align-content: start; gap: 6px; padding: 14px 16px 16px; }
.slot-title { margin: 0; font: 800 1.55rem/1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
.slot[data-state="hidden"] .slot-title { color: var(--muted); }
.slot-latin { margin: 0; color: var(--muted); font-size: .85rem; font-style: italic; }
.slot-text { margin: 0; color: var(--soft); font-size: .96rem; }

@media (max-width: 600px) {
  .mark b { display: none; }
  .slot[data-state="hidden"] .slot-thumb { aspect-ratio: auto; height: 64px; }
  .slot-thumb .n { font-size: 3rem; }
}

.complete {
  display: grid; gap: 14px; padding: 22px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface);
}
.complete p { margin: 0; color: var(--soft); max-width: 60ch; }
.complete .actions { margin-top: 4px; }

/* ---------- Game: quiz ---------- */
.quiz { display: grid; gap: 18px; padding-bottom: clamp(24px, 5vw, 48px); }
.opts { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.opt {
  display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 6px 16px; width: 100%; padding: 16px;
  text-align: left; cursor: pointer; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: 500 1.08rem/1.4 var(--font-body);
}
.opt:hover:not([disabled]) { border-color: var(--muted); }
.opt .key {
  padding: .35rem .5rem; border: 1px solid var(--line); color: var(--muted);
  font: 600 .8rem/1 var(--font-mono);
}
.opt .note { grid-column: 2; display: block; color: var(--soft); font-size: .95rem; font-weight: 400; }
.opt[data-state="wrong"] { border-color: var(--bad); }
.opt[data-state="wrong"] .key { border-color: var(--bad); color: var(--bad); }
.opt[data-state="right"] { border-color: var(--good); background: #14201a; }
.opt[data-state="right"] .key { border-color: var(--good); color: var(--good); }
.opt[disabled] { cursor: default; }
.opt[disabled]:not([data-state]) { opacity: .5; }

.feedback { margin: 0; min-height: 1.6em; color: var(--soft); }

.reveal { display: grid; gap: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.reveal-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.reveal p { margin: 0; max-width: 60ch; color: var(--soft); }
.facts { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.facts li { padding-left: 16px; border-left: 2px solid var(--accent); color: var(--soft); max-width: 60ch; }
.fine { margin: 0; color: var(--muted); font-size: .88rem; max-width: 62ch; }

/* ---------- Game: race ---------- */
.pick { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.pick-btn {
  display: grid; gap: 6px; padding: 20px 18px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
}
.pick-btn:hover:not([disabled]) { border-color: var(--accent); }
.pick-btn[disabled] { cursor: default; }
.pick-btn[data-state="picked"] { border-color: var(--accent); background: var(--surface-2); }
.pick-btn[disabled]:not([data-state]) { opacity: .5; }
.pick-name { font: 800 2.4rem/1 var(--font-display); letter-spacing: .01em; text-transform: uppercase; }
.pick-sub { color: var(--muted); font-size: .95rem; }

.result { display: grid; gap: 22px; }
.verdict { margin: 0; font: 800 clamp(1.7rem, 4vw, 2.4rem)/1.05 var(--font-display); letter-spacing: .01em; text-transform: uppercase; }
.verdict[data-ok="true"] { color: var(--good); }

.race { display: grid; gap: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.race-head {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; color: var(--muted);
  font: 500 .72rem/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
}
.lane { display: grid; grid-template-columns: 5.6rem 1fr 3.4rem; align-items: center; gap: 12px; }
.who { display: grid; gap: 2px; }
.who span { font: 800 1.3rem/1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
.who small { color: var(--muted); font: 500 .7rem/1.2 var(--font-mono); letter-spacing: .06em; }
.track { position: relative; height: 40px; border-block: 1px dashed var(--line); --rw: 3.4rem; --c: var(--muted); }
.track::after {
  content: ""; position: absolute; right: 0; top: -1px; bottom: -1px; width: 12px;
  background: repeating-conic-gradient(var(--text) 0 25%, transparent 0 50%) 0 0 / 12px 12px;
}
.trail {
  position: absolute; left: 0; top: 50%; height: 2px;
  width: calc((100% - 12px) * var(--p, 0)); background: linear-gradient(90deg, transparent, var(--c));
}
.runner {
  position: absolute; top: 50%; width: var(--rw); height: 20px; transform: translateY(-50%);
  left: calc((100% - var(--rw) - 12px) * var(--p, 0));
  background: var(--c); clip-path: polygon(0 0, 78% 0, 100% 50%, 78% 100%, 0 100%);
}
.lane[data-who="jackal"] .track { --c: var(--accent); }
.time { color: var(--text); font: 500 .85rem/1 var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.race-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.race-foot p { margin: 0; color: var(--soft); max-width: 52ch; }
@media (max-width: 520px) {
  .lane { grid-template-columns: 4.4rem 1fr 3rem; gap: 8px; }
  .track { --rw: 2.6rem; }
}

/* ---------- Shared pieces for the newer games ---------- */
.step { display: grid; gap: 14px; }
.step-p { margin: 0; color: var(--soft); max-width: 62ch; }
.callout { display: grid; gap: 6px; margin: 0; padding: 16px 18px; border-left: 3px solid var(--accent); background: var(--surface); max-width: 72ch; }
.callout p { color: var(--text); }
.credits-h { margin: 0 0 6px; color: var(--muted); font: 600 .62rem/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.credits { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .66rem; line-height: 1.5; }
.credits a { color: inherit; text-underline-offset: 2px; }
.reveal .credits { max-width: 70ch; }

/* A tall (portrait) photo beside the game on wide screens */
.split { display: grid; gap: 24px; align-items: start; }
.stage-slot.tall { width: min(100%, 52vh); margin-inline: auto; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 36px; }
  .split > .frame { position: sticky; top: 16px; }
  .split .stage-slot.tall { width: min(100%, calc((100vh - 110px) * 2 / 3)); }
}

/* Dial (Zebra Vision) */
.dial-box { display: grid; gap: 12px; justify-items: center; padding: 20px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.dial { display: block; width: min(100%, 320px); height: auto; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.dial.is-dragging { cursor: grabbing; }
.dial[aria-disabled="true"] { cursor: default; }
.dial:focus { outline: none; }
.dial:focus-visible .dial-face { stroke: var(--accent); stroke-width: 3; }
.dial-face { fill: var(--surface-2); stroke: var(--line); stroke-width: 2; }
.dial-tick { stroke: var(--muted); stroke-width: 1.4; }
.dial-tick.major { stroke: var(--text); stroke-width: 2.4; }
.dial-num { fill: var(--muted); font: 500 11px var(--font-mono); text-anchor: middle; dominant-baseline: central; }
.dial-sweep { fill: rgba(240, 169, 46, .26); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.dial-needle { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.dial-knob { fill: var(--accent); stroke: var(--bg); stroke-width: 3; }
.dial-bracket { fill: none; stroke: var(--good); stroke-width: 9; }
.dial-true { stroke: var(--good); stroke-width: 3; stroke-dasharray: 5 5; stroke-linecap: round; }
.zebra-head { fill: #ece9de; stroke: #0d0e0b; stroke-width: 1.5; }
.zebra-stripe { fill: none; stroke: #0d0e0b; stroke-width: 3; stroke-linecap: round; }
.zebra-eye { fill: #0d0e0b; }
.dial-read { margin: 0; font: 800 clamp(2.6rem, 7vw, 3.4rem)/1 var(--font-display); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.dial-hint { margin: 0; color: var(--muted); font-size: .9rem; text-align: center; max-width: 40ch; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 0; padding: 0; list-style: none; color: var(--soft); font-size: .86rem; }
.legend i { display: inline-block; width: 18px; height: 4px; margin-right: 7px; vertical-align: middle; background: var(--c); }
.verdict-sm { margin: 0; font: 800 clamp(1.5rem, 3.6vw, 2rem)/1.05 var(--font-display); letter-spacing: .01em; text-transform: uppercase; }
.verdict-sm[data-ok="true"] { color: var(--good); }
.diagram { display: grid; gap: 10px; justify-items: center; margin: 0; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.diagram svg { width: min(100%, 300px); height: auto; }
.diagram.wide svg { width: min(100%, 460px); }
.diagram figcaption { color: var(--muted); font-size: .88rem; text-align: center; max-width: 52ch; }
.diag-label { fill: var(--text); font: 600 12px var(--font-mono); letter-spacing: .04em; }
.diag-muted { fill: var(--muted); font: 500 11px var(--font-mono); }

/* Photo switch (Grooming Time) */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { padding: .55rem .75rem; border: 0; background: var(--surface); color: var(--muted); cursor: pointer; font: 500 .72rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

/* Colour palette and pins (Count the Colours) */
.palette { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.chip { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 3px 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.chip .sw { grid-row: 1 / span 3; width: 40px; height: 40px; border-radius: 50%; border: 2px dashed var(--line); }
.chip:not([data-state="hidden"]) .sw { border: 2px solid rgba(236, 233, 222, .35); background: var(--c); }
.chip[data-state="found"] { border-color: var(--accent); }
.chip-name { margin: 0; font: 800 1.25rem/1.1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
.chip[data-state="hidden"] .chip-name { color: var(--muted); }
.chip-where { margin: 0; color: var(--soft); font-size: .9rem; }
.chip .link-btn { font-size: .8rem; }
.pin { position: absolute; z-index: 2; width: 0; height: 0; pointer-events: none; }
.pin i { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .55); }
.pin b {
  position: absolute; left: 13px; top: -10px; padding: 3px 6px 2px; white-space: nowrap; border-radius: 2px;
  background: rgba(13, 14, 11, .86); border: 1px solid var(--c); color: var(--text);
  font: 600 .66rem/1.1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
}
.pin.left b { left: auto; right: 13px; }
.pin.new i { animation: pin-in .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes pin-in { from { transform: scale(2.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Circles (The Crossing) */
.ring {
  position: absolute; z-index: 2; min-width: 28px; min-height: 28px; transform: translate(-50%, -50%); pointer-events: none;
  border: 3px solid var(--accent); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .55);
}
.ring b {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, calc(-100% - 5px)); padding: 3px 6px 2px; border-radius: 2px;
  background: var(--accent); color: var(--accent-ink); font: 600 .7rem/1 var(--font-mono); white-space: nowrap;
}
.ring[data-state="missed"] { border-style: dashed; border-color: var(--text); }
.ring[data-state="missed"] b { background: var(--text); }
.ring.new { animation: lock .55s cubic-bezier(.2, .8, .2, 1); }

/* Sound cards (Go Away!) */
.sounds { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.sound { display: grid; gap: 14px; align-content: start; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.sound[data-state="right"] { border-color: var(--good); background: #14201a; }
.sound[data-state="wrong"] { border-color: var(--bad); }
.sound-top { display: flex; align-items: center; gap: 14px; }
.sound-key { min-width: 1.1ch; color: var(--accent); font: 800 2.4rem/1 var(--font-display); }
.play {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; padding: 0; cursor: pointer;
  border-radius: 50%; border: 1px solid var(--muted); background: var(--surface-2); color: var(--text);
}
.play:hover { border-color: var(--accent); }
.play svg { width: 20px; height: 20px; fill: currentColor; }
.bars { display: flex; align-items: center; gap: 3px; flex: 1; height: 34px; }
.bars i { flex: 1; max-width: 5px; height: 16%; border-radius: 2px; background: var(--line); }
.sound.is-playing .bars i { background: var(--accent); animation: eq 1s ease-in-out infinite; }
.bars i:nth-child(3n) { animation-delay: -.3s; }
.bars i:nth-child(3n + 1) { animation-delay: -.65s; }
.bars i:nth-child(4n) { animation-duration: .8s; }
@keyframes eq { 0%, 100% { height: 16%; } 50% { height: 92%; } }
.progress { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); }
.sound-name { margin: 0; font: 800 1.35rem/1.1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
.sound-note { margin: 0; color: var(--soft); font-size: .93rem; }
.sound .btn { justify-self: start; }
.bonus { display: grid; gap: 12px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.bonus p { margin: 0; color: var(--soft); max-width: 62ch; }
.video { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); background: #000; }

/* Bird cards (The Builder) */
.birds { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.bird {
  display: grid; width: 100%; padding: 0; overflow: hidden; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); font: inherit;
}
.bird:hover:not([disabled]) { border-color: var(--accent); }
.bird img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.bird-body { display: grid; gap: 6px; padding: 12px 14px 14px; }
.bird-top { display: flex; align-items: center; gap: 10px; }
.bird .key { padding: .35rem .5rem; border: 1px solid var(--line); color: var(--muted); font: 600 .8rem/1 var(--font-mono); }
.bird-name { font: 800 1.3rem/1.1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
.bird-note { color: var(--soft); font-size: .93rem; }
.bird[data-state="right"] { border-color: var(--good); background: #14201a; }
.bird[data-state="right"] .key { border-color: var(--good); color: var(--good); }
.bird[data-state="wrong"] { border-color: var(--bad); }
.bird[data-state="wrong"] .key { border-color: var(--bad); color: var(--bad); }
.bird[disabled] { cursor: default; }
.bird[disabled]:not([data-state]) { opacity: .6; }
.nest-parts { display: grid; gap: 12px; width: 100%; margin: 4px 0 0; padding: 0; list-style: none; }
.nest-parts li { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; color: var(--soft); font-size: .93rem; }
.nest-parts b {
  grid-row: span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font: 600 .8rem/1 var(--font-mono);
}
.nest-parts strong { color: var(--text); }

/* ---------- Gallery ---------- */
.gal { display: grid; gap: 18px; padding-bottom: clamp(32px, 6vw, 64px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  padding: .6rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
  font: 500 .74rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
}
.chips button:hover { color: var(--text); border-color: var(--muted); }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chips .n { margin-left: 7px; opacity: .65; }
/* Rows of photos at their own shapes: each photo grows in proportion to its width, so a row shares one height. */
.gallery { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; --rowh: 200px; }
.gallery::after { content: ""; flex: 999999 1 0; }          /* the last row keeps natural sizes instead of stretching */
.g-item { position: relative; min-width: 0; flex: calc(var(--ar) * 1000) 1 calc(var(--ar) * var(--rowh)); }
.g-item button { display: block; width: 100%; padding: 0; border: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.g-item img { display: block; width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; transition: transform .4s; }
.g-item button:hover img { transform: scale(1.035); }
.g-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; pointer-events: none; text-align: left;
  background: linear-gradient(180deg, transparent, rgba(13, 14, 11, .88)); color: var(--text); font-size: .82rem; line-height: 1.3;
  opacity: 0; transition: opacity .2s;
}
.g-item button:hover .g-cap, .g-item button:focus-visible .g-cap { opacity: 1; }
@media (hover: none) { .g-cap { display: none; } }
@media (max-width: 600px) { .gallery { gap: 5px; --rowh: 118px; } }

/* Full-screen photo viewer */
.lightbox {
  position: fixed; inset: 0; z-index: 900; display: grid; gap: 0; background: rgba(8, 9, 7, .97);
  grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
}
.lb-bar { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; }
.lb-count { margin: 0; color: var(--muted); font: 500 .74rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.lb-bar .hud { flex: 1; justify-content: flex-end; }
.lightbox [data-z="full"] { display: none; }                  /* the viewer already fills the screen */
.lb-close {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; cursor: pointer; flex: none;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
}
.lb-close svg, .lb-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-main { position: relative; min-height: 0; padding: 0 60px; }
.lb-slot { position: relative; width: 100%; height: 100%; aspect-ratio: auto; }   /* fills the space; the photo fits inside */
.lb-slot .zoomable { border-radius: 0; background: transparent; }
.lb-nav {
  position: absolute; top: 50%; z-index: 6; display: grid; place-items: center; width: 44px; height: 64px; padding: 0; cursor: pointer;
  transform: translateY(-50%); border-radius: var(--radius); border: 1px solid rgba(236, 233, 222, .25); background: rgba(13, 14, 11, .7); color: var(--text);
}
.lb-nav:hover { border-color: var(--accent); }
.lb-nav.prev { left: 8px; }
.lb-nav.next { right: 8px; }
.lb-cap { display: grid; gap: 4px; width: 100%; max-width: 900px; margin: 0 auto; padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); text-align: center; }
.lb-title { margin: 0; font: 800 clamp(1.25rem, 3vw, 1.8rem)/1.1 var(--font-display); letter-spacing: .01em; text-transform: uppercase; }
.lb-note { margin: 0; color: var(--soft); font-size: .95rem; }
.lb-shot { margin: 0; color: var(--muted); font: 500 .7rem/1.5 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 700px) {
  .lb-main { padding: 0; }
  .lb-nav { top: auto; bottom: 10px; transform: none; width: 44px; height: 44px; }
}

/* ---------- Our Story ---------- */
.story { display: grid; gap: clamp(36px, 6vw, 64px); padding-bottom: clamp(40px, 7vw, 72px); }
.story .page-head { padding-bottom: 0; }
.story-intro { display: grid; gap: 24px; align-items: center; }
@media (min-width: 860px) { .story-intro { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; } }
.story-text { display: grid; gap: 14px; }
.story-text p { margin: 0; color: var(--soft); font-size: clamp(1.02rem, 1.6vw, 1.15rem); max-width: 60ch; }
.story-hello { margin: 0; font: 800 clamp(2rem, 4.5vw, 3rem)/1 var(--font-display); letter-spacing: .01em; text-transform: uppercase; }
.story-intro .story-photo { width: 100%; max-width: 440px; justify-self: center; }
.story-sec { display: grid; gap: 14px; }
.story-sec > p { margin: 0; color: var(--soft); max-width: 62ch; }
/* A row of photos: each column is as wide as its photo's shape (--cols, in "fr"), so the photos in a row share
   one height and the row fills the width. On phones they stack, one per line. */
.story-row { display: grid; gap: 12px; align-items: start; grid-template-columns: var(--cols, 1fr); }
.story-row.single { max-width: 860px; }
@media (max-width: 600px) { .story-row { grid-template-columns: 1fr; gap: 18px; } }
.story-photo { display: grid; align-content: start; gap: 8px; min-width: 0; margin: 0; }
.story-photo button { display: block; width: 100%; padding: 0; border: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.story-photo img { display: block; width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; transition: transform .4s; }
.story-photo button:hover img { transform: scale(1.03); }
.story-photo figcaption { color: var(--muted); font-size: .88rem; line-height: 1.4; }
.story-end { display: grid; gap: 12px; padding: clamp(20px, 4vw, 32px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.story-end p { margin: 0; color: var(--soft); max-width: 62ch; }
.story-end .lede { color: var(--text); }
.story-sign { color: var(--accent) !important; font: 800 1.7rem/1 var(--font-display); letter-spacing: .04em; text-transform: uppercase; }
html[lang="zh-CN"] .story-hello, html[lang="zh-CN"] .story-sign { line-height: 1.25; letter-spacing: .02em; }

/* Home page: a peek at the gallery */
.teaser { display: grid; gap: 16px; padding-bottom: clamp(40px, 7vw, 72px); }
.teaser p { margin: 0; color: var(--soft); max-width: 62ch; }
.teaser-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.teaser-strip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); transition: opacity .2s; }
.teaser-strip:hover img { opacity: .85; }
.reveal .end-story { padding: 24px 0 0; border-top: 1px solid var(--line); }   /* Our Story, after the last game */
@media (max-width: 600px) {
  .teaser-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .teaser-strip img:nth-child(n + 4) { display: none; }
}

/* ---------- Pager + footer ---------- */
.pager {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  padding-block: 24px 48px; border-top: 1px solid var(--line);
}
.pager a { display: grid; gap: 6px; max-width: 48%; text-decoration: none; }
.pager .dir { color: var(--muted); font: 500 .72rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.pager .name { font: 800 clamp(1.4rem, 4vw, 2rem)/1 var(--font-display); letter-spacing: .01em; text-transform: uppercase; }
.pager a:hover .name { color: var(--accent); }
.pager .next { margin-left: auto; text-align: right; }

.footer { border-top: 1px solid var(--line); }
.footer .wrap { padding-block: 24px 40px; color: var(--muted); font: 500 .74rem/1.6 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.footer p { margin: 0; }

/* Chinese: taller lines and no tight display leading, since the characters are full-width and dense */
html[lang="zh-CN"] body { line-height: 1.75; }
html[lang="zh-CN"] h1 { line-height: 1.15; letter-spacing: .03em; }
html[lang="zh-CN"] .h2, html[lang="zh-CN"] .card-body h2, html[lang="zh-CN"] .slot-title, html[lang="zh-CN"] .pick-name,
html[lang="zh-CN"] .verdict, html[lang="zh-CN"] .pager .name, html[lang="zh-CN"] .who span,
html[lang="zh-CN"] .verdict-sm, html[lang="zh-CN"] .chip-name, html[lang="zh-CN"] .sound-name, html[lang="zh-CN"] .bird-name,
html[lang="zh-CN"] .lb-title {
  line-height: 1.25; letter-spacing: .02em;
}
html[lang="zh-CN"] .brand { letter-spacing: .12em; }
html[lang="zh-CN"] .eyebrow, html[lang="zh-CN"] .h3, html[lang="zh-CN"] .hud, html[lang="zh-CN"] .nav a,
html[lang="zh-CN"] .card-cta, html[lang="zh-CN"] .count, html[lang="zh-CN"] .pager .dir { letter-spacing: .06em; }
html[lang="zh-CN"] .slot-latin { font-style: normal; }

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