/* This Is Apexia (thisisapexia.com). Layout: the live world opens the page; below it, sticker-like panels
   (ink outline + drop) on a pale-sky ground, a grass band for "your character", bottom dock on phones. */
:root {
    --ink: #17232b;
    --ink-2: #43525c;
    --paper: #fffdf6;
    --gold: #ffc629;
    --gold-deep: #e9a923;
    --sky-1: #8ccaea;
    --sky-2: #b9e0f3;
    --sky-3: #eaf6fb;
    --ground: #dff1f9;
    --grass: #8cc65a;
    --grass-hi: #a6d877;
    --grass-lo: #6cad46;
    --lime: #c6f56b;
    --plate: #1d2b35;
    --rock: #b9ac97;
    --line: #c9d9e0;
    --warn: #b3261e;
    --display: "Montserrat", "Arial Black", "Helvetica Neue", Arial, sans-serif;
    --body: "Nunito", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --pop: 0 4px 0 var(--ink);
    --top: 56px;
    --dock: 64px;
    color-scheme: light;
  }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font: 500 16px/1.5 var(--body);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: calc(var(--dock) + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
  }
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  :root { --top: 64px; }
}
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
img, video, canvas { max-width: 100%; }
button, input { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
/* ---------- caption type (the video's look) ---------- */
.cap {
    font-family: var(--display);
    font-weight: 900;
    text-transform: uppercase;
    color: var(--paper);
    -webkit-text-stroke: 0.15em var(--ink);
    paint-order: stroke fill;
    text-shadow: 0 0.07em 0.14em rgba(12, 30, 40, 0.38);
    letter-spacing: -0.01em;
    line-height: 1.04;
  }
.cap em { font-style: normal; color: var(--gold); }
/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 50px; padding: 11px 18px;
    font: 900 15px/1.12 var(--display); text-transform: uppercase; letter-spacing: 0.02em; text-align: center;
    color: var(--ink); background: var(--paper);
    border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: var(--pop);
    cursor: pointer; text-decoration: none; user-select: none;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
  }
.btn:hover { background: #fff6dc; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn-gold { background: var(--gold); }
.btn-gold:hover { background: #ffd255; }
.btn-sm { min-height: 38px; padding: 7px 12px; font-size: 12.5px; border-radius: 11px; box-shadow: 0 3px 0 var(--ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: var(--pop); }
.btn-text {
    background: none; border: 0; padding: 6px 4px; cursor: pointer;
    font: 800 14px/1.2 var(--body); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px;
  }
.btn-text:hover { color: var(--ink); }
.btn svg, .pill-btn svg { width: 18px; height: 18px; flex: none; }
/* ---------- top bar ---------- */
.topbar {
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
    display: flex; align-items: center; gap: 10px;
    height: var(--top); padding-inline: 16px;
    background: var(--paper); border-bottom: 2.5px solid var(--ink);
  }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.vplate { width: 32px; height: 32px; flex: none; display: block; }
.wordmark { font: 900 17px/1 var(--display); letter-spacing: -0.015em; white-space: nowrap; }
.topnav { display: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.me-chip {
    display: inline-flex; align-items: center; gap: 7px; max-width: 150px;
    padding: 4px 11px 4px 4px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--paper);
    font: 900 13px/1 var(--display); cursor: pointer; box-shadow: 0 3px 0 var(--ink);
  }
.me-chip .av { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; font-size: 13px; flex: none; text-transform: uppercase; }
.me-chip .h { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) {
  .me-chip { padding: 3px; box-shadow: 0 2px 0 var(--ink); }
  .me-chip .h { display: none; }
  .me-chip .av { width: 30px; height: 30px; font-size: 14px; }
}
@media (max-width: 380px) {
  .wordmark { font-size: 15px; }
}
@media (min-width: 900px) {
  .topbar { padding-inline: max(24px, calc((100% - 1180px) / 2)); gap: 14px; }
  .wordmark { font-size: 20px; }
  .topnav { display: flex; gap: 2px; margin-left: 18px; }
  .topnav a {
      padding: 8px 12px; border-radius: 10px; text-decoration: none;
      font: 700 14px/1 var(--display); color: var(--ink-2);
    }
  .topnav a:hover { color: var(--ink); background: var(--sky-3); }
  .topnav a[aria-current="true"] { color: var(--ink); background: var(--gold); }
}
/* ---------- hero: the live world ---------- */
.hero {
    position: relative; overflow: hidden; isolation: isolate;
    height: clamp(560px, calc(100svh - var(--top) - var(--dock)), 760px);
    background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 50%, var(--sky-3) 100%);
  }
@media (min-width: 900px) {
  .hero { height: clamp(560px, calc(100svh - var(--top)), 780px); }
}
#globe { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; opacity: 0; transition: opacity 0.6s ease; }
#globe.dragging { cursor: grabbing; }
#globe:focus-visible { outline-offset: -6px; }
.hero.ready #globe { opacity: 1; }
.globe-ph {
    position: absolute; left: 50%; top: 49%; width: min(100vw, 72vh); aspect-ratio: 1; max-width: 100%;
    transform: translate(-50%, -50%); border-radius: 50%;
    background:
      radial-gradient(42% 36% at 46% 44%, var(--grass) 0 60%, transparent 62%),
      radial-gradient(circle at 40% 35%, #99d4ef 0%, #7cc2e8 55%, #66b3e0 100%);
    transition: opacity 0.6s ease;
  }
.hero.ready .globe-ph { opacity: 0; }
@media (min-width: 900px) {
  .globe-ph { left: 70%; top: 50%; width: 80vh; max-width: 640px; }
}
.labels { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.wlabel {
    position: absolute; left: 0; top: 0; margin-top: -6px; padding: 4px 8px 3px;
    border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink);
    font: 900 11px/1 var(--display); white-space: nowrap; box-shadow: 0 2px 0 rgba(23, 35, 43, 0.25); will-change: transform;
  }
.wlabel.fallen { background: #e3e6e8; color: var(--ink-2); border-color: var(--ink-2); }
.wlabel.fallen::before { content: "RIP "; font-size: 9px; letter-spacing: 0.06em; }
.wlabel.sel { background: var(--gold); z-index: 2; font-size: 12.5px; }
.zoom-ctl { position: absolute; right: 12px; top: 50%; z-index: 3; transform: translateY(-50%); display: grid; gap: 8px; }
.zoom-btn {
    width: 44px; height: 44px; display: grid; place-items: center; padding: 0; cursor: pointer;
    border: 2.5px solid var(--ink); border-radius: 13px; background: rgba(255, 253, 246, 0.96); color: var(--ink); box-shadow: 0 3px 0 var(--ink);
  }
.zoom-btn svg { width: 20px; height: 20px; }
.zoom-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.zoom-btn:disabled { opacity: 0.5; cursor: progress; }
.back-btn { background: var(--gold); }
.hud-top, .hud-main, .hud-eqs { transition: opacity 0.25s ease, transform 0.25s ease; }
.hud-main { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.hero.zoomed .hud-main { opacity: 0; visibility: hidden; pointer-events: none; }
.hero.zoomed .hud-eqs { display: none; }
.lbl-short { display: none; }
@media (max-width: 520px) {
  .hero.zoomed .lbl-long { display: none; }
  .hero.zoomed .lbl-short { display: inline; }
  .hero.zoomed .pill-btn { font-size: 12px; padding-inline: 10px 12px; }
}
.hero.zoomed .hud-main { position: absolute; }
.hero.zoomed .hud-day { font-size: 30px; }
.hero.zoomed .hud-count { font-size: 13px; }
.hero.zoomed .hud-top { gap: 4px; }
.wcard {
    position: absolute; left: 12px; right: 64px; bottom: 76px; z-index: 4; display: grid; gap: 6px;
    padding: 14px 14px 14px 16px; border: 2.5px solid var(--ink); border-radius: 18px; background: var(--paper); box-shadow: 0 5px 0 var(--ink);
  }
.wc-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 10px; }
.wc-handle { font: 900 19px/1.15 var(--display); padding-right: 40px; overflow-wrap: anywhere; }
.wc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wc-act { font: 800 14.5px/1.3 var(--body); }
.wc-motto { font: 700 14px/1.3 var(--display); }
.wc-motto:empty { display: none; }
.wc-born { font: 700 13px/1.3 var(--body); color: var(--ink-2); }
.wc-row { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.status.alive::before { background: var(--grass); }
.status.fallen { background: #e3e6e8; }
.status.fallen::before { background: var(--ink-2); }
.hud {
    position: absolute; inset: 0; z-index: 2;
    display: flex; flex-direction: column; justify-content: space-between; align-items: center;
    text-align: center; padding: 18px 16px 20px; pointer-events: none;
  }
.hud a, .hud button { pointer-events: auto; }
.hud-top { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hud-day { font-size: clamp(56px, 16vw, 70px); line-height: 0.95; }
.hud-eqs { display: flex; gap: 20px; justify-content: center; }
.eq { display: inline-flex; align-items: center; gap: 3px; }
.eq .ico { width: 30px; height: 30px; display: block; }
.eq .eqs { width: 20px; height: 28px; display: block; }
.hud-count { font-size: 17px; letter-spacing: 0.02em; }
.hud-bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 460px; }
.hud-tools { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pill-btn {
    display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 14px 7px 11px;
    font: 900 12.5px/1 var(--display); text-transform: uppercase; letter-spacing: 0.03em;
    background: rgba(255, 253, 246, 0.94); color: var(--ink);
    border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); cursor: pointer;
  }
.pill-btn:disabled { opacity: 0.6; cursor: progress; }
.drag-hint { font: 800 12px/1 var(--body); color: var(--ink); background: rgba(255, 253, 246, 0.7); padding: 6px 10px; border-radius: 999px; }
.hud-cap { font-size: clamp(31px, 9.2vw, 42px); }
.hud-hook { font-size: 19px; }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 4px; }
.hero-actions .btn { font-size: 13px; padding-inline: 8px; }
.globe-msg {
    position: absolute; left: 16px; right: 16px; top: 46%; z-index: 1; text-align: center;
    font: 800 14px/1.4 var(--body); color: var(--ink);
  }
@media (min-width: 900px) {
  .hud { align-items: flex-start; text-align: left; justify-content: center; gap: 36px; padding-inline: max(32px, calc((100% - 1180px) / 2)); }
  .hud-top, .hud-bottom { align-items: flex-start; }
  .hud-eqs { justify-content: flex-start; gap: 26px; }
  .hud-day { font-size: 116px; }
  .eq .ico { width: 46px; height: 46px; }
  .eq .eqs { width: 28px; height: 40px; }
  .hud-count { font-size: 26px; }
  .hud-cap { font-size: 54px; max-width: 12ch; }
  .hud-hook { font-size: 26px; }
  .hud-tools { order: 9; justify-content: flex-start; margin-top: 4px; }
  .hud-main { align-items: flex-start; }
  .zoom-ctl { right: 24px; }
  .wcard { left: auto; right: 84px; bottom: 28px; width: 340px; }
  .hero.zoomed .hud { justify-content: space-between; padding-block: 22px 26px; }
  .hero-actions { width: auto; grid-template-columns: auto auto; }
  .hero-actions .btn { font-size: 15px; padding-inline: 20px; }
}
/* ---------- sections ---------- */
.sec { position: relative; padding-block: 40px 44px; scroll-margin-top: calc(var(--top) + 8px); }
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 900px) {
  .wrap { padding-inline: 32px; }
  .sec { padding-block: 64px; }
}
.sec-title { font-size: clamp(30px, 8.6vw, 46px); }
.lede { margin-top: 10px; max-width: 58ch; font-size: 17px; color: var(--ink-2); }
.card {
    background: var(--paper); border: 2.5px solid var(--ink); border-radius: 20px;
    box-shadow: 0 5px 0 var(--ink); padding: 18px;
  }
@media (min-width: 900px) {
  .card { padding: 26px; }
}
.eyebrow { font: 900 12px/1.2 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.mini { font: 900 14px/1.2 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.ridge {
    position: absolute; left: 0; right: 0; top: -22px; height: 24px; pointer-events: none;
    clip-path: polygon(0 100%, 0 55%, 7% 80%, 15% 20%, 24% 70%, 33% 30%, 41% 85%, 50% 15%, 59% 65%, 68% 25%, 77% 80%, 86% 10%, 93% 60%, 100% 35%, 100% 100%);
  }
/* find */
.find-card { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.card > *, .editor > *, .controls > *, .result > *, .me-head > *, .board > *, .eps > *, .race-body > * { min-width: 0; }
.lbl { display: block; font: 900 13px/1.2 var(--display); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px; }
.field-row { display: flex; gap: 10px; }
.at-field {
    flex: 1; min-width: 0; display: flex; align-items: center;
    border: 2.5px solid var(--ink); border-radius: 14px; background: #fff; padding-left: 14px;
  }
.at-field:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }
.at-field > span { font: 900 18px/1 var(--display); color: var(--ink-2); }
.at-field input {
    flex: 1; min-width: 0; width: 100%; height: 46px; border: 0; background: transparent; padding: 0 12px 0 4px;
    font: 700 17px/1 var(--body); outline: none;
  }
.field-err { margin-top: 8px; font-weight: 800; color: var(--warn); font-size: 14.5px; }
.census { display: flex; align-items: center; gap: 8px; font: 700 13.5px/1.3 var(--body); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.census .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--grass); box-shadow: 0 0 0 2px var(--ink); flex: none; }
.result { border-top: 2px dashed var(--line); padding-top: 16px; display: grid; gap: 14px; }
.result-head { display: flex; gap: 14px; align-items: center; }
.ghost { width: 64px; height: 76px; flex: none; }
.result-title { font: 900 21px/1.15 var(--display); overflow-wrap: anywhere; }
.result-title .h { color: var(--ink); background: linear-gradient(transparent 58%, var(--gold) 58%); }
.result-note { margin-top: 4px; color: var(--ink-2); font-size: 15px; }
.steps-born { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: s; }
.steps-born li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; font-size: 15.5px; }
.steps-born li::before {
    counter-increment: s; content: counter(s);
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    font: 900 14px/1 var(--display); background: var(--gold); border: 2px solid var(--ink);
  }
.steps-born b { font-weight: 800; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.found-dot { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--c, var(--gold)); box-shadow: 0 3px 0 var(--ink); }
.ff-motto { margin-top: 6px; font: 700 15px/1.3 var(--display); }
.ff-motto:empty { display: none; }
/* me (grass band) */
.band-grass { background: linear-gradient(180deg, var(--grass-hi) 0%, var(--grass) 60%, var(--grass-lo) 100%); margin-top: 22px; }
.band-grass .ridge { background: var(--grass-hi); }
.me-card { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.me-head { display: grid; gap: 10px; }
.me-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.me-handle { font: 900 22px/1.1 var(--display); overflow-wrap: anywhere; }
.lock-note { display: inline-flex; align-items: center; gap: 5px; font: 700 12.5px/1 var(--body); color: var(--ink-2); }
.lock-note svg { width: 13px; height: 13px; }
.status {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 4px;
    font: 900 11.5px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase;
    border-radius: 999px; border: 2px solid var(--ink); background: var(--sky-3);
  }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; }
.me-msg { font-size: 16px; }
.me-msg b { font-weight: 800; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 860px) {
  .editor { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
}
.preview {
    position: relative; aspect-ratio: 4 / 5; max-width: 100%; border: 2.5px solid var(--ink); border-radius: 18px; overflow: hidden;
    background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 55%, var(--sky-3) 100%);
  }
#char3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
.tag-stack { position: absolute; left: 14px; right: 14px; top: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.name-tag {
    max-width: 100%;
    padding: 6px 14px 6px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--paper);
    font: 900 15px/1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 3px 0 rgba(23, 35, 43, 0.25);
  }
.motto-bubble {
    max-width: 100%;
    padding: 6px 12px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--paper);
    font: 700 13.5px/1.25 var(--display); text-align: center; overflow-wrap: anywhere; box-shadow: 0 3px 0 rgba(23, 35, 43, 0.25);
  }
.preview-hint { position: absolute; right: 10px; bottom: 9px; font: 800 11.5px/1 var(--body); color: var(--ink-2); background: rgba(255, 253, 246, 0.75); padding: 5px 8px; border-radius: 999px; }
.preview-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; font-weight: 800; }
.controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.controls fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.controls fieldset:disabled { opacity: 0.55; }
.controls legend { padding: 0; margin-bottom: 8px; font: 900 13px/1.2 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { position: relative; display: block; cursor: pointer; }
.sw input, .opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.sw-dot { display: block; width: 33px; height: 33px; border-radius: 50%; background: var(--c); border: 2.5px solid var(--ink); transition: transform 0.1s ease; }
.sw input:checked + .sw-dot { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5.5px var(--ink); transform: scale(0.94); }
.sw input:focus-visible + .sw-dot { outline: 3px solid var(--ink); outline-offset: 6px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; display: block; cursor: pointer; }
.opt-face {
    display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 13px;
    border: 2.5px solid var(--ink); border-radius: 12px; background: var(--paper);
    font: 700 14px/1.1 var(--display);
  }
.opt-face svg { width: 20px; height: 20px; flex: none; }
.opt input:checked + .opt-face { background: var(--gold); box-shadow: 0 3px 0 var(--ink); }
.opt input:focus-visible + .opt-face { outline: 3px solid var(--ink); outline-offset: 3px; }
.opt input[data-locked] + .opt-face { border-style: dashed; color: var(--ink-2); background: var(--sky-3); cursor: not-allowed; }
.motto-row { display: grid; gap: 6px; }
.motto-row input {
    width: 100%; height: 48px; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff;
    padding: 0 14px; font: 700 16px/1 var(--body);
  }
.motto-row input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.motto-meta { display: flex; justify-content: space-between; gap: 10px; font: 700 12.5px/1.3 var(--body); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.save-state { font: 800 13.5px/1.2 var(--body); color: var(--ink-2); }
.save-state.dirty { color: var(--warn); }
.locked-note { font: 700 14px/1.4 var(--body); color: var(--ink-2); }
/* race + fallen */
.board { display: grid; gap: 22px; margin-top: 22px; }
@media (min-width: 860px) {
  .board { grid-template-columns: 1.35fr 1fr; }
}
.race-body { display: grid; gap: 16px; margin-top: 14px; }
@media (min-width: 520px) {
  .race-body { grid-template-columns: 200px 1fr; align-items: center; }
}
.mtn { width: 100%; max-width: 260px; height: auto; display: block; margin-inline: auto; }
.zones { list-style: none; margin: 0; padding: 0; display: grid; }
.zones li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 2px dashed var(--line); font-weight: 700; }
.zones li:last-child { border-bottom: 0; }
.zones .n { font: 900 13px/1 var(--display); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.zones .throne-n { background: var(--sky-3); border: 2px solid var(--ink); border-radius: 999px; padding: 5px 9px 4px; color: var(--ink); letter-spacing: 0.06em; text-transform: uppercase; font-size: 11px; }
.empty-line { font: 900 19px/1.25 var(--display); margin-top: 16px; }
.sub { color: var(--ink-2); font-size: 15px; margin-top: 6px; }
.card h2.cap { font-size: clamp(26px, 7.4vw, 34px); }
.tomb { width: 150px; height: auto; display: block; margin: 12px auto 0; }
.climbers, .fallen-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; text-align: left; }
.person-btn {
    width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; text-align: left;
    border: 2px solid var(--ink); border-radius: 12px; background: #fff; font: 800 14.5px/1.2 var(--body); color: var(--ink);
  }
.person-btn:hover { background: #fff6dc; }
.person-btn .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); background: var(--c, var(--gold)); flex: none; }
.person-btn .h { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-btn .n { font: 900 12px/1 var(--display); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.more-line { font: 700 13px/1.3 var(--body); color: var(--ink-2); }
.count-pill { display: inline-block; margin-top: 12px; font: 900 12px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 10px 5px; border: 2px solid var(--ink); border-radius: 999px; font-variant-numeric: tabular-nums; }
/* episodes */
.band-sky { background: linear-gradient(180deg, var(--sky-2) 0%, var(--sky-3) 100%); }
.band-sky .ridge { background: var(--sky-2); }
.eps { display: grid; gap: 22px; margin-top: 22px; }
.ep { display: grid; gap: 16px; }
@media (min-width: 760px) {
  .ep { grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start; }
}
.ep video { display: block; width: 100%; max-width: 290px; aspect-ratio: 9 / 16; margin-inline: auto; border: 2.5px solid var(--ink); border-radius: 16px; background: var(--plate); }
.ep-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag { display: inline-block; padding: 5px 9px 4px; border: 2px solid var(--ink); border-radius: 999px; font: 900 11.5px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; background: var(--gold); }
.tag.plain { background: var(--paper); }
.ep h3 { font: 900 26px/1.1 var(--display); margin-top: 10px; }
.ep p { margin-top: 10px; max-width: 56ch; }
.ep-next { border-style: dashed; box-shadow: none; background: rgba(255, 253, 246, 0.6); display: flex; gap: 14px; align-items: center; }
.ep-next .lockbox { width: 48px; height: 48px; border-radius: 14px; border: 2.5px dashed var(--ink); display: grid; place-items: center; flex: none; }
.ep-next .lockbox svg { width: 22px; height: 22px; }
.ep-next h3 { font: 900 18px/1.2 var(--display); }
/* footer */
.foot { background: var(--plate); color: var(--paper); padding-block: 34px 40px; }
.foot .wrap { display: grid; gap: 12px; }
.foot-brand { display: flex; align-items: center; gap: 10px; }
.foot-brand b { font: 900 20px/1 var(--display); }
.foot p { color: #cfdbe2; font-size: 14.5px; max-width: 62ch; }
.foot .url { font: 900 15px/1 var(--display); color: var(--lime); }
/* dock (phones) */
.dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--paper); border-top: 2.5px solid var(--ink);
  }
.dock a {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 2px; min-height: 50px;
    text-decoration: none; font: 700 11px/1 var(--display); color: var(--ink-2); border-radius: 12px;
  }
.dock a .di { width: 44px; height: 28px; border-radius: 999px; display: grid; place-items: center; }
.dock a svg { width: 22px; height: 22px; }
.dock a[aria-current="true"] { color: var(--ink); }
.dock a[aria-current="true"] .di { background: var(--gold); box-shadow: inset 0 0 0 2px var(--ink); }
@media (min-width: 900px) {
  .dock { display: none; }
}
/* toast */
.toast {
    position: fixed; left: 50%; bottom: calc(var(--dock) + 14px + env(safe-area-inset-bottom, 0px)); z-index: 60;
    transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
    padding: 11px 16px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--paper); box-shadow: var(--pop);
    font: 800 14.5px/1.3 var(--body); text-align: center;
  }
@media (min-width: 900px) {
  .toast { bottom: 24px; }
}
/* sign-in dialog */
dialog.signin {
    width: min(440px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0;
    border: 2.5px solid var(--ink); border-radius: 22px; background: var(--paper); color: var(--ink);
    box-shadow: 0 6px 0 var(--ink); overflow: auto;
  }
dialog.signin::backdrop { background: rgba(23, 35, 43, 0.55); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px 20px; border-bottom: 2px dashed var(--line); }
.dlg-head h2 { font: 900 18px/1.2 var(--display); }
.icon-btn {
    margin-left: auto; width: 40px; height: 40px; flex: none; display: grid; place-items: center;
    border: 2.5px solid var(--ink); border-radius: 12px; background: var(--paper); cursor: pointer;
  }
.icon-btn svg { width: 16px; height: 16px; }
.dlg-body { padding: 16px 20px 22px; display: grid; gap: 14px; }
.dlg-body h3 { font: 900 21px/1.2 var(--display); overflow-wrap: anywhere; }
.dlg-body .help { color: var(--ink-2); font-size: 15px; }
.dlg-actions { display: grid; gap: 8px; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3.5px solid var(--line); border-top-color: var(--ink); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.done-badge { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--grass); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.done-badge svg { width: 30px; height: 30px; }
/* ---------- versão pública ---------- */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.soon-pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 11px 14px;
  font: 900 13px/1.12 var(--display); text-transform: uppercase; letter-spacing: 0.02em; text-align: center;
  color: var(--ink-2); background: rgba(255, 253, 246, 0.72); border: 2.5px dashed var(--ink-2); border-radius: 14px; cursor: default;
}
@media (min-width: 900px) { .soon-pill { font-size: 14px; padding-inline: 18px; } }
.fallen-card { text-align: center; }
.ep-next .sub { margin-top: 2px; }
.ep-media { display: grid; gap: 10px; justify-items: center; }
.sound-btn { min-height: 44px; }
.sound-btn[aria-pressed="true"] { background: var(--gold); }
.foot a { color: var(--paper); text-underline-offset: 3px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.page { max-width: 760px; margin-inline: auto; padding: 40px 16px 64px; }
.page .card { margin-top: 20px; }
.page p + p { margin-top: 10px; }
.back-link { display: inline-flex; margin-top: 22px; }
body.plain { padding-bottom: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
body.plain main { flex: 1 0 auto; width: 100%; }
body.plain .foot { margin-top: 0; }

/* ---------- rodada 5: entrar e editar de verdade ---------- */
.code-input {
  width: 100%; height: 56px; border: 2.5px solid var(--ink); border-radius: 14px; background: #fff; padding: 0 16px;
  font: 900 28px/1 var(--display); letter-spacing: 0.3em; font-variant-numeric: tabular-nums;
}
.code-input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.help.small { font-size: 13px; }
.help a { color: var(--ink); }
.notice {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 2.5px solid var(--ink); border-radius: 14px;
  background: var(--gold); font: 900 14.5px/1.3 var(--display); box-shadow: 0 3px 0 var(--ink);
}
.notice svg { width: 20px; height: 20px; flex: none; }
.me-action { font: 700 15px/1.35 var(--body); color: var(--ink-2); }
.me-action q { color: var(--ink); font-weight: 800; }
.wc-action { font: 700 13.5px/1.35 var(--body); color: var(--ink-2); }
.wc-action:empty { display: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.lbl-tight { margin: 0; }
.page .card > * + * { margin-top: 10px; }
.page .mini { margin-top: 18px; }
.page .mini:first-child { margin-top: 0; }
.plain-list { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 4px; }
