* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #263940; }
body { display: grid; place-items: center; font: 14px system-ui, "Microsoft YaHei", sans-serif; }
#stage { position: relative; width: min(100vw, 70dvh, 780px); height: 100dvh; overflow: hidden; background: #9dc8db; }
canvas { width: 100%; height: 100%; display: block; touch-action: none; }
#loading { position: absolute; inset: 45% 0 auto; text-align: center; color: #263940; }
#hud { position: absolute; top: max(18px, env(safe-area-inset-top)); inset-inline: 5%;
  color: #fff; pointer-events: none; text-shadow: 0 1px 4px #142126, 0 1px 10px #162428; }
.progress-label { display: flex; gap: .7rem; justify-content: space-between; align-items: baseline;
  font-size: clamp(12px, 3.5vw, 16px); font-weight: 650; font-variant-numeric: tabular-nums; }
#progress { appearance: none; display: block; border: 0; width: 100%; height: 4px;
  border-radius: 5px; overflow: hidden; margin-top: 8px; background: #13202770; }
#progress::-webkit-progress-bar { background: #13202770; }
#progress::-webkit-progress-value { background: #ffd365; border-radius: 5px; }
#progress::-moz-progress-bar { background: #ffd365; border-radius: 5px; }
#steering { position: absolute; inset-inline: 4.5%; bottom: max(9%, calc(env(safe-area-inset-bottom) + 16px));
  color: white; text-align: center; }
#steer-label { display: block; font-size: 12px; font-weight: 650; text-shadow: 0 1px 4px #0d161a; }
.steer-control { position: relative; }
.steer-thumb { position: absolute; top: 0; left: calc(25px + (100% - 50px) * var(--steer-ratio, .5));
  width: 50px; height: 54px; transform: translateX(-50%); pointer-events: none; }
#steer { appearance: none; display: block; width: 100%; height: 54px; margin: 0;
  background: linear-gradient(#181b19ba,#181b19ba) center / 100% 20px no-repeat;
  border-radius: 28px; border: 0; touch-action: none; cursor: grab; }
#steer:active { cursor: grabbing; }
#steer:focus-visible { outline: 2px solid #ffd365; outline-offset: 2px; }
#steer::-webkit-slider-runnable-track { height: 54px; }
#steer::-moz-range-track { height: 54px; }
#steer::-webkit-slider-thumb { appearance: none; width: 50px; height: 54px; border: 0;
  background: transparent; }
#steer::-moz-range-thumb { width: 50px; height: 54px; border: 0;
  background: transparent; }
#result { position: absolute; inset-inline: 0; bottom: max(9%, calc(env(safe-area-inset-bottom) + 16px));
  display: grid; justify-items: center; color: white; gap: 10px; }
#outcome { margin: 0; font-size: 20px; font-weight: 700; text-shadow: 0 2px 8px #101514; }
#retry { min-height: 46px; padding: 0 25px; border: 1px solid #ffffff94; border-radius: 12px;
  background: #202623e6; color: #fff; font: inherit; font-weight: 650; cursor: pointer; touch-action: manipulation; }
