/* ============================================================= tokens, reset */

:root {
  --bg: #050a14;
  --surface: #0a1426;
  --ink: #e6eeff;
  --muted: #8ea0c0;
  --line: rgba(150, 200, 255, 0.14);
  --line-soft: rgba(150, 200, 255, 0.09);
  --glass: rgba(10, 18, 34, 0.74);
  --well: rgba(3, 8, 18, 0.6);
  --cyan: #8fe6ff;
  --violet: #a792ff;
  --gold: #ffd27a;
  --focus: #bff3ff;
  /* Manrope ships latin, latin-ext and cyrillic; CJK falls back to the system (same stack as Aurora Keno) */
  font-family:
    Manrope,
    system-ui,
    -apple-system,
    'Segoe UI',
    'Noto Sans',
    'Hiragino Sans',
    'Malgun Gothic',
    'Microsoft YaHei',
    sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 230, 255, 0.28) transparent;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}

/* dark, thin scrollbars everywhere: the default light ones break the glass look */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(143, 230, 255, 0.25);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(143, 230, 255, 0.42);
  background-clip: content-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
}

/* the room around the machine: dark, with one soft pool of light behind the board */
#app {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60% 55% at 50% 42%, rgba(40, 80, 150, 0.22), transparent 70%),
    radial-gradient(40% 30% at 50% 100%, rgba(120, 90, 220, 0.08), transparent 70%), var(--bg);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#stage {
  position: absolute;
  inset: 0;
}
#stage canvas {
  display: block;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
}
:root[data-input='key'] button:focus-visible,
:root[data-input='key'] select:focus-visible,
:root[data-input='key'] input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
button:focus {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.fatal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

/* ============================================================= top bar */

.top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 6px
    max(16px, env(safe-area-inset-left));
  pointer-events: none;
}
.top > * {
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand .mark {
  width: 22px;
  height: 22px;
  flex: none;
  filter: drop-shadow(0 0 6px rgba(143, 230, 255, 0.45));
}
.brand .name {
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 13px;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand .name b {
  color: var(--cyan);
  font-weight: 700;
}
.demo {
  display: flex;
}
.demo b {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
  border: 1px solid rgba(255, 210, 122, 0.45);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.clock {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}

.icons {
  display: flex;
  gap: 6px;
}
.icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--muted);
  transition:
    background 90ms,
    color 90ms,
    transform 90ms;
}
.icon svg {
  width: 20px;
  height: 20px;
}
.icon:hover {
  color: var(--ink);
  background: rgba(150, 200, 255, 0.08);
}
.icon:active {
  transform: scale(0.94);
  background: rgba(150, 200, 255, 0.14);
}
/* aria-pressed = sound on: show the waves, hide the cross */
.icon[aria-pressed='true'] .off,
.icon[aria-pressed='false'] .on {
  display: none;
}

/* the prism in the header: facets light up as they are collected */
.prism {
  width: 24px;
  height: 21px;
  overflow: visible;
}
.prism .facet {
  fill: rgba(150, 200, 255, 0.1);
  transition: fill 300ms;
}
.prism-btn.flare .prism {
  animation: flare 900ms ease-out;
}
@keyframes flare {
  30% {
    transform: scale(1.35);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
  }
}

/* ============================================================= control panel */

.panel {
  position: absolute;
  display: grid;
  gap: 12px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
/* grid items may shrink below their content (a full history row must not widen the panel) */
.panel > * {
  min-width: 0;
}

.label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* recent results: a row of chips that fades out instead of being cut */
button.history {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0;
  border-radius: 10px;
}
.history ol {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  gap: 5px;
  min-height: 24px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
}
.history li {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(150, 200, 255, 0.07);
  color: var(--muted);
  animation: chip 220ms ease-out;
}
.history li.win {
  color: var(--ink);
  background: rgba(143, 230, 255, 0.12);
}
.history li.big {
  color: #1a1204;
  background: var(--gold);
}
button.history:hover li:not(.big) {
  background: rgba(150, 200, 255, 0.14);
}
@keyframes chip {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
}

.balance output {
  display: block;
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  margin-top: 2px;
  transform-origin: left center;
}
.balance small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-left: 4px;
}
.balance output.pulse {
  animation: take 260ms ease-out;
}
.balance output.pulse-big {
  animation: take-big 520ms ease-out;
}
@keyframes take {
  40% {
    transform: scale(1.06);
    color: #fff;
  }
}
@keyframes take-big {
  30% {
    transform: scale(1.12);
    color: var(--gold);
    text-shadow: 0 0 16px rgba(255, 210, 122, 0.6);
  }
}
.refill {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold);
  border: 1px solid rgba(255, 210, 122, 0.4);
  border-radius: 10px;
  padding: 8px 10px;
  transition: background 90ms;
}
.refill:hover {
  background: rgba(255, 210, 122, 0.08);
}

/* bet: ½  [amount]  2×  MAX */
.bet .row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px 48px;
  align-items: center;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--well);
}
.bet .stake {
  min-width: 0;
  width: 100%;
  height: 44px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.bet .stake:focus {
  outline: none;
  background: rgba(143, 230, 255, 0.06);
  border-radius: 10px;
}
.step {
  height: 44px;
  font-size: 15px;
  font-weight: 800;
  color: var(--cyan);
  border-radius: 12px;
  transition:
    background 90ms,
    transform 90ms,
    color 90ms;
}
.step.max {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.step:hover:not(:disabled) {
  background: rgba(143, 230, 255, 0.08);
}
.step:active:not(:disabled) {
  transform: scale(0.92);
}
.step:disabled {
  color: rgba(142, 160, 192, 0.35);
}

/* risk and rows: segmented controls */
.opt .seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(max-content, 1fr); /* a label is never squeezed below its own width */
  gap: 3px;
  margin-top: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--well);
}
.seg button {
  height: 32px;
  min-width: 0;
  padding: 0 4px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    background 90ms,
    color 90ms,
    transform 90ms;
}
.seg button:not([aria-pressed='true']):hover:not(:disabled) {
  color: var(--ink);
}
.seg button:active:not(:disabled) {
  transform: scale(0.95);
}
.seg button[aria-pressed='true'] {
  color: #04101f;
  background: linear-gradient(180deg, #c9f6ff, #8fe6ff);
}
.seg button:disabled:not([aria-pressed='true']) {
  opacity: 0.35;
}

/* DROP: a crystal key that physically gives under the finger */
.drop {
  position: relative;
  height: 58px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.24em;
  color: #04101f;
  background: linear-gradient(180deg, #c9f6ff 0%, #8fe6ff 45%, #7a9cff 100%);
  box-shadow:
    0 6px 0 #2b3f86,
    0 10px 24px rgba(110, 170, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -8px 16px rgba(80, 60, 200, 0.25);
  transition:
    transform 70ms ease-out,
    box-shadow 70ms ease-out,
    filter 120ms;
}
.drop:hover:not(:disabled) {
  filter: brightness(1.07);
}
.drop:active:not(:disabled),
.drop.pressed {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 #2b3f86,
    0 4px 12px rgba(110, 170, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -4px 10px rgba(80, 60, 200, 0.3);
}
.drop:disabled {
  color: rgba(4, 16, 31, 0.6);
  filter: saturate(0.35) brightness(0.65);
  transform: translateY(2px);
  box-shadow:
    0 4px 0 #1d2a55,
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* auto drop, turbo and the auto options */
.auto {
  display: flex;
  gap: 6px;
}
.auto button {
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--cyan);
  background: var(--well);
  transition:
    background 90ms,
    transform 90ms,
    color 90ms;
}
.auto .auto-go {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auto .turbo,
.auto .auto-cfg {
  flex: none;
  width: 44px;
  display: grid;
  place-items: center;
}
.auto svg {
  width: 16px;
  height: 16px;
}
.auto button:hover:not(:disabled):not(.running):not([aria-pressed='true']) {
  background: rgba(143, 230, 255, 0.08);
}
.auto button:active:not(:disabled) {
  transform: scale(0.97);
}
.auto button:disabled {
  opacity: 0.4;
}
/* active states keep their gold on hover and press: only the brightness changes */
.auto .auto-go.running,
.auto .turbo[aria-pressed='true'] {
  color: #1a1204;
  background: var(--gold);
  border-color: transparent;
}
.auto .auto-go.running:hover:not(:disabled),
.auto .turbo[aria-pressed='true']:hover:not(:disabled) {
  color: #1a1204;
  background: #ffe0a0;
  border-color: transparent;
}
.auto .auto-go.running:active:not(:disabled),
.auto .turbo[aria-pressed='true']:active:not(:disabled) {
  background: #e8b95e;
}

.keys {
  font-size: 11px;
  color: rgba(142, 160, 192, 0.7);
  line-height: 1.4;
}
.memory {
  font-size: 11px;
  color: var(--gold);
  line-height: 1.4;
}

/* ---- layout 1: side panel on wide screens (single column, DOM order) */
@media (min-width: 860px) and (min-aspect-ratio: 5/4) {
  .panel {
    right: max(20px, env(safe-area-inset-right));
    top: 50%;
    transform: translateY(-50%);
    width: 264px;
    padding: 20px;
    border-radius: 22px;
  }
}

/* ---- layout 2: phones and portrait: a real bottom tray, not a shrunken desktop */
@media not all and (min-width: 860px) and (min-aspect-ratio: 5/4) {
  .panel {
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 76dvh;
    overflow: auto;
    padding: 12px max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 'hist hist' 'bal bet' 'risk rows' 'drop drop' 'autoplay autoplay';
    gap: 9px 14px;
  }
  /* named areas exist only in the two compact layouts; the wide side panel is a plain column */
  .history {
    grid-area: hist;
  }
  .balance {
    grid-area: bal;
  }
  .bet {
    grid-area: bet;
  }
  .opt.risk {
    grid-area: risk;
  }
  .opt.rows {
    grid-area: rows;
  }
  .drop {
    grid-area: drop;
  }
  .auto {
    grid-area: autoplay;
  } /* not "auto": that keyword means automatic placement */
  .history .label,
  .keys,
  .opt .label {
    display: none;
  }
  .history ol {
    margin: 0;
    justify-content: center;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .balance {
    align-self: end;
  }
  .balance output {
    font-size: 22px;
  }
  .drop {
    height: 56px;
  }
  .memory {
    grid-column: 1 / -1;
  }
}
@media (max-width: 480px) {
  /* five header icons leave no room beside the badge, and the legal notice must never be cut or covered:
     it gets its own centred line, whatever the language */
  .top {
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .brand {
    display: contents;
  }
  .brand .name {
    display: none;
  }
  .brand .mark {
    order: 1;
    margin-right: auto;
  }
  .icons {
    order: 2;
    gap: 2px;
  }
  .icon {
    width: 38px;
    height: 38px;
  }
  .demo {
    order: 3;
    flex: 0 0 100%;
    justify-content: center;
  }
  .demo b {
    font-size: 9.5px;
    padding: 3px 8px;
  }
  .clock {
    order: 1;
  }
  .toast,
  .banner {
    top: max(92px, calc(env(safe-area-inset-top) + 82px));
  } /* below the two-line header */
  .seg button {
    font-size: 12px;
    padding: 0 2px;
  } /* "Низкий / Средний / Высокий" must fit its half of the tray */
}

/* ---- layout 3: short landscape phones: compact side panel, no history strip */
@media (max-height: 520px) and (orientation: landscape) and (max-width: 859px) {
  .panel {
    left: auto;
    right: max(10px, env(safe-area-inset-right));
    top: 50%;
    bottom: auto;
    max-height: calc(100dvh - 64px);
    transform: translateY(-50%);
    width: 300px;
    border-radius: 18px;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    grid-template-columns: 1.5fr 1fr; /* "Medium" needs the wider half */
    grid-template-areas: 'bal bal' 'bet bet' 'risk rows' 'drop drop' 'autoplay autoplay';
    gap: 6px 10px;
  }
  button.history {
    display: none;
  } /* same specificity as the rule that shows it, and later */
  .balance {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }
  .balance .label {
    order: 2;
  }
  .balance output {
    font-size: 20px;
    margin: 0;
  }
  .bet .label {
    display: none;
  }
  .bet .row {
    margin-top: 0;
  }
  .bet .stake,
  .step {
    height: 38px;
  }
  .drop {
    height: 46px;
  }
  .seg button {
    height: 28px;
  }
  .auto button {
    height: 32px;
  }
}

/* ============================================================= floating pieces */

/* a return travelling from the chute into the balance */
.flyer {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: #cfe0ff;
  text-shadow: 0 0 10px rgba(143, 230, 255, 0.55);
  white-space: nowrap;
}
.flyer.win {
  color: #fff;
}
.flyer.big {
  color: var(--gold);
  font-size: 18px;
  text-shadow: 0 0 14px rgba(255, 210, 122, 0.7);
}

.toast {
  position: absolute;
  top: max(58px, calc(env(safe-area-inset-top) + 48px));
  left: 50%;
  z-index: 6;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: var(--tone);
  background: rgba(8, 14, 28, 0.94);
  border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 18px color-mix(in srgb, var(--tone) 25%, transparent);
  pointer-events: none;
}
.toast.show {
  animation: toast 2600ms ease-out forwards;
}
@keyframes toast {
  0% {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
  8%,
  85% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -4px);
  }
}

/* connection problem: rounds already started are safe, new ones wait for "check again" */
.banner {
  position: absolute;
  z-index: 7;
  top: max(56px, calc(env(safe-area-inset-top) + 46px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 24px);
  padding: 8px 8px 8px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  color: #ffe2b0;
  background: rgba(40, 22, 6, 0.95);
  border: 1px solid rgba(255, 190, 90, 0.5);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.banner button {
  flex: none;
  padding: 8px 12px;
  border-radius: 10px;
  color: #1a1204;
  background: var(--gold);
  font-weight: 800;
}

/* chute details next to the pointer */
.tip {
  position: absolute;
  z-index: 6;
  display: grid;
  gap: 2px;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 12.5px;
  color: #c3d0ea;
  background: rgba(8, 14, 28, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  white-space: nowrap;
}
.tip b {
  font-size: 15px;
  color: var(--ink);
}

/* ============================================================= sheets (modals) */

.modal {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 5, 12, 0.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fade 140ms ease-out;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}

/* one sheet = header with its close button, a body that scrolls, an optional action footer */
.sheet {
  display: flex;
  flex-direction: column;
  width: min(540px, 100%);
  max-height: min(88dvh, 760px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  user-select: text;
  -webkit-user-select: text;
}
.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px 22px;
  border-bottom: 1px solid var(--line-soft);
}
.sheet-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.03em;
  line-height: 1.25;
}
.x {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--muted);
  transition:
    background 90ms,
    color 90ms;
}
.x svg {
  width: 18px;
  height: 18px;
}
.x:hover {
  color: var(--ink);
  background: rgba(150, 200, 255, 0.1);
}
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px 22px 20px;
}
.sheet-foot {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 22px 16px;
  border-top: 1px solid var(--line-soft);
}

.btn {
  flex: 1 1 150px;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 700;
  background: rgba(150, 200, 255, 0.1);
  transition:
    background 90ms,
    filter 90ms,
    transform 90ms;
}
.btn:hover:not(:disabled) {
  background: rgba(150, 200, 255, 0.18);
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}
.btn.primary {
  color: #04101f;
  background: linear-gradient(180deg, #c9f6ff, #8fe6ff);
}
.btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #d9faff, #a4ecff);
}
.btn:disabled {
  opacity: 0.45;
}

.sheet h3 {
  margin: 18px 0 8px;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet-body > h3:first-child {
  margin-top: 0;
}
.sheet p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: #c3d0ea;
}
.sheet .hint {
  font-size: 13px;
  color: var(--muted);
}
.sheet .warn {
  color: #ffd9a0;
}
.sheet code {
  display: block;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(150, 200, 255, 0.06);
}
.mono {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}
.small {
  font-size: 11.5px;
  line-height: 1.6;
}
.path {
  font-size: 15px;
  letter-spacing: 0.18em;
  color: var(--ink);
}

/* tables */
.table-wrap {
  overflow-x: auto;
  margin: 6px 0;
}
.sheet table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.sheet th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 8px;
}
.sheet td {
  padding: 6px 8px;
  border-top: 1px solid var(--line-soft);
}
.sheet th:not(:first-child),
.sheet td:not(:first-child) {
  text-align: right;
}

/* label / value pairs */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 6px;
}
.stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(150, 200, 255, 0.05);
}
.stat span {
  color: var(--muted);
}
.stat b {
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}

/* forms */
.field {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  font-size: 14px;
}
.field.inline {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.field small {
  color: var(--muted);
  font-size: 12px;
  grid-column: 1 / -1;
}
.field select,
.field input[type='range'],
.field input[name='clientSeed'] {
  width: 100%;
  font: inherit;
  color: var(--ink);
}
.field select,
.field input[name='clientSeed'] {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.field input[type='checkbox'] {
  width: 22px;
  height: 22px;
  accent-color: #8fe6ff;
}
.field input[type='range'] {
  accent-color: #8fe6ff;
}

/* history: the header row sticks to the top of the same scroll area, so the columns always line up */
.round-head,
.round-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 56px 58px 64px;
  column-gap: 8px;
  align-items: center;
}
.round-head {
  position: sticky;
  top: -16px;
  z-index: 1;
  margin: -16px 0 6px;
  padding: 16px 10px 8px;
  background: var(--surface);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.round-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rounds {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.round-row {
  width: 100%;
  text-align: left;
  padding: 10px;
  border-radius: 10px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  background: rgba(150, 200, 255, 0.05);
  transition: background 90ms;
}
.round-row:hover {
  background: rgba(150, 200, 255, 0.11);
}
.c-n {
  color: var(--muted);
}
.c-board {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.c-stake,
.c-mult,
.c-net {
  text-align: right;
  white-space: nowrap;
}
.c-net {
  color: var(--muted);
  font-weight: 700;
}
.round-row.win .c-net {
  color: var(--ink);
}
.round-row.big .c-net {
  color: var(--gold);
}
.round-row.big .c-mult {
  color: var(--gold);
}

.revealed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.revealed li {
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(150, 200, 255, 0.05);
}

/* collection */
.prism-big {
  display: grid;
  place-items: center;
  margin: 2px 0 10px;
}
.prism-big .prism {
  width: 84px;
  height: 72px;
}
.facets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.facets li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(150, 200, 255, 0.05);
}
.facets li i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: rgba(150, 200, 255, 0.15);
  transform: rotate(45deg);
  flex: none;
}
.facets li.lit {
  color: var(--ink);
}
.facets li.lit i {
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
}
.skins {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.skin {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  padding: 10px 4px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  transition:
    background 90ms,
    border-color 90ms;
}
.skin i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--t) 45%, #2a2a6a 100%);
  box-shadow: 0 0 10px color-mix(in srgb, var(--t) 50%, transparent);
}
.skin small {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
  min-height: 13px;
}
.skin.on {
  border-color: var(--cyan);
  background: rgba(143, 230, 255, 0.08);
}
.skin:disabled {
  opacity: 0.45;
}
.skin:disabled i {
  filter: grayscale(1);
}

/* Shared sheet readability, including collection and its progress states. */
.sheet {
  background: #101d46;
  border-color: #608bd0;
}
.sheet-head {
  background: #152954;
  border-bottom-color: #456aa7;
}
.sheet-head h2 {
  font-size: 20px;
  color: #f4f8ff;
}
.sheet .x {
  color: #d5e9ff;
  background: #223d72;
}
.sheet h3 {
  color: #c7dafa;
  font-size: 12px;
}
.sheet p,
.sheet .hint,
.sheet .field small {
  color: #d0def6;
  font-size: 14px;
}
.sheet .stat,
.sheet .round-row,
.sheet .revealed li {
  background: #1b305e;
}
.sheet .stat span,
.sheet th,
.sheet .round-head,
.sheet .c-n,
.sheet .c-net {
  color: #c4d6f3;
}
.facets li {
  color: #c3d3ef;
  background: #1b305e;
  min-height: 37px;
  font-size: 14px;
}
.facets li i {
  background: #7893c1;
}
.facets li.lit {
  color: #fff;
  font-weight: 700;
}
.skin {
  min-height: 76px;
  color: #eff6ff;
  background: #172951;
  border-color: #4e70a6;
  font-size: 13px;
}
.skin:hover:not(:disabled) {
  background: #264477;
  border-color: #b0eaff;
}
.skin.on {
  border-color: #9aeeff;
  background: #284d7c;
  box-shadow: inset 0 0 0 1px #9aeeff;
}
.skin i {
  width: 28px;
  height: 28px;
}
.skin small:empty {
  display: none;
}
@media (max-width: 420px) {
  .sheet-body {
    padding: 16px;
  }
  .skins {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .facets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* phones: sheets rise from the bottom edge, like native ones */
@media (max-width: 600px) {
  .modal {
    place-items: end center;
    padding: 0;
  }
  .sheet {
    width: 100%;
    max-height: 90dvh;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
  }
  .sheet-head {
    padding-left: 18px;
  }
  .sheet-body {
    padding: 14px 18px 18px;
  }
  .sheet-foot {
    padding: 10px 18px calc(14px + env(safe-area-inset-bottom));
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .facets {
    grid-template-columns: 1fr;
  }
  .round-head,
  .round-row {
    grid-template-columns: 34px minmax(0, 1fr) 46px 52px 56px;
    column-gap: 6px;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .sheet {
    width: min(620px, 100%);
    max-height: 94dvh;
  }
  .modal {
    place-items: center;
    padding: 8px;
  }
  .sheet {
    border-radius: 16px;
    border-bottom: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  .history li,
  .modal,
  .toast.show {
    animation: none;
  }
  .toast.show {
    opacity: 1;
  }
}

/* Prism arcade presentation */
:root {
  --bg: #080d2e;
  --surface: #101a45;
  --glass: rgba(9, 18, 52, 0.96);
  --well: #080f2c;
  --line: rgba(114, 157, 241, 0.35);
}
#app {
  background: radial-gradient(ellipse at 50% 42%, #1c2d68 0%, #101949 46%, #080d2e 100%);
}
.top {
  z-index: 4;
}
.start-screen {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 70px 22px max(22px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 44%, #192b67 0%, #101846 48%, #080d2e 100%);
}
.start-content {
  width: min(460px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.start-art {
  width: min(100%, 440px);
  min-height: 0;
  max-height: calc(100% - 108px);
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(72, 100, 255, 0.2));
}
.start-button {
  width: min(100%, 390px);
  min-height: 64px;
  flex: none;
  border-radius: 999px;
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #061336;
  background: linear-gradient(180deg, #d3ffff 0%, #78e2fa 43%, #7194ff 100%);
  border: 2px solid #b2f6ff;
  box-shadow:
    0 6px 0 #5040c3,
    0 11px 0 #e5a95e,
    0 16px 30px #090e42;
  transition:
    transform 0.1s,
    box-shadow 0.1s;
}
.start-button:active {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 #5040c3,
    0 5px 0 #e5a95e,
    0 8px 18px #090e42;
}
.start-demo {
  margin-top: 22px;
  color: #f5cf82;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
}
.ui:not(.playing) .panel,
.ui:not(.playing) .banner {
  visibility: hidden;
}
.ui:not(.playing) .top .demo,
.ui:not(.playing) .top [data-act='history'],
.ui:not(.playing) .top [data-act='collection'],
.ui:not(.playing) .top [data-act='rules'] {
  visibility: hidden;
}
.panel {
  border-color: rgba(115, 160, 251, 0.4);
  box-shadow:
    0 8px 25px rgba(2, 5, 29, 0.38),
    inset 0 1px 0 rgba(186, 218, 255, 0.12);
}
.drop {
  border: 1px solid #b7f8ff;
  background: linear-gradient(180deg, #cbffff, #78def8 50%, #7798ff);
  box-shadow:
    0 5px 0 #4a3bb2,
    0 8px 15px rgba(50, 71, 193, 0.35),
    inset 0 1px 0 #fff;
}
@media (max-width: 480px) {
  .brand .name {
    display: inline;
    font-size: 11px;
    letter-spacing: 0.08em;
  }
  .brand .mark {
    margin-right: 0;
  }
  .brand {
    display: flex;
  }
  .top {
    align-items: center;
  }
  .icons {
    gap: 0;
  }
  .icon {
    width: 34px;
    height: 38px;
  }
  .demo {
    order: 3;
  }
  .panel {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    padding: 10px 12px 12px;
    border: 1px solid var(--line);
    border-radius: 19px;
    gap: 6px 10px;
  }
  .history ol {
    min-height: 0;
  }
  .history:has(ol:empty) {
    display: none;
  }
  .bet .stake,
  .step {
    height: 38px;
  }
  .balance output {
    font-size: 20px;
  }
  .drop {
    height: 50px;
  }
  .auto button {
    height: 38px;
  }
}
@media (max-width: 360px) {
  .brand .name {
    font-size: 9px;
  }
  .icon {
    width: 31px;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .start-content {
    flex-direction: row;
    gap: 24px;
  }
  .start-art {
    height: 100%;
    width: auto;
    max-width: 55%;
    max-height: 100%;
  }
  .start-button {
    width: 35%;
  }
  .start-demo {
    position: absolute;
    bottom: 10px;
  }
}
.start-content {
  overflow: visible;
}
.start-art {
  width: min(150%, 640px);
  max-width: none;
}
@media (max-width: 480px) {
  .brand {
    display: contents;
  }
  .brand .mark {
    order: 0;
    margin-right: 0;
  }
  .brand .name {
    order: 1;
    margin-right: auto;
  }
  .icons {
    order: 2;
  }
  .demo {
    order: 3;
  }
  .ui:not(.playing) .top [data-act='history'],
  .ui:not(.playing) .top [data-act='collection'],
  .ui:not(.playing) .top [data-act='rules'],
  .ui:not(.playing) .top .demo {
    display: none;
  }
}
@media (min-width: 860px) and (min-aspect-ratio: 5/4) {
  .panel {
    transform: translateY(-50%) scale(var(--panel-scale, 1));
    transform-origin: left center;
  }
}
@media (min-width: 860px) and (min-aspect-ratio: 5/4) {
  .top {
    --header-scale: 1;
  }
  .brand .mark {
    width: calc(22px * var(--header-scale));
    height: calc(22px * var(--header-scale));
  }
  .brand .name {
    font-size: calc(13px * var(--header-scale));
  }
  .demo b {
    font-size: calc(10.5px * var(--header-scale));
    padding: calc(3px * var(--header-scale)) calc(9px * var(--header-scale));
  }
  .icon {
    width: calc(40px * var(--header-scale));
    height: calc(40px * var(--header-scale));
  }
  .icon svg {
    width: calc(20px * var(--header-scale));
    height: calc(20px * var(--header-scale));
  }
}
.history:has(ol:empty) {
  display: none;
}

/* Crystal hall: separate compositions keep the crystals visible in portrait. */
#app {
  background: #080d2e var(--hall-landscape) center center / cover no-repeat;
}
.start-screen {
  overflow: hidden;
  isolation: isolate;
  background: transparent;
}
.start-screen::before {
  content: '';
  position: absolute;
  inset: -12px;
  z-index: -1;
  background: #080d2e var(--hall-landscape) center center / cover no-repeat;
  filter: blur(5px) brightness(0.7);
}
@media (orientation: portrait) {
  #app {
    background-image: var(--hall-portrait);
  }
  .start-screen::before {
    background-image: var(--hall-portrait);
  }
}

/* Subtle frosted glass keeps the room visible without competing with the pins. */
#stage::before {
  content: '';
  position: absolute;
  left: var(--plate-x, 0);
  top: var(--plate-y, 0);
  width: var(--plate-w, 0);
  height: var(--plate-h, 0);
  border-radius: 14px;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(7, 19, 51, 0.18);
}
#stage canvas {
  position: relative;
}
.panel {
  background: rgba(9, 18, 52, 0.77);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
/* Menu and challenge, with clear goals and compact touch targets. */
.start-actions {
  width: min(100%, 390px);
  display: grid;
  gap: 12px;
  flex: none;
}
.start-actions .start-button {
  width: 100%;
  min-height: 60px;
  font-size: 20px;
}
.start-secondary {
  min-height: 54px;
  border-radius: 20px;
  color: #eafaff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.05em;
  border: 1px solid #83bcff;
  background: linear-gradient(180deg, #506dd3, #4439a4);
  box-shadow:
    0 5px 0 #20266b,
    0 8px 18px #050d30;
}
.start-secondary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #20266b;
}
.start-collection {
  min-height: 57px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border-radius: 17px;
  background: rgba(9, 20, 53, 0.8);
  border: 1px solid rgba(143, 195, 255, 0.55);
}
.start-collection span:nth-child(2) {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}
.start-collection b {
  font-size: 14px;
}
.start-collection small {
  color: #a9bde1;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.start-collection span:last-child {
  font-size: 24px;
  color: #a5dfff;
}
.collection-orb {
  width: 31px;
  height: 31px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(
    circle at 32% 25%,
    white,
    var(--orb-tint, #91eaff) 26%,
    #4b7de8 55%,
    #5033a9 82%
  );
  box-shadow: 0 0 12px #60c8ff90;
}
.start-art {
  max-height: calc(100% - 205px);
}
.game-home {
  display: none;
}
.playing .game-home {
  display: grid;
  font-size: 24px;
  color: #b6d8ff;
}
.challenge-info {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.challenge-title {
  color: #a5dcff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.challenge-values {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #bfcef1;
}
.challenge-values strong {
  color: white;
  font-size: 20px;
}
.challenge-progress {
  color: #ffd787;
  font-weight: 800;
  font-size: 13px;
}
.challenge-rule {
  color: #b0c1e7;
  font-size: 12px;
  line-height: 1.4;
}
.challenge-mode .balance,
.challenge-mode .bet,
.challenge-mode .history,
.challenge-mode .auto,
.challenge-mode .keys {
  display: none;
}
.challenge-result {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 4px 0 8px;
}
.result-gem {
  font-size: 54px;
  line-height: 1;
  color: #aaf3ff;
  text-shadow: 0 0 24px #56bbff;
  animation: result-appear 0.45s ease-out;
}
.result-caption {
  color: #ffd98a;
  font-weight: 800;
}
.challenge-result > strong {
  font-size: 42px;
  line-height: 1;
  color: #fff;
}
.result-stats {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}
.result-stats span {
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 10px;
  background: #ffffff0d;
  color: #b7c8eb;
}
.result-stats b {
  color: white;
}
@keyframes result-appear {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
}
@media not all and (min-width: 860px) and (min-aspect-ratio: 5/4) {
  .challenge-mode .panel {
    grid-template-areas: 'challenge challenge' 'risk rows' 'drop drop';
  }
  .challenge-info {
    grid-area: challenge;
    gap: 5px;
  }
  .challenge-rule {
    font-size: 11px;
  }
}
@media (max-height: 720px) and (orientation: portrait) {
  .start-actions {
    gap: 8px;
  }
  .start-actions .start-button,
  .start-secondary {
    min-height: 46px;
  }
  .start-collection {
    min-height: 48px;
  }
  .start-art {
    max-height: calc(100% - 170px);
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .start-actions {
    width: min(45%, 340px);
  }
  .start-actions .start-button {
    width: 100%;
  }
  .start-art {
    max-height: 100%;
  }
  .challenge-mode .panel {
    grid-template-areas: 'challenge challenge' 'risk rows' 'drop drop';
  }
  .challenge-rule {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .result-gem {
    animation: none;
  }
}
.unlock-reveal {
  position: absolute;
  z-index: 7;
  top: clamp(70px, 12vh, 120px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(90vw, 420px);
  padding: 12px 20px;
  border: 1px solid #f2cd78;
  border-radius: 18px;
  color: #fff3cf;
  background: linear-gradient(135deg, #172d62, #252151);
  box-shadow:
    0 8px 24px #060c2f99,
    0 0 25px #b19bff55;
  text-align: center;
  animation: unlock-appear 0.35s ease-out;
}
.unlock-gem {
  color: #aef2ff;
  font-size: 32px;
  text-shadow: 0 0 14px #6bcfff;
}
@keyframes unlock-appear {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .unlock-reveal {
    animation: none;
  }
}
.challenge-score.score-pulse {
  animation: score-land 0.28s ease-out;
}
.challenge-score.score-big {
  animation: score-land 0.5s ease-out;
  color: #ffdf91;
}
@keyframes score-land {
  40% {
    transform: scale(1.06);
    color: #d3ffff;
  }
}
.reduced-motion .challenge-score,
.reduced-motion .unlock-reveal,
.reduced-motion .result-gem {
  animation: none !important;
}
.result-points {
  color: #aabfe6;
  font-size: 13px;
  font-weight: 700;
}
@media (max-width: 600px) {
  .modal[data-modal='challenge'] {
    place-items: end center;
    padding: 12px 12px max(16px, env(safe-area-inset-bottom));
  }
  .modal[data-modal='challenge'] .sheet {
    border: 1px solid var(--line);
    border-radius: 20px;
    width: 100%;
    max-height: calc(100dvh - 32px);
  }
}
/* Menu keys: cool glass, separated physical travel, no gold underside. */
.start-actions {
  gap: 17px;
}
.start-actions .start-button {
  border-radius: 20px;
  box-shadow:
    0 5px 0 #29389a,
    0 8px 0 #192565,
    0 13px 20px #02092580,
    inset 0 1px 0 #efffff;
  transition:
    transform 90ms ease-out,
    box-shadow 90ms ease-out,
    filter 120ms ease-out;
}
.start-actions .start-button:hover {
  filter: brightness(1.06);
}
.start-actions .start-button:active {
  transform: translateY(4px);
  box-shadow:
    0 1px 0 #29389a,
    0 4px 0 #192565,
    0 6px 12px #02092580,
    inset 0 1px 0 #efffff;
}
.start-secondary {
  box-shadow:
    0 4px 0 #25266f,
    0 8px 16px #050d3080,
    inset 0 1px 0 #b7caff;
  transition:
    transform 90ms ease-out,
    box-shadow 90ms ease-out,
    filter 120ms ease-out;
}
.start-secondary:hover {
  filter: brightness(1.08);
}
.start-secondary:active {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 #25266f,
    0 4px 9px #050d3080,
    inset 0 1px 0 #b7caff;
}
.start-collection {
  transition:
    background 120ms ease-out,
    border-color 120ms ease-out,
    transform 90ms ease-out;
}
.start-collection:hover {
  background: rgba(26, 48, 96, 0.9);
  border-color: #a7daff;
}
.start-collection:active {
  transform: translateY(2px);
}
.start-art {
  max-height: calc(100% - 220px);
}
@media (max-height: 720px) and (orientation: portrait) {
  .start-actions {
    gap: 14px;
  }
  .start-art {
    max-height: calc(100% - 185px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .start-actions button {
    transition: none;
  }
}
.reduced-motion .start-actions button {
  transition: none;
}
.challenge-rule summary {
  cursor: pointer;
  color: #a9dfff;
  font-weight: 700;
  padding: 2px 0;
}
.challenge-rule div {
  padding: 5px 0 2px;
}
.modal[data-modal='challenge'] {
  background: rgba(2, 5, 18, 0.82);
}
@media (max-height: 520px) and (orientation: landscape) {
  .start-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px 16px;
  }
  .start-content {
    width: min(700px, 100%);
    height: 100%;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 24px;
  }
  .start-content .start-art {
    flex: 0 1 53%;
    width: 53%;
    max-width: 53%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  .start-actions {
    width: 42%;
    max-width: 310px;
    gap: 12px;
  }
  .start-actions .start-button,
  .start-secondary {
    min-height: 46px;
    font-size: 16px;
  }
  .start-collection {
    min-height: 48px;
  }
  .start-collection small {
    white-space: normal;
    line-height: 1.2;
  }
}
/* Keep result text legible from the very first frame. */
.modal[data-modal='challenge'] {
  animation: none;
}
.modal[data-modal='challenge'] .sheet {
  background: #101a45;
}

/* Header actions: compact crystal keys, with solid contrast over any backdrop. */
.ui:not(.playing) .top [data-act='history'],
.ui:not(.playing) .top [data-act='collection'],
.ui:not(.playing) .top [data-act='rules'] {
  display: none;
}
.top .icons {
  gap: 8px;
}
.top .icon {
  flex: none;
  width: 44px;
  height: 44px;
  color: #ecfaff;
  border: 1px solid rgba(141, 199, 255, 0.7);
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(42, 78, 145, 0.96), rgba(10, 22, 58, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(235, 252, 255, 0.32),
    0 3px 0 #0a163c,
    0 5px 12px #02091d70;
  transition:
    filter 120ms ease-out,
    transform 100ms ease-out,
    box-shadow 100ms ease-out;
}
.top .icon svg {
  width: 23px;
  height: 23px;
  filter: drop-shadow(0 1px 2px #061632);
}
.top .icon:hover {
  color: #fff;
  background: linear-gradient(155deg, #3f69b4, #15295c);
  filter: brightness(1.08);
}
.top .icon:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(235, 252, 255, 0.3),
    0 1px 0 #0a163c;
}
.top .prism .facet {
  fill: rgba(152, 207, 255, 0.45);
}
.top .prism-btn .prism {
  width: 24px;
  height: 22px;
}
@media (min-width: 860px) and (min-aspect-ratio: 5/4) {
  .top .icon {
    width: calc(44px * var(--header-scale));
    height: calc(44px * var(--header-scale));
    border-radius: calc(14px * var(--header-scale));
  }
  .top .icon svg {
    width: calc(23px * var(--header-scale));
    height: calc(23px * var(--header-scale));
  }
}
@media (max-width: 480px) {
  .top .icons {
    gap: 3px;
  }
  .top .icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .top .icon svg {
    width: 21px;
    height: 21px;
  }
  .ui.playing .brand .name {
    display: none;
  }
  .ui.playing .brand .mark {
    margin-right: auto;
  }
}
@media (max-width: 340px) {
  .top .icons {
    gap: 2px;
  }
  .top .icon {
    width: 39px;
    height: 40px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .top .icon {
    transition: none;
  }
}
.reduced-motion .top .icon {
  transition: none;
}
.top {
  justify-content: flex-end;
}
.top .clock:not([hidden]) {
  margin-right: auto;
}
.turbo-tip {
  position: fixed;
  z-index: 10;
  width: max-content;
  max-width: min(260px, calc(100vw - 16px));
  padding: 9px 12px;
  border: 1px solid rgba(143, 201, 255, 0.5);
  border-radius: 12px;
  color: #f1f8ff;
  background: #111f49;
  box-shadow: 0 8px 22px #02081f99;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  pointer-events: none;
}
/* End of source/src/ui/styles.css */
/* End of game/assets/styles-D5B-Dckr.css */
