:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#f4f0db;background:#171c1a;font-synthesis:none;color-scheme:dark;--cream:#f4f0db;--acid:#e6f36c}
*{box-sizing:border-box}
body{margin:0;min-height:100svh}
button,input{font:inherit;color:inherit}
button,a{-webkit-tap-highlight-color:transparent}
button{cursor:pointer}
button:disabled{opacity:.45;cursor:default}
[hidden]{display:none!important}
button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid var(--acid);outline-offset:5px}
/* The same edge-attached signature tab used in Elsewhere. */
.author-block{position:fixed;top:-1px;left:15px;z-index:8;display:inline-flex;align-items:center;gap:8px;border:1px solid #e4ece933;border-radius:0 0 8px 8px;padding:9px 12px;background:#263029eb;color:#c3ccc9;text-decoration:none;font-size:11px}
.author-wordmark{display:block;width:100px;height:auto;flex:none;color:#f3efe7}
.author-block:hover{border-color:#888}
main{width:min(1440px,100%);margin:auto}
.game-window{position:relative;height:100svh;min-height:320px;max-height:none;overflow:hidden;background:#3c4541;isolation:isolate;contain:layout paint}
.game-window::after{content:"";position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 130px #10191550;z-index:1;transform:translateZ(0)}
#street{display:block;width:100%;height:100%;touch-action:none;outline:none;cursor:crosshair}
#street[data-mode=flight],#street[data-mode=settling]{cursor:default}
#street[data-mode=idle][data-pointer=shoe]{cursor:grab}
#street[data-mode=idle][data-pointer=dragging]{cursor:grabbing}
#street:focus-visible{outline:1px solid #f4f0db60;outline-offset:-1px}
.top-hud{position:absolute;z-index:3;inset:0 0 auto;padding:26px 30px;display:flex;align-items:flex-start;gap:28px;pointer-events:none;font-variant-numeric:tabular-nums;background:linear-gradient(#122019a8,transparent);height:140px}
.hud-label{display:block!important;font-size:9px!important;line-height:1.2!important;font-weight:800!important;letter-spacing:2px!important;color:#dedfcb!important}
.distance{position:relative;display:grid;grid-template-columns:auto auto;align-items:baseline;column-gap:5px;padding-bottom:10px;min-width:110px;text-shadow:0 2px 8px #0007}
.distance .hud-label{grid-column:1/-1;margin-bottom:3px}
.distance strong{font-size:34px;font-weight:850;letter-spacing:-1px;line-height:1.15}
.distance>span:not(.hud-label){font-size:11px;font-weight:650;color:#eee9d5}
.track{position:absolute;bottom:0;left:0;right:0;height:2px;background:#fff3}
.track i{display:block;height:100%;width:100%;background:var(--acid);transform:scaleX(0);transform-origin:left;transition:transform .2s;will-change:transform}
.buttons{margin-left:auto;display:flex;gap:7px;pointer-events:auto}
.buttons button{width:36px;height:36px;padding:9px;border:1px solid #fff3;border-radius:3px;display:grid;place-items:center;background:#12221988;color:var(--cream);transition:background .15s}
.buttons button:hover{background:#647156}
.buttons svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#sound .sound-playing{display:none}
#sound[aria-pressed=true] .sound-muted{display:none}
#sound[aria-pressed=true] .sound-playing{display:block}
#sound[aria-pressed=true]{background:#75845a88}
.challenge-hud{position:absolute;z-index:3;left:50%;top:25px;transform:translateX(-50%);text-align:center;pointer-events:none;text-shadow:0 2px 12px #000a}
.challenge-hud>span{display:block;font-size:8px;letter-spacing:2px;font-weight:750}
.challenge-hud strong{display:block;font-size:38px;font-weight:850;letter-spacing:-1px;line-height:1.25;font-variant-numeric:tabular-nums}
#control-hint{position:absolute;z-index:3;right:24px;bottom:34px;margin:0;max-width:220px;font-size:10px;line-height:1.6;letter-spacing:.5px;text-transform:uppercase;text-align:right;color:#f5efdb;text-shadow:0 2px 8px #000;pointer-events:none}
.game-window:not([data-phase=walking]):not([data-phase=arriving]) .top-hud,.game-window:not([data-phase=walking]):not([data-phase=arriving]) .challenge-hud{visibility:hidden}
@media(min-width:1441px){.game-window{border-inline:1px solid #e8efcf15}
}
@media(max-width:800px){.top-hud{padding:20px;gap:20px}
.distance{min-width:92px}
.distance strong{font-size:29px}
.challenge-hud{top:19px}
.challenge-hud strong{font-size:32px}
.buttons button{width:32px;height:32px;padding:8px}
}
@media(max-width:600px){.game-window{min-height:320px;max-height:none}
.top-hud{padding:17px 14px;gap:15px;height:100px}
.hud-label{font-size:7px!important;letter-spacing:1.4px!important}
.distance{min-width:76px;column-gap:3px;padding-bottom:7px}
.distance strong{font-size:24px}
.distance>span:not(.hud-label){font-size:8px}
.buttons{gap:4px}
.buttons button{width:44px;height:44px;padding:14px;touch-action:manipulation}
.buttons svg{width:14px;height:14px}
.challenge-hud{top:17px;left:50%;transform:translateX(-50%);text-align:center}
.challenge-hud>span{font-size:6px;letter-spacing:1.3px}
.challenge-hud strong{font-size:clamp(26px,7.7vw,30px);line-height:1.3}
#control-hint{right:13px;bottom:34px;max-width:150px;font-size:8px;line-height:1.6}
.author-block{top:auto;left:auto;right:max(12px,env(safe-area-inset-right));bottom:-1px;border-radius:8px 8px 0 0;padding:6px 8px calc(6px + env(safe-area-inset-bottom));font-size:7px;gap:7px}
.author-wordmark{width:63px}
}
@media(max-width:370px){.top-hud{gap:10px}
.distance strong{font-size:22px}
.distance{min-width:71px}
#control-hint{max-width:130px;font-size:7px}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important;scroll-behavior:auto!important}
}



/* Keep timing and recovery at the edges; the shoes only show whose turn it is. */
.race-hud { position:absolute; top:99px; left:30px; display:flex; align-items:baseline; gap:9px; text-shadow:0 2px 8px #0007; }
.race-hud span { font-size:8px; font-weight:750; letter-spacing:1.5px; color:#dedfcb; }
.race-hud strong { font-size:19px; line-height:1.2; font-weight:650; font-variant-numeric:tabular-nums; letter-spacing:-.3px; }
.foot-control { position:absolute; z-index:4; right:30px; bottom:24px; width:140px; min-height:44px; display:flex; align-items:center; justify-content:space-between; gap:6px; padding:10px 11px; border:1px solid #e2ebc755; border-radius:2px; background:#182a22ed; color:var(--cream); font-size:12px; font-weight:650; touch-action:manipulation; }
.foot-control kbd { padding:1px 4px; border:1px solid #dbe5c75e; border-radius:2px; font:700 9px system-ui; }
.foot-control:hover:enabled { border-color:var(--acid); background:#30422c; }
#make-room { border-color:#d7dfac; }
#make-room[hidden] { display:none; }
.game-window:not([data-phase=walking]):not([data-phase=arriving]) .foot-control { visibility:hidden; }
@media(max-width:800px) {
  .race-hud { left:20px; top:87px; }
  .foot-control { right:20px; width:125px; }
}
@media(max-width:600px) {
  .race-hud { top:66px; left:14px; gap:7px; }
  .race-hud span { font-size:7px; letter-spacing:.7px; }
  .race-hud strong { font-size:14px; }
  .foot-control { right:14px; bottom:42px; width:110px; min-height:44px; padding:8px; font-size:10px; }
  #control-hint { bottom:44px; }
}
@media(min-width:601px) {
  .top-hud { padding-top:48px; height:162px; }
  .challenge-hud{ margin-top:22px; }
  .race-hud { margin-top:22px; }
}

/* Keep the restored game overlay readable without shifting the street. */
#district-name { text-transform:uppercase; }
@media(max-width:800px) and (min-width:601px) { .top-hud { padding-top:42px; } }
@media(max-height:500px) {
 .foot-control { bottom:32px; width:110px; min-height:40px; padding:8px; font-size:10px; }
 #control-hint { bottom:40px; max-width:160px; font-size:8px; }
}

/* Quiet menus. The street keeps its own presentation. */
.game-window:not([data-phase=walking]):not([data-phase=arriving]) { min-height:0; max-height:none; border-inline:0; }
.game-window:not([data-phase=walking]):not([data-phase=arriving])::after { display:none; }
body:has(.game-window:not([data-phase=walking]):not([data-phase=arriving])) { background:#fff; }
body:has(.game-window:not([data-phase=walking]):not([data-phase=arriving])) > .author-block { color:#666; border-color:#d4d4d4; background:#fff; }
body:has(.game-window:not([data-phase=walking]):not([data-phase=arriving])) > .author-block .author-wordmark { color:#242424; }
body:has(.game-window:not([data-phase=walking]):not([data-phase=arriving])) > .author-block:hover { border-color:#888; }
body:has(.game-window:not([data-phase=walking]):not([data-phase=arriving])) > .author-block:focus-visible { outline-color:#242424; }
.game-screen {
  position:absolute; inset:0; z-index:5; display:flex;
  padding:24px; overflow:auto; overscroll-behavior:contain;
  background:#fff; color:#242424; color-scheme:light;
  font:16px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.menu-content { width:min(600px,100%); min-width:0; margin:auto; display:flex; flex-direction:column; align-items:center; gap:28px; text-align:center; }
.result-content { width:min(340px,100%); gap:24px; }
.game-screen h1,.game-screen h2 { margin:0; font-family:inherit; font-size:40px; line-height:1.1; font-weight:650; letter-spacing:-1.2px; }
.game-screen h1 { font-size:clamp(36px,9vw,64px); white-space:nowrap; }
.menu-sneakers { display:block; width:min(300px,42svh,72vw); height:auto; }
.result-sneakers { display:block; width:min(240px,32svh,74vw); height:auto; }
.game-screen button { min-height:48px; min-width:120px; padding:11px 24px; border:1px solid #242424; border-radius:5px; font-family:inherit; font-size:16px; line-height:1.4; font-weight:600; text-align:center; touch-action:manipulation; }
.game-screen .sneaker-button { display:block; flex:none; min-width:0; min-height:0; padding:0; border:0; border-radius:12px; background:transparent; }
#start:enabled .menu-sneakers { animation:sneaker-invite 2.2s ease-in-out infinite; }
#start:active .menu-sneakers { animation:none; transform:scale(.98); }
@keyframes sneaker-invite { 0%,100% { transform:scale(1); } 50% { transform:scale(1.055); } }
#start { position:relative; isolation:isolate; }
#start .menu-sneakers { position:relative; z-index:1; }
#start:disabled { opacity:1; cursor:wait; }
.loading-status { position:absolute; left:0; right:0; bottom:-10px; font-size:12px; line-height:18px; font-weight:400; color:#737373; }
#start:enabled::before,#start:enabled::after { content:""; position:absolute; inset:-8px; border:2px solid #7c897b; border-radius:50%; pointer-events:none; opacity:0; animation:sneaker-ripple 2.2s ease-out infinite; }
#start:enabled::after { animation-delay:-1.1s; }
@keyframes sneaker-ripple { 0% { transform:scale(.84); opacity:0; } 15% { opacity:.45; } 100% { transform:scale(1.12); opacity:0; } }
@media(prefers-reduced-motion:reduce) {
  #start:enabled::before { animation:none; transform:none; opacity:.3; }
  #start:enabled::after { display:none; }
}
.game-screen .secondary { color:#242424; background:#fff; border-color:#d4d4d4; }
.game-screen .secondary:hover:enabled { background:#f5f5f5; border-color:#999; }
.game-screen button:focus-visible { outline:2px solid #242424; outline-offset:4px; }
.menu-actions { display:flex; justify-content:center; gap:12px; flex-wrap:wrap; }
.result-stats { width:100%; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:0; font-variant-numeric:tabular-nums; }
.result-stats dt { margin-bottom:5px; color:#666; font-size:13px; }
.result-stats dd { margin:0; font-size:20px; line-height:1.3; font-weight:600; white-space:nowrap; }
.record-note { margin:-12px 0 0; color:#666; font-size:13px; }
@media(max-width:360px) { .game-screen { padding:20px; } .game-screen h2 { font-size:36px; } .result-stats { gap:8px; } .result-stats dd { font-size:18px; } }
@media(max-height:500px) { .game-screen { padding-block:16px; } .menu-content { gap:16px; } .menu-sneakers { width:min(150px,31svh); } .result-sneakers { width:min(170px,25svh); } .game-screen h1 { font-size:40px; } .game-screen h2 { font-size:32px; } .record-note { margin:-6px 0 0; } }

.game-window[data-phase=arriving] .foot-control,.game-window[data-phase=arriving] #control-hint { visibility:hidden; }
.game-window[data-phase=arriving] #street { cursor:default; }

.sound-credits{position:absolute;left:16px;bottom:max(12px,env(safe-area-inset-bottom));z-index:7;color:#777;font-size:10px;text-decoration:none}
.sound-credits:hover{text-decoration:underline}
.game-window[data-phase=walking] .sound-credits,.game-window[data-phase=arriving] .sound-credits{display:none}
