:root { --bg: #0b0e11; --fg: #eceff1; --dim: #90a4ae; --btn: #37474f; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; overflow: hidden;
  -webkit-user-select: none; user-select: none; }
button { background: var(--btn); color: var(--fg); border: 0; border-radius: 12px;
  padding: 10px 14px; font-size: 16px; }
button.big { font-size: 26px; padding: 16px 40px; }
.hidden { display: none !important; }
.small { font-size: 15px; } .tiny { font-size: 11px; } .dim { color: var(--dim); } .warn { color: #ffab00; }
.screen { position: fixed; inset: 0; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
  max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.scroll { overflow-y: auto; }
#start { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
#start p { max-width: 640px; color: var(--dim); }

#drive { display: grid; grid-template-columns: 26% 1fr 27%; gap: 12px; }
.left { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.speed { font-size: min(22vh, 15vw); font-weight: 900; line-height: 1; }
.speed.over { color: #ff1744; }
.unit { color: var(--dim); font-size: 18px; }
.roundel { margin-top: 12px; width: min(28vh, 20vw); height: min(28vh, 20vw); border-radius: 50%;
  background: #fff; border: min(3.2vh, 2.3vw) solid #d50000; color: #000; display: flex;
  align-items: center; justify-content: center; font-size: min(10vh, 7vw); font-weight: 900; }
.banner { border-radius: 24px; display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: min(13vh, 6.5vw); font-weight: 900; line-height: 1.05; padding: 12px; color: #fff; }
.banner.p0 { background: #d50000; } .banner.p1 { background: #ff6d00; } .banner.p2 { background: #ffd600; color: #000; }
.banner.p3 { background: #1565c0; } .banner.p4 { background: #6a1b9a; }
.banner.road { color: var(--dim); font-size: min(7vh, 3.5vw); font-weight: 600; }
.right { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.status div { font-size: 15px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; }
.status .hot { background: #ffab00; color: #000; padding: 2px 4px; }
.buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

#settings h2 { margin: 0 0 0 16px; }
.row { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 18px; }
.feature { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 18px;
  border-bottom: 1px solid #1c2329; }
.feature input { width: 28px; height: 28px; }
.filebtn { background: var(--btn); border-radius: 12px; padding: 10px 14px; font-size: 16px; }
.filebtn input { display: none; }
pre { white-space: pre-wrap; }

#video { width: 2px; height: 2px; position: fixed; left: 0; top: 0; opacity: 0.01; pointer-events: none; }
#video.full { inset: 0; width: 100%; height: 100%; opacity: 1; object-fit: contain; z-index: 1; }
#mount { z-index: 2; padding: 0; }
#overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.mountbar { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 12px; align-items: center;
  background: rgba(0,0,0,.6); padding: 6px; border-radius: 10px; }
.dimmer { position: fixed; inset: 0; background: #000; display: flex; align-items: center; justify-content: center;
  color: #263238; font-size: 64px; font-weight: 900; z-index: 10; }
.rotate { display: none; }
@media (orientation: portrait) {
  .rotate { display: flex; position: fixed; inset: 0; background: var(--bg); align-items: center; justify-content: center;
    font-size: 28px; z-index: 20; }
}
