:root { color-scheme: dark; font-family: "Barlow Semi Condensed", ui-sans-serif, system-ui, sans-serif; background: #0d0b14; color: #ece8f6; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("barlow.ttf") format("truetype"); font-weight: 500; font-display: swap; }
* { box-sizing: border-box; }
html, body, main { width: 100%; height: 100%; margin: 0; overflow: hidden; }
#game { width: 100%; height: 100%; display: block; background: #0d0b14; outline: none; }
/* The loader sits where the title menu will appear, so the handoff reads as one screen. */
#loading { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-start; padding: 0 0 10vh 7vw; background: #0d0b14; transition: opacity .35s ease-out; }
#loading[hidden] { display: none; }
#loading.leaving { opacity: 0; pointer-events: none; }
.loading-block { width: min(560px, 86vw); }
h1 { font-size: clamp(52px, 8.6vw, 124px); font-weight: 700; line-height: .9; letter-spacing: 0; margin: 0 0 28px -.04em; color: #f3efe6; }
.loading-status { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.loading-status p { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
#status { color: #a2dfcb; }
#status.error { text-transform: none; letter-spacing: 0; font-size: 17px; font-weight: 500; color: #ebbcba; }
#percent { color: #6f6886; font-variant-numeric: tabular-nums; }
/* Segmented progress: whole machines arriving, not a smooth web bar. */
progress { display: block; width: 100%; height: 10px; appearance: none; border: none; background: repeating-linear-gradient(90deg, #1d1929 0 14px, transparent 14px 18px); color: #a2dfcb; }
progress::-webkit-progress-bar { background: repeating-linear-gradient(90deg, #1d1929 0 14px, transparent 14px 18px); }
progress::-webkit-progress-value { background: repeating-linear-gradient(90deg, #a2dfcb 0 14px, transparent 14px 18px); transition: width .2s ease-out; }
progress::-moz-progress-bar { background: repeating-linear-gradient(90deg, #a2dfcb 0 14px, transparent 14px 18px); }
/* A sheen keeps sweeping the segments, so the bar stays alive during long waits. */
.progress-track { position: relative; overflow: hidden; -webkit-mask: repeating-linear-gradient(90deg, #000 0 14px, transparent 14px 18px); mask: repeating-linear-gradient(90deg, #000 0 14px, transparent 14px 18px); }
.progress-track::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%); transform: translateX(-100%); animation: sheen 1.8s cubic-bezier(.45, 0, .25, 1) infinite; pointer-events: none; }
@keyframes sheen { to { transform: translateX(100%); } }
#loading.complete .progress-track::after { animation-duration: .9s; }
/* Startup work blocks the page's script, so between real milestones the fill creeps on
   with a transform: the compositor keeps animating it even while the main thread is busy. */
#progress-creep { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: #a2dfcb; transform-origin: left; transform: scaleX(0); pointer-events: none; }
#progress-creep.creeping { animation: creep var(--creep-seconds, 8s) cubic-bezier(.08, .6, .2, 1) forwards; }
@keyframes creep { to { transform: scaleX(1); } }
p { line-height: 1.6; max-width: 44em; }
.note { font-size: 12px; color: #6f6886; margin-top: 28px; }
button { font: inherit; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #0f2a23; background: #a2dfcb; border: none; padding: 12px 26px; cursor: pointer; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px)); }
button:hover, button:focus-visible { background: #c7eedc; outline: none; }
#retry { margin-top: 24px; }
.utility-button { position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; color: #ece8f6; background: rgba(13, 11, 20, .72); border: 1px solid #3a3450; clip-path: none; cursor: pointer; opacity: .7; transition: opacity .15s ease-out, border-color .15s ease-out; }
.utility-button svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.utility-button:hover, .utility-button:focus-visible { opacity: 1; border-color: #f6c177; background: rgba(13, 11, 20, .9); }
#fullscreen { position: absolute; right: 14px; top: 14px; }
#fullscreen[hidden] { display: none; }
#diagnostics { position: absolute; bottom: 0; left: 0; background: #0d0b14ee; padding: 10px; max-height: 40%; overflow: auto; width: 90%; font: 11px ui-monospace, monospace; }
#diagnostic-log { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } #loading, .utility-button, progress::-webkit-progress-value { transition: none; } .progress-track::after, #progress-creep.creeping { animation: none; } }

/* Touch play: the canvas owns every gesture (no scroll, pinch-zoom, pull-to-refresh or
   long-press callout), so the stick and buttons get the drags. */
html, body { overscroll-behavior: none; }
#game { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
