:root{--red:#f23d4f;--panel:#141c25;--line:#34414c}
body{font-family:'Segoe UI',Arial,sans-serif;background:#0d131a;color:#edf1f5}
.shell{max-width:1520px;margin:auto}header{background:#101820;border-color:#303b47}button{font-family:inherit;border-radius:3px;cursor:pointer}button:focus-visible,input:focus-visible{outline:2px solid #eef3f7;outline-offset:3px}.nav button.active,.controls .selected{background:#df3548;border-color:#ff6170}
.steel{background:rgba(17,25,34,.96);border:1px solid #34414c;border-top:3px solid #f23d4f;border-radius:3px;box-shadow:0 8px 24px #0004}
.cap{background:#202a35;border:0;font-size:10px;letter-spacing:1.5px;padding:10px 12px}.driver{min-height:34px;border-color:#ffffff0a}.driver.me{background:linear-gradient(90deg,#72303c,#2c222d);border-color:#ff465a}.driver.inactive{opacity:.45}.driver>span{min-width:0}.relative .driver{grid-template-columns:30px minmax(0,1fr) 74px;font-size:11px}.relative .driver>span:nth-child(2){overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.relative .driver .pos{font-size:12px}.relative .driver .gap{font-size:10px}.relative .driver.me .pos{font-size:9px;color:#fff}
.statgrid .stat{padding:12px;border-color:#303b47}.stat label{font-size:9px}.stat strong{font-size:22px;font-variant-numeric:tabular-nums}.statgrid{background:#141e28}.drivercard{background:linear-gradient(105deg,#202c38,#101820);border-left-color:#f23d4f}.drivercard h2{font-size:22px}.drivercard .number{font-size:52px}.drivercard p{font-size:11px}.ticker{border:1px solid #34414c;border-top:3px solid #f23d4f;border-radius:3px;background:#101820;padding:0;gap:1px}.ticker div{background:#18232e;padding:10px 7px;min-width:0;font-size:10px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ticker b{font-size:15px;margin-right:4px}.ticker small{font:10px Consolas,monospace;color:#a8bac9}
.waiting{padding:25px 12px;color:#8c9eaf;font-size:10px;letter-spacing:1px;line-height:1.6}.waiting small{display:block;font-size:9px;letter-spacing:0;margin-top:7px}.connection-status{position:fixed;right:12px;top:8px;z-index:200;padding:7px 10px;background:#101820;border:1px solid #34414c;border-radius:3px;font:600 10px 'Segoe UI';color:#e5b55e}.connection-status[data-connected=true]{color:#88dfb6}
.fw-isolated .scoring-tower .driver{height:42px}.fw-isolated .drivercard{box-sizing:border-box}
.stage{border-radius:3px;background:radial-gradient(ellipse at 70% 30%,#223040,#101820 70%);padding:18px}.hud{grid-template-columns:280px minmax(280px,1fr) 290px}.stage.flag-yellow,.stage.flag-green{animation:none}.stage.flag-yellow:after,.stage.flag-green:after{pointer-events:none}.footnote{font-size:11px;line-height:1.5}.scoring-tower .driver>span:nth-child(3){letter-spacing:0;font-size:10px}
@media(max-width:1050px){.hud{grid-template-columns:245px minmax(230px,1fr)}.right{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr}.main{padding:12px}.stage{padding:12px}.brand{font-size:28px}header{padding:18px}.nav{padding:12px}.controls{gap:6px}.controls button{padding:8px;font-size:10px}}
@media(max-width:640px){.hud{grid-template-columns:1fr}.right{grid-column:auto;display:flex;flex-direction:column}.mid{min-width:0}.stage{padding:8px}.controls label{width:100%}.brand{font-size:25px}.nav button{font-size:10px;padding:9px}.stat strong{font-size:20px}.drivercard h2{font-size:18px}.connection-status{position:static;margin:8px}.lightbar{position:relative!important;width:100%!important}.scoring-tower .driver>span:nth-child(3){font-size:12px}}

.hide-demo-border #stage{border-color:transparent!important}.hide-demo-border #stage:after{display:none!important}.hide-demo-announcement #announcement{display:none!important}
body:not(.fw-isolated) .stage>#lightbar{position:relative!important;left:auto!important;top:auto!important;bottom:auto!important;transform:none!important;width:min(510px,100%)!important;margin:22px auto 60px!important}
html.fw-isolated body>.fw-widget.lightbar{margin:0!important;width:100%!important}
.lightbar.checkered .bulb:nth-child(odd){background:#f1f5fa;box-shadow:0 0 12px #dfefff55}.lightbar.checkered .bulb:nth-child(even){background:#101820;box-shadow:inset 0 0 4px #000}.lightbar.white .bulb.white{background:#fff;box-shadow:0 0 16px #fff8}

/* Independent desktop windows preserve the approved desktop styles at widget-sized viewports. */
html.fw-isolated body>.fw-widget.steel{left:14px!important;top:14px!important;width:calc(100% - 28px)!important}
html.fw-isolated .scoring-tower .driver>span:nth-child(3){font-size:10px}
html.fw-isolated .stat strong{font-size:22px}
html.fw-isolated .drivercard h2{font-size:22px}
html.fw-isolated .race-flag-copy b{font-size:15px}
html.fw-isolated .race-flag-copy small{font-size:9px}
html.fw-isolated body>.fw-widget.lightbar{gap:5px;padding:10px 12px}

/* R3: continuous lower screen edge and physical lightbar optics. Timing stays in the existing controller. */
:is(.stage .announce,body>.fw-widget.announce){border-radius:0!important;border-left:0!important;border-right:0!important;border-bottom:0!important;box-shadow:none!important}
:is(.stage .lightbar,body>.fw-widget.lightbar){border:2px solid #52595e;border-top-color:#899196;border-bottom-color:#22282d;border-radius:5px;background:linear-gradient(180deg,#9da4a8 0,#535b61 3%,#262d32 12%,#14191d 47%,#22292e 88%,#657078 96%,#30383e 100%);box-shadow:0 4px 9px #0009,inset 0 1px #d9dfe244,inset 0 -2px #080b0d;gap:3px!important;padding:9px 14px!important}
:is(.stage .lightbar,body>.fw-widget.lightbar) .bulb{border-radius:2px;border:1px solid #080d11;outline:1px solid #919ba22b;box-shadow:inset 0 0 3px #000}
:is(.stage .lightbar,body>.fw-widget.lightbar) .bulb::before{content:"";position:absolute;inset:0;background:repeating-linear-gradient(90deg,#fff2 0 1px,transparent 1px 3px),repeating-linear-gradient(0deg,#0003 0 1px,transparent 1px 3px);box-shadow:inset 0 1px 1px #fff8,inset 0 -2px 2px #0008;pointer-events:none;z-index:2}
:is(.stage .lightbar,body>.fw-widget.lightbar) .bulb::after{content:"";position:absolute;inset:2px;background:radial-gradient(ellipse at center,#f8fcffb3 0 12%,#b5c4cb66 17%,#141d2566 24%,transparent 40%) 0 0/20% 100%;border-radius:0;opacity:.65;pointer-events:none;z-index:1}

