/* RuneTap production styles (UI v2). The spec and the class reference are docs/UI.md; design/v2/v2.css is the
   reference these rules come from (its mockup-only block is left out), followed at the end by what the game needs
   beyond the mockups. Graphical first: portraits, rings, bars and big gold figures carry the game; a label
   is one or two words at most and every explanation lives in the details popover. */

@font-face { font-family: "Vollkorn"; src: url("fonts/Vollkorn-VF.4ebef434f76f.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Signika"; src: url("fonts/Signika-VF.fae0180ef82a.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }

:root {
  color-scheme: dark;
  --iron-950: #16120e; --iron-900: #201a15; --iron-850: #28211a; --iron-800: #31291f; --iron-700: #43382b;
  --iron-600: #5a4b39; --iron-400: #8e7c62; --iron-300: #b4a184;
  --parch-50: #f7eed6; --parch-100: #efe2bf; --parch-200: #e3d1a3; --parch-300: #cfb67e; --parch-400: #ad9259;
  --ink: #2c1f12; --ink-soft: #5e4a32; --ink-faint: #85704f;
  --gold-100: #fff3c8; --gold-200: #ffe9a3; --gold-300: #ffd35c; --gold-400: #eeb02f; --gold-600: #b07818; --gold-800: #5f3d08; --gold-900: #3a2402;
  --jade-300: #a9e0c0; --jade-500: #5fae86; --jade-800: #1f4a37;
  --blood-400: #cf3a26; --blood-600: #9c1d12; --blood-900: #3f0905;
  --ember-500: #f07a12;
  --water-300: #7fd0e0; --water-600: #3c8fa3;
  --melee: #c4532f; --ranged: #5b9a3c; --magic: #4a7cc4;
  --ok: #3f7d34; --warn: #a8571a; --danger: #a8231b;
  --focus: #ffe28a; --focus-on-parch: #17468f;

  --font-num: "Vollkorn", "Palatino Linotype", Georgia, serif;
  --font-ui: "Signika", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;

  --touch: 44px;
  --gutter: 12px;
  --r-1: 3px; --r-2: 6px; --r-3: 10px;
  --bevel: inset 0 1px 0 rgba(255, 233, 190, 0.13), inset 0 -2px 0 rgba(0, 0, 0, 0.35);
  --ledge: 0 3px 0 #120d08;

  /* sizes that change per layout */
  --portrait: 60px;    /* list portraits */
  --dial: 52px;        /* special dials */
  --gold-fs: 31px;     /* the gold counter */
  --side-w: 100%;      /* the sheet column when it sits beside the fight */
  --fight-h: max(42dvh, min(340px, 50dvh)); /* the least the fight gets (a short phone keeps room under the plate) */

  /* safe areas (the design mockups override these four to fake a notch; the game reads env()) */
  --sa-t: env(safe-area-inset-top, 0px);
  --sa-r: env(safe-area-inset-right, 0px);
  --sa-b: env(safe-area-inset-bottom, 0px);
  --sa-l: env(safe-area-inset-left, 0px);

  /* Round 16: the UI size (Settings): the HUD, the sheet and the panels are zoomed by it; the fight view is not */
  --ui: 1;
  --sa-t0: var(--sa-t); --sa-r0: var(--sa-r); --sa-b0: var(--sa-b); --sa-l0: var(--sa-l);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--iron-950); color: var(--parch-100); font-family: var(--font-ui); font-size: 16px; line-height: 1.35; overflow: hidden; -webkit-tap-highlight-color: transparent; }
/* A game, not a page: no double-tap zoom, no long-press text selection or callout menu, no pull-to-refresh or
   rubber-band scroll. Text the player types or copies (save import and export) stays selectable. */
html, body { touch-action: manipulation; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable], .selectable { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img, svg, canvas { -webkit-user-drag: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; max-width: 100%; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.num { font-family: var(--font-num); font-variant-numeric: lining-nums tabular-nums; font-weight: 800; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.px { image-rendering: pixelated; }
svg.i { width: 18px; height: 18px; flex: none; }

/* The gold figure: chunky Vollkorn, a dark stroke painted under the fill and a hard ledge. The one loud thing. */
.goldtext {
  font-family: var(--font-num); font-weight: 900; font-variant-numeric: lining-nums tabular-nums;
  color: var(--gold-300);
  -webkit-text-stroke: 4px var(--gold-900); paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--gold-900);
  letter-spacing: 0.01em;
}
.goldtext--ess { color: var(--jade-300); -webkit-text-stroke-color: #0d2a1d; text-shadow: 0 2px 0 #0d2a1d; }

/* ================================================================== frame */
.game {
  position: relative;
  height: 100vh; height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(var(--fight-h), 1fr) auto minmax(0, max-content);
  grid-template-areas: "fight" "specials" "sheet";
  background: var(--iron-950);
}
.fight { grid-area: fight; }
.specials { grid-area: specials; }
.sheet { grid-area: sheet; }
.hinge { display: none; }

/* ================================================================== fight view */
.fight { position: relative; overflow: hidden; min-height: 0; background: #2b2118 center / cover no-repeat; isolation: isolate; }
.fight__shade { position: absolute; inset: 0 0 auto; height: 112px; background: linear-gradient(rgba(22, 18, 14, .92), rgba(22, 18, 14, .55) 60%, rgba(22, 18, 14, 0)); pointer-events: none; }
.fight__shade--b { inset: auto 0 0; top: auto; height: 96px; background: linear-gradient(rgba(22, 18, 14, 0), rgba(22, 18, 14, .7)); }

/* HUD: stage shield, region pips, the wallet and the two live rates */
.hud {
  position: absolute; inset: 0 0 auto;
  padding: calc(var(--sa-t) + 8px) calc(var(--sa-r) + var(--gutter)) 0 calc(var(--sa-l) + var(--gutter));
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; align-items: start;
}
.shield {
  position: relative; width: 52px; height: 58px; display: grid; place-items: center; padding-bottom: 6px;
  color: var(--parch-50);
}
.shield svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.shield .num { position: relative; font-size: 24px; font-weight: 900; line-height: 1; text-shadow: 0 2px 0 #000; }
.shield--sm { width: 36px; height: 40px; padding-bottom: 4px; }
.shield--sm .num { font-size: 16px; }
.shield--lg { width: 76px; height: 86px; }
.shield--lg .num { font-size: 34px; }
button.shield { min-width: var(--touch); }

.hud > .shield { grid-row: 1 / span 2; }
.where { min-width: 0; padding-top: 4px; }
/* the second HUD row: essence at the left under the pips, the two live rates at the right under the gold. It spans the
   region and wallet columns, so the wide rates never take width from the region's name above them */
.hud__row { grid-column: 2 / span 2; display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; min-width: 0; }
.hud__row .rates { flex-wrap: nowrap; min-width: 0; }
.where__name { font-size: 13px; color: var(--iron-300); white-space: nowrap; overflow: hidden; }
.pips { display: flex; align-items: center; gap: 3px; margin-top: 5px; }
.pip { width: 11px; height: 14px; border: 2px solid var(--parch-300); border-radius: 2px; flex: none; }
.pip--done { background: var(--parch-300); }
.pip--now { border-color: var(--gold-300); background: repeating-linear-gradient(135deg, var(--gold-300) 0 3px, transparent 3px 6px); }
.pip--boss { width: 18px; height: 16px; border: 0; color: var(--parch-300); }
.pip--boss svg { width: 100%; height: 100%; }

.wallet { display: grid; justify-items: end; gap: 4px; }
.counter { position: relative; display: flex; align-items: center; gap: 4px; }
/* the coin stack cropped to its coins (ui.js sets the sprite's coin box, --bx --by --bw --bh, and the height against the
   figure, --ph): one source pixel is --u, so the stack sits right against the number at a size that reads */
.counter__pile { --u: calc(var(--gold-fs) * var(--ph, 1) / var(--bh, 62)); position: relative; flex: none; overflow: hidden;
  width: calc(var(--u) * var(--bw, 62)); height: calc(var(--u) * var(--bh, 62)); margin-top: calc(var(--gold-fs) * -0.08); }
.counter__pile img { position: absolute; max-width: none; left: calc(var(--u) * var(--bx, 0) * -1); top: calc(var(--u) * var(--by, 0) * -1); width: calc(var(--u) * 72); height: calc(var(--u) * 64); }
.counter__value { font-size: var(--gold-fs); line-height: 1; }
/* gains: big gold figures that rise from the foe on every kill and fade before they reach the HUD */
.gains { position: absolute; left: 50%; top: max(38%, calc(var(--sa-t) + 172px)); width: 0; height: 0; pointer-events: none; z-index: 2; }
.rise { position: absolute; left: 0; top: 0; translate: -50% 0; white-space: nowrap; font-size: 20px; animation: rise 900ms cubic-bezier(.2, .7, .3, 1) both; animation-play-state: var(--play, running); }
.rise--big { font-size: 26px; }
@keyframes rise { 0% { transform: translateY(14px) scale(.8); opacity: 0; } 18% { transform: translateY(0) scale(1.08); opacity: 1; } 30% { transform: translateY(-4px) scale(1); } 100% { transform: translateY(-44px); opacity: 0; } }

.rates { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rate {
  position: relative; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px 0 5px;
  background: rgba(22, 18, 14, .78); border: 1px solid var(--iron-600); border-radius: 13px; overflow: hidden;
  font-size: 15px;
}
.rate img, .rate svg { width: 18px; height: 18px; }
.rate small { font-family: var(--font-ui); font-weight: 500; font-size: 11px; color: var(--iron-300); margin-left: 1px; }
.rate--gold .num { color: var(--gold-200); }
.rate--dps .num { color: #ffd0b8; }
.rate--ess .num { color: var(--jade-300); }
/* the one-second tick: a hairline that sweeps along the chip's bottom edge, then the number steps up */
.rate__tick { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; transform-origin: left; background: currentColor; opacity: .7; animation: tick 1s linear infinite; }
.rate--gold .rate__tick { color: var(--gold-300); }
.rate--dps .rate__tick { color: var(--blood-400); }
@keyframes tick { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* (battery: under a panel that hides the whole fight, the endless ones rest) */
.fight--covered .rate__tick, .fight--covered .next__ring, .fight--covered .coach, .fight--covered .coach * { animation-play-state: paused; }

/* foe plate */
.foe { position: absolute; left: 50%; top: calc(var(--sa-t) + 88px); width: min(78%, 420px); transform: translateX(-50%); text-align: center; }
.foe__name { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-num); font-weight: 800; font-size: 17px; color: var(--parch-50); text-shadow: 0 2px 0 #000, 0 0 2px #000; }
.weak { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px 0 3px; border-radius: 10px; font: 600 11px var(--font-ui); color: #fff; text-shadow: none; }
.weak svg { width: 14px; height: 14px; }
.weak--melee { background: var(--melee); } .weak--ranged { background: var(--ranged); } .weak--magic { background: var(--magic); }
.weak--boss { background: var(--gold-600); color: var(--gold-900); }
.hp { position: relative; display: grid; align-items: center; min-height: 19px; margin-top: 4px; background: var(--blood-900); border: 2px solid #0c0806; border-radius: 3px; overflow: hidden; }
.hp__fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%); background: linear-gradient(#5fd13a, #2f8f1c); }
.hp__text { position: relative; padding: 1px 0; font: 800 12px/1.15 var(--font-num); color: #fff; text-shadow: 0 1px 0 #000, 0 0 2px #000; }
.timer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; margin-top: 4px; }
.timer__bar { position: relative; height: 10px; background: var(--iron-900); border: 1px solid #0c0806; border-radius: 5px; overflow: hidden; }
.timer__bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%); background: var(--parch-300); }
.timer__secs { min-width: 34px; padding: 0 5px; border-radius: 4px; background: var(--iron-950); color: var(--parch-50); font-size: 14px; }
.timer--low .timer__secs { background: var(--blood-600); color: #fff; }
.timer--low i { background: repeating-linear-gradient(135deg, var(--blood-400) 0 5px, var(--blood-600) 5px 10px); }

/* buff chips under the foe plate (Round 1) */
.fcol { position: absolute; left: calc(var(--sa-l) + var(--gutter)); top: calc(var(--sa-t) + 118px); display: grid; justify-items: start; gap: 12px; }
.buffs { display: grid; gap: 12px; }
.buffs:empty { display: none; }
.buff { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--gold-300) calc(var(--p) * 360deg), var(--iron-700) 0); }
.buff::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--iron-900); }
.buff img { position: relative; width: 22px; height: 22px; }
.buff span { position: absolute; bottom: -7px; font: 800 10px var(--font-num); background: var(--iron-950); padding: 0 3px; border-radius: 3px; color: var(--parch-100); }


/* floor drops: the clue scroll (Round 1) */
.drop { position: absolute; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: conic-gradient(var(--parch-50) calc(var(--p) * 360deg), rgba(22, 18, 14, .6) 0); }
.drop::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--iron-800); border: 2px solid var(--parch-300); }
.drop svg { position: relative; width: 30px; height: 30px; }

/* bottom corners of the fight: the idle pile and the next-upgrade ring */
.next {
  position: absolute; right: calc(var(--sa-r) + var(--gutter)); bottom: 10px;
  display: grid; justify-items: center; gap: 2px; width: 76px;
}
.next__ring {
  position: relative; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--gold-300) calc(var(--p) * 360deg), rgba(22, 18, 14, .75) 0);
  border: 2px solid #0c0806;
}
.next__ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--iron-850); }
.next__ring img { position: relative; width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: top; }
.next__label { font: 600 11px var(--font-ui); color: var(--iron-300); text-shadow: 0 1px 0 #000; }
.next__cost { display: flex; align-items: center; gap: 3px; font-size: 14px; color: var(--gold-200); text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.next__cost img { width: 16px; height: 16px; }
/* ready: the ring becomes a raised gold shield with an up chevron, and breathes (off under reduced motion) */
.next--ready .next__ring { border-radius: 14px 14px 32px 32px; background: linear-gradient(var(--gold-300), var(--gold-400)); border-color: var(--gold-900); box-shadow: var(--ledge); animation: breathe 1.6s ease-in-out infinite; }
.next--ready .next__ring::before { inset: 4px; border-radius: 11px 11px 28px 28px; }
.up { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-300); border: 2px solid var(--gold-900); color: var(--gold-900); }
.up svg { width: 14px; height: 14px; }
@keyframes breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.pile { position: absolute; left: calc(var(--sa-l) + var(--gutter)); bottom: 8px; display: grid; justify-items: center; width: 104px; }
.pile img { width: calc(56px + var(--size, 1) * 20px); max-height: 72px; object-fit: contain; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .4)); }
.pile__amt { font-size: 20px; line-height: 1; margin-top: 2px; }
.pile__btn { margin-top: 4px; }

/* ================================================================== specials */
.specials { display: grid; gap: 6px; padding: 8px calc(var(--sa-r) + var(--gutter)) 8px calc(var(--sa-l) + var(--gutter)); background: var(--iron-900); border-top: 2px solid #0c0806; border-bottom: 2px solid #0c0806; }
.energy { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.energy svg { width: 14px; height: 16px; }
.energy__bar { height: 8px; border-radius: 4px; background: var(--iron-700); overflow: hidden; }
.energy__bar i { display: block; height: 100%; width: calc(var(--p) * 100%); background: linear-gradient(var(--water-300), var(--water-600)); }
.energy .num { font-size: 13px; color: var(--water-300); }
.dials { display: flex; justify-content: space-between; gap: 4px; }
.dial { position: relative; width: var(--dial); height: var(--dial); flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ring, var(--iron-400)) calc(var(--p) * 360deg), var(--iron-700) 0); }
.dial::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--iron-850); box-shadow: var(--bevel); }
.dial img { position: relative; width: 60%; height: 60%; object-fit: contain; }
.dial__t { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); font: 800 12px var(--font-num); padding: 0 4px; border-radius: 3px; background: var(--iron-950); color: var(--parch-100); white-space: nowrap; }
.dial[data-state="ready"] { --ring: var(--gold-300); }
.dial[data-state="ready"]::after { content: ""; position: absolute; top: -3px; left: 50%; width: 10px; height: 10px; transform: translateX(-50%) rotate(45deg); background: var(--gold-300); border: 2px solid var(--gold-900); }
.dial[data-state="active"] { --ring: var(--jade-500); }
.dial[data-state="active"] .dial__t { background: var(--jade-800); color: var(--jade-300); }
.dial[data-state="cooldown"] img { opacity: .4; }
.dial[data-state="cooldown"] .dial__secs { position: absolute; font: 900 16px var(--font-num); text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.dial[data-state="locked"] { background: var(--iron-800); }
.dial[data-state="locked"] img { opacity: .2; filter: grayscale(1); }
.dial[data-state="locked"] .lock { position: absolute; width: 20px; height: 20px; }
.dial[data-state="locked"] .dial__t { color: var(--iron-300); }

/* ================================================================== sheet and tabs */
.sheet { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--parch-100); color: var(--ink); }
.sheet__main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tabs { order: 2; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--iron-900); border-top: 2px solid #0c0806; padding: 0 var(--sa-r) var(--sa-b) var(--sa-l); }
.tab { position: relative; min-height: 56px; display: grid; justify-items: center; align-content: center; gap: 1px; padding: 4px 0; color: var(--iron-300); font-size: 12px; font-weight: 500; }
.tab__icon { position: relative; width: 30px; height: 30px; display: grid; place-items: center; }
.tab__icon img { width: 100%; height: 100%; object-fit: contain; }
.tab__icon img.bust { border-radius: 50%; object-fit: cover; object-position: top; background: var(--iron-700); }
.tab__icon svg { width: 24px; height: 24px; }
.tab[aria-selected="true"] { color: var(--gold-200); font-weight: 700; background: linear-gradient(var(--iron-700), var(--iron-800)); box-shadow: inset 0 3px 0 var(--gold-300); }
/* something here can be bought: a gold up-chevron tag (shape, not just color) */
.tab__up { position: absolute; top: -4px; left: -10px; width: 18px; height: 18px; border-radius: 4px; background: var(--gold-300); border: 2px solid var(--gold-900); color: var(--gold-900); display: grid; place-items: center; }
.tab__up svg { width: 10px; height: 10px; }
.tab__badge { position: absolute; top: -4px; right: -12px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--blood-600); border: 2px solid var(--iron-950); color: #fff; font: 800 11px/16px var(--font-num); }

.sheet__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px calc(var(--sa-r) + var(--gutter)) 8px calc(var(--sa-l) + var(--gutter)); background: var(--parch-200); border-bottom: 2px solid var(--parch-400); }
.summary { display: flex; align-items: center; gap: 8px; min-width: 0; }
.summary__icon { width: 30px; height: 30px; flex: none; }
.summary__val { font-size: 24px; line-height: 1; color: var(--ink); }
.summary__val small { font: 500 12px var(--font-ui); color: var(--ink-soft); margin-left: 2px; }
.amount { display: flex; border: 2px solid var(--ink); border-radius: var(--r-2); overflow: hidden; }
.amount button { min-width: 44px; height: 36px; padding: 0 6px; font: 700 14px var(--font-ui); color: var(--ink); }
.amount button[aria-pressed="true"] { background: var(--ink); color: var(--parch-50); text-decoration: underline; text-underline-offset: 3px; }
.seg { display: flex; gap: 4px; }
.seg button { height: 36px; min-width: 44px; padding: 0 10px; border-radius: 18px; border: 2px solid var(--ink-faint); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; color: var(--ink-soft); }
.seg button img, .seg button svg { width: 20px; height: 20px; }
.seg button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--parch-50); }

.sheet__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px calc(var(--sa-r) + var(--gutter)) 12px calc(var(--sa-l) + var(--gutter)); }
.list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); margin: 0; padding: 0; list-style: none; }

/* a unit row: hero, the Adventurer, a slayer reward. Portrait first, words last. */
.unit {
  display: grid; grid-template-columns: var(--portrait) minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px; background: var(--parch-50); border: 1px solid var(--parch-300); border-radius: var(--r-2);
  box-shadow: 0 2px 0 var(--parch-300);
}
/* a long list (fifty heroes) costs only the rows in view: the rest skip style, layout and paint until scrolled to
   (the bottom padding keeps the level chip, which hangs under the portrait, inside the row's own paint) */
.list > .unit { content-visibility: auto; contain-intrinsic-size: auto 92px; padding-bottom: 10px; }
.unit__name { font-weight: 700; font-size: 15px; line-height: 1.15; white-space: nowrap; overflow: hidden; }
.unit__mid { display: grid; gap: 5px; min-width: 0; }
.portrait { position: relative; width: var(--portrait); height: var(--portrait); border-radius: var(--r-2); background: radial-gradient(circle at 50% 35%, var(--iron-600), var(--iron-900) 75%); border: 2px solid var(--ink); }
.portrait > img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 4px; }
.portrait > img.item { object-fit: contain; padding: 18%; image-rendering: pixelated; }
.lv { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); min-width: 30px; height: 20px; padding: 0 5px; border-radius: 4px; background: var(--ink); color: var(--parch-50); font: 800 13px/20px var(--font-num); text-align: center; white-space: nowrap; }
.style { position: absolute; top: -6px; left: -6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--parch-50); color: #fff; }
.style svg { width: 12px; height: 12px; }
.style--melee { background: var(--melee); } .style--ranged { background: var(--ranged); } .style--magic { background: var(--magic); }
.unit--locked .portrait > img { filter: brightness(0) opacity(.55); }
.unit--locked { background: repeating-linear-gradient(135deg, var(--parch-100) 0 8px, var(--parch-200) 8px 16px); }
.unit--locked .lockb { position: absolute; inset: 0; display: grid; place-items: center; }
.unit--locked .lockb svg { width: 26px; height: 26px; }

/* share of party damage: a bar per hero, longest is the top hitter */
.share { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.share__bar { height: 10px; border-radius: 5px; background: var(--parch-200); box-shadow: inset 0 1px 0 rgba(0, 0, 0, .12); overflow: hidden; }
.share__bar i { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--c, var(--ink-soft)); border-radius: 5px; }
.share .num { font-size: 15px; color: var(--ink); }
.share .num small { font: 500 11px var(--font-ui); color: var(--ink-soft); }

/* milestone pips to the next perk, and the perk badge */
.ms { display: flex; align-items: center; gap: 3px; }
.ms i { width: 12px; height: 6px; border-radius: 2px; background: var(--parch-300); }
.ms i.on { background: var(--gold-600); }
.ms i.half { background: linear-gradient(90deg, var(--gold-600) 50%, var(--parch-300) 50%); }
.perk { display: inline-flex; align-items: center; gap: 3px; height: 20px; margin-left: 3px; padding: 0 6px; border-radius: 10px 3px 3px 10px; background: var(--ink); color: var(--gold-200); font: 800 12px var(--font-num); white-space: nowrap; }
.perk small { font: 600 10px var(--font-ui); color: var(--parch-300); }

/* the buy button: cost on top, what you gain under it. Affordable is a raised gold slab with an up chevron that
   breathes; not affordable is a sunken iron slot whose fill shows how close the gold is. */
.buy {
  position: relative; width: 104px; min-height: 56px; padding: 6px 8px; border-radius: var(--r-2);
  display: grid; justify-items: center; align-content: center; gap: 1px; overflow: hidden;
}
.buy__cost { display: flex; align-items: center; gap: 4px; font: 900 17px var(--font-num); line-height: 1.05; }
.buy__cost img, .buy__cost svg { width: 18px; height: 18px; }
.buy__gain { display: flex; align-items: center; gap: 2px; font: 800 12px var(--font-num); }
.buy__gain svg { width: 10px; height: 10px; }
.buy--yes { background: linear-gradient(var(--gold-300), var(--gold-400)); color: var(--gold-900); border: 2px solid var(--gold-900); box-shadow: var(--ledge); }
.buy--yes::after { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 16px 16px 0; border-color: transparent var(--gold-900) transparent transparent; }
.buy--yes .buy__chev { position: absolute; top: 1px; right: 1px; width: 8px; height: 8px; color: var(--gold-300); z-index: 1; }
.buy--pulse { animation: breathe 1.6s ease-in-out infinite; }
.buy--no { background: var(--iron-800); color: var(--parch-200); border: 2px dashed var(--iron-400); cursor: default; }
.buy--no::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%); background: repeating-linear-gradient(135deg, rgba(238, 176, 47, .32) 0 6px, rgba(238, 176, 47, .2) 6px 12px); }
.buy--no > * { position: relative; }
.buy__eta { font: 600 11px var(--font-ui); color: var(--iron-300); }
.buy--ess.buy--yes { background: linear-gradient(#8fd6ae, var(--jade-500)); color: #0d2a1d; border-color: #0d2a1d; }
.buy--ess.buy--yes::after { border-right-color: #0d2a1d; }
.buy--ess.buy--yes .buy__chev { color: #8fd6ae; }
.buy--hire.buy--yes { background: linear-gradient(#ffe9a3, var(--gold-300)); }
.buy--wide { width: 100%; }

/* tiles: relics, specials, pets, achievements, More, bestiary. Columns follow the width. */
.tiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(var(--tile, 104px), 1fr)); margin: 0; padding: 0; list-style: none; }
.tile {
  position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; padding: 10px 6px 8px;
  background: var(--parch-50); border: 1px solid var(--parch-300); border-radius: var(--r-2); box-shadow: 0 2px 0 var(--parch-300); text-align: center; color: var(--ink);
}
.tile__art { position: relative; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 50% 40%, var(--iron-600), var(--iron-900) 72%); border: 2px solid var(--ink); }
.tile__art > img { width: 70%; height: 70%; object-fit: contain; }
.tile__art > img.full { width: 92%; height: 92%; }
.tile__art--sq { border-radius: var(--r-2); }
.tile__name { font-weight: 700; font-size: 13px; line-height: 1.15; }
.tile__fx { display: inline-flex; align-items: center; gap: 3px; font: 800 14px var(--font-num); color: var(--ink); }
.tile__fx small { font: 600 11px var(--font-ui); color: var(--ink-soft); }
.tile .buy { width: 100%; min-height: 48px; }
.tile--off .tile__art > img { filter: grayscale(1) brightness(.45); }
.tile--off { background: repeating-linear-gradient(135deg, var(--parch-100) 0 8px, var(--parch-200) 8px 16px); }
.tile--on { padding-top: 26px; border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink), inset 0 0 0 2px var(--gold-300); }
.ribbon { position: absolute; top: -2px; left: 50%; transform: translateX(-50%); height: 22px; padding: 0 12px; display: inline-flex; align-items: center; gap: 4px; background: var(--ink); color: var(--gold-200); font: 700 11px var(--font-ui); clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 50%, 100% 100%, 0 100%, 7px 50%); white-space: nowrap; }
.tile--big .tile__art { width: 88px; height: 88px; }

/* ring: a progress ring around anything (achievements, task progress, dupes) */
.ring { position: relative; display: grid; place-items: center; width: var(--rs, 64px); height: var(--rs, 64px); border-radius: 50%;
  background: conic-gradient(var(--rc, var(--gold-600)) calc(var(--p) * 360deg), var(--parch-300) 0); }
.ring::before { content: ""; position: absolute; inset: var(--rw, 5px); border-radius: 50%; background: var(--ri, var(--iron-850)); }
.ring > * { position: relative; }
.ring--done { --rc: var(--ok); }
.ring--iron { background: conic-gradient(var(--rc, var(--gold-300)) calc(var(--p) * 360deg), var(--iron-700) 0); }

/* small icon pills */
.pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px 0 5px; border-radius: 12px; background: var(--parch-200); color: var(--ink); font: 800 13px var(--font-num); white-space: nowrap; }
.pill img, .pill svg { width: 16px; height: 16px; }
.pill--iron { background: var(--iron-800); color: var(--parch-100); border: 1px solid var(--iron-600); }
.pill--ess { background: #d6efdf; color: #0d2a1d; }
.pill--gold { background: var(--gold-200); color: var(--gold-900); }
.pill--done { background: var(--ok); color: #fff; }

/* hero card at the top of the Adventurer tab */
.herocard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: var(--r-3); background: linear-gradient(var(--iron-800), var(--iron-900)); color: var(--parch-100); border: 2px solid var(--ink); margin-bottom: 10px; }
.herocard .portrait { --portrait: 76px; border-color: var(--gold-600); }
.herocard .big { font-size: 26px; line-height: 1; }
.herocard .lbl { font-size: 12px; color: var(--iron-300); }
.herocard .ms i { background: var(--iron-600); } .herocard .ms i.on { background: var(--gold-300); }

h3.sec { display: flex; align-items: center; gap: 8px; margin: 12px 0 8px; font: 700 14px var(--font-ui); color: var(--ink-soft); }
h3.sec::after { content: ""; flex: 1; height: 2px; background: var(--parch-300); }

/* ================================================================== details popover (long-press, hover, or the portrait) */
.pop { position: absolute; z-index: 39; width: min(320px, calc(100% - 24px)); padding: 12px; border-radius: var(--r-3); background: var(--iron-900); color: var(--parch-100); border: 2px solid var(--gold-600); box-shadow: var(--ledge); }
.pop__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
.pop__head .portrait { --portrait: 56px; }
.pop__title { font: 800 18px var(--font-num); color: var(--parch-50); }
.pop__desc { margin: 8px 0; font-size: 13px; color: var(--iron-300); font-style: italic; max-width: 60ch; }
.pop__ladder { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin-top: 6px; }
.pop__ladder span { display: grid; justify-items: center; gap: 2px; padding: 4px 0; border-radius: 4px; background: var(--iron-800); font: 800 11px var(--font-num); color: var(--iron-300); }
.pop__ladder span b { font-size: 12px; color: var(--parch-100); }
.pop__ladder span.got { background: var(--gold-800); color: var(--gold-200); }
.pop__ladder span.got b { color: var(--gold-200); }
.pop::after { content: ""; position: absolute; top: -9px; left: 34px; width: 14px; height: 14px; background: var(--iron-900); border-left: 2px solid var(--gold-600); border-top: 2px solid var(--gold-600); transform: rotate(45deg); }

/* ================================================================== panels (every dialog) */
/* A panel takes the sheet's place: a bottom sheet over the lower screen on a portrait phone, the sheet column on a
   landscape phone, a tablet or a desktop, the second screen on a dual-screen device. The fight stays in view. */
.panelwrap { position: absolute; z-index: 40; inset: auto 0 0 0; height: 72%; display: flex; }
.scrim { position: absolute; inset: 0; z-index: 39; background: rgba(12, 9, 6, .55); }
/* in the game a panel never blocks the fight: a tap above it lands on the foe and the panel stays open (the close
   button, Escape or Back close it); the start screen's dialogs keep a scrim that blocks and closes */
#dialogs .scrim { pointer-events: none; background: rgba(12, 9, 6, .3); }
#dialogs .scrim--block { pointer-events: auto; background: rgba(12, 9, 6, .55); }
/* (Round 11: the Camp's sheet stops at the fight, so the camp shows above it; the layouts below set their own) */
.panelwrap:where(:has(> .panel--camp)) { height: calc(100% - var(--fight-h)); min-height: 50%; }
.panel { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--parch-100); color: var(--ink); border-top: 3px solid var(--gold-600); border-radius: var(--r-3) var(--r-3) 0 0; }
.panel__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px calc(var(--sa-r) + var(--gutter)) 10px calc(var(--sa-l) + var(--gutter)); background: linear-gradient(var(--iron-800), var(--iron-900)); color: var(--parch-50); border-radius: var(--r-3) var(--r-3) 0 0; }
.panel__head img, .panel__head > svg { width: 34px; height: 34px; object-fit: contain; }
.panel__title { font: 800 20px var(--font-num); }
.close { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-2); background: var(--iron-700); color: var(--parch-100); box-shadow: var(--bevel); }
.close svg { width: 18px; height: 18px; }
.panel__body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px calc(var(--sa-r) + var(--gutter)) 14px calc(var(--sa-l) + var(--gutter)); }
.panel__actions { display: flex; gap: 8px; padding: 10px calc(var(--sa-r) + var(--gutter)) calc(var(--sa-b) + 10px) calc(var(--sa-l) + var(--gutter)); border-top: 2px solid var(--parch-300); background: var(--parch-200); }
.panel__actions .btn { flex: 1; }

.btn { min-height: 48px; min-width: 44px; padding: 0 16px; border-radius: var(--r-2); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 16px; background: var(--iron-700); color: var(--parch-50); box-shadow: var(--bevel), var(--ledge); }
.btn img, .btn svg { width: 22px; height: 22px; }
.btn--primary { background: linear-gradient(var(--gold-300), var(--gold-400)); color: var(--gold-900); border: 2px solid var(--gold-900); }
.btn--quiet { background: transparent; color: var(--ink); border: 2px solid var(--ink-soft); box-shadow: none; }
.btn--danger { background: var(--danger); }
.btn--sm { min-height: 44px; font-size: 14px; padding: 0 12px; }

/* the stage of a panel: big art on a dark floor, the big number under it */
.stagebox { position: relative; display: grid; justify-items: center; gap: 2px; padding: 14px 10px 12px; border-radius: var(--r-3); background: radial-gradient(ellipse at 50% 30%, var(--iron-600), var(--iron-950) 75%); color: var(--parch-100); }
.stagebox > img.art { width: 150px; height: 120px; object-fit: contain; }
.stagebox .goldtext { font-size: 52px; line-height: 1; }
.stagebox .lbl { font-size: 13px; color: var(--iron-300); }

/* resets and keeps: icons, with a reset arrow or a check badge on each */
.fate { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 12px; }
.fate__lbl { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; width: 84px; }
.fate__lbl svg { width: 18px; height: 18px; }
.fate__icons { display: flex; flex-wrap: wrap; gap: 6px; }
.chipicon { position: relative; width: 46px; height: 46px; border-radius: var(--r-2); display: grid; place-items: center; background: var(--iron-800); border: 2px solid var(--ink); }
.chipicon > img { width: 30px; height: 30px; object-fit: contain; }
.chipicon > img.bust { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 4px; }
.chipicon .badge { position: absolute; right: -6px; bottom: -6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--parch-100); }
.chipicon .badge svg { width: 11px; height: 11px; }
.badge--keep { background: var(--ok); color: #fff; }
.badge--reset { background: var(--warn); color: #fff; }
.chipicon--reset > img { opacity: .7; }

/* stat tiles */
.stats { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.stat { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 8px; padding: 10px; background: var(--parch-50); border: 1px solid var(--parch-300); border-radius: var(--r-2); }
.stat > img, .stat > svg { width: 36px; height: 36px; object-fit: contain; }
.stat .num { display: block; font-size: 20px; line-height: 1.05; }
.stat span { font-size: 12px; color: var(--ink-soft); }

/* settings rows: icon, one word, the control */
.set { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 56px; border-bottom: 1px solid var(--parch-300); }
.set > svg { width: 28px; height: 28px; color: var(--ink-soft); }
.set__name { font-weight: 700; }
.switch { position: relative; width: 66px; height: 34px; border-radius: 17px; background: var(--iron-400); box-shadow: inset 0 2px 0 rgba(0, 0, 0, .25); font: 800 11px/34px var(--font-ui); color: #fff; text-align: right; padding-right: 9px; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: var(--parch-50); box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.switch[aria-checked="true"] { background: var(--ok); text-align: left; padding-left: 10px; }
.switch[aria-checked="true"]::after { left: 35px; }
.range { width: 140px; accent-color: var(--ink); }

/* clock ring for time away */
.clock { --rs: 112px; --rw: 9px; --ri: var(--iron-900); }
.clock .num { font-size: 22px; color: var(--parch-50); line-height: 1; text-align: center; }
.clock small { display: block; font: 600 11px var(--font-ui); color: var(--iron-300); }

/* save chooser cards */
.savecards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.savecard { display: grid; justify-items: center; gap: 6px; padding: 12px; border-radius: var(--r-3); background: var(--parch-50); border: 2px solid var(--parch-300); }
.savecard--ahead { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--gold-300); }


/* skill path (Round 4): branches as columns of round nodes joined by a line */
.path { display: grid; gap: 10px; grid-template-columns: repeat(var(--branches, 4), minmax(0, 1fr)); }
.branch { position: relative; display: grid; justify-items: center; gap: 18px; padding: 10px 0 14px; border-radius: var(--r-3); background: linear-gradient(var(--iron-800), var(--iron-900)); }
.branch::before { content: ""; position: absolute; top: 70px; bottom: 30px; left: 50%; width: 4px; transform: translateX(-50%); background: var(--iron-600); }
.branch__head { position: relative; display: grid; justify-items: center; gap: 2px; color: var(--parch-100); font-weight: 700; font-size: 13px; }
.branch__head svg { width: 30px; height: 30px; }
.node { position: relative; --rs: 58px; --rw: 4px; --ri: var(--iron-850); }
.node img, .node svg.n { width: 32px; height: 32px; object-fit: contain; }
.node .lv { bottom: -10px; font-size: 11px; height: 18px; line-height: 18px; min-width: 34px; }
.node--max .lv { background: var(--gold-300); color: var(--gold-900); }
.node--locked { filter: grayscale(1); opacity: .45; }
.gate { position: relative; display: flex; align-items: center; gap: 4px; padding: 0 8px; height: 22px; border-radius: 11px; background: var(--iron-950); color: var(--iron-300); font: 800 12px var(--font-num); }
.gate svg { width: 12px; height: 12px; }

/* armory (Round 5): the armor rack with four slots around it, the style's multiplier, the set and every piece.
   Each tier has a frame color and always shows its number beside it. */
:root { --gt1: #b0743c; --gt2: #8e9aa6; --gt3: #c9ced4; --gt4: #55565e; --gt5: #5468bd; --gt6: #3e8a4f; --gt7: #3ca7bd; --gt8: #c23a2c; --gt9: #dcd2b0; --gt10: #a9b84e; --gt11: #8fc0e6; --gt12: #f0c445; }
.gstyles { flex-wrap: wrap; margin-bottom: 10px; }
.gstyles button { height: var(--touch); padding: 0 14px 0 6px; border-radius: 22px; }
.gstyles .style { position: static; width: 28px; height: 28px; border-width: 2px; }
.gstyles .style svg { width: 15px; height: 15px; }
.doll { position: relative; display: grid; grid-template-columns: 1fr minmax(110px, 1.1fr) 1fr; grid-template-rows: repeat(2, auto); gap: 12px 8px; align-items: center; justify-items: center; padding: 14px 8px; border-radius: var(--r-3); background: radial-gradient(ellipse at 50% 45%, var(--iron-600), var(--iron-950) 75%); }
.doll__fig { grid-column: 2; grid-row: 1 / span 2; width: 100%; max-width: 190px; aspect-ratio: 1; object-fit: contain; }
.gslot--head { grid-column: 1; grid-row: 1; } .gslot--weapon { grid-column: 3; grid-row: 1; }
.gslot--body { grid-column: 1; grid-row: 2; } .gslot--legs { grid-column: 3; grid-row: 2; }
.gslot { display: grid; justify-items: center; gap: 5px; color: var(--parch-100); font-size: 12px; font-weight: 600; min-width: var(--touch); }
.gslot__box { position: relative; width: 68px; height: 68px; border-radius: var(--r-2); display: grid; place-items: center; background: var(--iron-800); border: 3px solid var(--tier, var(--iron-400)); box-shadow: 0 0 0 2px #0c0806, var(--bevel); }
.gslot__box img { width: 44px; height: 44px; object-fit: contain; }
.gslot--empty .gslot__box { border: 2px dashed var(--iron-400); background: rgba(22, 18, 14, .5); box-shadow: none; }
.gslot__lock { display: grid; place-items: center; color: var(--iron-300); } .gslot__lock svg { width: 20px; height: 20px; }
.gtier { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 4px; background: var(--tier, var(--iron-600)); color: #120d08; font-size: 12px; line-height: 1; border: 2px solid #120d08; }
.gslot__box .gtier { position: absolute; left: -8px; bottom: -8px; }
.plus { font: 900 12px/16px var(--font-num); min-width: 26px; height: 20px; padding: 0 4px; border-radius: 10px; background: var(--gold-300); color: var(--gold-900); border: 2px solid var(--gold-900); text-align: center; }
.gslot__box .plus { position: absolute; top: -9px; right: -10px; }
.gbar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 1px; width: 64px; height: 5px; }
.gbar i { border-radius: 1px; background: var(--iron-700); }
.gbar i.on { background: var(--gold-300); }
.gsum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; }
.gsum__mult { display: inline-flex; align-items: center; gap: 6px; }
.gsum__mult .style { position: static; width: 30px; height: 30px; border-color: var(--ink); }
.gsum__mult .style svg { width: 16px; height: 16px; }
.gsum__mult .goldtext { font-size: 34px; line-height: 1; }
.gset { display: inline-flex; align-items: center; gap: 8px; min-height: var(--touch); padding: 0 4px; border-radius: var(--r-2); }
.gset__pips { display: inline-flex; gap: 3px; }
.gset__pips i { width: 14px; height: 18px; border-radius: 3px; border: 2px solid var(--ink-soft); background: transparent; }
.gset__pips i.on { background: var(--ink); border-color: var(--ink); box-shadow: inset 0 -7px 0 var(--tier, var(--gold-300)); }
.gset__pips--pop { width: 100%; height: 100%; justify-content: center; align-items: center; }
.gset__pips--pop i { border-color: var(--iron-400); width: 9px; height: 14px; }
.gset .pill small { font: 700 11px var(--font-num); opacity: .8; margin-left: 4px; }
.gfx { height: var(--touch); padding: 0 10px 0 6px; border-radius: 22px; font: 700 13px var(--font-ui); }
.gfx img { width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; }
.gfx svg { width: 14px; height: 14px; }
.gfx--off img { filter: grayscale(1) brightness(.7); }
.gsum .gfx { margin-left: auto; }
/* the set effect popover (Round 23): every tier's effect for the style, the worn one marked On, later ones by stage */
.gfxlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gfxrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: var(--touch); padding: 4px 6px; border-radius: var(--r-2); background: var(--iron-800); border: 2px solid transparent; }
.gfxrow--on { border-color: var(--tier, var(--gold-300)); }
.gfxrow__pic { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-1, 4px); background: var(--iron-950); border: 2px solid var(--tier, var(--iron-400)); }
.gfxrow__pic img { width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; }
.gfxrow__pic .gtier { position: absolute; left: -6px; bottom: -6px; min-width: 16px; height: 16px; font-size: 10px; border-width: 1px; padding: 0 2px; }
.gfxrow__txt { display: grid; gap: 1px; font-size: 12px; color: var(--iron-300); line-height: 1.25; }
.gfxrow__txt b { font: 800 13px var(--font-ui); color: var(--parch-100); }
.gfxrow--locked .gfxrow__pic img { filter: grayscale(1) brightness(.6); }
.gfxrow--locked .gfxrow__txt b { color: var(--iron-300); }
.gfxrow .pill svg { width: 12px; height: 12px; }
.gauto { margin-top: 6px; }
.gauto > svg { width: 24px; height: 24px; }
/* the pieces: a row per tier (its number, color and material), a column per slot */
.ggrid { display: grid; grid-template-columns: 58px repeat(4, minmax(0, 1fr)); gap: 6px; }
.ggrid__tier { display: grid; justify-items: center; align-content: center; gap: 3px; font: 600 11px var(--font-ui); color: var(--ink-soft); text-align: center; line-height: 1.05; }
.ggrid__tier .gtier { min-width: 26px; height: 24px; font-size: 14px; }
.ggrid__name { display: inline-flex; align-items: center; gap: 2px; overflow-wrap: anywhere; }
.ggrid__name svg { width: 11px; height: 11px; }
.ggrid__tier--locked .gtier { filter: grayscale(1); opacity: .55; }
.gp { position: relative; min-height: 64px; display: grid; justify-items: center; align-content: center; gap: 4px; padding: 6px 2px 5px; border-radius: var(--r-2); background: var(--parch-50); border: 2px solid var(--tier, var(--parch-300)); box-shadow: 0 2px 0 var(--parch-300); }
.gp img { width: 40px; height: 40px; object-fit: contain; }
.gp .gbar { width: 80%; max-width: 64px; height: 4px; }
.gp .gbar i { background: var(--parch-300); } .gp .gbar i.on { background: var(--gold-600); }
.gp .plus { position: absolute; top: 2px; right: 2px; height: 18px; font-size: 11px; line-height: 14px; min-width: 22px; }
.gp__lock { position: absolute; left: 4px; top: 4px; color: var(--ink-soft); } .gp__lock svg { width: 14px; height: 14px; }
.gp--none, .gp--locked { border-color: var(--parch-300); border-style: dashed; background: repeating-linear-gradient(135deg, var(--parch-100) 0 8px, var(--parch-200) 8px 16px); box-shadow: none; }
.gp--none img { filter: brightness(0) opacity(.35); }
.gp--locked img { filter: brightness(0) opacity(.15); }
/* worn: an ink edge, a tier rim and a check (the shape says it, not only the color) */
.gp--worn { border-color: var(--ink); box-shadow: 0 2px 0 var(--ink), inset 0 0 0 3px var(--tier, var(--gold-300)); background: #fff8e2; }
.gp__worn { position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; border: 2px solid var(--parch-50); }
.gp__worn svg { width: 11px; height: 11px; }
/* completes the set: a gold corner tag with an up chevron */
.gp__set { position: absolute; left: 3px; bottom: 3px; width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center; background: var(--gold-300); color: var(--gold-900); border: 2px solid var(--gold-900); }
.gp__set svg { width: 10px; height: 10px; }
.gtpill .gtier { height: 18px; min-width: 18px; font-size: 11px; border-width: 1px; }
/* Round 28: masterwork. A plus past +10 is a dark plate with gold figures; a piece that can be raised now has a pale
   gold rim (the socket's "can cut" rim); the Pieces head shows the bar and the top plus open now */
.plus--mw { background: var(--iron-900); color: var(--gold-200); border-color: var(--gold-300); }
.gp--mwcan { box-shadow: 0 2px 0 var(--parch-300), 0 0 0 2px var(--gold-200); }
.gp--worn.gp--mwcan { box-shadow: 0 2px 0 var(--ink), inset 0 0 0 3px var(--tier, var(--gold-300)), 0 0 0 2px var(--gold-200); }
.gmw { min-height: var(--touch); padding: 0 10px 0 6px; border-radius: 22px; gap: 4px; }
.gmw img { width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; }
.gmw svg { width: 12px; height: 12px; }
.gmw--off img { filter: grayscale(1) brightness(.8); }
.mwrow { align-items: center; flex-wrap: wrap; }
.mwrow .pill { flex: none; }
.mwrow .pill img { width: 20px; height: 20px; object-fit: contain; image-rendering: pixelated; }
.mwring .num { font-size: 13px; color: var(--gold-200); }
.mwsteps .pill small { font: 700 11px var(--font-num); opacity: .8; margin-left: 4px; }
/* a set completed: the fight flashes gold once (never under reduced motion) */
.gflash { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(ellipse at 50% 55%, rgba(255, 211, 92, .55), rgba(255, 211, 92, 0) 70%); animation: gflash 700ms ease-out forwards; }
@keyframes gflash { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
.reduce-motion .gflash { display: none; }
@media (prefers-reduced-motion: reduce) { .gflash { display: none; } }
.toast > span.gtoast { overflow: visible; }
.gtoast { position: relative; width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-2); background: var(--iron-800); border: 2px solid var(--tier, var(--iron-400)); flex: none; }
.gtoast img { width: 26px !important; height: 26px !important; }
.gtoast .gtier { position: absolute; left: -6px; bottom: -6px; min-width: 16px; height: 16px; font-size: 10px; border-width: 1px; padding: 0 2px; }
.toast .style.gtoast__style { position: relative; top: 0; left: 0; width: 28px; height: 28px; flex: none; }
.toast .style.gtoast__style svg { width: 15px; height: 15px; }

/* the Iron Trial (Round 6): the gate, tokens, the twist, ten bosses as shields, records and the Quartermaster */
.trialbox { grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 12px; }
.trialbox > img.art { width: 170px; height: 170px; }
.trialbox__fig { display: grid; justify-items: start; gap: 4px; }
.trialbox__fig .goldtext { font-size: 46px; line-height: 1; }
.trialbox__fig .lbl svg { width: 14px; height: 14px; }
.trialbox__fig .pill { height: 28px; font-size: 15px; }
.trialrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 10px; }
.ttokens { display: flex; gap: 6px; }
.ttok { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, var(--iron-600), var(--iron-900) 72%); border: 2px solid var(--gold-600); }
.ttok img { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; }
.ttok--empty { background: transparent; border: 2px dashed var(--ink-faint); }
.twistpill { height: var(--touch); padding: 0 14px 0 10px; border-radius: 22px; font: 700 14px var(--font-ui); }
.twistpill svg, .twistpill img { width: 20px; height: 20px; }
.twistpill img { image-rendering: pixelated; object-fit: contain; }
.ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.ladder > li { display: grid; }
.rung { position: relative; display: grid; justify-items: center; gap: 2px; padding: 2px 0; border-radius: var(--r-2); }
.rung__shield { position: relative; width: 58px; height: 64px; display: grid; place-items: center; color: var(--iron-900); }
.rung__shield > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rung__shield > img { position: relative; width: 74%; height: 70%; margin-bottom: 8px; object-fit: contain; }
.rung__shield .badge { position: absolute; right: -4px; bottom: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--parch-100); }
.rung__shield .badge svg { width: 11px; height: 11px; }
.rung--next .rung__shield > img { filter: brightness(.8); }
.rung--now .rung__shield { outline: 3px solid var(--gold-400); outline-offset: 1px; border-radius: 6px 6px 24px 24px; }
/* past this week's reach: a dashed shield, the boss a shadow, a padlock (the shape says it, not only the color) */
.rung--locked .rung__shield > img { filter: brightness(0) opacity(.42); }
.rung--locked .rung__n { color: var(--ink-faint); }
.rung__shield .badge--lock { background: var(--iron-800); border-color: var(--parch-100); }
.rung__shield .badge--lock svg { width: 12px; height: 12px; }
.rung__n { font-size: 14px; line-height: 1; color: var(--ink); }
.trw { display: grid; place-items: center; width: 26px; height: 22px; border-bottom: 3px solid var(--tc, transparent); }
.trw img { width: 24px; height: 20px; object-fit: contain; }
.trw svg { width: 16px; height: 16px; }
.trw--ess { color: var(--jade-800); border-bottom: 0; }
.trophies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; padding: 10px 6px; border-radius: var(--r-3); background: radial-gradient(ellipse at 50% 30%, var(--iron-600), var(--iron-950) 80%); color: var(--parch-100); }
.trophy { display: grid; justify-items: center; align-content: start; gap: 2px; }
.trophy > img:not([src]) { visibility: hidden; }
.trophy > img { width: 52px; height: 52px; object-fit: contain; }
.trophy > img.px { width: 40px; height: 40px; margin: 6px 0; image-rendering: pixelated; }
.trophy > .shield { margin: 6px 0; }
.trophy .goldtext { font-size: 24px; line-height: 1.05; }
.trophy .lbl { font-size: 12px; color: var(--iron-300); }
img.dim { filter: grayscale(1) brightness(.6); }
.tshop { --tile: 132px; }
.tshop .tile__art { cursor: pointer; padding: 0; }
.tshop .tile__art img { width: 64%; height: 64%; image-rendering: pixelated; }
.tshop .tile__name { font-size: 12px; }
.tshop .buy__cost img { width: 20px; height: 20px; }
.tshop .pill--done { height: 32px; margin-top: 6px; }
/* (the buy sits on the floor of every tile, whatever the line above it holds; the egg's picture is a line high) */
.tshop .tile { grid-template-rows: auto auto 1fr auto; align-content: stretch; }
.tshop .tile__fx { align-self: start; min-height: 22px; }
.tshop .tile__fx img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.tshop .tile > .buy, .tshop .tile > .pill--done { align-self: end; }
/* the trial results: the trophy, the count, tags, rewards that count up */
.trialend > img.art--lg { width: 170px; height: 150px; }
.trialend .lbl svg { width: 14px; height: 14px; }
.trialend__tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.trialend__tags .pill { height: 30px; font-size: 14px; }
.trialend__tags img { width: 20px; height: 20px; object-fit: contain; image-rendering: pixelated; }
.trialloot .tile__art svg { width: 40px; height: 40px; color: var(--jade-300); }
.trialloot .tile__art img.px { width: 60%; height: 60%; }
.trialloot .tierchip { color: var(--parch-50); }
/* rewards flying off a trial boss */
.fly-item { position: fixed; z-index: 60; width: 30px; height: 30px; display: grid; place-items: center; pointer-events: none; }
.fly-item img, .fly-item svg { width: 100%; height: 100%; object-fit: contain; }
.fly-item img.px { image-rendering: pixelated; }
.fly-item svg { color: var(--jade-300); filter: drop-shadow(0 1px 0 #0d2a1d); }
/* the trial clock in the fight: a big ring of the shared seconds, the ladder count under it */
/* (a button: hold it to leave the trial; a tap passes through to the foe) */
.tclock { position: absolute; z-index: 2; right: calc(var(--sa-r) + var(--gutter)); top: calc(var(--sa-t) + 128px); display: grid; justify-items: center; gap: 2px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; touch-action: none; -webkit-touch-callout: none; }
.tclock:focus-visible { outline: 3px solid var(--gold-300); outline-offset: 3px; border-radius: 12px; }
.tclock__out { position: absolute !important; left: -6px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--iron-950); border: 2px solid var(--iron-400); color: var(--parch-100); }
.tclock__out svg { width: 13px; height: 13px; }
.tclock--hold .tclock__ring { animation: tclock-hold 650ms linear forwards; }
.tclock--hold .tclock__out { background: var(--blood-600); border-color: var(--parch-50); }
@keyframes tclock-hold { from { box-shadow: 0 0 0 2px #0c0806; } to { box-shadow: 0 0 0 2px #0c0806, 0 0 0 7px var(--blood-400); } }
.tclock__ring { --rs: var(--tclock, 68px); --rw: 7px; --ri: rgba(22, 18, 14, .88); box-shadow: 0 0 0 2px #0c0806; }
.tclock__secs { font-size: 20px; color: var(--parch-50); text-shadow: 0 1px 0 #000; }
.tclock__k { min-width: 40px; height: 20px; padding: 0 6px; border-radius: 4px; background: var(--iron-950); color: var(--gold-200); font-size: 13px; line-height: 20px; text-align: center; }
.tclock--low .tclock__ring { --rc: var(--blood-400); }
.tclock--low .tclock__secs { color: #ffd0c8; }
.tclock__add { position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); font-size: 20px; opacity: 0; white-space: nowrap; }
.tclock__add--on { animation: rt-still 1100ms linear both; }
/* the foe plate steps in from the clock ring while a trial runs, so neither covers the other */
.fight--trial .foe { width: min(calc(100% - 2 * (var(--tclock, 68px) + var(--gutter) + 6px)), 420px); }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 541px) { :root { --tclock: 92px; } .tclock { top: calc(var(--sa-t) + 150px); } .tclock__secs { font-size: 26px; } .tclock__k { font-size: 15px; } }
@media (min-width: 600px) and (orientation: portrait) { :root { --tclock: 84px; } .tclock__secs { font-size: 24px; } }

/* streak (Round 2) */
.streak { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.streak .shield { width: 100%; height: 42px; }
.streak .shield .num { font-size: 14px; }

/* map of lands (Round 7) */
.lands { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.land { position: relative; height: 96px; border-radius: var(--r-2); overflow: hidden; background: center / cover; border: 2px solid var(--ink); display: flex; align-items: flex-end; }
.land__bar { width: 100%; padding: 4px 6px; background: linear-gradient(rgba(22, 18, 14, 0), rgba(22, 18, 14, .92) 45%); color: var(--parch-50); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 4px; }
.land__bar b { font-size: 12px; white-space: nowrap; overflow: hidden; }
.land--here { box-shadow: inset 0 0 0 3px var(--gold-300); }
.land--locked { filter: grayscale(1) brightness(.5); }
.land .shield { position: absolute; top: 4px; left: 4px; }

/* constellations (Round 8): nodes on a dark chart, joined by thin lines; no glow */
.chart { position: relative; height: 300px; border-radius: var(--r-3); background: var(--iron-950); border: 2px solid var(--ink); overflow: hidden; }
.chart svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.cnode { position: absolute; transform: translate(-50%, -50%); --rs: 52px; --rw: 4px; --ri: var(--iron-900); }
.cnode .lv { bottom: -10px; font-size: 11px; height: 18px; line-height: 18px; }

/* toast: a short line at the bottom of the fight */
.toast { position: absolute; z-index: 3; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 22px; background: var(--iron-900); border: 2px solid var(--gold-600); color: var(--parch-50); font-weight: 600; font-size: 14px; white-space: nowrap; }
.toast img { width: 30px; height: 30px; }

/* ================================================================== layouts */

/* small phones */
@media (max-width: 379px) {
  :root { --portrait: 52px; --dial: 46px; --gold-fs: 28px; }
  .buy { width: 92px; }
  .tab { font-size: 11px; }
}

/* tablet portrait: more fight, two-column lists */
@media (min-width: 600px) and (orientation: portrait) {
  :root { --gutter: 20px; --portrait: 72px; --dial: 64px; --gold-fs: 44px; --fight-h: 46dvh; --tile: 130px; }
  .tab { grid-auto-flow: column; grid-auto-columns: max-content; justify-content: center; gap: 8px; font-size: 14px; }
  .next__ring { width: 84px; height: 84px; } .next__ring img { width: 62px; height: 62px; } .next { width: 96px; } :root { --next-w: 96px; }
  .foe { top: calc(var(--sa-t) + 104px); }
  .foe__name { font-size: 20px; } .hp { min-height: 20px; }
  .rate { height: 30px; font-size: 17px; }
  .shield:not(.shield--sm) { width: 64px; height: 72px; } .hud .shield .num { font-size: 30px; }
  .dials { justify-content: center; gap: 28px; }
}

/* landscape phone: specials as a column at the left, the sheet as a side panel with a tab rail; the fight keeps the
   middle. Safe areas on both long edges (notch and home indicator). */
@media (orientation: landscape) and (max-height: 540px) {
  :root { --gutter: 10px; --dial: 48px; --gold-fs: 26px; --portrait: 52px; --side-w: clamp(300px, 44vw, 420px); }
  .game { grid-template-columns: auto minmax(0, 1fr) var(--side-w); grid-template-rows: minmax(0, 1fr); grid-template-areas: "specials fight sheet"; }
  .specials { grid-template-rows: auto 1fr; padding: calc(var(--sa-t) + 6px) 6px calc(var(--sa-b) + 6px) calc(var(--sa-l) + 6px); border: 0; border-right: 2px solid #0c0806; width: calc(var(--sa-l) + 66px); }
  .energy { grid-template-columns: 1fr; justify-items: center; gap: 3px; }
  .energy__bar { width: 52px; }
  .dials { flex-direction: column; justify-content: space-between; align-items: center; }
  .hud { padding-left: var(--gutter); padding-right: var(--gutter); }
  .next { right: var(--gutter); bottom: calc(var(--sa-b) + 4px); } .pile { left: var(--gutter); bottom: calc(var(--sa-b) + 4px); }
  .next__ring { width: 56px; height: 56px; } .next__ring img { width: 40px; height: 40px; }
  .foe { top: calc(var(--sa-t) + 74px); width: 86%; }
  .sheet { border-left: 2px solid #0c0806; }
  /* icon-only tabs across the top of the side panel; the name is the accessible label and the hover tooltip */
  .tabs { order: 0; border-top: 0; border-bottom: 2px solid #0c0806; padding: var(--sa-t) var(--sa-r) 0 0; }
  .tab { min-height: 48px; }
  .tab__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tab[aria-selected="true"] { box-shadow: inset 0 -3px 0 var(--gold-300); }
  .sheet__head, .sheet__body, .panel__head, .panel__body, .panel__actions { padding-left: 10px; padding-right: calc(var(--sa-r) + 10px); }
  .sheet__body { padding-bottom: calc(var(--sa-b) + 10px); }
  .summary__val { font-size: 18px; }
  .list { grid-template-columns: minmax(0, 1fr); }
  .unit { gap: 8px; padding: 6px; }
  .summary__icon { width: 22px; height: 22px; }
  .amount button { min-width: 44px; }
  .buy { width: 86px; min-height: 50px; }
  .panelwrap { inset: 0 0 0 auto; width: var(--side-w); height: auto; }
  .scrim { display: none; }
  .panel { border-radius: 0; border-top: 0; border-left: 3px solid var(--gold-600); }
  .panel__head { border-radius: 0; padding-top: calc(var(--sa-t) + 8px); }
  .stagebox > img.art { width: 110px; height: 80px; } .stagebox .goldtext { font-size: 40px; }
  .toast { bottom: 12px; }
}

/* tablet landscape and desktop: sheet column at the right with tabs on top; specials under the fight */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 541px) {
  /* the sheet column is the right edge: it takes the right inset (an installed app with the system's status icons down
     that edge) on top of its width, so its rows keep the room they were sized for; the fight and the specials beside it
     keep none of it */
  :root { --gutter: 20px; --side-w: calc(clamp(400px, 34vw, 600px) + var(--sa-r)); --portrait: 68px; --dial: 64px; --gold-fs: 46px; --tile: 124px; }
  .fight, .specials { --sa-r: 0px; }
  .game { grid-template-columns: minmax(0, 1fr) var(--side-w); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "fight sheet" "specials sheet"; }
  .specials { grid-template-columns: minmax(0, 560px); justify-content: center; border-bottom: 0; padding-bottom: calc(var(--sa-b) + 12px); }
  .sheet { border-left: 2px solid #0c0806; }
  .sheet__main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .tabs { order: 0; border-top: 0; border-bottom: 2px solid #0c0806; padding-top: var(--sa-t); }
  .tab { min-height: 62px; font-size: 13px; }
  .tab[aria-selected="true"] { box-shadow: inset 0 -3px 0 var(--gold-300); }
  .hud .shield:not(.shield--sm) { width: 70px; height: 78px; } .hud .shield .num { font-size: 32px; }
  .where__name { font-size: 15px; } .pip { width: 14px; height: 18px; }
  .rate { height: 32px; font-size: 18px; padding: 0 10px 0 6px; } .rate img, .rate svg { width: 22px; height: 22px; }
  .foe { top: calc(var(--sa-t) + 120px); } .foe__name { font-size: 22px; } .hp { min-height: 22px; } .hp__text { font-size: 13px; }
  :root { --next-w: 120px; }
  .next { width: 120px; bottom: 16px; } .next__ring { width: 96px; height: 96px; } .next__ring img { width: 72px; height: 72px; } .next__cost { font-size: 18px; } .next__label { font-size: 13px; }
  .pile { width: 160px; } .pile img { width: calc(80px + var(--size, 1) * 36px); max-height: 140px; }
  .rise { font-size: 26px; } .rise--big { font-size: 34px; }
  .panelwrap { inset: 0 0 0 auto; width: var(--side-w); height: auto; }
  .scrim { display: none; }
  .panel { border-radius: 0; border-top: 0; border-left: 3px solid var(--gold-600); }
  .panel__head { border-radius: 0; padding-top: calc(var(--sa-t) + 12px); }
  .toast { bottom: 20px; }
}
/* very wide: lists of units go to two columns when the sheet is wide enough */
@media (min-width: 1700px) and (min-aspect-ratio: 1/1) {
  :root { --side-w: calc(640px + var(--sa-r)); --portrait: 72px; }
}

/* dual screen, side by side (Surface Duo spanned, a fold held open sideways): fight and specials on the first screen,
   the sheet and every panel on the second, nothing under the hinge. */
@media (horizontal-viewport-segments: 2) {
  :root { --side-w: env(viewport-segment-width 1 0); --gutter: 14px; --portrait: 60px; --dial: 56px; --gold-fs: 38px; }
  .game {
    grid-template-columns: env(viewport-segment-width 0 0) calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0)) env(viewport-segment-width 1 0);
    grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "fight hinge sheet" "specials hinge sheet";
  }
  .hinge { display: block; grid-area: hinge; background: #000; }
  .fight, .specials { --sa-r: 0px; }
  .specials { grid-template-columns: 1fr; padding-bottom: calc(var(--sa-b) + 10px); }
  .sheet__main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .tabs { order: 2; }
  .panelwrap { inset: 0 0 0 auto; width: env(viewport-segment-width 1 0); height: auto; }
  .scrim { display: none; }
  .panel { border-radius: 0; border-top: 0; }
  .panel__head { border-radius: 0; }
}
/* dual screen, one above the other (a fold held like a laptop, a Duo turned): fight on top, sheet below */
@media (vertical-viewport-segments: 2) {
  .game {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: calc(env(viewport-segment-height 0 0) - var(--specials-h, 104px)) var(--specials-h, 104px) calc(env(viewport-segment-top 0 1) - env(viewport-segment-bottom 0 0)) env(viewport-segment-height 0 1);
    grid-template-areas: "fight" "specials" "hinge" "sheet";
  }
  .hinge { display: block; grid-area: hinge; background: #000; }
  .panelwrap { inset: auto 0 0 0; height: env(viewport-segment-height 0 1); }
}

/* motion off: the OS setting or the in-game switch (.reduce-motion on .game) */
@media (prefers-reduced-motion: reduce) {
  .rise, .rate__tick, .buy--pulse, .next--ready .next__ring { animation: none; }
  .rate__tick { display: none; }
}
.reduce-motion .rise, .reduce-motion .rate__tick, .reduce-motion .buy--pulse, .reduce-motion .next--ready .next__ring { animation: none; }
.reduce-motion .rate__tick { display: none; }

/* ================================================================== small pieces */
.lockb { position: absolute; inset: 0; display: grid; place-items: center; }
.lockb svg { width: 26px; height: 26px; }
.pop--above::after { top: auto; bottom: -9px; transform: rotate(225deg); }

/* essence sits under the region pips: a small jade chip */
.hud__row .rate--ess { flex: none; height: 24px; font-size: 14px; }
.hud__row .rate--ess svg { width: 16px; height: 16px; }

.panel__head > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; }
.panel__head > span:first-child svg { width: 100%; height: 100%; }
/* (an icon wrapped in its own span, like the Achievements crown, fills the plate too, so it stays in the head) */
.panel__head > span:first-child > span { width: 34px; height: 34px; }
.stagebox .gains { top: 58%; }
.portrait > svg { width: 64%; height: 64%; margin: 18%; }
.tile__svg { width: 38px; height: 38px; display: grid; }
.tile__svg svg { width: 100%; height: 100%; }
.tile__art:has(.lv) { margin-bottom: 10px; }

/* the path on a phone: each branch is a row, nodes left to right along a line, so all four fit at once */
@media (max-width: 599px), (orientation: landscape) and (max-height: 540px) {
  .path { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .branch { grid-auto-flow: column; grid-template-columns: 56px; justify-content: start; align-items: center; gap: 10px; padding: 10px 8px 14px; overflow-x: auto; }
  .branch::before { top: 50%; bottom: auto; left: 60px; right: 12px; width: auto; height: 4px; transform: none; }
  .branch__head { font-size: 12px; }
  .branch .buy { width: 72px !important; min-height: 48px; }
  .node { --rs: 50px; }
}
.stagebox > img.art--lg { width: 190px; height: 150px; }
@media (orientation: landscape) and (max-height: 540px) { .stagebox > img.art--lg { width: 120px; height: 84px; } .stagebox { padding: 8px; } }
@media (min-width: 1700px) and (min-aspect-ratio: 1/1) {
  :root { --gold-fs: 60px; --dial: 72px; }
  .hud .shield:not(.shield--sm) { width: 84px; height: 94px; } .hud .shield .num { font-size: 38px; }
  .rate { height: 38px; font-size: 22px; } .where__name { font-size: 17px; }
  .foe { width: 520px; top: calc(var(--sa-t) + 150px); } .foe__name { font-size: 28px; } .hp { min-height: 26px; } .hp__text { font-size: 15px; }
  .rise { font-size: 34px; } .rise--big { font-size: 46px; }
  .buff { width: 52px; height: 52px; } .buff img { width: 32px; height: 32px; } .fcol { top: calc(var(--sa-t) + 150px); }
  .fcask { width: 56px; height: 56px; } .fcask img { width: 46px; height: 40px; } .fcask .num { font-size: 13px; }
  .unit__name { font-size: 17px; } .buy { width: 124px; min-height: 64px; } .buy__cost { font-size: 20px; }
}

/* ================================================================== the game beyond the mockups */
/* What the running game needs that the mockups did not draw: the 3D fight's tap surface, the cache splat sprites,
   flying coins, the clue on the floor, the casket opening, the task board, the start screen and the save text. */

[hidden] { display: none !important; }
:root {
  --ember-300: #ffc04a; --ember-800: #6a2a02;
  /* clue tiers: the seal color, always shown with the tier's word */
  --tier-easy: #4f9a3a; --tier-medium: #3c78b8; --tier-hard: #b03a2e; --tier-elite: #d8a420; --tier-master: #e6e2d6;
}
input, select, textarea { font: inherit; color: inherit; }
p { margin: 0 0 10px; }

/* the fight: the canvas fills it; taps land on .fight__tap, the overlay above lets them through except on its buttons */
.fight__tap { position: absolute; inset: 0; touch-action: manipulation; user-select: none; -webkit-user-select: none; cursor: pointer; }
.fight__tap:focus-visible { outline: 3px solid var(--focus); outline-offset: -4px; }
.fight canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fight__overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; user-select: none; -webkit-user-select: none; }
.fight__overlay button { pointer-events: auto; }
.fight--shake { animation: rt-shake 140ms linear; }
@keyframes rt-shake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-3px, 1px); } 50% { transform: translate(3px, -2px); } 75% { transform: translate(-2px, 2px); } }
.fight__wait { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); color: var(--parch-100); font-size: 14px; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.hud { z-index: 2; }
.foe { z-index: 4; } /* (over the splats and the rising gold: a hit never hides the name, the health or the timer) */
.foe__name > span:first-child { min-width: 0; overflow: hidden; white-space: nowrap; }
.foe__boss { margin-top: 8px; }
.where__name { display: flex; align-items: center; gap: 6px; }
.where__farm { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--iron-800); color: var(--gold-200); font: 700 11px var(--font-ui); }
.counter__pile img { image-rendering: pixelated; }
.rate img { image-rendering: pixelated; }
.rates .rate small { white-space: nowrap; }

/* gains rise from the foe's head (render.js places the box) */
.fight__overlay > .gains { z-index: 3; }

/* hit splats: the cache's own sprites, with drawn fallbacks when the cache export is missing */
.splat {
  position: absolute; transform: translate(-50%, -50%) scale(var(--z, 1)); display: grid; place-items: center; z-index: 2;
  font-family: var(--font-num); font-weight: 900; font-variant-numeric: lining-nums tabular-nums; color: #fff;
  line-height: 1; white-space: nowrap; pointer-events: none; background-repeat: no-repeat; background-position: center; background-size: 100% 100%;
  text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000, 1px 1px 0 #000;
}
.splat--hit {
  min-width: 46px; height: 40px; padding: 0 10px; font-size: 17px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 40' preserveAspectRatio='none'%3E%3Cpath d='M23 2 C29 2 31 6 35 6 C41 6 44 11 43 16 C42 19 45 22 44 26 C43 32 38 34 34 35 C30 38 26 38 23 37 C20 38 15 38 12 35 C7 34 2 31 2 26 C1 22 4 19 3 16 C2 11 6 6 11 6 C15 6 17 2 23 2 Z' fill='%23c42f1f' stroke='%23300603' stroke-width='2.5'/%3E%3C/svg%3E");
}
.splat--party { min-width: 36px; height: 32px; font-size: 14px; filter: brightness(0.82); }
.splat--crit {
  min-width: 72px; height: 64px; padding: 0 14px; font-size: 24px; color: #fff6d6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 64' preserveAspectRatio='none'%3E%3Cpath d='M36 2 L43 14 L57 7 L56 22 L70 26 L60 36 L68 49 L53 50 L50 62 L38 55 L26 62 L22 50 L6 50 L13 37 L2 27 L16 21 L14 7 L29 14 Z' fill='%23f07a12' stroke='%23200800' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M36 12 L41 21 L51 17 L50 27 L59 30 L52 37 L57 45 L47 45 L45 53 L37 48 L28 53 L26 45 L15 45 L20 37 L13 30 L22 27 L21 17 L31 21 Z' fill='%23c4310e'/%3E%3C/svg%3E");
}
.splat--gold { display: flex; align-items: center; min-width: 56px; height: 30px; padding: 0 12px; font-size: 15px; color: var(--gold-900); background: var(--gold-300); border: 2px solid var(--gold-900); border-radius: 15px; text-shadow: none; }
.splat--gold::before { content: "+"; }
.splat--sprite.splat--hit { background-image: var(--splat-hit); background-size: 50px 48px; image-rendering: pixelated; padding: 0 4px; }
.splat--sprite.splat--party { background-image: var(--splat-party); background-size: 40px 38px; filter: none; }
.splat--sprite.splat--crit { background-image: var(--splat-crit); background-size: 72px 72px; image-rendering: pixelated; min-width: 72px; height: 72px; color: #fff6d6; font-size: 25px; }
.splat--rise { animation: rt-splat 700ms ease-out forwards; }
/* (--z: render.js draws a splat smaller where the room under the plate is short; the rise shrinks with it, so a
   splat's top edge never climbs more than 1.1 of its drawn height over where it landed) */
@keyframes rt-splat {
  0% { transform: translate(-50%, calc(-50% + 20% * var(--z, 1))) scale(calc(0.7 * var(--z, 1))); opacity: 0; }
  12% { transform: translate(-50%, -50%) scale(calc(1.08 * var(--z, 1))); opacity: 1; }
  25% { transform: translate(-50%, -50%) scale(var(--z, 1)); }
  70% { opacity: 1; }
  100% { transform: translate(-50%, calc(-50% - 60% * var(--z, 1))) scale(var(--z, 1)); opacity: 0; }
}
@keyframes rt-still { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* coins flying to the gold counter (removed when they land) */
.fly-coin { position: fixed; z-index: 60; width: 30px; height: 27px; pointer-events: none; image-rendering: pixelated; transform: translate(-50%, -50%); }

/* the clue on the floor: the 3D scroll lies beside the foe; this ring around it counts its seconds down */
.drop { z-index: 6; width: 64px; height: 64px; margin: -32px 0 0 -32px; box-shadow: 0 0 0 2px #0c0806; }
.drop::before { inset: 5px; background: rgba(22, 18, 14, 0.15); border-color: var(--parch-50); }
.drop__tier { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); height: 18px; padding: 0 6px; border-radius: 4px; background: var(--iron-950); color: var(--parch-50); font: 700 11px/18px var(--font-ui); white-space: nowrap; border-left: 4px solid var(--tc, var(--parch-300)); }
.drop--low { background: conic-gradient(var(--blood-400) calc(var(--p) * 360deg), rgba(22, 18, 14, .6) 0); }

/* boosts at the left under the HUD */
.fcol { z-index: 2; }
.buff img { image-rendering: pixelated; object-fit: contain; }

/* toast: picture and a noun phrase, inside the fight */
/* it takes the floor between the left edge and the next-upgrade ring, centered in that span, and never runs under the
   ring; a name too long for a small phone shrinks a step before it would be cut */
.toast { z-index: 4; overflow: hidden; left: calc(var(--sa-l) + var(--gutter)); right: calc(var(--sa-r) + var(--gutter) + var(--next-w, 76px) + 6px); width: fit-content; max-width: none; margin-inline: auto; transform: none; }
.toast > span { overflow: hidden; white-space: nowrap; }
.toast img { object-fit: contain; image-rendering: pixelated; }
.toast img.r { image-rendering: auto; }
.toast svg { width: 26px; height: 26px; flex: none; }
.toast .pill { flex: none; }
@media (max-width: 379px) { .toast { font-size: 13px; gap: 6px; padding-right: 8px; } }

/* the next-upgrade widget and the pile are buttons in the overlay */
.next { padding: 0; color: inherit; z-index: 3; }
.next__ring img { image-rendering: auto; }
.next__label { font-weight: 700; }
.next--ready .next__label { color: var(--gold-200); }
.pile { z-index: 3; }
.pile img { image-rendering: auto; }

/* specials bar */
.dial { padding: 0; }
.dial img { image-rendering: pixelated; }
.dial .lock { position: absolute; width: 20px; height: 20px; }
.dial[data-state="noenergy"] img { opacity: .45; }
.dial[data-state="noenergy"] .dial__t { color: var(--water-300); display: inline-flex; align-items: center; gap: 2px; }
.dial[data-state="noenergy"] .dial__t svg { width: 9px; height: 11px; }
.dial[aria-disabled="true"] { cursor: default; }

/* sheet and tabs */
.tab__icon img { image-rendering: auto; }
.tab__icon img.px { image-rendering: pixelated; }
.tab:focus-visible { outline-offset: -3px; }
.summary__ess { display: inline-flex; align-items: center; gap: 4px; color: var(--jade-800); font-size: 20px; }
.summary__ess svg { width: 20px; height: 20px; }
.sheet :focus-visible, .panel__body :focus-visible, .panel__actions :focus-visible { outline-color: var(--focus-on-parch); }
.sheet .tabs :focus-visible { outline-color: var(--focus); }

/* rows */
button.portrait { padding: 0; flex: none; }
.portrait img.item { image-rendering: pixelated; }
.unit > .buy, .unit > .pill { justify-self: end; }

.buy__cost img { image-rendering: pixelated; }
.buy--no .buy__gain { opacity: .85; }
.unit--locked .share .num { color: var(--ink-soft); }
.unit__mid .ms { min-height: 20px; }
.tile__art img { image-rendering: pixelated; }
.tile__art img.r, .tile__art img.full { image-rendering: auto; }
.tile__art .lockb { position: absolute; }
button.tile { width: 100%; font: inherit; }
.tile .pill { margin-top: 2px; }
.tiles > li { display: grid; }
.herocard .portrait img { image-rendering: auto; }
.herocard .perk img { width: 16px; height: 16px; image-rendering: pixelated; }
.herocard .lbl { display: block; }

/* the More menu tiles */
.more .tile { min-height: 128px; }
.more .tile__art { width: 72px; height: 72px; }
.more .tab__badge { top: 6px; right: 6px; }
.more .tile__art svg { width: 40px; height: 40px; }

/* details popover */
.pop:focus-visible { outline: 3px solid var(--focus); }
.pop__head .portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 4px; }
.pop__head .portrait img.px { object-fit: contain; padding: 14%; image-rendering: pixelated; }
.pop__head .portrait img.prop { object-fit: contain; padding: 6%; }
.pop__head .portrait > svg { width: 64%; height: 64%; margin: 18%; }
.pop__facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pop__row { display: flex; gap: 8px; margin-top: 10px; }
.pop__row .btn { flex: 1; }
.pop .pill--iron { border-color: var(--iron-600); }

/* panels */
#dialogs { display: contents; }
.panel__title { margin: 0; overflow: hidden; white-space: nowrap; }
.panel__head img { image-rendering: auto; }
.panel__head img.px { image-rendering: pixelated; }
.panel__body > p { font-size: 15px; }
.panel__actions .btn img { width: 26px; height: 26px; object-fit: contain; }
.panel__actions .btn .pill { height: 22px; }
.panel:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: default; }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn--block { width: 100%; }
.note { font-size: 13px; color: var(--ink-soft); }
.note--warn { color: var(--danger); font-weight: 600; }
.stagebox .gains { position: absolute; left: 50%; width: 0; height: 0; }
.stagebox .lbl { display: inline-flex; align-items: center; gap: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.chipicon > img { image-rendering: pixelated; }
.chipicon > img.r, .chipicon > img.bust { image-rendering: auto; }
.chipicon > svg { width: 28px; height: 28px; }
.stat > img { image-rendering: pixelated; }
.seg button { background: transparent; }
.range { height: var(--touch); margin: 0; }
.vol { display: flex; align-items: center; gap: 8px; }
.vol output { font: 800 14px var(--font-num); min-width: 3ch; text-align: right; }
.fan { font-size: 12px; color: var(--ink-faint); margin: 16px 0 0; }

/* questions asked on the start screen (the game is hidden): a panel over the title art */
.start-dialogs .scrim { position: fixed; display: block; z-index: 49; }
.start-dialogs .panelwrap { position: fixed; z-index: 50; inset: auto 0 0 0; width: auto; height: auto; max-height: 92dvh; transform: none; }
.start-dialogs .panel { border-left: 0; border-top: 3px solid var(--gold-600); border-radius: var(--r-3) var(--r-3) 0 0; }
.start-dialogs .panel__head { border-radius: var(--r-3) var(--r-3) 0 0; padding-top: 10px; }
@media (min-width: 600px) and (min-height: 500px) {
  .start-dialogs .panelwrap { inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(600px, 92vw); }
  .start-dialogs .panel { border-radius: var(--r-3); overflow: hidden; }
}

/* offline: the counting figure, the clock ring and two pills */
.offline__fig { font-size: 56px; line-height: 1; }
.offline__row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; margin-top: 12px; }
.offline__pills { display: grid; gap: 8px; }
.offline__pills .pill { height: 34px; font-size: 16px; justify-self: start; }
.clock .num { display: block; }

/* treasure trails */
.cluepic { background: radial-gradient(circle at 50% 40%, var(--parch-50), var(--parch-300) 80%); }
.cluepic > img { object-fit: contain !important; padding: 4%; }
.lv.tierlv { border-left: 4px solid var(--tc, var(--parch-300)); font: 700 11px/20px var(--font-ui); }
.steps { display: flex; gap: 3px; }
.steps i { width: 14px; height: 6px; border-radius: 2px; background: var(--parch-300); }
.steps i.on { background: var(--gold-600); }
.steps i.now { background: repeating-linear-gradient(135deg, var(--gold-600) 0 3px, var(--parch-300) 3px 6px); }
.caskets { grid-template-columns: auto auto; align-items: center; gap: 16px; justify-content: center; }
.caskets > img.art { width: 132px; height: 104px; }
.caskets .goldtext { font-size: 48px; }
.caskets--none > img.art { filter: grayscale(.8) brightness(.6); }
.trinkets { --tile: 58px; gap: 6px; }
.trinkets .tile { padding: 6px; gap: 3px; }
.trinkets .tile__art { width: 44px; height: 44px; }
.trinkets .tile__art img { width: 92%; height: 92%; }
.tierbar { width: 70%; height: 4px; border-radius: 2px; background: var(--tc); }
.trinkets .tile--off .tierbar { opacity: .35; }

/* the caskets waiting, at the head of the fight's left column: the casket on a gold-rimmed plate, the count under it
   (the count, not the color, says it is there); one press opens the casket panel */
.fcask { position: relative; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 12px; cursor: pointer;
  background: radial-gradient(circle at 50% 40%, var(--iron-600), var(--iron-900) 72%); border: 2px solid var(--gold-400); box-shadow: 0 0 0 2px #0c0806, 0 2px 0 #0c0806; color: inherit; font: inherit; touch-action: manipulation; }
.fcask img { width: 36px; height: 32px; object-fit: contain; }
.fcask .num { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); font: 800 11px var(--font-num); background: var(--iron-950); padding: 0 4px; border-radius: 3px; color: var(--gold-200); white-space: nowrap; }
.fcask:focus-visible { outline: 3px solid var(--gold-200); outline-offset: 2px; }
.fcol .fcask + .buffs { margin-top: 2px; }

/* what a casket reward did: a check and a word or two ("Active", "Kept for good", "Energy full") */
.tstate { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px 0 5px; border-radius: 11px; background: var(--ok); color: #fff; font: 700 12px var(--font-ui); white-space: nowrap; }
.tstate svg { width: 13px; height: 13px; }
.sec .tstate { margin-left: 6px; vertical-align: middle; }
/* a boost tile's art is ringed like the fight's chip: time left of three times the base */
.tile__art--ring { background: conic-gradient(var(--gold-300) calc(var(--p, 0) * 360deg), var(--iron-700) 0); }
.tile__art--ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, var(--iron-600), var(--iron-900) 72%); }
.tile__art--ring > img { position: relative; }
/* a trinket found: a check badge on its tile in Trails */
.tkept { position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; box-shadow: 0 0 0 1px var(--ink); }
.tkept svg { width: 11px; height: 11px; }

/* casket opening: the lid frames swap, then the rewards fly out of it one by one */
.casketbox { min-height: 170px; }
.casketbox > img.art { width: 200px; height: 150px; }
.tierchip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; background: var(--iron-950); color: var(--parch-50); font: 700 12px var(--font-ui); border-left: 5px solid var(--tc); }
.loot { margin-top: 10px; --tile: 112px; }
.loot .tile { min-height: 132px; align-content: center; }
.loot .tile__art { width: 72px; height: 72px; }
.loot .tile__art img { width: 66%; height: 66%; }
.loot .tile__art img.r { width: 92%; height: 92%; }
.loot .tile__art svg { width: 40px; height: 40px; }
.loot .goldtext { font-size: 24px; line-height: 1.1; }
.goldtext--plain { color: var(--parch-50); }
.loot__wait { visibility: hidden; }

/* tasks: the board, the streak, today's three and the week */
.taskbox { grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 14px; }
.taskbox > img.art { width: 140px; height: 130px; }
.taskbox__fig { display: grid; justify-items: start; gap: 4px; }
.taskbox__fig .goldtext { font-size: 44px; line-height: 1; }
.streak { margin-top: 12px; }
.streak .shield { color: var(--parch-50); }
.streak .shield--soon .num { color: var(--iron-400); text-shadow: none; }
.streakbtn { display: block; width: 100%; border-radius: var(--r-2); }
.tasks .tile { min-height: 150px; }
.tasks .ring { --rs: 64px; --ri: var(--iron-850); }
.tasks .ring img { width: 34px; height: 34px; object-fit: contain; image-rendering: pixelated; }
.tasks .ring img.r { image-rendering: auto; width: 46px; height: 46px; }
.tasks .ring svg { width: 30px; height: 30px; }
.tasks .ring .crowni { color: var(--gold-300); }
.tasks .tile--done { background: linear-gradient(var(--parch-50), #e3ead0); }
.tasks--week { --tile: 96px; }
.tasks--week .tile { min-height: 118px; padding: 8px 4px; }
.tasks--week .ring { --rs: 48px; --rw: 4px; }
.tasks--week .ring img { width: 26px; height: 26px; }
.tasks--week .ring img.r { width: 34px; height: 34px; }
.tasks--week .ring svg { width: 22px; height: 22px; }
.weekbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 10px; }
.weekbar .share__bar { height: 16px; border-radius: 8px; }
.weekbar img { width: 54px; height: 44px; object-fit: contain; }

/* a coin burst for a finished task */
.burst { position: fixed; width: 0; height: 0; pointer-events: none; z-index: 60; }
.burst i { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, var(--gold-200), var(--gold-400) 60%, var(--gold-600)); border: 2px solid var(--gold-900); animation: burst 650ms cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes burst { 0% { transform: translate(0, 0) scale(.4); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 0; } }

/* cloud: account plate and save cards */
.account { grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-items: start; gap: 12px; }
.account__avatar { width: 52px; height: 52px; display: grid; place-items: center; border-radius: var(--r-2); background: #5865F2; border: 2px solid var(--ink); }
.account__avatar svg { width: 30px; height: 23px; }
.account__name { font-weight: 700; }
.savecard .shield { color: var(--parch-50); }
.savecard__where { font-weight: 700; }
.savecard__when { font-size: 12px; color: var(--ink-soft); }

/* the Discord sign-in button (start screen, cloud panel) */
.discord-btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 8px; background: #5865F2; color: #fff; font-family: var(--font-ui); font-weight: 600; font-size: 16px; width: 100%; }
.discord-btn:active { background: #4752C4; }
.discord-btn svg { width: 24px; height: 18px; flex: none; }
.discord-btn:focus-visible { outline: 3px solid var(--focus-on-parch); outline-offset: 3px; }

/* save text for export and import */
.save-text { width: 100%; min-height: 120px; padding: 8px; resize: vertical; font: 12px/1.35 ui-monospace, Consolas, monospace; color: var(--ink); background: var(--parch-50); border: 2px solid var(--ink-soft); border-radius: var(--r-2); }

/* the start screen: the title painting, our own lettering over its calm sky, buttons on the calm ground */
.start { position: fixed; inset: 0; z-index: 30; overflow: hidden; background: #8a8f8f; display: flex; flex-direction: column; align-items: center; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.start__art { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 52%; }
.start__logo { position: relative; margin: clamp(28px, 7vh, 90px) 0 0; text-align: center; color: #fff1c9; font-family: var(--font-num); font-weight: 900; line-height: 0.95; letter-spacing: 0; font-size: clamp(64px, 19vw, 132px); text-shadow: 0 4px 0 #5f3d08, 0 7px 0 #2a1a06, 0 0 2px #2a1a06; -webkit-text-stroke: 2px #3a2402; }
.start__logo span { color: var(--gold-300); }
.start__panel { position: relative; margin-top: auto; margin-bottom: clamp(16px, 4vh, 40px); width: min(360px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 12px; padding: 16px; background: rgba(32, 26, 21, 0.9); border: 2px solid #0e0b09; border-radius: var(--r-3); box-shadow: var(--bevel), 0 0 0 2px var(--iron-600); }
.start__panel .btn { width: 100%; min-height: 52px; font-size: 20px; }
.start__panel .btn--quiet { min-height: 44px; font-size: 14px; color: var(--parch-100); border-color: var(--parch-300); }
.start__note { margin: 0; font-size: 13px; color: var(--parch-200); text-align: center; line-height: 1.4; }
.start__saved { margin: 0; font-size: 13px; color: var(--iron-300); text-align: center; }
.start__fan { margin: 0; font-size: 11px; color: var(--iron-300); text-align: center; line-height: 1.35; }
.load { display: grid; gap: 6px; }
.load__track { height: 12px; background: var(--iron-950); border: 2px solid var(--iron-600); border-radius: 2px; overflow: hidden; }
.load__fill { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--gold-400) 0 10px, var(--gold-600) 10px 12px); }
.load__text { font-size: 13px; color: var(--parch-200); text-align: center; }
@media (min-aspect-ratio: 1/1) {
  .start__logo { font-size: clamp(64px, 11vh, 132px); margin-top: clamp(20px, 5vh, 60px); }
  .start__panel { margin-bottom: clamp(12px, 3vh, 32px); }
}

/* bigger splats and drop where the fight is big */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 541px) {
  .splat--sprite.splat--hit { background-size: 60px 58px; min-width: 56px; height: 48px; font-size: 20px; }
  .splat--sprite.splat--party { background-size: 46px 44px; font-size: 16px; }
  .splat--sprite.splat--crit { background-size: 88px 88px; min-width: 88px; height: 88px; font-size: 29px; }
  .drop { width: 80px; height: 80px; margin: -40px 0 0 -40px; }
  .toast { font-size: 16px; }
}

/* motion off (the OS setting or the in-game switch): nothing moves on its own */
@media (prefers-reduced-motion: reduce) {
  .splat--rise { animation: rt-still 700ms linear forwards; }
  .rise { animation: rt-still 900ms linear both; }
  .fight--shake { animation: none; }
  .burst { display: none; }
}
.reduce-motion .splat--rise { animation: rt-still 700ms linear forwards; }
.reduce-motion .rise { animation: rt-still 900ms linear both; }
.reduce-motion .fight--shake { animation: none; }
.reduce-motion .burst { display: none; }
.toast--long { white-space: normal; left: 50%; right: auto; width: auto; margin: 0; transform: translateX(-50%); max-width: min(92%, 420px); bottom: auto; top: 46%; border-radius: var(--r-3); z-index: 5; }
.toast--long > span { white-space: normal; }
.panel__icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--parch-100); }
.panel__icon > * { width: 100%; height: 100%; object-fit: contain; }
.panel__icon svg { width: 100%; height: 100%; }
/* the clue ring: only the rim counts down, so the scroll on the floor shows through the middle */
.drop, .drop--low { background: none; }
.drop::before { inset: 6px; background: transparent; border: 2px solid rgba(247, 238, 214, .55); }
.drop::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--parch-50) calc(var(--p) * 360deg), rgba(22, 18, 14, .65) 0);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  mask: radial-gradient(closest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); }
.drop--low::after { background: conic-gradient(var(--blood-400) calc(var(--p) * 360deg), rgba(22, 18, 14, .65) 0); }
.drop__tier { z-index: 1; }
@media (min-width: 600px) and (orientation: portrait) { .tab__icon { margin-right: 18px; } .tab .tab__badge { right: -16px; } }

/* Round 3: collection log (marks are chevrons: filled or hollow, the shape carries the state) and slayer */
.marks { display: inline-flex; gap: 2px; color: var(--gold-600); }
.marks .mk { width: 16px; height: 12px; }
.pop .marks, .toast .marks { color: var(--gold-300); }
.tile--unseen .tile__art img { filter: brightness(0) opacity(.55); }
.pages { flex-wrap: wrap; }
.pages button svg { width: 14px; height: 14px; color: var(--ok); }
.bestiary .tile { padding-top: 10px; }
.slayerbox { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; gap: 14px; }
.slayerbox .ring > svg { width: 52px; height: 52px; }
.unit .switch { justify-self: end; }
.unit > .buy { width: 92px; }
/* Round 4: path nodes are buttons */
button.node { padding: 0; }
.node > img { image-rendering: pixelated; }
.node > svg.n { color: var(--parch-100); }
.branch__head .style img { width: 70%; height: 70%; image-rendering: pixelated; }

/* item icons from the cache export in places that held drawn stand-ins: kept whole and crisp */
.portrait > img.px { object-fit: contain; padding: 14%; image-rendering: pixelated; }
.pop__head .portrait img.px { object-fit: contain; padding: 12%; image-rendering: pixelated; }
.ring > img.taski { width: 58%; height: 58%; object-fit: contain; image-rendering: pixelated; }
.toast img.px { image-rendering: pixelated; }
.shopfx { margin-top: 4px; justify-self: start; width: max-content; height: 24px; font-size: 13px; }
.shopfx img, .shopfx svg { width: 16px; height: 16px; }
.fly-coin--in { position: absolute; z-index: 1; }

/* The HUD's stage shield opens the map: a button with the shield's look */
.hud > button.shield { cursor: pointer; }
.hud > button.shield:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* Round 7 (early): the world map. The panel's body is a column: the map takes the room, the region card sits under it */
.panel--map .panel__body { display: flex; flex-direction: column; padding-top: 10px; padding-bottom: 10px; }
.wmapbox { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.wmap { position: relative; flex: 1; min-height: 200px; overflow: hidden; border-radius: var(--r-3); border: 2px solid var(--ink); background: #2f6c86; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.wmap--drag { cursor: grabbing; }
.wmap:focus-visible { outline: 3px solid var(--focus-on-parch); outline-offset: 2px; }
.wmap__gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wmap__img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.wmap__wait { position: absolute; inset: 0; display: grid; place-items: center; background: #2f6c86; }
.wmap__wait svg { width: 64px; height: 64px; opacity: .55; }
.wmap__wait--err svg { opacity: .25; }
.wmap__pins { position: absolute; inset: 0; pointer-events: none; }
.wpin { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.wpin > * { position: absolute; left: 0; bottom: 6px; transform: translateX(-50%); pointer-events: auto; }
.wpin__btn { width: var(--touch); height: 52px; display: grid; justify-items: center; align-content: end; padding-bottom: 2px; }
.wpin__btn .shield--sm { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .6)); }
.wpin--pick .wpin__btn .shield--sm { outline: 3px solid var(--parch-50); outline-offset: 1px; border-radius: 4px 4px 14px 14px; }
.wpin__btn:focus-visible { outline: 3px solid var(--focus); border-radius: 6px; }
/* the current region: a gold shield and a pointer under it (the shape says "here", not only the color) */
.wpin__here { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid var(--gold-300); filter: drop-shadow(0 1px 0 #000); margin-top: -1px; }
.wpin--current { z-index: 2; }
/* a region ahead in this lap: the outline shield on a dim backing (its shape, not only its color, says ahead) */
.wpin--ahead .shield--sm { background: rgba(22, 18, 14, .62); border-radius: 4px 4px 16px 16px; color: var(--parch-200); opacity: .85; }
.wpin__lock { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: rgba(22, 18, 14, .78); border: 2px solid var(--iron-600); pointer-events: none; }
.wpin__lock svg { width: 16px; height: 16px; }
.wpin--unknown .wpin__lock { opacity: .7; }
.wmap__ctl { position: absolute; right: 8px; bottom: 8px; display: grid; gap: 6px; z-index: 3; }
.wmap__btn { width: var(--touch); height: var(--touch); display: grid; place-items: center; border-radius: var(--r-2); background: var(--iron-850); color: var(--parch-50); border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.wmap__btn svg { width: 22px; height: 22px; }
.wmap__btn:focus-visible { outline: 3px solid var(--focus); }
.wmap__info:empty { display: none; }
.wmap__card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 10px 12px; border-radius: var(--r-3); background: radial-gradient(ellipse at 30% 30%, var(--iron-700), var(--iron-950) 80%); color: var(--parch-100); }
.wmap__boss { --portrait: 64px; border-color: var(--gold-600); }
.wmap__boss > img { object-fit: contain; object-position: center; }
.wmap__boss > svg { width: 60%; height: 60%; margin: 20%; color: var(--gold-300); }
.lv.wmap__crown { min-width: 26px; padding: 2px 5px; color: var(--gold-300); }
.lv.wmap__crown svg { width: 16px; height: 16px; }
.wmap__name { font: 800 17px var(--font-num); line-height: 1.15; overflow: hidden; white-space: nowrap; }
.wmap__row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.wmap__range { display: inline-flex; align-items: center; gap: 6px; }
.wmap__row .pill .mk { width: 16px; height: 12px; color: var(--gold-600); }
@media (orientation: landscape) and (max-height: 540px) {
  .wmapbox { flex-direction: row; }
  .wmap { min-height: 0; }
  .wmap__info { width: 42%; flex: none; }
  .wmap__card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .wmap__row { justify-content: center; }
  .wmap__name { white-space: normal; }
  .wmap__txt { min-width: 0; }
  .wmap__visit { padding: 0 8px; gap: 4px; max-width: 100%; }
  .wmap__visit > svg { display: none; }
  .wmap__vn { min-width: 0; padding: 0 4px; }
}
/* the Map tile in More shows the world itself */
.tile__art > img.mapart { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; image-rendering: auto; }

/* collection log pages: Foes, Pets, Trails */
.logpages { margin-bottom: 12px; flex-wrap: wrap; }
.logpages button { height: var(--touch); padding: 0 14px 0 8px; border-radius: 22px; }
.logpages button img, .logpages button svg { width: 28px; height: 28px; object-fit: contain; }
.loghead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.logcount { font-size: 15px; }
.logcaskets > div { display: grid; justify-items: start; gap: 4px; }
.tiertile { gap: 6px; padding-top: 10px; }
.tiertile .ring img { width: 74%; height: 74%; object-fit: contain; }
.tiertile .ring { background: conic-gradient(var(--tc) calc(var(--p) * 360deg), var(--iron-700) 0); }
.tiertile .pill img { width: 18px; height: 18px; object-fit: contain; }
.wpin--current .wpin__btn { height: 60px; }
.wpin--current .shield--sm { width: 44px; height: 49px; }
.wpin--current .shield--sm .num { font-size: 19px; }
.summary .seg button { height: var(--touch); }
.summary .seg button img { width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; }

/* the coach: a hand pressing on the foe for the first taps, then on the next-upgrade ring for the first buy (a shape,
   no words). Its ring ripples out with each press; under reduced motion the hand stands still and the ring stays. */
.coach { position: absolute; left: 50%; top: 56%; z-index: 4; width: 0; height: 0; pointer-events: none; }
.coach svg { position: absolute; left: -14px; top: -4px; width: 58px; height: 58px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .55)); transform-origin: 30% 10%; animation: coach-press 1.1s ease-in-out infinite; }
.coach__ring { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--parch-50); box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); opacity: 0; animation: coach-ring 1.1s ease-out infinite; }
.coach--next svg { width: 48px; height: 48px; left: -8px; top: 4px; }
.coach--dial { top: 50%; z-index: 2; }
.coach--hire { top: 55%; z-index: 3; }
.coach--hire svg { width: 44px; height: 44px; left: -6px; top: 6px; }
.coach--hire .coach__ring { left: -32px; top: -32px; width: 64px; height: 64px; border-color: var(--gold-200); }
[data-act="buyHero:0"]:has(> .coach) { position: relative; overflow: visible; }
.coach--dial svg { width: 44px; height: 44px; left: -6px; top: 6px; }
.coach--dial .coach__ring { left: -30px; top: -30px; width: 60px; height: 60px; border-color: var(--gold-200); }
.coach--next .coach__ring { left: -36px; top: -36px; width: 72px; height: 72px; border-color: var(--gold-200); }
@keyframes coach-press { 0%, 100% { transform: translate(10px, 12px) rotate(-8deg); } 45% { transform: translate(0, 0) rotate(-8deg) scale(.92); } 60% { transform: translate(0, 0) rotate(-8deg) scale(.92); } }
@keyframes coach-ring { 0%, 40% { transform: scale(.4); opacity: 0; } 50% { transform: scale(.55); opacity: .95; } 100% { transform: scale(1.25); opacity: 0; } }
.reduce-motion .coach svg, .reduce-motion .coach__ring { animation: none; }
.reduce-motion .coach__ring { opacity: .9; transform: none; }
@media (prefers-reduced-motion: reduce) { .coach svg, .coach__ring { animation: none; } .coach__ring { opacity: .9; } }

/* a system's first moment: its picture pops over the fight and flies to its tab, which glows once */
.arrive { position: fixed; z-index: 70; width: 72px; height: 72px; display: grid; place-items: center; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, var(--iron-600), var(--iron-900) 72%); border: 3px solid var(--gold-300); box-shadow: 0 0 0 3px var(--gold-900), var(--ledge); }
.arrive img, .arrive svg { width: 70%; height: 70%; object-fit: contain; }
.arrive img.px { image-rendering: pixelated; }
.arrived { animation: arrived 1.4s ease-out; }
@keyframes arrived { 0% { box-shadow: inset 0 0 0 3px var(--gold-300), 0 0 0 0 rgba(255, 211, 92, .9); } 60% { box-shadow: inset 0 0 0 3px var(--gold-300), 0 0 0 10px rgba(255, 211, 92, 0); } 100% { box-shadow: inset 0 0 0 0 var(--gold-300), 0 0 0 0 rgba(255, 211, 92, 0); } }
.reduce-motion .arrived { animation: none; box-shadow: inset 0 0 0 3px var(--gold-300); }

/* specials before all six are unlocked: the ones there are, and the next, side by side */
.dials--few { justify-content: center; gap: 14px; }

/* ================================================================== Round 8: the Voyage, the stars and Steady March */
/* the hero list is virtual (ui.js): only rows near the view are in the page, padding stands in for the rest, and
   every row keeps one height (the next hire keeps the room of the milestone pips it does not show) */
.list--virtual > .unit { content-visibility: visible; contain-intrinsic-size: none; }
/* (the global [hidden] rule is !important, so the pips' room is kept with !important too: without it the hire row stood
   8 px shorter than the rest and the list's height jumped as it scrolled into the window) */
.list--virtual > .unit .ms[hidden] { display: flex !important; visibility: hidden; }

/* Steady March: under the party rate, a ring around the banner filling to the next half step, and the multiplier */
.march { grid-column: 2 / span 2; justify-self: end; position: relative; display: inline-flex; align-items: center; gap: 4px; height: 26px; margin-top: 4px; padding: 0 8px 0 2px;
  border-radius: 13px; background: rgba(22, 18, 14, .78); border: 1px solid var(--iron-600); }
.march__ring { --rs: 22px; --rw: 3px; --ri: var(--iron-900); --rc: var(--blood-400); background: conic-gradient(var(--rc) calc(var(--p) * 360deg), var(--iron-700) 0); }
.march__ring img { width: 14px; height: 14px; object-fit: contain; }
.march__x { font-size: 15px; color: #ffd0b8; }
.march--idle .march__x { color: var(--iron-300); }
.march__crack { position: absolute; inset: 0; width: 100%; height: 100%; display: none; fill: none; stroke: var(--parch-50); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 1px 0 #000); }
.march--crack { border-color: var(--blood-400); animation: march-crack 560ms ease-out; }
.march--crack .march__crack { display: block; }
.march--crack .march__x { text-decoration: line-through; text-decoration-thickness: 2px; }
.march--up { animation: march-up 520ms ease-out; }
@keyframes march-crack { 0%, 100% { transform: none; } 15% { transform: translateX(-4px) rotate(-3deg); } 35% { transform: translateX(4px) rotate(3deg); } 55% { transform: translateX(-2px) rotate(-1deg); } 75% { transform: translateX(1px); } }
@keyframes march-up { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }
.reduce-motion .march--crack, .reduce-motion .march--up { animation: none; }
@media (prefers-reduced-motion: reduce) { .march--crack, .march--up { animation: none; } }
@media (min-width: 1700px) and (min-aspect-ratio: 1/1) { .march { height: 32px; } .march__ring { --rs: 28px; } .march__ring img { width: 18px; height: 18px; } .march__x { font-size: 18px; } }

/* Welcome back: badges on the gold figure (the march it was paid at, a trial that ended) */
.offbadge { position: absolute; top: 10px; display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 9px 0 5px; border-radius: 15px; font: 800 15px var(--font-num); border: 2px solid var(--ink); box-shadow: var(--ledge); }
.offbadge img, .offbadge svg { width: 20px; height: 20px; object-fit: contain; }
.offbadge--march { right: 10px; background: var(--gold-200); color: var(--gold-900); }
.offbadge--trial { left: 10px; background: var(--iron-800); color: var(--parch-100); border-color: var(--iron-600); font: 700 13px var(--font-ui); }

/* the Set sail panel */
.voybox { overflow: hidden; }
.voybox [data-shipbox] { display: contents; }
.voybox [data-shipbox] > img.art { width: 230px; height: 170px; object-fit: contain; }
/* desktops and tablets on their side: the ship (framed tight in ui.js) gets the room the column has */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 541px) {
  .voybox [data-shipbox] > img.art, .voybox > img.art--lg { width: 280px; height: 220px; }
}
/* landscape phones: the ship at the left and the offer, its bar and the trip at the right, so the plate is half as
   tall and the voyage count, the fate rows and Stars come into view without scrolling far */
@media (orientation: landscape) and (max-height: 540px) {
  .voybox { grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; padding: 8px 12px; }
  .voybox [data-shipbox] > img.art, .voybox > img.art--lg { grid-column: 1; grid-row: 1 / span 3; width: 104px; height: 104px; }
  .voybox > :not([data-shipbox]):not(img) { grid-column: 2; }
  .voybox__fig .goldtext { font-size: 40px; }
  .voybar { width: 100%; }
  .voybox__trip { margin-top: 2px; }
  .voypills { margin-top: 6px; }
  .voybox ~ .fate { margin-top: 6px; }
  .voyask .goldtext { font-size: 36px; }
}
.voybox__fig { display: inline-flex; align-items: center; gap: 6px; }
.voybox__fig .goldtext { font-size: 56px; line-height: 1; }
.voybox__frag { width: 40px; height: 40px; object-fit: contain; }
.voybox__up { animation: voy-up 600ms ease-out; }
@keyframes voy-up { 0% { transform: scale(1); } 30% { transform: scale(1.22); } 100% { transform: scale(1); } }
.reduce-motion .voybox__up { animation: none; }
.voybar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; width: min(240px, 80%); margin-top: 4px; }
.voybar .share__bar { background: var(--iron-800); box-shadow: inset 0 1px 0 rgba(0, 0, 0, .4); }
.voybar .num { font-size: 13px; color: var(--gold-200); }
.voybox__trip { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.voypills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.voypills .pill { height: 30px; font-size: 15px; }
.voypills img, .voypills svg { width: 20px; height: 20px; object-fit: contain; }
.chipicon__pct { position: absolute; left: -6px; top: -8px; padding: 0 4px; border-radius: 4px; background: var(--ok); color: #fff; font-size: 11px; line-height: 16px; }
.voystars { gap: 8px; min-height: 44px; margin-left: auto; }
.voystars img { width: 34px; height: 34px; object-fit: contain; }
/* the hint under the offer's bar: the essence for one more and, while the offer is small, "Grows fast"; a popover */
.voyhint { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 4px 6px; margin-top: 2px; border-radius: var(--r-2); background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.voyhint .pill { height: 28px; }
.voyhint .pill svg { width: 16px; height: 16px; }
/* what fragments buy: a tile a constellation on the chart's navy, a check badge on the ones the offer pays for */
.voybuys { margin-top: 12px; }
.voybuys__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 8px; }
.voybuys__t { font-weight: 700; font-size: 14px; flex: 1 0 100%; }
.voybuys__key { height: 28px; }
.voybuys__chk, .voyc__ok { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ok); color: #fff; }
.voybuys__chk svg { width: 12px; height: 12px; }
.voybuys__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; margin: 0; padding: 6px; list-style: none; border-radius: var(--r-3); background: radial-gradient(ellipse at 50% 0%, #22324d, #0f1828 80%); }
.voyc { position: relative; }
.voyc__b { display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-areas: "icon name" "icon lv" "fx fx" "cost cost"; align-items: center; gap: 2px 6px; width: 100%; min-height: 44px; padding: 6px; border-radius: var(--r-2); border: 1px solid rgba(180, 200, 230, .16); background: rgba(255, 255, 255, .03); color: var(--parch-100); text-align: left; font: inherit; cursor: pointer; }
.voyc--ok .voyc__b { border: 2px solid var(--gold-400); }
.voyc__icon { grid-area: icon; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #3a4c6a, #121c2c 72%); }
.voyc__icon img, .voyc__icon svg { width: 22px; height: 22px; object-fit: contain; }
.voyc--off .voyc__icon img { opacity: .6; }
.voyc__name { grid-area: name; font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.voyc__lv { grid-area: lv; font-size: 12px; color: var(--iron-300); }
.voyc__fx { grid-area: fx; justify-self: start; height: 22px; background: #24334c; color: var(--gold-200); border: 1px solid #3c4d6a; font-size: 12px; }
.voyc__fx small { font: 600 11px var(--font-ui); color: var(--iron-300); margin-left: 2px; }
.voyc__cost { grid-area: cost; justify-self: start; height: 22px; font-size: 12px; }
.voyc__ok { position: absolute; left: 24px; top: 24px; width: 20px; height: 20px; border: 2px solid var(--ink); }
.voyc__ok svg { width: 12px; height: 12px; }
.fatec { display: inline-grid; justify-items: center; gap: 4px; min-width: 46px; }
.fatec__w { font-size: 11px; font-weight: 600; line-height: 1.1; text-align: center; max-width: 72px; }
.fate__icons { row-gap: 10px; }
.voystars .pill img { width: 18px; height: 18px; }
.voyask { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: var(--r-3); background: radial-gradient(ellipse at 50% 30%, var(--iron-600), var(--iron-950) 75%); }
.voyask .goldtext { font-size: 44px; line-height: 1; }
.voyask__frag { width: 36px; height: 36px; object-fit: contain; }
.voyfade { position: absolute; inset: 0; z-index: 60; background: #0d1626; pointer-events: none; opacity: 0; }

/* landfall: what the voyage brought, in the middle of the fight at stage 1 */
.landfall { position: absolute; left: 50%; top: 58%; z-index: 6; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; padding: 12px 18px; border-radius: var(--r-3);
  background: rgba(13, 22, 38, .86); border: 2px solid var(--gold-600); box-shadow: var(--ledge); pointer-events: none; }
.landfall__row { display: inline-flex; align-items: center; gap: 6px; }
.landfall__row img, .landfall__row svg { width: 30px; height: 30px; object-fit: contain; }
.landfall .goldtext { font-size: 38px; line-height: 1; }

/* the constellations: one dark sky (navy, as on the quay), a figure per constellation whose stars light level by
   level. A lit star is filled and solid, an unlit one a dashed outline, so shape carries the state, not color. */
.starsky { display: grid; gap: 0; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); margin: 0; padding: 4px; list-style: none; border-radius: var(--r-3);
  background: radial-gradient(ellipse at 50% 0%, #2a3a55, #16263c 55%, #0e1726); border: 2px solid var(--ink); }
.const { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "sky sky" "name fx" "buy buy"; align-items: center; gap: 4px 6px; padding: 8px; border: 1px solid rgba(180, 200, 230, .12); border-radius: var(--r-2); }
.const__sky { grid-area: sky; position: relative; display: block; width: 100%; min-height: 44px; border-radius: var(--r-2); }
.const__fig { display: block; margin-left: 30px; }
.const__fig .fig { display: block; width: 100%; height: auto; aspect-ratio: 100 / 64; overflow: visible; }
.fig line { stroke: #3c4d6a; stroke-width: 1.2; stroke-dasharray: 2.5 2.5; }
.fig line.on { stroke: #cfb67e; stroke-width: 1.6; stroke-dasharray: none; }
.fig .st path, .fig .st__ring { transform-box: fill-box; transform-origin: center; }
.fig .st path { fill: none; stroke: #6f82a3; stroke-width: 1; stroke-dasharray: 1.6 1.2; }
.fig .st--on path { fill: #ffe9a3; stroke: #3a2402; stroke-width: 1; stroke-dasharray: none; transform: scale(1.35); }
.fig .st--new path { animation: star-lit 700ms cubic-bezier(.2, .7, .3, 1.3); }
.fig .st__ring { fill: none; stroke: #ffe9a3; stroke-width: 1.2; opacity: 0; animation: star-ring 800ms ease-out; }
@keyframes star-lit { 0% { transform: scale(.3); } 55% { transform: scale(2); } 100% { transform: scale(1.35); } }
@keyframes star-ring { 0% { transform: scale(.4); opacity: .95; } 100% { transform: scale(2.4); opacity: 0; } }
.reduce-motion .fig .st--new path, .reduce-motion .fig .st__ring { animation: none; }
@media (prefers-reduced-motion: reduce) { .fig .st--new path, .fig .st__ring { animation: none; } }
.const__icon { position: absolute; left: 0; top: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #3a4c6a, #121c2c 72%); border: 2px solid var(--ink); }
.const__art { display: grid; place-items: center; }
.const__art img, .const__art svg { width: 26px; height: 26px; object-fit: contain; }
.const__icon .lv { bottom: -10px; min-width: 24px; height: 18px; font-size: 12px; line-height: 18px; }
.const__name { grid-area: name; font-weight: 700; font-size: 13px; color: var(--parch-100); white-space: nowrap; overflow: hidden; }
.const__fx { grid-area: fx; background: #24334c; color: var(--gold-200); border: 1px solid #3c4d6a; }
.const__fx small { font: 600 11px var(--font-ui); color: var(--iron-300); }
.const > .buy { grid-area: buy; width: 100%; min-height: 48px; }
.const > .const__max { grid-area: buy; justify-self: center; height: 32px; }
.const--off .const__art img { filter: grayscale(1) brightness(.6); }
.const--off .const__fx { opacity: .75; }
.const--full .const__icon { border-color: var(--gold-400); }
.fragpill img, .fragpill svg { width: 20px; height: 20px; object-fit: contain; }
/* landscape phones: lower figures and a shorter buy, so a row of constellations fits the short sheet */
@media (orientation: landscape) and (max-height: 540px) {
  .starsky { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); }
  .const { padding: 6px; gap: 2px 6px; }
  .const__fig .fig { height: 58px; }
  .const > .buy { min-height: var(--touch); }
  .const > .const__max { height: 28px; }
}
.buy--frag .buy__cost img { image-rendering: pixelated; }
/* with the march chip under the rates, the foe plate steps down a row where the fight is narrow (phones, either way
   up, and a dual screen's first half), so a long foe name or the health bar never runs under the chip */
.fight--march .foe { translate: 0 22px; }
@media (min-width: 600px) and (orientation: portrait) { .fight--march .foe { translate: none; } }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 541px) { .fight--march .foe { translate: none; } }
@media (horizontal-viewport-segments: 2) { .fight--march .foe { translate: 0 22px; } }

/* What's new: a dot on the More tile while something is unread; the list grouped by date, each item a bold title
   over its note */
.tab__badge--dot { min-width: 14px; width: 14px; height: 14px; padding: 0; }
.linkbtn { display: inline-flex; align-items: center; min-height: var(--touch); margin-top: 4px; padding: 0; color: var(--ink-soft); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.news + .news { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--parch-300); }
.news__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.news__head .pill { height: 26px; font-size: 13px; }
.news__title { margin: 0; font-size: 16px; font-weight: 700; }
.news__items { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.news__items li { display: grid; gap: 1px; }
.news__items b { font-size: 14px; }
.news__items span { font-size: 13px; color: var(--ink-soft); line-height: 1.35; }

/* the Relics head with the Relics / Stars switch and the amount buttons: where the sheet is narrow (phones either way
   up, the desktop column) the switch keeps its pictures only and the essence figure stays, smaller (it is what the
   relics are bought with, so it never leaves this head) */
.sheet__head { container-type: inline-size; }
@container (max-width: 540px) { .summary .seg--fit .seg__w { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .summary .seg ~ .summary__ess { font-size: 17px; } .summary .seg ~ .summary__ess svg { width: 17px; height: 17px; } }
/* a list narrower than any layout sizes it for (a safe area or a screen segment that takes more than planned) keeps
   each row's name and damage readable: the landscape phone's smaller portrait and buy button */
.sheet__body { container-type: inline-size; }
@container (max-width: 330px) { .unit { --portrait: 52px; gap: 8px; padding: 6px; } .unit > .buy { width: 92px; min-height: 50px; } }

/* Round 9: hero ranks. Chevrons on the portrait's top right (one to four, stacked: the count is the shape), an ink
   plate with a parchment rim; jade rim from Legend with the Legend count beside it; a dashed rim while a rank earned
   this run waits for the next run to count */
.rankslot { display: contents; }
.rank { position: absolute; top: -6px; right: -6px; z-index: 1; display: grid; justify-items: center; gap: 1px; min-width: 20px; padding: 3px 3px 2px; border-radius: 5px; background: var(--ink); border: 2px solid var(--parch-50); color: var(--gold-300); }
.rank svg { display: block; width: 12px; height: auto; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.rank b { font: 800 10px/1 var(--font-num); color: var(--jade-300); }
.rank--legend { border-color: var(--jade-500); color: var(--jade-300); box-shadow: 0 0 0 1px var(--jade-800); }
.rank--next { border-style: dashed; border-color: var(--gold-300); }
.rank--legend.rank--next { border-color: var(--jade-300); }
.rank--inline { position: static; display: inline-grid; padding: 0; min-width: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--gold-600); }
.pill--iron .rank--inline { color: var(--gold-300); }
.rank--inline svg { width: 13px; stroke-width: 2.6; }
.rankpill { gap: 5px; }
.summary .rankpill--head { margin-left: auto; height: 30px; padding: 0 10px 0 6px; font-size: 15px; }
.summary .seg ~ .rankpill--head { margin-left: 8px; }
/* the rank ladder in a hero's popover: four rungs, each the look that rank brings over its level target */
.rladder__head { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.rladder__head .lbl { font-size: 12px; font-weight: 700; color: var(--iron-300); }
.rladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.rrung { position: relative; display: grid; justify-items: center; gap: 3px; padding: 6px 2px 5px; border-radius: 6px; background: var(--iron-800); border: 2px solid var(--iron-700); }
.rrung__pic { position: relative; width: 52px; height: 52px; border-radius: 6px; background: radial-gradient(circle at 50% 35%, var(--iron-600), var(--iron-950) 75%); }
.rrung__pic img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 5px; }
.rrung:not(.rrung--got):not(.rrung--next) .rrung__pic img { filter: brightness(0) opacity(.6); }
.rrung__b { position: absolute; right: -6px; bottom: -6px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--gold-300); color: var(--gold-900); border: 2px solid var(--iron-900); }
.rrung__b svg { width: 11px; height: 11px; }
.rrung .rank--rung { position: static; padding: 1px 3px; border-width: 1px; }
.rrung .rank--rung svg { width: 10px; }
.rrung__lv { font-size: 11px; color: var(--iron-300); white-space: nowrap; }
.rrung--got { background: var(--gold-800); border-color: var(--gold-400); }
.rrung--got .rrung__lv { color: var(--gold-200); }
.rrung--next { border-style: dashed; border-color: var(--gold-300); }
.rrung--next .rrung__b { background: var(--iron-950); color: var(--gold-300); border-color: var(--gold-300); }
.rrung--next .rrung__lv { color: var(--gold-200); font-family: var(--font-ui); font-weight: 700; }
/* the rank-up toast: the new look with its chevrons */
.toast > span.toastrank { display: inline-flex; align-items: center; gap: 5px; flex: none; overflow: visible; }
.toastrank > img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: top; image-rendering: auto; background: radial-gradient(circle at 50% 35%, var(--iron-600), var(--iron-950) 75%); }
.toastrank .rank { position: static; padding: 2px 2px 1px; min-width: 16px; border-width: 1px; }
.toast .toastrank .rank svg { width: 10px; height: auto; }
.toast .rankpend svg { width: 16px; height: 16px; }
/* the collection log's heroes page */
.herotile .tile__art img.full { border-radius: 50%; object-fit: cover; object-position: top; }
.herotile .tile__art .rank { top: -4px; right: -8px; }
.herotile[disabled] { cursor: default; }
.statrank { display: grid; place-items: center; width: 36px; height: 36px; }
.statrank .rank--inline { padding: 3px 4px; }
.statrank .rank--inline svg { width: 16px; }
/* the Tide's drawn wave (the export has no picture for it yet) */
.tideart { overflow: visible; }
.tideart__sea { fill: #2f6d9a; }
.tideart__crest { fill: #cfe6f2; stroke: #1b3c57; stroke-width: 1.4; stroke-linejoin: round; }
.tideart__line { fill: none; stroke: #cfe6f2; stroke-width: 1.6; stroke-linecap: round; }
/* a popover taller than the room above or below its row (a hero's rank ladder on a landscape phone) scrolls inside */
.pop--scroll { overflow-y: auto; overscroll-behavior: contain; }
.pop--scroll::after { display: none; }

/* ================================================================== fit on every screen */
/* the foe plate steps in from the next-upgrade ring's column when it would reach down beside the ring (ui.js measures
   both; render.js frames the foe under the plate) */
.foe.foe--narrow { width: min(calc(100% - 2 * (var(--next-w, 76px) + var(--gutter) + 6px)), 420px); }

/* before the first special: the specials bar is one slim row, the locked dial small with its level beside it, so the
   fight and the sheet keep the room (the landscape phone keeps its column) */
@media (orientation: portrait), (min-height: 541px) {
  .specials--few { padding-top: 5px; padding-bottom: 5px; }
  .specials--few .dials { justify-content: center; padding-right: 44px; }
  .specials--few .dial { width: var(--touch); height: var(--touch); }
  .specials--few .dial .lock { width: 16px; height: 16px; }
  .specials--few .dial__t { left: calc(100% + 6px); bottom: 50%; transform: translateY(50%); }
}

.list.ghosts { display: none; margin-top: 8px; }
/* the sheet folds away: the active tab's chevron says which way it goes (a press on the active tab, or Enter, folds or
   opens it). Folded, the stacked layout keeps only the tab bar and the side layouts a rail of tab icons; the fight
   takes the room and frames itself again. */
.tab__fold { position: absolute; top: 5px; right: 6px; width: 12px; height: 12px; display: none; color: var(--gold-200); transform: rotate(180deg); }
.tab[aria-selected="true"] .tab__fold { display: block; }
.game--sheet-off .tab__fold { transform: none; }
.game--sheet-off .sheet__main { display: none; }
.game--sheet-off .tab[aria-selected="true"] { color: var(--parch-100); background: none; box-shadow: none; }
@media (orientation: landscape) and (max-height: 540px), (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 541px) {
  .tab__fold { transform: rotate(90deg); }
  .game--sheet-off .tab__fold { transform: rotate(-90deg); }
  .game--sheet-off .sheet { background: var(--iron-900); }
  .game--sheet-off .tabs { grid-auto-flow: row; grid-auto-columns: auto; grid-auto-rows: max-content; align-content: start; flex: 1; border-bottom: 0; }
  .game--sheet-off .tab { padding: 8px 6px; }
  /* the next locked heroes stand in the column as silhouettes, so an early sheet is not an empty page */
  .list.ghosts { display: grid; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .game--sheet-off { grid-template-columns: auto minmax(0, 1fr) calc(var(--sa-r) + 60px); }
  .game--sheet-off .tabs { padding: var(--sa-t) var(--sa-r) var(--sa-b) 0; }
}
@media (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 541px) {
  .game--sheet-off { grid-template-columns: minmax(0, 1fr) calc(88px + var(--sa-r)); }
  .game--sheet-off .tab { min-height: 72px; }
}

/* the silhouettes: a dashed row each, the portrait blacked out, a blank bar for the name and an empty slot for the buy */
.unit--ghost { background: transparent; border: 2px dashed var(--parch-300); box-shadow: none; }
.unit--ghost .portrait { border-color: var(--parch-400); }
.unit--ghost .portrait > img { filter: brightness(0) opacity(.45); }
.ghost__bar { display: block; height: 12px; width: 62%; border-radius: 6px; background: var(--parch-200); }
.ghost__bar + .ghost__bar { width: 38%; height: 8px; }
.ghost__slot { width: 104px; min-height: 56px; border-radius: var(--r-2); border: 2px dashed var(--parch-300); }
@media (orientation: landscape) and (max-height: 540px) { .ghost__slot { width: 86px; min-height: 50px; } }

/* ================================================================== Round 10: the Kennel */
/* forms by shape and stars (an egg, a paw, a crown; one to three stars), the plate's color only as a second hint */
.fbadge { position: absolute; left: -7px; top: -7px; z-index: 2; display: grid; justify-items: center; gap: 0; width: 28px; padding: 3px 0 2px; border-radius: 7px; background: var(--ink); border: 2px solid var(--iron-950); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.fbadge > svg { width: 16px; height: 16px; }
.fbadge__stars { display: flex; justify-content: center; gap: 0; height: 7px; }
.fbadge__stars svg { width: 7px; height: 7px; }
.fbadge--f0 { color: var(--parch-200); }
.fbadge--f1 { color: var(--gold-300); }
.fbadge--f2 { color: var(--jade-300); border-color: var(--jade-800); }
.fbadge--inline { position: static; display: inline-grid; width: 20px; padding: 1px 0; border-width: 1px; border-radius: 5px; box-shadow: none; }
.fbadge--inline > svg { width: 12px; height: 12px; }
.fbadge--inline .fbadge__stars { height: 5px; }
.fbadge--inline .fbadge__stars svg { width: 5px; height: 5px; }
.kformpill { gap: 5px; padding-left: 3px; }

/* the bond ring: a ring around a pet's art plate that fills toward the next form; full and jade at Elder */
.bondring { position: absolute; inset: -7px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--gold-400) calc(var(--p, 0) * 360deg), var(--iron-700) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); }
.bondring--max { background: var(--jade-500); }
.ktile .tile__art { margin: 6px 0 10px; }
.ktile .tile__art > img.full { position: relative; }
.kgrid { --tile: 120px; }
.kennel h3.sec { margin: 4px 0 -2px; }
.kennel h3.sec > svg { width: 20px; height: 20px; color: var(--gold-600); }
.kennel h3.sec .pill { margin-left: 2px; }
.knote { margin: -4px 0 0; font-size: 13px; color: var(--ink-soft); line-height: 1.35; }
.kgrid .tile--on { padding-top: 26px; }
.kgrid .ribbon svg { width: 13px; height: 13px; color: var(--gold-300); }
/* a pet found since it was last opened: a gold New ribbon and a gold frame */
.ktile--new { border-color: var(--gold-500); box-shadow: 0 0 0 2px var(--gold-300); }
.ktile--new .ribbon { background: var(--gold-300); color: var(--ink); }
.kbadge__in { left: -4px; top: -4px; transform: scale(.85); }

/* the head: the kennel prop with the walk slots in front of it */
.kennel { display: grid; gap: 10px; }
.khead { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px; padding: 10px 8px 10px 4px; border-radius: var(--r-3); background: radial-gradient(ellipse at 22% 45%, var(--iron-600), var(--iron-950) 72%); color: var(--parch-100); }
.khead__prop { width: 84px; height: 84px; object-fit: contain; }
.kslots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.kslot { display: grid; min-width: 0; }
.kslot__in { display: grid; justify-items: center; align-content: start; gap: 8px; min-width: 0; }
.kslot__pic { --ks: 72px; position: relative; width: var(--ks); height: var(--ks); margin-top: 7px; border-radius: 50%; display: grid; place-items: center; }
.kslot__art { position: relative; width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 40%, var(--iron-600), var(--iron-900) 72%); border: 2px solid var(--ink); }
.kslot__art img { width: 94%; height: 94%; object-fit: contain; }
.kslot__art > svg { width: 44%; height: 44%; }
.kslot__badge .fbadge { left: -9px; top: -9px; }
.kslot__n { position: absolute; right: -6px; bottom: -6px; z-index: 2; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--gold-200); color: var(--gold-900); border: 2px solid var(--ink); font-size: 13px; line-height: 18px; text-align: center; }
.kslot--free .kslot__art { background: none; border: 2px dashed var(--iron-400); color: var(--iron-400); }
.kslot--free .kslot__n { background: var(--iron-800); color: var(--parch-100); border-color: var(--iron-400); }
.kslot--lock .kslot__art { background: var(--iron-900); border: 2px dashed var(--iron-600); }
.kslot__lbl { display: inline-flex; align-items: center; gap: 3px; min-height: 44px; font: 700 13px var(--font-ui); color: var(--iron-300); }
.kslot__lbl svg { width: 15px; height: 15px; color: var(--parch-300); }
.kfeed { min-height: 44px; width: 100%; max-width: 104px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 8px; border-radius: var(--r-2); font: 700 14px var(--font-ui);
  background: linear-gradient(var(--gold-300), var(--gold-400)); color: var(--gold-900); border: 2px solid var(--gold-900); box-shadow: var(--ledge); }
.kfeed img { width: 26px; height: 24px; object-fit: contain; image-rendering: pixelated; }
.kfeed--tile { display: flex; width: 100%; max-width: none; margin-top: 6px; }
.kfeed--tile[hidden] { display: none; }
.kfeed[aria-disabled="true"] { background: var(--iron-800); color: var(--iron-300); border: 2px dashed var(--iron-600); box-shadow: none; cursor: default; }
.kfeed[aria-disabled="true"] img { filter: grayscale(1) brightness(.6); }
.summary__lbl { font: 800 17px var(--font-num); color: var(--ink); }
.treatpill { margin-left: auto; height: 32px; font-size: 16px; }
.treatpill img { width: 26px; height: 24px; object-fit: contain; image-rendering: pixelated; }
.treatpill--none { background: var(--parch-200); color: var(--ink-soft); }
@media (min-width: 600px) and (orientation: portrait), (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 541px) {
  .khead__prop { width: 112px; height: 112px; }
  .kslot__pic { --ks: 88px; }
  .kslots { gap: 10px; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .khead { padding: 6px 6px 6px 2px; }
  .khead__prop { width: 56px; height: 56px; }
  .kslot__pic { --ks: 60px; }
  .kslot__in { gap: 6px; }
}
@media (max-width: 379px) {
  .khead__prop { width: 64px; height: 64px; }
  .kslot__pic { --ks: 64px; }
}
/* the head sizes to its own width, whatever the screen: the prop and three slots always fit (a 400 px desktop sheet
   had 112 + 3 x 88 and pushed the third slot out) */
.khead { container-type: inline-size; }
@supports (width: 1cqi) {
  .khead__prop { width: min(var(--kp, 112px), 26cqi); height: min(var(--kp, 112px), 26cqi); }
  .kslot__pic { --ks: min(88px, 21cqi) !important; }
}

/* the pet popover: three forms side by side, the bond bar, the ability, Walk and Feed */
.kforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 10px 0 4px; padding: 0; list-style: none; }
.kform { position: relative; display: grid; justify-items: center; gap: 4px; padding: 8px 2px 4px; border-radius: var(--r-2); background: var(--iron-850); border: 2px dashed var(--iron-600); }
.kform--got { border-style: solid; border-color: var(--iron-600); }
.kform--now { border-color: var(--gold-400); box-shadow: inset 0 0 0 1px var(--gold-600); }
.kform__pic { width: 64px; height: 64px; display: grid; place-items: center; }
.kform__pic img { width: 100%; height: 100%; object-fit: contain; }
.kform:not(.kform--got) .kform__pic img { filter: brightness(0) opacity(.6); }
.kform .fbadge { left: 4px; top: 4px; }
.kform__lv { font-size: 12px; color: var(--parch-100); }
.kform:not(.kform--got) .kform__lv { color: var(--iron-300); }
.kbond { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 8px 0 4px; }
.kbond__bar { position: relative; height: 10px; border-radius: 5px; background: var(--iron-700); overflow: hidden; }
.kbond__bar i { position: absolute; inset: 0; width: calc(var(--p, 0) * 100%); background: var(--gold-400); }
.kbond--max .kbond__bar i { background: var(--jade-500); }
.kbond__t { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--parch-100); }
.kbond__t svg { width: 14px; height: 14px; color: var(--jade-300); }
.kab { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 8px; border-radius: var(--r-2); background: var(--iron-850); font-size: 13px; color: var(--parch-100); }
.kab__g { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--iron-950); border: 2px solid var(--gold-600); }
.kab__g svg { width: 20px; height: 20px; }
.kab--off { color: var(--iron-300); }
.kab--off .kab__g { border-style: dashed; border-color: var(--iron-600); }
.kab__lock { gap: 3px; }
.kacts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.kacts .btn { width: 100%; }
.kacts .btn img { width: 26px; height: 24px; object-fit: contain; image-rendering: pixelated; }
.kacts .btn[aria-disabled="true"] { opacity: .55; cursor: default; }
.kfeed__n { margin-left: 2px; padding: 0 5px; border-radius: 8px; background: rgba(0, 0, 0, .2); font-size: 13px; }

/* the slot picker: which walking pet makes room (Cancel is the safe answer) */
.kpick__new { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px; font-weight: 700; color: var(--ink); }
.kpick__new img { width: 56px; height: 56px; object-fit: contain; }
.kpick__new > svg { width: 22px; height: 22px; color: var(--ink-soft); }
.kpick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.kpick__slot { width: 100%; min-height: 128px; display: grid; justify-items: center; align-content: start; gap: 6px; padding: 12px 4px 8px; border-radius: var(--r-2); background: var(--parch-50); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); color: var(--ink); }
.kpick__pic { position: relative; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, var(--iron-600), var(--iron-900) 72%); border: 2px solid var(--ink); }
.kpick__pic img { width: 94%; height: 94%; object-fit: contain; }
.kpick__name { font-weight: 700; font-size: 13px; line-height: 1.15; text-align: center; }

/* the fight: an ability's glyph pops over its pet and rises away; the pet buffs as ring chips on jade */
.petglyph { position: absolute; z-index: 2; left: 0; top: 0; pointer-events: none; translate: -50% -50%; animation: petglyph 1300ms cubic-bezier(.2, .7, .3, 1) both; }
.petglyph__b { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--iron-900); border: 2px solid var(--gold-400); box-shadow: 0 0 0 2px var(--iron-950), var(--ledge); }
.petglyph__b svg { width: 26px; height: 26px; }
@keyframes petglyph { 0% { transform: translateY(8px) scale(.4); opacity: 0; } 18% { transform: translateY(0) scale(1.15); opacity: 1; } 30% { transform: scale(1); } 75% { opacity: 1; } 100% { transform: translateY(-30px); opacity: 0; } }
@keyframes petglyph-still { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.reduce-motion .petglyph { animation-name: petglyph-still; }
@media (prefers-reduced-motion: reduce) { .petglyph { animation-name: petglyph-still; } }
.buff--pet { background: conic-gradient(var(--jade-500) calc(var(--p) * 360deg), var(--iron-700) 0); }
.buff--pet svg { position: relative; width: 22px; height: 22px; }
.buff--held { background: var(--jade-800); box-shadow: inset 0 0 0 2px var(--jade-500); }

/* welcome back: the walking pets' bond while away */
.offline__bond { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 6px 8px; border-radius: var(--r-2); background: var(--parch-100); }
.offline__pets { display: flex; gap: 10px; }
.offline__pet { position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, var(--iron-600), var(--iron-900) 72%); border: 2px solid var(--ink); }
.offline__pet img { width: 92%; height: 92%; object-fit: contain; }
.offline__pet .fbadge { transform: scale(.75); left: -10px; top: -10px; }
.offline__bond .pill { height: 32px; font-size: 15px; margin-left: auto; }
.offline__bond .pill svg { width: 16px; height: 16px; color: var(--gold-300); }

/* ================================================================== Round 11: the Camp */
/* the fight in the camp: no foe, so no plate, no clue on the floor and no next-upgrade ring; the boosts (the feast
   among them), the HUD and the gold stay */
.fight--camp .foe, .fight--camp .drop, .fight--camp .next, .fight--camp .coach { display: none; }
/* the feast as a ring chip beside the boosts: the feast item on an ember ring (the item says what it is) */
.buff--feast { background: conic-gradient(var(--ember-500) calc(var(--p) * 360deg), var(--iron-700) 0); }
/* the More tile's ring of the camp time the last return paid; a check when that return filled the limit */
.campring.ring--done svg { color: var(--ok); width: 18px; height: 18px; }
h3.sec > img { width: 22px; height: 22px; object-fit: contain; }

/* the three skill cards on the dark plate the panel opens with */
.campbox { padding: 12px 8px 12px; }
.cskills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; margin: 0; padding: 0; list-style: none; }
.cskill { display: grid; justify-items: center; align-content: start; gap: 5px; min-width: 0; text-align: center; }
.cskill__hand { position: relative; display: grid; place-items: center; min-width: var(--touch); min-height: var(--touch); padding-bottom: 8px; }
.cskill__ring { --rs: 78px; --rw: 5px; --ri: var(--iron-900); }
.cskill__ring.ring--done { --rc: var(--gold-300); }
.cskill__bust { width: 66px; height: 66px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, var(--iron-600), var(--iron-900) 75%); }
.cskill__bust > img.bust { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cskill__bust > img.px { width: 38px; height: 38px; }
.cskill__hand .lv { bottom: -2px; font-size: 14px; background: var(--gold-300); color: var(--gold-900); border: 2px solid var(--gold-900); height: 22px; line-height: 18px; }
.cskill__name { font: 700 13px var(--font-ui); color: var(--parch-100); }
.cskill__stock { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; }
.cskill__stock img { width: 24px; height: 24px; object-fit: contain; flex: none; }
.cskill__stock .goldtext { font-size: 20px; line-height: 1; white-space: nowrap; }
/* (a narrow side sheet never grows past its column for the figures in the cards) */
.panel--camp { min-width: 0; }
.panel--camp .panel__body { overflow-x: hidden; }
.campbox .cskill__rate { height: 22px; font-size: 12px; padding: 0 7px; }
.cskill__tools { display: inline-flex; align-items: center; gap: 2px; }
.cskill__tool { position: relative; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-2); background: var(--iron-800); border: 1px solid var(--iron-600); }
.cskill__tool img { width: 26px; height: 26px; object-fit: contain; }
.cskill__tool--next { border-style: dashed; }
.cskill__tool--next img { filter: grayscale(.6) brightness(.7); }
.cskill__tool--next .num { position: absolute; right: -6px; bottom: -6px; min-width: 18px; height: 16px; padding: 0 3px; border-radius: 3px; background: var(--iron-950); color: var(--parch-100); font-size: 10px; line-height: 16px; }
.cskill__arrow { width: 10px; height: 10px; color: var(--iron-300); transform: rotate(90deg); }

/* the Forge: a tile per style, the style's glyph with its temper level, the multiplier, an ore buy and Max */
.cforge { --tile: 100px; }
.ctile__glyph { position: static; width: 44px; height: 44px; border-width: 3px; }
.ctile__glyph svg { width: 26px; height: 26px; }
.pop__head .ctile__glyph { width: 100%; height: 100%; }
.ctile .tile__art .lv { min-width: 40px; }
.ctile .tile__fx { font-size: 18px; }
.ctile__max { width: 100%; min-height: 44px; }
.cmax { height: 34px; font-size: 14px; }
.cmax svg { width: 16px; height: 16px; }

/* the Feast: the pot over the fire, the ring of time left of three feasts, what a feast gives, a fish buy */
.cfeast { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 10px 8px 6px; border-radius: var(--r-3); background: radial-gradient(ellipse at 18% 50%, var(--iron-600), var(--iron-950) 72%); color: var(--parch-100); }
.cfeast__art { width: 76px; height: 76px; display: grid; place-items: center; min-width: var(--touch); }
.cfeast__art img { width: 100%; height: 100%; object-fit: contain; }
.cfeast__ring .num { font-size: 13px; color: var(--parch-50); white-space: nowrap; }
.cfeast__pills { display: flex; flex-wrap: wrap; gap: 6px; }
.cfeast .buy { width: 112px; }
@media (max-width: 459px) {
  .cfeast { grid-template-columns: auto auto minmax(0, 1fr); }
  .cfeast > .buy, .cfeast > .cmax { grid-column: 1 / -1; width: 100%; justify-self: stretch; justify-content: center; }
}

/* buildings: each one's look as it stands, its level, its effect, the next look and a log buy */
.cbuilds { --tile: 124px; }
.cbuild .tile__art { width: 92px; height: 82px; background: radial-gradient(ellipse at 50% 60%, var(--iron-600), var(--iron-900) 75%); }
.cbuild .tile__art > img.full { width: 96%; height: 96%; object-fit: contain; }
.cbuild .tile__art .lv { min-width: 36px; }
.cbuild__name { display: inline-flex; align-items: center; gap: 3px; }
.cbuild__name img { width: 18px; height: 18px; object-fit: contain; }
.cbuild__next { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 6px 0 2px; border-radius: 17px; background: var(--parch-200); border: 1px dashed var(--ink-faint); }
.cbuild__next img { width: 30px; height: 30px; object-fit: contain; filter: grayscale(.5) brightness(.75); }
.cbuild__next .num { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--ink); }
.cbuild__next svg { width: 13px; height: 13px; }

/* welcome back: what the camp gathered (each skill's item, the take and the levels it gained), and the feast */
.offline__camp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding: 6px 8px; border-radius: var(--r-2); background: var(--parch-100); }
.offline__cells { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.offline__ccell { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; color: var(--ink); }
.offline__citem { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 50% 40%, var(--iron-600), var(--iron-900) 72%); border: 2px solid var(--ink); }
.offline__citem img { width: 30px; height: 30px; object-fit: contain; }
.offline__citem .lv { bottom: -8px; min-width: 26px; height: 18px; font-size: 11px; line-height: 18px; background: var(--gold-300); color: var(--gold-900); }
.offline__feast { height: 32px; font-size: 15px; margin-left: auto; }
.offline__feast img { width: 22px; height: 22px; }
.offline__feast > span { margin-left: 2px; }

/* the Armory's weapon slot: the style's temper from the Forge */
.gslot__box .gtemper { position: absolute; top: -9px; left: -10px; height: 20px; padding: 0 5px; border-radius: 4px; background: var(--iron-950); color: var(--parch-50); border: 2px solid var(--parch-300); font-size: 11px; line-height: 16px; white-space: nowrap; }

/* Round 12: the Camp panel's switch (Camp, Patch, Altar), the ready plots on the Patch button */
.campsub { margin: 0 0 12px; flex-wrap: wrap; }
/* (Round 21: four sections share one row, even in a side sheet) */
.campsub { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.campsub button { justify-content: center; padding: 0 4px; gap: 4px; min-width: 0; }
.campsub button { height: var(--touch); position: relative; }
.campsub button img { width: 20px; height: 20px; object-fit: contain; image-rendering: pixelated; flex: none; }
.campsub__n { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--jade-500); color: #0d2a1d; font-size: 12px; line-height: 20px; }

/* Round 21: the camp's total level (a ring and a chip per skill), the Craft section's two cards, a closed card, the
   smith's "Ore low" pill, and Plating and Imbue on the feast's dark plate with a buy and Max */
.ctotal { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.ctotal__btn { display: inline-flex; align-items: center; gap: 8px; min-height: var(--touch); padding: 0 4px; }
.ctotal__ring { --rs: 52px; --rw: 5px; --ri: var(--iron-900); }
.ctotal__ring .num { font-size: 15px; color: var(--parch-50); }
.ctotal__ring.ring--done { --rc: var(--gold-300); }
.ctotal__lbl { font: 700 14px var(--font-ui); }
.ctotal__chips { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.ctotal__chip { display: inline-flex; align-items: center; gap: 2px; height: 26px; padding: 0 6px 0 2px; border-radius: 13px; background: var(--iron-800); color: var(--parch-100); font-size: 12px; }
.ctotal__chip img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.cskills--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cskill--off .cskill__bust > img { filter: grayscale(1) brightness(.45); }
.cskill--off .pill img { width: 20px; height: 20px; object-fit: contain; image-rendering: pixelated; }
.cskill__rate--low { color: var(--parch-50); background: var(--blood-600); }
.cskill__rate--low img { width: 18px; height: 18px; object-fit: contain; }
.ccraft { grid-template-columns: auto auto minmax(0, 1fr); }
.ccraft > .ccraft__buys { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 6px; }
.ccraft > .ccraft__buys .buy { width: 100%; }
.ccraft .ctile__max { color: var(--parch-100); border-color: var(--parch-300); }
.ccraft .ctile__max[aria-disabled="true"] { opacity: .45; }
.ccraft > .ccraft__buys > .cmax { grid-column: 1 / -1; justify-self: stretch; justify-content: center; }

/* the patch's head: the farming ring, the draught bottle and what a draught and a harvest give */
.cphead { grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 6px 12px; padding: 12px 12px 10px; justify-items: center; }
.cphead__skill { display: grid; justify-items: center; gap: 4px; }
.cphead__icon > img.px { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.cbottle { display: grid; justify-items: center; gap: 4px; }
.cbottle__btn { display: inline-flex; align-items: center; gap: 4px; min-width: var(--touch); min-height: 66px; padding: 0 6px; }
.cbottle__btn img { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.cbottle__btn .goldtext { font-size: 30px; line-height: 1; }
.cphead__pills { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; justify-self: start; }
.cphead__pills .pill { height: 28px; font-size: 14px; }
.cphead__pills .pill img { width: 20px; height: 20px; object-fit: contain; image-rendering: pixelated; }

/* a plot: its growth render in a growth ring, the plant's icon, the time left, four stage pips (filled or hollow) */
.cplots { --tile: 112px; }
.cplot .tile__art.cplot__art { width: 88px; height: 88px; border: 0; background: none; border-radius: 50%; }
.cplot__ring { --rs: 88px; --rw: 5px; --ri: var(--iron-900); }
.cplot__ring.ring--done { --rc: var(--gold-300); box-shadow: 0 0 0 2px var(--gold-900); }
.cplot__pic { width: 74px; height: 74px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, var(--iron-600), var(--iron-900) 75%); }
.cplot__pic > img.full { width: 100%; height: 100%; object-fit: cover; }
.cplot__pic > img.px { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.cplot__icon { position: absolute; top: -2px; right: -4px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--parch-50); border: 2px solid var(--ink); }
.cplot__icon img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.cplot__art .lv { bottom: -6px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.cplot__art .lv svg { width: 12px; height: 12px; }
.lv.cplot__ready { background: var(--gold-300); color: var(--gold-900); border: 2px solid var(--gold-900); height: 22px; font: 800 12px/18px var(--font-ui); }
.cplot--ready { border-color: var(--gold-600); box-shadow: 0 2px 0 var(--gold-600); }
.cplot--sel { border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink), inset 0 0 0 2px var(--jade-500); }
.cplot--sel::after { content: ""; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); border: 8px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
.cplot .tile__name { margin-top: 6px; }
.cpips { display: inline-flex; gap: 3px; }
.cpips i { width: 12px; height: 7px; border-radius: 2px; border: 1.5px solid var(--ink-soft); }
.cpips i.on { background: var(--ink); border-color: var(--ink); }
.cplot__gate, .cplot__yield { height: 30px; font-size: 14px; margin-top: 4px; }
.cplot__yield img { width: 20px; height: 20px; object-fit: contain; image-rendering: pixelated; }
.cplot .buy, .cseed .buy, .caltar .buy { margin-top: 2px; }
.cpick .buy__cost img { width: 20px; height: 20px; }

/* the seed chooser: item tiles with the level gate and the gold */
.cseeds { --tile: 100px; }
.cseed .tile__art > img.px { width: 70%; height: 70%; image-rendering: pixelated; }
.cseed__seed { position: absolute; top: -4px; right: -8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--parch-50); border: 2px solid var(--ink); }
.cseed__seed img { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; transform: scale(1.5); }
.cseed .tile__art .lv { display: inline-flex; align-items: center; gap: 2px; }
.cseed .tile__art .lv svg { width: 12px; height: 12px; }
.cseed .tile__fx svg { width: 15px; height: 15px; }

/* the Patch Sprite: the patch with its sprite's mark, what it does, a log buy or Built */
.csprite { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px 8px 6px; border-radius: var(--r-3); background: radial-gradient(ellipse at 18% 50%, var(--iron-600), var(--iron-950) 72%); color: var(--parch-100); }
.csprite__art { position: relative; width: 76px; height: 76px; display: grid; place-items: center; }
.csprite__art > img { width: 100%; height: 100%; object-fit: contain; }
.csprite__badge { position: absolute; right: 0; bottom: 2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--jade-500); color: #0d2a1d; border: 2px solid var(--iron-950); }
.csprite__badge svg { width: 15px; height: 15px; }
.offline__bare svg { width: 14px; height: 14px; }
.csprite__name { display: grid; gap: 2px; font: 700 15px var(--font-ui); }
.csprite__name small { font: 600 12px var(--font-ui); color: var(--iron-300); }
.csprite .buy { width: 112px; }

/* the altar: the altar as built with its candles, its tier, the prayer ring and the bones a kill offers */
.cahead { padding-top: 10px; }
.cahead > img.cahead__art { width: 200px; height: 150px; }
.cahead__tier { height: 28px; font-size: 14px; }
.cahead__tier b { margin-left: 4px; }
.cahead__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; margin-top: 8px; }
.cahead__bones { display: flex; flex-direction: column; gap: 6px; }
.cahead__bones .pill { height: 28px; font-size: 14px; }
.cahead__bones .pill img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }

/* vow sockets: a sworn vow (press to set it aside), an empty socket (dashed), a socket still shut (a padlocked shield) */
.csocks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; padding: 10px 8px; border-radius: var(--r-3); background: radial-gradient(ellipse at 50% 40%, var(--iron-700), var(--iron-950) 80%); }
.csock { display: grid; justify-items: center; gap: 4px; min-width: var(--touch); min-height: var(--touch); color: var(--parch-100); }
.csock__ring { position: relative; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; }
.csock--on .csock__ring { background: var(--iron-900); box-shadow: 0 0 0 3px var(--gold-300), 0 0 0 5px var(--gold-900); }
.csock--on .csock__ring img { width: 38px; height: 38px; object-fit: contain; image-rendering: pixelated; }
.csock--empty .csock__ring { border: 3px dashed var(--iron-400); }
.csock--locked .csock__ring { width: 60px; height: 64px; }
.csock__shield { width: 52px; height: 58px; color: var(--iron-600); }
.csock__lock { position: absolute; right: -2px; bottom: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--iron-950); color: var(--parch-100); border: 2px solid var(--iron-500); }
.csock__lock svg { width: 13px; height: 13px; }
.csock__name { font: 700 12px var(--font-ui); max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.csock--empty .csock__name, .csock--locked .csock__name { color: var(--iron-300); }

/* vow tiles: the prayer icon, the vow's short name and its effect now; sworn ones checked and framed */
.cvows { --tile: 100px; }
.cvow .tile__art.cvow__art { width: 60px; height: 60px; }
.cvow__art > img.px { width: 64%; height: 64%; image-rendering: pixelated; }
.cvow__art .lv { display: inline-flex; align-items: center; gap: 2px; }
.cvow__art .lv svg { width: 12px; height: 12px; }
.cvow--on { border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink), inset 0 0 0 2px var(--gold-300); }
.cvow--on .cvow__art { box-shadow: 0 0 0 3px var(--gold-300); }
.cvow__on { position: absolute; top: -6px; right: -8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; border: 2px solid var(--ink); }
.cvow__on svg { width: 13px; height: 13px; }
.tile__fx.cvow__fx { display: block; font-size: 12px; line-height: 1.2; white-space: normal; text-align: center; }

/* altar tiers: each look, its prayer factor, Built, Now, the next one's ore and log buy, or Later */
.caltars { --tile: 116px; }
.caltar .tile__art { width: 92px; height: 82px; background: radial-gradient(ellipse at 50% 60%, var(--iron-600), var(--iron-900) 75%); }
.caltar .tile__art > img.full { width: 96%; height: 96%; object-fit: contain; }
.caltar--now { border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink), inset 0 0 0 2px var(--gold-300); }
.buy__cost--two { flex-direction: column; gap: 1px; font-size: 14px; }
.buy__part { display: inline-flex; align-items: center; gap: 3px; }

/* the fight: a vow chip per sworn vow (no timer ring), the draughts beside a boss timer */
.buff--vow { background: var(--gold-600); box-shadow: 0 0 0 1px var(--iron-950); }
.buff--vow img { width: 24px; height: 24px; image-rendering: pixelated; }
.timer { grid-template-columns: minmax(0, 1fr) auto auto; }
.timer__draught { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 5px 0 2px; border-radius: 4px; background: var(--iron-950); color: var(--parch-50); font-size: 13px; line-height: 20px; }
.timer__draught[hidden] { display: none; }
.timer__draught img { width: 18px; height: 18px; object-fit: contain; image-rendering: pixelated; }
.timer__draught--on { background: var(--gold-300); color: var(--gold-900); box-shadow: inset 0 0 0 1px var(--gold-900); }
.timer__draught--pop { animation: march-up .6s ease-out; }
.timer--refill .timer__bar i { animation: refill .7s ease-out; }
@keyframes refill { from { width: 0; } }
.reduce-motion .timer__draught--pop, .reduce-motion .timer--refill .timer__bar i { animation: none; }

/* the Camp tile's leaf badge, the Draughts switch, Welcome back's bare plots */
.tab__badge--leaf { display: inline-flex; align-items: center; gap: 1px; padding: 0 5px 0 2px; background: var(--jade-500); color: #0d2a1d; }
.tab__badge--leaf img { width: 14px; height: 14px; object-fit: contain; image-rendering: pixelated; }
.set > img.set__img { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; justify-self: center; }
.offline__bare { height: 30px; font-size: 14px; margin-left: auto; }
.offline__farm .offline__citem svg { width: 26px; height: 26px; color: var(--jade-300); }

/* the Spire (Round 13): the tower shield, the strip and its ten windows, the crests, the Watch's seal pile, the
   Steward; in the fight the floor on the tower shield, the block's ten floors as pips and the floor clock */
.shield--tower { color: var(--gold-100); }
.shield .num[data-long] { font-size: 18px; }
.tile__art > .tile__shield { position: absolute; right: -10px; bottom: -8px; width: 32px; height: 36px; }
.tile__art > .tile__shield .num { font-size: 13px; }
.more .tile__art > .tile__shield svg { width: 100%; height: 100%; }
.spirebox { grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 4px 14px; padding: 10px 12px; }
.spirebox > img.spirebox__strip { width: 96px; height: 236px; object-fit: cover; object-position: 50% 40%; }
.spirebox > img.spirebox__strip:not([src]) { visibility: hidden; }
.spirebox__fig { display: grid; justify-items: start; gap: 6px; }
.spirebox__fig .goldtext { font-size: 56px; line-height: 1; }
.spirebox__fig .lbl svg { width: 16px; height: 16px; }
.spirebox__pills { display: flex; flex-wrap: wrap; gap: 6px; }
.spirebox__fig .pill { height: 28px; font-size: 15px; }
.spirebox__fig .pill img { width: 20px; height: 20px; object-fit: contain; }
.spirewhy { font: 700 13px var(--font-ui); }
/* the block's ten floors as arched windows climbing a stair: 1 to 5 along the bottom, 6 to 10 back along the top */
.sfloors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.sfloors > li { display: grid; }
.swin { position: relative; display: grid; justify-items: center; align-content: start; gap: 3px; min-height: 44px; padding: 2px 0 4px; border-radius: var(--r-2); }
.swin__pane { position: relative; width: 54px; height: 62px; display: grid; place-items: end center; border-radius: 27px 27px 4px 4px; border: 3px solid var(--iron-700); background: var(--iron-950); box-shadow: inset 0 0 0 2px #0c0806; overflow: visible; }
.swin__pane > img { width: 46px; height: 52px; margin-bottom: 2px; object-fit: contain; border-radius: 0 0 2px 2px; filter: brightness(0) opacity(.55) drop-shadow(0 0 1px var(--iron-400)); }
.swin--lit .swin__pane { background: radial-gradient(ellipse at 50% 35%, #ffe7a8, #ffc65a 55%, #c98a2a 100%); border-color: var(--gold-600); }
.swin--lit .swin__pane > img { filter: brightness(0) opacity(.85); }
.swin--now .swin__pane { background: radial-gradient(ellipse at 50% 35%, #fff3c8, #ffd35c 60%, #eeb02f 100%); border-color: var(--parch-50); outline: 3px solid var(--gold-300); outline-offset: 1px; }
.swin--now .swin__pane > img { filter: brightness(0); }
.swin__pane .badge { position: absolute; right: -7px; bottom: -5px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--parch-100); }
.swin__pane .badge svg { width: 11px; height: 11px; }
.badge--now { background: var(--gold-600); color: #fff; }
.swin__kind { position: absolute; left: -6px; top: -6px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--iron-950); border: 2px solid var(--gold-600); color: var(--gold-300); }
.swin__kind svg { width: 13px; height: 13px; }
.swin__kind--guard svg { width: 12px; height: 14px; }
.swin__n { font-size: 14px; line-height: 1; color: var(--ink); }
.swin--dark .swin__n { color: var(--ink-soft); }
.swin__rw { display: inline-flex; align-items: center; justify-content: center; gap: 1px; min-width: 26px; height: 22px; font-size: 12px; color: var(--ink); }
.swin__rw img { width: 20px; height: 20px; object-fit: contain; }
.swin__rw svg { width: 18px; height: 18px; }
.swin__rw--casket { border-bottom: 3px solid var(--tc, transparent); }
.swin__rw--casket img { width: 24px; height: 20px; }
.swin__rw--ess { color: var(--jade-800); }
.swin:focus-visible { outline-color: var(--focus-on-parch); }
/* the plate: crests, the Watch's seal pile, seals held */
.spireplate .trophy { min-height: 44px; padding: 0; border-radius: var(--r-2); color: inherit; font: inherit; }
.spireplate .trophy > img.px { width: 48px; height: 48px; margin: 8px 0; object-fit: contain; }
.spireplate .trophy > img.r { width: 64px; height: 64px; }
.spireplate .trophy:focus-visible { outline-offset: 2px; }
.sealpile { position: relative; display: block; width: 100px; height: 64px; }
.sealpile > span { position: absolute; width: 33px; height: 33px; }
.sealpile img { image-rendering: pixelated; }
.sealpile img, .sealpile svg { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 1px 0 #0c0806); }
.sealpile--none { opacity: .45; filter: grayscale(1); }
.sshop .tile__fx svg { width: 18px; height: 18px; color: var(--ink); }
.sshop .tile__art .lv { bottom: -10px; }
/* the fight during a climb: the tenth plain pip makes way for the crown at 10, the guard pip at 5 is a shield */
.pips--spire .pip:nth-child(10) { display: none; }
.pip--guard { width: 13px; border-radius: 2px 2px 7px 7px; border-width: 2px; border-color: var(--gold-300); }
.pip--bossnow { color: var(--gold-300); filter: drop-shadow(0 0 0 var(--gold-300)); }
.pip--bossnow svg { outline: 2px solid var(--gold-300); outline-offset: 1px; border-radius: 2px; }
.fight--spire .foe { width: min(calc(100% - 2 * (var(--tclock, 68px) + var(--gutter) + 6px)), 420px); }
.fight--spire .tclock__ring { --rc: #7fb0e6; }
.fight--spire .tclock--low .tclock__ring { --rc: var(--blood-400); }
.fight--spire .timer--refill .timer__bar i { animation: refill .7s ease-out, spire-sweep .9s ease-out; }
@keyframes spire-sweep { 0%, 40% { background: var(--gold-300); } 100% { background: var(--parch-300); } }
.reduce-motion .fight--spire .timer--refill .timer__bar i { animation: none; }
/* a crest: the crest prop rises over the fight and fades */
.crestpop { position: absolute; z-index: 3; left: 50%; top: 62%; height: min(150px, 30%); aspect-ratio: 1; display: grid; place-items: center; pointer-events: none; animation: crestpop 1800ms ease-out both; }
.crestpop img, .crestpop svg { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 0 rgba(12, 8, 6, .6)); }
@keyframes crestpop { 0% { transform: translate(-50%, -30%) scale(.3); opacity: 0; } 18% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; } 30% { transform: translate(-50%, -50%) scale(1); } 75% { transform: translate(-50%, -56%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -66%) scale(.9); opacity: 0; } }
.reduce-motion .crestpop { display: none; }
@media (prefers-reduced-motion: reduce) { .crestpop { display: none; } }
/* results: the floors climbed as lit windows, the count, from and to on tower shields */
.spireend { grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 8px 18px; }
.swins { position: relative; display: grid; grid-template-columns: repeat(2, 22px); grid-template-rows: repeat(5, 28px); gap: 5px 8px; padding: 8px 10px; border-radius: 6px; background: linear-gradient(90deg, #6d6152, #8e8170 50%, #6d6152); box-shadow: inset 0 0 0 2px #3a3128; }
.swins > i { display: block; border-radius: 11px 11px 2px 2px; background: #1a1612; box-shadow: inset 0 0 0 2px #2d261f; }
.swins > i.on { background: radial-gradient(ellipse at 50% 35%, #fff0c0, #ffc65a 60%, #c98a2a); box-shadow: inset 0 0 0 2px var(--gold-600); }
.swins > b { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); padding: 0 6px; border-radius: 4px; background: var(--iron-950); font-size: 14px; color: var(--gold-200); }
.spireend__fig { display: grid; justify-items: start; gap: 8px; }
.spireend__fig .goldtext { font-size: 56px; line-height: 1; }
.spireend__span { display: inline-flex; align-items: center; gap: 6px; }
/* Welcome back: the Watch's take for the time away, and a climb that time away ended */
.offline__spire { gap: 10px; }
.offline__spire .sealpile { flex: none; transform: scale(.72); transform-origin: left center; margin-right: -28px; }
.offline__spire .pill { height: 30px; font-size: 15px; }
.offline__spire .pill img { width: 20px; height: 20px; object-fit: contain; }
.offbadge--spire svg { width: 18px; height: 18px; }
.offbadge--second { top: 46px; }
@media (orientation: landscape) and (max-height: 540px) { .spirebox > img.spirebox__strip { width: 80px; height: 168px; } .spirebox__fig .goldtext { font-size: 44px; } }

/* the Colossi (Round 14): the More tile, the panel (today's colossus, its twist, the horns, the tier and the day's
   total, the ladder as a climbing bar, the Trophy Wall prop with the week's trophies on its mounts, the plate, the
   shop), the fight during an attack (the tier bar, the tier-up flash), the results and Welcome back's siege row */
.tile__art > img.coltile__pic { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.coltile__tier { position: absolute; right: -10px; bottom: -6px; min-width: 30px; height: 22px; padding: 0 5px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-200); color: var(--gold-900); border: 2px solid var(--ink); font-size: 13px; line-height: 1; }
.colbox { grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 6px 14px; padding: 10px 12px 12px; overflow: hidden; }
.colbox__art { position: relative; display: grid; justify-items: center; }
.colbox__foe { display: block; width: 190px; height: 190px; object-fit: contain; filter: drop-shadow(0 6px 0 rgba(12, 8, 6, .5)); }
img.colbox__foe:not([src]) { visibility: hidden; }
.colbox__art .coltwist { margin-top: -14px; position: relative; }
.colbox__fig { display: grid; justify-items: start; gap: 6px; min-width: 0; }
.colbox__fig .lbl { font: 700 14px var(--font-ui); }
.colbox__tier.goldtext { font-size: 60px; line-height: .95; }
.colbox__total { display: inline-flex; align-items: center; gap: 6px; }
.colbox__total svg { width: 18px; height: 18px; color: var(--parch-200); }
.colbox__total .goldtext { font-size: 26px; line-height: 1; }
.colbox__fig .pill { height: 28px; font-size: 15px; }
.chorns { display: inline-flex; gap: 6px; }
.chorn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 50% 40%, var(--gold-600), #3a2402 80%); border: 2px solid var(--gold-300); }
.chorn img, .chorn svg { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; }
/* a blown horn: hollow, a dashed rim and the horn faint (shape, not only color) */
.chorn--blown { background: transparent; border: 2px dashed var(--iron-400); }
.chorn--blown img, .chorn--blown svg { filter: grayscale(1) brightness(.5); opacity: .55; }
/* the ladder: the tier now, then the next five rising like steps, the bar filling from now toward the next */
.cladder { position: relative; margin-top: 12px; padding: 6px 4px 4px; border-radius: var(--r-3); background: var(--parch-100); box-shadow: inset 0 0 0 2px var(--parch-300); }
.cladder__steps { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cladder__steps > li { display: grid; justify-items: center; margin-bottom: calc(var(--k) * 7px); }
.cstep { display: grid; justify-items: center; gap: 2px; min-width: var(--touch); min-height: var(--touch); padding: 2px 2px 4px; border-radius: var(--r-2); }
.cstep .shield--sm { color: var(--parch-50); }
/* (a step not reached is a dashed outline: parchment behind it, so the rope runs behind the shield, not through its number) */
.cstep:not(.cstep--now) .shield--sm::before { content: ""; position: absolute; inset: 2px 3px 5px; border-radius: 2px 2px 14px 14px; background: var(--parch-100); }
.cstep--next .shield--sm::before { display: none; }
.cstep--now .shield--sm { width: 44px; height: 50px; }
.cstep--now .shield--sm .num { font-size: 19px; }
.cstep--next { outline: 2px solid var(--gold-400); outline-offset: -2px; }
.cstep__rw { display: inline-flex; align-items: center; gap: 2px; min-height: 22px; font-size: 13px; color: var(--ink); }
.cstep__rw img { width: 20px; height: 20px; object-fit: contain; image-rendering: pixelated; }
.cstep__rw img.r { image-rendering: auto; width: 24px; }
.cstep__rw svg { width: 18px; height: 18px; }
.cstep__rw--casket { border-bottom: 3px solid var(--tc, transparent); }
.cstep__rw b { font-size: 12px; }
.cstep--now .cstep__rw { font: 700 12px var(--font-ui); color: var(--ink-soft); }
/* the track runs under the shields from the tier now (the first column's middle) to the fifth step */
.cladder__track { position: absolute; left: calc(4px + (100% - 8px) / 12); bottom: 58px; width: calc((100% - 8px) * 5 / 6); height: 30px; overflow: visible; pointer-events: none; }
.cladder__track path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.cladder__rope { stroke: #8e7c62; stroke-width: 9px; }
.cladder__fill { stroke: var(--gold-400); stroke-width: 5px; }
.cladder__steps > li { position: relative; z-index: 1; }
/* the Trophy Wall: the prop, a trophy on each mount, the level on its plaque */
.cwall { position: relative; width: min(100%, 460px); margin: 12px auto 0; aspect-ratio: 1.5; overflow: hidden; }
/* (the prop's picture is square with the wall across its middle: the frame shows the middle band, and the trophies
   are placed on the square, which runs past the frame above and below) */
.cwall__in { position: relative; aspect-ratio: 1; margin-top: -16.67%; }
.cwall__art { width: 100%; height: 100%; object-fit: contain; display: block; }
.cwall__art:not([src]) { visibility: hidden; }
.cwall--dim .cwall__art { filter: grayscale(1) brightness(.6); }
.cmount { position: absolute; width: 52px; height: 52px; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 50% 40%, rgba(255, 231, 168, .35), rgba(12, 8, 6, 0) 70%); }
.cmount img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 0 rgba(12, 8, 6, .7)); }
.cmount--none { background: none; border: 2px dashed rgba(239, 226, 191, .55); width: 46px; height: 46px; }
.cmount--none img { filter: brightness(0) opacity(.5); }
.cmount--today { outline: 3px solid var(--gold-300); outline-offset: 0; }
.cmount .badge { position: absolute; right: -6px; top: -6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--parch-100); }
.cmount .badge svg { width: 11px; height: 11px; }
.cplaque { position: absolute; transform: translate(-50%, -50%); min-width: 22px; padding: 0 4px; border-radius: 3px; font-size: 12px; line-height: 16px; text-align: center; pointer-events: none; color: #1a140e; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }
.cplaque--silver, .cplaque--gold { font-weight: 900; }
.cplaquepill--bronze { box-shadow: inset 4px 0 0 #b4743a; }
.cplaquepill--silver { box-shadow: inset 4px 0 0 #c9ccd4; }
.cplaquepill--gold { box-shadow: inset 4px 0 0 #f0b733; }
.colplate { margin-top: 8px; }
.colplate .trophy { min-height: 44px; padding: 0; border-radius: var(--r-2); color: inherit; font: inherit; }
.colplate .trophy > img.px { width: 52px; height: 52px; margin: 2px 0; object-fit: contain; image-rendering: pixelated; }
.colplate .trophy > .colplate__crown { width: 40px; height: 40px; margin: 8px 0; color: var(--gold-300); }
.colplate .trophy:focus-visible { outline-offset: 2px; }
.cshop .tile__fx small { margin-left: 2px; }
.cshop .tile__name { overflow-wrap: anywhere; }
.colwait { width: 72px; height: 72px; object-fit: contain; image-rendering: pixelated; }
/* the fight during an attack: the ring and plate as in the trial, the tier bar in gold with its tier at each end */
.fight--colossus .foe { width: min(calc(100% - 2 * (var(--tclock, 68px) + var(--gutter) + 6px)), 420px); }
.fight--colossus .tclock__ring { --rc: var(--gold-400); }
.fight--colossus .tclock--low .tclock__ring { --rc: var(--blood-400); }
.hp--colossus { background: #2a1f10; }
.hp--colossus .hp__fill { background: linear-gradient(#ffd35c, #c98a2a); }
.hp--colossus .hp__text { color: #fff3c8; }
.hp__tier { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); font: 800 11px/1 var(--font-num); color: #fff; text-shadow: 0 1px 0 #000, 0 0 2px #000; }
.hp__tier--next { left: auto; right: 4px; }
.hp.tierup { animation: col-tierup 800ms ease-out; }
@keyframes col-tierup { 0% { box-shadow: 0 0 0 0 var(--gold-300); } 25% { box-shadow: 0 0 0 4px var(--gold-300); filter: brightness(1.6); } 100% { box-shadow: 0 0 0 0 transparent; } }
.hp.tierup .hp__fill { animation: refill .7s ease-out; }
.shield.tierup { animation: col-shieldpop 600ms ease-out; }
@keyframes col-shieldpop { 0% { transform: scale(1); } 30% { transform: scale(1.25); } 100% { transform: scale(1); } }
.reduce-motion .hp.tierup, .reduce-motion .hp.tierup .hp__fill, .reduce-motion .shield.tierup { animation: none; }
@media (prefers-reduced-motion: reduce) { .hp.tierup, .hp.tierup .hp__fill, .shield.tierup { animation: none; } }
/* results: the colossus, the damage dealt rising, the tiers gained as shields popping in */
.colend { grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 8px 16px; }
.colend__foe { display: block; width: 140px; height: 140px; object-fit: contain; }
img.colend__foe:not([src]) { visibility: hidden; }
.colend__fig { display: grid; justify-items: start; gap: 6px; }
.colend__fig .goldtext { font-size: 44px; line-height: 1; }
.colend__fig .lbl svg { width: 14px; height: 14px; }
.ctiers { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; max-width: 220px; }
.ctiers > b { font-size: 14px; color: var(--gold-200); margin-right: 2px; }
.ctiers__s { display: inline-grid; animation: col-tierin 420ms ease-out both; animation-delay: calc(var(--i, 0) * 120ms + 300ms); }
@keyframes col-tierin { 0% { transform: scale(.2); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
.reduce-motion .ctiers__s { animation: none; }
@media (prefers-reduced-motion: reduce) { .ctiers__s { animation: none; } }
/* Welcome back: the siege's take */
.offline__colossus { gap: 10px; }
.offline__colpic { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 40%, var(--iron-600), var(--iron-900) 72%); border: 2px solid var(--ink); }
.offline__colpic img { width: 100%; height: 100%; object-fit: contain; }
.offline__colossus .pill { height: 30px; font-size: 15px; }
.offline__colossus .pill img { width: 20px; height: 20px; object-fit: contain; }
.offline__colossus .pill small { font-size: 12px; margin-left: 2px; }
@media (orientation: landscape) and (max-height: 540px) { .colbox__foe { width: 130px; height: 130px; } .colbox__tier.goldtext { font-size: 44px; } .colbox__total .goldtext { font-size: 20px; } .cwall { width: min(100%, 360px); } }
@media (max-width: 379px) { .colbox__foe { width: 150px; height: 150px; } .colbox__tier.goldtext { font-size: 48px; } }

/* Round 15: the Wardrobe and the festivals */
/* the chosen title, small under the stage shield (absolute, so the HUD rows never move) */
.shield__title { position: absolute; left: 50%; top: calc(100% + 1px); transform: translateX(-50%); max-width: 104px; overflow: hidden; white-space: nowrap; font: 600 10px/14px var(--font-ui); color: var(--parch-300); text-shadow: 0 1px 0 #000, 0 0 3px #000; pointer-events: none; }
.herocard__title { display: block; margin-top: 1px; font: 600 11px var(--font-ui); color: var(--gold-200); white-space: nowrap; overflow: hidden; }
/* the festival token on the floor: its picture inside the clue's countdown ring */
.drop--token { background: conic-gradient(var(--gold-300) calc(var(--p) * 360deg), rgba(22, 18, 14, .6) 0); }
.drop--token::before { background: rgba(22, 18, 14, .55); border-color: var(--gold-200); }
.drop--token img { position: relative; width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; }
.drop--token .drop__tier { border-left-color: var(--gold-300); }
.drop--token.drop--low { background: conic-gradient(var(--blood-400) calc(var(--p) * 360deg), rgba(22, 18, 14, .6) 0); }
.buff--cheer { background: conic-gradient(var(--jade-300) calc(var(--p) * 360deg), var(--iron-700) 0); }
.sheet__head--tight .seg--w .seg__w, .sheet__head--tight .seg--fit .seg__w { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 459px) { .seg--w .seg__w { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }

/* the Wardrobe view */
.wstage { display: grid; grid-template-columns: minmax(120px, min(42%, 230px)) minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border-radius: var(--r-3); border: 2px solid var(--ink);
  background: radial-gradient(ellipse at 30% 70%, var(--iron-600), var(--iron-950) 75%); color: var(--parch-100); }
.wstage__fig { aspect-ratio: 1; display: grid; place-items: center; }
.wstage__fig img { width: 100%; height: 100%; object-fit: contain; }
.wstage__side { display: grid; justify-items: start; gap: 6px; min-width: 0; }
.wstage__side .lbl { font-size: 12px; color: var(--iron-300); }
.wstage__title { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font: 700 15px var(--font-ui); color: var(--gold-200); white-space: nowrap; overflow: hidden; }
.wstage__title svg { width: 18px; height: 18px; flex: none; }
.wstage__title--none { color: var(--iron-300); font-weight: 600; }
.wstage__worn { font: 800 18px var(--font-num); color: var(--parch-50); line-height: 1.1; }
.wbody { display: flex; gap: 8px; }
.wbody__b { position: relative; display: grid; justify-items: center; width: 56px; min-height: 64px; padding: 4px 0 2px; border-radius: var(--r-2); border: 2px dashed var(--iron-600); background: var(--iron-900); color: var(--parch-100); }
.wbody__b[aria-pressed="true"] { border: 2px solid var(--gold-300); background: var(--iron-800); }
.wbody__pic { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--iron-950); }
.wbody__pic img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.wbody__n { font: 800 12px var(--font-num); }
.wbody__on { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: var(--ok); color: #fff; }
.wtiles { --tile: 100px; }
.wtile .tile__art, .wtile__art { width: 76px; height: 76px; padding: 0; overflow: visible; }
.wtile__art img.full { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: top; }
img.sil { filter: brightness(0) opacity(.55); }
.wtile .badge { position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--parch-50); }
.wtile .badge svg { width: 13px; height: 13px; }
.wtile .tile__name { font-size: 12px; }
.wsrc img { image-rendering: pixelated; object-fit: contain; }
.wtitles { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.wtitle { display: inline-flex; align-items: center; gap: 5px; min-height: var(--touch); padding: 0 12px; border-radius: 22px; border: 2px solid var(--ink-faint); background: var(--parch-50); color: var(--ink); font: 600 13px var(--font-ui); }
.wtitle svg, .wtitle img { width: 18px; height: 18px; flex: none; object-fit: contain; }
/* the chosen title is a banner (a swallowtail end, filled), never only a color */
.wtitle--on { border: 0; border-radius: 0; padding: 0 22px 0 14px; background: var(--ink); color: var(--gold-200); clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%); font-weight: 700; }
.wtitle--off { border-style: dashed; color: var(--ink-faint); background: transparent; }
.wtitles__n { font-size: 12px; color: var(--ink-faint); }

/* the festival tile, panel and Welcome back row */
.festart { display: grid; place-items: center; }
.more .tile__art .festart svg { width: 46px; height: 46px; }
.tile--off .festart { filter: grayscale(.7) brightness(.7); }
.festring { margin-left: 4px; }
.tile [data-st] { display: inline-flex; align-items: center; gap: 2px; }
.festbox { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; justify-items: start; gap: 12px; padding: 14px; }
.festbox__em svg { width: 88px; height: 88px; display: block; }
.festbox__em.dim { filter: grayscale(.6) brightness(.75); }
.festbox__fig { display: grid; gap: 4px; min-width: 0; }
.festbox__tok { display: inline-flex; align-items: center; gap: 6px; }
.festbox__tok img { width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; }
.festbox .festbox__tok .goldtext { font-size: 44px; }
.festbox__days .num { display: block; font-size: 22px; line-height: 1; color: var(--parch-50); text-align: center; }
.festbox__days small { display: block; font: 600 11px var(--font-ui); color: var(--iron-300); text-align: center; }
.festbox--next { grid-template-columns: auto minmax(0, 1fr); }
.festbox--next .festbox__fig { justify-items: start; }
.fshop { --tile: 132px; }
.fshop .tile__art img { image-rendering: pixelated; object-fit: contain; }
.fshop__art { width: 96px; height: 112px; padding: 0; border-radius: var(--r-2); }
.fshop .fshop__art img.full { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.fshop__ttl { max-width: 100%; overflow: hidden; font: 600 11px var(--font-ui); }
.fshop .buy { width: 100%; min-height: 48px; }
.fshop .tile__fx img { width: 18px; height: 18px; object-fit: contain; image-rendering: pixelated; }
.fshop .buy__cost img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.fseasons { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.fseason { position: relative; width: 100%; display: grid; justify-items: center; gap: 3px; min-height: var(--touch); padding: 10px 4px 8px; border-radius: var(--r-2); border: 1px solid var(--parch-300); background: var(--parch-50); color: var(--ink); text-align: center; }
.fseason--on { padding-top: 24px; border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--gold-300); }
.fseason__em svg { width: 40px; height: 40px; display: block; }
.fseason__n { font: 700 12px var(--font-ui); line-height: 1.15; }
.fseason__d { font: 600 10px var(--font-ui); color: var(--ink-soft); }
.fseason__ms { display: flex; gap: 4px; }
.fseason__m { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--ink-faint); display: grid; place-items: center; }
.fseason__m--got { border-color: var(--ok); background: var(--ok); color: #fff; }
.fseason__m svg { width: 10px; height: 10px; }
.offline__fest .pill { height: 30px; font-size: 15px; }
.offline__fest .pill img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
@media (max-width: 379px) { .festbox__em svg { width: 64px; height: 64px; } .festbox .festbox__tok .goldtext { font-size: 34px; } .wstage { grid-template-columns: minmax(104px, 40%) minmax(0, 1fr); } }
@media (orientation: landscape) and (max-height: 540px) { .festbox__em svg { width: 60px; height: 60px; } .festbox .festbox__tok .goldtext { font-size: 32px; } .wstage { grid-template-columns: 120px minmax(0, 1fr); } }

/* Round 16: the quest card over the top half of the fight (a press or its time puts it away; the fight runs on under
   it), the Quests page of the collection log and a card shown again in its own panel */
.qcard { position: absolute; z-index: 7; left: calc(var(--sa-l) + var(--gutter)); right: calc(var(--sa-r) + var(--gutter)); top: calc(var(--sa-t) + 8px); max-width: 560px; max-height: calc(54% - 8px); margin-inline: auto; display: flex; flex-direction: column; padding: 0; overflow: hidden; border-radius: var(--r-3); background: var(--iron-900); border: 2px solid var(--gold-600); box-shadow: var(--ledge), 0 8px 24px rgba(0, 0, 0, .45); color: var(--parch-50); text-align: left; touch-action: manipulation; }
.qcard[hidden] { display: none; }
.qcard:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.qcard__art { position: relative; flex: 1 1 auto; min-height: 56px; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; background: var(--iron-850); }
.qcard__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; }
.qcard__ph { width: 56px; height: 56px; opacity: .55; }
.qcard--noart .qcard__art img, .qcard:not(.qcard--noart) .qcard__ph { display: none; }
.qcard__cap { flex: none; display: grid; gap: 3px; padding: 8px 12px 11px; }
.qcard__head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.qcard__head svg.i { width: 22px; height: 22px; }
.qcard__name { min-width: 0; overflow: hidden; text-overflow: clip; white-space: nowrap; font: 800 15px var(--font-num); color: var(--gold-200); }
.qcard__text { font-size: 15px; line-height: 1.3; color: var(--parch-50); }
.qcard__time { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--gold-400); transform-origin: left center; transform: scaleX(0); }
.qcard__time--run { animation: qtime var(--qms, 8000ms) linear forwards; }
@keyframes qtime { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.qcard--in { animation: qin 300ms cubic-bezier(.2, .8, .3, 1) both; }
.qcard--out { animation: qout 200ms ease-in forwards; }
@keyframes qin { from { transform: translateY(calc(-100% - 12px)); } to { transform: none; } }
@keyframes qout { to { transform: translateY(calc(-100% - 12px)); opacity: 0; } }
.reduce-motion .qcard--in, .reduce-motion .qcard--out { animation: none; }
.reduce-motion .qcard__time { display: none; }
@media (prefers-reduced-motion: reduce) { .qcard--in, .qcard--out { animation: none; } .qcard__time { display: none; } }
/* the beat: seen cards filled, this one filled and larger, the rest hollow (shape and fill, not color) */
.qdots { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding-left: 4px; flex: none; }
.qdot { display: block; width: 9px; height: 9px; transform: rotate(45deg); border: 2px solid var(--gold-300); }
.qdot--seen { background: var(--gold-300); }
.qdot--now { width: 13px; height: 13px; background: var(--gold-200); border-color: var(--gold-100); box-shadow: 0 0 0 2px var(--gold-800); }
/* Round 26: a story scene over the fight (the speaker's picture, a name, one line, the beat and a running bar; the
   narrator's lines are set in italic beside the scene's own picture in a square frame) */
.scard { position: absolute; z-index: 7; left: calc(var(--sa-l) + var(--gutter)); right: calc(var(--sa-r) + var(--gutter)); top: calc(var(--sa-t) + 8px); max-width: 480px; min-height: 84px; margin-inline: auto; display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 10px; padding: 9px 12px 13px 9px; overflow: hidden; border-radius: var(--r-3); background: var(--iron-900); border: 2px solid var(--gold-600); box-shadow: var(--ledge), 0 8px 24px rgba(0, 0, 0, .45); color: var(--parch-50); text-align: left; touch-action: manipulation; }
.scard[hidden] { display: none; }
.scard:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.scard__art { width: 64px; height: 64px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; border: 2px solid var(--gold-600); background: radial-gradient(circle at 50% 35%, var(--iron-600), var(--iron-950) 75%); }
.scard__art img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.scard__art > svg.i { width: 30px; height: 30px; opacity: .7; }
.scard--tale .scard__art { border-radius: var(--r-2); }
.scard--tale .scard__art img { object-fit: contain; object-position: center; }
.scard__cap { display: grid; gap: 3px; min-width: 0; }
.scard__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.scard__who { min-width: 0; overflow: hidden; white-space: nowrap; font: 800 15px var(--font-num); color: var(--gold-200); }
.scard__text { font-size: 15px; line-height: 1.3; }
.scard--tale .scard__text, .sline--tale .sline__text { font-style: italic; }
/* the Story page and a scene read again */
.stiles .tile__name { min-height: 1.2em; }
.stile .tile__art { position: relative; }
.stile__shield { position: absolute; right: 2px; top: 2px; width: 30px; height: 34px; }
.stile__shield .num { font-size: 12px; }
.sreplay__title { margin: 0 0 10px; font: 800 19px var(--font-num); color: var(--ink); }
.slines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sline { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border-radius: var(--r-3); background: var(--iron-900); border: 2px solid var(--gold-600); color: var(--parch-50); }
.sline__art { width: 56px; height: 56px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; border: 2px solid var(--gold-600); background: radial-gradient(circle at 50% 35%, var(--iron-600), var(--iron-950) 75%); }
.sline__art img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.sline__art > svg.i { width: 26px; height: 26px; opacity: .7; }
.sline--tale .sline__art { border-radius: var(--r-2); }
.sline--tale .sline__art img { object-fit: contain; object-position: center; }
.sline__cap { display: grid; gap: 2px; min-width: 0; }
.sline__who { font: 800 14px var(--font-num); color: var(--gold-200); }
.sline__text { font-size: 15px; line-height: 1.35; }
.qlogs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.qlog__head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; min-width: 0; }
.qlog__name { min-width: 0; font: 800 17px var(--font-num); color: var(--ink); }
.qlog--unseen .qlog__name { color: var(--ink-soft); }
.qlog__where { color: var(--ink-soft); font-size: 14px; }
.qlog__head .pill { margin-left: auto; }
.qlog__cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.qlog__cards > li { display: grid; }
.qthumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; min-height: 44px; overflow: hidden; border-radius: var(--r-2); background: var(--iron-850); border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); color: var(--parch-100); }
.qthumb__art { position: absolute; inset: 0; display: grid; place-items: center; }
.qthumb__art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; }
.qthumb__art > svg.i { width: 28px; height: 28px; opacity: .6; }
.qthumb__n { position: absolute; left: 4px; bottom: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--ink); color: var(--gold-200); font-size: 12px; line-height: 20px; text-align: center; }
.qthumb--locked { background: repeating-linear-gradient(135deg, var(--parch-200) 0 8px, var(--parch-300) 8px 16px); border: 2px dashed var(--ink-soft); box-shadow: none; }
.qthumb--locked .qthumb__art img.qthumb__sil { width: auto; height: 92%; object-fit: contain; filter: brightness(0) opacity(.5); }
.qthumb__sky { position: absolute; inset: 0; width: 100%; height: 100%; fill: rgba(44, 31, 18, .45); }
.qthumb--locked .lockb svg { width: 22px; height: 22px; }
.qthumb__shield { position: absolute; right: 3px; top: 3px; width: 30px; height: 34px; }
.qthumb__shield .num { font-size: 12px; }
.qreplay { margin: 0; overflow: hidden; border-radius: var(--r-3); background: var(--iron-900); border: 2px solid var(--gold-600); color: var(--parch-50); }
.qreplay__art { display: grid; place-items: center; aspect-ratio: 16 / 10; background: var(--iron-850); }
.qreplay__art img { width: 100%; height: 100%; object-fit: cover; }
.qreplay__art > svg.i { width: 56px; height: 56px; opacity: .55; }
.qreplay figcaption { display: grid; gap: 4px; padding: 10px 12px 12px; }
.qreplay__nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 12px; color: var(--ink); }
.qreplay__nav .btn { min-width: 64px; }
.qreplay__nav .btn:disabled { opacity: .4; cursor: default; }
.qreplay__back { transform: rotate(-90deg); }
.qreplay__fwd { transform: rotate(90deg); }

/* Collection, Foes page v2: totals with what they give, the region as one button that opens every region, foe tiles
   with name, kind badge, star shapes (filled or hollow), kills and a bar to the next star */
.bsum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.bsum__card { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "i l" "i f" "b b" "x x"; column-gap: 8px; row-gap: 3px; align-items: center;
  min-height: var(--touch); padding: 8px 10px 9px; text-align: left; font: inherit; color: var(--ink);
  background: var(--parch-50); border: 1px solid var(--parch-300); border-radius: var(--r-2); box-shadow: 0 2px 0 var(--parch-300); }
.bsum__icon { grid-area: i; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--gold-300); }
.bsum__icon svg { width: 22px; height: 22px; }
.bsum__icon--page { color: #8fd27d; }
.bsum__lbl { grid-area: l; font: 600 12px/1 var(--font-ui); color: var(--ink-soft); align-self: end; }
.bsum__fig { grid-area: f; font: 800 20px/1.05 var(--font-num); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: clip; }
.bsum__fig small { font: 700 13px var(--font-num); color: var(--ink-faint); margin-left: 1px; }
.bsum__card > .fbar { grid-area: b; margin-top: 4px; }
.bsum__fx { grid-area: x; display: flex; align-items: center; gap: 5px; min-width: 0; margin-top: 3px; height: 26px; padding: 0 8px 0 5px; border-radius: 13px;
  background: var(--iron-800); color: var(--parch-100); font: 600 12px var(--font-ui); }
.bsum__fx svg, .bsum__fx img { width: 16px; height: 16px; flex: none; }
.bsum__fx b { margin-left: auto; font: 800 14px var(--font-num); color: var(--gold-200); }
.bsum__fx--gold { background: var(--gold-200); color: var(--gold-900); }
.bsum__fx--gold b { color: var(--gold-900); }
.fbar { position: relative; display: block; width: 100%; height: 6px; border-radius: 3px; background: var(--parch-300); overflow: hidden; }
.fbar > i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%); background: var(--gold-600); border-radius: 3px; }
.fbar--top > i { background: var(--gold-400); }

.breg { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 72px; margin-bottom: 10px;
  padding: 8px 8px 8px 8px; text-align: left; font: inherit; border-radius: var(--r-3); background: var(--iron-850); color: var(--parch-100);
  border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.breg--open { border-color: var(--gold-600); }
.breg__art { position: relative; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, var(--iron-600), var(--iron-900) 72%); border: 2px solid var(--gold-600); }
.breg__art > img { width: 94%; height: 94%; object-fit: contain; }
.breg__art > svg { width: 28px; height: 28px; color: var(--gold-300); }
.breg__mid { display: grid; gap: 4px; min-width: 0; }
.breg__name { font: 800 17px/1.1 var(--font-num); color: var(--parch-50); overflow-wrap: anywhere; }
.breg__row { display: flex; flex-wrap: wrap; column-gap: 12px; row-gap: 2px; }
.breg__stat { display: inline-flex; align-items: center; gap: 4px; font: 600 12px var(--font-ui); color: var(--iron-300); white-space: nowrap; }
.breg__stat b { font: 800 14px var(--font-num); color: var(--parch-50); }
.breg__stat svg { width: 14px; height: 14px; }
.breg__pg { color: #8fd27d; }
.breg .fbar { background: var(--iron-700); height: 5px; }
.breg .fbar > i { background: var(--gold-300); }
.breg__more { display: grid; justify-items: center; gap: 3px; min-width: 56px; padding: 6px 4px; border-radius: var(--r-2); background: var(--iron-800); border: 1px solid var(--iron-600); font: 700 11px var(--font-ui); color: var(--parch-100); }
.breg__grid { display: grid; grid-template-columns: repeat(2, 8px); gap: 3px; width: 19px; height: 19px; }
.breg__grid i { display: block; width: 8px; height: 8px; border-radius: 2px; background: var(--gold-300); }
.breg__grid--x { display: grid; place-items: center; grid-template-columns: 1fr; }
.breg__grid--x svg { width: 18px; height: 18px; color: var(--gold-300); }
.donemark { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ok); color: #fff; border: 2px solid var(--ink); }
.donemark svg { width: 13px; height: 13px; }
.st { width: 15px; height: 15px; color: var(--ink-faint); }
.st--on { color: var(--gold-400); }

.ftiles { --tile: 108px; }
.ftile { gap: 3px; padding: 10px 6px 9px; grid-template-rows: auto minmax(2.3em, 1fr) auto auto auto; align-content: stretch; }
.ftile .tile__art { width: 72px; height: 72px; margin-bottom: 6px; }
.ftile--top .tile__art { border-color: var(--gold-600); box-shadow: 0 0 0 2px var(--gold-300); }
.ftile__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; align-self: center; font: 700 13px/1.15 var(--font-ui); color: var(--ink); overflow-wrap: anywhere; }
.ftile__name--off { color: var(--ink-faint); font-weight: 600; }
.ftile .stars { display: inline-flex; gap: 1px; }
.ftile__kills { font: 700 12px var(--font-num); color: var(--ink-soft); }
.ftile .fbar { width: 80%; height: 5px; }
.tile--off .ftile__kills { color: var(--ink-faint); }
.kindb { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px 0 4px;
  border-radius: 4px; font: 700 11px/1 var(--font-ui); white-space: nowrap; border: 1.5px solid var(--ink); }
.kindb svg { width: 13px; height: 13px; }
.kindb--boss { background: var(--gold-300); color: var(--gold-900); }
.kindb--boss svg { color: var(--gold-600); }
.kindb--guard { background: var(--iron-800); color: var(--parch-100); }

.rtiles { --tile: 78px; gap: 6px; }
.rtile { gap: 2px; padding: 10px 4px 7px; }
.rtile.tile--on { padding-top: 10px; }
.rtile .ribbon { top: -2px; height: 16px; padding: 0 9px; font-size: 10px; }
.rtile .tile__art { width: 46px; height: 46px; margin-bottom: 2px; }
.rtile__name { font: 700 12px/1.15 var(--font-ui); max-width: 100%; overflow-wrap: anywhere; }
.rtile__name--off { color: var(--ink-faint); font: 700 12px var(--font-num); }
.rtile__fig { display: inline-flex; align-items: center; gap: 3px; font: 700 12px var(--font-num); color: var(--ink-soft); }
.rtile__fig .st { width: 13px; height: 13px; }
.rtile .fbar { width: 80%; height: 4px; }
.rtile .donemark { width: 20px; height: 20px; right: -6px; bottom: -4px; }

.pop .stars { display: inline-flex; gap: 2px; align-items: center; }
.pop .st { width: 18px; height: 18px; color: var(--iron-400); }
.pop .st--on { color: var(--gold-300); }
.popnext { display: grid; gap: 4px; margin-top: 10px; }
.popnext__lbl { font: 700 13px var(--font-num); color: var(--parch-100); }
.fbar--pop { height: 6px; background: var(--iron-700); }
.fbar--pop > i { background: var(--gold-300); }
.popglyph { display: grid; place-items: center; width: 100%; height: 100%; color: #8fd27d; }
.popglyph svg { width: 60%; height: 60%; }
.popglyph--star { color: var(--gold-300); }
@container (max-width: 330px) { .bsum__fig { font-size: 17px; } }
@media (max-width: 379px) { .bsum__card { padding: 7px 8px; column-gap: 6px; } .bsum__icon { width: 30px; height: 30px; } .bsum__fig { font-size: 17px; } .breg__more { min-width: 48px; } }

/* where the star fragments are spent: a chip beside the essence (a press opens the Stars chart), the tabs' up chevron on
   it when the fragments buy a constellation; the landfall card's "Spend fragments"; the More grid's Stars tile */
.hud__purse { display: flex; align-items: center; gap: 6px; flex: none; min-width: 0; }
.hud__row .rate--frag { flex: none; height: 24px; font-size: 14px; padding: 0 6px 0 4px; gap: 4px; overflow: visible; cursor: pointer; color: inherit; font-family: inherit; }
.rate--frag .num { color: var(--gold-200); }
.rate--frag .rate__pic { display: grid; place-items: center; }
.rate--frag .rate__pic img, .rate--frag .rate__pic svg { width: 18px; height: 18px; object-fit: contain; }
/* (the press area reaches 44 px tall around the 24 px chip) */
.rate--frag::before { content: ""; position: absolute; left: -2px; right: -2px; top: -10px; bottom: -10px; }
.rate--frag:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* (the chevron sits on the chip's top right corner, as the tabs' does on theirs, so it takes no width from the rates) */
.rate__up { position: absolute; top: -7px; right: -7px; width: 16px; height: 16px; border-radius: 4px; background: var(--gold-300); border: 2px solid var(--gold-900); color: var(--gold-900); display: grid; place-items: center; }
.rate__up[hidden] { display: none; }
.hud__row .rate--frag:has(.rate__up:not([hidden])) { padding-right: 11px; margin-right: 4px; }
@media (max-width: 400px) { .hud__row, .hud__purse { gap: 4px; } }
.rate .rate__up svg { width: 9px; height: 9px; }
.landfall__go { pointer-events: auto; margin-top: 6px; min-height: 44px; white-space: nowrap; }
.landfall__go svg { width: 20px; height: 20px; }
.tile__up { top: 6px; left: 6px; width: 22px; height: 22px; }
.tile__up svg { width: 12px; height: 12px; }
/* the Stars switch before stage 600: a padlock and the 600 shield on its button; the chart then a preview, each buy a
   padlock with "Stage 600" beside the cost */
.seg__lock { display: inline-flex; align-items: center; gap: 2px; margin-left: 2px; }
.seg button .seg__lock > svg { width: 16px; height: 16px; }
.seg__lock .shield--sm { width: 22px; height: 25px; padding-bottom: 2px; }
.seg__lock .shield--sm svg { width: 100%; height: 100%; }
.seg__lock .shield--sm .num { font-size: 10px; }
.const__lock { grid-area: buy; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; min-height: 44px; }
.const__lock[hidden] { display: none; }
.const__lock .pill img { width: 16px; height: 16px; object-fit: contain; }
/* the Set sail offer reads as a reward for sailing, not a balance: "Sail to collect" with the ship over it, the figure in
   a dashed gold outline (not the solid pills owned currency uses), the price beside it in the Starts over pictures
   struck through, and the fragments held now apart under it */
.voyoffer { display: grid; justify-items: center; gap: 4px; }
.voyoffer__lbl { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--gold-200); text-transform: uppercase; letter-spacing: .06em; }
.voyoffer__lbl svg { width: 20px; height: 20px; }
.voyoffer__row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; }
.voybox__fig--offer { padding: 4px 12px; border: 2px dashed var(--gold-400); border-radius: var(--r-3); background: rgba(13, 22, 38, .35); }
.voyoffer__cost { display: inline-flex; align-items: center; gap: 10px; }
.chipicon--x::after { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 3px; margin-top: -1.5px; background: var(--warn); border-radius: 2px; transform: rotate(-35deg); box-shadow: 0 0 0 1px var(--ink); }
.voyheld { height: 28px; gap: 4px; }
.voyheld img, .voyheld svg { width: 18px; height: 18px; object-fit: contain; }

/* The Save section (Settings): a save file, a recovery code, the Discord cloud */
.saveopts { --tile: 104px; }
.saveopt { min-height: 132px; }
.saveopt__art { width: 34px; height: 34px; color: var(--gold-300); }
.saveopt__na { font-size: 11px; font-weight: 600; color: var(--ink-soft); line-height: 1.2; }
.savetext { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.codebox { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: 8px 14px; padding: 16px 10px; border-radius: var(--r-3); background: var(--iron-900); color: var(--gold-200); font: 700 26px/1.1 ui-monospace, Consolas, "Courier New", monospace; letter-spacing: .04em; -webkit-user-select: text; user-select: text; }
.codeform { display: grid; gap: 6px; margin-top: 10px; }
.codein { min-height: var(--touch); padding: 8px 10px; font-size: 18px; letter-spacing: .06em; text-transform: uppercase; background: var(--parch-50); color: var(--ink); border: 2px solid var(--ink-soft); border-radius: var(--r-2); }
@media (max-width: 360px) { .codebox { grid-template-columns: repeat(2, auto); font-size: 22px; } }

/* The Save button: a chest with its state mark (a check, an alert, an up arrow) and one word, on the fight's region
   line beside the stage shield, as More's Save tile chip and in Settings. Each opens the Save panel. The chip is 24 px
   tall and its press reaches 44 px (the ::before), as the fragment chip's does */
.where__top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.where__top .where__name { flex: 0 1 auto; min-width: 0; }
.where__region { min-width: 0; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.savebtn { position: relative; flex: none; display: inline-flex; align-items: center; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.savebtn::before { content: ""; position: absolute; left: -4px; right: -4px; top: -10px; bottom: -10px; }
.savebtn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 13px; }
.savechip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px 0 4px; border-radius: 12px; background: rgba(22, 18, 14, .78); border: 1px solid var(--iron-600); color: var(--parch-100); font: 700 12px var(--font-ui); white-space: nowrap; }
.savechip__ic { position: relative; flex: none; width: 18px; height: 18px; }
.savechip__ic > svg { width: 18px; height: 18px; display: block; }
.savechip__mark { position: absolute; right: -5px; bottom: -4px; width: 12px; height: 12px; border-radius: 50%; display: grid; place-items: center; border: 1px solid #1a140e; }
.savechip__mark svg { width: 8px; height: 8px; }
.savechip--saved .savechip__mark { background: var(--jade-300); color: #10231a; }
.savechip--backup { border: 2px solid var(--gold-300); color: var(--gold-200); }
.savechip--backup .savechip__mark { background: var(--gold-300); color: #1a140e; }
.savechip--saving .savechip__mark { background: var(--parch-200); color: #1a140e; }
.savechip--saving .savechip__w { color: var(--parch-200); }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 541px) {
  .savechip { height: 30px; border-radius: 15px; font-size: 14px; padding: 0 10px 0 6px; }
  .savechip__ic, .savechip__ic > svg { width: 22px; height: 22px; }
  .savebtn::before { top: -7px; bottom: -7px; }
}
.updbtn { margin-left: 6px; }
.savechip--upd { border: 2px solid var(--jade-300); color: var(--jade-300); }
/* in More's Save tile and the Settings row the chip sits on parchment */
.saveart { display: grid; place-items: center; }
.saveart > svg { width: 44px; height: 44px; }
.savechip--pill { background: var(--iron-900); }
.savebtn--row { display: flex; width: 100%; min-height: var(--touch); justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: var(--r-3); background: var(--parch-100); border: 1px solid var(--parch-400); }
.savebtn--row::before { content: none; }
.savebtn--row:focus-visible { outline-color: var(--focus-on-parch); border-radius: var(--r-3); }
.savebtn__go { display: grid; place-items: center; color: var(--ink-soft); }
.savebtn__go svg { width: 16px; height: 16px; transform: rotate(90deg); }
/* the start screen's Load a save */
.start__load svg { width: 18px; height: 18px; margin-right: 6px; }

/* the Save panel says the three are alternatives, and what each one is */
.saveopts__intro { margin: 0 0 10px; font: 600 15px var(--font-ui); color: var(--ink); }
.saveopt__hint { font: 500 12px/1.25 var(--font-ui); color: var(--ink-soft); text-align: center; }

/* Round 16: the sheet head fits at every width and UI size. Its figures never shrink below their content (the essence
   is what the relics cost, so it always shows in full); ui.js steps through the fits until nothing overflows: the
   switch keeps its pictures only (--tight), then the Stars padlock drops its stage shield (the button's label keeps
   the stage) and the switch and amounts trim their padding (--tighter), then the amounts take a row of their own
   (--stack) */
.summary > * { flex: none; }
.summary .seg button { flex: none; }
.sheet__head--tighter .seg__lock .shield { display: none; }
.sheet__head--tighter .summary .seg button { padding: 0 6px; gap: 3px; }
.sheet__head--tighter .amount button { min-width: 44px; padding: 0 3px; font-size: 13px; }
.sheet__head--tighter .summary .seg ~ .summary__ess { font-size: 16px; }
.sheet__head--stack { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
.sheet__head--stack .amount { justify-self: end; }
.summary__ess { white-space: nowrap; }

/* Round 16: the UI size. These layers are drawn at var(--ui) (85 to 130 percent) with CSS zoom: the sheet and the
   specials keep their grid cells and the panels their column (the content inside is laid out smaller or larger), the
   HUD pieces over the fight keep their anchors; the canvas, the splats and the rising gains, all placed in the fight's
   own pixels, are not zoomed, so taps and the foe plate's framing stay true. Safe areas inside a zoomed layer are
   divided back, so a notch or a side band covers the same screen pixels at every size. The floating chips' column and
   the toast zoom their contents only, as ui.js places those boxes in the overlay's pixels. */
.sheet, .specials, .panel, .start, .hud, .foe, .tclock, .next, .qcard, .scard, .fcol > *, .toast > * {
  --uz: var(--ui);
  zoom: var(--uz);
  --sa-t: calc(var(--sa-t0) / var(--uz)); --sa-r: calc(var(--sa-r0) / var(--uz)); --sa-b: calc(var(--sa-b0) / var(--uz)); --sa-l: calc(var(--sa-l0) / var(--uz));
}
/* (the HUD over the fight is drawn smaller at 85 but not larger than 100: at 100 it already spans the fight's width
   with long figures, so a larger HUD would cut the gold and the rates and squeeze the foe under the plate) */
.hud, .foe, .tclock, .next, .qcard, .scard, .fcol > *, .toast > * { --uz: min(var(--ui), 1); }
/* (nested layers are not zoomed twice) */
:is(.sheet, .specials, .panel, .start, .hud, .foe, .tclock, .next, .qcard, .scard) :is(.sheet, .specials, .panel, .start, .hud, .foe, .tclock, .next, .qcard, .scard) { --uz: 1; --sa-t: inherit; --sa-r: inherit; --sa-b: inherit; --sa-l: inherit; }
/* the UI size choice: a tile with a letter at each size; the pressed one is filled and underlined (not color alone) */
.uisz button { width: 44px; min-width: 44px; padding: 0; justify-content: center; position: relative; }
.uisz__tile { display: grid; place-items: center; width: calc(26px * var(--k)); height: calc(26px * var(--k)); border: 2px solid currentColor; border-radius: 5px; font: 800 calc(16px * var(--k)) / 1 var(--font-num); }
.uisz button[aria-pressed="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 5px; height: 2px; background: currentColor; }
.uisz__row { display: flex; align-items: center; gap: 8px; }
.uisz__pct { min-width: 4ch; text-align: right; font: 700 14px var(--font-num); color: var(--ink); }
@media (max-width: 400px) { .set--ui { grid-template-columns: 40px minmax(0, 1fr); } .set--ui .uisz__row { grid-column: 1 / -1; justify-self: end; margin-bottom: 8px; } }
/* Round 16: press areas at the UI size. Every button in a zoomed layer keeps at least 44 screen px: --t44 is the
   own-pixel size that draws at 44 below 100 percent (0 at 100 and over, where nothing changes). The small ones grow
   their box; the switch, whose knob is drawn at fixed sizes, and the Save chip and the fragment chip reach further with an invisible press
   area instead. */
.sheet, .specials, .panel, .start, .hud, .foe, .tclock, .next, .qcard, .scard, .fcol > *, .toast > * {
  --t44: min(calc(44px / var(--uz)), calc(max(0, 1 - var(--uz)) * 1000px));
  --hx: max(0px, calc((44px / var(--uz) - 44px) / 2));
}
:where(.sheet, .specials, .panel, .start, .hud, .foe, .tclock, .next, .qcard, .scard, .fcol, .toast) button:where(:not(.savebtn, .switch, .rate--frag)) { min-width: var(--t44, 0px); min-height: var(--t44, 0px); }
/* (the buy amounts reach 44 screen px tall at every UI size, 100 and over included, where their own 36 px box would
   draw short) */
.sheet .amount button, .panel .amount button { min-width: max(44px, var(--t44, 0px)); min-height: calc(44px / var(--uz, 1)); }
.sheet .seg button, .panel .seg button, .start .seg button { min-width: max(44px, var(--t44, 0px)); min-height: var(--t44, 0px); }
.fcask { min-width: max(44px, var(--t44, 0px)); min-height: max(44px, var(--t44, 0px)); }
.switch { min-width: max(66px, var(--t44, 0px)); }
.switch::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: max(100%, calc(44px / var(--uz, 1))); transform: translateY(-50%); }
.hud .savebtn::before, .hud .rate--frag::before { top: calc(-10px - var(--hx, 0px)); bottom: calc(-10px - var(--hx, 0px)); }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 541px) { .hud .savebtn::before { top: calc(-7px - var(--hx, 0px)); bottom: calc(-7px - var(--hx, 0px)); } }

/* the Discord community: a More tile (the logo on Discord's own color), a quiet start screen link, a button atop What's new */
.commart { display: grid; place-items: center; width: 64%; aspect-ratio: 1; border-radius: 50%; background: #5865F2; }
.commart svg { width: 58%; height: 58%; }
.start__community { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.start__community svg { color: currentColor; }
.start__community svg use { fill: currentColor; }
.news__community { text-decoration: none; margin-bottom: 14px; }

/* the Heroes head's rank total opens a card: the rank steps in a row */
.rankpill--head { border: 0; cursor: pointer; position: relative; }
.rankpill--head::before { content: ""; position: absolute; inset: -7px -2px; }  /* a 44 px press area round the 30 px chip */
.ranksteps { list-style: none; margin: 8px 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.ranksteps__i { display: inline-flex; align-items: center; gap: 4px; font: 700 14px var(--font-ui); }

/* a first buy that unlocks shows an open padlock before its price */
.buy__cost .unl { width: 18px; height: 18px; flex: none; margin-right: 2px; }

/* The Heroes list's level target (Lv): the fifth buy amount, its target on the button, and a popover under the head's
   right end with a typed level and quick picks (the rank levels carry their rank chevrons). A hero at or past the
   target shows a check and the target in place of a price. */
.sheet__head { position: relative; }
.amount .amount__lv { white-space: nowrap; }
.sheet__head--tighter .amount .amount__lv { padding: 0 4px; }
.lvpop { position: absolute; z-index: 30; top: calc(100% - 4px); right: calc(var(--sa-r) + var(--gutter)); width: min(252px, calc(100% - 16px)); padding: 10px; border-radius: var(--r-3); background: var(--iron-900); color: var(--parch-100); border: 2px solid var(--gold-600); box-shadow: var(--ledge); display: grid; gap: 8px; }
.lvpop[hidden] { display: none; }
.lvpop:focus-visible { outline: 3px solid var(--focus); }
.lvpop::after { content: ""; position: absolute; top: -9px; right: 22px; width: 14px; height: 14px; background: var(--iron-900); border-left: 2px solid var(--gold-600); border-top: 2px solid var(--gold-600); transform: rotate(45deg); }
.lvpop__field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 6px; align-items: center; }
.lvpop__field label { grid-column: 1 / -1; font: 700 12px var(--font-ui); color: var(--iron-300); }
.lvpop__field input { min-width: 0; height: 44px; padding: 0 10px; font: 800 18px var(--font-num); background: var(--parch-50); color: var(--ink); border: 2px solid var(--ink-soft); border-radius: var(--r-2); }
.lvpop__field input[aria-invalid="true"] { border: 3px dashed var(--blood-600); }
.lvpop__set { min-width: 56px; height: 44px; padding: 0 12px; border-radius: var(--r-2); font: 800 14px var(--font-ui); background: linear-gradient(var(--gold-300), var(--gold-400)); color: var(--gold-900); border: 2px solid var(--gold-900); }
.lvpop__picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lvpop__picks button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border-radius: var(--r-2); background: var(--iron-800); color: var(--parch-100); border: 2px solid var(--iron-600); font: 800 15px var(--font-num); }
.lvpop__picks button[aria-pressed="true"] { background: var(--gold-300); color: var(--gold-900); border-color: var(--gold-900); text-decoration: underline; text-underline-offset: 3px; }
.lvpop__picks .rank--inline { color: var(--gold-300); }
.lvpop__picks button[aria-pressed="true"] .rank--inline { color: var(--gold-900); }
.buy:not(.buy--done) .buy__cost .chk { display: none; }
.buy--done { background: var(--parch-200); color: var(--ink); border: 2px solid var(--ink-soft); cursor: default; }
.buy--done .buy__cost { font-size: 15px; }
.buy--done .buy__cost .chk { width: 16px; height: 16px; stroke-width: 3; }
/* the level picker opening upward when there is more room above, and scrolling inside when it is still taller */
.lvpop { overscroll-behavior: contain; }
.lvpop.lvpop--up { top: auto; bottom: calc(100% - 4px); }
.lvpop.lvpop--up::after { top: auto; bottom: -9px; transform: rotate(225deg); }

/* Round 17: Expeditions and the Curio Cabinet */
.xtile { display: grid; grid-template-columns: 1fr 1fr; place-items: center; width: 100%; height: 100%; }
.xtile > img { width: 30px; height: auto; }
.xtile > img:first-child { grid-column: 1 / 3; }
.xruns, .xoffers, .xheroes { list-style: none; margin: 0; padding: 0; }
.xruns { display: grid; gap: 8px; }
.xrun { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 64px; padding: 6px 10px 6px 6px;
  border-radius: var(--r-3); background: radial-gradient(ellipse at 30% 30%, var(--iron-600), var(--iron-950) 80%); color: var(--parch-100); }
.xrun--free { background: var(--parch-100); color: var(--ink-soft); border: 2px dashed var(--parch-300); }
.xrun--home { box-shadow: 0 0 0 2px var(--gold-300) inset; }
.xrun__boss, .xoffer__boss { position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, var(--iron-600), var(--iron-900) 72%); border: 2px solid var(--ink); }
.xrun__boss > img, .xoffer__boss > img { width: 100%; height: 100%; object-fit: cover; }
.xrun__boss > .i, .xoffer__boss > .i { width: 28px; height: 28px; }
.xrun--free .xrun__boss { background: var(--parch-200); border-color: var(--parch-300); }
.xrun__mid { display: grid; gap: 4px; min-width: 0; }
.xrun__name { font-weight: 700; font-size: 14px; overflow: hidden; white-space: nowrap; }
.xrun__party { display: flex; gap: 4px; }
.xface { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; border: 2px solid var(--parch-50); background: var(--iron-800); }
.xface > img { width: 100%; height: 100%; object-fit: cover; }
.xrun .ring .num { font-size: 12px; color: var(--ink); }
.xrun__recall { min-width: 44px; min-height: 44px; padding: 0; }
.xoffers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.xoffer { display: grid; justify-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 10px 6px 8px; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--parch-50); border: 1px solid var(--parch-300); border-radius: var(--r-2); box-shadow: 0 2px 0 var(--parch-300); }
.xoffer .xoffer__boss { width: 64px; height: 64px; overflow: visible; }
.xoffer .xoffer__boss > img { border-radius: 50%; }
.xoffer .xoffer__boss .badge { position: absolute; right: -4px; bottom: -4px; }
.xoffer--taken { background: repeating-linear-gradient(135deg, var(--parch-100) 0 8px, var(--parch-200) 8px 16px); cursor: default; }
.xoffer--taken .xoffer__boss > img { filter: grayscale(1) brightness(.6); }
.xoffer__name { font-weight: 700; font-size: 13px; line-height: 1.15; text-align: center; }
.xoffer__pills { display: inline-flex; align-items: center; gap: 6px; }
.xoffer__pills .style, .xpick .style { position: static; }
.xoffer__rw { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.xrw { display: inline-flex; align-items: center; gap: 2px; font: 800 12px var(--font-num); }
.xrw > img, .xrw > .i { width: 20px; height: 20px; object-fit: contain; }
.xrw--new > img { filter: drop-shadow(0 0 3px var(--gold-300)); }
.xplate { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.xplate .pill > img { width: 18px; height: auto; }
.xcab { display: grid; gap: 4px; padding: 10px 8px 6px; border-radius: var(--r-3); background: linear-gradient(#4a3524, #2c1f15); border: 2px solid var(--ink); }
.xshelf { position: relative; }
.xshelf__row { list-style: none; margin: 0; padding: 0 0 6px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
@media (min-width: 560px) { .xshelf__row { grid-template-columns: repeat(10, minmax(0, 1fr)); } }
.xshelf__board { display: block; height: 8px; margin-top: -4px; border-radius: 2px; background: linear-gradient(#8a6440, #5a3e27); box-shadow: 0 3px 0 #1a120b; }
.xshelf--full .xshelf__board { background: linear-gradient(var(--gold-300), var(--gold-600)); }
.xcurio { position: relative; display: grid; justify-items: center; align-content: end; width: 100%; min-height: 48px; padding: 2px 0; border: 0; background: none; cursor: pointer; }
.xcurio > img { width: 40px; height: 36px; object-fit: contain; }
.xcurio--none > img { filter: brightness(0) opacity(.45); }
.xstars { display: inline-flex; gap: 0; color: var(--gold-300); }
.xstars > span { display: grid; opacity: .25; }
.xstars > span.on { opacity: 1; }
.xstars .i { width: 9px; height: 9px; }
.pop .xstars .i, .tile .xstars .i { width: 14px; height: 14px; }
.xpick { grid-template-columns: auto 1fr; align-items: center; justify-items: start; gap: 12px; }
.xpick .xoffer__boss { width: 64px; height: 64px; }
.xhaul { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin: 12px 2px 4px; }
.xhaul__bar { display: block; height: 14px; border-radius: 7px; background: var(--parch-200); border: 2px solid var(--ink); overflow: hidden; }
.xhaul__bar > i { display: block; height: 100%; width: calc(var(--p) * 100%); background: linear-gradient(var(--gold-300), var(--gold-600)); }
.xhaul .goldtext { font-size: 22px; }
.xnote { margin: 4px 2px 10px; font-size: 13px; color: var(--ink-soft); }
.xheroes { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.xhero { display: grid; justify-items: center; gap: 4px; width: 100%; min-height: 44px; padding: 8px 4px 6px; border: 2px solid transparent; border-radius: var(--r-2); background: var(--parch-50); cursor: pointer; font: inherit; color: var(--ink); }
.xhero .portrait { --portrait: 56px; overflow: visible; }
.xhero .portrait > img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-2); }
.xhero .portrait .style { position: absolute; top: -6px; left: -6px; }
.xhero .portrait .badge { position: absolute; right: -6px; bottom: -6px; }
.xhero--on { border-color: var(--gold-600); background: var(--parch-100); box-shadow: 0 0 0 2px var(--gold-300) inset; }
.xhero__sc { font: 800 13px var(--font-num); }
.xhome { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; }
.xfound .tile__name { font-size: 12px; }

/* Round 18: Automation */
.autoart { display: grid; place-items: center; color: var(--gold-300); }
.autoart > .i { width: 30px; height: 30px; }
.autoart--tile > .i { width: 36px; height: 36px; }
.autocards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.autocard { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-2);
  background: var(--parch-50); border: 1px solid var(--parch-300); box-shadow: 0 2px 0 var(--parch-300); }
.autocard--on { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok) inset, 0 2px 0 var(--parch-300); }
.autocard--off { background: repeating-linear-gradient(135deg, var(--parch-100) 0 8px, var(--parch-200) 8px 16px); }
.autocard--off .tile__art > * { filter: grayscale(1) brightness(.6); }
.autocard .tile__art > img { width: 70%; height: 70%; object-fit: contain; }
.autocard__txt { display: grid; gap: 3px; min-width: 0; }
.autocard__name { font-weight: 800; font-size: 15px; }
.autocard__desc { font-size: 13px; color: var(--ink-soft); line-height: 1.3; }
.autocard .switch { min-height: 44px; height: 44px; line-height: 44px; border-radius: 22px; }
.autocard .switch::after { top: 4px; width: 36px; height: 36px; }
.autocard .switch[aria-checked="true"]::after { left: 27px; }
.autostall { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.autostall .seg button { height: 44px; }

/* Menus as pop-ups (Settings, Menus): the sheet keeps only its tab bar (the folded layout), and an open tab lays its
   page over the fight as a panel does, its own head with the tab's name and a close button on top */
.sheet__pophead { display: none; }
.game--popup-open .sheet { position: static; }
.game--popup-open .sheet__main {
  display: flex; flex-direction: column; position: absolute; z-index: 38; left: 0; right: 0;
  /* (the whole screen above the tab bar: the sheet steps back so the page is placed against the game, and the tab bar
     is 56 px tall with a 2 px rule over it and the bottom inset under it) */
  top: var(--sa-t); bottom: calc(58px + var(--sa-b)); height: auto; min-height: 0; overflow: hidden;
  background: var(--parch-100); border-top: 3px solid var(--gold-600); border-radius: var(--r-3) var(--r-3) 0 0;
  box-shadow: 0 -10px 28px rgba(0, 0, 0, .5);
}
.game--popup-open .sheet__pophead {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px calc(var(--sa-r) + var(--gutter)) 8px calc(var(--sa-l) + var(--gutter));
  background: linear-gradient(var(--iron-800), var(--iron-900)); color: var(--parch-50); border-radius: var(--r-3) var(--r-3) 0 0;
}
.sheet__poptitle { margin: 0; font: 800 20px var(--font-num); }
.game--popup-open .tab[aria-selected="true"] { color: var(--gold-200); background: linear-gradient(var(--iron-700), var(--iron-800)); box-shadow: inset 0 3px 0 var(--gold-300); }
/* a panel opened from an open page (Map or Settings from More) takes the page's place, the same size (the Camp keeps its
   own height, its camp above it), and the page opens again when it closes */
.game--popup .panelwrap--page:not(:has(> .panel--camp)) { inset: auto; top: var(--pg-top); left: var(--pg-left); width: var(--pg-width); height: var(--pg-height); min-height: 0; }
/* (in pop-up mode no panel covers the tab bar, a panel opened from anywhere: the tabs stay in reach) */
.game--popup .panelwrap:not(.panelwrap--page) { bottom: calc(58px + var(--sa-b)); }
/* (the Camp from a page: its camp shows above it as before, and it stops at the tab bar, so the tabs stay in reach) */
/* (Nov 22: the Camp takes the whole screen above the tab bar too, like every page; its minimize button folds it to its
   head so the camp shows, and a press on the head or the button brings it back) */
.game--popup .panelwrap:has(> .panel--camp) { inset: auto 0 auto 0; top: var(--sa-t); bottom: calc(58px + var(--sa-b)); height: auto; min-height: 0; }
.game--popup .panelwrap--page:has(> .panel--camp) { inset: auto; left: var(--pg-left); width: var(--pg-width); top: var(--pg-top); bottom: calc(100% - var(--pg-top) - var(--pg-height)); height: auto; min-height: 0; }
.game--popup .panelwrap.panelwrap--min:has(> .panel--camp) { top: auto; }
.panelwrap--min .panel__body, .panelwrap--min .panel__actions { display: none; }
.panelwrap--min .panel__head { cursor: pointer; }
.campmin { display: none; }
.game--popup .campmin { display: grid; }
.campmin svg { transform: rotate(180deg); }
.panelwrap--min .campmin svg { transform: none; }
.panel__head:has(> .campmin) { grid-template-columns: auto minmax(0, 1fr) auto auto; }
/* beside the fight (a landscape phone, a tablet, a PC): the page opens left of the tab rail, the full height */
@media (orientation: landscape) and (max-height: 540px), (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 541px) {
  .game--popup-open .sheet { position: relative; }
  .game--popup-open .sheet__main {
    top: 0; bottom: 0; right: 100%; left: auto; width: var(--side-w); height: auto;
    border-top: 0; border-left: 3px solid var(--gold-600); border-radius: 0; box-shadow: -10px 0 28px rgba(0, 0, 0, .5);
  }
  .game--popup-open .sheet__pophead { border-radius: 0; padding-top: calc(var(--sa-t) + 8px); }
  .game--popup-open .tab[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--gold-300); }
  .game--popup .panelwrap:has(> .panel--camp) { inset: 0 0 0 auto; width: var(--side-w); height: auto; min-height: 0; }
  .game--popup .panelwrap--page:has(> .panel--camp) { inset: auto; left: var(--pg-left); width: var(--pg-width); top: var(--pg-top); bottom: calc(100% - var(--pg-top) - var(--pg-height)); }
  .game--popup .panelwrap.panelwrap--min:has(> .panel--camp) { top: auto; }
  .game--popup .panelwrap:not(.panelwrap--page) { bottom: 0; }
}
/* Use Specials: the specials it starts, each a toggle (a check or a cross on it, never color alone); a tap mark on the
   ones that pay off through the player's taps */
.autosp { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.autosp__b { position: relative; width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--r-2); background: var(--iron-800); border: 2px solid var(--iron-600); }
.autosp__b > img { width: 34px; height: 34px; object-fit: contain; }
.autosp__b[aria-pressed="false"] > img { filter: grayscale(1) brightness(.55); }
.autosp__b[aria-pressed="true"] { border-color: var(--ok); }
.autosp__b--locked { opacity: .6; }
.autosp__mark { position: absolute; right: -5px; bottom: -5px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--iron-600); color: #fff; border: 2px solid var(--parch-50); }
.autosp__b[aria-pressed="true"] .autosp__mark { background: var(--ok); }
.autosp__mark svg { width: 9px; height: 9px; }
.autosp__tap { position: absolute; left: -5px; top: -5px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-300); color: var(--gold-900); border: 2px solid var(--parch-50); }
.autosp__tap svg { width: 10px; height: 10px; }

/* Round 22: Visit a region (the map card's Visit button, the visit panel, the fight's visit look, the result card) */
.wmap__visit { min-height: 44px; padding: 0 12px; font-size: 15px; gap: 6px; }
.wmap__visit svg { width: 20px; height: 20px; }
.wmap__vn { display: inline-grid; place-items: center; min-width: 34px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--gold-900); color: var(--parch-50); font: 800 13px/22px var(--font-num); }
.visitbox { grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-items: start; gap: 6px 14px; padding: 10px 12px; }
.visitbox__art { position: relative; width: 128px; height: 128px; flex: none; }
.visitbox__art > img.vboss { width: 128px; height: 128px; object-fit: contain; }
.visitbox__art > img.vguard { position: absolute; left: -8px; bottom: -6px; width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.visitbox__art > svg { width: 64px; height: 64px; margin: 32px; color: var(--gold-300); }
.visitbox__crown { position: absolute; right: 2px; top: 0; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--gold-300); color: var(--gold-900); border: 2px solid var(--gold-900); }
.visitbox__crown svg { width: 15px; height: 15px; }
.visitbox__fig { display: grid; justify-items: start; gap: 6px; min-width: 0; }
.visitbox__name { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--parch-50); font: 800 18px/1.15 var(--font-num); text-align: left; cursor: pointer; }
.visitbox__name--plain { min-height: 0; cursor: default; }
.visitbox__more { width: 18px; height: 18px; flex: none; }
.visitbox__pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.visitbox .pill { height: 28px; font-size: 15px; }
.visitbox .goldtext small { font-size: 24px; color: var(--iron-300); }
.vfoes { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.vfoe { width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: radial-gradient(circle at 50% 40%, var(--iron-600), var(--iron-900) 72%); border: 2px solid var(--ink); }
.vfoe img { width: 92%; height: 92%; object-fit: contain; }
.vcharges { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vcharges .pill { height: 28px; font-size: 14px; }
.vpips { display: inline-flex; gap: 6px; }
.vpip { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--iron-800); border: 2px solid var(--gold-600); }
.vpip svg { width: 24px; height: 24px; }
.vpip--off { background: transparent; border: 2px dashed var(--iron-600); }
.vpip--off svg { opacity: .35; filter: grayscale(1); }
.vpets { --tile: 120px; justify-content: center; }
.vpet .tile__art { width: 76px; height: 76px; }
.vpet .tile__art img.r { width: 90%; height: 90%; object-fit: contain; }
.vpet .tile__art .lv { top: -9px; bottom: auto; }
.vpet .tile__fx { font-size: 15px; }
.fight--visit .foe { width: min(calc(100% - 2 * (var(--tclock, 68px) + var(--gutter) + 6px)), 420px); }
.fight--visit .tclock__ring { --rc: var(--jade-300); }
.fight--visit .tclock--low .tclock__ring { --rc: var(--blood-400); }
.visitend { justify-content: center; }
.vpet .tile__name { margin-top: 8px; }

/* Round 24: the Essence Forge. A socket on each relic tile (a 44px button holding a small set ring), the forge strip
   over the tiles, the gem ladder and the gem picker in the cards. */
.sock { position: absolute; top: 0; right: 0; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; background: none; cursor: pointer; }
.sock__in { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 50% 40%, var(--iron-800), var(--iron-950) 75%); border: 2px solid var(--iron-400); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .55); }
.sock__in img { width: 20px; height: 20px; object-fit: contain; image-rendering: pixelated; }
.sock--set .sock__in { border-color: var(--gold-400); background: radial-gradient(circle at 50% 40%, var(--iron-700), var(--iron-950) 75%); }
.sock--can .sock__in { box-shadow: inset 0 2px 3px rgba(0, 0, 0, .55), 0 0 0 2px var(--gold-200); }
.sock:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 50%; }
.sock--big { position: static; width: 56px; height: 56px; }
.sock--big .sock__in { width: 50px; height: 50px; }
.sock--big .sock__in img { width: 38px; height: 38px; }
.pop__head .portrait:has(.sock--big) { background: none; border: 0; }
.forgebar { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 56px; margin: 0 0 8px; padding: 6px 10px; border-radius: var(--r-2); border: 2px solid var(--ink); background: var(--iron-900); color: var(--parch-100); cursor: pointer; text-align: left; }
.forgebar[hidden] { display: none; }
.forgebar__art img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; display: block; }
.forgebar .ring .num { color: var(--parch-50); }
.forgebar__gems { flex: 1; min-width: 0; display: flex; justify-content: center; gap: 2px; }
.fgem img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; display: block; }
.fgem--off img { filter: grayscale(1) brightness(.4); }
.forgebar__ore { margin-left: auto; flex: none; }
.forgebar:focus-visible { outline: 3px solid var(--focus); }
.gemlad { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin-top: 6px; }
.gemlad span { display: grid; justify-items: center; gap: 1px; padding: 4px 0; border-radius: 4px; background: var(--iron-800); color: var(--iron-300); }
.gemlad img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; filter: grayscale(1) brightness(.5); }
.gemlad b { font-size: 11px; color: var(--parch-100); }
.gemlad small { font-size: 10px; }
.gemlad span.got { background: var(--gold-800); }
.gemlad span.got img { filter: none; }
.gemlad span.got b { color: var(--gold-200); }
.gempick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.gemb { min-height: 52px; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 4px 0; border-radius: 6px; border: 2px solid transparent; background: var(--iron-800); color: var(--parch-100); font: 800 12px var(--font-num); }
.gemb img { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; }
.gemb .num { display: inline-flex; align-items: center; gap: 2px; }
.gemb svg { width: 12px; height: 12px; }
button.gemb { cursor: pointer; }
.gemb[aria-pressed="true"] { border-color: var(--gold-300); background: var(--gold-800); color: var(--gold-200); }
.gemb--had { opacity: .55; }
.gemb--had .num { color: var(--jade-300); }
.gemb--off img { filter: grayscale(1) brightness(.45); }
.gemb--off { color: var(--iron-300); }
.gemcut { align-items: center; flex-wrap: wrap; }
.gemcut .pill { flex: none; }
.gemcut .pill img { object-fit: contain; image-rendering: pixelated; }
.pill--short { background: var(--blood-900); color: var(--parch-100); border: 1px solid var(--blood-400); }

/* Round 25: Boss Rush. The entry panel's fan of bosses beside the best, the lineup as a strip of small portraits (the
   best rush's lit gold, the milestones marked), the crown pips and the milestone tiles; the fight's ring in gold. */
.rushbox { grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-items: start; gap: 6px 14px; padding: 10px 12px; }
.rushfan { position: relative; width: 128px; height: 128px; flex: none; display: grid; place-items: center; }
.rushfan > img { position: absolute; object-fit: contain; }
.rushfan > img.rf0 { inset: 0; width: 128px; height: 128px; z-index: 1; }
.rushfan > img.rf1, .rushfan > img.rf2 { bottom: -4px; width: 56px; height: 56px; filter: brightness(.55) drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.rushfan > img.rf1 { left: -12px; }
.rushfan > img.rf2 { right: -12px; }
.rushfan > svg { width: 64px; height: 64px; color: var(--gold-300); }
.rushbox__fig { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.rushbox__fig .goldtext { font-size: 48px; line-height: 1; }
.rushbox__fig .goldtext small { font-size: 22px; color: var(--iron-300); }
.rushbox__fig .lbl { font-size: 12px; color: var(--iron-300); }
.rushbox .pill { height: 28px; font-size: 15px; }
.rplus { margin-left: 4px; font-size: 12px; color: var(--jade-300); }
.rstrip { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; }
.rboss { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 50% 40%, var(--iron-600), var(--iron-900) 72%); border: 2px solid var(--ink); }
.rboss img { width: 92%; height: 92%; object-fit: contain; filter: brightness(.6); }
.rboss--beat { border-color: var(--gold-300); }
.rboss--beat img { filter: none; }
.rboss--now { border: 2px dashed var(--gold-300); }
.rboss--now img { filter: none; }
.rboss__m { position: absolute; right: -5px; bottom: -5px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--parch-100); border: 1.5px solid var(--ink); color: var(--jade-800); }
.rboss__m svg { width: 12px; height: 12px; }
.rpip svg { color: var(--gold-300); }
.rmiles { --tile: 96px; justify-content: center; }
.rmile .tile__art { width: 64px; height: 64px; }
.rmile .tile__art img.px { width: 36px; height: 36px; }
.rmile .trw { width: 52px; height: 44px; }
.rmile .trw img { width: 48px; height: 40px; }
.rmile .tile__art .lv { top: -9px; bottom: auto; }
.rmile .tile__fx { font-size: 14px; }
.rmile__ess { display: grid; place-items: center; color: var(--jade-300); }
.rmile__ess svg { width: 34px; height: 34px; }
.tile--big .rmile__ess svg { width: 56px; height: 56px; }
.tile--big .trw { width: 84px; height: 72px; }
.tile--big .trw img { width: 80px; height: 66px; }
.fight--rush .foe { width: min(calc(100% - 2 * (var(--tclock, 68px) + var(--gutter) + 6px)), 420px); }
.fight--rush .tclock__ring { --rc: var(--gold-300); }
.fight--rush .tclock--low .tclock__ring { --rc: var(--blood-400); }

/* Nov 22: the HUD sized by the fight's own width, not the screen's: a tablet or an unfolded Fold sideways with the sheet
   docked leaves the fight about 500 px wide, where the tablet's 46 px gold ran over the Save chip and the rates lost
   their "/s" */
.fight__overlay { container: fight / inline-size; }
@container fight (max-width: 640px) {
  .hud { --gold-fs: 32px; }
  .hud .rate { height: 28px; font-size: 15px; padding: 0 8px 0 5px; }
  .hud .rate img, .hud .rate svg { width: 18px; height: 18px; }
}

/* Round 27: Deeper laps. The frost badge on the stage shield's corner, mastery stars (a frost colored star), the Depths
   page of the collection log (the head ring, a ring per depth, boss tiles with their stars) */
.shield__depth { position: absolute; right: -9px; top: -5px; display: inline-flex; align-items: center; gap: 1px; height: 20px; padding: 0 5px 0 3px; border-radius: 10px; background: #1d3340; border: 1px solid var(--water-300); box-shadow: 0 1px 0 #000; color: #e4f6fa; font: 800 12px/1 var(--font-num); pointer-events: none; }
.shield__depth[hidden] { display: none; }
.shield .shield__depth svg { position: static; width: 12px; height: 12px; color: var(--water-300); }
.mstar { color: var(--water-300); }
.pill--deep { background: #1d3340; color: #d4f1f7; border: 1px solid var(--water-600); }
.pill--deep svg.mstar { width: 15px; height: 15px; }
.logpages .dglyph { color: var(--water-600); width: 24px; height: 24px; }
.popglyph--deep { color: var(--water-300); }
.dhead { gap: 14px; }
.dhead__ring { display: grid; place-items: center; min-width: 76px; min-height: 76px; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.dhead__ring .ring { --ri: #13222b; --rw: 6px; }
.dhead__fig { display: grid; justify-items: center; line-height: 1; color: #e4f6fa; }
.dhead__fig svg { width: 22px; height: 22px; }
.dhead__fig .num { font-size: 15px; }
.dhead__pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dlaps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.dlap { display: grid; justify-items: center; gap: 2px; width: 56px; }
.dlap .ring { --ri: #13222b; }
.dlap__n { color: #e4f6fa; font-size: 15px; }
.dlap__got { font-size: 11px; color: var(--ink-soft); }
.dlap--here .ring { box-shadow: 0 0 0 2px var(--parch-50), 0 0 0 4px var(--water-600); }
.dtile .tile__art { background: radial-gradient(circle at 50% 40%, #3b5566, #101b22 72%); }
.dtile--none .tile__art > img { filter: saturate(.4) brightness(.8); }
.dbadge { position: absolute; right: -10px; bottom: -6px; display: inline-flex; align-items: center; gap: 1px; height: 20px; padding: 0 5px 0 2px; border-radius: 10px; background: #1d3340; border: 1px solid var(--water-600); color: #e4f6fa; font-size: 12px; }
.dbadge svg { width: 14px; height: 14px; }

/* Round 29: the Quests page in chapters. The head ring opens the rules; a strip of chapters (the first lap, then one a
   depth, each a ring of its quests finished or a padlock over the stage it opens at) scrolls sideways on its own */
.qhead__ring { display: grid; place-items: center; min-width: 56px; min-height: 56px; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.qdeps { position: relative; box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; contain: inline-size; display: flex; gap: 6px; margin: 0 0 4px; padding: 4px 2px 8px; list-style: none; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; }
.qdeps > li { flex: none; scroll-snap-align: center; }
.qdep { display: grid; justify-items: center; gap: 2px; min-width: 56px; min-height: 64px; padding: 4px 2px; border: 0; border-radius: var(--r-2); background: none; color: inherit; cursor: pointer; }
.qdep .ring svg { width: 20px; height: 20px; color: var(--gold-600); }
.qdep--deep .ring { --ri: #13222b; }
.qdep--deep .ring svg { color: #9fc3cf; }
.qdep__n { color: #e4f6fa; font-size: 15px; }
.qdep__got { font-size: 11px; color: var(--ink-soft); }
.qdep--locked .ring { opacity: .6; }
.qdep[aria-pressed="true"] { background: var(--parch-200); box-shadow: inset 0 0 0 2px var(--ink); }
.qdep[aria-pressed="true"] .qdep__got { color: var(--ink); font-weight: 800; }
h3.qsec > svg.i { width: 18px; height: 18px; color: var(--water-600); }

/* Nov 22: where a side inset is a status bar down one edge (icons at its top), the folded rail stands in that strip
   below the icons instead of beside it (game--railin, set in ui.js); the fight gets the rail's width back */
@media (orientation: landscape) and (max-height: 540px) {
  .game--sheet-off.game--railin { grid-template-columns: auto minmax(0, 1fr) max(60px, var(--sa-r)); }
}
@media (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 541px) {
  .game--sheet-off.game--railin { grid-template-columns: minmax(0, 1fr) max(72px, var(--sa-r)); }
}
@media (orientation: landscape) and (max-height: 540px), (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 541px) {
  .game--sheet-off.game--railin .tabs { padding: calc(var(--sa-t) + 150px) 0 var(--sa-b) 0; }
}
/* (and the open sheet's contents run into that strip below the tab bar, which covers the icons; a panel's head keeps
   clear of them for its close button) */
.game--railin:not(.game--sheet-off) :is(.sheet__head, .sheet__body), .game--railin :is(.panel__body, .panel__actions) { padding-right: var(--gutter); }
