/* Info screen. Everything scales with the viewport so it fills a signage display at any resolution. */
html.screen { --bg: #0b0e14; --panel: #121722; --panel2: #182031; --line: #232b3d; --text: #e9edf5; --mute: #8a94a8; --accent: #5b9dff;
  --pos: #2fbf8a; --neg: #f0616d; --bar: #0f131c; --flag: #5b9dff; --flagtext: #06101f; --tick: #0f131c; --head: 600; --radius: .6rem;
  font-size: clamp(11px, 1.02vw, 30px); color-scheme: dark; }
/* NY Blue: exchange-floor navy with white type and cyan highlights. */
html.screen[data-theme="ny"] { --bg: #04142e; --panel: #082048; --panel2: #0c2b5e; --line: #17407f; --text: #ffffff; --mute: #9db8e0; --accent: #33c5ff;
  --pos: #3ddc84; --neg: #ff5a5f; --bar: #020c1d; --flag: #ffffff; --flagtext: #04142e; --tick: #020c1d; --radius: .2rem; }
/* TV: broadcast look, black with a red flag and heavy type. */
html.screen[data-theme="tv"] { --bg: #000000; --panel: #0d0d0f; --panel2: #18181c; --line: #2a2a30; --text: #ffffff; --mute: #a3a3ad; --accent: #ffd400;
  --pos: #00e676; --neg: #ff3b30; --bar: #c8102e; --flag: #c8102e; --flagtext: #ffffff; --tick: #111114; --head: 800; --radius: 0; }
/* PRO: white and grey, for bright rooms and print-like calm. */
html.screen[data-theme="pro"] { --bg: #eef0f3; --panel: #ffffff; --panel2: #f4f5f7; --line: #d5d9e0; --text: #14181f; --mute: #5d6675; --accent: #2b3340;
  --pos: #0a7d4f; --neg: #c02a2a; --bar: #ffffff; --flag: #14181f; --flagtext: #ffffff; --tick: #ffffff; --radius: .3rem; color-scheme: light; }

.screen * { box-sizing: border-box; }
.screen body { margin: 0; height: 100vh; overflow: hidden; background: var(--bg); color: var(--text); font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  display: grid; grid-template-rows: 3.4rem 2.5rem 1fr 2.8rem .25rem; }
.screen body.idle { cursor: none; } .screen body.idle #gear { opacity: 0; }
.screen .pos { color: var(--pos); } .screen .neg { color: var(--neg); } .screen .mute { color: var(--mute); } .screen .r { text-align: right; }
.screen img { width: 1.6em; height: 1.6em; border-radius: 50%; flex: none; }

.bar { display: flex; align-items: center; gap: 1.2rem; padding: 0 1.2rem; background: var(--bar); border-bottom: 1px solid var(--line); }
.bar .brand { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; font-size: 1.25rem; }
.bar .brand svg { width: 1.7rem; height: 1.7rem; }
.bar .scene { flex: 1; font-size: 1.15rem; font-weight: var(--head); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .live { display: flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .12em; }
.bar .live i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--neg); animation: pulse 1.6s infinite; }
html[data-theme="tv"] .bar .live i { background: #fff; }
.bar time { font-variant-numeric: tabular-nums; font-size: 1rem; white-space: pre; }
#gear { background: none; border: 0; color: inherit; font-size: 1.3rem; cursor: pointer; transition: opacity .4s; }
@keyframes pulse { 50% { opacity: .25; } }

.ticker { display: flex; align-items: center; overflow: hidden; background: var(--tick); border-bottom: 1px solid var(--line); white-space: nowrap; }
.ticker.bottom { border-top: 1px solid var(--line); border-bottom: 0; font-size: 1.15rem; }
.ticker .flag { align-self: stretch; display: flex; align-items: center; padding: 0 1.1rem; background: var(--flag); color: var(--flagtext); text-transform: uppercase; letter-spacing: .1em; font-size: .95rem; z-index: 1; }
.ticker .track { display: inline-flex; animation: scroll 120s linear infinite; will-change: transform; }
.ticker .track span { padding: 0 1.4rem; border-right: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ticker .track em { font-style: normal; font-size: .75em; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-right: .5em; }
.ticker .track .u em { color: var(--pos); } .ticker .track .d em { color: var(--neg); }
@keyframes scroll { to { transform: translateX(-50%); } }
.progress { background: var(--line); } .progress i { display: block; height: 100%; width: 0; background: var(--accent); }

#stage { position: relative; min-height: 0; }
.scene-box { position: absolute; inset: 0; padding: 1rem 1.2rem; transition: opacity .55s; }
.scene-box.in { animation: fade .55s both; } .scene-box.out { opacity: 0; }
@keyframes fade { from { opacity: 0; transform: translateY(.4rem); } }
#stage section, #stage aside { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
#stage header { display: flex; align-items: center; gap: .8rem; }
.nm b { display: block; font-weight: var(--head); line-height: 1.1; } .nm span { color: var(--mute); font-size: .7em; }
.px { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; } .px b { display: block; line-height: 1.1; } .px > span { font-size: .5em; color: var(--mute); }
.chartbox { position: relative; min-height: 0; } .chart { position: absolute; inset: 0; }
.chart svg { display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; } .chart .ax { fill: var(--mute); }
.chart .line { fill: none; stroke-width: .16em; stroke-linejoin: round; } .chart .area { opacity: .16; }
.chart .up .line { stroke: var(--pos); } .chart .up .area { fill: var(--pos); } .chart .down .line { stroke: var(--neg); } .chart .down .area { fill: var(--neg); }
.chart .cu { fill: var(--pos); stroke: var(--pos); } .chart .cd { fill: var(--neg); stroke: var(--neg); }
.chart .lastline { stroke: var(--accent); stroke-dasharray: 4 4; stroke-width: 1; } .chart .lastbox { fill: var(--accent); } .chart .lasttxt { fill: var(--bg); font-weight: 700; }
.chart .mk { fill: var(--text); } .chart .mkt { fill: var(--text); font-size: .9em; paint-order: stroke; stroke: var(--panel); stroke-width: .35em; }

.feature { display: grid; grid-template-columns: 1fr 24rem; gap: 1rem; height: 100%; }
.feature .main { display: flex; flex-direction: column; padding: 1rem 1.2rem; min-height: 0; }
.feature .main .chartbox { flex: 1; }
.feature .main header { font-size: 2.1rem; } .feature .main header img { width: 1.5em; height: 1.5em; }
.feature .headline { margin: .5rem 0 0; color: var(--mute); font-size: 1.05rem; }
.feature .chartbox { margin: .6rem 0; }
.feature .range { position: absolute; right: 7.4rem; top: .1rem; font-size: .8rem; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; }
.feature footer { display: flex; gap: 2rem; color: var(--mute); font-size: .95rem; } .feature footer b { color: var(--text); }
.overlay { position: absolute; left: 1rem; bottom: 3rem; min-width: 15rem; padding: .7rem .9rem; background: color-mix(in srgb, var(--panel2) 80%, transparent); border: 1px solid var(--line);
  border-left: .25rem solid var(--accent); border-radius: var(--radius); backdrop-filter: blur(2px); animation: slide .6s 2.2s both; transition: bottom .4s; }
.overlay h4 { margin: 0 0 .4rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.overlay div { display: flex; justify-content: space-between; gap: 1.4rem; padding: .16rem 0; font-size: .95rem; } .overlay span { color: var(--mute); } .overlay b { font-variant-numeric: tabular-nums; }
@keyframes slide { from { opacity: 0; transform: translateX(-1rem); } }
.feature aside { padding: .9rem 1rem; overflow: hidden; display: flex; flex-direction: column; }
.feature h3 { margin: 0 0 .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.feature ul { list-style: none; margin: 0 0 1rem; padding: 0; }
.lead li { display: grid; grid-template-columns: 1.6em 3.2rem 1fr auto; grid-template-areas: "i s sp p" "i s sp c"; align-items: center; column-gap: .6rem; padding: .42rem 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.lead img { grid-area: i; } .lead b { grid-area: s; } .lead .sp { grid-area: sp; height: 1.9rem; width: 100%; } .lead .p { grid-area: p; text-align: right; } .lead .c { grid-area: c; text-align: right; font-size: .8em; }
.wire li { padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .95rem; line-height: 1.3; }
.wire em { display: block; font-style: normal; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.wire .u em { color: var(--pos); } .wire .d em { color: var(--neg); }
svg.sp polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; } svg.sp.up polyline { stroke: var(--pos); } svg.sp.down polyline { stroke: var(--neg); }

.split { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1rem; height: 100%; }
.split section { display: grid; grid-template-rows: auto 1fr; padding: .8rem 1rem; min-height: 0; } .split header { font-size: 1.5rem; margin-bottom: .4rem; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; gap: 1rem; height: 100%; }
.tiles section { padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .4rem; min-height: 0; } .tiles header { font-size: 1.5rem; }
.tiles .big { font-size: 2.6rem; font-variant-numeric: tabular-nums; line-height: 1.1; } .tiles .row { font-size: .95rem; } .tiles .sp.wide { flex: 1; width: 100%; min-height: 0; }

.board { height: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem 1.2rem; }
.board table { width: 100%; height: 100%; border-collapse: collapse; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.board th { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--mute); text-align: left; padding: .3rem .6rem; } .board th.r { text-align: right; }
.board td { padding: 0 .6rem; border-top: 1px solid var(--line); } .board td.cn { display: flex; align-items: center; gap: .7rem; height: 100%; } .board td.cn span { color: var(--mute); font-size: .7em; }
.board .sc { display: inline-block; width: 6rem; height: .45rem; background: var(--panel2); border-radius: 1rem; margin-right: .7rem; vertical-align: middle; overflow: hidden; } .board .sc i { display: block; height: 100%; background: var(--accent); }
.board .spc { width: 9rem; } .board .spc svg { width: 100%; height: 2rem; }

#panel { position: fixed; right: 1rem; top: 4rem; width: 22rem; max-height: calc(100vh - 5rem); overflow: auto; z-index: 10; padding: 1rem 1.2rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: .6rem; box-shadow: 0 1rem 3rem #0008; font-size: 14px; }
#panel[hidden] { display: none; }
#panel h2 { margin: 0 0 .8rem; font-size: 16px; } #panel label { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: .5rem 0; }
#panel select, #panel input[type=number], #panel button { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
#panel input[type=number] { width: 5rem; } #panel fieldset { border: 1px solid var(--line); border-radius: 8px; margin: .8rem 0; padding: .5rem .8rem; } #panel legend { color: var(--mute); font-size: 12px; }
#panel .vw { display: flex; justify-content: space-between; align-items: center; } #panel .chk { justify-content: flex-start; }
#panel .btns { display: flex; gap: .6rem; margin-top: .8rem; } #panel button { cursor: pointer; flex: 1; } #panel .hint { color: var(--mute); font-size: 12px; }

@media (max-width: 900px), (orientation: portrait) {
  .feature { grid-template-columns: 1fr; grid-template-rows: 1.6fr 1fr; } .tiles { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); }
  .board th:nth-child(n+6), .board td:nth-child(n+6) { display: none; }
}

.clipscene { position: relative; height: 100%; background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.clipscene iframe, .clipscene video { width: 100%; height: 100%; border: 0; display: block; object-fit: contain; pointer-events: none; }
.clipscene .lower { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: stretch; background: linear-gradient(transparent, #000c 35%); padding: 3rem 1.4rem 1.2rem; gap: 1rem; }
.clipscene .lower em { align-self: flex-end; font-style: normal; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .9rem; padding: .45rem .9rem; background: var(--flag); color: var(--flagtext); }
.clipscene .lower b { display: block; font-size: 1.7rem; color: #fff; line-height: 1.2; } .clipscene .lower span { color: #cfd6e4; font-size: .95rem; }
.promoted { margin: .5rem 0 0; font-size: 1rem; color: var(--mute); } .promoted em, .clipscene .lower em.pm, .ticker .track .pm em { font-style: normal; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; background: #f5c400; color: #111; padding: .15rem .55rem; border-radius: .2rem; margin-right: .5rem; }
.ticker .track .pm em { font-size: .75em; }

/* Top traders scene */
.tiles.trs { height: calc(100% - 2rem); }
.tiles.trs section { border-top: 3px solid var(--line); } .tiles.trs section.ahead { border-top-color: var(--pos); } .tiles.trs section.behind { border-top-color: var(--neg); }
.tiles.trs header { display: flex; align-items: center; gap: .7rem; }
.tiles.trs .place { font-style: normal; font-weight: 800; font-size: 1.1em; width: 1.9em; height: 1.9em; display: grid; place-items: center; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line); flex: none; }
.tiles.trs section:first-child .place { background: var(--accent); color: var(--flagtext); border-color: var(--accent); }
.trnote { margin: .5rem 0 0; font-size: .85rem; color: var(--mute); text-align: center; }

.mlogo { display: inline-block; width: 1em; height: 1em; vertical-align: -.12em; background: var(--mc, var(--accent)); -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.tiles.trs .nm span .mlogo { margin-right: .2em; }
