/* Star Rocket: dark purple metal with amber trim under a Mars-canyon dusk. Layout scales with --u (1% of the game width, capped). */
:root {
  color-scheme: dark;
  --ink: #fdeedd;
  --amber: #ffb43a;
  --gold: #ffd36b;
  --teal: #2fd6c4;
  --coral: #ff7a5c;
  --plum: #1c0f2e;
  --plum-2: #34193f;
  --trim: #b9742a;
  --game-h: 100dvh;
  --u: min(1vw, 5px);
  --hud-h: 44px;
  --chip: calc(var(--u) * 9.6);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: transparent;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  color: inherit;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #fff4be;
  outline-offset: 2px;
}
button:disabled {
  cursor: default;
}
b,
strong,
output {
  font-variant-numeric: tabular-nums;
}

#game {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 500px);
  height: var(--game-h);
  min-height: 0;
  padding: max(5px, env(safe-area-inset-top)) 8px max(6px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: linear-gradient(#1c0f2e30, #1c0f2e70), url(assets/art/metal-bg.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center/cover;
  overflow: hidden;
}
.is-half #game {
  border-top: 2px solid var(--amber);
  border-radius: 14px 14px 0 0;
}

/* ---- header ---- */
.hud {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  height: var(--hud-h);
}
.round-button {
  flex: none;
  width: calc(var(--hud-h) - 6px);
  height: calc(var(--hud-h) - 6px);
  padding: 0;
  border: 0;
  background: url(assets/art/btn-round.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center/100% 100% no-repeat;
  color: var(--gold);
  font-size: 24px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.round-button:active {
  transform: scale(0.94);
}
.round-button svg {
  width: 54%;
  height: 54%;
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 3px #ff9a2e);
}
.view-toggle .to-half {
  display: none;
}
.view-toggle[aria-pressed="true"] .to-full {
  display: none;
}
.view-toggle[aria-pressed="true"] .to-half {
  display: inline;
}
.title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: grid;
  gap: 2px;
  justify-items: start;
  align-content: center;
}
.brand {
  font-size: 15px;
  font-style: italic;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  background: linear-gradient(#fff3d1, var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 2px #000a);
}
.round-no {
  margin-inline-start: 6px;
  font-size: 11px;
  color: #e7c9ff;
  font-weight: 600;
}
.title {
  grid-template-columns: auto 1fr;
  grid-auto-flow: row;
}
.title .plates {
  grid-column: 1 / -1;
}
.title .round-no {
  align-self: end;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}
.plates {
  display: flex;
  gap: 4px;
  direction: ltr;
}
.plate {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 17px;
  padding: 0 9px;
  background: center/100% 100% no-repeat;
  font-size: 10px;
  color: var(--gold);
}
.plate.rank {
  background-image: url(assets/art/plate-rank.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d);
}
.plate.clock {
  background-image: url(assets/art/plate-clock.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d);
}
.plate svg {
  width: 10px;
  height: 10px;
  fill: var(--amber);
  stroke: var(--amber);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.plate.clock svg {
  fill: none;
}
.tools {
  display: flex;
  gap: 3px;
  flex: none;
}

/* ---- stage ---- */
.stage {
  position: relative;
  flex: 1;
  min-height: 90px;
  direction: ltr;
  overflow: hidden;
  border: 2px solid var(--trim);
  border-radius: 12px;
  background: #2a1240;
  box-shadow: inset 0 0 14px #000a;
}
.sky {
  position: absolute;
  left: 0;
  right: 0;
  top: -30%;
  height: 150%;
  background: url(assets/art/sky.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) 50% 50% / cover no-repeat;
  will-change: transform;
}
.world,
.ruler,
.burst,
.flags {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.canyon {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 52%;
  object-fit: cover;
  object-position: center bottom;
  will-change: transform;
}
.pad {
  position: absolute;
  left: var(--padl, 3%);
  bottom: var(--padb, 3%);
  width: var(--padw, 50%);
  height: auto;
  will-change: transform;
}
.dust {
  position: absolute;
  inset: 0;
}
.puff {
  position: absolute;
  width: 38px;
  height: auto;
  margin-left: -19px;
  opacity: 0;
  animation: puff 1.2s ease-out var(--delay, 0ms) forwards;
}
.rocket {
  position: absolute;
  left: calc(var(--x0, 20%) - var(--rw, 40px) / 2);
  bottom: var(--rbase, 20%);
  width: var(--rw, 40px);
  height: var(--rh, 90px);
  transform-origin: 50% 60%;
  will-change: transform;
}
.rocket .body {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px #000a);
}
.rocket .fly,
.rocket.flying .idle {
  display: none;
}
.rocket.flying .fly {
  display: block;
}
.rocket.gone {
  visibility: hidden;
}
.rocket.glitch {
  animation: glitch 0.45s steps(2, end) forwards;
}
.flame {
  display: none;
  position: absolute;
  top: 90%;
  left: 50%;
  width: calc(var(--rh, 90px) * 0.31 * 0.78);
  height: calc(var(--rh, 90px) * 0.78);
  margin-left: calc(var(--rh, 90px) * -0.31 * 0.39);
  transform-origin: 50% 0;
  pointer-events: none;
}
.flame img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  animation: flicker 0.16s steps(2) infinite alternate;
}
.rocket[data-flame="1"] .flame {
  display: block;
  transform: scaleY(0.7);
}
.rocket[data-flame="2"] .flame {
  display: block;
}
.rocket[data-flame="3"] .flame {
  display: block;
  transform: scale(1.12, 1.3);
}
.rocket.gone .flame {
  display: none;
}

/* ruler: ticks are positioned by the page (upward from the stage bottom) */
.ruler .rail {
  position: absolute;
  right: 24px;
  top: 6%;
  bottom: 6%;
  width: 12px;
  background: url(assets/art/ruler-rail.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center / 100% 100% no-repeat;
  opacity: 0.8;
}
.ticks {
  position: absolute;
  inset: 0;
}
.tick {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
}
.tick .line {
  position: absolute;
  left: 0;
  right: 56px;
  top: 0;
  border-top: 1px dashed #ffd36b66;
}
.tag,
.marker b {
  position: absolute;
  right: 3px;
  top: -9px;
  width: 52px;
  height: 19px;
  display: grid;
  place-items: center;
  padding-inline-start: 7px;
  background: url(assets/art/tag-dark.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center / 100% 100% no-repeat;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
}
.marker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  will-change: transform;
}
.marker::before {
  content: "";
  position: absolute;
  left: 0;
  right: 56px;
  top: 0;
  border-top: 2px solid #ffd36bcc;
  box-shadow: 0 0 6px #ffb43a;
}
.marker b {
  width: 58px;
  height: 24px;
  top: -12px;
  right: 1px;
  font-size: 12px;
  background-image: url(assets/art/tag-amber.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d);
  color: #fff;
  text-shadow: 0 1px 2px #5a2400;
}

.burst .bit {
  position: absolute;
  width: 26px;
  height: auto;
  margin: 0 0 -13px -13px;
  opacity: 0;
  animation: scatter 1.1s ease-out forwards;
}
.readout {
  position: absolute;
  top: 7%;
  left: 0;
  right: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 2px 6px #000d, 0 0 14px #5a1a8a;
}
.readout small {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.readout b {
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
  color: #fff;
}
.readout[data-phase="bet"] b {
  font-size: 30px;
  color: var(--gold);
}
.readout[data-phase="run"] b {
  font-size: 44px;
}
.readout[data-phase="crashed"] b,
.readout[data-phase="settle"] b,
.readout[data-phase="crashed"] small,
.readout[data-phase="settle"] small {
  color: var(--coral);
}
.flags .flag {
  position: absolute;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 12px 0 8px;
  border-radius: 999px;
  background: linear-gradient(#1f8f7e, #0f5a52);
  border: 1px solid #9ff2e6;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 8px #000a;
  animation: flag 2.6s ease-out forwards;
}
.flags .flag:nth-child(2n) {
  margin-bottom: 30px;
}
.flag b {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--amber);
  color: #3a1800;
  font-size: 10px;
}
.flag em {
  font-style: normal;
  color: var(--gold);
}

.feedback {
  position: absolute;
  z-index: 8;
  top: 4px;
  left: 6px;
  right: 6px;
  display: grid;
  gap: 4px;
  pointer-events: none;
}
.feedback > * {
  pointer-events: auto;
}
.notice,
.connection {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 2px 8px;
  border: 2px solid var(--amber);
  border-radius: 12px;
  background: #1c0f2ef2;
  box-shadow: 0 4px 14px #000a;
  font-size: 12px;
}
.connection {
  justify-content: center;
  text-align: center;
  min-height: 28px;
}
.notice p {
  flex: 1;
  margin: 0;
  line-height: 1.3;
}
.notice button,
.result-card button,
.loading button,
.panel-retry {
  min-height: 40px;
  padding: 6px 14px;
  border: 2px solid #ffe3a0;
  border-radius: 12px;
  background: linear-gradient(#ffb43a, #d8601a);
  color: #fff;
  font-weight: 800;
  text-shadow: 0 1px 1px #6a2a00;
}
.result-card {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  width: min(90%, 320px);
  transform: translate(-50%, -50%);
  padding: 20px 24px 26px;
  display: grid;
  gap: 8px;
  text-align: center;
  background: url(assets/art/panel.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center / 100% 100% no-repeat;
  animation: rise 0.3s ease-out;
}
.result-main {
  display: grid;
  gap: 2px;
}
.result-main strong {
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.result-main #result-reward {
  font-size: 34px;
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 0 12px #ffb43a;
}
.result-main small {
  font-size: 12px;
  color: var(--coral);
}
.result-lines {
  display: grid;
  gap: 3px;
}
.result-lines .line {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  text-align: start;
}
.result-lines .line b {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--amber);
  color: #3a1800;
  font-size: 11px;
}
.result-lines .line em {
  font-style: normal;
  font-weight: 800;
}
.result-lines .line.cashed em {
  color: var(--teal);
}
.result-lines .line.lost em {
  color: var(--coral);
}
.result-values {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  font-size: 12px;
  color: #e7c9ff;
  text-align: start;
}
.result-values b {
  color: #fff;
}
.result-card .result-close {
  position: absolute;
  top: 6px;
  right: 8px;
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
}

/* ---- history pills ---- */
.pills {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  height: 22px;
  overflow: hidden;
  direction: ltr;
  align-content: flex-start;
}
.pill {
  flex: none;
  min-width: 46px;
  height: 22px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: center / 100% 100% no-repeat;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px #000b;
}
.pill.tier-low {
  background-image: url(assets/art/pill-low.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d);
}
.pill.tier-mid {
  background-image: url(assets/art/pill-mid.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d);
}
.pill.tier-high {
  background-image: url(assets/art/pill-high.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d);
}
.pill.tier-all,
.pill.tier-unknown {
  background-image: url(assets/art/pill-all.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d);
  order: -1;
}
.pill.tier-unknown {
  order: 0;
  filter: grayscale(0.8);
}

/* ---- bet panels ---- */
.bets {
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.bet {
  display: grid;
  gap: 4px;
  padding: 8px 9px 9px;
  background: url(assets/art/panel.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center / 100% 100% no-repeat;
  min-width: 0;
}
.bet-top,
.bet-auto {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.slot-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: url(assets/art/badge-ring.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center / 100% 100% no-repeat;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
  color: var(--gold);
}
.bet[data-slot="1"] .slot-badge {
  color: var(--teal);
}
.amount {
  flex: 1;
  min-width: 0;
  height: 26px;
  padding: 0 8px;
  border: 1px solid #b9742a99;
  border-radius: 8px;
  background: #12081c;
  color: var(--gold);
  font-size: 14px;
  font-weight: 800;
  box-shadow: inset 0 1px 4px #000;
}
.amount[aria-pressed="true"] {
  border-color: var(--amber);
  box-shadow: inset 0 1px 4px #000, 0 0 8px #ffb43a99;
}
.amount:disabled {
  opacity: 0.8;
}
.auto-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 4px;
  border: 0;
  background: none;
  font-size: 11px;
  font-weight: 700;
  color: #e7c9ff;
}
.auto-toggle .dot {
  width: 22px;
  height: 12px;
  border-radius: 999px;
  background: #12081c;
  border: 1px solid #b9742a99;
  position: relative;
}
.auto-toggle .dot::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8a6f9a;
  transition: transform 0.15s;
}
.auto-toggle[aria-pressed="true"] {
  color: var(--gold);
}
.auto-toggle[aria-pressed="true"] .dot::after {
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
  transform: translateX(10px);
}
.auto-toggle:disabled {
  opacity: 0.6;
}
.stepper {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}
.step {
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: url(assets/art/btn-square.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center / 100% 100% no-repeat;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  color: var(--gold);
}
.step:active:not(:disabled) {
  transform: scale(0.92);
}
.target {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--teal);
}
.act {
  position: relative;
  height: 44px;
  padding: 0 6px;
  display: grid;
  place-content: center;
  gap: 0;
  border: 0;
  background: url(assets/art/btn-board.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center / 100% 100% no-repeat;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 2px #5a2400;
}
.act.k-land,
.act.k-landing,
.act.k-landed {
  background-image: url(assets/art/btn-land.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d);
  text-shadow: 0 1px 2px #063a2a;
}
.act.k-wait,
.act.k-lost {
  background-image: url(assets/art/btn-wait.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d);
  text-shadow: 0 1px 2px #000;
}
.act.k-lost .act-main {
  color: var(--coral);
}
.act:active:not(:disabled) {
  transform: scale(0.97);
}
.act:disabled {
  filter: saturate(0.85);
}
.act.k-boarding,
.act.k-landing {
  opacity: 0.8;
}
.act.k-land:not(:disabled) {
  animation: pulse 0.7s ease-in-out infinite alternate;
}
.act-main {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
}
.act-sub {
  font-size: 11px;
  font-weight: 700;
  color: #fff2c8;
  line-height: 1.1;
}
.act-sub:empty {
  display: none;
}

/* ---- dock ---- */
.dock {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-height: calc(var(--chip) + 2px);
}
.wallet {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 11px;
  border: 0;
  background: url(assets/art/plate-count.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center / 100% 100% no-repeat;
  color: var(--gold);
}
.wallet .coin {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff1b0, #e49a1c);
  border: 1px solid #fff2c0;
  color: #6a3a00;
  font-style: normal;
  font-weight: 900;
  font-size: 12px;
}
.wallet b {
  font-size: 13px;
  min-width: 2ch;
  font-variant-numeric: tabular-nums;
}
.wallet .plus {
  font-size: 16px;
  font-weight: 900;
  color: var(--amber);
}
.again {
  flex: none;
  margin-inline-start: auto;
  height: 34px;
  min-width: 54px;
  padding: 0 10px;
  border: 0;
  background: url(assets/art/btn-again.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center / 100% 100% no-repeat;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px #5a2400;
}
.again:disabled {
  filter: grayscale(0.85) brightness(0.8);
}
.chips {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  direction: ltr;
}
.chips button {
  flex: none;
  width: var(--chip);
  height: var(--chip);
  padding: 0;
  border: 0;
  background: url(assets/art/chip-10.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center / 100% 100% no-repeat;
  font-size: calc(var(--chip) * 0.3);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px #000;
  transition: transform 0.12s;
}
.chips button[data-art="chip-100"] {
  background-image: url(assets/art/chip-100.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d);
}
.chips button[data-art="chip-1k"] {
  background-image: url(assets/art/chip-1k.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d);
}
.chips button[data-art="chip-10k"] {
  background-image: url(assets/art/chip-10k.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d);
}
.chips button[aria-pressed="true"] {
  transform: translateY(-3px) scale(1.1);
  filter: drop-shadow(0 0 6px var(--amber));
}
.demo {
  position: absolute;
  z-index: 3;
  top: calc(var(--hud-h) + 12px);
  left: 14px;
  padding: 1px 7px;
  border-radius: 8px;
  background: #1c0f2ecc;
  font-size: 10px;
  color: #e7c9ff;
}

/* ---- loading ---- */
.loading {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  text-align: center;
  background: linear-gradient(#1c0f2eb0, #1c0f2ee0), url(assets/art/sky.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center / cover;
}
.loading-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
}
.loading-title {
  font-size: 34px;
  font-style: italic;
  font-weight: 900;
  background: linear-gradient(#fff3d1, var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 8px #ff9a2e);
}
.loading p {
  margin: 0;
  font-size: 15px;
}
.loading progress {
  width: 70%;
  height: 12px;
  accent-color: var(--amber);
}
.loading small {
  margin-top: 10px;
  color: #e7c9ff;
  font-size: 12px;
}
.loading.failed progress {
  display: none;
}
.is-half .loading-logo,
.tier-tiny .loading-logo,
.tier-short .loading-logo {
  width: 70px;
  height: 70px;
}

/* ---- panels ---- */
#panel-mask {
  position: absolute;
  inset: 0;
  z-index: 40;
}
dialog {
  position: absolute;
  inset: 10px;
  margin: auto;
  width: calc(100% - 20px);
  max-width: 450px;
  max-height: calc(100% - 20px);
  height: fit-content;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--trim);
  border-radius: 14px;
  background: linear-gradient(#3b1f4a, #1c0f2e);
  color: var(--ink);
  box-shadow: 0 6px 24px #000c;
  overflow: hidden;
  z-index: 41;
}
dialog:not([open]) {
  display: none;
}
dialog::backdrop {
  background: transparent;
}
dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 6px 16px;
  border-bottom: 1px solid var(--trim);
  background: #2a1240;
}
dialog h2 {
  margin: 0;
  font-size: 18px;
  color: var(--gold);
}
dialog header button {
  border: 0;
  background: none;
  font-size: 28px;
  min-width: 44px;
  min-height: 44px;
}
#panel-body {
  padding: 14px;
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
}
#panel-body p {
  font-size: 14px;
  line-height: 1.6;
  margin: 6px 0;
}
#panel-body label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  margin: 14px 0;
}
#panel-body input[type="range"] {
  width: 55%;
  accent-color: var(--amber);
}
#panel-body input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--amber);
}
#panel-body select {
  max-width: 58%;
  min-height: 44px;
  background: #34193f;
  color: var(--ink);
  border: 1px solid var(--trim);
  border-radius: 8px;
}
#panel-body ol {
  padding-inline-start: 22px;
  font-size: 14px;
  line-height: 1.65;
}
#panel-body .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 14px;
}
#panel-body .row > span:first-child {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
#panel-body .record {
  padding: 8px 0;
  border-bottom: 1px solid #5a3a6a;
}
.record-values {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  font-size: 11px;
  color: #d8b8f0;
}
.record-values div {
  display: flex;
  flex-direction: column;
}
.record-values b {
  font-size: 13px;
  color: #fff;
}
.list-caption {
  color: #e7c9ff;
  font-size: 12px !important;
}
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.tabs button {
  flex: 1;
  min-height: 40px;
  border: 1px solid var(--trim);
  border-radius: 10px;
  background: #34193f;
  font-size: 13px;
  font-weight: 700;
}
.tabs button[aria-pressed="true"] {
  background: linear-gradient(#ffb43a, #d8601a);
  border-color: #ffe3a0;
}
.pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px 6px;
  direction: ltr;
}
.pill-grid .cell {
  display: grid;
  justify-items: center;
  gap: 2px;
}
.pill-grid small {
  font-size: 10px;
  color: #d8b8f0;
}

/* ---- tiers by the height the game really has ---- */
.tier-short .act {
  height: 38px;
}
.tier-short .bet {
  gap: 3px;
  padding: 6px 8px 7px;
}
.tier-short .readout b {
  font-size: 32px;
}
.tier-tiny {
  --hud-h: 38px;
}
.tier-tiny #game {
  gap: 4px;
  padding-top: 3px;
}
.tier-tiny .act {
  height: 34px;
}
.tier-tiny .act-sub {
  display: none;
}
.tier-tiny .bet {
  gap: 2px;
  padding: 5px 7px 6px;
}
.tier-tiny .amount,
.tier-tiny .auto-toggle {
  height: 22px;
  min-height: 22px;
}
.tier-tiny .step {
  width: 22px;
  height: 22px;
}
.tier-tiny .slot-badge {
  width: 20px;
  height: 20px;
}
.tier-tiny .pills {
  height: 20px;
}
.tier-tiny .pill {
  height: 20px;
}
.tier-tiny .wallet,
.tier-tiny .again {
  height: 30px;
}
.tier-tiny .readout {
  top: 4%;
}
.tier-tiny .readout b {
  font-size: 26px;
}
.tier-tiny .readout[data-phase="run"] b {
  font-size: 32px;
}
.tier-tiny .result-card {
  padding: 14px 20px 20px;
  gap: 4px;
}
.tier-tiny .result-main #result-reward {
  font-size: 26px;
}
.tier-tiny .loading-title {
  font-size: 26px;
}
@media (max-width: 350px) {
  #game {
    padding-left: 5px;
    padding-right: 5px;
  }
  .hud {
    gap: 2px;
  }
  .round-button {
    width: calc(var(--hud-h) - 8px);
    height: calc(var(--hud-h) - 8px);
  }
  .brand {
    font-size: 13px;
  }
  .bets {
    gap: 4px;
  }
  .auto-toggle .auto-label {
    display: none;
  }
  .dock {
    flex-wrap: wrap;
    row-gap: 3px;
  }
  .chips {
    flex-basis: 100%;
    justify-content: center;
  }
  .again {
    margin-inline-start: auto;
  }
}

/* ---- RTL: the interface mirrors; the flight stage, tags and numbers do not ---- */
[dir="rtl"] .hud,
[dir="rtl"] .dock,
[dir="rtl"] .bets,
[dir="rtl"] .bet,
[dir="rtl"] .notice,
[dir="rtl"] .connection,
[dir="rtl"] .result-card,
[dir="rtl"] dialog {
  direction: rtl;
}
[dir="rtl"] .title,
[dir="rtl"] .brand {
  direction: ltr;
}
[dir="rtl"] .title {
  justify-items: end;
}
[dir="rtl"] .stepper,
[dir="rtl"] .target {
  direction: ltr;
}
[dir="rtl"] #exit span {
  display: inline-block;
  transform: scaleX(-1);
}

/* ---- motion ---- */
@keyframes puff {
  0% {
    transform: translate(0, 0) scale(0.4);
    opacity: 0.9;
  }
  100% {
    transform: translate(var(--dx, 0), -14px) scale(1.5);
    opacity: 0;
  }
}
@keyframes scatter {
  0% {
    transform: translate(0, 0) rotate(0) scale(0.4);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(var(--s));
    opacity: 0;
  }
}
@keyframes glitch {
  0% {
    opacity: 1;
    filter: brightness(2) hue-rotate(40deg);
  }
  35% {
    opacity: 0.2;
  }
  60% {
    opacity: 0.9;
    transform-origin: 50% 60%;
  }
  100% {
    opacity: 0;
  }
}
@keyframes flicker {
  from {
    transform: scaleX(1) scaleY(1);
  }
  to {
    transform: scaleX(0.92) scaleY(1.08);
  }
}
@keyframes flag {
  0% {
    transform: translateY(8px);
    opacity: 0;
  }
  8% {
    transform: none;
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translateY(-18px);
    opacity: 0;
  }
}
@keyframes pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.03);
  }
}
@keyframes rise {
  from {
    transform: translate(-50%, calc(-50% + 14px));
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}
/* Reduced effects: the light CSS animations (flame flicker, button pulse) may stay in low-fx, but nothing else moves. */
.low-motion .puff,
.low-motion .bit,
.low-motion .rocket.glitch {
  animation: none !important;
}
.low-motion .rocket.glitch {
  visibility: hidden;
}
.low-motion *,
.low-motion *::before,
.low-motion *::after {
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  .result-card {
    transform: translate(-50%, -50%);
  }
}

/* Reserve disjoint touch targets even when the artwork scales down. */
.hud {
  min-height: 44px;
}
.hud button {
  min-width: 44px;
  min-height: 44px;
}

.hud .brand {
  min-width: 0;
  overflow: hidden;
}
