:root{
  --island-height:52px;
  --ink:#171a19;--muted:#56605a;--soft:#f2f3f2;--edge:#dfe3dd;--lime:#a2ec2b;--accent:#426b10;
  --shadow:0 4px 18px #20302022,0 1px 3px #17291012;--header:60px;color-scheme:light;
  font-family:"Segoe UI",Arial,sans-serif;color:var(--ink)
}
*{box-sizing:border-box}body{margin:0;overflow:hidden;background:#d9e0d2}
button,input{font:inherit}button{border:0;color:inherit;cursor:pointer}button:disabled{opacity:.55;cursor:default}
button:focus-visible,input:focus-visible{outline:3px solid #507a13;outline-offset:2px}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round;stroke-linecap:round}
.symbols,[hidden]{display:none!important}header,.brand,.head-right,.mode,.wallet,.profile-button,.eyebrow,.speed-top,.speed-top span,.trip,.trip span,.mapline,.keys,.keygroup,.dlg-top,.legend,.map-legend{display:flex;align-items:center}
header{height:var(--header);background:white;padding:0 24px;gap:16px;border-bottom:1px solid var(--edge);position:relative;z-index:3}
.brand{gap:9px}.brand b{font:italic 850 30px/1 Arial,sans-serif;letter-spacing:-2px}.logo{display:grid;place-items:center;width:34px;height:34px;border-radius:11px;background:var(--lime)}
.logo svg{fill:var(--ink);stroke:none;width:26px;height:26px}.header-line,.sep{width:1px;height:19px;background:var(--edge)}.edition,.mode{font-size:13px;color:var(--muted)}
.head-right{margin-left:auto;gap:8px}.mode{gap:6px;margin-right:8px}.mode i,.mapline i{width:7px;height:7px;border-radius:50%;background:#6fb41e}.wallet{gap:7px;font-weight:750;font-size:16px;white-space:nowrap;margin-right:5px}.wallet svg{width:16px}
.profile-button,.icon,.camera-btn,.touch button{background:var(--soft);border-radius:10px}.icon{display:grid;place-items:center;width:36px;height:36px}.icon svg{width:17px}
.profile-button{gap:6px;height:36px;padding:0 10px;font-size:12px;font-weight:650}.profile-button span{max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profile-button svg{background:var(--paint);border-radius:50%;padding:2px;color:#151815;stroke-width:2;outline:1px solid #0002}
.icon:hover,.profile-button:hover,.camera-btn:hover,.secondary:hover{background:#e6eae4}main{height:calc(100dvh - var(--header));position:relative;overflow:hidden;isolation:isolate}
#world{display:block;width:100%;height:100%}.panel,.place,.status{position:absolute;background:white;border:1px solid #e5e8e1;border-radius:16px;box-shadow:var(--shadow);z-index:2}
.place{left:20px;top:18px;pointer-events:none}
.place{padding:10px 15px}.eyebrow{gap:4px;font-size:11px;color:var(--muted);font-weight:650}.eyebrow svg{width:13px;height:13px;color:var(--accent)}.place h1{margin:3px 0 0;font-size:20px;line-height:1.1;letter-spacing:-.6px}
.minimap{grid-area:map;position:relative;align-self:center;width:100%;border-radius:10px;background:#f1f3ef;padding:2px;overflow:hidden;text-align:left}.minimap:hover{background:#cbdcb6}#smallMap{display:block;width:100%;height:auto;border-radius:8px}
.north{position:absolute;top:4px;right:4px;background:white;border-radius:5px;padding:2px 5px;font-size:10px;font-weight:750}.mapline{justify-content:space-between;padding:6px 6px 3px;font-size:11px;font-weight:650}.mapline i{display:inline-block;margin-right:5px}.mapline svg{width:13px;height:13px;color:var(--muted)}
.keys{left:20px;bottom:18px;gap:8px;padding:7px 11px;font-size:11px;color:var(--muted);white-space:nowrap}.keygroup{gap:3px}kbd{padding:2px 5px;min-width:18px;text-align:center;font:600 10px "Segoe UI",sans-serif;color:#383e3a;background:var(--soft);border:1px solid var(--edge);border-bottom-width:2px;border-radius:4px}
.telemetry{width:max-content;--dock-gap:max(14px,env(safe-area-inset-bottom));position:absolute;z-index:3;bottom:var(--dock-gap);left:50%;transform:translateX(-50%);display:grid;justify-items:center;gap:4px;color:#f7f9f5;pointer-events:none;font-variant-numeric:tabular-nums}
.island-status{display:flex;align-items:center;justify-content:center;gap:4px;white-space:nowrap}
.driver-reputation{background:#212520;border:1px solid #ffffff32;box-shadow:0 1px 5px #17201525;border-radius:20px;padding:3px 8px;font-size:10px}
.driver-reputation{display:flex;align-items:center;gap:5px}.driver-reputation span{color:#d1d6cf}.driver-reputation strong{color:#e3f7ad}.signal-countdown{position:absolute;z-index:1;transform:translate(-50%,calc(-100% - 9px));pointer-events:none;background:#361f20;color:#fff;border:1px solid #ef857d;border-radius:6px;padding:2px 5px;box-shadow:0 1px 4px #29141250;font:700 12px/1.15 "Segoe UI",sans-serif;font-variant-numeric:tabular-nums;white-space:nowrap}
.island{height:var(--island-height);display:flex;align-items:center;gap:15px;padding:8px 10px 8px 17px;border-radius:40px;background:#181b18;border:1px solid #ffffff38;box-shadow:0 4px 14px #121b194d}
.speed-block{display:flex;align-items:center;gap:9px}#gear{display:grid;place-items:center;width:23px;height:25px;background:#31392b;color:#c0f073;border-radius:8px;font:750 13px monospace}
.readout{display:flex;align-items:baseline;gap:4px}.readout output{min-width:1.18em;font:750 29px/1 Arial,sans-serif;letter-spacing:-1px;text-align:right}.readout span{font-size:10px;color:#d3d8ce}
.gauge{display:flex;height:2px;gap:1px;margin-top:2px}.gauge i{flex:1;background:#42473f}.gauge i.on,.fuel-meter i{background:var(--lime)}
.cab-resources,.cab-nav{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;align-items:center}
.cab-resources{border-left:1px solid #454a43;padding-left:12px}
.cab-resource{min-width:0}.cab-nav .gas-nav{width:100%}
.trip{gap:5px;font-size:11px;white-space:nowrap}.trip svg{width:14px;height:14px;color:#c6cec2}.fuel-meter{background:#454b41;height:4px;border-radius:4px;overflow:hidden;margin-top:5px}.fuel-meter i{display:block;height:100%;width:28%}.fuel-meter.low i{background:#ff9751}
.gas-nav{display:flex;gap:3px;align-items:center;justify-content:center;align-self:stretch;min-width:46px;min-height:34px;padding:0 9px;pointer-events:auto;background:#35432a;color:#d7f4b6;border-radius:24px;font-size:10px;font-weight:700}.gas-nav svg{width:13px;height:13px}.gas-nav:hover,.gas-nav[aria-pressed=true]{background:var(--lime);color:var(--ink)}
#conditionMeter i{width:100%}.fuel-key{color:#087955}.repair-key{color:#98511a}
@media(max-width:580px){
  .cab-resources{padding-left:6px;gap:5px}.cab-nav{gap:4px}.cab-nav .gas-nav{min-width:0;padding:0 5px}
  .cab-nav svg{display:none}.cab-resource .trip{font-size:10px;gap:2px}.cab-resource .trip svg{width:12px}
  .telemetry .island{gap:6px;padding-inline:8px}.speed-block{gap:4px}
}
@media(max-width:350px){.cab-resources .trip svg{display:none}.island #gear{width:18px}}
.service,.feedback,.status{position:absolute;left:50%;transform:translateX(-50%);text-align:center;z-index:4}
.service,.action{background:var(--lime);font-weight:700;border-radius:11px}.service{bottom:104px;padding:10px 15px}.feedback,.status{background:white;border-radius:12px;box-shadow:var(--shadow);padding:10px 16px;font-size:13px;max-width:72%}.feedback{bottom:104px;pointer-events:none}.status{top:45%}main:has(.service:not([hidden])) .feedback{bottom:149px}
.driver-tag{position:absolute;transform:translate(-50%,-100%);display:flex;align-items:center;gap:4px;white-space:nowrap;max-width:165px;background:white;color:var(--ink);border-radius:7px;padding:4px 7px;box-shadow:0 1px 5px #19241755;font:650 10px/1 "Segoe UI",sans-serif;pointer-events:none;z-index:0}
.driver-tag:before{content:"";width:7px;height:7px;flex:none;border-radius:50%;background:var(--paint);border:1px solid #0003}.driver-tag:after{content:"";position:absolute;top:100%;left:50%;border:4px solid transparent;border-top-color:white;transform:translateX(-50%)}.driver-tag b{overflow:hidden;text-overflow:ellipsis}.driver-tag span{color:#795512;flex:none}
.touch{display:none}dialog{width:min(390px,92vw);max-height:90dvh;overflow:auto;background:white;color:var(--ink);border:1px solid var(--edge);border-radius:22px;padding:20px;box-shadow:0 12px 60px #16211c44}dialog::backdrop{background:#131b175e;backdrop-filter:blur(3px)}.dlg-top{justify-content:space-between}.dlg-top .icon{border-radius:50%;width:30px;height:30px}dialog h2{margin:9px 0 18px;font-size:26px;letter-spacing:-.9px}.bindings{margin-bottom:15px}.bindings p{display:flex;align-items:center;justify-content:space-between;gap:9px;font-size:12px;margin:0;padding:8px 0;border-bottom:1px solid var(--edge)}.camera-btn{padding:4px 9px}.action,.secondary{width:100%;padding:12px;border-radius:11px;font-size:14px;font-weight:700}.action:hover,.service:hover{background:#92dd20}.secondary{background:var(--soft);margin-top:7px}
#largeMap{display:block;width:100%;max-height:55dvh;object-fit:contain;border-radius:12px}.map-legend{gap:8px 12px;font-size:11px;color:var(--muted);flex-wrap:wrap;margin-top:10px}.map-legend span:first-child{font-weight:700}#reviewLog{margin-bottom:12px}#reviewRows{max-height:110px;overflow:auto}#reviewRows p{font-size:12px}#reviewRows b{display:block}
#profileForm label,#profileForm legend{font-size:13px;font-weight:650}#nickname{display:block;width:100%;margin:7px 0 15px;padding:12px;background:var(--soft);border:1px solid var(--edge);border-radius:10px;color:var(--ink)}
#profileForm fieldset{border:0;padding:0;margin:0 0 18px}#paintOptions{display:grid;grid-template-columns:repeat(8,1fr);gap:2px;margin-top:5px}#paintOptions label{height:42px;display:grid;place-items:center;cursor:pointer;position:relative}#paintOptions input{position:absolute;opacity:0}#paintOptions span{position:relative;width:27px;height:27px;border:1px solid #0003;border-radius:50%}#paintOptions input:checked+span{outline:2px solid #26371e;outline-offset:3px}#paintOptions input:checked+span:after{content:"✓";position:absolute;inset:0;display:grid;place-items:center;color:white;font-weight:800;text-shadow:0 1px 3px black}#paintOptions input:focus-visible+span{outline:3px solid #558513;outline-offset:3px}
@media(max-width:760px){:root{--header:52px}header{padding:0 12px;gap:8px}.edition,.header-line,.keys{display:none}.head-right{gap:5px}.brand b{font-size:24px}.mode{font-size:10px;margin-right:2px}.wallet{font-size:13px}.profile-button span{display:none}.place{left:10px;top:10px}.place{padding:7px 10px}.place h1{font-size:16px}.island{gap:10px}}
@media(max-width:440px){.mode{display:none}.head-right{gap:4px}.place h1{font-size:15px}}
@media(max-height:540px) and (min-width:550px){.place{left:8px;top:7px;padding:4px 9px}.place .eyebrow{display:none}.place h1{font-size:15px}.keys{display:none}.feedback,.service{bottom:96px}}
@media(max-width:950px){.keys{display:none}}
.reset-player{color:#9c3026}.reset-player:hover{background:#f9e8e5}
@media(pointer:coarse){
  :root{--control-height:clamp(54px,12dvh,72px);--control-bottom:max(8px,env(safe-area-inset-bottom));--telemetry-bottom:calc(var(--control-bottom) + var(--control-height) + 6px);--hud-height:calc(var(--telemetry-bottom) + var(--island-height) + 28px)}
  .keys{display:none}
  .touch{position:absolute;z-index:3;bottom:var(--control-bottom);left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(4px,1.5vw,8px);pointer-events:none;user-select:none}
  .touch div{display:contents}
  .touch button{display:grid;place-content:center;justify-items:center;min-width:0;width:100%;height:var(--control-height);background:white;box-shadow:var(--shadow);pointer-events:auto;touch-action:none;font-size:30px;font-weight:700}
  .touch .pedals button{gap:2px;color:#343c32}
  .telemetry{--dock-gap:var(--telemetry-bottom)}
  .service,.feedback{bottom:var(--hud-height)}
  main:has(.service:not([hidden])) .feedback{bottom:calc(var(--hud-height) + 40px)}
  .pedals svg{width:36px;height:36px;stroke-width:2.2;fill:#e1e6dc}
  .pedals [data-key=KeyW] svg{fill:#dcf5b0}
  .pedals small{font-size:10px;font-weight:750}
  button{touch-action:manipulation}
  .touch button:active,.touch button.held{background:#d8f4b7;box-shadow:inset 0 0 0 2px #73964d;transform:translateY(1px)}
}
#resetPanel p{font-size:14px;line-height:1.5;margin:0 0 18px}#resetError{color:#9c3026}
.online-drivers{position:relative}
.online-drivers .mode{display:flex;min-height:36px;padding:4px 8px;border-radius:10px;background:transparent;white-space:nowrap}
.online-drivers .mode:hover,.online-drivers .mode[aria-expanded=true]{background:var(--soft);color:var(--ink)}
#driversPanel{position:absolute;right:0;top:calc(100% + 5px);width:min(350px,calc(100vw - 16px));max-height:min(60dvh,450px);overflow:auto;overscroll-behavior:contain;padding:14px;border:1px solid var(--edge);border-radius:14px;background:white;box-shadow:var(--shadow)}
#driversPanel h2{margin:0 0 10px;font-size:17px}
#driversPanel table{width:100%;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums}
#driversPanel :is(th,td){text-align:right;padding:7px 0 7px 8px;white-space:nowrap}
#driversPanel th{font-size:11px;color:var(--muted)}
#driversPanel th button{background:var(--soft);border-radius:6px;padding:5px;color:inherit;font-weight:650}
#driversPanel th[aria-sort] button{color:var(--accent);background:#ebf6dc}
#driversPanel td{border-top:1px solid var(--edge)}
#driversPanel :is(th,td):first-child{padding-left:0;text-align:left;white-space:normal;overflow-wrap:anywhere}
#driversPanel td:first-child::before{content:"";display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--paint);border:1px solid #0002;margin-right:5px}
@media(max-width:760px){#driversPanel{position:fixed;top:var(--header);right:8px}.online-drivers .mode{margin:0;padding-inline:4px}}
@media(max-width:440px){
  header{gap:4px;padding-inline:8px}
  .brand b{display:none}
  .wallet{min-width:0;margin-right:0;gap:4px}
  .wallet b{max-width:18vw;overflow:hidden;text-overflow:ellipsis}
}
