:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 500;
  --night: #130e23;
  --ink: #24142c;
  --plum: #302043;
  --pale: #fdf0d6;
  --muted: #dfcddf;
  --gold: #f6ce82;
  --bronze: #ac7c4c;
  --serif: Georgia, 'Times New Roman', serif;
  --frame: 1px solid #a77863;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-inline-size: 280px; background: var(--night); }
body {
  margin: 0;
  min-block-size: 100vh;
  color: var(--pale);
  background:
    radial-gradient(ellipse at 50% -12%, #4d315f, transparent 58%),
    radial-gradient(ellipse at 92% 64%, #123c47 0, transparent 44%),
    #130e23;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: #f7d28533; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
a { color: inherit; }
:where(a, button, input):focus-visible { outline: 2px solid #a5ffeb; outline-offset: 3px; }

.game-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  max-inline-size: 1230px;
  min-block-size: 100vh;
  min-block-size: 100dvh;
  margin-inline: auto;
  padding: 10px clamp(10px, 2vw, 25px) max(10px, env(safe-area-inset-bottom));
}

.masthead {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  align-items: center;
  gap: clamp(4px, 1.4vw, 18px);
  min-block-size: 60px;
  padding: 4px clamp(6px, 1vw, 12px);
  border-block-end: 1px solid #e3b28c68;
  background: linear-gradient(90deg, #1b1227 0%, #352444a0 52%, #1b1227 100%);
  border-radius: 14px 14px 2px 2px;
}

.masthead::after {
  position: absolute;
  inset: auto 0 -4px;
  border-block-end: 1px solid #e3b28c2f;
  content: '';
  pointer-events: none;
}

.all-games, .audio-controls button, .controls button, .scene-card button, dialog button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-block-size: 38px;
  padding: 5px 12px;
  border: 1px solid #9e735f;
  border-radius: 7px;
  color: var(--pale);
  background: linear-gradient(160deg, #432b55, #201729);
  box-shadow: inset 0 1px 0 #f4b2c833, 0 2px 3px #0e071f88;
  text-decoration: none;
}

.all-games { justify-self: start; white-space: nowrap; font-size: .81rem; font-weight: 700; }
.all-games:hover, button:not(:disabled):hover { filter: brightness(1.15); }
.all-games:active, button:not(:disabled):active { filter: brightness(.94); }

.brand { margin: 0; text-align: center; white-space: nowrap; }
.brand::before {
  display: block;
  block-size: 11px;
  margin-block-end: 1px;
  color: #a3f4ff;
  font-size: 10px;
  line-height: 1;
  text-shadow: -8px 4px #c476d6, 8px 4px #ffd884, 0 0 8px #77edff;
  content: '◆';
}
.brand h1, .brand strong, h1.brand {
  margin: 0;
  color: #ffdf9c;
  font: 700 clamp(24px, 4.2vw, 43px)/.99 var(--serif);
  letter-spacing: -.065em;
  text-shadow: 0 2px 0 #844766, 0 5px 13px #0b0519;
}
.brand small, .brand p, .brand span { display: block; margin: 4px 0 0; color: var(--muted); font-size: .61rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.audio-controls { justify-self: end; display: flex; align-items: center; gap: clamp(3px, .6vw, 8px); }
.audio-controls button { min-inline-size: 38px; min-block-size: 38px; padding: 3px; }
.audio-controls button[aria-pressed='true'] { border-color: #c38faf; color: #ffcedc; background: #4a2547; }
.audio-controls svg { inline-size: 18px; block-size: 18px; pointer-events: none; }
.audio-controls input[type='range'] { min-inline-size: 0; inline-size: clamp(35px, 7vw, 86px); margin: 0; accent-color: var(--gold); }

.playfield {
  isolation: isolate;
  position: relative;
  display: flex;
  flex-direction: column;
  min-block-size: 465px;
  overflow: hidden;
  border: var(--frame);
  border-radius: 19px 19px 12px 12px;
  background:
    linear-gradient(180deg, #2318329e, transparent 21%, #0d324331 66%, #100e2f8c),
    url('/assets/prism-isles.webp') center 51% / cover,
    linear-gradient(143deg, #a77cae, #316a78 42%, #195369 69%, #2e234d);
  box-shadow: inset 0 0 0 3px #f2c19330, inset 0 0 65px #0f092279, 0 6px 24px #0e091d9f;
}

.playfield::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% -8%, #e4d5f297 0, #c8b6dc55 28%, transparent 53%),
    linear-gradient(180deg, #24133260, transparent 23%, transparent 76%, #120d2582);
  content: '';
  pointer-events: none;
}

.chapter-badge, .run-hud {
  position: absolute;
  z-index: 3;
  inset-block-start: clamp(8px, 1.7vw, 18px);
  padding: 7px clamp(8px, 1.2vw, 14px);
  border: 1px solid #d4aa75ae;
  color: #fff1d6;
  background: linear-gradient(155deg, #3e2355eb, #1c1329f2);
  box-shadow: inset 0 1px #eec69940, 0 4px 10px #0c0c2588;
  text-shadow: 0 2px 2px #201029;
}

.chapter-badge {
  inset-inline-start: clamp(8px, 1.7vw, 18px);
  border-radius: 4px 13px 4px 12px;
  color: #ffe5a4;
  font: 700 clamp(12px, 1.8vw, 18px)/1.2 var(--serif);
}
.chapter-badge small, .chapter-badge span { display: block; font: 700 .58rem/1.2 system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.run-hud { inset-inline-end: clamp(8px, 1.7vw, 18px); display: flex; align-items: center; gap: clamp(5px, 1.1vw, 14px); border-radius: 11px 4px 12px 4px; }
.run-hud > * { margin: 0; }
.run-hud :where(.clock-group, .score-group) { display: flex; align-items: baseline; gap: 4px; }
.run-hud :where(.clock-group, .score-group) :where(small, label) { color: var(--muted); font-size: .61rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.score-group { padding-inline-start: 7px; border-inline-start: 1px solid #c996768c; }
#phase-label { color: #ead7ee; font-size: clamp(.62rem, 1.4vw, .78rem); font-weight: 760; letter-spacing: .045em; text-transform: uppercase; }
#timer, #score { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
#timer { color: #e0fbff; }
#score { color: #ffe0a0; }

.river {
  position: absolute;
  inset: 51px clamp(5px, 1.5vw, 22px) 9px;
  isolation: isolate;
}
.river::before, .river::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: '';
  pointer-events: none;
}
.river::before { background: radial-gradient(ellipse 42% 90% at 50% 44%, #6ee6e52e, #19444e0f 73%, transparent); }
.river::after {
  inset: 8% 15% 5%;
  background: radial-gradient(circle at 11% 20%, #ffe6b8 0 1px, transparent 3px),
    radial-gradient(circle at 73% 17%, #a9ffec 0 1px, transparent 4px),
    radial-gradient(circle at 22% 72%, #f8d4fe 0 1px, transparent 3px),
    radial-gradient(circle at 86% 49%, #a9ffec 0 1px, transparent 4px),
    radial-gradient(circle at 66% 81%, #ffe2b8 0 1px, transparent 3px);
  filter: drop-shadow(0 0 4px #c0ffee);
}
#boards { position: absolute; inset: 0; }

.drifter {
  --tile-size: clamp(32px, 4.4vmin, 48px);
  --shell-light: #97766b;
  --shell-mid: #5b2f42;
  --shell-deep: #302035;
  --rim: #dfac69;
  --lane: 50%;
  --drift: 0;
  position: absolute;
  inset-inline-start: clamp(118px, var(--lane), calc(100% - 118px));
  inset-block-start: calc(26% + 25% * var(--drift));
  display: grid;
  justify-items: center;
  gap: 5px;
  inline-size: max-content;
  padding: 8px 12px 12px;
  isolation: isolate;
  transform: translate(-50%, -21%);
  filter: drop-shadow(0 8px 9px #190f2da6);
}

.drifter::before, .drifter::after { position: absolute; z-index: -1; content: ''; pointer-events: none; }
.drifter::before {
  inset: 15px 0 0;
  border: 2px solid var(--rim);
  border-radius: 27% 19% 23% 23% / 16% 16% 17% 17%;
  background:
    linear-gradient(90deg, #1b162a50, transparent 19% 81%, #1b162a50),
    repeating-linear-gradient(0deg, #24172e55 0 1px, transparent 1px 15px),
    linear-gradient(135deg, var(--shell-light), var(--shell-mid) 55%, var(--shell-deep));
  box-shadow: inset 0 0 0 3px #1a0a3066, inset 0 0 0 5px #fed7983a, 0 3px 0 #251535;
}
.drifter::after {
  inset: auto 8% -5px;
  block-size: 14px;
  border-block-end: 2px solid #a2ffffc7;
  border-radius: 50%;
  box-shadow: 0 3px 7px #79e5df4f;
  opacity: .75;
}
.drifter[data-kind='chest'] { --shell-light: #c18364; --shell-mid: #784045; --shell-deep: #46243d; }
.drifter[data-kind='chest']::before {
  border-radius: 15% 18% 18% 18% / 12% 14% 14% 14%;
  background:
    linear-gradient(90deg, transparent 7%, #f3c17ec2 7% 12%, transparent 12% 88%, #f3c17ec2 88% 93%, transparent 93%),
    repeating-linear-gradient(0deg, #2a142d9c 0 1px, transparent 1px 15px),
    linear-gradient(135deg, var(--shell-light), var(--shell-mid) 55%, var(--shell-deep));
}
.drifter[data-kind='barrel'] { --shell-light: #c69162; --shell-mid: #694241; --shell-deep: #392a38; --rim: #e2c28a; }
.drifter[data-kind='barrel']::before {
  border-radius: 39% 40% 28% 27% / 22% 22% 23% 23%;
  background: linear-gradient(180deg, transparent 15%, #c19156c2 15% 22%, transparent 22% 78%, #ba8856 78% 83%, transparent 83%),
    repeating-linear-gradient(90deg, #27182a50 0 2px, transparent 2px 16px),
    linear-gradient(140deg, var(--shell-light), var(--shell-mid) 55%, var(--shell-deep));
}
.drifter[data-kind='raft'] { --shell-light: #bd9165; --shell-mid: #704650; --rim: #e5c591; }
.drifter[data-kind='turtle'], .drifter[data-kind='fish'] { --shell-light: #77b28f; --shell-mid: #357a75; --shell-deep: #163743; --rim: #b4ddb4; }
.drifter[data-kind='turtle']::before, .drifter[data-kind='fish']::before { border-radius: 40% 42% 35% 35% / 27% 27% 26% 26%; }
.drifter[data-kind='crystal'], .drifter[data-kind='shard'], .drifter[data-kind='lantern'], .drifter[data-kind='relic'], .drifter[data-kind='mushroom'] {
  --shell-light: #a772be;
  --shell-mid: #633384;
  --shell-deep: #292449;
  --rim: #d9a6e0;
}
.drifter[data-kind='crystal']::before, .drifter[data-kind='shard']::before, .drifter[data-kind='relic']::before {
  clip-path: polygon(50% 0, 76% 12%, 98% 37%, 100% 64%, 79% 89%, 53% 100%, 28% 92%, 3% 67%, 0 39%, 24% 14%);
  border-radius: 28%;
  background: conic-gradient(from 5deg at 48% 49%, #d28cf1, #65468b, #594388, #2e778e, #c477ce, #7147a0, #d28cf1);
}
.drifter.compact {
  --tile-size: clamp(29px, 4.1vmin, 40px);
  inset-inline-start: clamp(70px, var(--lane), calc(100% - 70px));
  inset-block-start: calc(31% + 24% * var(--drift) + .12 * var(--lane));
  padding: 7px 8px 10px;
}
.drifter.boss {
  --tile-size: clamp(35px, 5.4vmin, 55px);
  --shell-light: #7a9a78;
  --shell-mid: #3c686d;
  --shell-deep: #20243d;
  --rim: #e5c88a;
  inset-inline-start: 50%;
  inset-block-start: 54%;
  padding: 11px 17px 15px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 12px #68e9c59b) drop-shadow(0 9px 14px #16132ec9);
}
.drifter.boss::before {
  inset: 7px 0 0;
  border-radius: 34% 33% 26% 26% / 18% 18% 16% 16%;
  background: radial-gradient(ellipse at 50% 17%, #b5db9269, transparent 53%),
    repeating-linear-gradient(45deg, transparent 0 13px, #101c4040 13px 14px),
    linear-gradient(137deg, var(--shell-light), var(--shell-mid) 57%, var(--shell-deep));
}
.drifter.boss::after { border-color: #ecfffb; box-shadow: 0 3px 9px #a7ffffaf, 0 6px 19px #5df2e184; }
.guardian-art {
  position: absolute;
  z-index: -1;
  inline-size: 181%;
  block-size: 156%;
  inset: 52% auto auto 40%;
  transform: translate(-50%, -50%);
  visibility: hidden;
  pointer-events: none;
}
.drifter.boss.has-art::before { display: none; }
.drifter.boss.has-art::after { inset: auto -21% -24%; }
.drifter.boss.has-art .guardian-art { visibility: visible; }
.drifter.boss.has-art .board-label { transform: translateY(-28px); }
.drifter.boss.has-art.resolved .guardian-art { filter: brightness(1.15) saturate(1.35); }

.board-label {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  column-gap: 8px;
  max-inline-size: 100%;
  margin: 0;
  padding: 3px 9px 4px;
  border: 1px solid #edbd80c7;
  border-radius: 6px 6px 9px 9px;
  color: #fff1d3;
  background: linear-gradient(140deg, #482b55, #201529);
  box-shadow: inset 0 0 0 1px #eec0923a, 0 2px 5px #1e123f8f;
  font-size: clamp(.61rem, 1.55vw, .84rem);
  font-weight: 760;
  line-height: 1.15;
  text-align: center;
}
.board-label strong { color: #ffe6a9; font-family: var(--serif); }
.board-label small { color: #f8dfb4; font-size: .8em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.drifter.boss .board-label { font-size: clamp(.8rem, 2vw, 1.05rem); }
.drifter.boss .board-label::before, .drifter.boss .board-label::after {
  color: #aaf1fa;
  font-size: .75em;
  text-shadow: 0 0 6px #b57ef4;
  content: '◆';
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), var(--tile-size));
  grid-template-rows: repeat(var(--rows, 1), var(--tile-size));
  grid-auto-columns: var(--tile-size);
  grid-auto-rows: var(--tile-size);
  gap: clamp(2px, .35vmin, 4px);
  inline-size: max-content;
}
.tile {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: var(--tile-size);
  block-size: var(--tile-size);
  min-inline-size: 0;
  padding: 0;
  border: 1px solid #a6694a;
  border-radius: 5px;
  color: #302036;
  background: linear-gradient(155deg, #fff6df, #ffe8bc 57%, #ecc289);
  box-shadow: inset 0 2px 0 #fffef1b8, inset 0 -3px 0 #d4a16d8f, 0 2px 2px #20122a95;
  font-size: calc(var(--tile-size) * .62);
  font-weight: 850;
  line-height: 1;
  text-shadow: 0 1px #fffbe9b3;
  user-select: none;
}
.tile.wild {
  color: #2e527a;
  border-color: #779cb7;
  background: linear-gradient(145deg, #eafffb, #d9eafa 65%, #b8c5e3);
  box-shadow: inset 0 2px #fff, inset 0 -3px #879ed46b, 0 2px 2px #18192d9c;
}
.tile-value {
  position: absolute;
  inset-inline-end: 16%;
  inset-block-end: 12%;
  color: currentColor;
  font: 750 clamp(8px, calc(var(--tile-size) * .24), 13px)/1 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.tile-face { translate: -.03em -.08em; pointer-events: none; }
.tile.wild:empty::after { color: #3b5c86; font-size: .64em; content: '✧'; }
.tile.candidate {
  z-index: 1;
  color: #30132b;
  border-color: #8d4917;
  background: linear-gradient(145deg, #fff5a9, #ffd15c 60%, #ffad43);
  box-shadow: inset 0 2px #fffbd6, inset 0 -3px #d491329e, 0 0 0 1px #fff1a9, 0 0 10px 2px #ffd879bd;
}
.tile.chosen {
  z-index: 2;
  outline: 2px solid #fff7d3;
  outline-offset: -3px;
  box-shadow: inset 0 0 0 4px #7a3f365f, 0 0 0 2px #cb6f13, 0 0 14px 3px #fff4b7;
}
.tile.charred {
  color: transparent;
  border-color: #392435;
  background: radial-gradient(circle at 34% 66%, #d66b40 0 1px, transparent 2px),
    radial-gradient(circle at 67% 44%, #b94d3a 0 1px, transparent 2px),
    repeating-linear-gradient(42deg, transparent 0 5px, #9b5a4d42 5px 6px),
    linear-gradient(144deg, #4d3746, #291d2b 73%);
  box-shadow: inset 0 1px 6px #190f24c9, 0 1px 1px #ffc18a55;
  text-shadow: none;
}
.tile.charred::after { content: none; }

.scene-overlay {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: clamp(12px, 4vmin, 36px);
  background: radial-gradient(ellipse at center, #21133251, #201330ac);
}
.scene-card, dialog {
  position: relative;
  inline-size: min(100%, 610px);
  max-block-size: 100%;
  overflow: auto;
  padding: clamp(16px, 5vmin, 38px);
  border: 1px solid #e0af79;
  border-radius: 18px 8px 18px 8px;
  color: var(--pale);
  background: radial-gradient(ellipse at 50% 0, #5b3864, #2c1c40 54%, #1a132b 100%);
  box-shadow: inset 0 0 0 3px #29183b, inset 0 0 0 4px #e6bd7d75, 0 11px 38px #120c26a8;
  text-align: center;
}
.scene-card::before { display: block; margin: -3px 0 6px; color: #ffe4a0; font-size: 1.22rem; letter-spacing: .5em; text-indent: .5em; text-shadow: 0 0 14px #fcc5f5; content: '✦ ◆ ✦'; }
.scene-card :where(h1, h2), dialog h2 { margin: 0 0 10px; color: #ffe3a0; font: 700 clamp(1.8rem, 7vmin, 4rem)/.98 var(--serif); letter-spacing: -.055em; text-shadow: 0 2px 0 #8b4e66, 0 5px 18px #140d29; }
.scene-card h3 { margin: 1rem 0 .4rem; color: #ffe3a7; font-family: var(--serif); }
.scene-card p, dialog p { max-inline-size: 42ch; margin: .75em auto; color: #f3e2f2; font-size: clamp(.84rem, 2.5vmin, 1rem); line-height: 1.5; }
.scene-card .eyebrow { margin-block: .45rem .65rem; color: #f2bbcd; font-size: .66rem; font-weight: 800; letter-spacing: .19em; text-transform: uppercase; }
.scene-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-block-start: 16px; }
.result-totals {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 7px 14px;
  margin-block: 12px;
  color: #fff0c3;
  font-variant-numeric: tabular-nums;
}
.result-totals strong {
  flex-basis: 100%;
  font: 700 clamp(1.5rem, 5vmin, 2.5rem)/1.1 var(--serif);
}
.result-totals span { color: var(--muted); font-size: .82rem; }
.scene-card .word-list { display: grid; gap: 2px; padding: 0; list-style: none; text-align: start; }
.word-list li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-block-end: 1px solid #d9a6d14a; font-variant-numeric: tabular-nums; }
.scene-card :where(input, select):not([type='range']) { min-block-size: 42px; max-inline-size: 100%; padding: 6px 11px; border: 1px solid #caa579; border-radius: 6px; color: var(--pale); background: #20142e; }
.scene-card label { display: inline-block; max-inline-size: 100%; }
.scene-card ul, .scene-card ol { padding-inline-start: 1.45em; text-align: start; }
.scene-card li + li { margin-block-start: .35em; }
.scene-card table { inline-size: 100%; border-collapse: collapse; text-align: start; }
.scene-card :where(th, td) { padding: .4em .45em; border-block-end: 1px solid #c6a3ca60; }
.scene-card :where(details, .results, .word-history) { text-align: start; }
dialog { max-inline-size: calc(100vw - 30px); }
dialog::backdrop { background: #110b21c4; backdrop-filter: blur(3px); }

.controls {
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-inline-size: 0;
  padding: 8px clamp(7px, 2vw, 18px) 6px;
  border: var(--frame);
  border-radius: 9px 9px 15px 15px;
  background: radial-gradient(ellipse at 50% 0, #4b3059, #21162e 62%, #191125);
  box-shadow: inset 0 0 0 2px #e5b37f2e, 0 -2px 18px #160d26a2;
}
#word-form { display: flex; align-items: center; justify-content: center; gap: 6px; inline-size: min(100%, 440px); }
.word-input {
  flex: 1 1 auto;
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 45px;
  padding: 5px 10px;
  border: 1px solid #bc8e69;
  border-radius: 7px 3px 3px 7px;
  color: #fff0cc;
  background: #21152e;
  box-shadow: inset 0 2px 8px #100a1b91, 0 1px #e9c89347;
  font-size: max(16px, 1.05rem);
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.word-input::placeholder { color: #dbc2df; font-size: .77em; font-weight: 620; letter-spacing: .02em; text-transform: none; }
.controls .burn-button, .scene-card button:first-of-type {
  min-block-size: 44px;
  border-color: #ffdf9b;
  color: #3c1b32;
  background: linear-gradient(154deg, #ffeba9, #f0b96b 67%, #ca795a);
  box-shadow: inset 0 1px 0 #fff5d4, 0 2px 5px #1d102c99;
  font-weight: 830;
  white-space: nowrap;
}
.controls .burn-button:not(:disabled) {
  color: #faffcf;
  border-color: #ffdf91;
  background: linear-gradient(155deg, #508f42, #255b3d 58%, #14352d);
  box-shadow: inset 0 1px 0 #f2ffbbbd, 0 0 0 1px #a1c25c, 0 0 12px #a2d85654;
  text-shadow: 0 1px 2px #19352b;
}
#feedback { margin: 1px 0; color: #f4d6f4; font-size: .79rem; text-align: center; }
#feedback:empty { display: none; }
#choices { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; max-inline-size: 100%; }
#choices:empty { display: none; }
#choices button { min-block-size: 36px; padding: 4px 8px; font-size: .77rem; }
#choices button[aria-pressed='true'], #choices button.selected { color: #3b2140; background: #ffe5a5; }

@media (max-width: 640px) {
  .game-shell { gap: 7px; padding-inline: 5px; padding-block-start: 4px; }
  .masthead { grid-template-columns: auto auto minmax(0, 1fr); gap: 6px; min-block-size: 52px; padding-inline: 3px; }
  .brand h1, .brand strong, h1.brand { font-size: clamp(20px, 6.4vw, 32px); }
  .brand::before { display: none; }
  .brand :where(small, p, span) { display: none; }
  .all-games { min-block-size: 38px; padding-inline: 6px; font-size: .69rem; }
  .audio-controls { gap: 4px; }
  .audio-controls button { min-inline-size: clamp(25px, 8.3vw, 38px); min-block-size: 38px; }
  .audio-controls input[type='range'] { inline-size: clamp(35px, 11vw, 64px); }
  .playfield { min-block-size: clamp(405px, 72dvh, 670px); border-radius: 12px 12px 8px 8px; }
  .run-hud { gap: 6px; }
  .run-hud :where(.clock-group, .score-group) :where(small, label) { display: none; }
  #timer, #score { font-size: .85rem; }
  .river { inset-block-start: 45px; }
  .drifter {
    --tile-size: clamp(29px, 8.35vw, 34px);
    inset-inline-start: clamp(87px, var(--lane), calc(100% - 87px));
    inset-block-start: clamp(95px, calc(-4% + .99 * var(--lane) + 3.2% * var(--drift)), calc(100% - 103px));
    padding: 6px 7px 8px;
    gap: 4px;
    transform: translate(-50%, -50%);
  }
  .drifter.compact {
    --tile-size: clamp(29px, 8.15vw, 32px);
    inset-inline-start: clamp(55px, var(--lane), calc(100% - 55px));
    inset-block-start: clamp(96px, calc(17% + .44 * var(--lane) + 12% * var(--drift)), calc(100% - 96px));
    padding: 5px 5px 7px;
  }
  .drifter.boss { --tile-size: clamp(29px, 9vw, 42px); inset-block-start: 51%; padding: 9px 11px 12px; }
  .guardian-art { inline-size: min(153%, 92vw); inset-inline-start: 46%; block-size: 146%; }
  .drifter.boss.has-art .board-label { transform: translateY(-25px); }
  .board-label { padding-inline: 5px; }
  .drifter.compact .board-label { column-gap: 4px; max-inline-size: 108px; }
  .controls { position: sticky; inset-block-end: 0; }
}

@media (max-width: 350px) {
  .masthead { gap: 4px; }
  .audio-controls { gap: 2px; }
  .audio-controls input[type='range'] { inline-size: 32px; }
  .audio-controls svg { inline-size: 15px; block-size: 15px; }
  .drifter.boss { --tile-size: 28px; }
  .run-hud #phase-label { letter-spacing: 0; }
}

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