:root { --ink:#2a2420; --paper:rgba(248,244,235,.82); --line:rgba(42,36,32,.28); --accent:#8a5a2b; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #efe9dc; color: var(--ink); font: 13px/1.35 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
body.retro #scene { image-rendering: pixelated; }
.crt { position: fixed; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.22) 3px),
              radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,.5) 100%); }

.panel { position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); width: 264px; max-height: calc(100% - 24px); overflow: auto;
  padding: 10px 12px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.phead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.brand { letter-spacing: .18em; font-size: 11px; font-weight: 700; }
.row { display: flex; justify-content: space-between; margin-top: 8px; }
.row output { font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; margin: 4px 0 0; accent-color: var(--accent); }
select, button { font: inherit; color: inherit; background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: 5px; padding: 4px 8px; }
details.veh { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
details.veh summary { cursor: pointer; letter-spacing: .12em; font-size: 11px; font-weight: 700; }
.vreset { margin-top: 8px; }
select { width: 100%; margin-top: 3px; }
button { cursor: pointer; }
button:hover { background: rgba(255,255,255,.85); }
.btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.read { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.read b { font-weight: 600; }
.foot { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 11px; opacity: .75; }
.foot a { color: inherit; }
:focus-visible { outline: 2px solid #1d5fd1; outline-offset: 2px; }
.open { position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); background: var(--paper); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

body.retro { --ink:#b8ffb8; --paper:rgba(6,20,10,.82); --line:rgba(157,255,157,.4); --accent:#9dff9d; font-family: ui-monospace, Menlo, monospace; }
body.retro select, body.retro button { background: rgba(0,0,0,.4); border-radius: 0; }
body.retro select option { background: #06140a; }
body.retro .panel { border-radius: 0; }
body.atmos { --paper:rgba(255,248,236,.78); }

.fsign { display: flex; gap: 6px; margin-top: 8px; }
.fsign input { flex: 1; min-width: 0; font: inherit; color: inherit; background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: 5px; padding: 4px 8px; }
.fnote { margin: 6px 0 0; font-size: 11px; opacity: .8; }
.ferr { margin: 6px 0 0; color: #a33; }
.frow { display: flex; justify-content: space-between; margin-top: 8px; }
.frow a { color: inherit; }
body.retro .fsign input { background: rgba(0,0,0,.4); border-radius: 0; }

@media (max-width: 640px) {
  .panel { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 56%; }
  .open { right: 8px; bottom: 8px; }
}
