html, body { margin: 0; height: 100%; overflow: hidden; background: #000; font: 14px/1.4 system-ui, Segoe UI, sans-serif; color: #eee; }
#view { display: block; width: 100vw; height: 100vh; }
.hidden { display: none !important; }

#loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #0d1410; gap: 14px; }
#loading .title { font-size: 34px; letter-spacing: .35em; font-weight: 700; }
#loading .bar { width: 320px; height: 6px; background: #223; border-radius: 3px; overflow: hidden; }
#loadbar { width: 0; height: 100%; background: #e8c547; transition: width .2s; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#info { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.55); padding: 8px 12px; border-radius: 6px; font: 13px/1.5 Consolas, monospace; white-space: pre; }
#minimap { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.45); border-radius: 6px; }
#help { position: absolute; bottom: 10px; left: 10px; max-width: 34vw; background: rgba(0,0,0,.45); padding: 5px 10px; border-radius: 6px; font-size: 11px; color: #ccc; }

.panel { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); background: rgba(14,18,16,.94); border: 1px solid #3a4a40; border-radius: 10px; padding: 22px 26px; min-width: 380px; max-width: 640px; max-height: 80vh; overflow: auto; }
.panel h1 { margin: 0 0 16px; font-size: 20px; }
.panel .tag { font-size: 12px; font-weight: 400; color: #e8c547; margin-left: 8px; }
.panel label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 10px 0; }
.panel select, .panel button { font: inherit; background: #26302b; color: #eee; border: 1px solid #4a5a50; border-radius: 6px; padding: 6px 10px; }
.panel button { cursor: pointer; padding: 8px 18px; }
.panel button:hover { background: #34433b; }
.panel .row { display: flex; gap: 10px; margin-top: 16px; }
.panel .note { font-size: 12px; color: #9aa; margin-top: 16px; }
#credits-body p { margin: 6px 0; font-size: 13px; }
#credits-body h3 { margin: 14px 0 4px; font-size: 14px; color: #e8c547; }

#corner-banner { position: absolute; top: 18px; left: 50%; transform: translate(-50%, -6px); padding: 5px 18px; border-radius: 6px;
  background: rgba(0,0,0,.45); font-size: 22px; font-weight: 600; letter-spacing: .06em; opacity: 0; transition: opacity .6s, transform .6s; white-space: nowrap; }
#corner-banner.on { opacity: 1; transform: translate(-50%, 0); }
#speedo { position: absolute; overflow: visible; bottom: 12px; left: 50%; transform: translateX(-50%); width: 340px; font-family: 'Segoe UI', system-ui, sans-serif; }
#speedo .revstrip { display: flex; gap: 2px; height: 6px; padding: 0 18px; margin-bottom: 4px; }
#speedo .revstrip i { flex: 1; background: rgba(255,255,255,.14); border-radius: 1px; transform: skewX(-20deg); }
#speedo .revstrip i.on { background: #f2f2f2; }
#speedo .revstrip i.amber { background: #ffb020; }
#speedo .revstrip i.red { background: #ff3030; }
#speedo .revstrip i.flash { background: #4aa8ff; box-shadow: 0 0 6px #4aa8ff; }
#speedo .core { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 26px;
  background: linear-gradient(rgba(10,12,14,.72), rgba(10,12,14,.55));
  clip-path: polygon(0 0, 100% 0, 94% 100%, 6% 100%); }
#speedo .spd { flex: 1; text-align: right; line-height: 1; }
#speedo .kmh { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
#speedo .unit { display: block; font-size: 9px; color: #9aa; letter-spacing: .08em; margin-top: 2px; }
#speedo .gear { font-size: 44px; font-weight: 700; width: 44px; text-align: center; line-height: 1; }
#speedo .rpmbox { flex: 1; line-height: 1; }
#speedo .rpm { font-size: 18px; color: #ddd; font-variant-numeric: tabular-nums; }
#speedo .bar { position: absolute; bottom: 16px; width: 14px; height: 72px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.18); border-radius: 3px; }
#speedo .bar i { position: absolute; bottom: 0; left: 0; right: 0; height: 0; border-radius: 2px; }
#speedo .bar span { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); font-size: 9px; color: #aaa; margin-top: 2px; letter-spacing: .05em; }
#speedo .brk { left: -30px; } #speedo .thr { right: -30px; }
#speedo .thr i { background: #43d36b; }
#speedo .brk i { background: #ff4040; }
#speedo .lights { display: flex; justify-content: center; gap: 10px; margin-top: 3px; font-size: 10px; letter-spacing: .1em; }
#speedo .lights span { color: rgba(255,255,255,.3); }
#speedo .lights span.active { color: #ffb020; }
#speedo .lights .l-box { color: #bbb; }
#laptime { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); text-align: center; font-variant-numeric: tabular-nums; }
#laptime .t { font-size: 22px; font-weight: 600; background: rgba(0,0,0,.4); padding: 2px 14px; border-radius: 4px; }
#laptime .t.invalid { color: #ff7070; }
#laptime .d { font-size: 13px; margin-top: 2px; }
#times { position: absolute; top: 240px; right: 10px; width: 220px; font: 12px/1.6 Consolas, monospace; background: rgba(0,0,0,.4); border-radius: 6px; padding: 6px 10px; white-space: pre; }
#times:empty { display: none; }
#times .best { color: #c58cff; } #times .good { color: #5fe07a; } #times .slow { color: #ffd34d; }
#corner-banner { top: 60px; }
.panel .checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.panel .checks label { justify-content: flex-start; margin: 4px 0; }
.panel .keys { font-size: 12px; color: #bcc; line-height: 1.6; margin-top: 12px; }
#pausebadge { position: absolute; top: 46%; left: 50%; transform: translate(-50%,-50%); font-size: 40px; font-weight: 700; letter-spacing: .3em; text-shadow: 0 2px 8px #000; }
#fps { position: absolute; top: 8px; left: 10px; font: 12px Consolas, monospace; color: #cfc; background: rgba(0,0,0,.4); padding: 2px 6px; border-radius: 4px; }
#info:not(.hidden) ~ #fps { display: none; }
#tyres { position: absolute; right: 14px; bottom: 14px; background: rgba(0,0,0,.45); border-radius: 8px; padding: 6px 12px 8px; font-family: 'Segoe UI', sans-serif; }
#tyres .title { font-size: 10px; letter-spacing: .15em; color: #aaa; text-align: center; margin-bottom: 4px; }
#tyres .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
#tyres .ty { display: flex; flex-direction: column; align-items: center; }
#tyres .shape { width: 22px; height: 38px; border-radius: 6px; background: #3fd46b; position: relative; box-shadow: inset 0 0 0 2px rgba(0,0,0,.35); }
#tyres .shape .w { position: absolute; left: 0; right: 0; bottom: -14px; font-size: 9px; color: #ccc; text-align: center; display: none; }
#tyres .t { font-size: 12px; color: #eee; margin-top: 2px; font-variant-numeric: tabular-nums; }
#pitmsg { position: absolute; top: 108px; left: 50%; transform: translateX(-50%); font: 600 18px 'Segoe UI', sans-serif; text-shadow: 0 2px 6px #000; letter-spacing: .05em; white-space: nowrap; }
