:root {
  --background: #0b0b0d;
  --panel: #131316;
  --surface: #1a1a1e;
  --edge: #27272e;
  --edge-strong: #373740;
  --text: #f2f2f3;
  --muted: #a2a2ac;
  --accent: #2bd576;
  --loss: #ff9a8f;
  --display: "Arial Narrow", "Inter", sans-serif;
}

.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.upgrade-header { background: #0f0f12; }
.upgrade-header .header-inner { width: min(100% - 48px, 1400px); grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; min-height: 66px; }
.upgrade-header .brand { font-family: var(--display); font-weight: 800; letter-spacing: .09em; }
.upgrade-header .nav { gap: 24px; }
.upgrade-header .nav :is(a, button) { font-family: var(--display); font-size: 13px; text-transform: uppercase; letter-spacing: .075em; }
.upgrade-header .nav [aria-current] { color: var(--accent); }
.upgrade-header .header-actions { gap: 14px; }
.upgrade-header .deposit-button { flex: none; padding-inline: 16px; }
.upgrade-header .button.primary, .upgrade-workspace .button.primary:not(:disabled) { border-color: var(--accent); background: var(--accent); color: #04140b; }
.upgrade-header .button.primary:hover, .upgrade-workspace .button.primary:not(:disabled):hover { border-color: #59e596; background: #59e596; }
.metric { display: grid; gap: 3px; padding: 2px 0; border: 0; background: none; color: var(--text); text-align: left; white-space: nowrap; }
.metric span, .label { color: var(--muted); font-family: var(--display); font-weight: 650; font-size: 11px; letter-spacing: .095em; text-transform: uppercase; }
.metric strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.metric[data-open=jackpot] strong { color: var(--accent); }
.metric:hover strong { text-decoration: underline; text-underline-offset: 3px; }

.upgrade-workspace { width: min(100% - 48px, 1400px); margin: 0 auto; padding: 16px 0 0; display: grid; gap: 16px; }
.mode-bar { display: flex; align-items: center; gap: 9px; min-height: 28px; color: var(--muted); font-size: 12px; }
.mobile-pool { display: none; }
.mode-label { padding: 4px 7px; border: 1px solid #4f402b; border-radius: 4px; background: #211b14; color: #f3c489; text-transform: uppercase; letter-spacing: .08em; font-weight: 750; font-size: 10px; }
.market-status { margin-left: auto; padding: 4px 0; border: 0; background: transparent; color: var(--muted); text-align: right; font-size: 12px; }
.market-status:hover { color: var(--text); }
.market-status[data-status=live] { color: #7bdda3; }
.upgrade-stage { height: auto; padding: 18px; border-radius: 9px; }
.stage-grid, .stage-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 380px) minmax(0, 1fr); align-items: stretch; gap: 18px; }
.stage-card { min-width: 0; min-height: 270px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; padding: 18px; border: 1px solid var(--edge); border-radius: 8px; background: var(--surface); text-align: center; }
.stage-content { display: grid; justify-items: center; gap: 9px; min-width: 0; width: 100%; }
.stage-empty { max-width: 220px; color: var(--muted); line-height: 1.45; }
.stage-link { color: var(--text); font-weight: 700; text-underline-offset: 3px; }
.stage-link:hover { color: var(--accent); text-decoration: underline; }
.stage-quantity { max-width: 100%; overflow-wrap: anywhere; font-size: clamp(17px, 2.15vw, 26px); font-weight: 800; font-variant-numeric: tabular-nums; }
.stage-price { color: var(--accent); font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stage-note { font-size: 12px; line-height: 1.4; color: var(--muted); }
.stage-note[data-error=true] { color: var(--loss); }
.stage-total { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stage-total strong { font-size: 23px; color: var(--accent); font-variant-numeric: tabular-nums; }
.stake-card .stage-content:has(.stake-line) { max-height: 245px; overflow: auto; padding: 3px; justify-items: stretch; }
.stake-line { padding: 8px 10px; border-radius: 6px; border: 1px solid var(--edge); background: var(--panel); text-align: left; min-width: 0; }
.stake-line-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.stake-line strong { display: block; font-size: 13px; font-weight: 750; overflow-wrap: anywhere; }
.stake-line small { color: var(--muted); font-size: 11px; }
.stake-line .line-value { color: var(--accent); font-size: 12px; white-space: nowrap; }
.stake-line input[type=range] { display: block; width: 100%; height: 22px; margin: 4px 0 0; accent-color: var(--accent); cursor: pointer; }
.coin-icon { position: relative; display: grid; place-items: center; width: 46px; height: 46px; flex: none; isolation: isolate; border-radius: 10px; background: #25262e; overflow: hidden; }
.coin-icon span { padding: 2px; font-size: 11px; font-weight: 800; color: var(--muted); }
.coin-icon img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; opacity: 0; }
.coin-icon.loaded img { opacity: 1; }
.coin-icon.loaded span { visibility: hidden; }
.coin-icon.light { background: #d4d4de; }
.stage-content > .coin-icon { width: 70px; height: 70px; border-radius: 12px; }
.stake-line .coin-icon { width: 32px; height: 32px; border-radius: 7px; }

.upgrade-workspace .wheel-panel { grid-area: auto; grid-template-rows: auto; height: auto; min-height: 0; padding: 0; display: grid; place-items: center; background: none; border: 0; }
.upgrade-workspace .wheel { width: 100%; max-width: 380px; margin: 0; aspect-ratio: 1; }
.wheel canvas { display: block; width: 100%; height: 100%; }
.upgrade-workspace .wheel-label { inset: 25%; gap: 5px; pointer-events: none; }
.upgrade-workspace .wheel-label strong { font-size: clamp(31px, 4vw, 52px); line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.upgrade-workspace .wheel-label span { font-size: 12px; text-align: center; }
.upgrade-workspace .wheel[data-result=win] .wheel-label strong { color: var(--accent); }
.upgrade-workspace .wheel[data-result=loss] .wheel-label strong, .upgrade-workspace .wheel[data-odds=low] .wheel-label strong { color: var(--loss); }
.upgrade-workspace .wheel[data-result=win][data-odds=low] .wheel-label strong { color: var(--accent); }

.stage-actions { align-items: start; margin-top: 14px; }
.stake-actions, .presets { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; }
.presets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.presets .button { min-width: 0; padding-inline: 2px; font-variant-numeric: tabular-nums; }
.button[aria-pressed=true] { color: var(--accent); border-color: var(--accent); background: #14251b; }
.upgrade-workspace .button:disabled { opacity: .5; }
.launch { display: grid; gap: 7px; }
.upgrade-workspace .upgrade-button { width: 100%; min-height: 52px; font-family: var(--display); font-weight: 800; letter-spacing: .075em; text-transform: uppercase; font-size: clamp(13px, 2.2vw, 21px); }
.launch-status { min-height: 16px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.35; }
.launch-status[data-error=true] { color: var(--loss); }

.lists-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; gap: 16px; }
.lists-grid .panel { display: block; grid-area: auto; height: auto; min-width: 0; }
.upgrade-workspace .panel-head { min-height: 51px; padding-inline: 14px; }
.upgrade-workspace .panel-head h2 { font-family: var(--display); font-size: 13px; letter-spacing: .085em; text-transform: uppercase; }
.upgrade-workspace .catalogue-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, 210px) auto; gap: 8px; }
.catalogue-head .button { min-height: 34px; white-space: nowrap; }
.catalogue-head .search-control { min-height: 34px; }
.upgrade-workspace .catalogue-tools { display: flex; justify-content: space-between; align-items: center; padding: 6px 14px; min-height: 45px; }
.upgrade-workspace .catalogue-scroll { padding: 0; max-height: 580px; overflow: auto; scrollbar-color: #383841 transparent; }
.coin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); align-content: start; gap: 8px; padding: 11px; }
.coin-grid .empty-text { grid-column: 1 / -1; }
.coin-tile { position: relative; display: grid; grid-template-rows: auto auto auto auto; align-content: start; justify-items: center; gap: 5px; min-width: 0; min-height: 123px; padding: 10px 6px 8px; border: 1px solid var(--edge); border-radius: 6px; background: var(--surface); text-align: center; }
.coin-tile:hover { border-color: #4e4e59; }
.coin-tile[aria-pressed=true] { border-color: var(--accent); background: #14251b; }
.coin-tile[aria-pressed=true]::after { content: '✓'; position: absolute; top: 5px; right: 5px; width: 16px; height: 16px; border-radius: 3px; background: var(--accent); color: #04140b; font-weight: 800; }
.coin-tile strong, .coin-tile small, .coin-tile .tile-odds { max-width: 100%; }
.coin-tile strong { font-weight: 780; line-height: 1.15; overflow-wrap: anywhere; }
.coin-tile small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-tile .tile-value { color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.coin-tile .tile-odds { color: var(--accent); font-size: 11px; font-weight: 700; }
.coin-tile[data-limited=true] .tile-odds { color: var(--muted); }
.coin-tile[data-limited=true] .coin-icon { opacity: .72; }
.coin-tile[data-demo=true] .tile-value { color: var(--muted); }
.upgrade-workspace .more-button { margin: 0 11px 11px; width: calc(100% - 22px); }
.empty-state { grid-column: 1 / -1; display: grid; justify-items: start; gap: 9px; padding: 9px; line-height: 1.45; }
.empty-state p { color: var(--muted); }
.rules-content, .profile-content { display: grid; gap: 10px; line-height: 1.55; }
.rules-content h3 { color: var(--text); margin-top: 7px; }
.rules-content ol { padding-inline-start: 22px; margin: 0; }
.rules-content li + li { margin-top: 5px; }
.rules-content a { color: var(--accent); }
.dialog[data-kind=rules] { width: min(690px, calc(100vw - 28px)); }
.history-row time { font-size: 12px; color: var(--muted); }
.history-info { display: grid; gap: 5px; min-width: 0; }
.history-info strong { overflow-wrap: anywhere; }
.jackpot-line { color: var(--accent); font-weight: 750; }
.proof-data { margin: 0; padding: 12px; border-radius: 6px; border: 1px solid var(--edge); overflow-wrap: anywhere; white-space: pre-wrap; font-size: 12px; }
.support-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1050px) {
  .upgrade-header .header-inner { gap: 14px; }
  .upgrade-header .nav { gap: 12px; }
  .upgrade-header .header-actions { gap: 9px; }
  .stage-grid, .stage-actions { grid-template-columns: minmax(0, 1fr) minmax(210px, 33%) minmax(0, 1fr); gap: 10px; }
  .stage-card { padding: 12px; }
  .coin-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); }
}
@media (max-width: 760px) {
  .upgrade-header .header-inner { width: calc(100% - 24px); grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding-top: 8px; }
  .upgrade-header .brand { font-size: 14px; gap: 6px; }
  .upgrade-header .brand img { width: 28px; height: 28px; }
  .upgrade-header .nav { grid-row: 2; grid-column: 1 / -1; min-height: 43px; gap: 20px; }
  .upgrade-header .header-actions { grid-row: 1; grid-column: 2; gap: 6px; }
  .upgrade-header .header-actions .button { min-height: 36px; padding-inline: 9px; font-size: 12px; }
  .upgrade-header .metric { display: none; }
  .upgrade-header .account-button { min-width: 62px; }
  .mobile-pool { display: inline-flex; gap: 4px; padding: 2px 0; border: 0; background: none; font-size: 11px; color: var(--muted); white-space: nowrap; }
  .mobile-pool strong { color: var(--accent); }
  .mode-bar > span:not(.mode-label) { display: none; }
  .market-status { font-size: 11px; }
  .upgrade-workspace { width: calc(100% - 24px); gap: 12px; padding-top: 8px; }
  .upgrade-stage { padding: 10px; }
  .stage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upgrade-workspace .wheel-panel { grid-column: 1 / -1; grid-row: 1; }
  .upgrade-workspace .wheel { width: min(100%, 290px); }
  .upgrade-workspace .wheel-label strong { font-size: 39px; }
  .stage-card { min-height: 153px; gap: 8px; padding: 9px; }
  .stage-content > .coin-icon { width: 48px; height: 48px; }
  .stage-quantity { font-size: 16px; }
  .stage-price, .stage-total strong { font-size: 17px; }
  .stake-line { padding: 6px; }
  .stake-line-top { grid-template-columns: auto minmax(0, 1fr); gap: 4px 6px; }
  .stake-line .line-value { grid-column: 2; }
  .stake-line .coin-icon { width: 24px; height: 24px; }
  .stage-actions { grid-template-columns: 1fr; gap: 9px; }
  .stage-actions .launch { grid-row: 3; }
  .stage-actions .button { min-height: 40px; }
  .stage-actions .upgrade-button { min-height: 47px; font-size: 17px; }
  .lists-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .coin-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .upgrade-workspace .catalogue-head { grid-template-columns: minmax(0, 1fr) auto; padding-block: 8px; }
  .upgrade-workspace .catalogue-head h2 { grid-column: 1 / -1; }
  .upgrade-workspace .footer { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}
@media (max-width: 370px) {
  .upgrade-header .brand span { font-size: 12px; }
  .upgrade-header .header-actions .button { padding-inline: 7px; }
  .stage-card { padding: 7px; }
  .stake-line .coin-icon { display: none; }
  .stake-line-top { grid-template-columns: minmax(0, 1fr); }
  .stake-line .line-value { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
