html, body { margin: 0; height: 100%; overflow: hidden; background: #e7d3b0; font-family: Georgia, 'Times New Roman', serif; color: #2b2416; }
canvas.game { display: block; width: 100%; height: 100%; }
.hidden { display: none !important; }
#hud { position: fixed; inset: 0; pointer-events: none; user-select: none; }
.tag { position: absolute; background: #f2e3c0; border: 2px solid #4a3220; border-radius: 6px; padding: 8px 14px;
  box-shadow: 3px 4px 0 rgba(58, 40, 14, .35); display: flex; align-items: baseline; gap: 8px; }
.tag b { font-size: 26px; font-variant-numeric: tabular-nums; margin-right: 10px; }
.lbl { font-size: 12px; letter-spacing: .14em; color: #7a5a38; }
.tl { left: 18px; top: 16px; transform: rotate(-1deg); }
.tr { right: 18px; top: 16px; transform: rotate(1deg); }
.bl { left: 18px; bottom: 18px; flex-direction: column; align-items: stretch; gap: 4px; min-width: 220px; transform: rotate(.6deg); }
.br { right: 18px; bottom: 18px; padding: 4px; transform: rotate(-.8deg); }
.street { font-size: 15px; font-style: italic; }
.speed b { font-size: 46px; line-height: 1; margin-right: 6px; }
.nos { display: flex; align-items: center; gap: 8px; }
.bar { flex: 1; height: 14px; background: #d9c8a0; border: 2px solid #4a3220; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: #3c8fb0; }
.bar i.on { background: #e2503a; }
#msg { position: absolute; left: 50%; top: 18%; transform: translateX(-50%) rotate(-1.5deg); background: #f2b33d; border: 2px solid #4a3220;
  border-radius: 6px; padding: 8px 18px; font-size: 26px; font-weight: bold; box-shadow: 3px 4px 0 rgba(58, 40, 14, .35); opacity: 0; }
#msg.show { opacity: 1; }
#count { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); font-size: 140px; font-weight: bold; color: #f2e3c0;
  -webkit-text-stroke: 3px #4a3220; text-shadow: 4px 5px 0 rgba(58, 40, 14, .35); }
.sheet { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-.4deg); background: #f2e3c0; border: 3px solid #4a3220;
  border-radius: 10px; padding: 22px 36px 24px; box-shadow: 6px 8px 0 rgba(58, 40, 14, .35); text-align: center; max-width: 92vw; z-index: 4; }
.sheet h1 { margin: 0 0 2px; font-size: 46px; color: #e2503a; -webkit-text-stroke: 1px #4a3220; }
.credit, .osm { margin: 0; font-size: 13px; color: #7a5a38; }
.sheet .sub, .route { margin: 6px 0; color: #5a4a30; }
.route { font-size: 14px; }
#pick { display: flex; gap: 12px; justify-content: center; margin: 12px 0; }
#pick button { background: #f6efe2; color: #3a291c; font-size: 22px; padding: 8px 18px; }
#pick button small { display: block; font-size: 12px; font-weight: normal; color: #7a5a38; }
#pick button.sel { background: #2f6b4f; color: #f2e3c0; }
#pick button.sel small { color: #efe4cc; }
.sheet table { margin: 0 auto 8px; border-spacing: 8px 4px; text-align: left; font-size: 15px; }
kbd { display: inline-block; min-width: 18px; text-align: center; padding: 1px 6px; background: #fff7e4; border: 2px solid #4a3220; border-radius: 4px; box-shadow: 1px 2px 0 #4a3220; font: bold 13px Georgia, serif; }
button { font: bold 22px Georgia, serif; color: #f2e3c0; background: #2f6b4f; border: 3px solid #4a3220; border-radius: 8px; padding: 8px 28px; box-shadow: 3px 4px 0 #4a3220; cursor: pointer; }
button:disabled { background: #8a927a; cursor: wait; }
#modes { display: flex; gap: 12px; justify-content: center; margin-top: 8px; }
#status { min-height: 1.2em; font-style: italic; margin: 4px 0; }
.touchhelp { display: none; }
.confetti { position: fixed; top: -12px; width: 10px; height: 16px; z-index: 6; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(200deg); } }

#touch, #rotate { display: none; }
html.touch, html.touch body { position: fixed; inset: 0; height: 100dvh; overscroll-behavior: none; touch-action: none; user-select: none; }
html.touch { --sl: max(10px, env(safe-area-inset-left)); --sr: max(10px, env(safe-area-inset-right)); --sb: max(10px, env(safe-area-inset-bottom)); --b: min(78px, 20vh); }
html.touch #touch { display: block; }
#touch > * { position: absolute; pointer-events: auto; touch-action: none; }
#pad { left: var(--sl); bottom: var(--sb); width: min(210px, 30vw); height: var(--b); border-radius: 999px; background: rgba(242, 227, 192, .72);
  border: 2px solid #4a3220; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; box-sizing: border-box; font-size: 22px; color: #4a3220; }
#knob { position: absolute; left: 50%; top: 50%; width: calc(var(--b) * .72); height: calc(var(--b) * .72); margin: calc(var(--b) * -.36) 0 0 calc(var(--b) * -.36);
  border-radius: 50%; background: #2f6b4f; border: 2px solid #4a3220; pointer-events: none; }
#tbtns { right: var(--sr); bottom: var(--sb); display: grid; grid-template-columns: repeat(2, var(--b)); grid-auto-rows: var(--b); gap: 9px; }
#tutil { left: 50%; bottom: var(--sb); transform: translateX(-50%); display: flex; gap: 7px; }
#touch button { font: bold 12px Georgia, serif; padding: 0; color: #2b2416; background: rgba(242, 227, 192, .82); border-radius: 14px; }
#touch button.gasb { background: rgba(47, 107, 79, .9); color: #f2e3c0; font-size: 15px; }
#touch button.nosb { background: rgba(60, 143, 176, .92); color: #f2e3c0; }
#touch button.down { transform: translate(2px, 3px); box-shadow: none; }
#tutil button { width: 46px; height: 30px; border-radius: 8px; font-size: 10px; }
html.touch .sheet table { display: none; }
html.touch .touchhelp { display: block; margin: 0 0 8px; font-size: 14px; }
html.touch .sheet h1 { font-size: 32px; }
html.touch .tl, html.touch .tr, html.touch .bl { transform: none; }
html.touch .tag b { font-size: 18px; }
html.touch .bl { left: 50%; top: 8px; bottom: auto; transform: translateX(-50%); flex-direction: row; align-items: center; min-width: 0; }
html.touch .br { width: 96px; height: 96px; top: 46px; bottom: auto; right: var(--sr); }
html.touch .speed b { font-size: 22px; }
#rotate { position: fixed; inset: 0; z-index: 9; background: #2f6b4f; color: #f2e3c0; align-items: center; justify-content: center; flex-direction: column; gap: 12px; text-align: center; font: bold 22px Georgia, serif; }
@media (orientation: portrait) { html.touch #rotate { display: flex; } }
