:root {
    --bg: #05080e;
    --panel: rgba(13, 19, 30, .82);
    --panel-strong: rgba(16, 23, 36, .96);
    --line: rgba(148, 163, 184, .13);
    --muted: #7f8da3;
    --text: #f3f7fb;
    --red: #ff405d;
    --red-soft: #ff7187;
    --blue: #2ea8ff;
    --blue-soft: #72c9ff;
    --green: #45e6a6;
    --cyan: #42e2ef;
    --gold: #ffca5c;
    --violet: #9b7cff;
}

* { box-sizing: border-box; }

html, body { width: 100%; min-height: 100%; margin: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: "IBM Plex Sans", sans-serif;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    background: repeating-linear-gradient(180deg, transparent 0 4px, rgba(255,255,255,.009) 5px);
    mix-blend-mode: screen;
}

button { font: inherit; }

.atmosphere { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.grid-plane {
    position: absolute;
    inset: 42% -20% -40%;
    background-image: linear-gradient(rgba(46,168,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(46,168,255,.07) 1px, transparent 1px);
    background-size: 58px 58px;
    transform: perspective(600px) rotateX(62deg);
    transform-origin: center top;
    mask-image: linear-gradient(to bottom, transparent, #000 20%, transparent 85%);
}
.glow { position: absolute; width: 42vw; aspect-ratio: 1; filter: blur(110px); opacity: .12; border-radius: 50%; animation: drift 12s ease-in-out infinite alternate; }
.glow-red { background: var(--red); top: -20vw; left: -12vw; }
.glow-blue { background: var(--blue); bottom: -24vw; right: -10vw; animation-delay: -6s; }

.command-view {
    position: relative;
    z-index: 1;
    width: min(100%, 1920px);
    min-height: 100vh;
    margin: 0 auto;
    padding: clamp(18px, 2vw, 38px) clamp(20px, 2.4vw, 46px) 18px;
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 1.5vw, 25px);
}

.command-header { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand-lockup { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; overflow: hidden; }
.brand-mark img { width: 110%; height: 110%; object-fit: contain; filter: drop-shadow(0 0 14px rgba(46,168,255,.24)); }
.overline, .eyebrow { color: var(--muted); font: 600 10px/1.2 "JetBrains Mono", monospace; letter-spacing: .2em; }
.brand-lockup h1 { margin: 4px 0 0; font: 700 clamp(20px, 1.7vw, 30px)/1 "Rajdhani", sans-serif; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-meta { display: flex; align-items: center; gap: 17px; color: #aeb9c9; font: 600 12px/1 "JetBrains Mono", monospace; letter-spacing: .05em; }
.live-pill { display: inline-flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid rgba(69,230,166,.3); color: var(--green); background: rgba(69,230,166,.07); border-radius: 3px; }
.live-pill i, .feed-pulse i { width: 7px; height: 7px; background: currentColor; border-radius: 50%; box-shadow: 0 0 14px currentColor; animation: signal 1.3s ease-out infinite; }
.live-pill.upcoming { color: var(--gold); border-color: rgba(255,202,92,.25); background: rgba(255,202,92,.07); }
.live-pill.completed, .live-pill.standby { color: var(--muted); border-color: var(--line); background: rgba(127,141,163,.07); }
.live-pill.alert { color: var(--red); border-color: rgba(255,64,93,.35); background: rgba(255,64,93,.08); }
.meta-divider { width: 1px; height: 22px; background: var(--line); }
#wallClock { color: #fff; font-size: 17px; }

.panel {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(17,25,39,.94), rgba(9,14,23,.82));
    border: 1px solid var(--line);
    border-radius: 7px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 18px 50px rgba(0,0,0,.18);
}
.panel::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.018) 46%, transparent 70%); transform: translateX(-100%); animation: sweep 11s linear infinite; }

.status-banner { padding: 10px 18px; display: flex; align-items: center; justify-content: center; gap: 14px; border: 1px solid rgba(255,202,92,.32); border-radius: 5px; background: rgba(255,202,92,.08); color: var(--gold); font-size: 13px; }
.status-banner[hidden] { display: none; }
.status-banner span { font: 700 10px/1 "JetBrains Mono", monospace; letter-spacing: .18em; }
.status-banner.danger { color: #fff; background: rgba(255,64,93,.18); border-color: rgba(255,64,93,.55); }

.arena-grid {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(250px, .62fr) minmax(230px, .53fr);
    grid-template-rows: minmax(245px, 1.05fr) minmax(112px, .47fr) minmax(275px, 1.05fr);
    gap: clamp(12px, 1vw, 18px);
    min-height: 0;
}
.arena-grid[hidden] { display: none; }

.score-stage { grid-column: 1; grid-row: 1; padding: clamp(20px, 1.6vw, 30px); }
.stage-heading, .section-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.stage-heading h2, .section-heading h2 { margin: 4px 0 0; font: 700 clamp(19px, 1.45vw, 25px)/1.1 "Rajdhani", sans-serif; }
.sync-state { display: flex; align-items: center; gap: 7px; color: var(--green); font: 600 9px/1 "JetBrains Mono", monospace; letter-spacing: .12em; }
.sync-state span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.sync-state.stale { color: var(--gold); }
.duel { height: calc(100% - 68px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.side-score { position: relative; display: flex; flex-direction: column; align-items: center; }
.side-icon { position: absolute; left: 6%; top: 18%; width: 38px; height: 38px; border: 1px solid currentColor; display: grid; place-items: center; font: 700 18px/1 "Rajdhani", sans-serif; transform: rotate(45deg); opacity: .55; }
.side-icon::first-letter { transform: rotate(-45deg); }
.side-score > span { font: 700 12px/1 "JetBrains Mono", monospace; letter-spacing: .14em; }
.red-side { color: var(--red-soft); }
.blue-side { color: var(--blue-soft); }
.side-score > strong { color: #fff; font: 700 clamp(64px, 6.5vw, 112px)/.86 "Rajdhani", sans-serif; letter-spacing: -.04em; text-shadow: 0 0 42px color-mix(in srgb, currentColor 25%, transparent); transition: transform .25s ease; }
.side-score.score-pop > strong { animation: scorePop .5s ease; }
.side-score small { color: var(--muted); font-size: clamp(10px, .76vw, 13px); }
.side-score small b { color: #d8e1ed; }
.duel-center { display: flex; align-items: center; gap: 8px; color: #526077; }
.duel-center span { width: 24px; height: 1px; background: currentColor; }
.duel-center b { font: 700 12px/1 "JetBrains Mono", monospace; }
.score-balance { position: absolute; left: 7%; right: 7%; bottom: 15px; display: flex; height: 3px; background: #1b2432; }
.balance-red, .balance-blue { transition: width .8s cubic-bezier(.22,.8,.2,1); }
.balance-red { background: var(--red); box-shadow: 0 0 15px rgba(255,64,93,.45); }
.balance-blue { background: var(--blue); box-shadow: 0 0 15px rgba(46,168,255,.45); }
.score-balance i { position: absolute; top: 50%; width: 9px; height: 9px; border: 2px solid #fff; background: var(--bg); border-radius: 50%; transform: translate(-50%,-50%); transition: left .8s cubic-bezier(.22,.8,.2,1); }

.leader-spotlight { grid-column: 2; grid-row: 1; padding: clamp(20px, 1.6vw, 30px); text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.leader-spotlight::before { content: ""; position: absolute; width: 170px; height: 170px; top: 35%; left: 50%; transform: translate(-50%,-50%); border: 1px solid rgba(255,202,92,.12); border-radius: 50%; box-shadow: 0 0 70px rgba(255,202,92,.06); }
.leader-spotlight .eyebrow { position: absolute; top: 25px; left: 26px; }
.crown { position: absolute; top: 20px; right: 24px; color: rgba(255,202,92,.17); font: 700 44px/1 "Rajdhani", sans-serif; }
.leader-badge { width: 60px; height: 60px; z-index: 1; display: grid; place-items: center; border: 1px solid rgba(255,202,92,.5); color: var(--gold); background: rgba(255,202,92,.08); font: 700 22px/1 "Rajdhani", sans-serif; transform: rotate(45deg); margin-bottom: 19px; }
.leader-badge span { transform: rotate(-45deg); }
.leader-spotlight h2 { z-index: 1; margin: 0; max-width: 100%; font: 700 clamp(24px, 2vw, 36px)/1 "Rajdhani", sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leader-spotlight p { z-index: 1; color: var(--muted); margin: 7px 0 12px; font-size: 12px; }
.leader-score { z-index: 1; display: flex; align-items: baseline; gap: 6px; color: var(--gold); }
.leader-score strong { color: #fff; font: 700 clamp(42px, 3.3vw, 60px)/1 "Rajdhani", sans-serif; }
.leader-score span { font: 700 10px/1 "JetBrains Mono", monospace; }
.leader-stats { z-index: 1; width: 100%; display: flex; justify-content: center; gap: 16px; margin-top: 11px; color: var(--muted); font-size: 10px; }
.leader-stats span + span { padding-left: 16px; border-left: 1px solid var(--line); }
.leader-stats b { color: #ccd5e2; }

.clock-panel { grid-column: 3; grid-row: 1; padding: clamp(20px, 1.5vw, 28px); display: flex; flex-direction: column; justify-content: center; }
.countdown { margin: 16px 0 14px; color: #fff; font: 700 clamp(30px, 3vw, 54px)/1 "JetBrains Mono", monospace; letter-spacing: -.08em; white-space: nowrap; }
.event-progress { height: 4px; border-radius: 2px; background: rgba(255,255,255,.07); overflow: hidden; }
.event-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--green)); box-shadow: 0 0 13px rgba(69,230,166,.6); transition: width 1s linear; }
.clock-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 13px; color: var(--muted); font: 500 9px/1.35 "JetBrains Mono", monospace; }
.clock-meta span:last-child { text-align: right; }

.kpi-strip { grid-column: 1 / 4; grid-row: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: inherit; }
.kpi-card { padding: 16px 18px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 14px; min-width: 0; }
.kpi-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid currentColor; background: color-mix(in srgb, currentColor 7%, transparent); font: 700 18px/1 "Rajdhani", sans-serif; }
.kpi-green { color: var(--green); }.kpi-cyan { color: var(--cyan); }.kpi-gold { color: var(--gold); }.kpi-violet { color: var(--violet); }
.kpi-card > div:nth-child(2) { min-width: 0; }
.kpi-card span { display: block; color: var(--muted); font: 600 8px/1 "JetBrains Mono", monospace; letter-spacing: .13em; white-space: nowrap; }
.kpi-card strong { display: block; color: #fff; margin: 7px 0 3px; font: 700 clamp(24px, 1.9vw, 34px)/.86 "Rajdhani", sans-serif; }
.kpi-card strong b { font: inherit; }
.kpi-card strong em { color: var(--muted); font: 600 10px/1 "JetBrains Mono", monospace; margin-left: 3px; }
.kpi-card small { display: block; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-card small b { color: #c8d3df; }
.mini-ring { --progress: 0deg; width: 39px; height: 39px; padding: 4px; border-radius: 50%; background: conic-gradient(var(--green) var(--progress), rgba(255,255,255,.07) 0); }
.mini-ring span { width: 100%; height: 100%; border-radius: inherit; background: #101722; }
.health-bars { display: flex; gap: 3px; align-items: flex-end; height: 38px; }
.health-bars i { display: block; width: 3px; background: var(--green); min-height: 6px; box-shadow: 0 0 5px rgba(69,230,166,.4); animation: bars 2s ease-in-out infinite alternate; }
.health-bars i.down { background: var(--red); }
.people-stack { display: flex; align-items: center; padding-right: 6px; }
.people-stack i { width: 21px; height: 21px; margin-left: -6px; border: 2px solid #101722; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--violet)); }
.people-stack i:first-child { margin-left: 0; background: linear-gradient(135deg, var(--red), var(--gold)); }
.pulse-line { display: flex; align-items: center; gap: 3px; height: 32px; }
.pulse-line i { display: block; width: 3px; height: 12px; background: var(--violet); animation: equalizer 1.1s ease-in-out infinite alternate; }
.pulse-line i:nth-child(2) { animation-delay: -.7s; }.pulse-line i:nth-child(3) { animation-delay: -.2s; }.pulse-line i:nth-child(4) { animation-delay: -.9s; }.pulse-line i:nth-child(5) { animation-delay: -.45s; }

.standings-panel { grid-column: 1 / 3; grid-row: 3; padding: clamp(18px, 1.35vw, 25px); }
.updated-chip { padding: 6px 8px; color: var(--muted); border: 1px solid var(--line); border-radius: 2px; font: 600 8px/1 "JetBrains Mono", monospace; letter-spacing: .1em; }
.standings-head, .standing-row { display: grid; grid-template-columns: minmax(210px, 1fr) 100px 100px; align-items: center; }
.standings-head { padding: 13px 12px 8px; color: #5e6b7e; font: 600 8px/1 "JetBrains Mono", monospace; letter-spacing: .12em; }
.standings-head span:not(:first-child) { text-align: right; }
.standings-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.standing-row { position: relative; min-height: 41px; padding: 6px 12px; border: 1px solid rgba(255,255,255,.045); background: rgba(255,255,255,.018); overflow: hidden; }
.standing-row::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--team-color); box-shadow: 0 0 10px var(--team-color); }
.standing-identity { display: grid; grid-template-columns: 29px 30px minmax(0, 1fr); align-items: center; gap: 9px; min-width: 0; }
.standing-rank { color: #6b7788; font: 600 11px/1 "JetBrains Mono", monospace; }
.standing-row:first-child .standing-rank { color: var(--gold); }
.team-symbol { width: 27px; height: 27px; display: grid; place-items: center; color: var(--team-color); border: 1px solid color-mix(in srgb, var(--team-color) 38%, transparent); background: color-mix(in srgb, var(--team-color) 7%, transparent); font: 700 12px/1 "Rajdhani", sans-serif; }
.team-name { min-width: 0; }
.team-name b { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 600 12px/1.1 "IBM Plex Sans", sans-serif; }
.team-name small { color: var(--muted); font-size: 8px; }
.objective-cell, .score-cell { text-align: right; }
.objective-cell { color: #bac4d2; font: 500 11px/1 "JetBrains Mono", monospace; }
.score-cell { color: #fff; font: 700 20px/1 "Rajdhani", sans-serif; }

.activity-panel { grid-column: 3; grid-row: 3; padding: clamp(18px, 1.35vw, 25px); }
.feed-pulse { display: flex; align-items: center; gap: 6px; color: var(--green); font: 600 8px/1 "JetBrains Mono", monospace; }
.activity-list { margin-top: 13px; display: grid; gap: 4px; }
.activity-item { display: grid; grid-template-columns: 25px 1fr auto; gap: 9px; align-items: center; min-height: 45px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.045); }
.activity-icon { width: 24px; height: 24px; display: grid; place-items: center; color: var(--team-color, var(--cyan)); border: 1px solid color-mix(in srgb, var(--team-color, var(--cyan)) 35%, transparent); font: 700 10px/1 "Rajdhani", sans-serif; }
.activity-copy { min-width: 0; }
.activity-copy p { margin: 0; color: #c7d0dc; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-copy p b { color: #fff; }
.activity-copy small, .activity-time { color: #647185; font: 500 8px/1.1 "JetBrains Mono", monospace; }
.activity-time { white-space: nowrap; }
.empty-row { min-height: 120px; display: grid; place-items: center; color: var(--muted); font-size: 11px; text-align: center; }

.standby { flex: 1; min-height: 560px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.standby[hidden] { display: none; }
.standby-orbit { position: relative; width: 150px; height: 150px; display: grid; place-items: center; margin-bottom: 35px; border: 1px solid rgba(46,168,255,.14); border-radius: 50%; }
.standby-orbit::before, .standby-orbit::after { content: ""; position: absolute; border-radius: inherit; border: 1px solid rgba(46,168,255,.09); }
.standby-orbit::before { inset: 14px; }.standby-orbit::after { inset: 32px; }
.standby-orbit i { position: absolute; inset: -1px; border-radius: inherit; border-top: 1px solid var(--blue); animation: rotate 3s linear infinite; }
.standby-orbit span { color: var(--blue-soft); font: 700 12px/1 "JetBrains Mono", monospace; letter-spacing: .12em; }
.standby h2 { margin: 12px 0 8px; font: 700 48px/1 "Rajdhani", sans-serif; }
.standby p { margin: 0; color: var(--muted); }

.command-footer { min-height: 28px; display: flex; justify-content: space-between; align-items: center; color: #667387; font: 500 8px/1 "JetBrains Mono", monospace; letter-spacing: .09em; }
.footer-status, .footer-actions { display: flex; align-items: center; gap: 10px; }
.footer-status i { width: 1px; height: 10px; background: var(--line); }
.secure-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
#fullscreenButton { border: 0; background: none; color: #8592a6; padding: 3px; cursor: pointer; font: 600 8px/1 "JetBrains Mono", monospace; letter-spacing: .08em; }
#fullscreenButton:hover, #fullscreenButton:focus-visible { color: #fff; outline: none; }
#fullscreenButton b { font-size: 14px; margin-left: 4px; }

noscript { position: fixed; inset: auto 20px 20px; z-index: 100; padding: 14px; background: #5e1423; color: white; text-align: center; }

@keyframes signal { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes sweep { 0%,70% { transform: translateX(-110%); } 90%,100% { transform: translateX(110%); } }
@keyframes drift { to { transform: translate(8vw, 5vh) scale(1.12); } }
@keyframes scorePop { 40% { transform: scale(1.08); filter: brightness(1.25); } }
@keyframes bars { from { opacity: .55; transform: scaleY(.55); } to { opacity: 1; transform: scaleY(1); } }
@keyframes equalizer { from { height: 7px; opacity: .45; } to { height: 27px; opacity: 1; } }
@keyframes rotate { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
    .arena-grid { grid-template-columns: 1.4fr .8fr; grid-template-rows: auto auto auto auto; }
    .score-stage { grid-column: 1; grid-row: 1; min-height: 280px; }
    .leader-spotlight { grid-column: 2; grid-row: 1; min-height: 280px; }
    .clock-panel { grid-column: 1 / 3; grid-row: 2; min-height: 150px; }
    .kpi-strip { grid-column: 1 / 3; grid-row: 3; grid-template-columns: repeat(2, 1fr); }
    .standings-panel { grid-column: 1; grid-row: 4; }.activity-panel { grid-column: 2; grid-row: 4; }
}

@media (max-width: 720px) {
    body { overflow: auto; }
    .command-header, .event-meta { align-items: flex-start; }
    .location, .meta-divider { display: none; }
    .brand-mark { width: 42px; height: 42px; }
    .brand-lockup h1 { max-width: 48vw; font-size: 18px; }
    .arena-grid { display: flex; flex-direction: column; }
    .score-stage { min-height: 310px; }.leader-spotlight { min-height: 300px; }.clock-panel { min-height: 170px; }
    .kpi-strip { display: grid; grid-template-columns: 1fr; }
    .standings-panel { min-height: 300px; }.activity-panel { min-height: 300px; }
    .standing-head, .standing-row { grid-template-columns: minmax(150px, 1fr) 70px 75px; }
    .command-footer { gap: 12px; }.footer-status { max-width: 60%; }.footer-status i, #dataAge { display: none; }
}

@media (min-width: 1200px) and (max-height: 820px) {
    .command-view { padding-top: 18px; gap: 12px; }
    .command-header { min-height: 50px; }
    .arena-grid { grid-template-rows: minmax(220px, .96fr) 103px minmax(248px, 1fr); gap: 11px; }
    .brand-mark { width: 45px; height: 45px; }
    .score-stage, .leader-spotlight, .clock-panel, .standings-panel, .activity-panel { padding: 18px; }
    .leader-spotlight .eyebrow { top: 18px; left: 18px; }
    .standing-row { min-height: 36px; }
    .activity-item { min-height: 39px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
