/*
  Alephium visual overhaul, 2026-07-01.
  Revert path: remove this stylesheet link from ui/index.html.
*/

:root {
  --alph-bg: #14213d;
  --alph-surface: rgba(25, 39, 70, 0.95);
  --alph-surface-2: rgba(32, 48, 82, 0.97);
  --alph-line: rgba(140, 196, 255, 0.44);
  --alph-line-hot: rgba(187, 139, 255, 0.54);
  --alph-blue: #66a4fa;
  --alph-violet: #a46cdb;
  --alph-cyan: #00eeff;
  --alph-red: #e65465;
  --alph-orange: #f99e70;
  --alph-white: #f8f8f8;
  --alph-muted: #d3def2;
  --alph-glass: rgba(255, 255, 255, 0.09);
  --alph-shadow: rgba(4, 8, 18, 0.44);
}

html {
  background: var(--alph-bg);
}

body {
  --bg: var(--alph-bg);
  --panel: var(--alph-surface);
  --panel-2: var(--alph-surface-2);
  --line: var(--alph-line);
  --text: var(--alph-white);
  --muted: var(--alph-muted);
  --gold: var(--alph-orange);
  --red: var(--alph-red);
  --green: #60d394;
  --blue: var(--alph-blue);
  --violet: var(--alph-violet);
  --ember: var(--alph-orange);
  background:
    linear-gradient(118deg, rgba(8, 88, 248, 0.3), transparent 34%),
    linear-gradient(242deg, rgba(164, 108, 219, 0.26), transparent 32%),
    linear-gradient(180deg, #1b2d52 0%, #14213d 52%, #17243e 100%);
}

body::before {
  opacity: 0.26;
  background-image:
    linear-gradient(60deg, rgba(102, 164, 250, 0.16) 1px, transparent 1px),
    linear-gradient(120deg, rgba(164, 108, 219, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 88px 88px, 88px 88px, 44px 44px;
  mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 92%);
}

body::after {
  background:
    linear-gradient(90deg, rgba(7,12,25,0.24), transparent 18%, transparent 82%, rgba(7,12,25,0.22)),
    linear-gradient(180deg, transparent 0%, rgba(4,8,16,0.1) 60%, rgba(4,8,16,0.28) 100%);
}

button {
  border-color: rgba(102, 164, 250, 0.38);
  background:
    linear-gradient(180deg, rgba(102, 164, 250, 0.22), rgba(8, 88, 248, 0.16)),
    linear-gradient(135deg, #20224a, #111426);
  color: #f8fbff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    0 14px 28px rgba(0,0,0,0.34),
    0 0 0 1px rgba(102,164,250,0.08);
}

button.secondary,
summary.secondary {
  border-color: rgba(164, 108, 219, 0.32);
  background:
    linear-gradient(180deg, rgba(164,108,219,0.18), rgba(92,97,248,0.09)),
    #141625;
}

a.secondary,
summary.secondary {
  border: 1px solid rgba(164, 108, 219, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(164,108,219,0.18), rgba(92,97,248,0.09)),
    #141625;
  color: #f8fbff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    0 14px 28px rgba(0,0,0,0.34),
    0 0 0 1px rgba(102,164,250,0.08);
}

a.secondary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

button.green {
  border-color: rgba(0,238,255,0.34);
  background:
    linear-gradient(180deg, rgba(0,238,255,0.2), rgba(96,211,148,0.13)),
    #0d1d24;
}

button.gold {
  border-color: rgba(249,158,112,0.48);
  background:
    linear-gradient(180deg, rgba(249,158,112,0.3), rgba(230,84,101,0.16)),
    #24131b;
  color: #fff6ef;
}

input {
  background:
    linear-gradient(90deg, rgba(102,164,250,0.08), rgba(164,108,219,0.08)),
    rgba(0,0,0,0.56);
  border-color: rgba(102,164,250,0.3);
}

.shell {
  position: relative;
}

.hero {
  min-height: 286px;
  border-bottom-color: rgba(102,164,250,0.22);
}

.hero::before {
  height: 190px;
  opacity: 0.72;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(102,164,250,0.16) 8.2% 8.6%, transparent 8.8% 19%, rgba(164,108,219,0.16) 19.2% 19.7%, transparent 19.9% 100%),
    linear-gradient(150deg, transparent 0 35%, rgba(0,238,255,0.18) 35.2% 35.7%, transparent 36% 100%),
    linear-gradient(210deg, transparent 0 44%, rgba(249,158,112,0.2) 44.2% 44.8%, transparent 45% 100%),
    linear-gradient(to top, rgba(5,5,8,0.96), transparent 78%);
}

.brand-copy {
  position: relative;
  padding-top: 30px;
}

.brand-copy::before {
  content: "ALEPHIUM PRIZE DUNGEON";
  position: absolute;
  top: 0;
  left: 0;
  color: var(--alph-cyan);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-shadow: 0 0 18px rgba(0,238,255,0.32);
}

h1 {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 950;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 0 28px rgba(102,164,250,0.28),
    0 14px 36px rgba(0,0,0,0.7);
}

.subtitle {
  color: #d8e2f7;
}

.badge {
  border-color: rgba(0,238,255,0.38);
  background:
    linear-gradient(90deg, rgba(0,238,255,0.13), rgba(164,108,219,0.14)),
    rgba(0,0,0,0.28);
  color: #dffcff;
}

.hero-vista,
.panel,
.first-visit,
.chain-progress,
.prize-chip,
.play-tools,
.terminal-banner,
.stat,
.verify-box,
.leader-row,
.turn-hero,
.turn-loadout,
.mobile-weapon-panel,
.recent-turns li,
.run-tip,
.empty-card {
  border-color: var(--alph-line);
  background:
    linear-gradient(135deg, rgba(102,164,250,0.14), transparent 34%),
    linear-gradient(315deg, rgba(164,108,219,0.12), transparent 36%),
    var(--alph-surface);
}

.panel {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 28px 80px var(--alph-shadow),
    0 0 0 1px rgba(102,164,250,0.05);
}

.hero-vista {
  border-color: rgba(102,164,250,0.44);
  box-shadow:
    inset 0 0 56px rgba(102,164,250,0.1),
    0 28px 70px rgba(0,0,0,0.48);
}

.hero-vista svg {
  filter: hue-rotate(185deg) saturate(1.28) contrast(1.08);
}

.panel h2,
.panel h3,
.room-head h2,
.room-head h3,
.run-tip strong,
.tool-copy strong,
.chain-copy span,
.turn-kicker,
.first-visit-kicker {
  color: #cfe7ff;
  text-shadow: 0 0 14px rgba(102,164,250,0.28);
}

.first-visit-title,
.terminal-title {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 950;
  text-transform: uppercase;
}

.first-visit-tags span,
.card-top span,
.pill,
.turn-type,
.rank {
  border-color: rgba(102,164,250,0.26);
  background:
    linear-gradient(180deg, rgba(102,164,250,0.12), rgba(164,108,219,0.07)),
    rgba(0,0,0,0.28);
}

.mode-controls button {
  position: relative;
  overflow: hidden;
}

.how-play-cta {
  display: grid;
  gap: 3px;
  align-content: center;
  text-align: left;
  border-color: rgba(121,184,255,0.58);
  background:
    linear-gradient(180deg, rgba(121,184,255,0.28), rgba(8,88,248,0.18)),
    linear-gradient(135deg, rgba(0,238,255,0.14), rgba(245,196,95,0.1)),
    #14213a;
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 14px 28px rgba(0,0,0,0.34),
    0 0 0 1px rgba(121,184,255,0.12);
}

.how-play-cta strong,
.how-play-cta span {
  display: block;
}

.how-play-cta strong {
  font-size: 14px;
  line-height: 1.1;
}

.how-play-cta span {
  color: rgba(231,243,255,0.92);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.how-play-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.how-play-head-actions .how-play-full-link {
  min-height: 34px;
}

.mode-controls button::after,
.chain-progress::after,
.play-tools::after {
  content: "";
  position: absolute;
  inset: auto 10px 8px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,238,255,0.62), transparent);
  pointer-events: none;
}

.chain-progress,
.play-tools {
  position: relative;
  overflow: hidden;
}

.prize-target {
  position: relative;
}

.prize-chip {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 10px 26px rgba(5,10,22,0.18);
}

.prize-chip span {
  color: #cfe7ff;
}

.prize-chip strong {
  color: #fff;
  text-shadow: 0 0 18px rgba(0,238,255,0.18);
}

.prize-chip em {
  color: #d3def2;
}

.chain-spinner {
  border-color: rgba(102,164,250,0.2);
  border-top-color: var(--alph-cyan);
  box-shadow: 0 0 18px rgba(0,238,255,0.24);
}

.stats {
  perspective: 900px;
}

body:not(.run-in-progress):not(.run-complete) .stats,
body:not(.run-in-progress):not(.run-complete) .progress {
  display: none;
}

body:not(.run-in-progress):not(.run-complete) .wallet-strip input {
  display: none;
}

body.run-complete .stat-weapon {
  display: none;
}

body.run-in-progress .stat-weapon {
  display: none;
}

body.run-in-progress .play-tools {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  max-width: none;
}

.stat {
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, transparent 0 54%, rgba(0,238,255,0.14) 55%, transparent 58%);
  pointer-events: none;
}

.stat span {
  color: #9fb4d5;
}

.stat strong {
  color: #ffffff;
  text-shadow: 0 0 20px rgba(102,164,250,0.32);
}

#scoreStat .score-base,
#scoreStat .score-times,
#scoreStat .score-multiplier,
#scoreStat .score-final,
#scoreStat .score-original {
  display: inline;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-transform: none;
}

#scoreStat .score-times {
  margin: 0 0.18em;
  color: #8dd8ff;
  font-size: 0.74em;
}

#scoreStat .score-multiplier {
  color: #ffe08a;
  font-size: 0.82em;
}

#scoreStat .score-final {
  color: #ffffff;
}

#scoreStat .score-original {
  margin-left: 0.22em;
  color: #9fb4d5;
  font-size: 0.56em;
  font-weight: 800;
  white-space: nowrap;
}

.progress {
  border-color: rgba(102,164,250,0.24);
  background: rgba(0,0,0,0.48);
}

.progress > div {
  background: linear-gradient(90deg, var(--alph-blue), var(--alph-cyan), var(--alph-orange));
  box-shadow: 0 0 18px rgba(0,238,255,0.34);
}

.room-choice {
  border-radius: 8px;
  background:
    linear-gradient(150deg, rgba(255,255,255,0.16), transparent 24%),
    linear-gradient(330deg, rgba(102,164,250,0.18), transparent 36%),
    linear-gradient(30deg, rgba(164,108,219,0.14), transparent 42%),
    #1e3155;
  clip-path: polygon(0 13px, 13px 0, calc(100% - 13px) 0, 100% 13px, 100% calc(100% - 13px), calc(100% - 13px) 100%, 13px 100%, 0 calc(100% - 13px));
}

.room-choice::before {
  inset: 7px;
  border-color: rgba(102,164,250,0.18);
  border-radius: 6px;
  clip-path: polygon(0 10px, 10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px));
}

.room-choice::after {
  background:
    linear-gradient(115deg, transparent 0 38%, rgba(0,238,255,0.18) 39%, transparent 42%),
    radial-gradient(ellipse at center, rgba(255,255,255,0.12), transparent 58%);
}

.room-choice.monster {
  border-color: rgba(230,84,101,0.72);
  --card-glow: rgba(230,84,101,0.32);
}

.room-choice.weapon {
  border-color: rgba(102,164,250,0.76);
  --card-glow: rgba(102,164,250,0.34);
}

.room-choice.potion {
  border-color: rgba(0,238,255,0.66);
  --card-glow: rgba(0,238,255,0.24);
}

.card-art {
  border-color: rgba(126,184,255,0.34);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.15), transparent 30%),
    linear-gradient(60deg, transparent 0 44%, rgba(0,238,255,0.16) 45%, transparent 47%),
    radial-gradient(circle at 50% 35%, var(--card-glow, rgba(102,164,250,0.32)), transparent 50%),
    #1a2b4c;
  isolation: isolate;
}

.card-art svg {
  filter: saturate(1.15) contrast(1.06);
  max-width: 100%;
  overflow: hidden;
}

.card-kind {
  border-color: rgba(0,238,255,0.42);
  background: rgba(4, 7, 16, 0.78);
  color: #e7fbff;
  box-shadow:
    0 0 18px rgba(0,238,255,0.2),
    0 8px 20px rgba(0,0,0,0.42);
}

.weapon-badge {
  border-color: rgba(102,164,250,0.46);
  background:
    linear-gradient(90deg, rgba(102,164,250,0.2), rgba(164,108,219,0.16)),
    rgba(4, 8, 18, 0.84);
}

.card-name {
  color: #ffffff;
}

.card-subtitle,
.small,
.wallet-status,
.run-tip span,
.tool-copy span,
.chain-copy p,
.turn-notes li {
  color: #b9c5dc;
}

.wallet-chooser[hidden] {
  display: none !important;
}

.wallet-chooser.show {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 7, 16, 0.72);
  backdrop-filter: blur(8px);
}

.wallet-chooser-card {
  width: min(92vw, 360px);
  border: 1px solid rgba(245, 196, 95, 0.28);
  background:
    linear-gradient(180deg, rgba(27, 33, 47, 0.98), rgba(10, 14, 23, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  padding: 16px;
}

.wallet-chooser-card h2 {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: 0;
}

.wallet-chooser-card button {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  text-align: left;
}

#potionBagLine {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  min-width: 0;
  color: #b9c5dc;
  font-size: 11px;
  line-height: 1.1;
}

#potionBagLine[hidden] {
  display: none !important;
}

#potionBagLine span {
  color: #7ee9ff;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

#potionBagLine b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 2px 6px;
  border: 1px solid rgba(96, 211, 148, 0.35);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(96, 211, 148, 0.18), rgba(0, 238, 255, 0.08)),
    rgba(4, 10, 20, 0.72);
  color: #e5fff2;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

#potionTimingLine {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
  min-width: 0;
  color: #d7eaff;
  font-size: 11px;
  line-height: 1.15;
}

#potionTimingLine b {
  color: #e5fff2;
  font-size: 12px;
  font-weight: 950;
}

#potionTimingLine em {
  color: #b9c5dc;
  font-style: normal;
}

.desktop-weapon-loadout {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.desktop-weapon-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(126, 184, 255, 0.34);
  border-radius: 7px;
  background: rgba(6, 14, 28, 0.64);
  color: #dff3ff;
}

.desktop-weapon-svg {
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  filter: drop-shadow(0 2px 6px rgba(121, 184, 255, 0.26));
}

.desktop-weapon-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1.08;
}

.desktop-weapon-copy b,
.desktop-weapon-copy span,
.desktop-weapon-copy em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-weapon-copy b {
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}

.desktop-weapon-copy span {
  color: #d7eaff;
  font-size: 11px;
  font-weight: 850;
}

.desktop-weapon-copy em {
  color: #aebbd1;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.card-meta {
  color: #dfe8f7;
}

.card-meta .pill {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions button {
  min-width: 0;
}

.mobile-choice-stat,
.mobile-choice-action {
  display: none;
}

.room-choice.monster .actions button:not(.secondary) {
  border-color: rgba(230,84,101,0.38);
  background:
    linear-gradient(180deg, rgba(230,84,101,0.28), rgba(249,158,112,0.12)),
    #20121a;
}

.room-choice.weapon .actions button:not(.secondary) {
  border-color: rgba(102,164,250,0.44);
}

.room-choice.potion .actions button:not(.secondary) {
  border-color: rgba(0,238,255,0.34);
  background:
    linear-gradient(180deg, rgba(0,238,255,0.18), rgba(96,211,148,0.12)),
    #0d1d24;
}

.terminal-banner {
  border-color: rgba(230,84,101,0.46);
}

.terminal-banner.win {
  border-color: rgba(0,238,255,0.46);
}

.terminal-banner.missed {
  border-color: rgba(245,196,95,0.48);
  background:
    linear-gradient(180deg, rgba(245,196,95,0.08), rgba(19,17,13,0.2)),
    rgba(7, 15, 31, 0.7);
}

body.run-complete .toolbar {
  display: flex;
}

body.run-complete.run-mode-prize .toolbar {
  display: none;
}

body.run-complete.run-mode-practice .toolbar {
  display: flex;
}

body.run-complete .terminal-banner.show {
  margin-top: 4px;
}

body.run-complete .layout > .panel > .room-head,
body.run-complete #roomCards,
body.run-complete #cardRailCue {
  display: none;
}

.terminal-status {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(102,164,250,0.34);
  border-radius: 7px;
  color: #d9e8ff;
  background:
    linear-gradient(180deg, rgba(102,164,250,0.13), rgba(7,15,31,0.4)),
    rgba(10, 20, 38, 0.62);
  font-size: 13px;
  font-weight: 900;
}

.terminal-status.recorded {
  display: inline-flex;
  width: fit-content;
  min-height: 0;
  padding: 7px 10px;
  border-color: rgba(0,238,255,0.24);
  border-radius: 999px;
  color: #c8f8ff;
  background: rgba(0,238,255,0.08);
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
}

.terminal-status.recorded.winning {
  border-color: rgba(96,211,148,0.38);
  color: #dfffe9;
  background:
    linear-gradient(180deg, rgba(96,211,148,0.18), rgba(245,196,95,0.1)),
    rgba(8,28,20,0.48);
}

.terminal-status.recorded.missed {
  border-color: rgba(245,196,95,0.34);
  color: #ffe9b3;
  background:
    linear-gradient(180deg, rgba(245,196,95,0.14), rgba(230,84,101,0.06)),
    rgba(28,22,8,0.46);
}

.terminal-guide-links,
.score-replay-guide-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.terminal-guide-links {
  margin-top: -2px;
}

.terminal-scoring-details {
  border: 1px solid rgba(121,184,255,0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(121,184,255,0.08), rgba(7,15,31,0.26)),
    rgba(5, 12, 24, 0.58);
  overflow: hidden;
}

.terminal-scoring-details summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 11px 12px;
  color: #d9e8ff;
  cursor: pointer;
  list-style: none;
}

.terminal-scoring-details summary::-webkit-details-marker {
  display: none;
}

.terminal-scoring-details summary span {
  color: #d9e8ff;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.terminal-scoring-details summary strong {
  color: #fff5dc;
  font-size: 16px;
  line-height: 1;
}

.terminal-scoring-details summary::after {
  content: "+";
  justify-self: end;
  grid-column: 3;
  grid-row: 1;
  width: 18px;
  color: rgba(217,232,255,0.72);
  font-size: 16px;
  font-weight: 1000;
  text-align: right;
}

.terminal-scoring-details[open] summary::after {
  content: "-";
}

.terminal-scoring-details .score-replay-score-details {
  border-width: 1px 0 0;
  border-radius: 0;
  background: rgba(0,0,0,0.16);
}

.terminal-guide-links a,
.score-replay-guide-links a,
.how-play-full-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(121,184,255,0.28);
  border-radius: 7px;
  color: #d9e8ff;
  background: rgba(121,184,255,0.08);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.terminal-guide-links a:hover,
.score-replay-guide-links a:hover,
.how-play-full-link:hover {
  border-color: rgba(245,196,95,0.42);
  color: #fff2c9;
}

.terminal-prize-snapshot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.terminal-prize-snapshot div {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(245,196,95,0.22);
  border-radius: 7px;
  background: rgba(0,0,0,0.24);
}

.terminal-prize-snapshot .terminal-prize-card-winning {
  border-color: rgba(96,211,148,0.4);
  background:
    linear-gradient(180deg, rgba(96,211,148,0.18), rgba(245,196,95,0.08)),
    rgba(5,24,18,0.52);
}

.terminal-prize-snapshot .terminal-prize-card-winning span,
.terminal-prize-snapshot .terminal-prize-card-winning strong {
  color: #dfffe9;
}

.terminal-prize-snapshot .terminal-prize-card-missed {
  border-color: rgba(245,196,95,0.4);
  background:
    linear-gradient(180deg, rgba(245,196,95,0.16), rgba(230,84,101,0.06)),
    rgba(31,22,6,0.52);
}

.terminal-prize-snapshot .terminal-prize-card-missed span,
.terminal-prize-snapshot .terminal-prize-card-missed strong {
  color: #ffe9b3;
}

.terminal-prize-snapshot .terminal-prize-card-opportunity {
  border-color: rgba(102,164,250,0.38);
  background:
    linear-gradient(180deg, rgba(102,164,250,0.15), rgba(245,196,95,0.06)),
    rgba(8,18,32,0.52);
}

.terminal-prize-snapshot .terminal-prize-card-opportunity span,
.terminal-prize-snapshot .terminal-prize-card-opportunity strong {
  color: #d9e8ff;
}

.terminal-prize-snapshot .terminal-prize-card-opportunity strong {
  font-size: 21px;
}

.terminal-prize-snapshot span,
.terminal-prize-snapshot em {
  display: block;
  overflow-wrap: anywhere;
}

.terminal-prize-snapshot .score-reset-label-mobile {
  display: none;
}

.terminal-prize-snapshot span {
  color: rgba(255,244,213,0.68);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.terminal-prize-snapshot strong {
  display: block;
  margin-top: 2px;
  color: #fff4d5;
  font-size: 18px;
  line-height: 1.05;
}

.terminal-prize-snapshot em {
  margin-top: 3px;
  color: rgba(255,244,213,0.72);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.terminal-boost-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid rgba(96,211,148,0.32);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(96,211,148,0.13), rgba(245,196,95,0.08)),
    rgba(3,20,16,0.58);
}

.terminal-boost-cta span,
.terminal-boost-cta strong,
.terminal-boost-cta em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.terminal-boost-cta span {
  color: #dfffe9;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.terminal-boost-cta strong {
  margin-top: 3px;
  color: #fff8de;
  font-size: 13px;
  line-height: 1.25;
}

.terminal-boost-cta em {
  margin-top: 5px;
  color: rgba(210,255,227,0.68);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.terminal-boost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid rgba(245,196,95,0.45);
  border-radius: 7px;
  color: #171109;
  background: linear-gradient(180deg, #ffe38d, #f5c45f);
  box-shadow: 0 8px 18px rgba(245,196,95,0.14);
  font-size: 12px;
  font-weight: 1000;
  text-align: center;
  text-decoration: none;
}

.terminal-boost-link span {
  color: inherit;
}

.terminal-next button {
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 48px;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.terminal-next button strong,
.terminal-next button span {
  display: block;
}

.terminal-next button strong {
  font-size: 13px;
  line-height: 1.12;
}

.terminal-next button span {
  color: rgba(255, 247, 230, 0.76);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
}

.terminal-next button.gold span {
  color: #ffe8ad;
}

.terminal-next button.primary {
  border-color: rgba(102,164,250,0.52);
  background:
    linear-gradient(180deg, rgba(102,164,250,0.34), rgba(32,63,114,0.92)),
    #14264a;
}

.terminal-next button.green:not(:disabled) {
  border-color: rgba(0,238,255,0.36);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 10px 24px rgba(0,238,255,0.12);
}

@media (max-width: 720px) {
  .how-play-head-actions {
    justify-content: stretch;
  }

  .how-play-head-actions .how-play-full-link {
    flex: 1 1 auto;
  }

  .terminal-guide-links,
  .score-replay-guide-links {
    gap: 6px;
  }

  .terminal-guide-links,
  .score-replay-guide-links {
    display: none;
  }

  .terminal-guide-links a,
  .score-replay-guide-links a {
    flex: 1 1 128px;
  }

  .terminal-prize-snapshot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .terminal-prize-snapshot strong {
    font-size: 16px;
  }

  .terminal-prize-snapshot .terminal-prize-card-opportunity strong {
    font-size: 18px;
  }

  .terminal-prize-snapshot .score-reset-label-desktop {
    display: none;
  }

  .terminal-prize-snapshot .score-reset-label-mobile {
    display: block;
  }

  .terminal-boost-cta {
    grid-template-columns: 1fr;
  }

  .terminal-boost-link {
    width: 100%;
  }
}

.verify-box,
.leader-row,
.logbox {
  background:
    linear-gradient(135deg, rgba(102,164,250,0.12), transparent 36%),
    rgba(20, 33, 58, 0.78);
}

.leader-row-recent {
  grid-template-columns: minmax(0, 1fr) auto;
}

.leader-row-recent > div:not(.leader-score-wrap) {
  min-width: 0;
}

.leader-row-recent:not(.leader-row-guest-start) .leader-name {
  flex-wrap: nowrap;
  width: auto;
  max-width: 100%;
}

.leader-row-recent:not(.leader-row-guest-start) .small {
  white-space: nowrap;
}

.leader-row-practice {
  opacity: 0.58;
  filter: saturate(0.72);
}

.leader-row-practice .rank {
  background: rgba(121,184,255,0.07);
  color: rgba(215,234,255,0.72);
}

.leader-row-practice .leader-mode,
.leader-row-practice .leader-score {
  color: rgba(215,234,255,0.72);
}

.leader-row-pot-boost {
  border-color: rgba(250, 204, 21, 0.26);
}

.leader-row-pot-boost .leader-mode {
  border-color: rgba(250, 204, 21, 0.32);
  color: #fde68a;
}

.leader-row-pot-boost .leader-score {
  color: #fde68a;
}

.leader-row-practice .leader-score {
  font-weight: 800;
}

.leader-row-guest-start {
  opacity: 0.52;
  filter: saturate(0.55);
  border-color: rgba(121,184,255,0.1);
}

.leader-row-guest-start .rank {
  background: rgba(121,184,255,0.1);
  color: rgba(215,234,255,0.78);
}

.leader-row-guest-start .leader-chip {
  opacity: 0.68;
}

.leader-row-guest-start .leader-mode {
  color: rgba(215,234,255,0.66);
}

.leader-row-guest-start .leader-score {
  font-size: 11px;
  color: rgba(215,234,255,0.52);
  opacity: 0.62;
}

.leader-chip {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.leader-score-wrap {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.leader-replay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  color: #fff7e6;
  font-size: 10px;
  text-decoration: none;
}

.score-replay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3, 6, 12, 0.74);
  backdrop-filter: blur(10px);
}

.score-replay-backdrop[hidden] {
  display: none;
}

.score-replay-panel {
  width: min(760px, 100%);
  max-height: min(720px, calc(100dvh - 44px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 1px solid rgba(121,184,255,0.24);
  border-radius: 8px;
  background: rgba(8, 13, 22, 0.98);
  box-shadow: 0 28px 90px rgba(0,0,0,0.58);
}

.score-replay-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.score-replay-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1;
}

.score-replay-head p {
  margin: 6px 0 0;
  color: #c7d4e6;
  font-size: 13px;
  line-height: 1.45;
}

.score-replay-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-width: 0;
}

.score-replay-challenge,
.score-replay-watch,
.score-replay-share-game,
.score-replay-copy,
.score-replay-share,
.score-replay-close,
.score-replay-share-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 9px;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.score-replay-share-menu {
  position: relative;
}

.score-replay-share-menu summary {
  list-style: none;
  cursor: pointer;
}

.score-replay-share-menu summary::-webkit-details-marker {
  display: none;
}

.score-replay-share-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 3;
  display: grid;
  gap: 6px;
  min-width: 158px;
  padding: 8px;
  border: 1px solid rgba(126,162,255,0.24);
  border-radius: 10px;
  background: rgba(8,12,22,0.96);
  box-shadow: 0 18px 42px rgba(0,0,0,0.5);
}

.score-replay-share-menu-panel button,
.score-replay-share-menu-panel a {
  width: 100%;
}

.score-replay-challenge {
  border-color: rgba(245,196,95,0.42);
}

.score-replay-watch[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.54;
}

.score-replay-close {
  border-color: rgba(126,162,255,0.28);
}

.score-replay-link-status {
  min-height: 0;
  padding: 0 18px;
  color: #9ed8ff;
}

.score-replay-link-status[hidden] {
  display: none;
}

.score-replay-body {
  overflow: auto;
  padding: 16px 18px 18px;
}

.score-replay-card-preview,
.uxtest-share-card-preview {
  appearance: none;
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 12px;
  padding: 0;
  border: 1px solid rgba(245,196,95,0.24);
  border-radius: 8px;
  background: rgba(245,196,95,0.06);
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 14px 36px rgba(0,0,0,0.28);
}

.score-replay-card-preview img,
.uxtest-share-card-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: contain;
}

.score-replay-card-preview:hover,
.uxtest-share-card-preview:hover {
  border-color: rgba(245,196,95,0.44);
  transform: translateY(-1px);
}

.uxtest-share-highlights + .uxtest-share-card-preview,
.uxtest-share-empty + .uxtest-share-card-preview {
  margin-top: 12px;
}

.score-replay-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.score-replay-summary div,
.score-replay-turn {
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  background: rgba(255,255,255,0.045);
}

.score-replay-summary div {
  padding: 9px;
  min-width: 0;
}

.score-replay-summary .score-replay-prize {
  border-color: rgba(245,196,95,0.38);
  background: rgba(245,196,95,0.1);
}

.score-replay-summary span,
.score-replay-turn span {
  display: block;
  color: #b6c7dc;
}

.score-replay-summary strong,
.score-replay-turn strong {
  display: block;
  overflow-wrap: anywhere;
  color: #fff5dc;
}

.score-replay-summary em {
  display: block;
  margin-top: 2px;
  color: #d7c07a;
  font-style: normal;
}

.score-replay-integrity {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.replay-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.replay-chip.ok {
  border-color: rgba(122,220,153,0.34);
  background: rgba(122,220,153,0.1);
  color: #d8ffe4;
}

.replay-chip.warn {
  border-color: rgba(245,196,95,0.36);
  background: rgba(245,196,95,0.1);
  color: #ffe8ad;
}

.score-replay-meta {
  margin-bottom: 10px;
  color: #c7d4e6;
}

.score-replay-section {
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
}

.score-replay-section h3 {
  margin: 0 0 6px;
  color: #fff5dc;
  font-size: 13px;
  line-height: 1.15;
}

.score-replay-section p {
  margin: 0;
  color: #c7d4e6;
  line-height: 1.45;
}

.score-replay-score-details {
  padding: 12px;
}

.score-replay-score-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.score-replay-score-head > div {
  display: grid;
  gap: 6px;
}

.score-replay-score-head h3 {
  margin: 0;
}

.score-replay-score-head strong {
  color: #fff5dc;
  font-size: 20px;
  line-height: 1;
}

.score-replay-score-equation {
  display: grid;
  gap: 6px;
}

.score-replay-score-row,
.score-replay-score-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px;
  background: rgba(255,255,255,0.035);
}

.score-replay-score-row span,
.score-replay-score-total span {
  color: #b6c7dc;
  font-size: 11px;
  font-weight: 800;
}

.score-replay-score-row strong,
.score-replay-score-total strong {
  color: #fff5dc;
  font-size: 13px;
  overflow-wrap: anywhere;
  text-align: right;
}

.score-replay-score-row em {
  grid-column: 1 / -1;
  color: #d7c07a;
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.score-replay-score-row-subtotal {
  border-color: rgba(121,184,255,0.18);
  background: rgba(121,184,255,0.07);
}

.score-replay-score-total {
  border-color: rgba(122,220,153,0.28);
  background: rgba(122,220,153,0.09);
}

.score-replay-score-total strong {
  color: #d8ffe4;
  font-size: 16px;
}

.score-replay-score-note {
  margin-top: 8px;
  color: #ffe8ad;
  font-size: 12px;
}

.score-replay-body .terminal-hand-recap {
  margin-bottom: 10px;
  background: rgba(245,196,95,0.08);
}

.score-replay-hand-details {
  display: grid;
  gap: 6px;
}

.score-replay-hand-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(245,196,95,0.2);
  border-radius: 7px;
  background: rgba(245,196,95,0.06);
}

.score-replay-hand-row span,
.score-replay-hand-row em {
  color: #b6c7dc;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.score-replay-hand-row strong {
  min-width: 0;
  color: #fff5dc;
  overflow-wrap: anywhere;
}

.score-replay-hand-row em {
  justify-self: end;
  text-align: right;
}

.score-replay-turns {
  display: grid;
  gap: 6px;
}

.score-replay-turn {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 9px;
}

.score-replay-turn-index {
  display: grid;
  place-items: center;
  min-height: 28px;
  border-radius: 8px;
  background: rgba(121,184,255,0.12);
  color: #d7eaff;
  font-weight: 900;
}

.score-replay-empty {
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  color: #c7d4e6;
}

body.score-replay-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .leader-score-wrap {
    align-items: end;
  }

  .leader-row-recent {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .score-replay-backdrop {
    padding: 12px;
  }

  .score-replay-head {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }

  .score-replay-head h2 {
    font-size: 20px;
  }

  .score-replay-actions {
    justify-content: start;
    flex-wrap: wrap;
    gap: 4px;
  }

  .score-replay-challenge,
  .score-replay-watch,
  .score-replay-share-game,
  .score-replay-copy,
  .score-replay-share,
  .score-replay-close,
  .score-replay-share-menu summary {
    min-height: 32px;
    padding: 5px 7px;
    font-size: 11px;
  }

  .score-replay-share-menu-panel {
    right: auto;
    left: 0;
  }

  .score-replay-link-status {
    padding: 0 14px;
  }

  .score-replay-body {
    padding: 12px;
  }

  .score-replay-card-preview,
  .uxtest-share-card-preview {
    margin-bottom: 10px;
    border-radius: 7px;
  }

  .uxtest-share-card .uxtest-share-card-preview {
    width: calc(100vw - 24px);
    max-width: none;
    margin-right: calc(50% - 50vw + 12px);
    margin-left: calc(50% - 50vw + 12px);
  }

  .uxtest-share-card .uxtest-share-card-preview:hover {
    transform: none;
  }

  .score-replay-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-replay-turn {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .score-replay-hand-row {
    grid-template-columns: 1fr;
  }

  .score-replay-hand-row em {
    justify-self: start;
    text-align: left;
  }
}

.leader-scope-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(130,166,220,0.28);
  border-radius: 7px;
  background: rgba(5,12,24,0.3);
}

.leader-actions button {
  min-height: 26px;
  padding: 4px 7px;
  font-size: 10px;
}

.leader-scope-toggle button {
  border-color: transparent;
  background: transparent;
}

.leader-scope-toggle button.active {
  border-color: rgba(121,184,255,0.55);
  background: rgba(121,184,255,0.18);
  color: #f7fbff;
}

.leader-mode {
  border-color: rgba(102,164,250,0.34);
  background:
    linear-gradient(90deg, rgba(102,164,250,0.14), rgba(164,108,219,0.08)),
    rgba(0,0,0,0.22);
  color: #dbeaff;
}

.leader-prize {
  border-color: rgba(249,158,112,0.42);
  background:
    linear-gradient(90deg, rgba(249,158,112,0.18), rgba(0,238,255,0.08)),
    rgba(0,0,0,0.24);
  color: #fff0d9;
}

.leader-replay-source {
  border-color: rgba(121,184,255,0.36);
  background:
    linear-gradient(90deg, rgba(121,184,255,0.16), rgba(255,221,139,0.08)),
    rgba(0,0,0,0.22);
  color: #e6f2ff;
}

.leader-submit.pending {
  border-color: rgba(121,184,255,0.36);
  background:
    linear-gradient(90deg, rgba(121,184,255,0.16), rgba(255,221,139,0.08)),
    rgba(0,0,0,0.22);
  color: #e6f2ff;
}

.leader-submit.failed {
  border-color: rgba(245,113,113,0.34);
  background:
    linear-gradient(90deg, rgba(245,113,113,0.16), rgba(255,221,139,0.06)),
    rgba(0,0,0,0.22);
  color: #ffd2d2;
}

.leader-outcome {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.leader-outcome.cleared {
  border-color: rgba(0,238,255,0.32);
  background:
    linear-gradient(90deg, rgba(122,220,153,0.16), rgba(0,238,255,0.08)),
    rgba(0,0,0,0.22);
}

.leader-outcome.death {
  border-color: rgba(245,113,113,0.32);
  background:
    linear-gradient(90deg, rgba(245,113,113,0.14), rgba(164,108,219,0.08)),
    rgba(0,0,0,0.22);
}

.leader-outcome.started {
  border-color: rgba(121,184,255,0.32);
  background:
    linear-gradient(90deg, rgba(121,184,255,0.14), rgba(122,220,153,0.08)),
    rgba(0,0,0,0.22);
  color: #dff2ff;
}

.leader-submit.unverified {
  border-color: rgba(255,221,139,0.34);
  background:
    linear-gradient(90deg, rgba(255,221,139,0.15), rgba(121,184,255,0.08)),
    rgba(0,0,0,0.22);
  color: #fff0c2;
}

@media (min-width: 861px) {
  body.run-in-progress .shell {
    max-width: 1500px;
    padding-top: 10px;
  }

  body.run-in-progress .hero,
  body.run-in-progress .toolbar,
  body.run-in-progress .run-tips,
  body.run-in-progress .first-visit {
    display: none;
  }

  body.run-in-progress .layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 12px;
    padding-top: 0;
    align-items: start;
  }

  body.run-in-progress .panel {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.05),
      0 18px 44px rgba(4,8,18,0.24);
  }

  body.run-in-progress .layout > .panel {
    position: relative;
    overflow: hidden;
    background:
      linear-gradient(135deg, rgba(102,164,250,0.1), transparent 30%),
      radial-gradient(ellipse at 50% 58%, rgba(0,238,255,0.08), transparent 42%),
      rgba(14, 24, 45, 0.74);
  }

  body.run-in-progress .layout > .panel::before {
    content: "";
    position: absolute;
    inset: 110px 12px 12px;
    border: 1px solid rgba(102,164,250,0.14);
    border-radius: 8px;
    background:
      linear-gradient(rgba(102,164,250,0.045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(102,164,250,0.045) 1px, transparent 1px),
      radial-gradient(ellipse at 50% 18%, rgba(102,164,250,0.1), transparent 46%),
      rgba(6, 12, 24, 0.18);
    background-size: 34px 34px, 34px 34px, 100% 100%, 100% 100%;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.04),
      inset 0 0 48px rgba(0,238,255,0.04);
    pointer-events: none;
  }

  body.run-in-progress .layout > .panel::after {
    content: "PRIZE RUN IN PROGRESS";
    position: absolute;
    left: 26px;
    bottom: 24px;
    color: rgba(207,231,255,0.16);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    pointer-events: none;
  }

  body.run-in-progress .panel-pad {
    position: relative;
    z-index: 1;
    padding: 12px;
  }

  body.run-in-progress .prize-target,
  body.run-in-progress .stats {
    opacity: 0.68;
    transition: opacity 140ms ease, filter 140ms ease;
  }

  body.run-in-progress .prize-target:hover,
  body.run-in-progress .prize-target:focus-within,
  body.run-in-progress .stats:hover,
  body.run-in-progress .stats:focus-within {
    opacity: 1;
  }

  body.run-in-progress .prize-target {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 7px;
  }

  body.run-in-progress .prize-chip {
    min-height: 43px;
    padding: 6px 9px;
    background:
      linear-gradient(135deg, rgba(102,164,250,0.08), transparent 38%),
      rgba(9, 16, 31, 0.62);
  }

  body.run-in-progress .prize-chip span {
    font-size: 8px;
  }

  body.run-in-progress .prize-chip strong {
    margin-top: 2px;
    font-size: 15px;
  }

  body.run-in-progress .prize-chip em {
    display: none;
  }

  body.run-in-progress .stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 8px;
  }

  body.run-in-progress .stat {
    min-height: 46px;
    padding: 7px 9px;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.01)),
      rgba(9, 16, 31, 0.56);
  }

  body.run-in-progress .stat span {
    font-size: 8px;
  }

  body.run-in-progress .stat strong {
    margin-top: 2px;
    font-size: 18px;
  }

  body.run-in-progress #potionStat,
  body.run-in-progress #weaponStat {
    font-size: 14px;
  }

  body.run-in-progress .progress {
    height: 7px;
    margin-bottom: 9px;
    opacity: 0.72;
  }

  body.run-in-progress .play-tools {
    max-width: none;
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    margin: 0 0 14px auto;
    padding: 10px 12px;
    opacity: 0.7;
    background:
      linear-gradient(90deg, rgba(0,238,255,0.08), rgba(96,211,148,0.07)),
      rgba(6, 12, 24, 0.64);
    transition: opacity 140ms ease;
  }

  body.run-in-progress .play-tools:hover,
  body.run-in-progress .play-tools:focus-within {
    opacity: 1;
  }

  body.run-in-progress .tool-copy span {
    display: none;
  }

  body.run-in-progress .tool-copy #potionTimingLine {
    display: flex;
    max-height: 38px;
    overflow: hidden;
  }

  body.run-in-progress .tool-copy #potionBagLine {
    display: flex;
    max-height: 22px;
    overflow: hidden;
  }

  body.run-in-progress .tool-copy #potionBagLine span {
    display: none;
  }

  body.run-in-progress .tool-copy strong {
    font-size: 10px;
  }

  body.run-in-progress .tool-weapon {
    min-height: 38px;
    align-content: center;
  }

  body.run-in-progress .tool-weapon #desktopWeaponStat {
    font-size: 12px;
    line-height: 1.12;
  }

  body.run-in-progress .play-tools #potionBtn {
    min-width: 108px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
  }

  body.run-in-progress .tool-potion-group {
    grid-template-columns: minmax(0, 1fr) clamp(108px, 10vw, 136px);
  }

  body.run-in-progress .room-head {
    margin: 0 0 8px;
  }

  body.run-in-progress .room-head h2 {
    font-size: 14px;
  }

  body.run-in-progress:not(.five-card-preview).new-room-pulse .room-head h2 {
    animation: five-card-room-title-pulse 1.05s ease-in-out 2;
  }

  body.run-in-progress #modeLine {
    opacity: 0.68;
  }

  body.run-in-progress #roomCards {
    gap: 12px;
    align-items: stretch;
    min-height: clamp(370px, calc(100vh - 305px), 520px);
    padding-bottom: 18px;
  }

  body.run-in-progress:not(.five-card-preview).new-room-pulse #roomCards {
    animation: five-card-room-stack-transition 0.8s ease-out 1;
  }

  body.run-in-progress .room-choice {
    position: relative;
    z-index: 1;
    filter: saturate(1.12) brightness(1.05);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.1),
      0 22px 50px rgba(4,8,18,0.36),
      0 0 38px var(--card-glow);
  }

  body.run-in-progress .room-choice:hover,
  body.run-in-progress .room-choice:focus-within {
    z-index: 2;
    filter: saturate(1.2) brightness(1.1);
  }

  body.run-in-progress:not(.five-card-preview).new-room-pulse .room-choice {
    animation: five-card-room-card-pulse 1.05s ease-in-out 2;
  }

  body.run-in-progress:not(.five-card-preview).new-room-pulse .room-choice .card-art,
  body.run-in-progress:not(.five-card-preview).new-room-pulse .room-choice .card-copy {
    animation: five-card-room-card-enter 0.72s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  body.run-in-progress:not(.five-card-preview).new-room-pulse .room-choice:nth-child(2) .card-art,
  body.run-in-progress:not(.five-card-preview).new-room-pulse .room-choice:nth-child(2) .card-copy {
    animation-delay: 0.06s;
  }

  body.run-in-progress:not(.five-card-preview).new-room-pulse .room-choice:nth-child(3) .card-art,
  body.run-in-progress:not(.five-card-preview).new-room-pulse .room-choice:nth-child(3) .card-copy {
    animation-delay: 0.12s;
  }

  body.run-in-progress:not(.five-card-preview).new-room-pulse .room-choice:nth-child(4) .card-art,
  body.run-in-progress:not(.five-card-preview).new-room-pulse .room-choice:nth-child(4) .card-copy {
    animation-delay: 0.18s;
  }

  body.run-in-progress:not(.five-card-preview).new-room-pulse .room-choice::before {
    animation: five-card-room-border-pulse 1.05s ease-in-out 2;
  }

  body.run-in-progress .side {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    opacity: 1;
  }

  body.run-in-progress .side:hover,
  body.run-in-progress .side:focus-within {
    opacity: 1;
    filter: none;
  }

  body.run-in-progress .side .panel {
    background:
      linear-gradient(135deg, rgba(102,164,250,0.07), transparent 42%),
      rgba(9, 16, 31, 0.58);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.04),
      0 14px 32px rgba(4,8,18,0.16);
    transition: opacity 160ms ease, filter 160ms ease;
  }

  body.run-in-progress .side .panel:not(:first-child) {
    opacity: 0.46;
    filter: saturate(0.72);
  }

  body.run-in-progress .side .panel:not(:first-child):hover,
  body.run-in-progress .side .panel:not(:first-child):focus-within {
    opacity: 0.95;
    filter: saturate(1);
  }

  body.run-in-progress .side .panel:first-child {
    opacity: 0.96;
    filter: saturate(1.06);
    background:
      linear-gradient(135deg, rgba(102,164,250,0.13), transparent 38%),
      linear-gradient(315deg, rgba(0,238,255,0.08), transparent 44%),
      rgba(12, 24, 45, 0.76);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.08),
      0 18px 42px rgba(4,8,18,0.24);
  }

  body.run-in-progress .side h3 {
    font-size: 10px;
  }

  body.run-in-progress .logbox,
  body.run-in-progress .verify-box,
  body.run-in-progress .flow-hint {
    font-size: 11px;
  }

  body.run-in-progress .leaderboard {
    max-height: 310px;
    overflow: auto;
    scrollbar-width: thin;
  }
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  body {
    background:
      linear-gradient(135deg, rgba(8,88,248,0.26), transparent 36%),
      linear-gradient(235deg, rgba(164,108,219,0.24), transparent 40%),
      #172542;
  }

  .hero {
    min-height: 268px;
  }

  .brand-copy {
    padding-top: 24px;
  }

  .brand-copy::before {
    font-size: 9px;
  }

  h1 {
    font-size: clamp(30px, 10vw, 44px);
  }

  .toolbar {
    border-bottom-color: rgba(102,164,250,0.22);
    background:
      linear-gradient(90deg, rgba(102,164,250,0.1), rgba(164,108,219,0.08)),
      rgba(5, 7, 14, 0.96);
  }

  body:not(.run-in-progress):not(.run-complete) .wallet-strip input {
    display: none;
  }

  body:not(.run-in-progress):not(.run-complete) .wallet-strip .how-play-cta {
    width: 100%;
    min-height: 54px;
  }

  .room-choice {
    clip-path: polygon(0 10px, 10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px));
  }

  .actions button {
    font-size: 13px;
  }

  body.run-in-progress .shell {
    padding: 6px 6px calc(14px + var(--safe-bottom));
  }

  body.run-in-progress .toolbar {
    display: none;
  }

  body.run-complete .toolbar {
    display: flex;
    position: static;
    margin: 0 0 10px;
  }

  body.run-in-progress .panel-pad {
    padding: 6px;
  }

  body.run-in-progress .stats {
    gap: 5px;
    margin-bottom: 5px;
  }

  body.run-in-progress .prize-target {
    gap: 5px;
    margin-bottom: 5px;
  }

  body.run-in-progress .prize-chip {
    min-height: 38px;
    padding: 5px 7px;
  }

  body.run-in-progress .prize-chip span {
    font-size: 7px;
  }

  body.run-in-progress .prize-chip strong {
    margin-top: 2px;
    font-size: 14px;
  }

  body.run-in-progress .prize-chip em {
    display: none;
  }

  body.run-in-progress .stat {
    min-height: 42px;
    padding: 6px 8px;
  }

  body.run-in-progress .stat span {
    font-size: 8px;
  }

  body.run-in-progress .stat strong {
    margin-top: 2px;
    font-size: 17px;
  }

  body.run-in-progress #weaponStat {
    font-size: 15px;
  }

  body.run-in-progress .progress {
    height: 7px;
    margin-bottom: 5px;
  }

  body.run-in-progress .play-tools {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-bottom: 6px;
    padding: 7px;
    gap: 7px;
  }

  body.run-in-progress .play-tools #potionBtn {
    flex-basis: 116px;
    min-height: 36px;
    padding: 7px;
  }

  body.run-in-progress .tool-copy strong {
    font-size: 9px;
  }

  body.run-in-progress .tool-copy span {
    font-size: 10px;
    line-height: 1.22;
  }

  body.run-in-progress .tool-copy #potionBagLine {
    display: flex;
    gap: 4px;
    margin-top: 3px;
  }

  body.run-in-progress .tool-copy #potionBagLine span {
    font-size: 8px;
    line-height: 1;
  }

  body.run-in-progress .tool-copy #potionBagLine b {
    min-height: 16px;
    padding: 1px 5px;
    font-size: 10px;
    line-height: 1;
  }

  body.run-in-progress .room-head {
    margin-bottom: 4px;
  }

  body.run-in-progress #roomCards {
    gap: 8px;
    padding-bottom: 8px;
  }

  body.run-in-progress .room-choice {
    flex-basis: min(68vw, 266px);
    min-height: 306px;
    grid-template-rows: auto 112px minmax(64px, auto) auto;
    gap: 6px;
    padding: 7px;
  }

  body.run-in-progress .card-art,
  body.run-in-progress .card-art svg {
    min-height: 112px;
  }

  body.run-in-progress .card-top {
    gap: 6px;
  }

  body.run-in-progress .card-name {
    font-size: 14px;
    line-height: 1.05;
  }

  body.run-in-progress .card-subtitle {
    font-size: 9px;
  }

  body.run-in-progress .card-meta {
    font-size: 9px;
    gap: 4px;
  }

  body.run-in-progress .card-meta .pill {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.run-in-progress .pill {
    padding: 4px 6px;
  }

  body.run-in-progress .actions {
    gap: 6px;
  }

  body.run-in-progress .actions button {
    min-height: 38px;
    font-size: 11px;
    padding: 7px;
  }
}

/*
  Graphical focus layer, 2026-07-02.
  Revert path: remove this block and restore index.html cache keys to the previous
  alephium-overhaul.css/alpha-game.js versions.
*/

body.run-in-progress {
  --active-stage-line: rgba(0, 238, 255, 0.3);
  --active-stage-fill: rgba(6, 12, 24, 0.68);
}

body.run-mode-prize.run-in-progress {
  --active-run-label: "PAID PRIZE RUN";
  --active-stage-line: rgba(249, 158, 112, 0.38);
}

body.run-mode-practice.run-in-progress {
  --active-run-label: "PRACTICE RUN";
  --active-stage-line: rgba(102, 164, 250, 0.34);
}

body.run-in-progress .layout > .panel {
  border-color: var(--active-stage-line);
}

body.run-in-progress .layout > .panel::after {
  content: var(--active-run-label, "RUN IN PROGRESS");
}

body.run-in-progress .prize-target,
body.run-in-progress .stats,
body.run-in-progress .play-tools {
  border: 1px solid rgba(102, 164, 250, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(102, 164, 250, 0.08), transparent 42%),
    var(--active-stage-fill);
}

body.run-in-progress .stats {
  position: relative;
}

body.run-in-progress .stat:nth-child(1),
body.run-in-progress .stat:nth-child(3) {
  border-color: rgba(0, 238, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(0, 238, 255, 0.12), rgba(102, 164, 250, 0.04)),
    rgba(8, 18, 34, 0.72);
}

body.run-in-progress .stat:nth-child(1) strong,
body.run-in-progress .stat:nth-child(3) strong {
  color: #f8fbff;
  text-shadow: 0 0 18px rgba(0, 238, 255, 0.24);
}

body.run-in-progress .hero,
body.run-in-progress .toolbar,
body.run-in-progress .run-tips {
  display: none !important;
}

body.run-in-progress .room-head {
  min-height: 34px;
  padding: 0 4px;
  border-bottom: 1px solid rgba(102, 164, 250, 0.12);
}

body.run-in-progress .room-head h2 {
  color: #f8fbff;
}

body.run-in-progress #modeLine {
  max-width: 52%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-head-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(102, 164, 250, 0.18);
  border-radius: 8px;
  background: rgba(4, 9, 18, 0.48);
}

.view-switch button {
  min-height: 30px;
  padding: 6px 9px;
  border-color: transparent;
  background: transparent;
  color: #aebdd1;
  box-shadow: none;
  font-size: 11px;
}

.view-switch button.active,
.view-switch button[aria-pressed="true"] {
  border-color: rgba(245,196,95,0.36);
  background:
    linear-gradient(180deg, rgba(245,196,95,0.22), rgba(0,238,255,0.08)),
    rgba(8,14,24,0.86);
  color: #fff4d5;
}

body.run-in-progress #roomCards {
  position: relative;
  border-radius: 8px;
}

body.run-in-progress .room-choice {
  position: relative;
  border-width: 1px;
  transform: translateZ(0);
}

body.run-in-progress .card-art {
  overflow: hidden;
  contain: paint;
}

body.run-in-progress .weapon-icon,
body.run-in-progress .button-icon {
  max-width: 1.35em;
  max-height: 1.35em;
}

body.run-in-progress .room-choice .actions button {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 24px rgba(0, 0, 0, 0.28);
}

body.run-in-progress .room-choice.resolved {
  opacity: 1;
  filter: none;
}

body.run-in-progress .room-choice.resolved .card-top,
body.run-in-progress .room-choice.resolved .card-art,
body.run-in-progress .room-choice.resolved .card-copy,
body.run-in-progress .room-choice.resolved .card-meta {
  opacity: 0.46;
  filter: saturate(0.62) brightness(0.84);
}

body.run-in-progress .room-choice.resolved .card-art svg {
  filter: saturate(0.58) contrast(0.9) brightness(0.72);
}

body.run-in-progress .room-choice.resolved .actions {
  display: none;
}

body.run-in-progress .resolved-badge {
  display: none;
}

body.run-in-progress .resolved-action {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  z-index: 8;
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 58px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 244, 213, 0.4);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(5, 10, 22, 0.84), rgba(19, 31, 56, 0.96), rgba(5, 10, 22, 0.84));
  color: #fff4d5;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.08;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.95);
  transform: translateY(-50%);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

body.run-in-progress .resolved-action strong,
body.run-in-progress .resolved-action span {
  display: block;
}

body.run-in-progress .resolved-action span {
  margin-top: 4px;
  color: #f3f7ff;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.18;
  text-transform: none;
}

body.run-in-progress .resolved-action.slain {
  color: #ffd47a;
  border-color: rgba(245, 196, 95, 0.52);
  box-shadow:
    inset 0 0 0 1px rgba(245, 196, 95, 0.14),
    0 12px 30px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(245, 196, 95, 0.14);
}

body.run-in-progress .side .panel {
  border-color: rgba(102, 164, 250, 0.2);
}

body.run-in-progress .side .panel:not(:first-child) {
  opacity: 0.58;
  filter: saturate(0.82);
}

body.run-in-progress .side .panel:not(:first-child):hover,
body.run-in-progress .side .panel:not(:first-child):focus-within {
  opacity: 1;
  filter: saturate(1);
}

body.run-complete .terminal-banner.show {
  border-color: rgba(249, 158, 112, 0.36);
  background:
    linear-gradient(135deg, rgba(249, 158, 112, 0.12), transparent 38%),
    linear-gradient(315deg, rgba(0, 238, 255, 0.08), transparent 42%),
    rgba(9, 16, 31, 0.84);
}

@media (min-width: 861px) {
  body.run-in-progress .shell {
    max-width: 1440px;
  }

  body.run-in-progress .layout {
    grid-template-columns: minmax(760px, 1fr) 352px;
    gap: 16px;
  }

  body.run-in-progress .layout > .panel {
    min-height: calc(100vh - 24px);
  }

  body.run-in-progress .layout > .panel::before {
    inset: 126px 16px 16px;
    border-color: rgba(102, 164, 250, 0.18);
    background:
      linear-gradient(rgba(102, 164, 250, 0.05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(102, 164, 250, 0.05) 1px, transparent 1px),
      radial-gradient(ellipse at 50% 14%, rgba(0, 238, 255, 0.1), transparent 46%),
      radial-gradient(ellipse at 50% 78%, rgba(249, 158, 112, 0.08), transparent 50%),
      rgba(5, 10, 20, 0.22);
    background-size: 32px 32px, 32px 32px, 100% 100%, 100% 100%, 100% 100%;
  }

  body.run-in-progress .layout > .panel::after {
    left: 30px;
    bottom: 26px;
    color: rgba(207, 231, 255, 0.2);
  }

  body.run-in-progress .panel-pad {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    align-items: start;
  }

  body.run-in-progress .chain-progress,
  body.run-in-progress .terminal-banner,
  body.run-in-progress .mobile-turn,
  body.run-in-progress .room-head,
  body.run-in-progress #roomCards,
  body.run-in-progress #status {
    grid-column: 1;
  }

  body.run-in-progress .prize-target {
    grid-column: 1;
    margin-bottom: 0;
  }

  body.run-in-progress .stats {
    grid-column: 1;
    margin-bottom: 0;
  }

  body.run-in-progress .progress {
    grid-column: 1;
    margin: -2px 0 0;
  }

  body.run-in-progress .play-tools {
    grid-column: 1;
    align-self: start;
    max-width: none;
    min-height: 0;
    margin: 0 0 2px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-content: start;
    opacity: 0.86;
  }

  body.run-in-progress .tool-copy span {
    display: block;
    font-size: 11px;
    line-height: 1.35;
  }

  body.run-in-progress .tool-copy strong {
    font-size: 12px;
  }

  body.run-in-progress .play-tools #potionBtn {
    width: auto;
    min-width: 0;
  }

  body.run-in-progress .room-head {
    margin-top: 6px;
  }

  body.run-in-progress #roomCards {
    min-height: clamp(390px, calc(100vh - 332px), 540px);
    padding: 10px 6px 18px;
  }

  body.run-in-progress .room-choice {
    max-width: 292px;
  }

  body.run-in-progress .side {
    gap: 12px;
  }

  body.run-in-progress .side .panel:first-child {
    min-height: 160px;
  }

  body.run-in-progress .side .panel:nth-child(2) {
    opacity: 0.82;
    filter: saturate(0.95);
  }

  body.run-in-progress .side .panel:nth-child(2) .controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.run-in-progress .verify-box,
  body.run-in-progress .flow-hint {
    overflow-wrap: normal;
    word-break: normal;
  }

  body.run-in-progress .verify-box {
    min-height: 72px;
  }
}

@media (max-width: 860px) {
  body.run-in-progress .layout > .panel {
    background:
      linear-gradient(180deg, rgba(0, 238, 255, 0.08), transparent 18%),
      linear-gradient(135deg, rgba(102, 164, 250, 0.08), transparent 34%),
      rgba(8, 15, 29, 0.88);
  }

  body.run-in-progress .layout > .panel::after {
    content: var(--active-run-label, "RUN IN PROGRESS");
    display: block;
    margin: 0 0 6px;
    padding: 6px 8px;
    border: 1px solid rgba(102, 164, 250, 0.16);
    border-radius: 8px;
    color: rgba(207, 231, 255, 0.82);
    background: rgba(6, 12, 24, 0.56);
    font-size: 9px;
    font-weight: 950;
    text-align: center;
    text-transform: uppercase;
  }

  body.run-in-progress .prize-target {
    opacity: 0.72;
  }

  body.run-in-progress .stats {
    border-color: rgba(102, 164, 250, 0.12);
  }

  body.run-in-progress .play-tools {
    opacity: 0.9;
  }

  body.run-in-progress .mobile-turn {
    border-color: rgba(0, 238, 255, 0.22);
    background:
      linear-gradient(90deg, rgba(0, 238, 255, 0.1), rgba(249, 158, 112, 0.06)),
      rgba(6, 12, 24, 0.68);
  }

  body.run-in-progress .side .panel:not(:first-child) {
    opacity: 0.72;
    filter: saturate(0.86);
  }
}

@media (min-width: 721px) and (max-width: 860px) {
  body.run-in-progress .stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  html.run-in-progress,
  html.run-in-progress body {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.run-in-progress .shell {
    padding: 4px 6px calc(8px + var(--safe-bottom));
  }

  body.run-in-progress .layout {
    gap: 0;
  }

  body.run-in-progress .layout > .panel::after {
    display: none;
  }

  body.run-in-progress .panel-pad {
    gap: 4px;
    padding: 5px;
  }

  body.run-in-progress .prize-target {
    order: 1;
    display: none;
  }

  body.run-in-progress .stats {
    order: 2;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.run-in-progress .stat-weapon {
    display: none;
  }

  body.run-in-progress .progress {
    order: 3;
  }

  body.run-in-progress .play-tools {
    order: 4;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  body.run-in-progress .tool-weapon {
    display: none;
  }

  body.run-in-progress .tool-potion-group {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(92px, 30%);
  }

  body.run-in-progress .mobile-turn {
    order: 5;
    min-height: 0;
    max-height: 74px;
    overflow: hidden;
  }

  body.run-in-progress .room-head {
    order: 6;
  }

  body.run-in-progress .room-head-right {
    flex: 1;
    gap: 6px;
  }

  body.run-in-progress .view-switch {
    grid-template-columns: repeat(2, minmax(64px, 1fr));
    flex: 0 1 148px;
  }

  body.run-in-progress .view-switch button {
    min-height: 28px;
    padding: 5px 7px;
    font-size: 10px;
  }

  body.run-in-progress #modeLine {
    flex: 1;
    min-width: 0;
    max-width: none;
    text-align: right;
  }

  body.run-in-progress #roomCards {
    order: 7;
    margin: 0 -2px;
    padding: 3px 48px 11px 2px;
    mask-image: linear-gradient(90deg, black 0%, black calc(100% - 46px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, black 0%, black calc(100% - 46px), transparent 100%);
  }

  body.run-in-progress .room-choice {
    flex-basis: min(66vw, 258px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      0 18px 36px rgba(4, 8, 18, 0.32),
      0 0 28px var(--card-glow);
  }

  body.run-in-progress.card-rail-at-end #roomCards {
    mask-image: linear-gradient(90deg, black 0%, black 100%);
    -webkit-mask-image: linear-gradient(90deg, black 0%, black 100%);
  }

  body.run-in-progress .card-rail-cue {
    order: 8;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 8px;
    margin: -5px 0 8px;
  }

  body.run-in-progress .mobile-turn .turn-potion-loadout,
  body.run-in-progress .mobile-turn .turn-weapon-loadout {
    display: none;
  }

  body.run-in-progress .mobile-turn .mobile-weapon-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 2px;
    margin-top: 6px;
    padding: 5px 7px;
  }

  body.run-in-progress .mobile-turn .mobile-weapon-panel > span {
    font-size: 8px;
    align-self: center;
  }

  body.run-in-progress .mobile-turn .mobile-weapon-panel strong {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 1px 6px;
    margin: 0;
    font-size: 12px;
    min-width: 0;
    line-height: 1.08;
  }

  body.run-in-progress .mobile-turn .mobile-weapon-panel > em {
    display: none;
  }

  body.run-in-progress .mobile-turn .mobile-weapon-panel .weapon-stat-name,
  body.run-in-progress .mobile-turn .mobile-weapon-panel .weapon-stat-power,
  body.run-in-progress .mobile-turn .mobile-weapon-panel .weapon-stat-target {
    margin: 0;
    min-width: 0;
    line-height: 1.08;
  }

  body.run-in-progress .mobile-turn .mobile-weapon-panel .weapon-stat-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }

  body.run-in-progress .mobile-turn .mobile-weapon-panel .weapon-stat-power {
    font-size: 11px;
  }

  body.run-in-progress .mobile-turn .mobile-weapon-panel .weapon-stat-power b {
    font-size: 13px;
  }

  body.run-in-progress .mobile-turn .mobile-weapon-panel .weapon-stat-target {
    grid-column: 1 / -1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
  }

  body.run-in-progress .mobile-turn .mobile-weapon-panel .weapon-stat-status {
    display: block;
    grid-column: 3;
    grid-row: 2;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ffe1a3;
    font-size: 8px;
    line-height: 1.08;
    white-space: nowrap;
  }

  body.run-in-progress .card-rail-cue button {
    width: 36px;
    min-height: 32px;
    padding: 0;
    border-radius: 999px;
    font-size: 22px;
    line-height: 1;
  }

  body.run-in-progress .card-rail-cue button:disabled {
    opacity: 0.28;
  }

  body.run-in-progress .card-rail-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 18px;
  }

  body.run-in-progress .card-rail-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(207, 231, 255, 0.34);
    box-shadow: 0 0 0 1px rgba(102, 164, 250, 0.12);
    transition: width 140ms ease, background 140ms ease, box-shadow 140ms ease;
  }

  body.run-in-progress .card-rail-dot.active {
    width: 18px;
    background: rgba(0, 238, 255, 0.82);
    box-shadow: 0 0 14px rgba(0, 238, 255, 0.28);
  }

  body.run-in-progress .side {
    margin-top: 2px;
  }

  body.run-in-progress .side .panel:nth-child(2),
  body.run-in-progress .side .panel:nth-child(3) {
    padding: 0;
  }

  body.run-in-progress .side .panel:nth-child(2) > *,
  body.run-in-progress .side .panel:nth-child(3) > * {
    transform: scale(0.98);
    transform-origin: top center;
  }
}

/*
  Connected first-view desktop cleanup, 2026-07-02.
  Revert path: remove this block and restore index.html cache keys to rail2.
  Current cache key: activefocus14.
*/

body.run-in-progress .layout > .panel::before {
  content: none !important;
  display: none !important;
}

@media (min-width: 861px) {
  body.run-in-progress .shell {
    padding-top: 0;
  }

  body.run-in-progress .layout > .panel {
    min-height: 0 !important;
    height: fit-content;
  }

  body.run-in-progress .hero {
    display: grid;
    min-height: 220px;
    align-items: end;
    padding: 14px 0 18px;
    opacity: 1;
    filter: none;
  }

  body.run-in-progress .hero::before {
    height: 150px;
    opacity: 0.58;
  }

  body.run-in-progress .brand {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 430px);
    gap: 22px;
  }

  body.run-in-progress .brand-copy {
    padding-top: 0;
  }

  body.run-in-progress .brand-copy::before {
    font-size: 10px;
  }

  body.run-in-progress h1 {
    font-size: clamp(42px, 8vw, 92px);
    line-height: 0.9;
  }

  body.run-in-progress .subtitle,
  body.run-in-progress .hero-vista {
    display: block;
  }

  body.run-in-progress .hero-vista,
  body.run-in-progress .hero-vista svg {
    min-height: 170px;
    height: 170px;
  }

  body.run-in-progress .hero-vista {
    display: block;
    aspect-ratio: auto;
  }

  body.run-in-progress .hero-vista svg {
    width: 100%;
    object-fit: cover;
    object-position: center 56%;
  }

  body.run-in-progress .rules-chip {
    top: 10px;
    right: 10px;
    z-index: 2;
    min-height: 28px;
    padding: 5px 9px;
    background: rgba(6, 13, 28, 0.72);
    border-color: rgba(0, 238, 255, 0.36);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(8px);
  }

  body.run-in-progress .first-visit {
    display: none;
  }

  body.run-in-progress .toolbar {
    display: grid;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    grid-template-columns:
      minmax(160px, 1fr)
      minmax(150px, 0.85fr)
      minmax(170px, max-content)
      minmax(180px, 1fr);
    gap: 6px;
    align-items: stretch;
    margin-bottom: 8px;
    opacity: 0.36;
    filter: saturate(0.55) brightness(0.72);
    pointer-events: none;
    z-index: 0;
  }

  body.run-in-progress .wallet-strip,
  body.run-in-progress .mode-controls {
    display: contents;
  }

  body.run-in-progress .wallet-strip input {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    flex-basis: auto;
  }

  body.run-in-progress #connectWalletBtn {
    grid-column: 3;
    grid-row: 1;
    min-height: 36px;
    padding: 7px 10px;
    white-space: nowrap;
  }

  body.run-in-progress .wallet-status {
    grid-column: 1 / span 2;
    grid-row: 2;
    min-height: 14px;
    padding-left: 2px;
    font-size: 10px;
  }

  body.run-in-progress .mode-controls button {
    min-height: 36px;
    padding: 7px 10px;
  }

  body.run-in-progress #startBtn {
    grid-column: 2;
    grid-row: 1;
  }

  body.run-in-progress #startPrizeBtn {
    grid-column: 3;
    grid-row: 1;
  }

  body.run-in-progress .mode-controls button span {
    display: none;
  }

  body.run-in-progress .run-tips {
    display: grid;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
    opacity: 0.32;
    filter: saturate(0.5) brightness(0.7);
    pointer-events: none;
    z-index: 0;
  }

  body.run-in-progress .run-tip {
    min-height: 38px;
    padding: 7px 9px;
  }

  body.run-in-progress .run-tip span {
    display: none;
  }

  body.run-in-progress .layout > .panel::before,
  body.run-in-progress .layout > .panel::after {
    content: none !important;
    display: none !important;
  }

  body.run-in-progress .panel-pad {
    gap: 6px;
    padding-top: 8px;
    overflow: hidden;
  }

  body.run-in-progress .prize-target {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 6px;
    gap: 6px;
  }

  body.run-in-progress .prize-chip {
    min-height: 36px;
    padding: 5px 7px;
  }

  body.run-in-progress .prize-chip span,
  body.run-in-progress .prize-chip em {
    font-size: 8px;
  }

  body.run-in-progress .prize-chip strong {
    font-size: 13px;
  }

  body.run-in-progress .stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px;
    gap: 6px;
  }

  body.run-in-progress .stat {
    min-height: 34px;
    padding: 5px 6px;
  }

  body.run-in-progress .prize-target,
  body.run-in-progress .stats,
  body.run-in-progress .progress,
  body.run-in-progress .play-tools,
  body.run-in-progress .room-head {
    opacity: 1;
    filter: none;
    transition: opacity 160ms ease, filter 160ms ease;
  }

  body.run-in-progress .chain-progress,
  body.run-in-progress #cardRailCue,
  body.run-in-progress #status {
    display: none !important;
  }

  body.run-in-progress .play-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 0;
    min-height: 42px;
    padding: 6px 10px;
  }

  body.run-in-progress.potion-ready .play-tools {
    position: static;
    z-index: 1;
    width: auto;
    min-height: 42px;
    margin: 0;
    padding: 6px 10px;
    filter: saturate(1.08) brightness(1.05);
  }

  body.run-in-progress .tool-copy span {
    display: none;
  }

  body.run-in-progress .tool-copy #potionTimingLine {
    display: flex;
    max-height: 34px;
    overflow: hidden;
  }

  body.run-in-progress .tool-copy #potionBagLine {
    display: flex;
    max-height: 22px;
    overflow: hidden;
  }

  body.run-in-progress .tool-copy #potionBagLine span {
    display: none;
  }

  body.run-in-progress .tool-copy strong {
    font-size: 11px;
  }

  body.run-in-progress .tool-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
  }

  body.run-in-progress .tool-potion-group {
    grid-template-columns: minmax(0, 1fr) clamp(108px, 10vw, 136px);
  }

  body.run-in-progress .play-tools #potionBtn {
    flex: 0 0 clamp(108px, 10vw, 136px);
    min-height: 42px;
    padding: 7px 10px;
  }

  body.run-in-progress .room-head {
    display: flex;
    min-height: 26px;
    margin-top: 0;
    padding: 0 6px;
  }

  body.run-in-progress #roomCards {
    grid-template-columns: repeat(5, minmax(148px, 1fr));
    grid-auto-rows: auto;
    min-height: 0 !important;
    height: auto !important;
    margin-top: 0;
    margin-bottom: 0;
    padding: 3px 6px 8px;
    align-items: start;
  }

  body.run-in-progress .room-choice {
    align-self: start;
    height: 258px;
    min-height: 258px;
    grid-template-rows: 22px 130px 32px 34px;
    align-content: start;
    gap: 5px;
    padding: 7px;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.1),
      0 14px 32px rgba(4,8,18,0.3),
      0 0 22px var(--card-glow);
  }

  body.run-in-progress .card-art,
  body.run-in-progress .card-art svg {
    min-height: 130px;
    height: 130px;
  }

  body.run-in-progress .card-art svg {
    width: 100%;
  }

  body.run-in-progress .card-top {
    align-items: center;
    gap: 5px;
    min-height: 22px;
    font-size: 9px;
    line-height: 1;
  }

  body.run-in-progress .card-top span {
    min-width: 0;
    max-width: 48%;
    padding: 2px 5px;
    border-radius: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.run-in-progress .card-name {
    min-height: 0;
    font-size: 13px;
    line-height: 1;
  }

  body.run-in-progress .card-subtitle {
    display: none;
  }

  body.run-in-progress .card-meta {
    gap: 4px;
    font-size: 9px;
    line-height: 1;
  }

  body.run-in-progress .pill {
    min-height: 18px;
    padding: 3px 5px;
    border-radius: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.run-in-progress .weapon-badge {
    left: 6px;
    bottom: 6px;
    min-width: 0;
    max-width: calc(100% - 48px);
    gap: 5px;
    padding: 3px 6px;
    font-size: 9px;
  }

  body.run-in-progress .weapon-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 0;
  }

  body.run-in-progress .weapon-badge .weapon-icon {
    width: 18px !important;
    height: 18px !important;
    min-height: 0 !important;
    max-width: 18px;
    max-height: 18px;
  }

  body.run-in-progress .card-kind {
    right: 6px;
    bottom: 6px;
    width: 28px;
    height: 28px;
  }

  body.run-in-progress .actions {
    gap: 5px;
  }

  body.run-in-progress .actions button {
    min-height: 34px;
    padding: 4px 6px;
    font-size: 10px;
    line-height: 1.1;
    overflow: hidden;
  }

  body.run-in-progress .room-choice.weapon .actions {
    grid-template-columns: 1fr;
  }

  body.run-in-progress .room-choice.weapon .actions button {
    grid-column: 1 / -1;
  }
}

@media (min-width: 861px) {
  body:not(.run-in-progress):not(.run-complete) .shell {
    padding-top: 0;
  }

  body:not(.run-in-progress):not(.run-complete) .hero {
    min-height: 220px;
    align-items: end;
    padding: 14px 0 18px;
  }

  body:not(.run-in-progress):not(.run-complete) .hero::before {
    height: 150px;
    opacity: 0.58;
  }

  body:not(.run-in-progress):not(.run-complete) .brand {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 430px);
    gap: 22px;
    align-items: end;
  }

  body:not(.run-in-progress):not(.run-complete) .brand-copy {
    padding-top: 0;
  }

  body:not(.run-in-progress):not(.run-complete) .brand-copy::before {
    font-size: 10px;
  }

  body:not(.run-in-progress):not(.run-complete) h1 {
    font-size: clamp(42px, 8vw, 92px);
    line-height: 0.9;
  }

  body:not(.run-in-progress):not(.run-complete) .subtitle,
  body:not(.run-in-progress):not(.run-complete) .hero-vista {
    display: block;
  }

  body:not(.run-in-progress):not(.run-complete) .hero-vista,
  body:not(.run-in-progress):not(.run-complete) .hero-vista svg {
    min-height: 170px;
    height: 170px;
  }

  body:not(.run-in-progress):not(.run-complete) .hero-vista {
    aspect-ratio: auto;
  }

  body:not(.run-in-progress):not(.run-complete) .hero-vista svg {
    width: 100%;
    object-fit: cover;
    object-position: center 56%;
  }

  body:not(.run-in-progress):not(.run-complete) .rules-chip {
    top: 10px;
    right: 10px;
    z-index: 2;
    min-height: 28px;
    padding: 5px 9px;
    background: rgba(6, 13, 28, 0.72);
    border-color: rgba(0, 238, 255, 0.36);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(8px);
  }

  body:not(.run-in-progress):not(.run-complete) .first-visit {
    display: none;
  }

  body:not(.run-in-progress):not(.run-complete) .layout {
    padding-top: 10px;
  }

  body:not(.run-in-progress):not(.run-complete) .panel-pad {
    padding: 14px;
  }

  body:not(.run-in-progress):not(.run-complete) .toolbar {
    display: grid;
    grid-template-columns:
      minmax(190px, 1fr)
      minmax(190px, 0.92fr)
      minmax(190px, max-content)
      minmax(220px, 1fr);
    gap: 8px;
    align-items: stretch;
    margin-bottom: 12px;
  }

  body:not(.run-in-progress):not(.run-complete) .wallet-strip {
    display: contents;
  }

  body:not(.run-in-progress):not(.run-complete) .wallet-strip input {
    display: none;
  }

  body:not(.run-in-progress):not(.run-complete) .wallet-strip .how-play-cta {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding: 9px 12px;
  }

  body:not(.run-in-progress):not(.run-complete) #connectWalletBtn {
    grid-column: 3;
    grid-row: 1;
    min-height: 44px;
    white-space: nowrap;
  }

  body:not(.run-in-progress):not(.run-complete) .wallet-status {
    grid-column: 1 / span 2;
    grid-row: 2;
    min-height: 18px;
    align-self: start;
    padding-left: 2px;
    overflow-wrap: anywhere;
  }

  body:not(.run-in-progress):not(.run-complete) .mode-controls {
    display: contents;
  }

  body:not(.run-in-progress):not(.run-complete) .mode-controls button {
    min-height: 58px;
    padding: 9px 12px;
  }

  body:not(.run-in-progress):not(.run-complete) #startBtn {
    grid-column: 2;
    grid-row: 1;
  }

  body:not(.run-in-progress):not(.run-complete) #startPrizeBtn {
    grid-column: 4;
    grid-row: 1;
  }

  body:not(.run-in-progress):not(.run-complete) .run-tips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  body:not(.run-in-progress):not(.run-complete) .run-tip {
    min-height: 58px;
    padding: 9px 10px;
  }

  body:not(.run-in-progress):not(.run-complete) .run-tip span {
    font-size: 11px;
    line-height: 1.25;
  }
}

@media (min-width: 721px) and (max-width: 1320px) {
  body:not(.run-in-progress):not(.run-complete) .shell {
    padding: 8px 12px 14px;
  }

  body:not(.run-in-progress):not(.run-complete) .hero {
    min-height: 172px;
    padding: 10px 0 12px;
  }

  body:not(.run-in-progress):not(.run-complete) .brand {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 14px;
  }

  body:not(.run-in-progress):not(.run-complete) h1 {
    font-size: clamp(46px, 6.2vw, 76px);
  }

  body:not(.run-in-progress):not(.run-complete) .subtitle {
    max-width: 780px;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.42;
  }

  body:not(.run-in-progress):not(.run-complete) .hero-vista,
  body:not(.run-in-progress):not(.run-complete) .hero-vista svg {
    min-height: 150px;
    height: 150px;
  }

  body:not(.run-in-progress):not(.run-complete) .layout {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 10px;
  }

  body:not(.run-in-progress):not(.run-complete) .toolbar {
    grid-template-columns:
      minmax(170px, 1fr)
      minmax(178px, 0.9fr)
      minmax(178px, max-content)
      minmax(190px, 1fr);
    gap: 7px;
    margin-bottom: 9px;
  }

  body:not(.run-in-progress):not(.run-complete) .mode-controls button {
    min-height: 50px;
    padding: 8px 10px;
  }

  body:not(.run-in-progress):not(.run-complete) .wallet-strip .how-play-cta {
    min-height: 50px;
    padding: 8px 10px;
  }

  body:not(.run-in-progress):not(.run-complete) .run-tips {
    gap: 7px;
    margin-bottom: 8px;
  }

  body:not(.run-in-progress):not(.run-complete) .run-tip {
    min-height: 52px;
    padding: 8px 9px;
  }

  body:not(.run-in-progress):not(.run-complete) .room-head {
    margin-bottom: 7px;
  }

  body:not(.run-in-progress):not(.run-complete) .room-head h2 {
    font-size: 15px;
  }

  body:not(.run-in-progress):not(.run-complete) #roomCards {
    gap: 10px;
  }

  body:not(.run-in-progress):not(.run-complete) .empty-card {
    min-height: 142px;
    padding: 10px;
  }

  body:not(.run-in-progress):not(.run-complete) .empty-card svg {
    height: 82px;
    margin-bottom: 7px;
  }

  body:not(.run-in-progress):not(.run-complete) .empty-card strong {
    font-size: 14px;
    line-height: 1.12;
  }

  body:not(.run-in-progress):not(.run-complete) .empty-card span {
    margin-top: 2px;
    font-size: 10.5px;
    line-height: 1.22;
  }

  body:not(.run-in-progress):not(.run-complete) .side {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  body:not(.run-in-progress):not(.run-complete) .side .panel {
    min-height: 0;
  }

  body:not(.run-in-progress):not(.run-complete) .side .panel-pad {
    padding: 10px;
  }

  body:not(.run-in-progress):not(.run-complete) .side h3 {
    font-size: 13px;
    line-height: 1.12;
  }

  body:not(.run-in-progress):not(.run-complete) .leader-actions {
    gap: 4px;
  }

  body:not(.run-in-progress):not(.run-complete) .leader-actions button {
    min-height: 24px;
    padding: 3px 6px;
    font-size: 9.5px;
  }

  body:not(.run-in-progress):not(.run-complete) .logbox,
  body:not(.run-in-progress):not(.run-complete) .verify-box {
    max-height: 124px;
    min-height: 68px;
    overflow: auto;
  }

  body:not(.run-in-progress):not(.run-complete) .leaderboard {
    max-height: none;
    min-height: 68px;
    overflow: visible;
    gap: 7px;
    margin-top: 8px;
  }

  body:not(.run-in-progress):not(.run-complete) .leader-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
  }

  body:not(.run-in-progress):not(.run-complete) .leader-row-recent {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body:not(.run-in-progress):not(.run-complete) .leader-name {
    gap: 5px;
  }

  body:not(.run-in-progress):not(.run-complete) .leader-chip {
    min-height: 18px;
    padding: 2px 6px;
    font-size: 9.5px;
  }
}

/*
  Completed runs re-show lobby chrome, but should not fall back to the
  older/taller base hero. Keep the post-run header matched to the lobby
  header so finishing a round does not create an empty blue band above it.
*/
@media (min-width: 861px) {
  body.run-complete .shell {
    padding-top: 0;
  }

  body.run-complete .hero {
    min-height: 220px;
    align-items: end;
    padding: 14px 0 18px;
  }

  body.run-complete .hero::before {
    height: 150px;
    opacity: 0.58;
  }

  body.run-complete .brand {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 430px);
    gap: 22px;
    align-items: end;
  }

  body.run-complete .brand-copy {
    padding-top: 0;
  }

  body.run-complete .brand-copy::before {
    font-size: 10px;
  }

  body.run-complete h1 {
    font-size: clamp(42px, 8vw, 92px);
    line-height: 0.9;
  }

  body.run-complete .subtitle,
  body.run-complete .hero-vista {
    display: block;
  }

  body.run-complete .hero-vista,
  body.run-complete .hero-vista svg {
    min-height: 170px;
    height: 170px;
  }

  body.run-complete .hero-vista {
    aspect-ratio: auto;
  }

  body.run-complete .hero-vista svg {
    width: 100%;
    object-fit: cover;
    object-position: center 56%;
  }

  body.run-complete .rules-chip {
    top: 10px;
    right: 10px;
    z-index: 2;
    min-height: 28px;
    padding: 5px 9px;
    background: rgba(6, 13, 28, 0.72);
    border-color: rgba(0, 238, 255, 0.36);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(8px);
  }
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  body.five-card-preview.run-in-progress .shell {
    height: 100dvh;
    padding: 4px 5px calc(6px + var(--safe-bottom));
  }

  body.five-card-preview.run-in-progress .layout {
    height: calc(100dvh - 8px - var(--safe-bottom));
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
  }

  body.five-card-preview.run-in-progress .layout > .panel {
    min-height: 0;
    overflow: hidden;
  }

  body.five-card-preview.run-in-progress .panel-pad {
    height: 100%;
    display: grid;
    grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
    gap: 4px;
    padding: 4px;
  }

  body.five-card-preview.run-in-progress .prize-target {
    display: none;
  }

  body.five-card-preview.run-in-progress .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 4px;
    gap: 4px;
  }

  body.five-card-preview.run-in-progress .stat {
    min-height: 28px;
    padding: 3px 4px;
  }

  body.five-card-preview.run-in-progress .stat span {
    font-size: 8px;
  }

  body.five-card-preview.run-in-progress .stat strong {
    font-size: 14px;
  }

  body.five-card-preview.run-in-progress .stat-potion,
  body.five-card-preview.run-in-progress .stat-weapon {
    display: none;
  }

  body.five-card-preview.run-in-progress .progress {
    height: 5px;
  }

  body.five-card-preview.run-in-progress .mobile-turn {
    min-height: 31px;
    max-height: 43px;
    padding: 4px 6px;
  }

  body.five-card-preview.run-in-progress .mobile-turn .mobile-weapon-panel {
    min-height: 0;
    padding: 4px 6px;
    gap: 6px;
  }

  body.five-card-preview.run-in-progress .mobile-turn .mobile-weapon-panel > span {
    font-size: 8px;
  }

  body.five-card-preview.run-in-progress .mobile-turn .mobile-weapon-panel strong {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    column-gap: 5px;
    font-size: 10px;
  }

  body.five-card-preview.run-in-progress .mobile-turn .mobile-weapon-panel .weapon-stat-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(121, 184, 255, 0.35);
    border-radius: 7px;
    background: rgba(121, 184, 255, 0.1);
    color: #cbe9ff;
  }

  body.five-card-preview.run-in-progress .mobile-turn .mobile-weapon-panel .weapon-panel-icon {
    width: 14px;
    height: 14px;
  }

  body.five-card-preview.run-in-progress .mobile-turn .mobile-weapon-panel .weapon-stat-name {
    grid-column: 2;
    grid-row: 1;
    font-size: 10px;
  }

  body.five-card-preview.run-in-progress .mobile-turn .mobile-weapon-panel .weapon-stat-power {
    grid-column: 3;
    grid-row: 1;
    font-size: 10px;
    color: #e8f4ff;
    white-space: nowrap;
  }

  body.five-card-preview.run-in-progress .mobile-turn .mobile-weapon-panel .weapon-stat-power b {
    font-size: 12px;
  }

  body.five-card-preview.run-in-progress .mobile-turn .mobile-weapon-panel .weapon-stat-target {
    grid-column: 2;
    grid-row: 2;
    font-size: 8px;
    color: #ffe1a3;
    text-transform: uppercase;
  }

  body.five-card-preview.run-in-progress .mobile-turn .mobile-weapon-panel .weapon-stat-status {
    grid-column: 3;
    grid-row: 2;
    display: block;
    color: #ffe1a3;
    font-size: 8px;
    font-weight: 950;
    text-transform: uppercase;
  }

  body.five-card-preview.run-in-progress .play-tools {
    grid-template-columns: minmax(0, 1fr) minmax(102px, 29%);
    min-height: 32px;
    padding: 4px 6px;
    gap: 6px;
  }

  body.five-card-preview.run-in-progress .play-tools::after {
    inset: auto 8px 2px;
  }

  body.five-card-preview.run-in-progress.potion-ready .play-tools {
    min-height: 32px;
    padding: 4px 6px;
  }

  body.five-card-preview.run-in-progress .tool-copy strong {
    display: none;
  }

  body.five-card-preview.run-in-progress .tool-copy #potionBagLine {
    margin: 0;
    max-height: 26px;
  }

  body.five-card-preview.run-in-progress .tool-copy #potionBagLine b {
    min-height: 16px;
    padding: 1px 5px;
    font-size: 10px;
  }

  body.five-card-preview.run-in-progress .play-tools #potionBtn {
    min-height: 30px;
    padding: 4px 6px;
    font-size: 10px;
  }

  body.five-card-preview.run-in-progress .room-head {
    min-height: 22px;
    margin: 0;
    padding: 0 3px;
  }

  body.five-card-preview.run-in-progress .room-head h2 {
    font-size: 13px;
  }

  body.five-card-preview.run-in-progress.new-room-pulse .room-head h2 {
    animation: five-card-room-title-pulse 1.05s ease-in-out 2;
  }

  body.five-card-preview.run-in-progress .room-head-right {
    flex: 1 1 auto;
    gap: 3px;
    justify-content: flex-end;
    min-width: 0;
  }

  body.five-card-preview.run-in-progress .view-switch-wrap {
    display: block;
    flex: 0 1 auto;
    min-width: 0;
  }

  body.five-card-preview.run-in-progress .view-switch {
    width: 100px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    padding: 1px;
    border-radius: 6px;
  }

  body.five-card-preview.run-in-progress .view-switch button {
    min-height: 17px;
    padding: 1px 2px;
    font-size: 8px;
    line-height: 1;
    white-space: nowrap;
  }

  body.five-card-preview.run-in-progress #modeLine {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 112px;
    min-height: 18px;
    padding: 2px 6px;
    border: 1px solid rgba(102, 164, 250, 0.2);
    border-radius: 999px;
    background: rgba(5, 10, 22, 0.42);
    color: #dbeafe;
    font-size: 9.5px;
    line-height: 1.15;
    text-align: right;
  }

  body.five-card-preview.run-in-progress #roomCards {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(67px, 1fr);
    gap: 4px;
    min-height: 0 !important;
    height: 100% !important;
    max-height: none;
    overflow: hidden;
    padding: 0 1px 1px;
    scroll-snap-type: none;
  }

  body.five-card-preview.run-in-progress.new-room-pulse #roomCards {
    animation: five-card-room-stack-transition 0.8s ease-out 1;
  }

  body.five-card-preview.run-in-progress #cardRailCue {
    display: none !important;
  }

  body.five-card-preview.run-in-progress .room-choice {
    width: 100%;
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 136px minmax(0, 1fr) 88px;
    grid-template-rows: 1fr;
    align-items: stretch;
    gap: 4px;
    padding: 5px;
    overflow: hidden;
    scroll-snap-align: none;
  }

  body.five-card-preview.run-in-progress .room-choice::before {
    inset: 4px;
  }

  body.five-card-preview.run-in-progress.new-room-pulse .room-choice {
    animation:
      five-card-room-card-pulse 1.05s ease-in-out 2;
  }

  body.five-card-preview.run-in-progress.new-room-pulse .room-choice .card-art,
  body.five-card-preview.run-in-progress.new-room-pulse .room-choice .card-copy {
    animation: five-card-room-card-enter 0.72s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  body.five-card-preview.run-in-progress.new-room-pulse .room-choice:nth-child(2) .card-art,
  body.five-card-preview.run-in-progress.new-room-pulse .room-choice:nth-child(2) .card-copy {
    animation-delay: 0.06s;
  }

  body.five-card-preview.run-in-progress.new-room-pulse .room-choice:nth-child(3) .card-art,
  body.five-card-preview.run-in-progress.new-room-pulse .room-choice:nth-child(3) .card-copy {
    animation-delay: 0.12s;
  }

  body.five-card-preview.run-in-progress.new-room-pulse .room-choice:nth-child(4) .card-art,
  body.five-card-preview.run-in-progress.new-room-pulse .room-choice:nth-child(4) .card-copy {
    animation-delay: 0.18s;
  }

  body.five-card-preview.run-in-progress.new-room-pulse .room-choice:nth-child(5) .card-art,
  body.five-card-preview.run-in-progress.new-room-pulse .room-choice:nth-child(5) .card-copy {
    animation-delay: 0.24s;
  }

  body.five-card-preview.run-in-progress.new-room-pulse .room-choice::before {
    animation: five-card-room-border-pulse 1.05s ease-in-out 2;
  }

  body.five-card-preview.run-in-progress .room-choice.resolved {
    opacity: 1;
    filter: none;
  }

  body.five-card-preview.run-in-progress .room-choice.resolved .card-art,
  body.five-card-preview.run-in-progress .room-choice.resolved .card-copy {
    opacity: 0.5;
    filter: saturate(0.62);
  }

  body.five-card-preview.run-in-progress .room-choice.resolved .card-art svg {
    filter: saturate(0.58) contrast(0.9) brightness(0.72);
  }

  body.five-card-preview.run-in-progress .room-choice.resolved-slain .card-art::after {
    content: "";
    position: absolute;
    inset: 12% 10%;
    z-index: 3;
    border-top: 3px solid rgba(255, 230, 156, 0.9);
    border-bottom: 3px solid rgba(239, 106, 91, 0.82);
    transform: rotate(-18deg);
    pointer-events: none;
  }

  body.five-card-preview.run-in-progress .room-choice.resolved-evaded .card-art::after,
  body.five-card-preview.run-in-progress .room-choice.resolved-fatal .card-art::after {
    content: "";
    position: absolute;
    inset: 9px;
    z-index: 3;
    border: 2px dashed rgba(255, 196, 184, 0.62);
    border-radius: 8px;
    pointer-events: none;
  }

  body.five-card-preview.run-in-progress .card-top {
    display: none;
  }

  body.five-card-preview.run-in-progress .room-choice::after {
    right: 98px;
  }

  body.five-card-preview.run-in-progress .mobile-choice-action {
    display: none;
  }

  body.five-card-preview.run-in-progress .card-art,
  body.five-card-preview.run-in-progress .card-art svg {
    width: 136px;
    min-width: 136px;
    height: 100%;
    min-height: 0;
  }

  body.five-card-preview.run-in-progress .card-art svg {
    width: 100%;
    height: 100%;
  }

  body.five-card-preview.run-in-progress .classic-card-face {
    min-height: 0;
  }

  body.five-card-preview.run-in-progress .classic-card-corner,
  body.five-card-preview.run-in-progress .classic-card-rule {
    display: none;
  }

  body.five-card-preview.run-in-progress .classic-card-center strong {
    font-size: 16px;
  }

  body.five-card-preview.run-in-progress .card-kind {
    right: 3px;
    bottom: 3px;
    width: 20px;
    height: 20px;
    font-size: 12px;
  }

  body.five-card-preview.run-in-progress .weapon-badge {
    top: auto;
    right: 3px;
    bottom: 3px;
    left: auto;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    max-width: none;
    padding: 2px;
    border-radius: 50%;
  }

  body.five-card-preview.run-in-progress .weapon-badge span {
    display: none;
  }

  body.five-card-preview.run-in-progress .weapon-badge .weapon-icon {
    width: 13px !important;
    height: 13px !important;
    max-width: 13px;
    max-height: 13px;
  }

  body.five-card-preview.run-in-progress .resolved-badge {
    position: absolute;
    left: 5px;
    bottom: 5px;
    z-index: 5;
    max-width: calc(100% - 10px);
    padding: 3px 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(5, 8, 16, 0.9);
    color: #fff4d5;
    font-size: 8.5px;
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.46), 0 0 14px rgba(245, 196, 95, 0.18);
  }

  body.five-card-preview.run-in-progress .resolved-badge.slain {
    border-color: rgba(239, 106, 91, 0.54);
    color: #ffd47a;
  }

  body.five-card-preview.run-in-progress .resolved-badge.equipped,
  body.five-card-preview.run-in-progress .resolved-badge.banked,
  body.five-card-preview.run-in-progress .resolved-badge.used {
    border-color: rgba(0, 238, 255, 0.38);
    color: #c8fbff;
  }

  body.five-card-preview.run-in-progress .card-copy {
    position: relative;
    z-index: 1;
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    overflow: hidden;
  }

  body.five-card-preview.run-in-progress .card-name {
    min-height: 0;
    font-size: 13px;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.five-card-preview.run-in-progress .card-subtitle {
    display: block;
    min-height: 0;
    color: #b9c5dc;
    font-size: 10.5px;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.five-card-preview.run-in-progress .card-meta {
    display: flex;
    gap: 3px;
    min-height: 0;
    overflow: hidden;
  }

  body.five-card-preview.run-in-progress .pill {
    flex: 0 1 auto;
    min-height: 16px;
    padding: 2px 5px;
    font-size: 9.5px;
    line-height: 1;
  }

  body.five-card-preview.run-in-progress .actions {
    position: relative;
    inset: auto;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    grid-column: 3;
    grid-row: 1;
    gap: 4px;
    min-width: 0;
    min-height: 0;
    opacity: 1;
  }

  body.five-card-preview.run-in-progress .actions button {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 7px;
    padding: 5px 5px;
    font-size: 12px;
    line-height: 1.05;
    white-space: normal;
  }

  body.five-card-preview.run-in-progress .actions button strong,
  body.five-card-preview.run-in-progress .actions button span {
    display: block;
  }

  body.five-card-preview.run-in-progress .actions button strong {
    color: #fff7d6;
    font-size: 14.25px;
    line-height: 1;
    white-space: nowrap;
  }

  body.five-card-preview.run-in-progress .actions button span {
    margin-top: 3px;
    color: #f5c45f;
    font-size: 11.5px;
    font-weight: 900;
  }

  body.five-card-preview.run-in-progress .actions button em,
  body.five-card-preview.run-in-progress .mobile-choice-action em {
    display: block;
    margin-top: 2px;
    color: #f5c45f;
    font-size: 10.5px;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
  }

  body.five-card-preview.run-in-progress .actions .button-icon {
    display: block;
    width: 16px;
    height: 16px;
    margin-bottom: 2px;
  }

  body.five-card-preview.run-in-progress .actions button.secondary {
    height: auto;
    min-height: 25px;
    font-size: 9.5px;
    color: #ffc4b8;
  }

  body.five-card-preview.run-in-progress .actions button:only-child,
  body.five-card-preview.run-in-progress .resolved-action {
    grid-row: 1 / -1;
  }

  body.five-card-preview.run-in-progress .room-choice.resolved .actions {
    position: relative;
    display: block;
    grid-column: 3;
    grid-row: 1;
    pointer-events: none;
  }

  body.five-card-preview.run-in-progress .room-choice.resolved .resolved-badge {
    display: none;
  }

  body.five-card-preview.run-in-progress .resolved-action {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 50%;
    z-index: 8;
    display: grid;
    place-items: center;
    align-content: center;
    width: auto;
    height: auto;
    min-height: 39px;
    border: 1px solid rgba(255, 244, 213, 0.38);
    border-radius: 7px;
    background:
      linear-gradient(90deg, rgba(5, 10, 22, 0.82), rgba(19, 31, 56, 0.96), rgba(5, 10, 22, 0.82));
    color: #fff4d5;
    padding: 6px 9px;
    font-size: 13px;
    font-weight: 950;
    line-height: 1.05;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.95);
    transform: translateY(-50%);
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.46),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }

  body.five-card-preview.run-in-progress .resolved-action strong,
  body.five-card-preview.run-in-progress .resolved-action span {
    display: block;
  }

  body.five-card-preview.run-in-progress .resolved-action span {
    margin-top: 3px;
    color: #f3f7ff;
    font-size: 10px;
    font-weight: 850;
    line-height: 1.1;
    text-transform: none;
  }

  body.five-card-preview.run-in-progress .resolved-action.slain {
    color: #ffd47a;
    border-color: rgba(245, 196, 95, 0.52);
    box-shadow:
      inset 0 0 0 1px rgba(245, 196, 95, 0.14),
      0 10px 24px rgba(0, 0, 0, 0.46),
      0 0 18px rgba(245, 196, 95, 0.14);
  }

  body.five-card-preview.run-in-progress .side {
    display: block;
    min-height: 0;
    overflow: hidden;
  }

  body.five-card-preview.run-in-progress .side .panel:first-child {
    min-height: 58px;
    max-height: 78px;
    margin-top: 4px;
    padding: 5px;
  }

  body.five-card-preview.run-in-progress .side .panel:first-child h3 {
    display: none;
  }

  body.five-card-preview.run-in-progress .side .panel:first-child .logbox {
    min-height: 0;
    max-height: 68px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.five-card-preview.run-in-progress .side .panel:first-child .recent-turns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  body.five-card-preview.run-in-progress .side .panel:first-child .recent-turns li {
    padding: 4px 6px;
  }

  body.five-card-preview.run-in-progress .side .panel:first-child .recent-turns li:nth-child(n + 5) {
    display: none;
  }
}

@keyframes five-card-room-title-pulse {
  0%, 100% {
    color: inherit;
    text-shadow: none;
    transform: translateZ(0);
  }
  35% {
    color: #fff7d6;
    text-shadow:
      0 0 10px rgba(245, 196, 95, 0.65),
      0 0 22px rgba(0, 238, 255, 0.28);
    transform: scale(1.035);
  }
}

@keyframes five-card-room-stack-transition {
  0% {
    transform: translateY(8px);
  }
  58% {
    transform: translateY(-2px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes five-card-room-card-enter {
  0% {
    opacity: 0.18;
    transform: translateX(14px) scale(0.985);
  }
  68% {
    opacity: 1;
    transform: translateX(-2px) scale(1.006);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes five-card-room-card-pulse {
  0%, 100% {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 14px 32px rgba(4,8,18,0.3), 0 0 22px var(--card-glow);
  }
  35% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.22),
      0 16px 36px rgba(4,8,18,0.42),
      0 0 0 1px rgba(245,196,95,0.52),
      0 0 26px rgba(0,238,255,0.34),
      0 0 30px var(--card-glow);
  }
}

@keyframes five-card-room-border-pulse {
  0%, 100% {
    opacity: 0.9;
    border-color: currentColor;
  }
  35% {
    opacity: 1;
    border-color: rgba(255, 247, 214, 0.9);
  }
}

@media (max-width: 380px) {
  body.five-card-preview.run-in-progress .room-choice::after {
    right: 90px;
  }

  body.five-card-preview.run-in-progress .room-choice {
    grid-template-columns: 108px minmax(0, 1fr) 80px;
    gap: 4px;
    padding: 4px;
  }

  body.five-card-preview.run-in-progress .card-art,
  body.five-card-preview.run-in-progress .card-art svg {
    width: 108px;
    min-width: 108px;
  }

  body.five-card-preview.run-in-progress .mobile-choice-action strong {
    font-size: 13px;
  }

  body.five-card-preview.run-in-progress .actions button strong {
    font-size: 13.25px;
  }
}

@media (max-height: 760px) and (max-width: 720px), (max-height: 760px) and (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  body.five-card-preview.run-in-progress .panel-pad {
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
  }

  body.five-card-preview.run-in-progress .mobile-turn {
    display: none;
  }

  body.five-card-preview.run-in-progress .side .panel:first-child {
    max-height: 54px;
  }

  body.five-card-preview.run-in-progress .side .panel:first-child .recent-turns {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.five-card-preview.run-in-progress .side .panel:first-child .recent-turns span {
    display: none;
  }
}

@media (max-height: 680px) and (max-width: 720px), (max-height: 680px) and (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  body.five-card-preview.run-in-progress .side .panel:first-child {
    display: none;
  }
}

@media (min-width: 721px) {
  body.five-card-preview.run-in-progress .mobile-choice-stat,
  body.five-card-preview.run-in-progress .mobile-choice-action {
    display: none;
  }
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  body.run-in-progress .shell {
    padding: 4px 6px calc(8px + var(--safe-bottom));
  }

  body.run-in-progress .layout {
    gap: 0;
  }

  body.run-in-progress .layout > .panel::after {
    display: none !important;
  }

  body.run-in-progress .panel-pad {
    gap: 4px;
    padding: 5px;
  }

  body.run-in-progress .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding: 5px;
  }

  body.run-in-progress .stat-potion {
    display: none;
  }

  body.run-in-progress .stat {
    min-height: 30px;
    padding: 4px 5px;
  }

  body.run-in-progress .stat strong {
    font-size: 16px;
  }

  body.run-in-progress .play-tools {
    grid-template-columns: minmax(0, 1fr) minmax(118px, 32%);
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 5px 8px;
  }

  body.run-in-progress .tool-weapon {
    display: none;
  }

  body.run-in-progress.potion-ready .play-tools {
    min-height: 36px;
    padding: 5px 8px;
  }

  body.run-in-progress .play-tools #potionBtn {
    flex-basis: 100%;
    min-height: 34px;
    padding: 5px 8px;
    white-space: nowrap;
  }

  body.five-card-preview.run-in-progress .play-tools {
    grid-template-columns: minmax(0, 1fr) minmax(126px, 34%);
    gap: 6px;
    min-height: 32px;
    padding: 4px 6px;
  }

  body.five-card-preview.run-in-progress .play-tools::after {
    inset: auto 8px 2px;
  }

  body.five-card-preview.run-in-progress.potion-ready .play-tools {
    min-height: 32px;
    padding: 4px 6px;
  }

  body.five-card-preview.run-in-progress .play-tools #potionBtn {
    min-height: 30px;
    padding: 4px 6px;
  }

  body.run-in-progress .tool-actions {
    display: block;
    width: 100%;
  }

  body.run-in-progress .tool-copy span {
    display: none;
  }

  body.five-card-preview.run-in-progress .tool-copy #potionTimingLine {
    display: none;
  }

  body.five-card-preview.run-in-progress .tool-copy #potionBagLine {
    display: flex;
    margin: 0;
    max-height: 26px;
  }

  body.five-card-preview.run-in-progress .tool-copy #potionBagLine span {
    display: inline-flex;
  }

  body.five-card-preview.run-in-progress .tool-actions {
    display: block;
    width: 100%;
  }

  body.five-card-preview.run-in-progress .play-tools #potionBtn {
    width: 100%;
    min-width: 96px;
  }

  body.run-in-progress .mobile-turn {
    min-height: 0;
    max-height: 98px;
    overflow: hidden;
  }

  body.run-in-progress .mobile-turn .turn-potion-loadout,
  body.run-in-progress .mobile-turn .turn-weapon-loadout {
    display: none;
  }

  body.run-in-progress .side {
    gap: 6px;
  }

  body.run-in-progress .side .panel:first-child {
    display: block;
    margin-top: 6px;
    min-height: 206px;
    padding: 6px;
  }

  body.run-in-progress .side .panel:first-child h3 {
    margin: 0 0 4px;
    font-size: 11px;
  }

  body.run-in-progress .side .panel:first-child .logbox {
    min-height: 158px;
    max-height: 166px;
    padding: 6px;
    overflow: hidden;
  }

  body.run-in-progress .side .panel:first-child .recent-turns {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  body.run-in-progress .side .panel:first-child .recent-turns li {
    min-width: 0;
    padding: 5px 7px;
    border: 1px solid rgba(102, 164, 250, 0.18);
    border-radius: 7px;
    background: rgba(5, 10, 22, 0.28);
  }

  body.run-in-progress .side .panel:first-child .recent-turns strong,
  body.run-in-progress .side .panel:first-child .recent-turns span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.run-in-progress .side .panel:first-child .recent-turns strong {
    color: #fff;
    font-size: 11px;
    line-height: 1.1;
  }

  body.run-in-progress .side .panel:first-child .recent-turns span {
    margin-top: 2px;
    color: #a9b8d4;
    font-size: 9px;
  }

  body.run-in-progress .side .panel:nth-child(2) {
    display: none;
  }

  body.run-in-progress .side .panel:nth-child(3) {
    display: none;
  }

  body.run-in-progress .room-head {
    min-height: 22px;
    margin-bottom: 3px;
    padding: 0 4px;
    position: relative;
    z-index: 2;
  }

  body.run-in-progress #roomCards {
    margin-top: 2px;
    padding: 2px 48px 8px 2px;
  }

  body.run-in-progress .room-choice {
    height: 226px;
    min-height: 226px;
    grid-template-rows: 20px 104px 28px 34px;
    gap: 4px;
    padding: 6px;
  }

  body.run-in-progress .card-art,
  body.run-in-progress .card-art svg {
    min-height: 104px;
    height: 104px;
  }

  body.run-in-progress .actions button {
    min-height: 34px;
    padding: 4px 6px;
    font-size: 10px;
  }
}

@media (min-width: 861px) {
  body.run-in-progress:not(.five-card-preview) .tool-copy {
    display: grid;
    align-content: center;
    row-gap: 5px;
  }

  body.run-in-progress:not(.five-card-preview) .tool-copy #potionTimingLine {
    margin-top: 1px;
  }

  body.run-in-progress:not(.five-card-preview) .tool-copy #potionBagLine {
    gap: 5px;
    margin-top: 0;
    padding-top: 1px;
    max-height: 24px;
  }

  body.run-in-progress:not(.five-card-preview) .tool-copy #potionBagLine b {
    min-height: 17px;
    padding: 2px 6px;
    line-height: 1;
  }
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  body.run-complete .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.run-complete .stat-potion,
  body.run-complete .stat-weapon {
    display: none;
  }

  body.run-complete .hero {
    min-height: 0;
    padding: 8px 2px 10px;
  }

  body.run-complete .hero-vista,
  body.run-complete .hero-vista svg {
    min-height: 134px;
  }
}
