@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;650;700;750;800&display=swap');

:root {
  color-scheme: dark;
  --paper: #181b1a;
  --paper-deep: #242a27;
  --white: #202522;
  --ink: #ecede7;
  --muted: #939d95;
  --secondary: #b0b9b0;
  --line: #353d37;
  --accent: #ed603c;
  --accent-hover: #d94d2a;
  --accent-soft: #39271f;
  --olive: #afbea0;
  --selected-text: #d1d9c5;
  --market: #161a19;
  --market-line: #2b322e;
  --market-text: #ecede7;
  --market-muted: #8c9991;
  --market-secondary: #b0bcb2;
  --market-icon: #282f29;
  --market-strip: #1c211e;
  --market-loading: #161a19eb;
  --green: #83bba0;
  --green-soft: #23372d;
  --red: #e58e76;
  --down-soft: #3b2823;
  --up-border: #628c73;
  --down-border: #ab6956;
  --button-text: #fff9f4;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --sans: 'Manrope', Arial, sans-serif;
}
:root[data-theme='light'] {
  color-scheme: light;
  --paper: #f5f4ef;
  --paper-deep: #eeeee6;
  --white: #fcfcf8;
  --ink: #202420;
  --muted: #72786f;
  --secondary: #646b62;
  --line: #dedfd6;
  --accent-soft: #fbe8df;
  --olive: #343c2d;
  --market: #fcfcf8;
  --market-line: #e1e5dc;
  --market-text: #202b23;
  --market-muted: #718076;
  --market-secondary: #526658;
  --market-icon: #e9eee5;
  --market-strip: #f0f3eb;
  --market-loading: #fcfcf8eb;
  --green: #387a5e;
  --green-soft: #e4ede5;
  --red: #b1543e;
  --down-soft: #f9e7df;
  --up-border: #78916e;
  --down-border: #ce8d76;
}
:root[data-theme='dark'] { --selected-text: #273322; }


*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, select { min-width: 0; }
button, input, select { border-radius: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex-shrink: 0; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
button, a, input, select { touch-action: manipulation; }
button { border: 0; background: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
::selection { background: #ed603c2b; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.positive, .up { color: var(--green); }
.negative, .down { color: var(--red); }

.app-shell, .shell { width: min(100% - 104px, 1440px); margin-inline: auto; }
.site-header { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 28px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; font-size: 23px; font-weight: 800; line-height: 1; letter-spacing: -1.1px; }
.brand svg { width: 27px; height: 32px; }
.brand-mark { color: var(--accent); }
.brand-dot { color: var(--accent); }
.header-nav { display: flex; align-items: center; gap: 30px; }
.header-nav a, .nav-link { font-size: 12px; font-weight: 650; color: var(--secondary); transition: color 160ms ease; }
.header-nav a:hover, .nav-link:hover { color: var(--accent); }
.header-meta, .header-tag { color: var(--muted); font-size: 10px; letter-spacing: .08em; font-family: var(--mono); }
.header-status { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--secondary); font-family: var(--mono); }
.status-dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--green); }

.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 41px 0 31px; }
.eyebrow { font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.intro h1 { font-size: clamp(42px, 4.25vw, 64px); font-weight: 650; line-height: 1.1; letter-spacing: -.065em; }
.intro h1 em { font-style: normal; color: var(--accent); }
.intro h1 span { color: var(--accent); }
.intro .eyebrow { margin-bottom: 14px; }
.intro-copy { max-width: 300px; padding-bottom: 5px; color: var(--secondary); font-size: 12px; line-height: 1.85; }
.intro-copy p + p { margin-top: 4px; }

.mode-row, .mode-selector { display: flex; align-items: stretch; justify-content: space-between; min-height: 88px; border-top: 1px solid var(--line); gap: 20px; }
.mode-tabs { display: flex; align-items: stretch; gap: 34px; }
.mode-tab { display: flex; align-items: center; gap: 13px; padding: 18px 0 21px; position: relative; text-align: left; color: var(--muted); transition: color 160ms ease; }
.mode-tab::after { position: absolute; content: ''; height: 2px; background: var(--accent); bottom: 0; left: 0; right: 0; transform: scaleX(0); transform-origin: left; transition: transform 220ms ease; }
.mode-tab:hover { color: var(--ink); }
.mode-tab[aria-selected='true'], .mode-tab.active { color: var(--ink); }
.mode-tab[aria-selected='true']::after, .mode-tab.active::after { transform: scaleX(1); }
.mode-tab svg { width: 22px; height: 22px; }
.mode-tab strong { display: block; font-size: 15px; font-weight: 750; letter-spacing: -.025em; }
.mode-tab small { display: block; font-size: 10px; font-weight: 400; margin-top: 2px; color: var(--muted); }
.mode-hint, .mode-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 326px; align-items: stretch; min-width: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.market-panel { background: var(--market); color: var(--market-text); min-width: 0; display: flex; flex-direction: column; }
.market-header, .chart-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 26px 20px; border-bottom: 1px solid var(--market-line); }
.market-title { display: flex; align-items: center; gap: 10px; }
.market-title h2 { font-size: 14px; font-weight: 650; letter-spacing: -.02em; }
.market-title p, .market-subtitle { color: var(--market-muted); font-size: 10px; margin-top: 3px; }
.market-symbol { width: 30px; height: 30px; display: grid; place-items: center; color: var(--market-secondary); background: var(--market-icon); border-radius: 50%; font: 15px var(--mono); }
.market-meta { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.market-badge, .market-tag { color: var(--market-secondary); font: 9px var(--mono); letter-spacing: .035em; padding: 5px 7px; border: 1px solid var(--market-line); border-radius: 3px; white-space: nowrap; }
.market-badge.live, .market-tag.accent { color: #dd9278; border-color: #614334; }
.market-stats, .chart-stats { display: flex; align-items: center; gap: 34px; padding: 18px 26px 12px; }
.market-stats > div, .chart-stats > div { min-width: 0; }
.market-stats small, .chart-stats small { display: block; color: var(--market-muted); font-size: 9px; margin-bottom: 5px; }
.market-stats strong, .chart-stats strong { display: block; font-family: var(--mono); font-size: 14px; font-weight: 400; font-variant-numeric: tabular-nums; }
.chart-surface { position: relative; height: 305px; min-height: 260px; flex: 1 0 305px; overflow: hidden; }
.chart-surface canvas { display: block; width: 100%; height: 100%; }
.chart-footer, .market-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 26px; min-height: 51px; border-top: 1px solid var(--market-line); color: var(--market-muted); font-size: 10px; }
.chart-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 17px; }
.chart-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #72b8a0; }
.legend-dot.orange { background: var(--accent); }
.legend-line { display: inline-block; width: 14px; border-top: 1px dashed #87968b; }
.chart-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; z-index: 4; background: var(--market-loading); color: var(--market-secondary); font-size: 12px; backdrop-filter: blur(3px); }
.loading-spinner, .spinner { width: 22px; height: 22px; border: 2px solid #465047; border-top-color: var(--accent); border-radius: 50%; animation: spin 800ms linear infinite; }

.control-panel, .controls-panel { min-width: 0; padding: 24px; display: flex; flex-direction: column; background: var(--paper); }
.control-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 21px; }
.control-heading h2, .controls-panel h2, .control-panel h2 { font-size: 17px; font-weight: 750; letter-spacing: -.04em; line-height: 1.3; }
.panel-step, .step-count { font: 10px var(--mono); color: var(--muted); }
.field { display: block; margin-bottom: 17px; }
.field-label, .field > label, label.field > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 10px; font-weight: 650; color: var(--secondary); }
.field-label span { font-weight: 400; color: var(--muted); }
.text-input, .field input[type='text'], .field input[type='number'], .field select { display: block; width: 100%; min-height: 39px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--ink); font-size: 12px; transition: border-color 160ms ease, background 160ms ease; }
.text-input::placeholder, input::placeholder { color: #a0a499; }
.text-input:hover, .field input:hover, .field select:hover { border-color: #bbc0b1; }
.text-input:focus, .field input:focus, .field select:focus { outline: none; border-color: var(--accent); background: var(--white); }
.segmented { display: flex; align-items: stretch; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 4px; }
.segmented button { flex: 1; min-width: 0; min-height: 31px; padding: 6px 5px; border-radius: 2px; color: var(--secondary); font-size: 10px; font-weight: 600; transition: background 160ms ease, color 160ms ease; }
.segmented button:hover { background: var(--paper-deep); color: var(--ink); }
.segmented button.active, .segmented button[aria-pressed='true'], .segmented button[aria-selected='true'] { color: #f5f6ee; background: var(--olive); }
.segmented button:disabled { opacity: .5; }
.field-help { margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.primary-button, .primary-btn { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 15px 16px; min-height: 48px; border: 1px solid var(--accent); border-radius: 3px; color: white; background: var(--accent); font-size: 12px; font-weight: 750; transition: background 180ms ease, border-color 180ms ease, transform 180ms ease; }
.primary-button:hover:not(:disabled), .primary-btn:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.primary-button svg, .primary-btn svg { width: 17px; height: 17px; transition: transform 180ms ease; }
.primary-button:hover:not(:disabled) svg, .primary-btn:hover:not(:disabled) svg { transform: translateX(3px); }
.primary-button:active:not(:disabled), .primary-btn:active:not(:disabled) { transform: translateY(1px); }
.primary-button:disabled, .primary-btn:disabled { opacity: .5; }
.secondary-button, .secondary-btn { width: 100%; min-height: 39px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 3px; color: var(--secondary); font-size: 11px; font-weight: 600; transition: background 160ms ease, border-color 160ms ease; }
.secondary-button:hover, .secondary-btn:hover { background: var(--paper-deep); border-color: #c4c8ba; }
.text-button, .text-btn { padding: 4px 0; color: var(--secondary); font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover, .text-btn:hover { color: var(--accent); }
.control-note, .setup-note { margin-top: 12px; color: var(--muted); text-align: center; font-size: 9px; line-height: 1.6; }
.control-divider { height: 1px; border: 0; background: var(--line); margin: 19px 0; }

input[type='range'] { display: block; width: 100%; height: 18px; margin: 12px 0 5px; padding: 0; background: transparent; accent-color: var(--accent); appearance: none; cursor: pointer; touch-action: none; }
input[type='range']::-webkit-slider-runnable-track { height: 3px; background: var(--line); border-radius: 3px; }
input[type='range']::-webkit-slider-thumb { appearance: none; height: 14px; width: 14px; margin-top: -5.5px; border: 3px solid var(--paper); border-radius: 50%; background: var(--accent); outline: 1px solid var(--accent); }
input[type='range']::-moz-range-track { height: 3px; background: var(--line); border-radius: 3px; }
input[type='range']::-moz-range-thumb { height: 10px; width: 10px; border: 3px solid var(--paper); border-radius: 50%; background: var(--accent); outline: 1px solid var(--accent); }
.range-labels { display: flex; justify-content: space-between; font: 9px var(--mono); color: var(--muted); }
.guess-value { font: 36px var(--mono); letter-spacing: -.06em; color: var(--accent); line-height: 1.25; margin-bottom: 11px; }
.guess-input-row { display: flex; align-items: center; gap: 9px; }
.guess-input-row input { min-width: 0; flex: 1; }
.guess-input-row button { width: 35px; height: 38px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 3px; font-family: var(--mono); }
.round-progress { display: flex; gap: 4px; margin-top: 16px; }
.round-progress span { height: 3px; flex: 1; background: var(--line); }
.round-progress .done { background: var(--olive); }
.round-progress .current { background: var(--accent); }
.session-stats, .result-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 19px; }
.session-stats span, .result-stats span { display: block; color: var(--muted); font-size: 9px; margin-bottom: 5px; }
.session-stats strong, .result-stats strong { font: 16px var(--mono); }
.result-summary { padding: 16px 0 20px; animation: fade-up 300ms ease both; }
.result-summary h3 { font-size: 19px; line-height: 1.35; letter-spacing: -.03em; margin: 6px 0; }
.result-summary p { font-size: 11px; color: var(--secondary); line-height: 1.8; }
.result-score { margin: 14px 0; font: 38px var(--mono); letter-spacing: -.06em; }
.result-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; background: var(--green-soft); color: var(--green); border-radius: 3px; font-size: 9px; font-weight: 650; }
.result-badge.negative { background: var(--accent-soft); color: var(--red); }
.error-message, .error-banner { padding: 10px 12px; border: 1px solid var(--down-border); background: var(--down-soft); color: var(--red); font-size: 11px; line-height: 1.6; border-radius: 3px; margin-bottom: 14px; }

.below-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 326px; gap: 36px; padding: 39px 0 34px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.section-heading h2 { font-size: 18px; font-weight: 750; letter-spacing: -.04em; }
.section-heading .eyebrow { font-size: 9px; }
.leaderboard-filters { display: flex; gap: 6px; }
.leaderboard-filters button { padding: 5px 9px; color: var(--muted); font-size: 10px; border-radius: 3px; }
.leaderboard-filters button.active, .leaderboard-filters button[aria-pressed='true'] { color: var(--ink); background: var(--paper-deep); }
.leaderboard-filters button:hover { color: var(--ink); }
.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.leaderboard-table th { text-align: left; color: var(--muted); font-size: 9px; font-weight: 400; padding: 10px 9px; border-bottom: 1px solid var(--line); }
.leaderboard-table td { padding: 12px 9px; border-bottom: 1px solid var(--line); }
.leaderboard-table th:first-child, .leaderboard-table td:first-child { padding-left: 0; width: 40px; color: var(--muted); font-family: var(--mono); }
.leaderboard-table th:last-child, .leaderboard-table td:last-child { padding-right: 0; text-align: right; }
.leaderboard-table td:not(:nth-child(2)) { font-family: var(--mono); }
.leaderboard-empty { color: var(--muted); text-align: center; padding: 25px 10px !important; font-family: var(--sans) !important; }
.rules ol { margin: 0; padding: 0; list-style: none; counter-reset: rule; }
.rules li { display: grid; grid-template-columns: 23px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--secondary); font-size: 11px; line-height: 1.75; counter-increment: rule; }
.rules li::before { content: '0' counter(rule); font-family: var(--mono); font-size: 9px; color: var(--accent); padding-top: 2px; }
.rules li strong { display: block; color: var(--ink); font-size: 11px; font-weight: 650; margin-bottom: 2px; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 21px 0 25px; border-top: 1px solid var(--line); font-size: 9px; color: var(--muted); }
.site-footer .footer-brand { color: var(--secondary); font-weight: 750; font-size: 11px; letter-spacing: -.02em; }
.site-footer p { max-width: 460px; text-align: right; }

dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100svh - 48px); overflow: auto; padding: 30px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 7px; }
dialog::backdrop { background: #10161080; backdrop-filter: blur(5px); }
dialog[open] { animation: dialog-in 220ms cubic-bezier(.2, .8, .2, 1); }
.dialog-close { position: absolute; top: 16px; right: 16px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; padding: 0; line-height: 1; color: var(--secondary); }
.dialog-close svg { width: 14px; height: 14px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.dialog-close:hover { background: var(--paper-deep); }
dialog h2 { font-size: 31px; font-weight: 650; letter-spacing: -.06em; line-height: 1.2; margin: 16px 0 10px; }
dialog > p, .dialog-description { color: var(--secondary); font-size: 12px; line-height: 1.8; }
.dialog-score { font: 54px var(--mono); letter-spacing: -.07em; margin: 22px 0; }
.dialog-actions { display: grid; gap: 9px; margin-top: 22px; }
.dialog-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 18px 0; border-block: 1px solid var(--line); }
.dialog-stats small { display: block; color: var(--muted); margin-bottom: 6px; font-size: 10px; }
.dialog-stats strong { font: 20px var(--mono); }

.page-width { width: min(100% - 104px, 1440px); margin-inline: auto; }
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 50; padding: 10px 14px; background: var(--ink); color: var(--paper); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.site-header { padding-inline: max(52px, calc((100vw - 1440px) / 2)); }
.brand-symbol { display: grid; place-items: center; width: 29px; height: 29px; color: var(--paper); background: var(--accent); border-radius: 3px; font-size: 25px; font-weight: 400; line-height: 1; letter-spacing: -1px; }
.brand-dot { font-size: 10px; color: var(--muted); align-self: flex-start; margin: 0 0 0 -5px; }
.site-header nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.site-header nav a, .site-header nav button { display: inline-flex; align-items: center; line-height: 1; white-space: nowrap; position: relative; padding: 8px 0; font-size: 11px; font-weight: 600; color: var(--secondary); transition: color 160ms ease; }
.site-header nav a:hover, .site-header nav button:hover { color: var(--accent); }
.site-header nav .nav-active { color: var(--ink); }
.nav-active::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); position: absolute; left: calc(50% - 2px); bottom: -5px; }
.site-header nav button span { display: inline-block; margin-left: 3px; font-size: 13px; }
.practice-label { display: flex; align-items: center; gap: 7px; font-size: 9px; color: var(--secondary); }
.practice-label i, .under-workspace i { width: 5px; height: 5px; border-radius: 50%; background: #6c8060; }
.tiny-cross { color: var(--accent); margin-right: 7px; font-size: 14px; vertical-align: -1px; }
.intro h1 { display: flex; align-items: center; gap: .23em; white-space: nowrap; }
.intro h1 svg { width: 49px; height: 49px; stroke: var(--accent); stroke-width: 2.1; fill: none; margin-left: 16px; }
.intro > p { color: var(--secondary); font-size: 11px; line-height: 1.95; margin-bottom: 4px; max-width: 293px; }
.mode-bar { display: flex; align-items: stretch; min-height: 94px; border-top: 1px solid var(--line); }
.mode-bar .mode-tab { min-width: 245px; padding: 20px 27px 23px 0; margin-right: 27px; gap: 12px; }
.mode-number { font: 9px var(--mono); color: var(--muted); align-self: flex-start; margin-top: 6px; }
.mode-name { font-size: 15px; font-weight: 750; letter-spacing: -.025em; }
.mode-name small { font-size: 9px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.mode-arrow { margin-left: auto; font-size: 20px; align-self: flex-start; line-height: 1.2; margin-top: 1px; }
.mode-tab.active .mode-number, .mode-tab.active .mode-arrow { color: var(--accent); }
.rules-link { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--secondary); font-size: 10px; white-space: nowrap; }
.rules-link > span { width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid #a7afa0; border-radius: 50%; font: 10px var(--mono); }
.rules-link:hover { color: var(--accent); }
.chart-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 19px 25px; border-bottom: 1px solid var(--market-line); }
.instrument { display: flex; align-items: center; gap: 11px; min-width: 0; }
.instrument-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--market-icon); color: var(--market-secondary); font-size: 24px; line-height: 1; }
.instrument strong { display: block; font-size: 12px; font-weight: 600; letter-spacing: -.02em; }
.instrument > div > span { display: block; font-size: 9px; color: var(--market-muted); margin-top: 3px; }
.chart-badges { display: flex; align-items: center; gap: 9px; font: 9px var(--mono); }
.chart-badges > span { padding: 5px 7px; color: var(--market-secondary); border: 1px solid var(--market-line); border-radius: 3px; white-space: nowrap; }
.chart-badges #chart-status { display: flex; align-items: center; gap: 6px; border: 0; color: var(--market-muted); }
.chart-badges i { width: 5px; height: 5px; background: #8d9d7a; border-radius: 50%; }
.chart-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 23px 25px 15px; }
.chart-eyebrow { display: block; font: 8px var(--mono); letter-spacing: .095em; color: var(--market-muted); margin-bottom: 8px; }
#chart-value { display: block; font: 31px var(--mono); font-weight: 400; color: var(--market-text); letter-spacing: -.06em; line-height: 1; }
#chart-value span { color: var(--market-muted); font-size: 22px; margin-left: 5px; }
.chart-context { display: flex; align-items: center; gap: 9px; font-size: 9px; line-height: 1.7; color: var(--market-muted); }
.lock-icon { color: var(--market-secondary); font-size: 24px; }
.chart-footnote { display: flex; align-items: center; gap: 16px; min-height: 38px; padding: 8px 25px 13px; color: var(--market-muted); font-size: 8px; }
.chart-footnote > span:first-child { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.chart-footnote .legend-dot { width: 4px; height: 4px; }
.chart-footnote .legend-dot.up { background: #72b8a0; }
.chart-footnote .legend-dot.down { background: #d87964; margin-left: 7px; }
.chart-footnote > span:nth-child(2) { margin-left: auto; text-align: right; line-height: 1.5; }
.chart-footnote button { padding: 0; color: var(--market-secondary); font-size: 17px; line-height: 1; }
.chart-footnote button:hover { color: var(--accent); }
.session-strip { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 25px; min-height: 52px; border-top: 1px solid var(--market-line); background: var(--market-strip); }
.session-strip > span { display: inline-flex; align-items: center; gap: 9px; color: var(--market-secondary); font-size: 9px; }
.session-strip b { color: var(--market-muted); font: 9px var(--mono); font-weight: 400; }
.session-strip .positive { color: #86b59b; }
.session-strip .negative { color: #d78b77; }
.loader { width: 24px; height: 24px; border: 2px solid #394638; border-top-color: var(--accent); border-radius: 50%; animation: spin 800ms linear infinite; }
.chart-loading strong { margin-top: 3px; font-size: 12px; font-weight: 500; }
.chart-loading > span:last-child { font-size: 10px; color: var(--market-muted); }
.panel-eyebrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font: 8px var(--mono); letter-spacing: .045em; margin-bottom: 10px; }
.panel-eyebrow > span:last-child:not(:first-child) { color: var(--accent); font-size: 17px; line-height: 1; }
.control-panel h2 { font-size: 23px; font-weight: 650; letter-spacing: -.05em; margin-bottom: 6px; }
.panel-description { color: var(--secondary); font-size: 10px; line-height: 1.75; margin-bottom: 19px; }
.control-panel .field-label { font-size: 9px; margin-bottom: 7px; }
.nickname-field { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 3px; height: 37px; gap: 8px; padding: 0 11px; margin-bottom: 17px; transition: border-color 160ms ease; }
.nickname-field:focus-within { border-color: var(--accent); }
.nickname-field > span { color: var(--muted); font: 12px var(--mono); }
.nickname-field input { width: 100%; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 11px; }
fieldset { min-width: 0; padding: 0; margin: 0 0 16px; border: 0; }
legend { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0; margin-bottom: 7px; font-size: 9px; font-weight: 600; color: var(--secondary); }
legend span { color: var(--muted); font-size: 8px; font-weight: 400; }
.segmented:not(.compact) button { min-height: 40px; font-size: 13px; font-weight: 600; }
.segmented button small { display: block; margin-top: 2px; font-size: 7px; line-height: 1.2; font-weight: 400; color: var(--muted); }
.segmented button.selected, .segmented button[aria-pressed='true'] { background: var(--olive); color: var(--paper); }
.segmented button.selected small, .segmented button[aria-pressed='true'] small { color: var(--selected-text); }
.segmented.compact button { min-height: 28px; font-size: 9px; }
.universe-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0 17px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.universe-field label { font-size: 9px; font-weight: 600; color: var(--secondary); }
.universe-field select { max-width: 178px; border: 0; padding: 3px 0 3px 4px; color: var(--secondary); font-size: 9px; background: transparent; cursor: pointer; }
.button { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 12px 14px; border: 1px solid transparent; border-radius: 3px; font-size: 11px; font-weight: 650; transition: background 180ms ease, border-color 180ms ease, transform 180ms ease; }
.button.primary { background: var(--accent); color: #fff9f4; border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.primary > span:last-child:not(:first-child) { font-size: 19px; font-weight: 400; line-height: 1; transition: transform 180ms ease; }
.button.primary:hover:not(:disabled) > span:last-child:not(:first-child) { transform: translate(2px, -2px); }
.button.secondary { justify-content: center; color: var(--secondary); border-color: var(--line); background: transparent; font-size: 10px; }
.button.secondary:hover:not(:disabled) { background: var(--paper-deep); border-color: #c6ccbc; }
.button:disabled { opacity: .55; }
.button:active:not(:disabled) { transform: translateY(1px); }
.form-note { margin-top: 10px; text-align: center; color: var(--muted); font-size: 8px; line-height: 1.6; }
.survival-start { padding: 13px 0 17px; border-top: 1px solid var(--line); margin: 0 0 16px; }
.survival-start > span { display: block; font-size: 9px; color: var(--secondary); }
.survival-start > strong { display: block; margin: 6px 0; font: 30px var(--mono); letter-spacing: -.07em; }
.survival-start > strong > span { font-size: 19px; color: var(--muted); }
.survival-start > small { color: var(--muted); font-size: 9px; }
.play-score { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 0 1px; }
.play-score > span { font-size: 10px; color: var(--secondary); }
.play-score > strong { font: 29px var(--mono); letter-spacing: -.05em; }
.round-progress { margin-top: 11px; margin-bottom: 24px; }
.round-progress i { display: block; height: 3px; flex: 1; background: var(--line); }
.round-progress i.done { background: var(--olive); }
.round-progress i.active { background: var(--accent); }
#prediction-controls h2 { font-size: 22px; }
#prediction-controls .panel-description { margin-bottom: 17px; }
.direction-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 23px; }
.direction-buttons button { min-height: 37px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--secondary); font-size: 10px; font-weight: 600; border: 1px solid var(--line); border-radius: 3px; transition: background 160ms ease, border-color 160ms ease, color 160ms ease; }
.direction-buttons button > span { font-size: 18px; line-height: 1; font-weight: 400; }
.direction-buttons button:hover { border-color: #a6b5a0; }
.direction-buttons button.chosen[data-direction='up'] { background: var(--green-soft); border-color: var(--up-border); color: var(--green); }
.direction-buttons button.chosen[data-direction='down'] { background: var(--down-soft); border-color: var(--down-border); color: var(--red); }
.guess-field { display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.guess-field input { min-width: 0; width: 100%; border: 0; background: none; color: var(--ink); font: 35px var(--mono); letter-spacing: -.06em; outline: none; }
.guess-field:focus-within { border-color: var(--accent); }
.guess-field input::-webkit-inner-spin-button, .guess-field input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.guess-field input[type='number'] { appearance: textfield; }
.guess-field > span { color: var(--muted); font: 24px var(--mono); }
#classic-controls { margin-bottom: 24px; }
.leverage-heading { display: flex; align-items: baseline; justify-content: space-between; font-size: 10px; color: var(--secondary); }
.leverage-heading strong { color: var(--ink); font: 26px var(--mono); letter-spacing: -.04em; }
.leverage-presets { display: flex; justify-content: space-between; gap: 4px; margin: 3px 0 16px; }
.leverage-presets button { color: var(--muted); padding: 4px 8px; font: 9px var(--mono); border-radius: 3px; }
.leverage-presets button.selected { background: var(--paper-deep); color: var(--olive); }
.trade-metrics { margin: 0; border-top: 1px solid var(--line); padding-top: 10px; }
.trade-metrics > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 8px 0; }
.trade-metrics dt { color: var(--secondary); font-size: 10px; }
.trade-metrics dd { margin: 0; color: var(--ink); font: 11px var(--mono); }
.trade-metrics > div:last-child dd { color: var(--red); }
.risk-note { margin: 12px 0 18px; color: var(--muted); font-size: 8px; line-height: 1.7; }
.error-message { margin: 16px 0 0; }
.result-status { font: 9px var(--mono); color: var(--green); letter-spacing: .05em; text-transform: uppercase; padding-top: 3px; }
.result-status.loss, .result-status.negative { color: var(--red); }
.result-number { font: 43px var(--mono); letter-spacing: -.065em; line-height: 1.2; margin: 15px 0 5px; color: var(--green); }
.result-number.loss, .result-number.negative { color: var(--red); }
.result-metrics { display: grid; gap: 0; padding: 8px 0 14px; margin: 13px 0 16px; border-block: 1px solid var(--line); }
.result-metrics > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 0 0; }
.result-metrics span, .result-metrics dt { color: var(--secondary); font-size: 9px; }
.result-metrics strong, .result-metrics dd { margin: 0; font: 11px var(--mono); }
#result-panel > p { font-size: 10px; color: var(--secondary); line-height: 1.75; }
#result-panel { animation: fade-up 280ms ease both; }
#result-panel h2 { font-size: 22px; margin-bottom: 10px; }
#result-panel .button { margin-top: 13px; }
.history-item { display: flex; align-items: center; gap: 7px; font: 9px var(--mono); }
.under-workspace { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 13px; font-size: 8px; color: var(--muted); }
.under-workspace > span { display: inline-flex; align-items: center; gap: 6px; }
.under-workspace > span > span { font-size: 14px; color: var(--secondary); }
.below-game { display: grid; grid-template-columns: minmax(0, 1fr) 326px; gap: 50px; margin-top: 53px; margin-bottom: 40px; }
.section-topline { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
.section-topline .eyebrow, .how-section > .eyebrow { font-size: 8px; letter-spacing: .12em; margin-bottom: 11px; }
.section-topline h2, .how-section h2 { font-size: 27px; font-weight: 650; letter-spacing: -.055em; line-height: 1.25; }
.section-topline h2 > span { color: var(--accent); }
.section-icon { color: var(--accent); font-size: 30px; font-weight: 400; line-height: 1; }
.leaderboard-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.period-tabs { display: flex; gap: 17px; }
.period-tabs button { position: relative; padding: 0 0 8px; color: var(--muted); font-size: 10px; }
.period-tabs button.active { color: var(--ink); font-weight: 650; }
.period-tabs button.active::after { position: absolute; content: ''; height: 2px; background: var(--olive); inset: auto 0 0; }
.period-tabs button:hover { color: var(--ink); }
.leaderboard-controls select { border: 1px solid var(--line); border-radius: 3px; color: var(--secondary); font-size: 9px; padding: 6px 24px 6px 9px; background: transparent; cursor: pointer; }
.table-scroll { width: 100%; overflow-x: auto; }
.leaderboard-section table { width: 100%; border-collapse: collapse; font-size: 10px; }
.leaderboard-section th { padding: 12px 10px; text-align: right; border-block: 1px solid var(--line); color: var(--muted); font-size: 8px; font-weight: 400; }
.leaderboard-section td { padding: 13px 10px; text-align: right; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 10px; font-variant-numeric: tabular-nums; }
.leaderboard-section th:nth-child(1), .leaderboard-section td:nth-child(1) { width: 54px; padding-left: 0; text-align: left; color: var(--muted); }
.leaderboard-section th:nth-child(2), .leaderboard-section td:nth-child(2) { text-align: left; font-family: var(--sans); }
.leaderboard-section th:last-child, .leaderboard-section td:last-child { padding-right: 0; }
.leaderboard-section td.empty-state { padding: 37px 10px; text-align: center; color: var(--muted); font-family: var(--sans); font-size: 11px; }
.player-avatar { display: inline-grid; place-items: center; vertical-align: middle; width: 22px; height: 22px; border-radius: 50%; background: var(--paper-deep); color: var(--secondary); font: 8px var(--mono); margin-right: 8px; }
.leaderboard-note { margin-top: 13px; color: var(--muted); font-size: 8px; line-height: 1.7; }
.how-section { padding-left: 27px; border-left: 1px solid var(--line); }
.how-section h2 { font-size: 27px; }
.how-section ol { list-style: none; margin: 19px 0 13px; padding: 0; }
.how-section li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 9px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.how-section li > span { font: 9px var(--mono); color: var(--accent); padding-top: 3px; }
.how-section li strong { display: block; margin-bottom: 5px; font-size: 10px; font-weight: 650; }
.how-section li p { color: var(--secondary); font-size: 9px; line-height: 1.75; }
.text-link { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 5px 0; font-size: 9px; color: var(--secondary); }
.text-link > span { color: var(--ink); font-size: 17px; }
.text-link:hover { color: var(--accent); }
.site-footer.page-width { padding-inline: 0; }
.site-footer .footer-brand { font-size: 14px; }
.site-footer .brand-symbol { width: 19px; height: 19px; font-size: 16px; border-radius: 2px; }
.site-footer > span { font-size: 8px; }
dialog h3 { font-size: 12px; font-weight: 750; margin: 21px 0 8px; }
dialog > p + p { margin-top: 10px; }
dialog > .button { margin-top: 21px; }
#help-dialog { width: min(560px, calc(100% - 32px)); }
#help-dialog p { font-size: 11px; }
.summary-score { padding: 21px 0; font: 50px var(--mono); letter-spacing: -.07em; color: var(--accent); }
.summary-score small, .summary-score span { display: block; margin-top: 6px; font: 10px var(--sans); letter-spacing: 0; color: var(--muted); }
.summary-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 17px 0; border-block: 1px solid var(--line); }
.summary-stats span, .summary-stats dt { display: block; font-size: 9px; color: var(--muted); margin-bottom: 7px; }
.summary-stats strong, .summary-stats dd { margin: 0; font: 18px var(--mono); }
#summary-content > p { margin-top: 15px; font-size: 11px; color: var(--secondary); }
#summary-dialog > .button.secondary { margin-top: 9px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.intro { animation: fade-up 550ms 30ms ease both; }
.mode-row, .mode-selector { animation: fade-up 550ms 80ms ease both; }
.workspace { animation: fade-up 600ms 130ms ease both; }
.below-workspace { animation: fade-up 600ms 180ms ease both; }

@media (min-width: 1600px) { .intro { padding-top: 48px; padding-bottom: 38px; } .workspace { grid-template-columns: minmax(0, 1fr) 350px; } .below-workspace { grid-template-columns: minmax(0, 1fr) 350px; } .chart-surface { height: 350px; flex-basis: 350px; } .control-panel, .controls-panel { padding: 27px; } }
@media (max-width: 1150px) {
  .app-shell, .shell { width: calc(100% - 64px); }
  .intro h1 { font-size: 51px; }
  .intro-copy { max-width: 265px; font-size: 11px; }
  .workspace, .below-workspace { grid-template-columns: minmax(0, 1fr) 298px; }
  .control-panel, .controls-panel { padding: 21px; }
  .market-header, .chart-header { padding-inline: 20px; }
  .market-stats, .chart-stats { padding-inline: 20px; gap: 23px; }
  .chart-footer, .market-footer { padding-inline: 20px; }
  .market-meta { gap: 5px; }
  .below-workspace { gap: 28px; }
}
@media (max-width: 850px) {
  .app-shell, .shell { width: calc(100% - 48px); }
  .site-header { min-height: 80px; }
  .brand { font-size: 21px; }
  .header-nav { gap: 22px; }
  .header-meta, .header-tag, .header-status { display: none; }
  .intro { padding-top: 31px; padding-bottom: 28px; }
  .intro h1 { font-size: 46px; }
  .intro-copy { max-width: 225px; }
  .mode-row, .mode-selector { min-height: 82px; }
  .mode-note, .mode-hint { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .market-panel { min-height: 414px; }
  .chart-surface { height: 260px; min-height: 230px; flex-basis: 260px; }
  .control-panel, .controls-panel { padding: 25px; }
  .below-workspace { grid-template-columns: minmax(0, 1fr) 260px; gap: 27px; padding-top: 30px; }
}
@media (max-width: 640px) {
  .app-shell, .shell { width: calc(100% - 32px); }
  .site-header { min-height: 71px; gap: 14px; }
  .brand { font-size: 20px; letter-spacing: -.9px; gap: 7px; }
  .brand svg { width: 23px; height: 27px; }
  .header-nav { gap: 18px; }
  .header-nav a, .nav-link { font-size: 10px; }
  .intro { display: block; padding-top: 27px; padding-bottom: 26px; }
  .intro .eyebrow { font-size: 9px; margin-bottom: 12px; }
  .intro h1 { font-size: clamp(35px, 8.6vw, 50px); line-height: 1.12; letter-spacing: -.07em; }
  .intro-copy { max-width: 320px; padding: 0; margin-top: 16px; font-size: 11px; line-height: 1.8; }
  .mode-row, .mode-selector { min-height: 79px; gap: 0; }
  .mode-tabs { width: 100%; gap: 24px; }
  .mode-tab { flex: 1; gap: 9px; padding: 14px 0 17px; }
  .mode-tab strong { font-size: 13px; }
  .mode-tab small { font-size: 9px; }
  .mode-tab svg { width: 19px; height: 19px; }
  .workspace { border-radius: 4px; }
  .market-panel { min-height: 362px; }
  .market-header, .chart-header { padding: 17px 16px; gap: 10px; }
  .market-title { gap: 8px; }
  .market-title h2 { font-size: 12px; }
  .market-title p, .market-subtitle { font-size: 9px; }
  .market-symbol { width: 26px; height: 26px; font-size: 13px; }
  .market-badge, .market-tag { font-size: 8px; padding: 4px 5px; }
  .market-stats, .chart-stats { padding: 15px 16px 8px; gap: 22px; }
  .market-stats small, .chart-stats small { font-size: 8px; }
  .market-stats strong, .chart-stats strong { font-size: 12px; }
  .chart-surface { height: 220px; min-height: 220px; flex-basis: 220px; }
  .chart-footer, .market-footer { padding: 12px 16px; min-height: 43px; font-size: 9px; gap: 8px; }
  .chart-legend { gap: 11px; }
  .control-panel, .controls-panel { padding: 21px; }
  .control-heading { margin-bottom: 21px; }
  .control-heading h2, .controls-panel h2, .control-panel h2 { font-size: 18px; }
  .field-label, .field > label, label.field > span { font-size: 11px; }
  .text-input, .field input[type='text'], .field input[type='number'], .field select { min-height: 43px; font-size: 16px; }
  .segmented button { min-height: 36px; font-size: 11px; }
  .primary-button, .primary-btn { min-height: 49px; font-size: 13px; }
  .below-workspace { grid-template-columns: 1fr; gap: 29px; padding-top: 30px; }
  .section-heading { margin-bottom: 11px; }
  .section-heading h2 { font-size: 18px; }
  .leaderboard-table { font-size: 11px; }
  .leaderboard-table th { font-size: 8px; padding-inline: 5px; }
  .leaderboard-table td { padding-inline: 5px; }
  .rules li { padding: 13px 0; font-size: 12px; }
  .rules li strong { font-size: 12px; }
  .site-footer { align-items: flex-start; padding: 19px 0 23px; }
  .site-footer p { max-width: 205px; font-size: 8px; }
  dialog { padding: 25px; }
  dialog h2 { font-size: 29px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Layout refinements for the game surfaces. */
.mode-bar { animation: fade-up 550ms 80ms ease both; }
.below-game { animation: fade-up 600ms 180ms ease both; }
@media (max-width: 1150px) {
  .page-width { width: calc(100% - 64px); }
  .site-header { padding-inline: 32px; }
  .site-header nav { gap: 23px; }
  .practice-label { font-size: 8px; }
  .intro h1 { font-size: 49px; }
  .intro h1 svg { width: 38px; height: 38px; margin-left: 9px; }
  .intro > p { font-size: 10px; max-width: 252px; }
  .chart-toolbar, .chart-heading { padding-inline: 20px; }
  .chart-footnote, .session-strip { padding-inline: 20px; }
  .chart-badges { gap: 4px; font-size: 8px; }
  .chart-badges > span { padding: 4px 6px; }
  .instrument strong { font-size: 11px; }
  .instrument > div > span { font-size: 8px; }
  .session-strip > span { gap: 7px; font-size: 8px; }
  .chart-footnote { gap: 11px; }
  .below-game { grid-template-columns: minmax(0, 1fr) 298px; gap: 30px; }
  .how-section { padding-left: 24px; }
  .section-topline h2, .how-section h2 { font-size: 25px; }
}
@media (max-width: 850px) {
  .page-width { width: calc(100% - 48px); }
  .site-header { padding-inline: 24px; }
  .practice-label { display: none; }
  .site-header nav { gap: 21px; }
  .site-header nav a, .site-header nav button { font-size: 10px; }
  .intro { gap: 20px; }
  .intro h1 { font-size: clamp(36px, 5.45vw, 46px); }
  .intro h1 svg { display: none; }
  .intro > p { max-width: 211px; font-size: 9px; }
  .mode-bar { min-height: 87px; }
  .mode-bar .mode-tab { min-width: 229px; margin-right: 22px; padding-right: 15px; }
  .rules-link { font-size: 0; gap: 0; }
  .rules-link > span { font-size: 10px; width: 19px; height: 19px; }
  .chart-heading { padding-top: 19px; padding-bottom: 13px; }
  .chart-context { font-size: 10px; }
  .chart-footnote { font-size: 9px; }
  .session-strip > span { font-size: 10px; }
  #setup-panel { width: 100%; }
  .control-panel #setup-form { display: grid; grid-template-columns: 1fr 1fr; column-gap: 22px; align-items: start; }
  #setup-form > .field-label, #setup-form > .nickname-field { grid-column: 1 / -1; }
  #setup-form > .nickname-field { margin-bottom: 20px; }
  #setup-form > fieldset { margin-bottom: 21px; }
  #setup-form > .universe-field { grid-column: 1 / -1; margin-bottom: 18px; padding-bottom: 15px; }
  #setup-form > .start-button, #setup-form > .form-note { grid-column: 1 / -1; }
  #setup-form > .survival-start { margin: 0; padding: 4px 0 14px; border: 0; }
  #setup-panel .panel-description { margin-bottom: 21px; }
  .control-panel .field-label, legend { font-size: 10px; }
  .nickname-field input { font-size: 13px; }
  .nickname-field { height: 40px; }
  .segmented:not(.compact) button { min-height: 38px; }
  .segmented.compact button { min-height: 38px; font-size: 11px; }
  .universe-field label, .universe-field select { font-size: 11px; }
  .below-game { grid-template-columns: minmax(0, 1fr) 240px; gap: 27px; margin-top: 39px; }
  .how-section { padding-left: 21px; }
  .section-topline h2, .how-section h2 { font-size: 23px; }
  .section-icon { display: none; }
  .section-topline { margin-bottom: 22px; }
  .form-note { font-size: 9px; }
  .button { min-height: 46px; font-size: 12px; }
  .play-score { padding-top: 7px; }
  #play-panel { max-width: 580px; width: 100%; margin-inline: auto; }
  .direction-buttons button { min-height: 42px; font-size: 12px; }
  .panel-eyebrow { font-size: 9px; }
  .panel-description { font-size: 11px; }
}
@media (max-width: 640px) {
  .page-width { width: calc(100% - 32px); }
  .site-header { padding-inline: 16px; }
  .site-header nav { gap: 17px; margin-left: auto; }
  .site-header nav a, .site-header nav button { font-size: 9px; }
  .site-header nav button { display: none; }
  .brand-symbol { width: 24px; height: 24px; font-size: 21px; }
  .brand-dot { font-size: 8px; margin-left: -4px; }
  .intro h1 { font-size: clamp(30px, 7.7vw, 46px); }
  .intro > p { max-width: 300px; margin-top: 16px; font-size: 10px; line-height: 1.8; }
  .mode-bar { min-height: 85px; }
  .mode-bar .mode-tab { min-width: 0; flex: 1; gap: 9px; padding: 16px 9px 17px 0; margin-right: 14px; }
  .mode-bar .mode-tab:nth-child(2) { margin-right: 0; padding-right: 0; }
  .mode-name { font-size: 13px; }
  .mode-name small { font-size: 8px; margin-top: 3px; line-height: 1.5; max-width: 126px; }
  .mode-number { font-size: 8px; margin-top: 5px; }
  .mode-arrow { display: none; }
  .rules-link { display: none; }
  .chart-toolbar { padding: 16px 15px; gap: 8px; }
  .instrument { gap: 8px; }
  .instrument-icon { width: 28px; height: 28px; font-size: 20px; }
  .instrument strong { font-size: 10px; }
  .instrument > div > span { font-size: 7px; }
  .chart-badges { gap: 3px; font-size: 7px; }
  .chart-badges > span { padding: 4px 5px; }
  .chart-badges #chart-status { padding-right: 0; gap: 4px; }
  .chart-heading { padding: 19px 15px 13px; gap: 15px; }
  .chart-eyebrow { font-size: 7px; letter-spacing: .04em; }
  #chart-value { font-size: 27px; }
  #chart-value span { font-size: 19px; }
  .chart-context { font-size: 8px; gap: 6px; }
  .lock-icon { font-size: 21px; }
  .chart-footnote { padding: 9px 15px 11px; gap: 10px; font-size: 7px; }
  .chart-footnote > span:nth-child(2) { max-width: 166px; }
  .chart-footnote button { font-size: 16px; }
  .session-strip { min-height: 46px; padding: 14px 15px; gap: 10px; }
  .session-strip > span { font-size: 8px; gap: 5px; }
  .session-strip b { font-size: 7px; }
  .control-panel #setup-form { display: block; }
  .control-panel h2 { font-size: 24px; }
  .control-panel .field-label, legend { font-size: 11px; margin-bottom: 8px; }
  .nickname-field { height: 43px; margin-bottom: 19px; }
  .nickname-field input { font-size: 16px; }
  .nickname-field > span { font-size: 14px; }
  .panel-description { font-size: 11px; margin-bottom: 21px; }
  .panel-eyebrow { margin-bottom: 12px; }
  .segmented:not(.compact) button { min-height: 46px; font-size: 15px; }
  .segmented button small { font-size: 8px; }
  .segmented.compact button { min-height: 35px; font-size: 11px; }
  #setup-form > fieldset { margin-bottom: 18px; }
  .universe-field { margin-top: 4px; }
  .universe-field select { font-size: 11px; max-width: 190px; }
  #setup-form > .survival-start { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
  .button { min-height: 47px; font-size: 12px; }
  .under-workspace { align-items: flex-start; font-size: 7px; margin-top: 11px; gap: 15px; line-height: 1.7; }
  .under-workspace > span:last-child { max-width: 133px; text-align: right; }
  .under-workspace > span:first-child { max-width: 170px; }
  .below-game { display: block; margin-top: 34px; margin-bottom: 30px; }
  .section-topline h2 { font-size: 25px; }
  .section-topline .eyebrow, .how-section > .eyebrow { font-size: 8px; }
  .section-icon { display: block; font-size: 25px; }
  .section-topline { margin-bottom: 23px; }
  .period-tabs button { font-size: 11px; }
  .leaderboard-controls select { font-size: 10px; }
  .leaderboard-section th { padding-inline: 6px; font-size: 8px; }
  .leaderboard-section td { padding-inline: 6px; font-size: 10px; }
  .leaderboard-section td.empty-state { font-size: 10px; padding-block: 32px; }
  .leaderboard-note { font-size: 8px; }
  .how-section { margin-top: 32px; padding: 26px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .how-section h2 { font-size: 26px; }
  .how-section ol { margin-top: 19px; }
  .how-section li { padding-block: 13px; gap: 12px; }
  .how-section li strong { font-size: 12px; }
  .how-section li p { font-size: 11px; }
  .text-link { font-size: 10px; }
  .site-footer { flex-wrap: wrap; gap: 13px; }
  .site-footer > span:last-child { margin-left: auto; }
  #help-dialog p { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .mode-bar, .below-game { animation: none; }
}

/* States generated after the first round. */
.button-spinner { width: 14px; height: 14px; border: 1.5px solid #ffffff6b; border-top-color: white; border-radius: 50%; animation: spin 700ms linear infinite; }
.result-number small { font: 10px var(--sans); letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.result-number { overflow-wrap: anywhere; }
.reveal-details { margin: 0 0 15px; color: var(--secondary); font-size: 9px; }
.reveal-details summary { cursor: pointer; padding-block: 5px; }
.reveal-details summary:hover { color: var(--accent); }
.reveal-details p { margin-top: 8px; font: 9px/1.9 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.summary-subtitle { margin: -14px 0 20px; color: var(--muted); font-size: 10px; }
.summary-stats strong { display: block; overflow-wrap: anywhere; }
.session-strip.played { justify-content: flex-start; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--market-line) var(--market-strip); }
.session-strip.played > span { flex-shrink: 0; white-space: nowrap; }
.session-strip.played > span:first-child { font: 8px var(--mono); color: var(--market-muted); margin-right: 3px; }
.session-strip.played .history-item { padding-right: 16px; border-right: 1px solid #323e31; }
.session-strip.played .history-item:last-child { border-right: 0; padding-right: 0; }
.round-progress i.current { background: var(--accent); }
.player-cell { display: flex; align-items: center; gap: 9px; min-width: 0; overflow-wrap: anywhere; }
.avatar { display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; flex-shrink: 0; background: var(--paper-deep); color: var(--secondary); font: 8px var(--mono); }
.top-rank { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; color: var(--olive); }
.my-row { background: var(--paper-deep); }
.empty-state strong { display: block; color: var(--secondary); font-size: 12px; font-weight: 600; margin-bottom: 7px; }
.empty-state .text-link { width: auto; margin-inline: auto; margin-top: 10px; }
@media (max-width: 360px) {
  .site-header nav { gap: 12px; }
  .site-header nav a:first-child { display: none; }
  .brand { font-size: 19px; }
  .intro h1 { font-size: 29px; }
  .chart-badges #chart-status { font-size: 0; }
  .chart-badges #chart-status i { width: 6px; height: 6px; }
}

/* Short desktop windows keep the primary action inside the first screen. */
@media (min-width: 851px) and (max-height: 800px) {
  .site-header { min-height: 68px; }
  .intro { padding-top: 19px; padding-bottom: 18px; }
  .intro h1 { font-size: 46px; }
  .intro .eyebrow { font-size: 8px; margin-bottom: 8px; }
  .intro h1 svg { width: 36px; height: 36px; }
  .intro > p { font-size: 10px; line-height: 1.75; }
  .mode-bar { min-height: 66px; }
  .mode-bar .mode-tab { padding-top: 12px; padding-bottom: 14px; }
  .mode-name { font-size: 13px; }
  .mode-name small { font-size: 8px; margin-top: 2px; }
  .mode-number { margin-top: 4px; }
  .mode-arrow { font-size: 18px; }
  .chart-toolbar { padding-top: 13px; padding-bottom: 13px; }
  .chart-heading { padding-top: 17px; padding-bottom: 12px; }
  .chart-eyebrow { font-size: 7px; margin-bottom: 6px; }
  #chart-value { font-size: 27px; }
  .chart-surface { height: 240px; min-height: 240px; flex-basis: 240px; }
  .chart-footnote { min-height: 31px; padding-top: 6px; padding-bottom: 9px; }
  .session-strip { min-height: 43px; padding-top: 14px; padding-bottom: 14px; }
  .control-panel { padding: 16px 21px; }
  .panel-eyebrow { font-size: 7px; margin-bottom: 6px; }
  .panel-eyebrow > span:last-child:not(:first-child) { font-size: 13px; }
  .control-panel h2 { font-size: 21px; line-height: 1.2; margin-bottom: 4px; }
  .panel-description { font-size: 9px; line-height: 1.6; margin-bottom: 12px; }
  .control-panel .field-label { font-size: 8px; margin-bottom: 5px; }
  .nickname-field { height: 32px; margin-bottom: 11px; }
  .nickname-field input { font-size: 10px; }
  fieldset { margin-bottom: 10px; }
  legend { font-size: 8px; margin-bottom: 5px; }
  legend span { font-size: 7px; }
  .segmented:not(.compact) button { min-height: 32px; font-size: 11px; line-height: 1.25; padding: 4px; }
  .segmented button small { font-size: 6px; line-height: 1.2; margin-top: 2px; }
  .segmented.compact button { min-height: 23px; padding: 4px; font-size: 8px; line-height: 1.2; }
  .universe-field { padding-top: 0; padding-bottom: 8px; margin-bottom: 11px; }
  .universe-field label, .universe-field select { font-size: 8px; }
  .button { min-height: 39px; padding-top: 10px; padding-bottom: 10px; font-size: 10px; }
  .form-note { font-size: 7px; margin-top: 7px; }
  .round-progress { margin-top: 8px; margin-bottom: 16px; }
  .play-score { padding-top: 5px; }
  .play-score > strong { font-size: 25px; }
  #prediction-controls h2 { font-size: 21px; }
  #prediction-controls .panel-description { margin-bottom: 13px; }
  .direction-buttons { margin-bottom: 16px; }
  .direction-buttons button { min-height: 32px; }
  #classic-controls { margin-bottom: 18px; }
  .guess-field input { font-size: 30px; }
  .survival-start { padding-top: 10px; padding-bottom: 12px; margin-bottom: 10px; }
  .survival-start > strong { font-size: 27px; }
  .result-number { font-size: 37px; margin-top: 11px; }
  .result-metrics { padding-top: 5px; padding-bottom: 11px; margin-top: 11px; margin-bottom: 10px; }
  .result-metrics > div { padding-top: 6px; }
  .reveal-details { margin-bottom: 10px; }
  .risk-note { margin-top: 9px; margin-bottom: 12px; }
  .under-workspace { margin-top: 10px; }
  .below-game { margin-top: 37px; }
}

/* Give the recovered title space to price history, keeping the shared page alignment. */
@media (min-width: 851px) {
  .mode-bar { min-height: 66px; border-top: 0; }
  .mode-bar .mode-tab { padding-top: 12px; padding-bottom: 14px; }
  .workspace { height: clamp(480px, calc(100svh - 190px), 900px); }
  .market-panel { min-height: 0; }
  .chart-surface { height: auto; min-height: 240px; flex: 1 1 0; }
  .chart-toolbar, .chart-heading, .chart-footnote, .session-strip { flex-shrink: 0; }
  .control-panel { min-height: 0; overflow-y: auto; }
}
@media (min-width: 1151px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 350px; }
}
@media (min-width: 851px) and (max-height: 800px) {
  .workspace { height: max(480px, calc(100svh - 164px)); }
}
@media (max-width: 850px) {
  .chart-surface { height: clamp(320px, 48svh, 460px); min-height: 320px; flex: 0 0 auto; }
}

/* SVG arrows must never fall back to a platform emoji font. */
.ui-icon { display: inline-block; width: 1em; height: 1em; vertical-align: -.12em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brand .ui-icon { width: 1em; height: 1em; }

/* The mobile arena reserves room for the trade ticket before sizing the chart. */
@media (max-width: 850px) {
  .site-header { min-height: 50px; height: 50px; }
  .mode-bar { min-height: 44px; height: 44px; border-top: 0; }
  .mode-bar .mode-tab { min-width: 0; flex: 1; margin-right: 12px; padding: 9px 8px 9px 0; gap: 8px; }
  .mode-name { font-size: 13px; }
  .mode-name small, .mode-arrow { display: none; }
  .mode-number { margin-top: 2px; }
  .workspace { scroll-margin-top: 0; }
  body:not([data-phase='setup']) .workspace {
    height: max(450px, calc(100svh - 106px - env(safe-area-inset-bottom, 0px)));
    grid-template-rows: minmax(170px, 1fr) auto;
  }
  body:not([data-phase='setup']) .market-panel { min-height: 0; }
  body:not([data-phase='setup']) .chart-heading,
  body:not([data-phase='setup']) .session-strip { display: none; }
  body:not([data-phase='setup']) .chart-toolbar { min-height: 40px; height: 40px; padding: 5px 12px; flex-shrink: 0; }
  body:not([data-phase='setup']) .instrument-icon { width: 24px; height: 24px; font-size: 18px; }
  body:not([data-phase='setup']) .instrument > div > span { display: none; }
  body:not([data-phase='setup']) .chart-surface { height: auto; min-height: 100px; flex: 1 1 0; }
  body:not([data-phase='setup']) .chart-footnote { min-height: 26px; height: 26px; padding: 0 12px; flex-shrink: 0; }
  body:not([data-phase='setup']) .chart-footnote > span:first-child { display: none; }
  body:not([data-phase='setup']) .chart-footnote > span:nth-child(2) { margin: 0 auto 0 0; max-width: none; text-align: left; font-size: 8px; }
  body:not([data-phase='setup']) .chart-footnote button { min-width: 36px; min-height: 26px; }
  body:not([data-phase='setup']) .control-panel { padding: 8px 12px 10px; min-height: 0; }
  #play-panel { max-width: none; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; }
  #play-panel > .panel-eyebrow { grid-column: 1 / -1; margin: 0; min-height: 24px; font-size: 9px; }
  #play-panel .text-button { font-size: 10px; padding: 4px 0; }
  .play-score { grid-column: 1 / -1; padding: 0; height: 24px; align-items: center; }
  .play-score > span { font-size: 10px; }
  .play-score > strong { font-size: 17px; letter-spacing: -.03em; }
  .round-progress { display: none; }
  #prediction-controls { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; margin-top: 6px; }
  #prediction-controls > h2, #prediction-controls > .panel-description, #prediction-controls > .form-note { display: none; }
  .direction-buttons { grid-column: 1; grid-row: 1; gap: 6px; margin: 0; }
  .direction-buttons button { min-height: 44px; font-size: 12px; gap: 5px; }
  #classic-controls, #survival-controls { display: contents; }
  #classic-controls > .field-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .guess-field { grid-column: 2; grid-row: 1; height: 44px; padding: 0 8px; border: 1px solid var(--line); border-radius: 3px; }
  .guess-field input { font-size: 24px; }
  .guess-field > span { font-size: 16px; }
  #prediction-controls input[type='range'] { grid-column: 1 / -1; grid-row: 2; height: 32px; margin: 0; }
  input[type='range']::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -9.5px; }
  input[type='range']::-moz-range-thumb { width: 16px; height: 16px; }
  .range-labels { grid-column: 1 / -1; grid-row: 3; margin-top: -6px; font-size: 10px; }
  #submit-button { grid-column: 1 / -1; min-height: 44px; padding: 9px 12px; margin: 2px 0 0; }
  .leverage-heading { grid-column: 2; grid-row: 1; align-items: center; font-size: 12px; }
  .leverage-heading strong { font-size: 23px; }
  .leverage-presets { display: none; }
  .trade-metrics { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0; border: 0; }
  .trade-metrics > div { display: block; margin: 0; }
  .trade-metrics dt { font-size: 9px; white-space: nowrap; }
  .trade-metrics dd { font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
  #bid-note { grid-column: 1 / -1; font-size: 9px; line-height: 1.4; margin: 0; }
  #result-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin-top: 6px; align-items: center; }
  .result-status { font-size: 9px; }
  .result-number { font-size: 25px; margin: 0; text-align: right; }
  #result-panel > p { grid-column: 1 / -1; font-size: 10px; line-height: 1.4; }
  .result-metrics { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 5px 14px; margin: 0; padding: 6px 0; }
  .result-metrics > div { padding: 0; gap: 4px; flex-wrap: wrap; }
  .result-metrics dt { font-size: 9px; }
  .result-metrics dd { font-size: 10px; }
  .reveal-details { grid-column: 1 / -1; margin: 0; font-size: 10px; }
  .reveal-details[open] { max-height: 90px; overflow-y: auto; }
  #result-panel .button { grid-column: 1 / -1; min-height: 44px; margin-top: 0; }
  body:not([data-phase='setup']) .error-message { margin-top: 6px; font-size: 11px; }
  /* Setup uses the same compact form, without spending a screen on a demo. */
  body[data-phase='setup'] .market-panel { display: none; }
  body[data-phase='setup'] .control-panel { padding: 18px; }
  body[data-phase='setup'] #setup-panel > .panel-eyebrow { display: none; }
  body[data-phase='setup'] #setup-panel h2 { font-size: 21px; }
  body[data-phase='setup'] #setup-panel .panel-description { margin-bottom: 12px; }
  body[data-phase='setup'] #setup-form { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
  #setup-form > fieldset { margin-bottom: 12px; }
  #setup-form > .nickname-field { margin-bottom: 12px; }
  #setup-form > .survival-start { padding: 0; margin: 0 0 12px; border: 0; }
  .survival-start > strong { font-size: 24px; margin: 2px 0; }
  .survival-start > small { font-size: 8px; }
  .segmented:not(.compact) button, .segmented.compact button { min-height: 44px; }
  .segmented:not(.compact) button { font-size: 13px; }
  .segmented button small, legend span { display: none; }
  .universe-field select { font-size: 16px; max-width: 180px; }
  #setup-form > .universe-field { margin: 0 0 12px; padding-bottom: 10px; }
}
@media (max-width: 850px) and (max-height: 500px) and (orientation: landscape) {
  body:not([data-phase='setup']) .workspace { height: auto; min-height: calc(100svh - 106px); grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr); grid-template-rows: auto; }
  body:not([data-phase='setup']) .chart-surface { min-height: 170px; }
}
@media (max-width: 850px) {
  #play-panel { grid-template-columns: minmax(0, 1fr) auto auto; gap: 0 10px; }
  #play-panel > .panel-eyebrow { display: contents; }
  #round-label { grid-column: 1; grid-row: 1; font: 9px var(--mono); color: var(--secondary); }
  #play-panel .panel-eyebrow > .text-button { grid-column: 3; grid-row: 1; min-height: 28px; white-space: nowrap; }
  .play-score { grid-column: 2; grid-row: 1; height: 28px; }
  .play-score > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .play-score > strong { font-size: 15px; white-space: nowrap; }
  body[data-mode='survival'] .chart-footnote button { display: none; }
}

/* Safari must not start a smooth page scroll while a new trade is ready. */
@media (max-width: 850px) {
  html { scroll-behavior: auto; }
  #prediction-controls input[type='range'] { height: 44px; }
}

/* Theme control lives outside navigation so it remains available on small screens. */
.theme-toggle { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--secondary); transition: background 160ms ease, color 160ms ease; }
.theme-toggle:hover { background: var(--paper-deep); color: var(--ink); }
.theme-toggle .ui-icon { width: 18px; height: 18px; }
.theme-moon { display: none; }
[data-theme='light'] .theme-sun { display: none; }
[data-theme='light'] .theme-moon { display: block; }
.chart-footnote .legend-dot.up { background: var(--green); }
.chart-footnote .legend-dot.down { background: var(--red); }
.session-strip .positive { color: var(--green); }
.session-strip .negative { color: var(--red); }
@media (max-width: 600px) {
  .site-header { gap: 10px; }
  .theme-toggle { border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}

/* Balance navigation around the viewport, independent of the logo width. */
@media (min-width: 851px) {
  .site-header { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .site-header .brand { justify-self: start; }
  .site-header nav { margin: 0; justify-self: center; }
  .site-header .theme-toggle { justify-self: end; }
}
.asset-select { position: relative; min-width: 0; }
#universe-toggle { min-height: 36px; padding: 7px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); background: var(--white); font-size: 10px; white-space: nowrap; }
#universe-toggle .ui-icon { width: 14px; height: 14px; color: var(--muted); }
#universe-toggle:hover, #universe-toggle[aria-expanded='true'] { border-color: var(--secondary); }
#universe-list { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 10; width: max-content; min-width: 100%; padding: 5px; background: var(--white); border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 8px 24px #00000020; }
#universe-list button { display: block; width: 100%; min-height: 40px; padding: 10px 30px 10px 10px; text-align: left; position: relative; color: var(--secondary); font-size: 11px; border-radius: 2px; }
#universe-list button:hover, #universe-list button:focus-visible { background: var(--paper-deep); color: var(--ink); outline-offset: -2px; }
#universe-list button[aria-selected='true'] { color: var(--ink); background: var(--paper-deep); }
#universe-list button[aria-selected='true']::after { content: ''; position: absolute; right: 12px; top: calc(50% - 3px); width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
body[data-mode='survival'] .direction-buttons [data-direction='down'] { order: -1; }
#survival-controls { --position-color: var(--muted); }
#survival-controls[data-side='down'] { --position-color: var(--red); }
#survival-controls[data-side='up'] { --position-color: var(--green); }
#leverage-value { color: var(--position-color); }
#leverage-slider { --leverage-start: 50%; --leverage-end: 50%; }
#leverage-slider::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--line) 0%, var(--line) var(--leverage-start), var(--position-color) var(--leverage-start), var(--position-color) var(--leverage-end), var(--line) var(--leverage-end), var(--line) 100%); }
#leverage-slider::-moz-range-track { background: linear-gradient(to right, var(--line) 0%, var(--line) var(--leverage-start), var(--position-color) var(--leverage-start), var(--position-color) var(--leverage-end), var(--line) var(--leverage-end), var(--line) 100%); }
#leverage-slider::-webkit-slider-thumb { background: var(--position-color); outline-color: var(--position-color); }
#leverage-slider::-moz-range-thumb { background: var(--position-color); outline-color: var(--position-color); }
.leverage-scale { display: flex; justify-content: space-between; color: var(--muted); font: 9px var(--mono); margin: 5px 0 14px; }
.leverage-scale span:first-child { color: var(--red); }
.leverage-scale span:last-child { color: var(--green); }
.button:disabled { opacity: .5; }
@media (max-width: 850px) {
  #universe-toggle { min-height: 44px; font-size: 12px; }
  #universe-list button { min-height: 44px; font-size: 13px; }
  .leverage-scale { grid-column: 1 / -1; grid-row: 3; margin: -6px 0 0; font-size: 9px; }
}

.direction-buttons button [data-direction-label] { font: inherit; }
@media (max-width: 360px) {
  body[data-mode='survival'] .direction-buttons button { min-width: 0; padding-inline: 4px; font-size: 11px; gap: 4px; }
  body[data-mode='survival'] .direction-buttons button .ui-icon { width: 12px; height: 12px; }
}
#survival-controls[data-side='neutral'] #liquidation-value { color: var(--muted); }
