/* arcade.css — the DANKSNAKE arcade at /play/.
 *
 * Extends /assets/theme.css (its fonts, its focus ring, its button colour) rather
 * than starting over: the arcade is the console's screen turned all the way up, so
 * it is dark in both themes, like the puzzle's board. The neon values below are the
 * site's own dark-theme --go and --hot, and docs/ART-BIBLE.md holds the rest.
 */
:root {
  --void: #05060a;
  --neon: #7dffbe;       /* = theme.css dark --go, the snake's green */
  --neon-hot: #ff4f93;   /* = theme.css dark --hot, the one button colour */
  --neon-ink: #1a0610;   /* = theme.css dark --hot-ink */
  --glass: rgba(5, 6, 10, .78);
  --text: #e4ecdf;       /* = theme.css dark --ink */
  --dim: #9eab9f;        /* = theme.css dark --muted, 8.5:1 on --void */
  --food: #ffd23f;       /* the food's yellow (ART-BIBLE §4): points, and the points burst */
  color-scheme: dark;
}
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--void); color: var(--text);
  font-family: var(--ui);
  -webkit-text-size-adjust: 100%;
}
body { overscroll-behavior: none; }
#stage { position: fixed; inset: 0; display: block; touch-action: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui button, #ui a, #ui label, #ui input { pointer-events: auto; }
[hidden] { display: none !important; }
/* The frame-rate readout (Settings -> Show frame rate, or ?fps=1): a small chip in the
   top-right corner, above everything, never in the way of a tap. */
.fps {
  position: fixed; z-index: 5; right: calc(4px + env(safe-area-inset-right)); top: calc(4px + env(safe-area-inset-top));
  margin: 0; padding: 2px 6px; border-radius: 6px; pointer-events: none;
  background: var(--glass); color: var(--neon);
  font: 600 11px/1.3 var(--ui); font-variant-numeric: tabular-nums; letter-spacing: .02em;
}

/* ---- title
   The title is its own scroller: the first screen (.title-first, at least the full
   height) is the game's title and nothing else, and the prose about the game sits
   BELOW it (.below). The document never scrolls and the canvas keeps
   touch-action: none, so nothing here can drag a run; the whole title is hidden
   the moment Play is pressed. */
.title-ui {
  position: absolute; inset: 0;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  pointer-events: auto; touch-action: pan-y;
}
.title-first {
  position: relative; min-height: 100%; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  background: radial-gradient(ellipse 70% 42% at 50% 48%, rgba(5,6,10,.86), rgba(5,6,10,.35) 70%, transparent);
}
.neon {
  margin: 0; font-family: var(--display); font-weight: 400; line-height: .95;
  font-size: clamp(44px, 15vw, 120px); letter-spacing: .01em;
  display: flex; flex-direction: column; align-items: center;
}
@media (min-width: 700px) { .neon { flex-direction: row; gap: .08em; } }
.n-dank {
  color: #fff4f9;
  text-shadow: 0 0 2px #fff, 0 0 10px var(--neon-hot), 0 0 24px var(--neon-hot), 0 0 48px rgba(255,79,147,.55);
}
.n-snake {
  color: #f2fff9;
  text-shadow: 0 0 2px #fff, 0 0 10px var(--neon), 0 0 24px var(--neon), 0 0 48px rgba(125,255,190,.55);
  animation: flicker 5.5s steps(1) 1.2s infinite;
}
@keyframes flicker { 0%, 100% { opacity: 1; } 91% { opacity: 1; } 92% { opacity: .55; } 93% { opacity: 1; } 95% { opacity: .7; } 96% { opacity: 1; } }
.tag { margin: 0; max-width: 30ch; font-size: 17px; line-height: 1.4; color: var(--text); text-shadow: 0 1px 8px var(--void); }
.menu { display: flex; flex-direction: column; gap: 12px; width: min(280px, 100%); margin-top: 8px; }
@media (min-width: 700px) { .menu { flex-direction: row; width: auto; } }

/* ---- buttons: the console's A button, lit */
.btn {
  min-height: 52px; min-width: 132px; padding: 0 26px; border-radius: 999px;
  font: 700 18px/1 var(--ui); letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn-hot {
  background: var(--neon-hot); color: var(--neon-ink); border: 2px solid #ffc2da;
  box-shadow: 0 0 0 1px rgba(255,79,147,.4), 0 0 22px rgba(255,79,147,.6), inset 0 -3px 0 rgba(0,0,0,.25);
}
.btn-line {
  background: var(--glass); color: var(--neon); border: 2px solid var(--neon);
  box-shadow: 0 0 14px rgba(125,255,190,.35), inset 0 0 10px rgba(125,255,190,.15);
}
.btn:active { transform: translateY(1px); }
.btn-small { min-height: 44px; min-width: 88px; padding: 0 16px; font-size: 14px; }
:focus-visible { outline-color: #fff; }

.panel {
  width: min(320px, 100%); padding: 16px 18px; border-radius: 16px; text-align: left;
  background: var(--glass); border: 1px solid rgba(125,255,190,.45);
  box-shadow: 0 0 24px rgba(125,255,190,.18);
}
.toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; font-size: 17px; cursor: pointer; }
.toggle input { width: 24px; height: 24px; accent-color: var(--neon-hot); }
.toggle small { margin-left: 6px; font-size: 13px; font-weight: 400; color: var(--dim); }
.slider { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; font-size: 17px; }
.slider input { flex: 1; min-width: 0; height: 32px; accent-color: var(--neon-hot); }
.slider input:disabled { opacity: .4; }
.fine { margin: 6px 0 14px; font-size: 14px; line-height: 1.45; color: var(--dim); }
/* Settings -> Controls: three radios in the toggles' own row style. */
.controls { margin: 0; padding: 0; border: 0; min-width: 0; }
.controls legend { padding: 0; font-weight: 700; font-size: 17px; }
.controls legend small { margin-left: 6px; font-size: 13px; font-weight: 400; color: var(--dim); }
.seg { display: flex; gap: 6px; margin-top: 2px; }
.seg-opt {
  flex: 1; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 4px 6px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px solid rgba(125, 255, 190, .35); border-radius: 12px;
  font-size: 15px; font-weight: 600; line-height: 1.15; cursor: pointer;
}
/* The radio stays in the page (focus, keys, screen readers) but the pill is what shows. */
.seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.seg-opt:has(input:checked) { background: var(--neon-hot); border-color: var(--neon-hot); color: var(--neon-ink); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--neon); outline-offset: 2px; }
.controls-note { margin: 2px 0 2px; }

/* Hold and point (input.js): a faint ring where the thumb landed and an arrow for the
   way it reads. Placed by main.js (transform); nothing here animates, so it never keeps
   the idle stop awake, and pointer-events stay off so the canvas gets the thumb. */
.aim {
  position: fixed; left: 0; top: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  box-sizing: border-box; border-radius: 50%; border: 2px solid rgba(125, 255, 190, .3);
  pointer-events: none;
}
.aim-arrow { position: absolute; inset: 0; display: none; }
.aim[data-dir] .aim-arrow { display: block; }
.aim-arrow::after {
  content: ''; position: absolute; right: -16px; top: 50%; margin-top: -9px;
  border-left: 14px solid var(--neon); border-top: 9px solid transparent; border-bottom: 9px solid transparent;
  opacity: .7;
}
.aim[data-dir="0"] .aim-arrow { transform: rotate(-90deg); }
.aim[data-dir="2"] .aim-arrow { transform: rotate(90deg); }
.aim[data-dir="3"] .aim-arrow { transform: rotate(180deg); }

/* ---- arena overlay */
.arena-ui { position: absolute; inset: 0; }
.hud {
  position: absolute; left: 0; right: 0; top: 0; height: 64px; box-sizing: border-box;
  padding: 10px 12px 0; display: flex; align-items: center; justify-content: space-between;
  max-width: 560px; margin: 0 auto;
}
.readout { margin: 0; font-size: 15px; color: var(--dim); letter-spacing: .06em; text-transform: uppercase; }
.readout b { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--neon); margin-left: 6px; text-shadow: 0 0 10px rgba(125,255,190,.6); }
/* hint, pause and go-again lines: glass pills over the field's lower third, never
   in the way of a touch (pointer-events stay off, so a tap reaches the canvas) */
.callout {
  position: absolute; left: 50%; top: 62%; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 48px); box-sizing: border-box;
  margin: 0; padding: 12px 20px; border-radius: 999px; text-align: center;
  font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--text);
  background: var(--glass); border: 1px solid rgba(125,255,190,.5);
  box-shadow: 0 0 20px rgba(125,255,190,.22);
}
.callout b { color: var(--neon); text-transform: uppercase; letter-spacing: .06em; }
.hint { top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); }
.seed {
  flex: 0 0 auto; margin: 0; font-size: 12px; letter-spacing: .06em; color: var(--dim); font-variant-numeric: tabular-nums;
}
/* the arena's goal line under the meter: where you are, what clears it, live progress */
.goalbar {
  position: absolute; left: 0; right: 0; top: 98px; height: 26px; box-sizing: border-box;
  max-width: 560px; margin: 0 auto; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.goal { margin: 0; min-width: 0; font-size: 14px; line-height: 1.2; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; margin-left: 4px; }
.goal .where { letter-spacing: .06em; text-transform: uppercase; font-size: 12px; }
.goal.done b { color: var(--neon); text-shadow: 0 0 8px rgba(125,255,190,.6); }
/* the boss's health: one laser-red pip per coil it can still take */
.boss-hp { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.boss-hp i { width: 18px; height: 8px; border-radius: 999px; background: #ff2d55; box-shadow: 0 0 8px rgba(255,45,85,.7); }
.boss-hp i.gone { background: transparent; box-shadow: none; outline: 1px solid rgba(255,45,85,.55); outline-offset: -1px; }
/* The Hive (T-DSA1.5): one pip per open vent, in its lime. */
.boss-hp.hive i { width: 13px; background: #c8ff3d; box-shadow: 0 0 8px rgba(200,255,61,.6); }
.boss-hp.hive i.gone { background: transparent; box-shadow: none; outline-color: rgba(200,255,61,.5); }
/* the 'Sector 1 clear' card: the banner in the site's hot pink */
.banner.clear { border-color: rgba(255,79,147,.6); box-shadow: 0 0 28px rgba(255,79,147,.3); }
.banner.clear b { color: var(--neon-hot); text-shadow: 0 0 12px rgba(255,79,147,.6); }
/* the sector banner: shown for 2 s as each arena starts; never takes a touch */
.banner {
  position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%);
  width: max-content; max-width: calc(100% - 40px); margin: 0; padding: 14px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  border-radius: 16px; background: var(--glass); border: 1px solid rgba(125,255,190,.5);
  box-shadow: 0 0 24px rgba(125,255,190,.25); pointer-events: none;
}
.banner span { font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.banner b { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.1; color: var(--neon); text-shadow: 0 0 12px rgba(125,255,190,.6); }
.banner.in { animation: banner-in .35s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes banner-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.9); } to { opacity: 1; transform: translate(-50%, -50%); } }
html.still .banner.in { animation: none; }
@media (prefers-reduced-motion: reduce) { .banner.in { animation: none; } }
/* score + combo in the HUD */
.combo {
  position: relative; overflow: hidden;
  display: inline-block; margin-left: 8px; padding: 2px 8px 4px; border-radius: 999px;
  font: 700 15px/1.2 var(--ui); color: var(--neon-ink); background: var(--neon-hot);
  box-shadow: 0 0 12px rgba(255,79,147,.6); vertical-align: 3px;
}
.combo b { font: inherit; color: inherit; margin: 0; text-shadow: none; }
/* the combo window draining: full after a crush, empty when the chain breaks */
.combo-fill {
  position: absolute; left: 6px; right: 6px; bottom: 2px; height: 2px; border-radius: 2px;
  background: var(--neon-ink); transform-origin: left center;
}
/* the coil's trade, '-8 length, +120': centred on the field's top edge for 2.5 s,
   clear of the meter row and the goal line */
.trade {
  position: absolute; top: 134px; left: 50%; transform: translateX(-50%); width: max-content;
  max-width: calc(100% - 40px); margin: 0; padding: 4px 12px;
  border-radius: 999px; background: var(--glass); border: 1px solid rgba(255,210,63,.55);
  font-size: 15px; font-weight: 700; color: var(--food); font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.trade.miss { color: var(--dim); border-color: rgba(158,171,159,.45); }
/* the title's scoring panel: the coil pay table */
.howto {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: min(380px, calc(100% - 32px)); max-height: calc(100% - 32px); box-sizing: border-box;
  overflow-y: auto; background: var(--void);
}
.howto:focus { outline: none; }
.howto:focus-visible { outline: 2px solid #fff; }
.howto-title { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--neon); }
.howto .fine b { color: var(--text); }
.paytable { width: 100%; border-collapse: collapse; margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.paytable th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); font-weight: 600; text-align: left; padding: 2px 0 4px; }
.paytable th:last-child, .paytable td:last-child { text-align: right; }
.paytable td { padding: 3px 0; border-top: 1px solid rgba(125,255,190,.18); font-size: 16px; font-weight: 700; color: var(--text); }
.paytable td:last-child { color: var(--food); }
/* the death screen (T-DSA1.12): the replay inset over the death panel, stacked and
   centred. pointer-events stay off so a tap anywhere reaches the canvas and restarts. */
.death-stack {
  position: absolute; left: 50%; top: 128px; bottom: 12px; transform: translateX(-50%);
  width: min(340px, calc(100% - 40px)); display: flex; flex-direction: column; align-items: center;
  justify-content: center; justify-content: safe center; gap: 10px;
}
.arena-ui.wide .death-stack { top: 24px; bottom: 24px; }
/* the inset: a frame the canvas paints the last seconds into (scenes/arena.js reads
   #replay-box's box); its caption sits under it */
.replay { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.replay-box {
  height: clamp(96px, calc(100vh - 580px), 300px); aspect-ratio: 19 / 31; box-sizing: border-box;
  border: 1px solid rgba(255,79,147,.7); border-radius: 12px; box-shadow: 0 0 22px rgba(255,79,147,.25);
}
.replay-cap { margin: 0; max-width: 300px; padding: 3px 10px; border-radius: 8px; background: var(--void); text-align: center; font-size: 13px; line-height: 1.35; color: var(--dim); }
/* a Daily Run's panel holds the board too: a smaller inset keeps the stack on screen */
.death-stack:has(#daily:not([hidden])) .replay-box { height: clamp(96px, calc(100vh - 780px), 200px); }
.arena-ui.wide .replay-box { height: clamp(150px, calc(100vh - 520px), 340px); }
/* the death panel: what killed you, the run's numbers, how to go again. Opaque, so
   it reads as the game's own screen, not a debug overlay over a live arena. */
.death {
  width: 100%; box-sizing: border-box; text-align: center;
  background: #0b0d14;
  border-color: rgba(255,79,147,.7); box-shadow: 0 0 28px rgba(255,79,147,.3);
}
.death .death-mut { white-space: nowrap; }
.death .mut-icon { width: 20px; height: 20px; vertical-align: -5px; margin-right: 3px; }
.cause {
  margin: 2px 0 6px; font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.15;
  color: #fff4f9; text-shadow: 0 0 10px var(--neon-hot), 0 0 22px rgba(255,79,147,.55);
}
.death .fine { margin: 0 0 12px; }
.tally { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin: 0 0 12px; }
.tally div[hidden] { display: none; }
/* T-DSA1.6: the same panel as the Run clear screen (the Serpent is dead): mint, not hot pink. */
.death.won { border-color: rgba(125,255,190,.75); box-shadow: 0 0 28px rgba(125,255,190,.3); }
.death.won .cause { text-shadow: 0 0 10px var(--neon), 0 0 22px rgba(125,255,190,.55); }
.tally dt { white-space: nowrap; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.tally dd { margin: 2px 0 0; font-size: 17px; font-weight: 700; color: var(--neon); font-variant-numeric: tabular-nums; }
.death .build { margin: -4px 0 8px; color: var(--text); }
.death .build b { color: var(--neon); }
.again { margin: 0; font-size: 17px; font-weight: 600; color: var(--text); }
.noscript { position: fixed; inset: auto 16px 40% 16px; text-align: center; font-size: 17px; color: var(--text); }
.noscript a { color: var(--neon); }

html.still .n-snake { animation: none; }
@media (prefers-reduced-motion: reduce) { .n-snake { animation: none; } }

/* ---- mutations: the meter row under the HUD, owned icons, the offer's cards.
   Icons are painted on the canvas (scenes/icons.js) inside the empty .slot and
   .card-icon boxes; card panels are painted there too, so the DOM cards are only
   borders and words over them. */
.mutbar {
  position: absolute; left: 0; right: 0; top: 66px; height: 30px; box-sizing: border-box;
  max-width: 560px; margin: 0 auto; padding: 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.meter {
  flex: 1 1 auto; height: 10px; border-radius: 999px; overflow: hidden;
  background: rgba(125,255,190,.1); border: 1px solid rgba(125,255,190,.5);
  box-shadow: 0 0 10px rgba(125,255,190,.25);
}
.meter i {
  display: block; height: 100%; transform-origin: left center; transform: scaleX(0);
  background: linear-gradient(90deg, #7dffbe, #2fd4ff 60%, #8a5cff);
  box-shadow: 0 0 12px #2fd4ff; transition: transform .25s ease-out;
}
.meter.full { border-color: #ff4f93; box-shadow: 0 0 14px rgba(255,79,147,.6); }
.owned { display: flex; gap: 4px; flex: 0 0 auto; }
.owned .slot { display: block; width: 24px; height: 24px; }
.offer {
  position: absolute; inset: 0; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 72px 16px calc(24px + env(safe-area-inset-bottom));
}
.offer-title {
  margin: 0; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1; text-transform: uppercase;
  color: #fff4f9; text-shadow: 0 0 10px var(--neon-hot), 0 0 24px rgba(255,79,147,.55);
}
.offer-title span { display: block; margin-top: 8px; text-align: center; font: 600 14px/1 var(--ui); letter-spacing: .08em; color: var(--dim); text-shadow: none; }
.cards { display: flex; flex-direction: column; gap: 12px; width: min(360px, 100%); }
.card {
  display: flex; align-items: center; gap: 14px; min-height: 104px; padding: 12px 16px 12px 12px;
  border-radius: 16px; border: 2px solid transparent; background: transparent;
  color: var(--text); text-align: left; font: 400 15px/1.35 var(--ui); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.card[disabled] { cursor: default; }
.card.sel:not([disabled]) { border-color: rgba(255,255,255,.55); }
.card-icon { flex: 0 0 64px; width: 64px; height: 64px; }
.card-words { display: flex; flex-direction: column; gap: 4px; }
.card-name { font: 700 18px/1.1 var(--ui); letter-spacing: .04em; text-transform: uppercase; color: #fff; }
.card-text { color: var(--text); }
.card-tier { font: 600 11px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.card-tier i { font-style: normal; color: #fff; letter-spacing: .2em; }
.card-combo {
  margin-top: 4px; padding: 5px 8px; border-radius: 8px; font: 400 13px/1.3 var(--ui); color: var(--text);
  border: 1px solid var(--neon-hot); background: rgba(255,79,147,.12); box-shadow: 0 0 10px rgba(255,79,147,.35);
}
.card-combo b { display: inline-block; margin-right: 6px; font: 700 11px/1 var(--ui); letter-spacing: .12em; color: #fff4f9; text-transform: uppercase; }
.offer.intro .card { animation: card-in .5s cubic-bezier(.2,.9,.3,1.2) both; }
.offer.intro .card:nth-child(2) { animation-delay: .06s; }
.offer.intro .card:nth-child(3) { animation-delay: .12s; }
@keyframes card-in { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
@media (min-width: 900px) {
  .cards { flex-direction: row; width: auto; gap: 18px; }
  .card { flex-direction: column; align-items: center; text-align: center; width: 250px; min-height: 250px; padding: 22px 18px; }
  .card-icon { flex-basis: 96px; width: 96px; height: 96px; }
}
html.still .offer.intro .card { animation: none; }
@media (prefers-reduced-motion: reduce) { .offer.intro .card { animation: none; } }

/* ---- the title's links, and the prose under the first screen */
.title-links { margin: 4px 0 0; font-size: 15px; color: var(--dim); text-shadow: 0 1px 8px var(--void); }
.title-links a { color: var(--neon); font-weight: 600; display: inline-block; padding: 10px 6px; }
.below {
  position: relative; box-sizing: border-box; max-width: 640px; margin: 0 auto;
  padding: 28px 20px calc(40px + env(safe-area-inset-bottom));
  background: var(--void); border-top: 1px solid rgba(125,255,190,.35);
  text-align: left; font-size: 16px; line-height: 1.55; color: var(--text);
}
.below h2 { margin: 0 0 8px; font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--neon); }
.below h3 { margin: 22px 0 6px; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--neon-hot); }
.below p { margin: 0 0 10px; }
.below b { color: var(--neon); }
.below a { color: var(--neon); font-weight: 600; }
/* An open Settings or Scoring panel gets the first screen to itself, laid out exactly
   as before the prose existed: the title column is one screen tall and centred, and
   the tagline, the links and the prose below step aside until the panel closes (the
   tagline since T-DSA1.11, so Settings with its frame-rate toggle fits an 844 px phone). */
.title-ui:has(#settings:not([hidden]), #howto:not([hidden])) .title-first { height: 100%; gap: 12px; }
.title-ui:has(#settings:not([hidden]), #howto:not([hidden])) .tag,
.title-ui:has(#settings:not([hidden]), #howto:not([hidden])) .title-links,
.title-ui:has(#settings:not([hidden]), #howto:not([hidden])) .daily-note,
.title-ui:has(#settings:not([hidden]), #howto:not([hidden])) .below { display: none; }

/* ---- the Daily Run (T-DSA1.8): the title's note, and its block in the death panel.
   Only the block's controls take taps (#ui input/button/a); a tap elsewhere on the
   panel still reaches the canvas and starts a practice run. */
/* Play and Daily Run share one row on a phone (Daily Run sits beside Play, and the
   title keeps its height: Settings' whole panel still fits an 844 px screen). */
.menu-pair { display: flex; gap: 12px; }
.menu-pair .btn { flex: 1 1 0; min-width: 0; padding: 0 10px; }
@media (min-width: 700px) { .menu-pair { display: contents; } .menu-pair .btn { flex: none; min-width: 132px; padding: 0 26px; } }
.daily-note { max-width: 32ch; margin: 2px 0 0; text-align: center; text-shadow: 0 1px 8px var(--void); }
.daily { margin: 10px 0 10px; padding-top: 10px; border-top: 1px solid rgba(125,255,190,.3); }
.daily-title { margin: 0 0 4px; font: 400 15px/1.2 var(--display); letter-spacing: .04em; color: var(--neon); }
.daily-status { margin: 0 0 8px; font-size: 14px; line-height: 1.4; color: var(--text); }
.daily-form { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 8px; }
.daily-form label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.daily-form input {
  width: 4.2em; min-height: 44px; box-sizing: border-box; padding: 0 8px; border-radius: 10px;
  font: 700 20px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; text-align: center;
  color: var(--text); background: var(--void); border: 2px solid var(--neon);
}
.daily-net { margin: 0 0 6px; font-size: 13px; color: var(--dim); }
.daily-net.off { color: var(--food); }
.daily-board { margin: 0 auto 8px; padding: 0; max-width: 240px; list-style: none; counter-reset: rank; font-variant-numeric: tabular-nums; }
.daily-board li { display: flex; gap: 10px; align-items: baseline; padding: 2px 0; font-size: 14px; counter-increment: rank; }
.daily-board li::before { content: counter(rank) "."; width: 1.6em; text-align: right; color: var(--dim); }
.daily-board b { color: var(--neon); letter-spacing: .08em; }
.daily-board .pts { margin-left: auto; font-weight: 700; color: var(--food); }
.daily-board .at { width: 4.2em; text-align: right; color: var(--dim); font-size: 12px; }
.daily-actions { display: flex; gap: 8px; justify-content: center; margin: 0; }
.daily-actions a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* ---- the wide layout (T-DSA1.10): a window >= 1024 px wide and wider than 4:3.
   scenes/arena.js puts .wide on #arena-ui and the panel geometry in custom
   properties (--panel-left/-right/-top/-w/-h, from the arena's drawn box), so the
   panels always sit 24 px clear of the arena and of the window's edges. Without .wide
   the two asides generate no box (display: contents) and their .side-only parts are
   not drawn: the portrait HUD is exactly what it was. */
.side { display: contents; }
.side-only { display: none; }
.arena-ui.wide .side {
  position: absolute; top: var(--panel-top); width: var(--panel-w); max-height: var(--panel-h);
  box-sizing: border-box; overflow-y: auto; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 20px; border-radius: 16px; text-align: left;
  /* no glass fill: the panels sit on the bare void beside the arena, and the mutation
     icons are painted on the canvas under them (scenes/icons.js), so a fill would dim them */
  background: transparent; border: 1px solid rgba(125,255,190,.4);
  box-shadow: 0 0 24px rgba(125,255,190,.14);
}
.arena-ui.wide .side-build { left: var(--panel-left); }
.arena-ui.wide .side-run { left: var(--panel-right); }
.arena-ui.wide .side-only { display: block; }
.arena-ui.wide .side-only[hidden] { display: none; }
.arena-ui.wide .side .hud,
.arena-ui.wide .side .mutbar,
.arena-ui.wide .side .goalbar { position: static; max-width: none; height: auto; margin: 0; padding: 0; }
.arena-ui.wide .side .hud { flex-wrap: wrap; justify-content: flex-start; gap: 10px 20px; }
.arena-ui.wide .side .hud #back { flex-basis: 100%; max-width: 132px; }
.arena-ui.wide .readout b { font-size: 30px; }
.arena-ui.wide .side .owned { display: none; }
.arena-ui.wide .side .goalbar { flex-direction: column; align-items: flex-start; gap: 6px; }
.arena-ui.wide .goal { white-space: normal; font-size: 16px; }
.arena-ui.wide .goal .where { display: none; }
.arena-ui.wide .goal b { margin-left: 0; font-size: 20px; }
.side-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--neon); text-shadow: 0 0 10px rgba(125,255,190,.5); }
.side-sub { margin: 4px 0 0; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--neon-hot); }
.side-note { margin: 0; font-size: 14px; line-height: 1.45; color: var(--dim); }
.build-list, .combo-list { margin: 0; padding: 0; list-style: none; }
.build-list li {
  display: grid; grid-template-columns: 32px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 6px 0; border-top: 1px solid rgba(125,255,190,.14);
}
.build-list li:first-child { border-top: 0; }
.build-list .slot { grid-row: 1 / 3; width: 32px; height: 32px; }
.build-list b { font: 700 15px/1.2 var(--ui); letter-spacing: .04em; text-transform: uppercase; color: #fff; }
.build-list .tier { font: 600 11px/1.2 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.build-list .tier i { font-style: normal; color: #fff; letter-spacing: .2em; }
.build-list li.in-combo b { color: #fff4f9; text-shadow: 0 0 8px rgba(255,79,147,.7); }
.combo-list li {
  margin: 0 0 8px; padding: 7px 10px; border-radius: 10px; font-size: 13px; line-height: 1.35; color: var(--text);
  border: 1px solid var(--neon-hot); background: rgba(255,79,147,.12); box-shadow: 0 0 10px rgba(255,79,147,.3);
}
.combo-list b { display: block; font: 700 12px/1.2 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: #fff4f9; }
.combo-list .pair { display: block; margin: 2px 0 4px; font-size: 12px; color: var(--dim); }
.sector { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.sector span { margin-left: 6px; color: var(--food); }
.side-stats { margin: 0; flex-wrap: wrap; gap: 8px 22px; }
.arena-ui.wide .side-stats { display: flex; }
.side-stats dt, .keys dt { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.side-stats dd { margin: 2px 0 0; font-size: 17px; font-weight: 700; color: var(--neon); font-variant-numeric: tabular-nums; }
.keys { margin: 4px 0 0; padding-top: 12px; border-top: 1px solid rgba(125,255,190,.2); gap: 6px; }
.arena-ui.wide .keys { display: grid; grid-template-columns: max-content 1fr; align-items: baseline; gap: 8px 12px; }
.keys div { display: contents; }
.keys dt { text-transform: none; letter-spacing: 0; font-size: 13px; }
.keys dd { margin: 0; font-size: 13px; color: var(--text); }
kbd {
  display: inline-block; min-width: 1.4em; margin-right: 3px; padding: 1px 5px; border-radius: 5px; box-sizing: border-box;
  font: 600 12px/1.4 var(--ui); text-align: center; color: var(--text);
  border: 1px solid rgba(158,171,159,.6); background: rgba(158,171,159,.1);
}
.run-seed { margin: -4px 0 8px; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
