:root { --bg: #1c1b19; --panel: rgba(20, 19, 17, .78); --text: #f2ede4; --dim: #a8a196; --red: #d2452e; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--text); font: 14px/1.35 system-ui, -apple-system, Segoe UI, sans-serif; }
#c, #labels { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#sky { position: fixed; inset: 0; background: #000; }
#labels { pointer-events: none; }
.panel { position: fixed; background: var(--panel); border-radius: 8px; padding: 10px 14px; }
.dim { color: var(--dim); }
#top-left { top: 16px; left: 16px; max-width: min(460px, calc(100vw - 32px)); }
#road { font-size: 26px; font-weight: 800; }
#flow { font-weight: 600; margin-top: 2px; }
#where { color: var(--dim); font-size: 13px; }
#top-right { top: 16px; right: 16px; width: 250px; }
#top-right .row { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
#top-right .opt { white-space: nowrap; }
#clock { font-size: 26px; font-weight: 800; }
#top-right select { background: #2a2825; color: var(--text); border: 0; border-radius: 4px; padding: 2px 4px; }
#hour { width: 100%; accent-color: var(--red); }
#search-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); width: min(380px, calc(100vw - 32px)); }
#search { width: 100%; padding: 9px 12px; border-radius: 8px; border: 0; background: var(--panel); color: var(--text); font-size: 15px; outline: none; }
#results { list-style: none; margin: 4px 0 0; padding: 0; background: var(--panel); border-radius: 8px; overflow: hidden; }
#results li { padding: 7px 12px; cursor: pointer; }
#results li:hover { background: rgba(255, 255, 255, .08); }
#results i { color: var(--dim); font-style: normal; font-size: 12px; margin-left: 6px; }
#minimap { position: fixed; right: 16px; bottom: 16px; width: 220px; height: 220px; border-radius: 50%; border: 2px solid rgba(242, 237, 228, .25); cursor: pointer; }
#minimap.big { width: min(480px, 70vw); height: min(480px, 70vw); border-radius: 12px; }
#bottom-left { bottom: 16px; left: 16px; max-width: min(520px, calc(100vw - 270px)); }

.keys { display: grid; grid-template-columns: repeat(3, 30px); grid-template-rows: 30px 30px; gap: 4px; margin: 2px 0 8px; }
.keys .k { display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--dim); border-radius: 6px; font-weight: 800; font-size: 13px; color: var(--text); background: rgba(255,255,255,.04); }

.keys2 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 12px; color: var(--dim); }
.keys2 .k { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1.5px solid var(--dim); border-radius: 5px; font-weight: 800; font-size: 12px; color: var(--text); background: rgba(255,255,255,.04); }
.keys2 .k:not(:first-child) { margin-left: 8px; }
body.touch .keys2 { display: none; }
.keys .k-w { grid-column: 2; grid-row: 1; } .keys .k-a { grid-column: 1; grid-row: 2; } .keys .k-s { grid-column: 2; grid-row: 2; } .keys .k-d { grid-column: 3; grid-row: 2; }
#fps { font-size: 11px; margin-top: 2px; }
#touch { display: none; }
body.touch #touch { display: block; }
body.touch .keys { display: none; }
#touch button { position: fixed; bottom: 24px; width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--panel); color: var(--text); font-size: 22px; touch-action: none; }
#t-left { left: 20px; } #t-right { left: 96px; } #t-brake { right: 96px; bottom: 260px !important; } #t-gas { right: 20px; bottom: 260px !important; }
body.touch #bottom-left { bottom: 100px; }
#loading { position: fixed; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; background: var(--bg); z-index: 10; }
#loading .logo { justify-self: center; width: 160px; height: auto; margin-bottom: 6px; }
#loading .title { font-size: 34px; font-weight: 800; }
#loading .bar { width: 260px; height: 6px; background: #2a2825; border-radius: 3px; overflow: hidden; }
#progress { width: 0; height: 100%; background: var(--red); transition: width .2s; }
#loading-what { color: var(--dim); }
@media (max-width: 720px) {
  #top-right { top: auto; bottom: 100px; right: 16px; width: 200px; }
  #search-wrap { top: auto; bottom: 16px; left: 50%; width: 46vw; }
  #minimap { width: 120px; height: 120px; top: 120px; bottom: auto; }
  #road { font-size: 20px; }
}

#tip { position: fixed; pointer-events: none; background: var(--panel); padding: 4px 9px; border-radius: 6px; font-weight: 600; max-width: 340px; z-index: 5; }
#tip i { color: var(--dim); font-style: normal; font-weight: 400; font-size: 12px; margin-left: 7px; }
#article { top: 110px; right: 16px; width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - 360px); overflow: auto; z-index: 6; }
#article .close { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: var(--dim); font-size: 22px; cursor: pointer; }
#article .kind { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
#article h2 { margin: 2px 24px 6px 0; font-size: 20px; line-height: 1.2; }
#article .facts { font-size: 13px; color: var(--dim); margin-bottom: 8px; }
#article .facts b { color: var(--text); }
#article a { color: #e9c9a8; }
#article img { float: right; max-width: 110px; max-height: 130px; margin: 2px 0 6px 10px; border-radius: 4px; }
#article p { margin: 0 0 8px; font-size: 14px; }
#article .drive { background: var(--red); color: #fff; border: 0; border-radius: 6px; padding: 6px 12px; font-weight: 700; cursor: pointer; margin-bottom: 8px; }
#article .wiki { display: inline-block; font-weight: 700; clear: both; }
@media (max-width: 720px) { #article { top: auto; bottom: 230px; max-height: 40vh; } }

body.film #top-left, body.film #search-wrap, body.film #minimap, body.film #bottom-left, body.film #touch, body.film #tip, body.film #article { display: none !important; }
body.film #top-right .row:last-child, body.film #hour, body.film #day { display: none; }
body.film #top-right { width: auto; padding: 12px 18px; }
body.film #clock { font-size: 40px; }

#gps { top: 64px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; min-width: min(420px, calc(100vw - 32px)); border: 1px solid rgba(255, 176, 32, .45); }
#gps[hidden] { display: none; }
#gps .arrow { font-size: 34px; color: #ffb020; width: 40px; text-align: center; }
#gps b { display: block; font-size: 16px; }
#gps .in { color: #ffb020; font-weight: 700; }
#gps .to { color: var(--dim); font-size: 12px; }
#gps .x { margin-left: auto; background: none; border: 0; color: var(--dim); font-size: 22px; cursor: pointer; }
#article .nav { background: #ffb020; color: #1c1b19; border: 0; border-radius: 6px; padding: 6px 12px; font-weight: 700; cursor: pointer; margin: 0 6px 8px 0; }
#results .gpsb { float: right; background: #ffb020; color: #1c1b19; border: 0; border-radius: 4px; font-weight: 700; font-size: 11px; padding: 2px 6px; cursor: pointer; }
body.film #gps { display: none !important; }
