@charset "UTF-8";

/* Shared interface. The original stylesheet owns game art and motion. */
:root {
  --bg: #0d1018;
  --surface: #151a25;
  --surface-raised: #1c2230;
  --line: #ffffff14;
  --text: #edf0f7;
  --muted: #a0abc0;
  --gold: #f0cc88;
  --green: #8fdfbb;
  --red: #f4a0ad;
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
}
body { background: var(--bg); font-size: 14px; line-height: 1.6; }
button, input, select { line-height: 1.4; }
button { touch-action: manipulation; }
button:disabled { cursor: not-allowed; }
h1, h2, h3 { word-break: keep-all; overflow-wrap: anywhere; }
.site-shell, body[data-screen="lobby"] .site-shell { max-width: 1640px; padding: 0 32px; }
.site-header, body[data-screen="lobby"] .site-header { height: 76px; }
.brand { font-size: 22px; gap: 12px; }
.brand-chip { width: 37px; height: 37px; font-size: 24px; }
.brand b { color: var(--muted); font-size: 9px; letter-spacing: 3px; }
.header-right { gap: 8px; }
.virtual-label { font-size: 12px; }
.quiet-button { min-height: 36px; padding: 8px 12px; border-color: var(--line); color: #bdc6d8; font-size: 12px; border-radius: 8px; }
.quiet-button:hover { background: #ffffff09; border-color: #ffffff38; }
.button { min-height: 46px; padding: 12px 16px; border-radius: 9px; font-size: 14px; box-shadow: none; }
.button:hover:not(:disabled) { transform: none; }
.primary { color: #24201a; background: #f0cc88; border: 1px solid #f3d69e; box-shadow: none; }
.secondary { color: #d6deec; background: #262e3e; border-color: #ffffff20; }
.button:disabled { opacity: .4; }
.input { background: #0f131d; border-color: #ffffff24; border-radius: 9px; font-size: 15px; height: 46px; }
.input::placeholder { font-size: 13px; color: #8793a9; }
.field-label { color: #c0cadb; font-size: 13px; }
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: 1.5px; }
.panel { background: var(--surface); border-color: var(--line); border-radius: 16px; }
.site-footer, body[data-screen="lobby"] .site-footer { margin-top: 24px; padding: 16px 0 20px; color: #909bb0; font-size: 11px; }

/* Entrance and lobby */
body[data-screen="entrance"] { background: var(--bg); }
.entrance-main { min-height: calc(100svh - 76px); }
.entrance-stage { border-color: var(--line); background: var(--surface); }
.entrance-checkin { background: var(--surface); }
.entrance-heading h1 { font-size: 32px; }
.entrance-heading p, .nickname-guide { color: #b4bfd2; }
.nickname-input { height: 54px; font-size: 17px; }
.entrance-submit { font-size: 16px; box-shadow: none; }
.hero-grid, body[data-screen="lobby"] .hero-grid { grid-template-columns: minmax(0,1fr) 360px; margin-top: 20px; gap: 20px; }
.hero-world, body[data-screen="lobby"] .hero-world { min-height: 330px; border-radius: 16px; border-color: var(--line); }
.hero-copy, body[data-screen="lobby"] .hero-copy { padding: 30px 36px; }
.hero-copy h1, body[data-screen="lobby"] .hero-copy h1 { font-size: 52px; line-height: 1.13; letter-spacing: -2px; margin: 18px 0 16px; }
.hero-copy>p:not(.eyebrow), body[data-screen="lobby"] .hero-copy>p:not(.eyebrow) { font-size: 13px; line-height: 1.7; }
.hero-link, body[data-screen="lobby"] .hero-link { font-size: 12px; margin-top: 12px; padding: 8px 0 5px; }
.hero-badge { display: none; }
.entry-panel, body[data-screen="lobby"] .entry-panel { background: var(--surface); border-color: var(--line); border-radius: 16px; padding: 20px; box-shadow: none; }
.entry-panel h2, body[data-screen="lobby"] .entry-panel h2 { font-size: 23px; margin: 4px 0; }
.entry-panel>p:not(.eyebrow), body[data-screen="lobby"] .entry-panel>p:not(.eyebrow) { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.lobby-player, body[data-screen="lobby"] .lobby-player { margin: 12px 0; padding: 10px 0; }
.lobby-player small { font-size: 11px; color: var(--muted); }
.lobby-player strong { font-size: 15px; }
.lobby-avatar { background: #2c3548; color: #f0cc88; }
.lobby-player .quiet-button { font-size: 12px; }
.entry-panel>.button, body[data-screen="lobby"] .entry-panel>.button { margin: 0; min-height: 44px; }
.room-browser, body[data-screen="lobby"] .room-browser { margin-top: 16px; padding-top: 12px; }
.room-browser-head, body[data-screen="lobby"] .room-browser-head { margin-bottom: 8px; }
.room-browser-head strong { font-size: 13px; }
.room-browser-head .quiet-button { font-size: 11px; min-height: 28px; }
.room-list, body[data-screen="lobby"] .room-list { min-height: 50px; max-height: 112px; }
.rooms-empty, body[data-screen="lobby"] .rooms-empty { min-height: 50px; color: var(--muted); font-size: 12px; }
.open-room { background: #0f131d; border-color: var(--line); }
.open-room-info strong { font-size: 13px; }
.open-room-info small { font-size: 11px; color: var(--muted); }
.entry-foot, body[data-screen="lobby"] .entry-foot { font-size: 10px; color: #909bb0; margin-top: 10px; }
.race-how, body[data-screen="lobby"] .race-how { margin: 12px 0 20px; padding: 12px 20px; gap: 16px; }
.race-how>div>span, body[data-screen="lobby"] .race-how>div>span { font-size: 20px; font-style: normal; color: #78859e; }
.race-how p { font-size: 11px; color: var(--muted); }
.race-how b { font-size: 13px; color: var(--text); }
.section-heading, body[data-screen="lobby"] .section-heading { margin-bottom: 14px; }
.section-heading .eyebrow { display: none; }
.section-heading h2, body[data-screen="lobby"] .section-heading h2 { font-size: 22px; margin: 0; }
.game-count { font-size: 11px; color: var(--muted); }
.catalog-grid, body[data-screen="lobby"] .catalog-grid { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }
.game-card, body[data-screen="lobby"] .game-card { display: grid; grid-template-columns: 88px minmax(0,1fr); min-height: 128px; background: var(--surface); border-color: var(--line); border-radius: 12px; }
.game-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb,var(--accent) 50%,transparent); box-shadow: 0 8px 24px #0003; }
.game-card-art, body[data-screen="lobby"] .game-card-art { min-height: 128px; height: 100%; background: radial-gradient(ellipse at center,color-mix(in srgb,var(--accent) 10%,transparent),transparent 72%); }
.game-card-art>.game-art, body[data-screen="lobby"] .game-card-art>.game-art { width: 82px; height: 90px; }
.card-index, .art-halo, .game-card-art:after { display: none; }
.game-card-tag, body[data-screen="lobby"] .game-card-tag { font-size: 10px; position: static; display: inline-block; margin-top: 7px; padding: 2px 6px; color: #d9c5a2; background: #efc98309; border-color: #efc98321; }
.game-card-info, body[data-screen="lobby"] .game-card-info { padding: 15px 12px 13px 0; min-width: 0; align-self: stretch; display: flex; flex-direction: column; }
.game-card-info>small { display: none; }
.game-card-info h3, body[data-screen="lobby"] .game-card-info h3 { font-size: 16px; min-height: 26px; margin: 0 0 6px; letter-spacing: -.5px; gap: 4px; }
.game-card-info p, body[data-screen="lobby"] .game-card-info p { display: block; flex: 1; font-size: 12px; line-height: 1.5; color: #a8b3c8; word-break: keep-all; }
.game-card-info .game-card-tag { align-self: flex-start; }
.card-arrow { font-size: 15px; color: #78859e; }

/* Consistent room columns and a compact, readable race HUD. */
.room-heading { padding: 20px 0 16px; }
.room-heading h1 { font-size: 24px; margin: 2px 0 0; }
.room-heading .eyebrow { font-size: 10px; }
.room-layout { grid-template-columns: minmax(0,1fr) 250px; gap: 20px; align-items: start; }
.room-layout>div, #game-visual, .table-console { min-width: 0; }
.race-banner { padding: 18px 24px; gap: 28px; margin-bottom: 20px; background: var(--surface); border-color: var(--line); border-radius: 14px; }
.countdown-wrap { gap: 12px; }
.clock-icon { font-size: 34px; color: #b9c5dd; }
.countdown { font-size: 32px; letter-spacing: 1px; }
.countdown-wrap small, .bank-stats>div>span { font-size: 12px; color: var(--muted); }
.bank-stats { display: grid; grid-template-columns: 1.15fr 1fr 80px; gap: 24px; padding-left: 28px; border-color: var(--line); }
.bank-stats b { font-size: 25px; color: var(--text); }
.bank-stats .rank-stat { position: static; margin: 0; text-align: right; }
.rank-stat b { justify-content: flex-end; color: var(--gold); }
.race-progress i { background: var(--gold); }
.room-mode-bar { background: var(--surface); border: 1px solid var(--line); padding: 5px; gap: 4px; margin: 0 0 16px; border-radius: 12px; }
.room-mode-bar>button { min-height: 42px; font-size: 14px; padding: 8px; color: #aebbd0; flex-direction: row; gap: 6px; border-radius: 8px; }
.room-mode-bar>button>span { font-size: 10px; background: #ffffff09; color: #aebbd0; }
.room-mode-bar>button[aria-pressed=true] { color: var(--gold); background: #f0cc8810; border-color: #f0cc8838; box-shadow: none; }
.room-mode-bar>button[aria-pressed=true]>span { color: var(--gold); }
.game-tabs, .casino-tabs { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; margin-bottom: 16px; }
.game-tab { min-height: 48px; padding: 8px; background: #151a25; border-color: var(--line); border-radius: 9px; gap: 7px; }
.game-tab .game-art { width: 28px; height: 28px; }
.game-tab span { font-size: 12px; color: #b8c2d5; white-space: normal; word-break: keep-all; }
.game-tab.selected { background: color-mix(in srgb,var(--accent) 10%,#151a25); border-color: color-mix(in srgb,var(--accent) 55%,transparent); box-shadow: none; }
.game-tab.selected span { color: #fff1d6; }
.game-tab:hover:not(:disabled) { background: #252c3b; border-color: #ffffff38; }
#room-side>aside { position: sticky; top: 20px; }
.sidebar { padding: 18px; background: var(--surface); }
.side-heading { padding-bottom: 12px; border-color: var(--line); }
.side-heading strong { font-size: 14px; }
.side-heading span, .side-note { font-size: 11px; color: var(--muted); }
.player-list { padding-top: 4px; }
.sidebar .player-list { max-height: 440px; }
.player-row { padding: 13px 0; gap: 8px; border-color: var(--line); }
.player-row.assets-only .player-name { font-size: 13px; color: #ced7e7; }
.player-row.assets-only .player-money { font-size: 15px; color: #f3d59f; }
.player-row.me:before { border: 0; background: #f0cc8805; inset: 5px -8px; }
.recent-feed { margin-top: 16px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.recent-feed h3 { font-size: 12px; color: #d0d8e7; }
.feed-row { font-size: 11px; padding: 9px 0; }
.feed-row span, .empty-feed { color: var(--muted); font-size: 11px; }
.feed-row b { font-size: 11px; }

/* The game stays left; actions and the settled result share one right column. */
.arena { padding: 20px; display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 16px 20px; background: var(--surface); overflow: visible; }
#arena-heading, #ticket-status { grid-column: 1/-1; }
#ticket-status:empty { display: none; }
.arena-head { margin: 0; min-height: 46px; }
.arena-head h2 { font-size: 24px; margin-top: 2px; }
.arena-head .eyebrow { font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.arena-meta { gap: 8px; }
.arena-meta>span { font-size: 11px; border-color: #f0cc8828; color: #dbc69e; }
.arena .quiet-button { min-height: 34px; font-size: 12px; padding: 7px 10px; }
.table-console { padding: 16px; background: #0f141f; border: 1px solid var(--line); border-radius: 12px; align-self: stretch; display: flex; flex-direction: column; gap: 12px; }
.table-instruction { font-size: 13px; color: #b8c3d7; line-height: 1.7; word-break: keep-all; }
.table-instruction strong { display: block; color: #e4e9f2; font-size: 14px; margin-bottom: 6px; }
.table-console #hand-timer:empty, .table-console #game-result:empty { display: none; }
.table-console #game-result { margin-top: auto; }
.table-console #game-controls { min-width: 0; width: 100%; }
.stake-bar { grid-template-columns: minmax(0,1fr); padding-top: 0; border: 0; gap: 10px; }
.stake-control { min-height: 48px; border-color: #ffffff2b; background: #090e18; border-radius: 8px; }
.stake-control input { min-height: 48px; padding: 10px 34px 10px 12px; font-size: 20px; }
.stake-control>span:last-child { color: var(--muted); font-size: 12px; }
.stake-presets { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; width: 100%; }
.stake-presets button { min-width: 0; min-height: 36px; font-size: 11px; padding: 5px 2px; background: #1d2637; border-color: #ffffff16; color: #c3cee1; }
.stake-bar>.button { min-height: 48px; font-size: 14px; margin: 3px 0 0; }
.stake-help { font-size: 11px; color: #96a3ba; line-height: 1.7; margin: 12px 0 0; }
.pending-note { min-height: 166px; border: 0; font-size: 13px; }
.pending-note small { font-size: 12px; color: var(--muted); }
.result-bar { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 0; padding: 14px; border-color: #ffffff20; border-radius: 10px; background: #1b2230; animation: none; }
.result-icon { display: none; }
.result-bar b { display: none; }
.result-bar p { font-size: 13px; line-height: 1.6; color: #e0e6f0; margin: 5px 0; }
.result-bar small { font-size: 11px; color: var(--muted); }
.result-bar>strong { text-align: left; font-size: 25px; white-space: normal; overflow-wrap: anywhere; }
.result-bar>strong small { display: none; }
.result-win { background: #8fdfbb0b; border-color: #8fdfbb50; }
.hand-clock, .annuity-income { font-size: 12px; margin: 0; }
.play-stage { min-height: 300px; border-color: var(--line); background-color: #101420; border-radius: 12px; }
.slot-stage { min-height: 300px; }
.paytable { font-size: 12px; color: #aebbd0; margin: 12px 0 0; gap: 4px; line-height: 1.8; }
.paytable b { font-size: 12px; color: #f0cc88; }
.paytable>span { margin: 0 4px; }
.bet-options { gap: 8px; margin: 12px 0 0; }
.bet-option { min-height: 56px; font-size: 13px; background: #20283a; border-color: #ffffff20; }
.bet-option small { font-size: 11px; color: #aab8d0; }
.bet-option.selected { border-color: var(--gold); background: #f0cc8810; box-shadow: none; }
.table-tip { display: none; }
.personal-history { padding-top: 14px; }
.personal-history h3 { font-size: 11px; color: var(--muted); }
.history-pill { font-size: 11px; color: #b4c0d6; background: var(--surface); border-color: var(--line); padding: 6px 9px; }

/* Tickets use the same action column and consistent number spacing. */
.ticket-status { margin: 0; padding: 10px 14px; gap: 6px 20px; border-color: #ffffff12; background: #0f141f; color: #afbdd4; font-size: 12px; }
.ticket-status>span:last-child { margin-left: auto; }
.ticket-stage { margin: 0; border-radius: 12px; border-color: var(--line); }
.constellation-stage { min-height: 216px; padding: 18px; }
.ticket-heading strong { font-size: 18px; margin: 5px 0 8px; }
.ticket-heading small { font-size: 10px; letter-spacing: 2px; }
.constellation-drum { top: 5px; opacity: .25; }
.lottery-balls { gap: 12px; padding-top: 48px; }
.lottery-ball { width: 50px; height: 50px; font-size: 23px; }
.ticket-picker-head { margin: 12px 0 8px; color: #b7c3d8; font-size: 13px; }
.number-board.lottery-board { width: 100%; max-width: none; grid-template-columns: repeat(8,minmax(0,1fr)); gap: 6px; margin: 0; }
.lottery-board .number-cell { min-height: 38px; height: auto; font-size: 14px; border-radius: 7px; background: #20283a; border-color: #ffffff18; }
.lottery-board .number-cell.selected { background: #f0cc88; color: #22202a; border-color: #ffe1ab; }
.ticket-purchase p { text-align: left; font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.ticket-purchase p b { display: block; font-size: 28px; line-height: 1.5; }
.ticket-purchase .button { font-size: 14px; min-height: 48px; }
.scratch-stage { min-height: 330px; display: grid; align-items: center; padding: 20px; }
.scratch-card { width: 100%; max-width: 420px; padding: 18px; }
.scratch-card-heading strong { font-size: 21px; }
.scratch-symbols { height: 54px; }
.scratch-card-footer { font-size: 9px; }
.annuity-stage { min-height: 265px; padding: 24px 12px; }
.annuity-digits { gap: 8px; }
.annuity-digits .ticket-digit { width: 54px; height: 68px; font-size: 36px; }
.annuity-direction { font-size: 12px; }
.annuity-entry { gap: 12px; margin: 16px 0 0; justify-content: flex-start; }
.annuity-entry label { font-size: 13px; color: #c1ccdf; }
.annuity-entry .input { width: 148px; height: 46px; letter-spacing: 7px; font-size: 21px; padding: 8px; }

/* Buildings, markets and workshop share the same panel edges and spacing. */
.property-panel, .market-panel, .recovery-panel { padding: 24px; background: var(--surface); }
.property-heading { gap: 16px; align-items: center; margin-bottom: 20px; }
.property-heading h2 { font-size: 24px; margin: 0; }
.property-heading p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.property-count { color: #e3cfa6; border-color: #e3cfa633; font-size: 12px; padding: 5px 9px; white-space: nowrap; }
.property-summary, .market-summary { gap: 12px; margin-bottom: 20px; }
.property-summary { padding: 0; border: 0; background: transparent; margin-top: 0; }
.property-summary>div+div { border-left: 0; padding: 14px 16px; }
.property-summary>div, .market-summary>div { background: #0f141f; border-color: var(--line); padding: 14px 16px; border-radius: 10px; }
.property-summary span, .market-summary span { font-size: 12px; color: var(--muted); }
.property-summary strong, .market-summary strong { font-size: 26px; }
.property-summary small, .market-summary small { font-size: 12px; }
.market-summary small { word-break: keep-all; overflow-wrap: anywhere; }
.property-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; align-items: stretch; }
.property-card { background: #111723; border-color: var(--line); border-radius: 12px; display: flex; flex-direction: column; }
.property-art { height: 130px; }
.property-art>.game-art { height: 118px; max-width: 170px; }
.property-owned { font-size: 11px; }
.property-card-body { padding: 16px 12px 12px; flex: 1; display: flex; flex-direction: column; }
.property-card h3 { font-size: 16px; min-height: 26px; }
.property-yield { font-size: 23px; margin: 6px 0 0; }
.property-yield span { display: block; font-size: 11px; margin: 0; color: var(--muted); }
.property-price { font-size: 12px; margin: 8px 0 14px; color: #b5c0d5; }
.property-actions, .property-actions.has-sale { display: grid; grid-template-columns: 1fr; grid-template-rows: repeat(2,38px); gap: 6px; margin-top: auto; }
.property-actions .button { min-height: 38px; padding: 7px 4px; font-size: 12px; }
.property-state { font-size: 11px; min-height: 20px; margin: 10px 0 0; }
.property-help { font-size: 12px; color: var(--muted); }
.market-panel { display: grid; grid-template-columns: minmax(0,1fr) minmax(250px,.9fr); gap: 20px; }
.market-panel>.property-heading, .market-summary, .market-help { grid-column: 1/-1; margin: 0; }
.market-list { margin: 0; align-self: start; gap: 10px; }
.market-item { grid-template-columns: 36px minmax(0,1fr) 85px; gap: 10px; padding: 14px 12px; border-color: var(--line); background: #101622; border-radius: 10px; }
.market-item.selected { border-color: var(--market-color); background: color-mix(in srgb,var(--market-color) 5%,#101622); }
.market-item .market-icon { width: 36px; height: 36px; font-size: 20px; }
.market-item .market-spark { grid-column: 2/-1; width: 100%; height: 42px; grid-row: 2; }
.market-identity strong { font-size: 14px; }
.market-identity small { font-size: 11px; color: #a4b1c8; }
.market-quote strong { font-size: 18px; }
.market-quote strong small, .market-quote em { font-size: 11px; }
.market-order { margin: 0; padding: 18px; background: #0f141f; border-color: var(--line); border-radius: 12px; align-self: start; }
.market-order-heading h3 { font-size: 22px; }
.market-current strong { font-size: 22px; }
.market-order-stats { font-size: 12px; }
.market-insight, .market-total, .market-help { font-size: 12px; color: var(--muted); }
.market-input-row { flex-wrap: wrap; }
.market-input-row .input { flex-basis: 100%; }
.market-input-row .quiet-button { flex: 1; min-height: 36px; font-size: 12px; }
.market-order-actions .button { min-height: 44px; }
.market-input-label { font-size: 13px; }
.market-help summary { cursor: pointer; color: #c7d1e1; padding: 3px 0; }
.market-help p { margin-top: 10px; line-height: 1.8; }
.workshop { max-width: 700px; margin: 0 auto; padding: 24px; background: #0f141f; border-color: var(--line); }
.work-guide, .work-invitation { font-size: 13px; color: #b7c3d8; }
.work-pay { font-size: 12px; color: var(--muted); }
.sort-stamp, .current-chip-label { font-size: 12px; }
.sort-bin b { font-size: 14px; }
.work-stats { margin: 16px 0 12px; font-size: 12px; }
.recovery-back, #cancel-work { font-size: 12px; }
.waiting-panel, .final-panel { background: var(--surface); padding: 32px; }
.waiting-panel>p:not(.eyebrow) { color: var(--muted); font-size: 14px; }
.waiting-panel>small { font-size: 12px; }
dialog { background: #171e2c; border-color: #ffffff24; border-radius: 16px; padding: 28px; }
dialog::backdrop { background: #040710bb; backdrop-filter: blur(5px); }
#rules-content { color: #bdc8da; font-size: 14px; line-height: 1.85; }

@media (min-width: 1440px) and (min-height: 900px) {
  body[data-screen="lobby"] .hero-grid { margin-top: 16px; }
  body[data-screen="lobby"] .entry-panel { padding: 16px 20px; }
  body[data-screen="lobby"] .entry-panel .eyebrow { display: none; }
  body[data-screen="lobby"] .lobby-player { margin: 8px 0; padding: 8px 0; }
  body[data-screen="lobby"] .room-browser { margin-top: 12px; padding-top: 10px; }
  body[data-screen="lobby"] .entry-foot { margin-top: 6px; }
  body[data-screen="lobby"] .race-how { margin-bottom: 16px; }
  body[data-screen="lobby"] .site-footer { margin-top: 16px; padding-bottom: 12px; }
}

@media (max-width: 1439px) {
  .catalog-grid, body[data-screen="lobby"] .catalog-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .room-layout { grid-template-columns: minmax(0,1fr) 220px; gap: 16px; }
  .arena { grid-template-columns: minmax(0,1fr) 230px; gap: 16px; padding: 18px; }
  .game-tab { padding: 7px 4px; gap: 5px; }
  .game-tab span { font-size: 11px; }
  .game-tab .game-art { width: 25px; height: 25px; }
  .table-console { padding: 14px; }
  .property-panel, .market-panel, .recovery-panel { padding: 20px; }
}
@media (max-width: 1179px) {
  .site-shell, body[data-screen="lobby"] .site-shell { padding: 0 24px; }
  .room-layout { grid-template-columns: minmax(0,1fr); }
  #room-side>aside { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .recent-feed { margin: 0; }
  .sidebar { margin: 0; }
  .arena { grid-template-columns: minmax(0,1fr) 264px; }
  .game-tab span { font-size: 12px; }
  .hero-grid, body[data-screen="lobby"] .hero-grid { grid-template-columns: minmax(0,1fr) 330px; }
  .hero-copy, body[data-screen="lobby"] .hero-copy { padding: 30px; }
}
@media (max-width: 899px) {
  .arena { grid-template-columns: minmax(0,1fr); }
  .table-console { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; }
  #table-description { grid-column: 1/-1; }
  .table-console #game-result { margin: 0; }
  .table-console #hand-timer { grid-column: 1/-1; }
  .game-tab { flex-direction: column; }
  .game-tabs { gap: 6px; }
  .game-tab span { font-size: 11px; }
  .hero-grid, body[data-screen="lobby"] .hero-grid { grid-template-columns: 1fr; }
  .hero-world, body[data-screen="lobby"] .hero-world { min-height: 310px; }
  .catalog-grid, body[data-screen="lobby"] .catalog-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .game-card, body[data-screen="lobby"] .game-card { grid-template-columns: minmax(0,1fr); }
  .game-card-art, body[data-screen="lobby"] .game-card-art { min-height: 95px; height: 95px; }
  .game-card-info, body[data-screen="lobby"] .game-card-info { padding: 0 14px 14px; align-self: start; }
  .game-card-info h3, body[data-screen="lobby"] .game-card-info h3 { font-size: 16px; }
  .property-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .market-panel { grid-template-columns: minmax(0,1fr); }
  .market-item { grid-template-columns: 40px minmax(0,1fr) 110px 100px; }
  .market-item .market-spark { grid-column: auto; grid-row: auto; }
  .bank-stats { gap: 18px; grid-template-columns: 1.1fr 1fr 64px; }
}
@media (max-width: 600px) {
  .site-shell, body[data-screen="lobby"] .site-shell { padding: 0 16px; }
  .site-header, body[data-screen="lobby"] .site-header { height: 66px; gap: 8px; }
  .brand { font-size: 17px; gap: 8px; }
  .brand-chip { width: 30px; height: 30px; font-size: 19px; border-width: 2px; }
  .brand b { font-size: 7px; letter-spacing: 2px; margin-top: 5px; }
  .header-right { gap: 4px; }
  .header-right .quiet-button { min-height: 34px; padding: 6px 7px; font-size: 10px; }
  .virtual-label { display: none; }
  .site-footer, body[data-screen="lobby"] .site-footer { font-size: 10px; margin-top: 20px; padding: 14px 0 20px; gap: 5px; flex-direction: column; }
  .entrance-main { min-height: calc(100svh - 66px); padding: 20px 0; }
  .entrance-world { height: 180px; }
  .entrance-checkin { padding: 26px; }
  .entrance-heading h1 { font-size: 28px; }
  .hero-grid, body[data-screen="lobby"] .hero-grid { gap: 14px; margin-top: 16px; }
  .hero-world, body[data-screen="lobby"] .hero-world { min-height: 300px; }
  .hero-copy, body[data-screen="lobby"] .hero-copy { padding: 26px 22px; }
  .hero-copy h1, body[data-screen="lobby"] .hero-copy h1 { font-size: 42px; }
  .hero-copy>p:not(.eyebrow), body[data-screen="lobby"] .hero-copy>p:not(.eyebrow) { font-size: 12px; }
  .hero-copy .eyebrow { font-size: 9px; }
  .race-how, body[data-screen="lobby"] .race-how { justify-content: space-between; padding: 12px 0; margin: 10px 0 18px; gap: 10px; align-items: start; }
  .race-how>div { align-items: flex-start; flex-direction: column; gap: 4px; flex: 1; }
  .race-how>i { display: none; }
  .race-how p { font-size: 10px; }
  .race-how b { font-size: 11px; }
  .section-heading h2, body[data-screen="lobby"] .section-heading h2 { font-size: 20px; }
  .game-count { font-size: 9px; letter-spacing: 1px; }
  .catalog-grid, body[data-screen="lobby"] .catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .game-card-info, body[data-screen="lobby"] .game-card-info { padding: 0 12px 12px; }
  .game-card-info h3, body[data-screen="lobby"] .game-card-info h3 { font-size: 15px; }
  .game-card-info p, body[data-screen="lobby"] .game-card-info p { font-size: 11px; }
  .game-card-tag, body[data-screen="lobby"] .game-card-tag { font-size: 9px; }
  .room-heading { padding: 16px 0 12px; }
  .room-heading h1 { font-size: 21px; }
  .room-heading .eyebrow { font-size: 9px; }
  .room-code .quiet-button { min-height: 34px; font-size: 12px; }
  .race-banner { display: grid; grid-template-columns: minmax(0,1fr); padding: 14px 16px; gap: 12px; margin-bottom: 14px; }
  .countdown-wrap { width: 100%; justify-content: space-between; gap: 10px; }
  .clock-icon { display: none; }
  .countdown-wrap>div { display: flex; width: 100%; justify-content: space-between; align-items: center; }
  .countdown-wrap small { font-size: 12px; }
  .countdown { font-size: 26px; }
  .bank-stats { display: grid; grid-template-columns: 1.1fr 1fr 50px; width: 100%; border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; gap: 8px; }
  .bank-stats b { font-size: 21px; }
  .bank-stats>div:nth-child(2) { border-left: 0; padding-left: 0; }
  .bank-stats>div>span { font-size: 10px; white-space: nowrap; }
  .bank-stats .game-art { width: 19px; height: 19px; margin-right: 5px; }
  .rank-stat { display: block; }
  .room-mode-bar { grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 12px; gap: 4px; }
  .room-mode-bar>button { min-height: 40px; font-size: 13px; flex-direction: row; padding: 6px; }
  .room-mode-bar>button>.income-tag { display: none; }
  .game-tabs, .casino-tabs { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; margin-bottom: 12px; }
  .game-tab { min-height: 64px; padding: 7px 2px; gap: 4px; }
  .game-tab .game-art { width: 27px; height: 27px; }
  .game-tab span { font-size: 11px; }
  .ticket-tabs .game-tab { padding: 9px 3px; }
  .ticket-tabs .game-tab span { font-size: 11px; }
  .arena { padding: 14px; gap: 14px; border-radius: 12px; }
  .arena-head { align-items: center; gap: 8px; }
  .arena-head h2 { font-size: 22px; }
  .arena-head .eyebrow { font-size: 9px; }
  .arena-meta>span { display: none; }
  .arena .quiet-button { font-size: 11px; min-height: 34px; }
  .table-console { display: flex; padding: 14px; gap: 14px; align-items: stretch; }
  .table-instruction { font-size: 12px; }
  .table-instruction strong { font-size: 13px; }
  .table-console #game-result { margin-top: 0; }
  .stake-presets button { min-height: 40px; font-size: 12px; }
  .result-bar { padding: 12px; grid-template-columns: minmax(0,1fr) auto; align-items: center; }
  .result-bar>strong { font-size: 23px; text-align: right; max-width: 125px; }
  .result-bar>strong small { display: block; }
  .play-stage, .slot-stage { min-height: 255px; }
  .paytable { font-size: 11px; }
  .paytable b { font-size: 11px; }
  .bet-option { font-size: 12px; min-height: 54px; }
  .bet-option small { font-size: 10px; }
  .ticket-status { font-size: 11px; padding: 10px; gap: 5px 12px; }
  .ticket-status>span:last-child { margin-left: 0; flex-basis: 100%; }
  .constellation-stage { min-height: 195px; padding: 16px 8px; }
  .ticket-heading strong { font-size: 16px; }
  .lottery-balls { gap: 7px; padding-top: 44px; }
  .lottery-ball { width: 40px; height: 40px; font-size: 19px; }
  .number-board.lottery-board { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 5px; }
  .lottery-board .number-cell { min-height: 40px; font-size: 14px; }
  .ticket-picker-head { font-size: 12px; }
  .ticket-purchase p b { display: inline; font-size: 20px; margin: 0 4px; }
  .scratch-stage { min-height: 300px; padding: 12px; }
  .scratch-card { padding: 14px 10px; }
  .scratch-card-heading strong { font-size: 18px; }
  .scratch-symbols { height: 50px; }
  .scratch-symbols>span { font-size: 27px; }
  .annuity-stage { min-height: 230px; padding: 18px 8px; }
  .annuity-digits { gap: 5px; }
  .annuity-digits .ticket-digit { width: 43px; height: 59px; font-size: 31px; }
  .annuity-entry { gap: 8px; flex-wrap: wrap; }
  .annuity-entry .input { width: 130px; height: 44px; font-size: 20px; letter-spacing: 6px; }
  #room-side>aside { display: block; }
  .recent-feed { margin-top: 12px; }
  .sidebar { padding: 16px; }
  .property-panel, .market-panel, .recovery-panel { padding: 16px; }
  .property-heading { gap: 8px; margin-bottom: 16px; align-items: flex-start; }
  .property-heading h2 { font-size: 22px; }
  .property-heading p { font-size: 12px; }
  .property-count { font-size: 10px; }
  .property-summary, .market-summary { gap: 8px; margin-bottom: 16px; }
  .property-summary>div, .market-summary>div { padding: 12px; }
  .property-summary>div+div { padding: 12px; }
  .property-summary span, .market-summary span { font-size: 11px; }
  .property-summary strong, .market-summary strong { font-size: 22px; }
  .property-grid { gap: 10px; }
  .property-art { height: 110px; }
  .property-art>.game-art { height: 95px; max-width: 125px; }
  .property-card-body { padding: 12px 10px; }
  .property-card h3 { font-size: 14px; }
  .property-yield { font-size: 21px; }
  .property-actions .button { font-size: 11px; }
  .property-state, .property-price { font-size: 11px; }
  .market-panel { gap: 16px; }
  .market-panel>.property-heading, .market-summary { margin: 0; }
  .market-item { grid-template-columns: 34px minmax(0,1fr) 84px; padding: 12px 10px; gap: 8px; }
  .market-item .market-spark { display: none; }
  .market-quote strong { font-size: 18px; }
  .market-identity strong { font-size: 14px; }
  .market-order { padding: 16px; }
  .market-order-heading h3, .market-current strong { font-size: 20px; }
  .market-help { font-size: 11px; }
  .workshop { padding: 16px 12px; }
  .workshop h3 { font-size: 23px; }
  .work-guide, .work-invitation { font-size: 12px; }
  .work-pay { font-size: 11px; }
  .sort-bin b { font-size: 12px; }
  .sort-stamp { font-size: 11px; letter-spacing: 0; }
  .waiting-panel, .final-panel { padding: 24px 16px; }
  .waiting-panel h2 { font-size: 27px; }
  dialog { padding: 24px 20px; }
}
@media (max-width: 359px) {
  .site-shell, body[data-screen="lobby"] .site-shell { padding: 0 10px; }
  .brand { font-size: 15px; }
  .brand-chip { width: 26px; height: 26px; font-size: 17px; }
  .header-right .quiet-button { font-size: 9px; padding: 5px; }
  .arena { padding: 12px; }
  .annuity-digits .ticket-digit { width: 37px; height: 54px; font-size: 28px; }
  .lottery-ball { width: 35px; height: 35px; font-size: 18px; }
  .lottery-balls { gap: 6px; }
  .property-panel, .market-panel, .recovery-panel { padding: 12px; }
  .property-card-body { padding: 10px 8px; }
  .property-card h3 { font-size: 13px; }
  .property-owned { font-size: 10px; }
  .annuity-entry { gap: 6px; }
  .annuity-entry label { font-size: 12px; }
  .annuity-entry .input { width: 115px; }
  .annuity-entry .quiet-button { padding: 6px; font-size: 10px; }
}
/* Keep each market's balance, trading result and dividends distinct. */
.market-summary-stock { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.market-summary-coin { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.market-summary .market-summary-note { display: block; margin: 7px 0 0; font-size: 11px; line-height: 1.5; color: var(--muted); }
.market-order-actions .button { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; min-width: 0; min-height: 64px; padding: 10px 8px; }
.market-order-actions .button span { font-size: 15px; font-weight: 800; }
.market-order-actions .button span small { font-size: 11px; font-weight: 500; }
.market-order-actions .button b { font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.market-order-actions .market-sell-button { border-color: #6488bb; color: #d9eaff; background: #18283d; }
.market-order-actions .market-sell-button:hover:not(:disabled) { background: #213856; }
.market-receipts { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.market-receipts h4 { margin: 0 0 8px; font-size: 12px; color: #c7d1e1; }
.market-receipts p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.market-receipts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.market-receipts li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.market-receipts li span { min-width: 0; }
.market-receipts li b { display: block; overflow-wrap: anywhere; }
.market-receipts li small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.market-receipts li strong { text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) {
  .market-summary-stock, .market-summary-coin { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-summary-coin>div:first-child { grid-column: auto; }
}

/* Values and ranking stay at the same snapshot until the outcome is revealed. */
.revealing-outcome #my-balance, .revealing-outcome .bank-stats>div:nth-child(2)>b,
.revealing-outcome .rank-stat b, .revealing-outcome .player-row.me .player-money { visibility: visible; }
.revealing-outcome .balance-stat::after, .revealing-outcome .player-row.me::after { display: none; }
.game-picker-toggle { display: none; }
.room-mode-bar>button:disabled { opacity: .4; }
.active-play-notice { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 12px; border: 1px solid #f0cc8835; border-radius: 10px; background: #27271f; }
.active-play-notice>div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 12px; }
.active-play-notice strong { font-size: 12px; color: #f3d59f; }
.active-play-notice span { font-size: 12px; color: #d2d9e5; font-variant-numeric: tabular-nums; }
.active-play-actions { display: flex; gap: 6px; flex-shrink: 0; }
.active-play-actions .button, .active-play-actions .quiet-button { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.lottery-receipt { padding: 12px; border: 1px solid #8fcdf730; border-radius: 9px; background: #14202d; }
.lottery-receipt h3 { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px; margin: 0 0 8px; font-size: 12px; }
.lottery-receipt h3 span { color: #f0cc88; font-size: 11px; }
.lottery-receipt dl { display: grid; gap: 6px; margin: 0; }
.lottery-receipt dl>div { display: flex; align-items: center; gap: 8px; }
.lottery-receipt dt { width: 48px; flex-shrink: 0; font-size: 11px; color: var(--muted); }
.lottery-receipt dd { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.lottery-receipt dd span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #273546; color: #d9e4ef; font-size: 11px; }
.lottery-receipt dd .matched { background: #f0cc88; color: #24201a; font-weight: 800; }
.lottery-receipt p { margin: 8px 0 0; font-size: 11px; color: #c7d7e5; }
#ticket-receipt:empty { display: none; }
dialog { max-height: min(85svh, 760px); overflow-y: auto; }

/* Compact markets keep the order and its asset visible together. */
.market-panel { padding: 18px; gap: 12px; }
.market-panel>.property-heading .eyebrow { display: none; }
.market-panel>.property-heading h2 { margin: 0; font-size: 24px; }
.market-panel>.property-heading p { margin: 4px 0 0; font-size: 12px; line-height: 1.5; }
.market-summary>div { padding: 8px 12px; }
.market-summary strong { font-size: 24px; }
.market-summary>div>span { font-size: 11px; }
.property-yield { margin-bottom: 12px; }
.property-summary>div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.property-summary strong { display: flex; align-items: baseline; gap: 4px; margin: 0; }
.property-summary strong small { display: inline; }
.market-summary .market-summary-note { margin-top: 4px; line-height: 1.4; }
.market-order { padding: 14px; }
.market-order-stats { padding: 10px 0; margin: 10px 0; }
.market-insight, .market-total { margin: 8px 0; }
.market-order-actions .button { min-height: 58px; }
.market-receipts { padding-top: 8px; margin-top: 10px; }
.market-receipts summary { cursor: pointer; font-size: 12px; color: #c7d1e1; padding: 2px 0; }
.market-receipts[open]>ul, .market-receipts[open]>p { margin-top: 10px; }
@media (min-width: 1180px) {
  .room-heading { padding: 12px 0; }
  .room-heading .eyebrow { display: none; }
  .race-banner { padding: 12px 20px; margin-bottom: 14px; }
  .room-mode-bar { margin-bottom: 12px; }
  .room-mode-bar>button { min-height: 38px; }
  .game-tabs, .casino-tabs { gap: 6px; margin-bottom: 12px; }
  .game-tab { min-height: 40px; padding: 6px; }
  .game-tab .game-art { width: 24px; height: 24px; }
  .arena-head .eyebrow { display: none; }
  .table-console .blackjack-explanation { padding: 8px 12px; line-height: 1.45; }
  .table-console .blackjack-explanation p, .table-console .blackjack-explanation small { margin-top: 3px; }

  .market-item { grid-template-columns: 36px minmax(0,1fr) 96px minmax(78px,auto); padding: 12px; min-height: 80px; }
  .market-item .market-spark { grid-column: auto; grid-row: auto; width: 96px; height: 38px; }
  .market-input-row { flex-wrap: nowrap; }
  .market-input-row .input { flex: 1 1 100px; width: 100px; }
  .market-input-row .quiet-button { flex: 0 1 auto; padding: 7px 9px; }
  .table-console { padding: 12px; gap: 8px; }
  .table-instruction strong { display: none; }
  .result-bar { padding: 10px; gap: 4px; }
  .result-bar p { margin: 0; font-size: 12px; }
  .result-bar>strong { font-size: 22px; }
  .pinball-cabinet .pinball-board { max-width: 308px; }
  .constellation-stage { min-height: 166px; padding: 12px 18px; }
  .lottery-balls { padding-top: 25px; min-height: 80px; }
  .number-board.lottery-board { grid-template-columns: repeat(12,minmax(0,1fr)); }
  .ticket-purchase p b { display: inline; font-size: 20px; margin: 0 4px; }
}
@media (max-width: 600px) {
  body[data-screen="room"] .site-header { height: 56px; }
  .room-heading { padding: 10px 0; }
  .room-heading .eyebrow { display: none; }
  .room-heading h1 { font-size: 18px; }
  .race-banner { grid-template-columns: 88px minmax(0,1fr); padding: 10px 12px; gap: 12px; margin-bottom: 10px; }
  .countdown { font-size: 22px; }
  .bank-stats { grid-template-columns: minmax(0,1fr) 34px; border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 12px; }
  .bank-stats>div:nth-child(2) { display: none; }
  .bank-stats .balance-stat b { font-size: 18px; }
  .countdown-wrap { gap: 5px; }
  .countdown-wrap { padding-bottom: 0; justify-content: flex-start; }
  .countdown-wrap>div { display: grid; gap: 0; }
  .countdown-wrap .clock-icon { display: none; }
  .countdown-wrap small { font-size: 10px; white-space: nowrap; }
  .bank-stats b { font-size: 18px; }
  .room-mode-bar { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 2px; padding: 4px; margin-bottom: 10px; }
  .room-mode-bar>button { font-size: 12px; padding: 6px 1px; min-height: 40px; }
  .room-mode-bar>button>span { display: none; }
  .game-picker { margin-bottom: 0; }
  .game-picker-toggle { display: flex; align-items: center; width: 100%; min-height: 42px; gap: 6px; padding: 4px 0; border-radius: 6px; border: 0; background: transparent; color: var(--text); text-align: left; }
  .game-picker-toggle .game-art { width: 24px; height: 24px; }
  .game-picker-toggle b { font-size: 13px; }
  .game-picker-toggle>span { margin-left: auto; color: var(--muted); font-size: 11px; }
  .game-picker .game-tabs { display: none; margin: 0 0 10px; }
  .game-picker.open .game-tabs { display: grid; }
  .arena-head { min-height: 40px; padding: 0; }
  .arena-head .eyebrow { display: none; }
  .arena-head h2 { display: none; }
  .arena-head>div:first-child { min-width: 0; }
  .game-picker-toggle b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .arena-meta { gap: 5px; flex-shrink: 0; }
  .wheel-wrap { width: 188px; height: 188px; }
  .roulette-stage { min-height: 208px; }
  .active-play-notice { padding: 8px 10px; gap: 6px; }
  .active-play-notice>div:first-child { display: grid; gap: 2px; }
  .active-play-notice strong, .active-play-notice span { font-size: 11px; }
  .active-play-actions .button, .active-play-actions .quiet-button { padding: 6px 7px; font-size: 11px; }
  #game-controls:not(:empty) { position: static; width: 100%; padding: 0; }
  #game-controls .stake-bar { display: grid; grid-template-columns: minmax(0,.85fr) minmax(135px,1.15fr); gap: 8px; margin: 0; }
  #game-controls .stake-control { grid-column: 1; grid-row: 1; min-height: 44px; }
  #game-controls .stake-control input { min-height: 44px; font-size: 18px; }
  #game-controls .stake-bar>.button { grid-column: 2; grid-row: 1; margin: 0; min-height: 44px; padding: 8px; font-size: 12px; }
  #game-controls .stake-presets { grid-column: 1/-1; grid-row: 2; }
  #game-controls .stake-presets button { min-height: 40px; }
  #game-controls .stake-help { display: none; }
  #game-controls .pending-note { min-height: 48px; margin: 0; }
  #game-controls .ticket-purchase { display: flex; align-items: center; gap: 12px; }
  #game-controls .ticket-purchase p { flex: 0 1 100px; margin: 0; font-size: 10px; }
  #game-controls .ticket-purchase p b { display: block; margin: 0; font-size: 16px; }
  #game-controls .ticket-purchase .button { flex: 1; min-width: 0; font-size: 13px; }
  #game-controls .button-row { margin: 0; }
  #game-controls .spectator { margin: 0; padding: 10px; }
  #game-controls .spectator p { display: none; }
  #game-controls .spectator .button { margin-top: 8px; }
  .table-console:has(#game-result:empty):has(#ticket-receipt:empty) { padding: 12px; }
  .table-console #hand-timer:has(.hand-clock) { display: none; }
  .market-panel { padding: 12px; gap: 10px; }
  .market-panel>.property-heading h2 { font-size: 20px; }
  .market-panel>.property-heading p { font-size: 11px; }
  .market-summary { gap: 0 12px; padding: 4px 0; border-block: 1px solid var(--line); }
  .market-summary>div { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 4px 0; border: 0; background: transparent; min-width: 0; }
  .market-summary>div>span { font-size: 10px; white-space: nowrap; }
  .market-summary strong { font-size: 16px; line-height: 1.3; margin: 0; overflow-wrap: anywhere; text-align: right; }
  .market-summary strong small { font-size: 9px; }
  .market-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .market-list .market-item { grid-template-columns: minmax(0,1fr); gap: 6px; min-height: 104px; padding: 10px 6px; text-align: left; align-content: start; }
  .market-item .market-icon, .market-item .market-spark { display: none; }
  .market-item .market-signal { display: block; min-height: 26px; white-space: normal; overflow: visible; text-overflow: clip; word-break: keep-all; font-size: 9px; line-height: 1.4; }
  .market-identity strong { font-size: 12px; overflow-wrap: anywhere; }
  .market-identity small { font-size: 10px; }
  .market-item .market-quote { text-align: left; }
  .market-quote strong { font-size: 17px; overflow-wrap: anywhere; }
  .market-quote em, .market-quote strong small { font-size: 10px; }
  .market-order { padding: 12px; }
  .market-order-heading h3, .market-current strong { font-size: 18px; }
  .market-order-heading .market-icon { width: 30px; height: 30px; }
  .market-order-stats { padding: 8px 0; margin: 8px 0; font-size: 10px; }
  .market-order-stats b { font-size: 12px; }
  .market-input-row { display: grid; grid-template-columns: minmax(70px,.8fr) minmax(0,1fr) minmax(0,1fr); gap: 5px; }
  .market-input-row .input { width: 100%; min-width: 0; height: 44px; font-size: 18px; }
  .market-input-row .quiet-button { min-height: 44px; padding: 5px; font-size: 10px; }
  .market-total { font-size: 10px; margin: 6px 0; }
  .market-order-actions .button { min-height: 54px; padding: 8px 5px; }
  .market-receipts { margin-top: 8px; padding-top: 8px; }
  .property-panel>.property-heading { margin-bottom: 10px; }
  .property-summary { margin-bottom: 12px; padding: 0; border: 0; background: transparent; }
  .property-summary>div { flex-direction: column; gap: 5px; padding: 10px; }
  .property-summary>div+div { padding-left: 10px; border-left: 0; }
  .property-summary strong { font-size: 22px; }
  .property-art { min-height: 0; height: 100px; }
  .property-art>.game-art { max-height: 88px; }
  .property-actions { margin-top: 10px; }
  #toast { z-index: 40; bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* Outcomes share the same console on every screen size. */
#boot-loading { text-align: center; }
.boot-retry { display: inline-flex; visibility: hidden; margin-top: 12px; text-decoration: none; animation: show-boot-retry 1ms 8s forwards; }
@keyframes show-boot-retry { to { visibility: visible; } }
.final-settlements { margin: 18px auto; padding: 12px 16px; max-width: 620px; border: 1px solid var(--line); border-radius: 10px; background: #122138; }
.final-settlements p { margin: 4px 0; font-size: 12px; color: var(--muted); }
body[data-screen="room"][data-phase="finished"] .room-layout { grid-template-columns: minmax(0,1fr); }
body[data-screen="room"][data-phase="finished"] #room-side { display: none; }
body[data-screen="room"][data-phase="finished"] .final-panel { width: 100%; max-width: 940px; margin: 0 auto; }

@media (min-width: 1180px) {
  .property-panel { padding: 18px; }
  .property-panel>.property-heading { margin-bottom: 14px; }
  .property-panel>.property-heading p { margin: 4px 0 0; font-size: 12px; }
  .property-summary { padding: 0; border: 0; background: transparent; margin: 0 0 16px; }
  .property-summary>div+div { border-left: 0; padding-left: 16px; }
  .recovery-panel { padding: 18px; }
  .recovery-panel .property-heading { margin-bottom: 14px; }
  .recovery-panel .property-heading h2 { margin: 0; font-size: 24px; }
  .recovery-panel .property-heading p { margin: 4px 0 0; font-size: 12px; }
  .workshop { padding: 16px 24px; }
  .workshop-heading .eyebrow { display: none; }
  .workshop h3 { margin: 0; font-size: 22px; }
  .work-guide { margin: 8px 0; }
  .work-stats { margin: 10px 0; padding: 10px 14px; }
  .sort-table { padding: 5px 0 12px; gap: 9px; }
  .current-chip { padding: 3px 0 6px; }
  .current-chip .sort-chip { width: 76px; height: 76px; }
  .workshop .sort-bins .sort-bin { min-height: 80px; padding: 7px 6px; }
  .workshop #cancel-work { margin-top: 12px; }
  .work-pay { margin-top: 10px; }
  .recovery-back { margin-top: 12px; }
}
@media (max-width: 600px) {
  html { scroll-padding-block: 12px; }
  .final-panel { padding: 24px 14px; }
  .winner-amount { font-size: clamp(28px, 8vw, 42px); overflow-wrap: anywhere; }
}

/* Team colors have original emblems, written names and stable numbered cards. */
#create-teams { margin: 18px 0; padding: 0; border: 0; min-width: 0; }
#create-teams[hidden] { display: none; }
#create-teams legend { margin-bottom: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.team-emblem { display: inline-flex; position: relative; align-items: center; justify-content: center; flex: 0 0 auto; width: 32px; height: 32px; border: 1px solid color-mix(in srgb,var(--team-color) 42%,transparent); border-radius: 10px; color: var(--team-color); background: linear-gradient(145deg,color-mix(in srgb,var(--team-color) 22%,#152239),#142139); box-shadow: inset 0 1px 0 #ffffff16; }
.team-emblem svg { display: block; width: 76%; height: 76%; fill: currentColor; overflow: visible; }
.team-mark-line { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.team-mark-detail { fill: #152239; opacity: .7; }
.team-color-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
.team-color-option { display: flex; position: relative; align-items: center; justify-content: center; flex-direction: column; gap: 7px; min-width: 0; min-height: 78px; padding: 11px 5px 8px; border: 1px solid var(--line); border-radius: 10px; background: #152239; font-size: 12px; cursor: pointer; }
.team-color-option input { position: absolute; top: 6px; right: 6px; margin: 0; width: 14px; height: 14px; accent-color: var(--team-color); }
.team-color-option:has(input:checked) { border-color: var(--team-color); background: linear-gradient(145deg,color-mix(in srgb,var(--team-color) 16%,#152239),#152239); }
.team-color-option:has(input:checked)>span:last-child { color: var(--team-color); font-weight: 800; }
.team-create-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.team-waiting { position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 0,#648aca15,transparent 60%),var(--surface); }
.team-waiting .eyebrow { color: var(--gold); }
.team-choice-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 22px auto 12px; max-width: min(1020px,calc(var(--team-columns,5) * 192px + (var(--team-columns,5) - 1) * 12px)); text-align: left; font-size: 13px; }
.team-choice-heading span { color: var(--muted); }
.team-choice-grid { display: grid; grid-template-columns: repeat(var(--team-columns,5),minmax(0,1fr)); gap: 12px; margin: 0 auto 22px; max-width: min(1020px,calc(var(--team-columns,5) * 192px + (var(--team-columns,5) - 1) * 12px)); }
.team-choice { display: flex; position: relative; min-width: 0; min-height: 130px; align-items: center; justify-content: center; flex-direction: column; gap: 8px; padding: 16px 10px 12px; border: 1px solid color-mix(in srgb,var(--team-color) 24%,transparent); border-radius: 14px; background: radial-gradient(ellipse at 50% 0,color-mix(in srgb,var(--team-color) 12%,transparent),transparent 80%),#142139; color: var(--text); cursor: pointer; transition: border-color .15s,background-color .15s; }
.team-choice::after { content: ''; position: absolute; height: 3px; width: 34px; bottom: 0; left: 50%; transform: translateX(-50%); background: var(--team-color); opacity: .55; border-radius: 3px 3px 0 0; }
.team-choice .team-emblem { width: 50px; height: 50px; border-radius: 15px; }
.team-choice-number { position: absolute; left: 12px; top: 10px; color: var(--team-color); opacity: .75; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.team-choice-check { position: absolute; right: 10px; top: 8px; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--team-color); color: #122038; font-weight: 900; font-size: 12px; visibility: hidden; }
.team-choice strong { font-size: 14px; line-height: 1.25; white-space: nowrap; }
.team-choice small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.team-choice:hover:not(:disabled),.team-choice.selected { border-color: var(--team-color); background: radial-gradient(ellipse at 50% 0,color-mix(in srgb,var(--team-color) 23%,transparent),transparent 85%),#17263c; }
.team-choice.selected { box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--team-color) 25%,transparent); }
.team-choice.selected .team-choice-check { visibility: visible; }
.team-choice.selected strong,.team-choice.selected small { color: var(--team-color); }
.team-choice:focus-visible,.team-color-option:focus-within { outline: 2px solid var(--team-color); outline-offset: 3px; }
.team-standing { padding: 8px; margin: 5px 0; border: 1px solid transparent; border-radius: 9px; background: linear-gradient(100deg,color-mix(in srgb,var(--team-color) 8%,transparent),transparent),#142139; }
.team-standing-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.team-standing-rank { flex: 0 0 23px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.team-standing-rank small { font-size: 9px; margin-left: 2px; font-weight: 400; }
.team-standing .team-emblem { width: 27px; height: 27px; border-radius: 8px; }
.team-standing-name { flex: 1; min-width: 0; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-standing-head strong { flex-shrink: 0; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.team-standing-head strong small { margin-left: 3px; font-size: 9px; color: var(--muted); font-weight: 400; }
.team-mine-tag { display: inline-block; margin-left: 5px; color: var(--team-color); font-size: 9px; font-weight: 500; }
.team-leader-tag { display: block; width: fit-content; margin-top: 3px; color: var(--gold); font-size: 9px; font-weight: 500; }
.team-standing.my-team { border-color: color-mix(in srgb,var(--team-color) 40%,transparent); }
.team-standing.leader { padding-block: 11px; border-color: #ebd19b60; background: radial-gradient(ellipse at 0 0,color-mix(in srgb,var(--team-color) 16%,transparent),transparent 85%),#1e2a3f; }
.team-standing.leader .team-emblem { width: 34px; height: 34px; }
.team-standing.leader .team-standing-rank { color: #ffe4a6; font-size: 16px; }
.team-standing.leader .team-standing-head strong { color: #ffe4a6; font-size: 15px; }
.team-members { margin: 7px 0 0 30px; color: var(--muted); font-size: 11px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-banner.team-race-banner { border-color: color-mix(in srgb,var(--team-color) 36%,transparent); background: linear-gradient(110deg,color-mix(in srgb,var(--team-color) 8%,transparent),transparent 60%),var(--surface); }
.team-race-banner .balance-label { display: flex; align-items: center; gap: 7px; color: var(--team-color); }
.team-race-banner .balance-label .team-emblem { width: 22px; height: 22px; border-radius: 7px; }
.team-race-banner .balance-label>span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-race-banner .race-progress i { background: var(--team-color); }
.champion-card.team-champion { border-color: color-mix(in srgb,var(--team-color) 55%,var(--gold)); background: radial-gradient(ellipse at 50% 20%,color-mix(in srgb,var(--team-color) 16%,transparent),transparent 70%),#142137; }
.team-champion .champion-crown { font-size: 32px; margin-bottom: 10px; }
.team-champion>.team-emblem { width: 74px; height: 74px; border-radius: 22px; }
.team-champion h2 { color: var(--team-color); }
.final-row.team-final-row { border-left: 2px solid var(--team-color); }
.team-final-row .final-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.team-final-row .team-emblem { width: 24px; height: 24px; border-radius: 7px; }
.team-final-row .final-name-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-final-row .final-name small { flex-shrink: 0; margin-left: 0; color: var(--team-color); }
.team-waiting .waiting-note { font-size: 12px; }
@media(min-width:1920px) { .team-standing-name,.team-standing-head strong { font-size: clamp(12px,.65vw,16px); } }
@media(max-width:1000px) { .team-standing-head { gap: 5px; } .team-standing .team-emblem { width: 24px; height: 24px; } .team-mine-tag { display: block; margin-left: 0; margin-top: 2px; } }
@media(max-width:800px) { .team-choice-grid { grid-template-columns: repeat(min(var(--team-columns,3),3),minmax(0,1fr)); } }
@media(max-width:600px) {
  #create-dialog { max-height: calc(100dvh - 32px); padding: 22px 20px; }
  .team-color-grid { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; }
  .team-color-option { padding: 22px 3px 8px; min-height: 78px; gap: 5px; font-size: 11px; }
  .team-color-option input { top: 5px; right: 5px; width: 13px; height: 13px; }
  .team-color-option .team-emblem { width: 26px; height: 26px; border-radius: 8px; }
  .team-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .team-choice { min-height: 112px; padding: 13px 8px 11px; }
  .team-choice .team-emblem { width: 40px; height: 40px; border-radius: 12px; }
  .team-choice strong { font-size: 13px; }
  .team-choice-number { left: 10px; top: 9px; font-size: 10px; }
  .team-waiting { text-align: left; }
  .team-choice-heading { font-size: 12px; }
  .team-race-banner .balance-label { gap: 4px; font-size: 10px; }
  .team-race-banner .balance-label .team-emblem { width: 17px; height: 17px; border-radius: 5px; }
  .team-standing-head { gap: 7px; }
  .team-mine-tag { display: inline-block; margin: 0 0 0 5px; }
  .team-final-row .final-name { gap: 4px; }
  .team-final-row .team-emblem { width: 20px; height: 20px; border-radius: 6px; }
  .team-final-row .final-name small { display: none; }
  #create-form .input { font-size: 16px; }
}
@media(prefers-reduced-motion:reduce) { .team-choice { transition: none; } }
/* Mode navigation is available in the lobby; live controls keep their existing space. */
body[data-screen="room"] #arena-mode-link { display: none; }
@media(max-width:600px) { #arena-mode-link { font-size:10px; padding:7px 8px; } }

/* Shared room creation: descriptions stay inside the scrollable dialog. */
#create-dialog .create-mode-note { margin: 10px 0 16px; font-size: 12px; line-height: 1.65; color: var(--muted); overflow-wrap: anywhere; }
#game-visual .pinball-paytable { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 8px; }
#game-visual .pinball-paytable > span { margin: 0; color: inherit; }
#game-visual .pinball-paytable > i { font-style: normal; }
@media (max-width: 600px) {
  #game-visual .pinball-paytable { flex-direction: column; align-items: center; line-height: 1.6; }
  #game-visual .pinball-paytable > i { display: none; }
}
