* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #b99b79; color: #fff3df; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
[hidden] { display: none !important; }
main { position: fixed; inset: 0; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
canvas:active { cursor: grabbing; }
.rover-joystick { position: fixed; z-index: 3; width: 124px; height: 124px; transform: translate(-50%, -50%); border: 1px solid #fff3df55; border-radius: 50%; background: #44322240; box-shadow: inset 0 0 20px #31201520; pointer-events: none; user-select: none; }
.rover-joystick-thumb { position: absolute; left: 39px; top: 39px; width: 44px; height: 44px; border: 1px solid #fff3df80; border-radius: 50%; background: #fff3df45; }
header { position: fixed; z-index: 2; top: 24px; left: 28px; letter-spacing: .16em; pointer-events: none; text-shadow: 0 1px 12px #231407aa; }
header a { color: inherit; text-decoration: none; pointer-events: auto; }
#loading { position: fixed; z-index: 2000; inset: 0; display: grid; place-items: center; background: #b99b79; transition: opacity .3s; }
.loading-content { width: min(320px, calc(100vw - 48px)); letter-spacing: .06em; }
.loading-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
#loading-number { opacity: .65; font-variant-numeric: tabular-nums; }
#loading-progress { height: 2px; overflow: hidden; background: #fff3df30; }
#loading-fill { width: 100%; height: 100%; background: #fff3df; transform: scaleX(0); transform-origin: left; transition: transform .18s linear; }
#loading.is-ready { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { #loading, #loading-fill { transition: none; } }
body.ui-hidden header, body.ui-hidden .lil-gui, body.ui-hidden #rover-hud, body.ui-hidden #daylight { display: none; }
#rover-hud { position: fixed; bottom: 24px; left: 28px; font-size: 10px; letter-spacing: .1em; opacity: .8; text-shadow: 0 1px 8px #231407; pointer-events: none; }
#rover-speed { font-variant-numeric: tabular-nums; }
#daylight { position: fixed; right: 20px; bottom: 16px; display: flex; gap: 2px; }
#daylight button { position: relative; min-height: 32px; padding: 8px; border: 0; background: transparent; color: #fff3df; opacity: .6; font: inherit; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; text-shadow: 0 1px 6px #231407; cursor: pointer; transition: opacity .15s; }
#daylight button:hover, #daylight button:focus-visible { opacity: 1; }
#daylight button[aria-pressed="true"] { opacity: .95; }
#daylight button[aria-pressed="true"]::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 4px; height: 1px; background: currentColor; opacity: .65; box-shadow: 0 1px 4px #23140780; }
#daylight button:focus-visible { outline: 1px solid #e7ba7b; outline-offset: 1px; }
.lil-gui.root { top: 20px; right: 28px; }
.lil-gui.root, .lil-gui.root .lil-gui { --background-color: #28231df2; --text-color: #e2d3bb; --title-background-color: transparent; --title-text-color: #fff3df; --widget-color: #494035; --hover-color: #61513f; --focus-color: #786149; --number-color: #e7ba7b; --string-color: #e7ba7b; --font-size: 11px; }
.lil-gui.root, .lil-gui.root * { text-transform: uppercase; }
.lil-gui.root.closed, .lil-gui.root .lil-gui { background-color: transparent; }
.lil-gui.root .title { text-align: center; text-shadow: 0 1px 10px #241a0d; }
.lil-gui.root .title::before { position: static; padding-right: 2px; }
@media (max-width: 650px) { header { top: 20px; left: 16px; font-size: 10px; letter-spacing: .08em; } .lil-gui.root { right: 16px; top: 52px; } }
@media (max-width: 650px) { #rover-hud { left: 16px; } #daylight { right: 8px; } }
/* Canvas focus must never draw a frame around the scene, including Tab. */
canvas, canvas:focus, canvas:focus-visible { outline: none; }
