/* TopFloor chrome, permanently dark; the original Stock Crash chart keeps its artwork. */
:root{color-scheme:dark}
.stock-brand{font-size:24px;color:#44e8ff;margin-right:4px}
#stage{background:#1e1c1d!important;aspect-ratio:auto;min-height:360px;height:100%;container-type:normal}
.stock-market{position:absolute;inset:38px 24px 12px;display:grid;grid-template-rows:auto auto auto minmax(100px,1fr) auto auto;min-height:0;color:#f1f8ff}
.stock-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #454042;padding-bottom:9px}
.stock-heading>div{display:flex;align-items:baseline;gap:15px}.stock-heading h1{font-size:26px;letter-spacing:-1px;margin:0}.stock-heading div span{font-size:14px;color:#d2cece}
#stage #round-state{display:block!important;font-size:10px;font-weight:650;letter-spacing:.5px;color:#ddd9d9}
.price-row{display:flex;align-items:center;gap:22px;margin:8px 0}.price-row>strong{font-size:38px;letter-spacing:-1.5px;font-variant-numeric:tabular-nums;line-height:1.1}.price-row>strong span{font-size:.7em;color:#d2cece;margin-left:4px}.price-row b{font-size:19px;font-weight:600}.price-row small{display:block;color:#d2cece;font-size:11px;margin-top:3px}
.market-meta{display:flex;justify-content:space-between;color:#d2cece;font-size:10px;letter-spacing:.5px}.chart-wrap{position:relative;min-height:0;margin-top:10px}#chart{width:100%;height:100%;display:block}#chart-hint{position:absolute;inset:40% 54px auto 0;text-align:center;color:#ddd9d9;font-size:14px}
.stock-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-top:1px solid #454042;border-bottom:1px solid #454042;padding:9px 0;gap:8px;font-size:11px;color:#d2cece}.stock-stats div{display:flex;gap:9px;align-items:center}.stock-stats b{color:#f1f8ff;font-weight:550;font-variant-numeric:tabular-nums}
.market-status{display:flex;justify-content:space-between;gap:8px;align-items:center;padding-top:7px;font-size:10px;color:#d2cece}#stage #countdown{display:inline!important;font-size:10px}.market-status button{font-size:10px;color:#b4cedd;padding:2px 0}
.stock-market .positive{color:#ed4146!important}.stock-market .negative{color:#ff6961!important}
#stage .round-intro{background:#1e1c1ded;backdrop-filter:blur(3px)}
#stage .intro-brand{width:min(260px,55%);height:70px;transform:none}#stage .intro-label{font-size:10px;letter-spacing:2px;color:#d2cece}#stage .round-intro>strong{font-size:38px;color:#fff}#stage .intro-track{width:170px;margin:9px 0;background:#3e3a3c}#stage .intro-track span{background:#44e8ff}#stage .round-intro>p{font-size:12px;margin:5px 0;color:#d2cece}
.stage-message{z-index:40;bottom:45px;background:#283750;color:#fff}.stock-market .badge{white-space:nowrap}
.night-mode .bet-action,.night-mode .modal-action{color:#172033}.night-mode .bet-action.cancel{background:#52432a;color:#ffe7ad;border-color:#8f7143}.night-mode .bet-action.cashout{color:#102a24}
.night-mode .win-confirmation{color:#b9f8db;background:#164334ed}.night-mode .modal-action:disabled{color:#172033}.night-mode #session-notice{background:#52432a;color:#ffe7ad}
@media(min-width:1100px) and (min-height:650px){.stage-frame{background:#1e1c1d!important}#stage{height:calc(100% - 17px);min-height:340px}.play-area{grid-template-rows:24px minmax(360px,1fr) auto auto}}
@media(max-width:1099px),(max-height:649px){#stage{height:430px;min-height:360px;aspect-ratio:auto}.stock-market{inset:36px 20px 12px}}
@media(max-width:600px){#stage{height:390px;min-height:0}.stock-market{inset:33px 12px 10px}.stock-heading h1{font-size:22px}.stock-heading>div{gap:8px}.stock-heading div span{font-size:11px}#stage #round-state{font-size:8px}.price-row>strong{font-size:30px}.price-row b{font-size:16px}.stock-stats div{flex-direction:column;align-items:flex-start;gap:3px}.market-meta{font-size:9px}.stock-stats{font-size:10px}.market-status,#stage #countdown,.market-status button{font-size:9px}.game-header .wordmark{font-size:18px}.stock-brand{font-size:21px}}
@media(max-width:380px){.stock-heading>div{flex-wrap:wrap;gap:2px 6px}.stock-heading div span{font-size:10px}.game-header .wordmark{font-size:16px}.stock-brand{font-size:18px}.market-status{align-items:flex-start;flex-direction:column;gap:3px}}
/* Keep full amounts readable when the activity rail narrows both order tickets. */
@media(min-width:801px) and (max-width:1099px){.stake-box{padding:4px 2px;gap:2px}.stake-box button{min-width:23px;width:23px;height:25px;font-size:18px}.stake-box input{font-size:15px}.bet-main{gap:8px}}
/* StockX palette and five-round market recap. */
:root{--stock-cyan:#44e8ff;--stock-up:#46dba1;--stock-down:#ff4658;--stock-yellow:#ffe52b;--stock-stage:#0d1626}
.game-header .wordmark{gap:0}.game-header .wordmark .stock-brand{color:var(--stock-cyan);margin-right:7px}.game-header .wordmark .brand-heist{color:var(--stock-cyan)}
.night-mode .bet-action{background:var(--stock-cyan);border-color:var(--stock-cyan);color:#102133;box-shadow:none}
.night-mode .bet-action.cashout{background:var(--stock-yellow);border-color:#e4c820;color:#172033}
.night-mode .bet-action.cancel{background:var(--stock-down);border-color:var(--stock-down);color:#171e2d}
.night-mode .fun-strip{background:var(--stock-yellow);color:#332e12}
.night-mode #stage,.night-mode .stage-frame{background:var(--stock-stage)!important}
#stage .round-intro{background:#0d1626ed}
.stock-market{grid-template-rows:auto auto auto minmax(100px,1fr) auto auto}
.stock-stats{border-color:#2a3a50}.price-row>strong span{color:inherit}
.stock-market .positive{color:var(--stock-up)!important}.stock-market .negative{color:var(--stock-down)!important}.stock-market .neutral{color:#d8e4f4!important}
.stock-results{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;padding-bottom:9px;border-bottom:1px solid #2a3a50}
.stock-result{display:flex;flex-direction:column;align-items:center;min-width:0;padding:4px 6px 3px;border-radius:10px;border:1px solid #ff465830;background:linear-gradient(145deg,#ff46581e,#ff465808);color:var(--stock-down)}
.stock-result.sold{background:linear-gradient(145deg,#46dba124,#46dba10a);border-color:#46dba130;color:var(--stock-up)}
.stock-result strong{font-size:18px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.15}.stock-result svg{width:100%;height:17px;margin:2px 0}.stock-result>span{font-size:8px;letter-spacing:.6px;color:#aebdd2;white-space:nowrap}
.stock-result:hover{border-color:currentColor;filter:brightness(1.15)}
.market-status:has(#countdown:empty){display:none}
/* Keep the five results visible while the next-round countdown runs. */
#stage .round-intro{top:112px;height:auto;bottom:0}
@media(max-width:600px){.stock-results{gap:6px}.stock-result{padding:3px 3px;border-radius:7px}.stock-result strong{font-size:14px}.stock-result svg{height:15px}.stock-result>span{font-size:6px;letter-spacing:0}#stage .round-intro{top:103px}.stock-market{inset-inline:12px}#stage{height:430px}}

/* Positive prices and cashed results use the green market status color. */
.stock-market .price-row .positive{color:var(--stock-up)!important}

/* Compact whole-round summaries; leave more room for the live chart. */
#stage .stock-market{top:12px}
.stock-result{padding:3px 6px 2px;gap:0}
.result-quote{display:flex;align-items:baseline;justify-content:space-between;width:100%;gap:3px}
.stock-result strong{font-size:16px}.result-quote small{font-size:8px;white-space:nowrap}
.stock-result svg{height:12px;margin:1px 0}
.stock-result .result-range{display:flex;justify-content:space-between;width:100%;gap:4px;font-size:8px;letter-spacing:0;color:#aebdd2}
.result-range b{font-weight:600;color:#d8e4f4}
#stage .round-intro{top:74px}
@media(max-width:600px){.stock-results{gap:4px}.stock-result{padding:3px 3px 2px}.stock-result strong{font-size:12px}.result-quote{justify-content:center}.result-quote small{display:none}.stock-result .result-range{font-size:6px;gap:2px;flex-wrap:wrap;justify-content:center}.stock-result svg{height:10px}#stage .round-intro{top:76px}}

/* Phone layout: reserve room for both order tickets in the visible viewport. */
@media(max-width:600px){
 .game-header{min-height:44px;padding-block:5px;gap:5px;flex-wrap:nowrap}
 .game-header .demo-badge,.game-header .wallet>span{display:none}
 .game-header .wordmark{font-size:16px;flex-wrap:nowrap}
 .game-layout{padding:6px;gap:8px}.play-area{gap:6px}
 .rounds-bar{height:26px;margin:0}.rounds-bar .icon{height:26px;width:26px;min-width:26px}
 .fun-strip{height:14px;line-height:14px;font-size:8px}
 #stage{height:clamp(230px,calc(100svh - 410px),360px);min-height:0}
 #stage .stock-market{inset:7px 9px 6px;grid-template-rows:auto auto auto minmax(80px,1fr) auto auto}
 .stock-results{gap:4px;padding-bottom:5px}.stock-result{padding:2px 3px;border-radius:6px}
 .stock-result strong{font-size:12px}.stock-result svg{height:8px;margin:1px 0}
 .stock-result .result-range{display:none}
 .price-row{margin:5px 0;gap:14px}.price-row>strong{font-size:27px}.price-row b{font-size:14px}.price-row small{font-size:9px;margin-top:1px}
 .chart-wrap{margin-top:4px}.stock-stats{padding:4px 0;font-size:9px;gap:4px}
 .stock-stats div{flex-direction:row;gap:4px;flex-wrap:wrap}.market-status{padding-top:3px}
 #stage .round-intro{top:42px}#stage .intro-brand{width:160px;height:45px}
 #stage .round-intro>strong{font-size:28px}#stage .intro-label{font-size:8px;letter-spacing:1px}
 #stage .intro-track{margin:5px 0}#stage .round-intro>p{font-size:10px;margin:2px 0}
 .bet-panels{grid-template-columns:minmax(0,1fr);gap:6px}
 .bet-panel{padding:6px 8px;border-radius:12px}.panel-top{min-height:26px;margin-bottom:4px}
 .panel-top .segmented{padding:2px}.panel-top .segmented button{padding:5px 8px;font-size:11px}
 .bet-main{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
 .stake-box{height:36px;padding:3px}.stake-box input{font-size:20px}
 .stake-box button{min-width:28px;height:28px}.presets{margin-top:4px;gap:4px}.presets button{padding:5px;min-height:28px}
 .bet-action{min-height:68px}.bet-action span{font-size:22px}.bet-action b{font-size:13px}
 .panel-help{margin-top:3px;font-size:9px;min-height:11px}
 .auto-options{margin-top:5px;padding-top:5px;gap:6px}
 .game-tools{padding-block:4px;gap:5px 8px}
}
/* Cashout feedback sits inside the artwork, below the round recap. */
.chart-wrap .win-notifications{position:absolute;top:8px;left:50%;transform:translateX(-50%);z-index:30;width:max-content;max-width:calc(100% - 16px);display:grid;gap:5px;pointer-events:none}
.chart-wrap .win-confirmation{font-size:12px;line-height:1.4;padding:7px 10px;letter-spacing:.2px;border:1px solid #46dba180;border-radius:8px;text-align:center}
@media(max-width:600px){.chart-wrap .win-confirmation{font-size:10px;padding:5px 8px}}

.peak-label{font-size:9px;font-weight:500;letter-spacing:0}.stock-result{cursor:default}.stock-result:hover{filter:none}.fairness-footer{justify-content:space-between}.fairness-footer .fairness-link{margin-right:auto}
@media(max-width:600px){.peak-label{font-size:8px;display:block;line-height:1}.stock-result strong{line-height:1.1}}

.peak-label{display:block;font-size:9px;line-height:1.2;margin-bottom:2px;white-space:nowrap}
@media(max-width:600px){.peak-label{font-size:7px;margin-bottom:1px}}

/* Compact Cosmo header and Alien-style navigation. */
.game-header{height:38px;padding:0 12px;gap:8px}
.game-header .wordmark,.game-header .spaceship-brand span{font-size:17px;letter-spacing:1px}
.game-header .demo-badge{font-size:8px;padding:5px 7px;border-radius:5px}
.game-header .wallet{font-size:8px;gap:5px}.game-header .wallet strong{font-size:13px;font-weight:400}
.game-header .icon{width:25px;min-width:25px;height:25px;font-size:16px}
.game-header .back,.rounds-bar .icon{display:grid;place-items:center;flex:none;width:28px;min-width:28px;height:28px;padding:0;border:1px solid #354963;border-radius:8px;color:#b7c7dd;background:#19283e;box-shadow:none}
.game-header .back:hover,.rounds-bar .icon:hover{color:#fff;background:#24364e}
.night-mode .fair-modal-brand img{background:#fff;border-radius:4px;padding:4px;mix-blend-mode:normal}
@media(min-width:801px) and (min-height:551px) and (min-aspect-ratio:1/1){.game-layout{height:calc(100dvh - 38px)}}
@media(max-width:380px){.game-header{gap:5px;padding:0 6px}.game-header .spaceship-brand span{font-size:14px}}

.rounds-bar .icon{width:24px;min-width:24px;height:20px;border-radius:6px;flex:0 0 24px;align-self:center;font-size:20px;line-height:1}.rounds-bar .icon svg{display:block;margin:auto}

#modal{scrollbar-width:none}#modal::-webkit-scrollbar{display:none;width:0;height:0}.crash-multipliers{display:grid;grid-template-columns:repeat(auto-fit,minmax(70px,1fr));gap:8px;padding:4px 0 12px}.crash-multipliers .round-chip{text-align:center;padding:10px 6px}

#players{scrollbar-width:none}#players::-webkit-scrollbar{display:none;width:0;height:0}

#players .player-row{content-visibility:auto;contain-intrinsic-size:auto 44px}


/* Top results: compact filter rows and individual result cards. */
#activity-panel.show-top .activity-summary,#activity-panel.show-top .table-labels{display:none}
#top-filters{flex-direction:column;gap:4px;margin:8px 0;padding:5px;background:#0b1525;border-radius:15px;flex-shrink:0}
#top-filters .segmented{background:transparent;padding:0;width:100%}
#top-filters button{padding:7px 3px;font-size:12px;font-weight:400}
#top-filters button.selected{background:#2d405d;color:#fff}
.top-result{padding:12px 10px;margin-bottom:7px;background:#0a1423;border-radius:16px;color:#c4cfdf}
.top-result header{display:flex;align-items:center;gap:8px;margin-bottom:13px}
.top-avatar{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#26384f;font-size:24px;flex-shrink:0}
.top-result header strong{font-size:12px;font-weight:500}.top-result time{display:block;font-size:10px;color:#8392a9;margin-top:2px}
.top-proof{margin-left:auto;display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#253147;color:#a4b1c5;flex-shrink:0}
.top-result dl{display:grid;grid-template-columns:1fr 1fr;gap:7px 10px;margin:0;font-size:10px;font-variant-numeric:tabular-nums}
.top-result dl div{display:flex;justify-content:space-between;gap:4px;min-width:0}.top-result dt{color:#8392a9;white-space:nowrap}.top-result dd{margin:0;text-align:right;overflow-wrap:anywhere}.top-result .top-mult{color:#8bd2ff}.top-result .top-mult.medium{color:#c9a7ff}.top-result .top-mult.high{color:#fface4}

/* Center manual controls; automatic controls use the space below them. */
.bet-panel{display:flex;flex-direction:column}
.bet-panel>.panel-top,.bet-panel>.bet-main,.bet-panel>.auto-options,.bet-panel>.panel-help{flex-shrink:0}
.bet-panel:has(.auto-options[hidden])>.bet-main{margin-top:auto}
.bet-panel:has(.auto-options[hidden])>.panel-help{margin-bottom:auto}


/* StockX-specific sizing and existing palette. */
.game-header{height:38px;min-height:38px;padding-block:0}.game-header .wordmark{font-size:17px}.game-header .stock-brand{font-size:21px}
.night-mode .fun-strip{background:#f6d60c;color:#182337}
.top-result .top-mult{color:#8bd2ff}.top-result .top-mult.medium{color:#c9a7ff}.top-result .top-mult.high{color:#fface4}
.fair-modal-brand{text-align:center;margin:10px 0 24px}.fair-modal-brand img{width:135px;max-width:100%}
.bet-panel{min-height:164px}.bet-panel:has(.auto-options:not([hidden])) .bet-main{margin-top:0}.auto-options{flex-wrap:wrap}
@media(max-width:600px){.bet-panel{min-height:126px}.bet-panel:has(.auto-options:not([hidden])){min-height:160px}.game-header .wallet strong{font-size:12px}}
#stage[data-phase="waiting"] #elapsed{visibility:hidden}
