:root { font-family: "Segoe UI", "Microsoft YaHei", sans-serif; color: #294e43; background: #e6f3ed; color-scheme: light; letter-spacing: 0; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.page { height: 100svh; min-height: 590px; position: relative; overflow: hidden; }
.masthead { position: absolute; inset: 32px 42px auto; display: flex; justify-content: space-between; gap: 20px; z-index: 2; pointer-events: none; }
.eyebrow { margin: 0 0 9px; font-size: 11px; font-weight: 700; color: #628576; }
h1 { margin: 0; font-size: 32px; line-height: 1.4; font-weight: 750; }
.subtitle { margin: 9px 0 0; font-size: 13px; color: #6d8c7e; }
.club-mark { display: flex; align-items: center; align-self: flex-start; gap: 11px; padding-top: 6px; }
.club-mark svg { width: 37px; height: 37px; }
.club-mark span { font-size: 11px; line-height: 1.7; font-weight: 700; }
.ride-metrics { position: absolute; top: 32px; left: 50%; transform: translateX(-50%); z-index: 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 240px; max-width: calc(100% - 32px); gap: 24px; text-align: center; pointer-events: none; }
.ride-metric > span { display: block; color: #628576; font-size: 11px; font-weight: 650; }
.ride-metric p { display: flex; justify-content: center; align-items: baseline; gap: 5px; margin: 4px 0 0; white-space: nowrap; }
.ride-metric output { color: #294e43; font-size: 24px; font-weight: 750; line-height: 1.25; font-variant-numeric: tabular-nums; }
.ride-metric small { font-size: 11px; color: #628576; }
#stage { position: absolute; inset: 0; touch-action: none; }
#stage canvas { display: block; width: 100%; height: 100%; cursor: grab; outline: none; }
#stage canvas:active { cursor: grabbing; }
.footer { position: absolute; inset: auto 42px 27px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 22px; pointer-events: none; }
.route { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #566c62; }
.route-dot { flex: 0 0 7px; height: 7px; border-radius: 50%; background: #d87160; }
.route small { display: block; margin-top: 5px; color: #75887d; font-size: 10px; }
.footer-note { justify-self: end; text-align: right; font-size: 10px; line-height: 1.8; color: #74877a; }
.controls { display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 8px 15px 8px 9px; border: 1px solid #d7e1d7; border-radius: 8px; background: #fafcf5f2; box-shadow: 0 4px 18px #344b4210; pointer-events: auto; }
.icon-button { display: grid; place-items: center; position: relative; width: 38px; height: 38px; flex: 0 0 38px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #527362; cursor: pointer; transition: background 150ms; }
.icon-button:hover { background: #e4ece2; }
.icon-button.primary { background: #366a55; color: white; }
.icon-button.primary:hover { background: #28523f; }
.icon-button[aria-pressed="true"] { background: #d8e8d6; color: #2d5c44; }
.icon-button svg { width: 18px; height: 18px; }
.icon-button:focus-visible, input:focus-visible, #stage canvas:focus-visible { outline: 3px solid #cf8166; outline-offset: 4px; }
.tooltip { position: absolute; bottom: calc(100% + 13px); left: 50%; transform: translateX(-50%); padding: 7px 10px; border-radius: 4px; background: #294e43; color: white; font-size: 11px; white-space: nowrap; pointer-events: none; opacity: 0; }
.icon-button:hover .tooltip, .icon-button:focus-visible .tooltip { opacity: 1; }
.divider { height: 23px; width: 1px; margin: 0 4px; background: #dce4d9; }
.speed { display: flex; align-items: center; gap: 10px; }
.speed span, .speed output { font-size: 11px; }
.speed meter { width: 64px; height: 18px; }
.speed meter::-webkit-meter-bar { background: #dfe6df; border: 0; border-radius: 3px; }
.speed meter::-webkit-meter-optimum-value { background: #366a55; }
.speed[data-danger="true"] meter::-webkit-meter-optimum-value { background: #ce6151; }
.speed output { min-width: 34px; font-variant-numeric: tabular-nums; }
.pedal-button { touch-action: none; user-select: none; }
.icon-button:disabled { cursor: default; opacity: 0.45; }
.ride-status { position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%); max-width: calc(100% - 40px); font-size: 13px; font-weight: 650; color: #294e43; pointer-events: none; text-shadow: 0 1px 3px #fff; }
.ride-status[data-danger="true"] { color: #a3342b; }
.junction-status { position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%); max-width: calc(100% - 40px); text-align: center; font-size: 13px; font-weight: 650; color: #294e43; text-shadow: 0 1px 3px #fff; pointer-events: none; }
.sound-button { position: absolute; top: 94px; right: 42px; z-index: 6; background: #fafcf5dd; }
.sound-button .tooltip { bottom: auto; top: calc(100% + 9px); left: auto; right: 0; transform: none; }
.game-over { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: #e6f3ed18; }
.game-over-content { position: absolute; top: 17%; left: 50%; width: min(740px, calc(100% - 32px)); transform: translateX(-50%); text-align: center; }
.game-over h2 { margin: 0; font-family: Impact, "Arial Black", sans-serif; font-size: 88px; line-height: 1.1; font-weight: 900; color: #cf5948; text-shadow: 3px 4px 0 #fffdec, 5px 7px 0 #294e43; transform: rotate(-4deg); animation: result-stamp 550ms cubic-bezier(0.22, 0.8, 0.25, 1) both; }
.run-result { display: flex; justify-content: center; gap: 28px; margin: 24px 0 18px; color: #365a4d; font-size: 13px; font-variant-numeric: tabular-nums; }
.run-result strong { font-size: 20px; }
.retry-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 23px; border: 0; border-radius: 6px; background: #294e43; color: #fffdec; font-weight: 650; font-size: 14px; cursor: pointer; pointer-events: auto; box-shadow: 0 3px 0 #18392f; }
.retry-button svg { width: 18px; height: 18px; }
.retry-button:hover { background: #386b59; }
.retry-button:focus-visible { outline: 3px solid #cf5948; outline-offset: 4px; }
.page.is-over .footer, .page.is-over .ride-status { visibility: hidden; }
@keyframes result-stamp { 0% { opacity: 0; transform: scale(1.5) rotate(-10deg); } 65% { opacity: 1; transform: scale(0.96) rotate(-3deg); } 100% { transform: scale(1) rotate(-4deg); } }
.status { position: absolute; top: 49%; left: 50%; transform: translate(-50%, -50%); margin: 0; text-align: center; line-height: 1.8; font-size: 13px; width: min(300px, 85%); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .masthead { inset: 25px 24px auto; }
  h1 { font-size: 27px; }
  .eyebrow { font-size: 10px; }
  .club-mark span { display: none; }
  .club-mark svg { width: 32px; height: 32px; }
  .sound-button { top: 83px; right: 24px; }
  .game-over-content { top: 19%; }
  .game-over h2 { font-size: 52px; text-shadow: 2px 3px 0 #fffdec, 4px 5px 0 #294e43; }
  .run-result { margin: 17px 0 14px; }
  .footer { inset: auto 12px 22px; grid-template-columns: 1fr; justify-items: center; gap: 15px; }
  .controls { grid-row: 1; padding: 8px; gap: 5px; max-width: 100%; flex-wrap: wrap; justify-content: center; }
  .speed { flex-basis: 100%; justify-content: center; }
  .speed { gap: 7px; }
  .speed meter { width: 40px; }
  .ride-status { bottom: 151px; }
  .junction-status { bottom: 179px; }
  .route { font-size: 11px; }
  .route small, .footer-note { display: none; }
}
@media (max-width: 359px) {
  .controls { gap: 2px; }
  .icon-button { width: 34px; height: 34px; flex-basis: 34px; }
  .speed meter { width: 30px; }
  .speed span { display: none; }
  .game-over h2 { font-size: 42px; }
}
@media (max-width: 600px) {
  .ride-metrics { top: 18px; width: 224px; gap: 20px; }
  .ride-metric output { font-size: 22px; }
  .masthead { top: 84px; }
  .masthead .eyebrow, .masthead .subtitle { display: none; }
  .sound-button { top: 130px; }
  .game-over-content { top: max(155px, 19%); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .game-over h2 { animation: none; } }
