/* Uses the Brand variables from brand.css. The drive itself is pixel art; the panels use the Brand. */
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; }
body { display: block; touch-action: none; user-select: none; }
[hidden] { display: none !important; }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; image-rendering: pixelated; }
#carlayer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; image-rendering: pixelated; }
#hud { position: fixed; inset: 0; pointer-events: none; transition: opacity 0.5s; }
#hud.off, #hud.fade, body.photo #hud { opacity: 0; }
#hud > * { position: absolute; }
.chip { display: block; width: auto; height: auto; place-items: unset; flex: none; white-space: nowrap; text-align: left; padding: 6px 12px; margin-bottom: 8px; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font: var(--fs-s) var(--mono); letter-spacing: 0.08em; }
#topleft { top: 16px; left: 16px; }
#scene small { display: block; color: var(--dim); font-size: 10px; letter-spacing: 0.06em; margin-top: 2px; }
#toast { top: 16px; left: 50%; transform: translateX(-50%); padding: 8px 18px; background: var(--glass-2); border: 1px solid var(--edge-1); border-radius: 10px; font-size: var(--fs-m); letter-spacing: 0.1em; text-transform: uppercase; opacity: 0; transition: opacity 0.6s; max-width: 70vw; text-align: center; }
#toast.show { opacity: 1; }
#rail { right: 16px; top: 16px; max-height: calc(100vh - 250px); display: flex; flex-direction: column; flex-wrap: wrap-reverse; align-content: flex-start; gap: 6px; }
#rail .ib { pointer-events: auto; width: 38px; height: 38px; padding: 0; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; color: var(--text); cursor: pointer; }
#rail .ib:hover { border-color: var(--accent); color: var(--accent); }
#rail .ib svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#rail .ib.active { color: var(--accent); border-color: var(--accent); }
#rail #auto:not(.active):hover { color: var(--text); border-color: var(--line); } /* hovering must not make an "off" autopilot look blue */
#rail .slash { display: none; } #rail .ib.on .slash { display: inline; } #rail .ib.on { color: #e8604c; }
#hud.fade #rail .ib { pointer-events: none; }
#panel-body { padding: 0 16px; }
#panel .tabs { display: flex; box-sizing: border-box; margin: 0 -16px; border-radius: 0; border-width: 0 0 1px; padding: 6px 12px; position: sticky; top: 62px; background: #0c1419; z-index: 1; }
#panel .tabs button { flex: 1; padding: 7px 2px; font-size: 11px; letter-spacing: 0.08em; }
#speed { right: 16px; bottom: 16px; padding: 8px 20px; background: var(--glass); border: 1px solid var(--line); border-left: 3px solid var(--accent); transform: skewX(-12deg); font-family: var(--mono); }
#speed b { font-size: var(--fs-xl); color: var(--text); margin-right: 6px; }
#speed small { color: var(--dim); font-size: var(--fs-s); letter-spacing: 0.1em; text-transform: uppercase; }
#hint { left: 50%; transform: translateX(-50%); bottom: 16px; white-space: nowrap; font-size: var(--fs-s); color: var(--dim); letter-spacing: 0.06em; text-shadow: 0 1px 2px #000; }
#bottomright { right: 16px; bottom: 76px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#minimap { background: var(--glass); border: 1px solid var(--line); border-radius: 10px; }
#radio { position: fixed; left: 16px; bottom: 16px; pointer-events: auto; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; width: 230px; }
#r-title { display: block; font: var(--fs-s) var(--mono); letter-spacing: 0.06em; color: var(--accent); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb { display: flex; align-items: center; gap: 6px; }
.rb .btn { padding: 4px 9px; }
.rb input { flex: 1; min-width: 0; accent-color: var(--accent); }
#hud.hide-scene #scene, #hud.hide-clock #clockchip, #hud.hide-km #kmchip, #hud.hide-speed #speed, #hud.hide-hints #hint, #hud.hide-minimap #minimap, #hud.hide-radio #radio { display: none; }

#ytbox { position: fixed; left: 16px; bottom: 16px; width: 230px; height: 129px; z-index: 5; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #000; }
body:has(#ytbox:not([hidden])) #radio { bottom: 155px; }
#ytbox iframe { display: block; width: 230px; height: 129px; }

#panel { background: linear-gradient(#0c1419, #0c1419) padding-box, var(--edge) border-box; position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 100vw); z-index: 10; overflow-y: auto; border-radius: 0; touch-action: pan-y; user-select: text; padding: 0 0 24px; }
#panel header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #0c1419; z-index: 1; }
#panel h4 { margin: 18px 0 6px; font: 11px var(--sans); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--accent); }
#panel .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; font-size: 13px; color: var(--text); border-top: 1px solid var(--line); }
#panel select, #panel input[type=text], #panel input[type=number] { background: #0a0f14; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; max-width: 190px; font: inherit; }
#panel input[type=color] { background: none; border: 0; width: 40px; height: 26px; padding: 0; }
#panel .rng { display: flex; align-items: center; gap: 8px; } #panel .rng input { width: 120px; accent-color: var(--accent); }
#panel output { min-width: 52px; text-align: right; color: var(--dim); font: 11px var(--mono); }
#panel .note { font-size: 11px; color: var(--dim); margin: 6px 0; line-height: 1.4; }
#panel details { margin-top: 18px; border-top: 1px solid var(--line); } #panel summary { cursor: pointer; padding: 10px 0; color: var(--accent); font-size: 11px; letter-spacing: var(--tracking-label); text-transform: uppercase; }
#panel .btns { display: flex; flex-wrap: wrap; gap: 8px; }
#panel h5 { margin: 14px 0 2px; font: 11px var(--sans); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--dim); }
#panel .evbtns { display: flex; align-items: center; gap: 10px; } #panel .evbtns .btn { padding: 2px 8px; font-size: 11px; }
#panel .sc { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 2px 0; } #panel .sc span { flex: 1; } #panel .sc input[type=number] { width: 64px; }
#panel .plist { display: flex; flex-direction: column; gap: 6px; padding: 6px 0; } #panel .plist input { max-width: none; }
#panel .pl { display: flex; gap: 6px; align-items: center; } #panel .pl .btn { flex: 1; text-align: left; } #panel .x { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 11px; }

#photobar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: none; gap: 10px; align-items: center; padding: 10px 16px; background: var(--glass-2); border: 1px solid var(--line); border-radius: 12px; z-index: 6; }
body.photo #photobar { display: flex; }
#photobar select { background: #0a0f14; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
#photobar small { color: var(--dim); }

#help { position: fixed; inset: 0; margin: auto; width: min(420px, 92vw); height: fit-content; padding: 18px 22px; background: var(--glass-2); border: 1px solid var(--edge-1); border-radius: 14px; z-index: 12; box-shadow: var(--popup-glow); }
#help h3 { margin: 0 0 10px; font: 12px var(--sans); letter-spacing: var(--tracking-head); text-transform: uppercase; color: var(--accent); }
#help .kv { display: flex; gap: 12px; padding: 4px 0; font-size: 13px; } #help kbd { min-width: 96px; font: 12px var(--mono); color: var(--accent); }
@media (max-width: 700px) { #hint { display: none; } #topleft { max-width: 50vw; }  }
#flash { position: fixed; inset: 0; z-index: 30; background: #fff; opacity: 0.85; pointer-events: none; transition: opacity 0.6s ease-out; }
