:root {
  color-scheme: dark;
  --ink: #f4edde;
  --muted: #b3c5ca;
  --gold: #f3d89b;
  --safe: #bbefc9;
  --lost: #ffc5a5;
  --line: #819b9e42;
  --font-ui: Aptos, "Segoe UI", "Microsoft JhengHei", system-ui, sans-serif;
  --font-display: Bahnschrift, "Arial Narrow", "Microsoft JhengHei", sans-serif;
  background: #0a1422;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); font: 500 14px/1.5 var(--font-ui); }
button, input { color: inherit; font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
:root ::selection { background: #704627; color: #fff5db; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.app[data-game="blast"] {
  --game-accent: #f4d18a;
  --header-accent: #213651;
  --dock-max-width: 444px;
  isolation: isolate;
  position: relative;
  width: min(1140px, 100%);
  min-height: 100dvh;
  margin-inline: auto;
  padding: 14px clamp(10px, 2vw, 18px) 28px;
  background: #0c1520;
}
.app[data-game="blast"]::before {
  position: absolute; z-index: -1; inset: 1px; content: ""; pointer-events: none;
  background: linear-gradient(180deg, #0b1825c9, #14192291 66%, #17191ff2),
    url("assets/starport-theatre-small.webp") center 45% / cover no-repeat;
  opacity: .58;
}
.app[data-game="blast"] > .header.game-header {
  min-height: 56px;
  width: 100%;
  margin: 0;
  color: #f8edd8;
  border-color: #a3bbc347;
  background: linear-gradient(117deg, #43515c 0%, #24374f 54%, #192e48 100%);
}
.hud-demo { color: var(--gold) !important; }
.app[data-game="blast"] .header-brand .game-badge { object-fit: cover; }
.app[data-game="blast"] .header-zone-right button.header-asset { min-width: 106px; text-align: left; }
.app[data-game="blast"] .practice-wallet .hud-score small { color: #d8d2b6; }
.app[data-game="blast"] .practice-wallet:disabled .hud-score strong { color: #c1cdd4; }
.app[data-game="blast"] .practice-wallet .practice-token {
  display: block; width: 23px; height: 23px; flex: 0 0 23px;
  background: url("series/assets/paper-controls/tokens.webp") center / contain no-repeat;
}
.back-mark {
  display: block; width: 8px; height: 8px; margin-left: 4px;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.info-mark {
  display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 50%;
  font: 700 11px/1 var(--font-ui);
}
.blast-map-instruments {
  display: grid; grid-template-columns: auto minmax(0, 1fr) 148px; align-items: center;
  gap: 12px; min-height: 100px;
  margin-top: 10px; padding: 8px 12px; border: 1px solid #57818a4b;
  border-radius: 5px 11px 5px 9px; background: linear-gradient(108deg, #153638, #112631);
}
.starport-dial { width: 42px; height: 38px; object-fit: contain; }
.blast-map-readout { display: grid; gap: 3px; min-width: 0; }
.map-context { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 8px; }
#sector-title { color: var(--gold); font: 730 12px/1.25 var(--font-ui); }
#round-id { color: #bad3cf; font-size: 11px; font-variant-numeric: tabular-nums; }
.map-objective { margin: 0; color: #fff0c9; font-size: 15px; font-weight: 750; line-height: 1.35; }
#entry-step, #status-message { margin: 0; color: #d6e8e2; font-size: 12px; line-height: 1.35; }
.blast-map-instruments:has(.blast-map-timer:not([data-clock="ready"])) #entry-step { display: none; }
.blast-map-instruments:is([data-phase="revealing"], [data-phase="settled"]) .map-objective,
.blast-map-instruments[data-phase="revealing"] #status-message { display: none; }
.reveal-summary { display: grid; gap: 3px; min-width: 0; }
#reveal-count {
  margin: 0; color: #ffd6c8; font-size: 14px; font-weight: 760; line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.lost-rooms {
  display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0;
}
.lost-rooms li {
  padding: 2px 6px; border: 1px solid #ed9d8d; border-radius: 4px 7px;
  background: #512c2d; color: #ffe0d6; font-size: 12px; font-weight: 710;
  line-height: 1.2; font-variant-numeric: tabular-nums;
}
#status-message:empty { display: none; }
#status-message[data-tone="safe"] { color: var(--safe); }
#status-message[data-tone="lost"], #status-message[data-tone="error"] { color: var(--lost); }
.station #round-status:has(#entry-guide:not([hidden])) {
  width: min(calc(100% - 16px), 444px);
}
#round-status #entry-guide {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.22fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 3px;
  inline-size: min(100%, 410px);
  margin: 1px 0 0;
  padding: 0;
  list-style: none;
}
#round-status #entry-guide[hidden], #round-status #entry-step[hidden] { display: none; }
#entry-guide li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  align-content: center;
  gap: 4px;
  min-inline-size: 0;
  padding: 3px 4px;
  border-block-end: 1px solid #8ac4ae60;
  color: #e9f7f0;
  font-size: clamp(10px, 2.9vw, 12px);
  font-weight: 700;
  line-height: 1.22;
  text-wrap: balance;
}
#entry-guide li > b {
  display: grid;
  place-items: center;
  inline-size: 13px;
  block-size: 13px;
  border: 1px solid #8ec8b4;
  border-radius: 50%;
  color: #cbf3e2;
  font-size: 9px;
  line-height: 1;
}
#entry-guide li small {
  display: block;
  margin-block-start: 1px;
  color: #d4eade;
  font-size: clamp(9px, 2.5vw, 10.5px);
  font-weight: 600;
}
#entry-guide li[aria-current="step"] {
  background: #534625a8;
  color: #fff0be;
  border-block-end-color: #ffe18f;
}
#entry-guide li[aria-current="step"] > b {
  border-color: #ffe18f;
  background: #ffe18f;
  color: #302312;
}
#labels [aria-pressed="true"]:not(.safe):not(.lost) {
  outline: 2px solid #ffe199;
  outline-offset: 1px;
}
.blast-map-timer {
  position: relative; display: grid; place-content: center; justify-items: center; align-self: stretch;
  min-width: 0; min-height: 80px; gap: 2px; overflow: hidden; padding: 6px 6px 8px;
  color: #ffe9b3; border: 1px solid #8c7852; border-radius: 5px 11px 5px 9px;
  background: linear-gradient(152deg, #332b1b, #1d2527);
}
.blast-map-timer[data-clock="running"] {
  color: #f5ffe4; border-color: #86ddc1;
  background: linear-gradient(145deg, #18544e, #203738);
}
.blast-map-timer[data-clock="urgent"] {
  color: #fff3dd; border-color: #ffd394;
  background: linear-gradient(145deg, #7b351b, #47291d);
}
.blast-map-timer:is([data-clock="locked"], [data-clock="revealing"]) {
  color: #fff0ce; border-color: #d6aa6e; background: #483b30;
}
.blast-map-timer[data-clock="settled"] { color: #def4ea; border-color: #72a79a; background: #203b3d; }
.blast-map-timer[data-result="safe"] {
  color: #d3ffde; border-color: #a2eac3; background: linear-gradient(153deg, #20584d, #1e3936);
}
.blast-map-timer[data-result="lost"] {
  color: #ffe1d8; border-color: #ffab9a; background: linear-gradient(153deg, #79392d, #4f2829);
}
.blast-map-timer:is([data-result="safe"], [data-result="lost"]) #clock-label { display: none; }
.personal-result {
  display: grid; justify-items: center; gap: 4px; min-width: 0; text-align: center; align-content: center;
}
#personal-bay { color: inherit; font-size: 11px; font-weight: 700; line-height: 1.25; text-wrap: balance; }
#personal-status {
  font: 850 clamp(18px, 4.8vw, 31px)/1.06 var(--font-display);
  color: inherit;
}
#clock-label { color: inherit; text-align: center; font: 750 12px/1.2 var(--font-ui); }
#timer-value { display: flex; align-items: baseline; justify-content: center; gap: 4px; }
#countdown { font: 850 48px/.93 var(--font-display); font-variant-numeric: tabular-nums; }
#seconds-unit { align-self: end; padding-bottom: 2px; font-size: 12px; font-weight: 750; }
.progress {
  position: absolute; right: 0; bottom: 0; left: 0;
  overflow: hidden; height: 4px; background: #eaf8de35;
}
.blast-map-timer:not([data-clock="running"]):not([data-clock="urgent"]) .progress { display: none; }
.progress i { display: block; height: 100%; background: currentColor; transform: scaleX(0); transform-origin: left; }
.blast-map-instruments:is([data-phase="locked"], [data-phase="revealing"]) { border-color: #c89c647a; }
.game-layout { display: grid; gap: 12px; grid-template-columns: minmax(0, 1.75fr) minmax(285px, 1fr); align-items: start; margin-top: 10px; }
.game-stage-viewport { min-width: 0; overflow: hidden; border: 1px solid #7b9da45c; border-radius: 6px 14px 6px 12px; background: #101f29; }
.viewport {
  isolation: isolate; position: relative; height: clamp(440px, calc(100dvh - 220px), 630px);
  background: #10212b url("assets/starport-theatre-small.webp") center / cover no-repeat;
}
#scene { position: absolute; display: block; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
#scene:active { cursor: grabbing; }
#station-flight #door-control { left: var(--hatch-x); top: var(--hatch-y); }
#game-sheet .sheet-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
#game-sheet .sheet-tabs button { min-width: 0; }
@media (min-width: 651px) {
  #stage.station:not(.fallback) .flight-rail > .airlock-controls { bottom: 58px; }
}
.labels { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.room-marker {
  position: absolute; top: 0; left: 0; width: 78px; height: 46px; transform: translate(-50%, -50%);
  display: grid; grid-template: auto auto / auto auto; align-content: center; justify-content: center;
  align-items: center; gap: 0 4px; padding: 2px 4px; pointer-events: auto;
  border: 1px solid transparent; border-radius: 4px 8px;
  background: #101c27d8; color: var(--gold); text-shadow: 0 2px 3px #050d18;
  font: 700 12px/1.28 var(--font-ui);
}
.room-marker b { grid-row: 1; grid-column: 1; color: #f6dc9d; font-size: 11px; font-variant-numeric: tabular-nums; }
.room-marker small { grid-row: 1; grid-column: 2; color: #ffe6ab; font-size: 11px; white-space: nowrap; }
.room-marker strong { grid-column: 1 / -1; color: #f4f8e8; font: 750 12px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.room-marker.selected, .room-marker:not(:disabled):hover { border-color: #f4d698c9; background: #2a3027f5; }
.room-marker.safe { border-color: #9bdbab8c; background: #163026ed; }
.room-marker.safe strong { color: var(--safe); }
.room-marker.lost { border-color: #ff9c8d; background: #632e2cee; }
.room-marker.lost :is(b, small, strong) { color: #ffe4db; }
.room-marker.lost::after {
  content: ""; position: absolute; top: -3px; right: -3px;
  width: 14px; height: 14px; border: 1px solid #ffc0ae; border-radius: 3px;
  background: #8d3f33 center / 8px 8px no-repeat;
  background-image: linear-gradient(45deg, transparent 42%, #fff0e9 43% 57%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, #fff0e9 43% 57%, transparent 58%);
}
.stage-footer {
  display: flex; align-items: center; justify-content: end; gap: 6px; min-height: 43px; padding-inline: 9px;
  border-top: 1px solid #7891933b; background: #10242b; color: #bbccca; font-size: 11px;
}
.camera-hint { margin-right: auto; }
.map-button, .setting-tools .tool {
  min-height: 44px; padding: 0 9px; border: 1px solid transparent; border-radius: 5px 9px;
  background: transparent; color: #d9e9e5; font-size: 12px; white-space: nowrap;
}
.map-button:hover, .setting-tools .tool:hover { border-color: var(--line); background: #1a333c; color: var(--gold); }
.scene-fallback { position: absolute; inset: 49% 12px auto; margin: 0; text-align: center; color: #f5e6c6; }
.stage.fallback .viewport { height: 115px; }
.stage.fallback .camera-hint, .stage.fallback #reset-view, .stage.fallback #inspect-room,
.stage[data-view="cabin"] #reset-view { display: none; }
#inspect-room { color: #f3d89b; }
#inspect-room[aria-pressed="true"] { border-color: #ecd69b70; background: #263a3b; }
.room-list {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 8px; background: #10242b;
}
.room-list button {
  display: grid; grid-template-rows: auto 1fr auto; align-items: center; justify-items: center; gap: 3px;
  min-width: 0; min-height: 45px; border: 1px solid var(--line); border-radius: 5px 9px;
  padding: 5px; background: #1b303b; color: #f2e4bd; font-size: 11px;
}
.room-list button img { width: 30px; height: 28px; object-fit: contain; }
.room-list-name { min-width: 0; overflow-wrap: anywhere; }
.room-list-status { white-space: nowrap; }
.room-list button.selected { border-color: var(--gold); }
.room-list button.safe { color: var(--safe); }
.room-list button.lost { color: #ffe1d6; border-color: #ed9d8d; background: #512c2d; }
.app[data-game="blast"] .blast-bet-dock {
  width: 100%; max-width: none; margin: 0; padding: 10px; gap: 8px; align-self: start;
  background: linear-gradient(140deg, #233c44, #101b29 76%);
  --fold-edge: #f3d89b;
}
.blast-bet-dock .bet-dock-segmented { min-width: 0; }
.blast-bet-dock .bet-dock-segment-btn { min-height: 44px; background: transparent; color: #c5d4d8; }
.blast-bet-dock .bet-dock-segment-btn[aria-pressed="true"] {
  color: #ffe0a1; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  background: #4763695a; font-weight: 800;
}
.blast-bet-dock .bet-dock-segment-btn:disabled { opacity: .64; }
.blast-bet-dock .bet-dock-segmented { background: #304a526e; }
.blast-bet-dock .turn-stake summary { min-height: 46px; }
.stake-controls { min-width: 0; display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.amount-input { display: flex; align-items: center; min-height: 44px; gap: 6px; padding: 0 10px; border: 1px solid #6b8a9c65; border-radius: 6px; background: #0b1927; }
.amount-input input { width: 100%; min-width: 0; border: 0; background: transparent; font-weight: 750; }
.amount-input span { color: var(--muted); font-size: 12px; }
.quick-amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.quick-amounts button {
  min-height: 44px; border: 1px solid #6b8a9c46; border-radius: 5px 8px;
  background: #1b303e; color: #dce8e5; font-variant-numeric: tabular-nums;
}
.quick-amounts button[aria-pressed="true"] { border-color: #ecc47992; color: var(--gold); background: #363833; }
.blast-bet-dock .bet-dock-cta-btn { min-height: 53px; padding-left: 45px; font-size: 15px; }
.blast-bet-dock .bet-dock-cta-btn[data-round="settled"] { padding-left: 12px; }
.illustrated-arcade .app[data-game="blast"] .bet-dock-cta-btn[data-round="settled"]::before { display: none; }
.app[data-game="blast"] .bet-dock-meta-info {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  min-height: 18px; padding: 0 3px; font-size: 11px; color: #bfcdd1;
}
#room-name { font-weight: 700; color: #e4e7d8; }
#room-odds { display: inline-block; margin-left: 5px; color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.settings-sheet {
  width: min(100vw - 20px, 530px); max-height: 83dvh; margin: auto auto 0; padding: 15px;
  border: 1px solid #849ea657; border-radius: 18px 18px 4px 4px;
  background: #142632; color: #f5eedb; box-shadow: 0 -15px 35px #0208107a;
}
.settings-sheet::backdrop { background: #030912bd; }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.sheet-heading h2 { margin: 0; font: 800 19px/1.3 var(--font-display); }
.sheet-tabs .bet-dock-segment-btn { min-height: 44px; color: #c5d4d8; }
.sheet-tabs .bet-dock-segment-btn[aria-pressed="true"] { color: var(--gold); background: #35505a; }
.sheet-panel { padding: 10px 3px 4px; color: #dce6e1; }
.sheet-panel ol { margin: 2px 0 12px; padding-left: 23px; }
.sheet-panel li { margin-bottom: 4px; }
.sheet-panel p { margin: 2px 0 0; color: #c5d3d2; }
.setting-tools .tool { border-color: var(--line); margin-right: 4px; }
.history ul { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; justify-content: space-between; gap: 8px; padding: 7px; border-bottom: 1px solid var(--line); }
.history li strong { color: var(--safe); }
.history li strong.negative { color: var(--lost); }
@media (max-width: 775px) {
  .app[data-game="blast"] { width: min(100%, 526px); padding-top: 9px; }
  .game-layout { grid-template-columns: minmax(0, 1fr); gap: 9px; margin-top: 8px; }
  .viewport { height: clamp(325px, 91vw, 448px); }
  .blast-map-instruments {
    grid-template-columns: auto minmax(0, 1fr) 109px; gap: 8px; min-height: 100px;
    margin-top: 8px; padding: 6px 8px;
    position: sticky; top: 0; z-index: 20; box-shadow: 0 3px 13px #08151b80;
  }
  .starport-dial { width: 36px; height: 34px; }
  .map-objective { font-size: 13px; }
  #entry-step, #status-message { font-size: 11px; }
  #countdown { font-size: 43px; }
  .stage-footer { min-height: 36px; }
  .room-marker {
    isolation: isolate; width: 66px; height: 44px; padding: 4px 3px;
    border-color: transparent; background: transparent;
  }
  .room-marker::before {
    position: absolute; inset: 6px 0; z-index: -1; content: "";
    border: 1px solid #616d644f; border-radius: 4px 7px; background: #101c27cb;
  }
  .room-marker:is(.selected, .safe, .lost, :not(:disabled):hover) { border-color: transparent; background: transparent; }
  .room-marker.selected::before, .room-marker:not(:disabled):hover::before { border-color: var(--gold); background: #202921eb; }
  .room-marker.safe::before { border-color: #9bdbab8c; background: #163026e3; }
  .room-marker.lost::before { border: 2px solid #ffa896; background: #632e2cf4; }
  .room-marker.lost::after { top: -6px; right: -4px; }
  .lost-rooms li { font-size: 11px; padding-inline: 4px; }
  #status-message { text-wrap: pretty; }
}
@media (max-width: 500px) {
  .blast-map-instruments { grid-template-columns: minmax(0, 1fr) 103px; }
  .starport-dial { display: none; }
  .blast-map-timer { padding-inline: 5px; }
}
@media (max-width: 370px) {
  .app[data-game="blast"] .header-zone-right button.header-asset { min-width: 86px; }
  .blast-map-instruments { grid-template-columns: minmax(0, 1fr) 96px; }
  .camera-hint { display: none; }
  .room-marker { width: 62px; gap: 0 2px; }
}
