/* Nunito (SIL OFL 1.1, see vendor/nunito/OFL.txt) */
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 600 900; font-display: swap; src: url(vendor/nunito/nunito-latin.woff2) format('woff2'); }
/* The letters of each language (i18n.js sets <html lang>; a Language button carries its own): Nunito has only the Latin
   ones, the rest come from the device, and which ones must be said, or a Japanese page borrows Chinese shapes. */
:lang(zh-Hant) { font-family: 'Nunito', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', 'Noto Sans CJK TC', system-ui, sans-serif; }
:lang(zh-Hans) { font-family: 'Nunito', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', system-ui, sans-serif; }
:lang(ja) { font-family: 'Nunito', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Meiryo', 'Noto Sans JP', 'Noto Sans CJK JP', system-ui, sans-serif; }
:lang(ko) { font-family: 'Nunito', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', 'Noto Sans CJK KR', system-ui, sans-serif; word-break: keep-all; overflow-wrap: anywhere; }   /* (Korean breaks between words, not inside them, unless a word alone is too long) */
:root {
  --cream: rgba(255, 249, 236, 0.92);
  --wood: #c99b6b;
  --wood-dark: #9b6d43;
  --ink: #5b3a1e;
  --ink-soft: #8a6646;
  --accent: #e35b4f;
  --accent-dark: #b9443a;
  --gold: #f2b53a;
  --shadow: 0 3px 0 rgba(120, 80, 40, 0.22), 0 10px 24px rgba(60, 40, 20, 0.16);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #3d4a5a; color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, 'PingFang TC', sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#game.looking { cursor: grabbing; }
#game.stacking.grab { cursor: pointer; }
#game.stacking.grabbing { cursor: grabbing; }
[hidden] { display: none !important; }
/* (a phone's browser flashes its own grey box over anything tapped: a plain rectangle, which stuck out past the
   round corners of the buttons. 2026-11-26, the user, of the pick-up button: "按了之後…沒有彎角，是長方形的". Off
   everywhere: each button shows a press of its own) */
html { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus { outline: none; }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.card {
  background: var(--cream);
  border: 2px solid var(--wood);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
kbd {
  display: inline-grid; place-items: center;
  min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 6px; border: 1.5px solid var(--wood);
  background: #fffdf6; box-shadow: 0 2px 0 var(--wood);
  font: 800 12px/1 'Nunito', sans-serif; color: var(--ink);
}

/* ---------- HUD ---------- */
#hud {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 16px; right: 16px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px;
  pointer-events: none;
  padding-right: 148px; /* room for the corner buttons */
}
#hud > .card { padding: 6px 14px; display: flex; align-items: center; gap: 10px; min-height: 44px; }
.hud-left { justify-self: start; }
.hud-mid { justify-self: center; font-size: 20px; }
.hud-mid small { font-size: 13px; color: var(--ink-soft); margin-left: 3px; font-weight: 800; }
.hud-right { justify-self: end; }
.stat { display: flex; align-items: center; gap: 6px; font-size: 22px; }
.stat svg { width: 28px; height: 28px; }
.chip {
  background: var(--gold); color: #fff; font-weight: 900; font-size: 15px;
  padding: 2px 9px; border-radius: 999px; box-shadow: 0 2px 0 #c98d1c;
}
.chip.pop { animation: pop 0.35s ease-out; }
@keyframes pop { 40% { transform: scale(1.35); } }

.corner {
  position: fixed; top: max(12px, env(safe-area-inset-top)); right: 16px;
  display: flex; gap: 8px; z-index: 5;
}
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--cream); border: 2px solid var(--wood); border-radius: 12px;
  box-shadow: 0 3px 0 rgba(120, 80, 40, 0.25); color: var(--ink); padding: 0;
}
.icon-btn:hover { background: #fffdf6; }
#btn-sound .cross { display: none; }
#btn-sound.off .cross { display: inline; }
#btn-sound.off .waves { display: none; }
#btn-sound.off { color: var(--ink-soft); }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(120, 80, 40, 0.25); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .off { display: none; }
/* (the title's quick buttons: pressed = on, so not pressed is dimmed; the HUD speaker is the other way round, pressed = muted,
   and was dimmed while the sound was on, 2026-11-25 the user: "右上角的喇叭是半透明狀態") */
.icon-btn[aria-pressed="false"]:not(#btn-sound) { color: var(--ink-soft); opacity: 0.8; }
.icon-btn[aria-pressed="false"]:not(#btn-sound) .off { display: inline; }

.hint {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%); padding: 10px 18px; font-size: 16px; font-weight: 800;
  pointer-events: none; text-align: center; max-width: calc(100vw - 32px);
  animation: hintIn 0.35s ease-out;
}
@keyframes hintIn { from { opacity: 0; transform: translate(-50%, 10px); } }

/* notices while driving ("Cooler fell off!"): small cards in one fixed place under the HUD, newest at the bottom, three
   at most. 2026-11-25, the user: the words over the car shook with it while driving ("他會一直抖") → "1 固定在上方".
   They no longer follow the car. --pop-top is set by main.js (under the HUD, or under the guide's strip when it shows). */
#popups {
  position: fixed; left: 50%; top: var(--pop-top, 68px); transform: translateX(-50%);
  display: grid; justify-items: center; gap: 6px; pointer-events: none;
  width: max-content; max-width: min(520px, calc(100vw - 32px));
}
.popup {
  display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border-radius: 14px;
  background: #fffdf6; border: 2px solid var(--wood); box-shadow: 0 3px 0 rgba(120, 80, 40, 0.22);
  color: var(--ink); font-weight: 800; font-size: 16px; line-height: 1.25;
  animation: popIn 0.22s ease-out; transition: opacity 0.3s;
}
.popup i { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #f3e8d6; color: var(--wood-dark); font-style: normal; }
.popup i svg { width: 24px; height: 24px; }
.popup.bad { border-color: var(--accent); }
.popup.bad i { background: #ffe4dc; color: var(--accent-dark); }
.popup.good { border-color: #6fae4a; }
.popup.good i { background: #e3f4d3; color: #3f7a22; }
.popup.out { opacity: 0; }
.popup.again { animation: popAgain 0.25s ease-out; }
@keyframes popIn { from { opacity: 0; transform: translateY(-8px); } }
@keyframes popAgain { 40% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .popup, .popup.again { animation: none; } }

/* ---------- screens ---------- */
.overlay {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(255, 240, 210, 0.15), rgba(60, 40, 20, 0.28));
  z-index: 10; animation: fade 0.3s ease-out; overscroll-behavior: contain;
}
@keyframes fade { from { opacity: 0; } }
.panel {
  width: min(460px, 100%); padding: 26px 28px 22px; text-align: center;
  max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
  animation: rise 0.35s cubic-bezier(.2, 1.3, .5, 1);
}
.panel.small { width: min(340px, 100%); }
@keyframes rise { from { transform: translateY(16px) scale(0.97); } }
h1 { margin: 0 0 4px; font-size: 44px; font-weight: 900; letter-spacing: 0.5px; color: var(--ink); }
h1::after { content: ''; display: block; width: 90px; height: 5px; margin: 6px auto 0; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--accent) 0 30px, var(--gold) 30px 60px, #4f8fd6 60px 90px); }
h2 { margin: 0 0 12px; font-size: 26px; font-weight: 900; }
.subtitle { margin: 8px 0 0; font-size: 15px; font-weight: 900; letter-spacing: 2.5px; text-transform: uppercase; color: #3fae9c; }
.tag { margin: 8px 0 16px; color: var(--ink-soft); font-weight: 700; font-size: 15px; }
.how { list-style: none; margin: 0 0 20px; padding: 0; text-align: left; display: grid; gap: 9px; font-weight: 700; font-size: 14.5px; }
.how li { display: flex; align-items: center; gap: 10px; }
.keys { display: inline-flex; gap: 4px; flex: none; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; margin: 0 4px; }
.dot.rope { background: var(--accent); border: 2px solid var(--accent-dark); border-radius: 4px; }
.dot.swing { background: #e8cfa2; border: 2px solid var(--wood-dark); }
.dot.gold { background: #ffe7a6; box-shadow: 0 0 10px #ffdf8a; border: 1.5px solid #e8c468; }
.big-btn {
  min-height: 48px; padding: 10px 34px; border: 0; border-radius: 14px;
  background: var(--accent); color: #fff; font-size: 20px; font-weight: 900;
  box-shadow: 0 4px 0 var(--accent-dark);
}
/* a row of big buttons: side by side with room between, onto a second line with room above it (the 4 px drop
   shadow under each counted; 2026-11-25, the user: buttons were touching, "很多都會疊在一起") */
.row-btns { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 14px 10px; }
.big-btn:hover { filter: brightness(1.05); }
.big-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-dark); }
.big-btn.ghost { background: #fffdf6; color: var(--ink); border: 2px solid var(--wood); box-shadow: 0 4px 0 var(--wood); }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.best { margin: 14px 0 12px; color: var(--ink-soft); font-weight: 800; font-size: 14px; min-height: 1em; }
.sub { margin: 14px 0 0; color: var(--ink-soft); font-weight: 700; font-size: 13px; }
.newbest { margin: -4px 0 10px; color: var(--accent); font-weight: 900; font-size: 18px; animation: pop 0.6s ease-out; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.stats div { background: #fffdf6; border: 1.5px solid #ecdcc3; border-radius: 12px; padding: 8px; }
.stats dt { font-size: 12px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.6px; }
.stats dd { margin: 2px 0 0; font-size: 24px; font-weight: 900; }
.score { margin: 4px 0 0; font-size: 18px; font-weight: 800; }
.score b { font-size: 30px; color: var(--accent); margin-left: 6px; }

@media (max-width: 640px) {
  #hud { left: 10px; right: 10px; padding-right: 0; top: calc(max(12px, env(safe-area-inset-top)) + 52px); gap: 6px; }
  #hud > .card { padding: 4px 10px; min-height: 40px; }
  .corner { right: 10px; }
  .hud-mid { font-size: 17px; }
  .stat { font-size: 19px; }
  h1 { font-size: 36px; }
  .panel { padding: 20px 18px 18px; }
  .how { font-size: 13.5px; }
}

/* ---------- Rattle Road ---------- */
#hud-time, #hud-target { font-variant-numeric: tabular-nums; }
.dot.hole { background: #3a3d44; border: 2px solid #1e2025; box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.5); }
.dot.pick { background: #8fd17c; border: 2px solid #5aa04b; }
.how li { align-items: flex-start; line-height: 1.4; }
.how .keys, .how .dot { margin-top: 2px; }
.how kbd { min-width: 22px; height: 22px; font-size: 11.5px; }
.col-btns { display: grid; gap: 10px; }
.hint { bottom: max(14px, calc(env(safe-area-inset-bottom) + 8px)); width: max-content; padding: 8px 16px; font-size: 15px; }

/* the title: the trip, then one big button to start */
.level-line { margin: -6px 0 14px; font-weight: 800; font-size: 15px; color: var(--ink); }
.level-line .lv { display: inline-block; margin-right: 6px; padding: 1px 9px; border-radius: 999px; background: #4f8fd6; color: #fff; font-size: 13px; }
.pick-h { margin: 0 0 8px; font-weight: 900; font-size: 16px; }
/* the car's look: two small toggles on one line, the picked one filled */
body.touch .how .mouse-only { display: none; }
.looks-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 14px; }
.looks-row .pick-h { margin: 0; }
.looks { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }   /* (four looks on a phone: onto a second line, not past the card) */
.look { min-height: 44px; padding: 6px 14px; border: 2px solid var(--wood); border-radius: 999px; background: #fffdf6; font-weight: 800; font-size: 14px; color: var(--ink); }
.look:hover { background: #fff6e3; }
.look[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.look:focus-visible { outline: 3px solid #4f8fd6; outline-offset: 2px; }
.modes { display: grid; grid-template-columns: 1fr; gap: 8px; }
.mode {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 88px; padding: 10px 8px;
  border: 2px solid var(--wood); border-radius: 14px; background: #fffdf6; box-shadow: 0 4px 0 var(--wood); text-align: center;
}
.mode { min-height: 72px; border-color: var(--accent-dark); background: var(--accent); box-shadow: 0 4px 0 var(--accent-dark); }
.mode b { font-size: 22px; font-weight: 900; color: #fff; }
.mode span { font-size: 13px; font-weight: 700; color: #fff3e6; line-height: 1.3; }
.mode:hover { background: var(--accent); filter: brightness(1.06); }
.mode:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-dark); }
@media (max-width: 480px) {
  .modes { grid-template-columns: 1fr; }
  .mode { min-height: 56px; flex-direction: row; justify-content: space-between; text-align: left; padding: 8px 14px; }
  .mode span { text-align: right; }
}

/* the HUD: the clock (and the third star's time), how far along the road, what is still on the roof */
#hud { grid-template-columns: auto 1fr auto; }
.hud-left { gap: 8px; font-size: 22px; }
.hud-left svg { width: 26px; height: 26px; flex: none; color: var(--wood-dark); }
.hud-left b { min-width: 2.6em; }
.star-time { font-size: 12.5px; font-weight: 900; color: #c98d1c; white-space: nowrap; }
.star-time i { font-style: normal; color: var(--ink-soft); }
.star-time.missed { color: var(--ink-soft); opacity: 0.6; text-decoration: line-through; }
#hud-clock.low b { color: var(--accent-dark); }
.hud-mid { justify-self: center; gap: 8px; }
/* the compass: points at the camp from where the camera looks */
.hud-mid .arrow { width: 30px; height: 30px; flex: none; color: #7a2a22; transition: transform 0.12s linear; }
#hud-dist { min-width: 3.6em; text-align: right; font-variant-numeric: tabular-nums; }
/* the minimap: the whole valley, the car, the camp's flag, anything that fell */
.minimap {
  position: fixed; right: 16px; top: calc(max(12px, env(safe-area-inset-top)) + 58px);
  width: clamp(96px, 24vh, 172px); height: auto; aspect-ratio: 1; padding: 0; border-radius: 12px;
  pointer-events: none; image-rendering: auto; z-index: 2;
}
.hud-mid .flag { width: 22px; height: 22px; flex: none; color: var(--wood-dark); }
.gear-row { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.gear-row li { position: relative; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #fffdf6; border: 1.5px solid #ecdcc3; }
.gear-row li svg { width: 24px; height: 24px; }
.gear-row li.down { background: #ffe4dc; border-color: var(--accent); animation: low 0.8s ease-in-out infinite; }
.gear-row li.gone, .gear-row li.broken, .gear-row li.home { opacity: 0.35; filter: grayscale(1); }
.gear-row li.gone::after, .gear-row li.broken::after { content: ''; position: absolute; left: 3px; right: 3px; top: 50%; height: 2.5px; margin-top: -1px; background: var(--accent-dark); transform: rotate(-35deg); border-radius: 2px; }
@keyframes low { 50% { transform: scale(1.06); } }
@media (max-width: 640px) {
  #hud { grid-template-columns: auto 1fr; grid-template-areas: "left ." "right right" "mid mid"; top: max(12px, env(safe-area-inset-top)); row-gap: 6px; }
  .hud-left { grid-area: left; font-size: 19px; }
  .hud-right { grid-area: right; justify-self: start; }
  .hud-mid { grid-area: mid; justify-self: start; }
  .minimap { right: 10px; top: calc(max(12px, env(safe-area-inset-top)) + 106px); width: clamp(84px, 26vw, 120px); }
  .gear-row li { width: 28px; height: 28px; }
  /* (the notices: on the left like the HUD, and not under the minimap on the right) */
  #popups { left: 10px; transform: none; justify-items: start; gap: 5px; max-width: calc(100vw - 28px - clamp(84px, 26vw, 120px)); }
  .popup { font-size: 15px; padding: 4px 12px 4px 5px; }
  .popup i { width: 26px; height: 26px; border-radius: 8px; }
  .popup i svg { width: 21px; height: 21px; }
}


/* Pick up: big, bottom middle, with the time it takes filling it */
.pick-btn {
  position: fixed; left: 50%; bottom: max(84px, calc(env(safe-area-inset-bottom) + 76px)); transform: translateX(-50%); z-index: 6;
  min-width: 160px; min-height: 54px; padding: 8px 26px; border: 0; border-radius: 16px; overflow: hidden;
  background: #5aa04b; color: #fff; font-size: 20px; font-weight: 900; box-shadow: 0 4px 0 #3d7a32, 0 8px 20px rgba(0, 0, 0, 0.3);
}
.pick-btn > span { position: relative; z-index: 1; }
.pick-btn > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 255, 255, 0.3); border-radius: 16px 0 0 16px; }   /* (the loading bar: round on the left like the button, should a browser not clip it) */
.pick-btn:active { transform: translate(-50%, 3px); box-shadow: 0 1px 0 #3d7a32; }
.pick-btn { -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* phones and tablets: Go and Brake, bottom right (the stick is bottom left) */
.pedals { display: none; position: fixed; z-index: 5; right: calc(max(12px, env(safe-area-inset-right)) + 8px); bottom: max(18px, env(safe-area-inset-bottom)); gap: 12px; align-items: flex-end; }
body.touch .pedals:not([hidden]) { display: flex; }
.pedal {
  width: 86px; height: 86px; border-radius: 50%; border: 3px solid rgba(255, 253, 246, 0.95); color: #fff; font-size: 18px; font-weight: 900;
  touch-action: none; -webkit-tap-highlight-color: transparent; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3), 0 6px 16px rgba(0, 0, 0, 0.25); opacity: 0.88;
}
.pedal.go { width: 104px; height: 104px; background: #5aa04b; font-size: 22px; }
.pedal.brake { background: #c9493e; margin-bottom: 6px; }
/* the handbrake sits above Brake, so the row stays clear of the stick on a phone */
.pedal.hand { position: absolute; left: 7px; bottom: 104px; width: 72px; height: 72px; background: #d08a2a; font-size: 13px; line-height: 1.05; }
.pedal.down { transform: translateY(3px) scale(0.96); opacity: 1; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
body.touch .hint { bottom: max(218px, calc(env(safe-area-inset-bottom) + 212px)); }
body.touch .pick-btn { bottom: max(150px, calc(env(safe-area-inset-bottom) + 144px)); }

.big-btn:disabled { opacity: 0.5; cursor: default; filter: grayscale(0.5); }

/* the end card */
.stars { margin: -4px 0 6px; font-size: 44px; letter-spacing: 6px; line-height: 1; }
.stars i { font-style: normal; color: #e3d6c2; text-shadow: 0 2px 0 rgba(120, 80, 40, 0.2); }
.stars i.on { color: var(--gold); text-shadow: 0 2px 0 #c98d1c, 0 0 14px rgba(255, 200, 80, 0.7); animation: pop 0.5s ease-out backwards; }
.stars i.on:nth-child(2) { animation-delay: 0.25s; } .stars i.on:nth-child(3) { animation-delay: 0.5s; }
.over-why { margin: 0 0 10px; font-weight: 800; font-size: 14.5px; color: var(--ink-soft); }
.over-gear { list-style: none; margin: 0 0 12px; padding: 0; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.over-gear li { position: relative; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: #fffdf6; border: 1.5px solid #ecdcc3; }
.over-gear li svg { width: 28px; height: 28px; }
.over-gear li.lost { opacity: 0.35; filter: grayscale(1); }

.loading { position: fixed; inset: 0; display: grid; place-items: center; z-index: 60; background: #3d4a5a; color: #fffdf6; font-weight: 900; font-size: 18px; }
.loading[hidden] { display: none; }

/* the thumb stick (phones and tablets only, src/stick.js): faint in the bottom left corner while a run is on, until a finger
   goes down on the game view; then it sits under that finger and the knob follows it (never out of the ring). It takes no
   touches itself: the game view under it does */
.stick { display: none; position: fixed; z-index: 4; left: calc(max(12px, env(safe-area-inset-left)) + 12px); bottom: max(18px, env(safe-area-inset-bottom));
  width: 112px; height: 112px; border-radius: 50%; pointer-events: none; opacity: 0.55; transition: opacity 0.15s ease;
  border: 3px solid rgba(255, 253, 246, 0.9); background: radial-gradient(circle, rgba(91, 58, 30, 0.10), rgba(91, 58, 30, 0.28));
  box-shadow: 0 2px 10px rgba(60, 40, 20, 0.2); }
body.touch .stick:not([hidden]) { display: block; }
.stick.held { bottom: auto; translate: -50% -50%; opacity: 1; transition: none; }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%;
  background: #fffdf6; border: 2px solid var(--wood); box-shadow: var(--shadow); }
.stick.held .stick-knob { border-color: var(--accent); }
/* the word under the resting stick, until the first time a finger takes it */
.stick-word { position: absolute; left: 50%; top: calc(100% + 4px); translate: -50% 0; white-space: nowrap; font-family: inherit; font-weight: 800; font-size: 12px; line-height: 1;
  color: #fffdf6; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55); }
.stick.held .stick-word, .stick.used .stick-word { display: none; }
/* with the stick resting in the corner, hints sit above it */
body.touch .hint { bottom: max(218px, calc(env(safe-area-inset-bottom) + 212px)); }

/* ---------- the ten trips (2026-11-24) ---------- */
.trip { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 6px; margin: -4px 0 4px; }
.trip-arrow { width: 44px; height: 44px; border: 2px solid var(--wood); border-radius: 50%; background: #fffdf6; font-size: 26px; font-weight: 900; line-height: 1; color: var(--ink); padding: 0 0 3px; }
.trip-arrow:hover { background: #fff6e3; }
.trip-arrow:disabled { opacity: 0.35; cursor: default; background: #fffdf6; }
.trip-arrow:focus-visible, .link-btn:focus-visible, .paint:focus-visible, .livery:focus-visible { outline: 3px solid #4f8fd6; outline-offset: 2px; }
.trip-card { min-width: 0; }
.trip-card .level-line { margin: 0 0 4px; }
.trip-stars { color: #e0a21c; letter-spacing: 1px; white-space: nowrap; }
.trip-blurb { margin: 0 0 6px; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); line-height: 1.35; min-height: 2.7em; }
.trip-gear { justify-content: center; }
.trip-gear li { width: 26px; height: 26px; }
.trip-all { margin: 0 0 12px; }
.link-btn { min-height: 36px; padding: 4px 10px; border: 0; background: none; color: #3d6fb0; font-weight: 800; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
/* the trip map: the camp journal (2026-11-25, version C of tools/map-versions.html) */
.map-btn::before { content: '🏕 '; text-decoration: none; display: inline-block; margin-right: 2px; }
.trips-panel { position: relative; width: min(1040px, 100%); text-align: left; padding: 24px 28px 18px 64px; border-radius: 10px 14px 14px 10px;
  background: #fbf4e2 repeating-linear-gradient(transparent 0 31px, #e6d9bd 31px 32px); box-shadow: 0 8px 0 #4e3d2d, 0 20px 40px rgba(0,0,0,.35); color: var(--ink); }
.trips-panel::before { content: ''; position: absolute; left: 22px; top: 18px; bottom: 18px; width: 16px; background: radial-gradient(circle at 8px 12px, #6f5a45 5px, transparent 6px) 0 0 / 16px 34px repeat-y; pointer-events: none; }
.trips-panel h2 { margin: 0 0 2px; font-size: 26px; font-weight: 900; }
.trips-sub { margin: 0 0 16px; color: var(--ink-soft); font-weight: 700; }
.trips-x { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; background: none; font-size: 22px; color: var(--ink-soft); border-radius: 10px; }
.trips-x:hover { background: rgba(155,109,67,.12); }
.trips-panel > .row-btns { margin-top: 18px; }
.trips-msg { position: sticky; bottom: 0; z-index: 3; margin: 14px 0 6px; padding: 10px 14px; text-align: center; font-weight: 800; color: #b9443a; background: #fff9ec; border: 2px solid var(--wood); border-radius: 12px; box-shadow: 0 4px 12px rgba(60,40,20,.18); }
.trips-msg:empty { display: none; }
.stamps { list-style: none; margin: 0; padding: 6px 4px 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 30px 24px; }
.stamps li { position: relative; }
.stamps li:nth-child(odd) { rotate: -1.6deg; } .stamps li:nth-child(3n) { rotate: 1.4deg; }
.stamp { position: relative; display: block; width: 100%; border: 0; text-align: center; color: var(--ink); padding: 7px;
  background: radial-gradient(circle, transparent 4px, var(--sc, #fff) 4.6px) -6px -6px / 12px 12px;
  filter: drop-shadow(0 2px 2px rgba(80,50,20,.25)); transition: transform .15s; }
.stamp:hover, .stamp:focus-visible { transform: translateY(-3px) scale(1.03); }
.stamp:focus-visible { outline: 3px solid #4f8fd6; outline-offset: 4px; }
.stamp .in { display: block; background: var(--sc, #fff); padding: 7px 7px 5px; }
.stamp .pic { display: block; aspect-ratio: 4 / 3; border-radius: 3px; overflow: hidden; }
.stamp .pic svg { display: block; width: 100%; height: 100%; }
.stamp .nm { display: block; font-weight: 900; font-size: 15px; margin-top: 6px; line-height: 1.15; }
.stamp .st { display: block; color: #e0a21c; font-size: 15px; letter-spacing: 1px; min-height: 20px; }
.stamp .st .off { color: #e3d3b6; }
.stamp .st em { font-style: normal; color: #e35b4f; font-size: 13px; font-weight: 900; letter-spacing: 0; }
.stamp .no { position: absolute; top: 18px; left: 18px; z-index: 1; background: rgba(255,255,255,.9); border-radius: 8px; font-weight: 900; font-size: 12px; padding: 1px 7px; }
.stamp.locked { --sc: #f1e8d6; cursor: default; }
.stamp.locked:hover { transform: none; }
.stamp.locked .pic { display: grid; place-items: center; background: repeating-linear-gradient(45deg, #ece0c8 0 8px, #e6d8bc 8px 16px); color: #a99678; font-size: 34px; font-weight: 900; }
.stamp.locked .nm { color: #a99678; }
.stamp.open { outline: 3px dashed #e35b4f; outline-offset: 4px; }
.stamp.open:focus-visible { outline: 3px solid #4f8fd6; }
.stamp .postmark { position: absolute; right: 4px; top: 6px; width: 70px; height: 70px; rotate: -14deg; pointer-events: none; opacity: .82; }
.stamp-car { position: absolute; left: -22px; top: -26px; width: 64px; z-index: 2; pointer-events: none; }
.stamp-car svg { display: block; width: 100%; height: auto; }
@media (max-width: 860px) { .stamps { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) {
  .trips-panel { padding: 20px 14px 14px 40px; } .trips-panel::before { left: 10px; }
  .trips-panel h2 { font-size: 22px; padding-right: 40px; }
  .stamps { grid-template-columns: repeat(2, 1fr); gap: 26px 16px; }
  .stamp .nm { font-size: 14px; }
}

/* the Car button and its sheet */
.car-btn { display: inline-flex; align-items: center; gap: 8px; }
.paint-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(60, 40, 20, 0.35); background: #58d29e; flex: none; }
.sheet { position: fixed; inset: 0; z-index: 11; display: flex; justify-content: flex-end; align-items: stretch; padding: 16px; overscroll-behavior: contain; }
.sheet-card { width: min(400px, 100%); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; padding: 20px 20px 18px; animation: slide 0.25s ease-out; align-self: center; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.sheet-card h2 { margin-bottom: 10px; }
.sheet-card .pick-h { margin: 6px 0 8px; }
.paints { display: flex; flex-wrap: wrap; gap: 10px; padding: 3px; margin: 0 0 10px; }
.paint { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fffdf6; box-shadow: 0 0 0 2px var(--wood); }
.paint[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--accent); }
.liveries { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 14px; }
.livery { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 44px; padding: 6px 4px 8px; border-radius: 14px; }
.livery img, .livery .none { width: 64px; height: 64px; object-fit: contain; }
.livery .none { display: grid; place-items: center; border: 2px dashed #d8c8ae; border-radius: 12px; color: var(--ink-soft); font-size: 22px; font-style: normal; }   /* (an <i>: upright, not the browser's slant; 2026-11-25 the user: "為何加號是斜的") */
.mine-add .none { font-size: 30px; font-weight: 800; line-height: 1; }
.livery span { font-size: 12.5px; line-height: 1.2; }
.look.livery[aria-pressed="true"] { background: #fff1e6; color: var(--ink); box-shadow: 0 0 0 2px var(--accent) inset; }
@media (max-width: 640px) {
  .sheet { padding: 0; align-items: flex-end; }
  .sheet-card { width: 100%; max-height: 62dvh; border-radius: 18px 18px 0 0; padding-inline: 14px; align-self: flex-end; padding-bottom: max(18px, env(safe-area-inset-bottom)); animation-name: up; }
  @keyframes up { from { transform: translateY(24px); opacity: 0; } }
  .liveries { grid-template-columns: repeat(3, 1fr); }
}

/* the first-time guide */
.lesson { position: fixed; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 64px); transform: translateX(-50%); z-index: 6; display: grid; gap: 6px; padding: 10px 18px 12px; font-weight: 800; font-size: 17px; width: max-content; max-width: min(560px, calc(100vw - 32px)); animation: rise 0.35s ease-out; }
.lesson-top { display: flex; gap: 10px; align-items: center; }
.lesson-top b { flex: none; padding: 1px 9px; border-radius: 999px; background: #4f8fd6; color: #fff; font-size: 13px; }
.lesson.done .lesson-top b { background: #4aa04a; }
/* a step done: the strip gives a little hop and a green glow (main.js stepDone) */
.lesson.done { animation: lesson-pop 0.45s ease-out; box-shadow: 0 0 0 3px rgba(74, 160, 74, 0.55), var(--shadow); }
@keyframes lesson-pop { 0% { scale: 1; } 40% { scale: 1.08; } 100% { scale: 1; } }
@media (prefers-reduced-motion: reduce) { .lesson.done { animation: none; } }
.lesson-dots { display: flex; gap: 5px; }
.lesson-dots i { width: 9px; height: 9px; border-radius: 50%; background: #e3d6bb; }
.lesson-dots i.on { background: #4aa04a; }
.lesson-dots i.now { background: var(--accent); box-shadow: 0 0 0 3px rgba(242, 181, 58, 0.45); }
.lesson-skip { margin-left: auto; min-height: 32px; padding: 4px 8px; border: 0; background: none; color: var(--ink-soft); font: inherit; font-size: 13px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lesson-skip:hover { color: var(--ink); }
.lesson.done .lesson-skip { display: none; }
.chip { display: inline-block; padding: 0 8px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 0.9em; }
.guide { background: rgba(60, 40, 20, 0.22); }
.guide-card { width: min(420px, 100%); padding: 20px 24px 16px; background: #fbf4e6; }
.guide-n { margin: 0 0 4px; color: #4f8fd6; font-weight: 900; font-size: 14px; }
.guide-done { margin: 0 0 6px; color: #3f8a3f; font-weight: 800; font-size: 14px; }
.guide-art { margin: 4px auto 6px; width: min(240px, 100%); }
.guide-art svg { display: block; width: 100%; height: auto; }
.guide-how { text-align: left; font-weight: 700; font-size: 15.5px; line-height: 1.5; margin: 0 0 14px; }
.guide-how p { margin: 0 0 8px; }
.guide-how kbd { min-width: 24px; height: 24px; }
.guide .col-btns .lesson-skip { margin: 0 auto; min-height: 44px; }
@media (prefers-reduced-motion: reduce) { .guide-art svg * { animation: none !important; } }
.lesson kbd { min-width: 24px; height: 24px; }
/* (a phone: below the distance and the minimap, the whole width) */
@media (max-width: 640px) {
  .lesson { top: calc(max(12px, env(safe-area-inset-top)) + 232px); left: 16px; right: 16px; transform: none; width: auto; max-width: none; font-size: 15px; padding: 8px 14px 10px; }
  .guide-how { font-size: 15px; }
  .paints { gap: 10px 12px; }   /* (seven on two lines rather than rings touching) */
}
.pedal.teach { animation: teach 0.9s ease-in-out infinite; }
@keyframes teach { 50% { box-shadow: 0 0 0 6px rgba(242, 181, 58, 0.85); } }

/* the night at the camp */
.camp { position: fixed; inset: auto 0 0 0; z-index: 10; display: flex; justify-content: center; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); pointer-events: none; }
.camp-card { pointer-events: auto; width: min(560px, 100%); padding: 16px 20px; text-align: center; background: rgba(255, 249, 236, 0.92); animation: rise 0.5s ease-out; }
.camp-card h2 { font-size: 22px; margin: 0 0 6px; }
.camp-say { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; font-weight: 700; font-size: 15px; color: var(--ink); }
.camp-say li { animation: fade 0.6s ease-out both; }
.camp-say li:nth-child(2) { animation-delay: 0.8s; } .camp-say li:nth-child(3) { animation-delay: 1.6s; } .camp-say li:nth-child(4) { animation-delay: 2.4s; }

/* the settings sheet (settings.js) */
.set-note { margin: 0 0 10px; color: var(--ink-soft); font-weight: 700; font-size: 13.5px; line-height: 1.4; }
.set-paper { margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; background: #fff1d6; font-weight: 700; font-size: 14px; }
.set-paper .link-btn { min-height: 44px; }
.sliders { display: grid; gap: 4px; margin: 12px 0 8px; }
.slider { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; }
.slider label { font-weight: 800; font-size: 15px; }
.slider output { font-weight: 900; font-variant-numeric: tabular-nums; color: var(--accent-dark); min-width: 4.2em; text-align: right; }
.slider input { grid-column: 1 / -1; width: 100%; height: 36px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.slider small { grid-column: 1 / -1; margin: -6px 0 4px; color: var(--ink-soft); font-weight: 700; font-size: 12.5px; }
/* the pause card's two volumes, above its buttons */
.vol-sliders { margin: 4px 0 14px; text-align: left; }
.vol-sliders output { min-width: 3.2em; }
.set-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; font-size: 14px; cursor: pointer; }
.set-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.set-check[hidden] { display: none; }
/* (the end card after the last trip: the whole game done) */
.o-finale { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: linear-gradient(135deg, #fff1c8, #ffe0e6); border: 2px solid #f2b53a; font-weight: 800; font-size: 15px; line-height: 1.35; color: var(--ink); }
.o-finale[hidden] { display: none; }
/* (My pictures: each in a cell with its own tick "On the car"; unticked, kept but not on the car, shown faded) */
.mine-cell { display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-width: 0; }
.mine-cell .livery { width: 100%; }
.mine-cell.off .livery img { opacity: .38; filter: grayscale(.7); }
.mine-show { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 2px; font-weight: 700; font-size: 12.5px; line-height: 1.15; color: var(--ink); cursor: pointer; border-radius: 10px; }
.mine-show:hover { background: #fff1e6; }
.mine-show input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.mine-show:has(input:focus-visible) { outline: 3px solid #4f8fd6; outline-offset: 1px; }
.mine-show input:focus-visible { outline: none; }
.mine-add { align-self: start; }
.set-status { min-height: 1.3em; margin: 6px 0 8px; font-weight: 800; font-size: 14px; color: var(--ink-soft); }
.set-status.dirty { color: var(--accent-dark); }
.set-unsaved { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: #ffe6e1; border: 2px solid var(--accent); }
.set-unsaved p { margin: 0 0 8px; font-weight: 900; }
.set-unsaved .row-btns { justify-content: flex-start; margin: 0; }
.set-btns { flex-wrap: wrap; justify-content: flex-start; gap: 14px 10px; margin: 0; }
.settings-card .row-btns .big-btn { padding: 8px 16px; font-size: 16px; min-height: 44px; }
.big-btn:disabled { opacity: 0.45; cursor: default; filter: none; transform: none; }
/* (while the sheet is open: where the top and the bottom blur begin) */
.blur-guides { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.blur-guides i { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 1px rgba(40, 30, 20, 0.35); }
.blur-guides span { position: absolute; left: 12px; padding: 2px 8px; border-radius: 8px; background: rgba(40, 30, 20, 0.6); color: #fff; font-size: 12px; font-weight: 800; font-style: normal; }
.blur-guides .bg-top span { top: 4px; }
.blur-guides .bg-bottom span { bottom: 4px; }
.settings-card { background: #fbf4e6; }
@media (max-width: 640px) { .settings-card { max-height: 48dvh; } }

/* ---------- the story trips: the travel journal (journal.js), the polaroid (2026-11-24) ---------- */
/* (on the left over the waiting car, so its roof fills up on the right; a sheet from the bottom on a phone) */
.journal { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; padding: 16px 16px 16px max(24px, 4vw); pointer-events: none; animation: fade 0.3s ease-out; }
.j-page {
  pointer-events: auto; position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
  padding: 18px 22px 18px 30px; border-radius: 6px 16px 16px 6px; text-align: center; color: var(--ink);
  /* kraft paper, faint lines, a stitched spine on the left */
  background:
    linear-gradient(90deg, rgba(90, 60, 30, 0.22) 0 10px, transparent 10px),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(120, 90, 50, 0.1) 27px 28px),
    #ecdcbc;
  box-shadow: 0 4px 0 #b8946a, 0 14px 30px rgba(40, 25, 10, 0.3);
  animation: rise 0.35s cubic-bezier(.2, 1.3, .5, 1);
}
.j-page::before { content: ''; position: absolute; left: 4px; top: 14px; bottom: 14px; border-left: 2px dashed rgba(255, 245, 225, 0.75); }
.j-top { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-weight: 900; font-size: 14px; }
.j-n { color: var(--accent-dark); letter-spacing: 0.5px; text-transform: uppercase; }
.j-count { color: var(--ink-soft); }
.j-top .lesson-skip { min-height: 44px; }
.j-card { position: relative; margin: 6px auto 12px; width: min(340px, 100%); padding: 8px 8px 10px; background: #fffdf8; box-shadow: 0 2px 6px rgba(60, 40, 20, 0.22); transform: rotate(-1.4deg); }
.j-card.in { animation: jcard 0.4s cubic-bezier(.2, 1.3, .5, 1); }
@keyframes jcard { from { transform: rotate(-6deg) translateY(-14px) scale(0.94); opacity: 0; } }
.j-card img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.j-card.lost img { filter: grayscale(0.85) brightness(0.92); }
.j-tape { position: absolute; top: -10px; left: 50%; width: 92px; height: 22px; transform: translateX(-50%) rotate(3deg); background: rgba(242, 181, 58, 0.55); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.j-stamp { position: absolute; right: 10px; bottom: 16px; padding: 4px 10px; border: 3px solid currentColor; border-radius: 8px; font-weight: 900; font-size: 18px; transform: rotate(-10deg); background: rgba(255, 253, 248, 0.7); animation: stamp 0.35s cubic-bezier(.3, 1.6, .6, 1) 0.2s both; }
.j-stamp.ok { color: #2f7a35; }
.j-stamp.bad { color: #c2382e; right: auto; left: 50%; bottom: 40%; transform: translateX(-50%) rotate(-14deg); font-size: 20px; }
@keyframes stamp { from { opacity: 0; scale: 2.2; } }
.journal h2 { margin: 0 0 4px; font-size: 25px; }
.j-text { margin: 0 0 12px; font-weight: 700; font-size: 16px; line-height: 1.45; color: #6a4a2c; font-style: italic; min-height: 2.9em; }
.journal.j-chapter .j-text { font-size: 17px; }
.j-dots { list-style: none; margin: 0 0 14px; padding: 0; display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
.j-dots li { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 253, 246, 0.55); border: 1.5px dashed #c9ab80; opacity: 0.55; }
.j-dots li svg { width: 24px; height: 24px; }
.j-dots li.done { opacity: 1; border-style: solid; background: #fffdf6; }
.j-dots li.lost { opacity: 0.45; filter: grayscale(1); border-style: solid; }
.j-dots li.now { opacity: 1; border: 2px solid var(--accent); }
.journal .row-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.journal .row-btns .big-btn { padding: 10px 24px; }
.j-fly { position: fixed; z-index: 30; pointer-events: none; border: 4px solid #fffdf8; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25); transform-origin: center; }
@media (max-width: 640px) {
  .journal { align-items: flex-end; padding: 0; }
  .j-page { width: 100%; max-height: 72dvh; border-radius: 18px 18px 0 0; padding: 12px 16px max(14px, env(safe-area-inset-bottom)) 16px; background: repeating-linear-gradient(0deg, transparent 0 27px, rgba(120, 90, 50, 0.1) 27px 28px), #ecdcbc; }
  .j-page::before { display: none; }
  .j-card { width: min(250px, 70%); margin-bottom: 8px; }
  .journal h2 { font-size: 21px; }
  .j-text { font-size: 15px; min-height: 0; margin-bottom: 8px; }
  .j-dots li { width: 30px; height: 30px; }
  .journal .row-btns .big-btn { flex: 1; padding: 10px 12px; font-size: 18px; }
}

/* the camera's flash, and the photo on the results */
.flash { position: fixed; inset: 0; z-index: 40; background: #fff; pointer-events: none; animation: flash 0.7s ease-out both; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.camp-line { margin: 0 0 12px; font-weight: 800; font-size: 17px; color: var(--ink); min-height: 1.4em; }
/* (side by side: as wide as the two of them, never cut; the tilted photo has room round it. A narrow screen stacks them
   and scrolls, 2026-11-24: at 1030 px the row came out 20 px too narrow, a scrollbar and the photo's corner clipped) */
.over-wrap { display: flex; align-items: center; justify-content: center; gap: 28px; width: max-content; max-width: 100%; padding: 12px; }
.over-wrap .panel { flex: none; width: min(460px, calc(100vw - 32px)); }
.polaroid { flex: none; margin: 0; width: min(330px, 80vw); padding: 12px 12px 0; background: #fffdf8; box-shadow: 0 6px 18px rgba(30, 20, 10, 0.35); transform: rotate(-3deg); animation: polaroid 0.6s cubic-bezier(.2, 1.2, .5, 1); }
@keyframes polaroid { from { transform: rotate(-12deg) translateY(40px) scale(0.85); opacity: 0; } }
.polaroid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #1a1d26; animation: develop 2.6s ease-out 0.3s both; }
@keyframes develop { from { filter: brightness(2.4) saturate(0) blur(3px); opacity: 0.6; } 60% { filter: brightness(1.2) saturate(0.6) blur(0.5px); } }
.polaroid figcaption { padding: 10px 4px 14px; font-weight: 800; font-style: italic; font-size: 17px; color: #4a3a6a; text-align: center; transform: rotate(-1deg); }
@media (max-width: 860px) {
  .over-wrap { flex-direction: column; justify-content: flex-start; gap: 14px; width: 100%; max-height: calc(100dvh - 32px); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
  .over-wrap .panel { max-height: none; overflow: visible; }
  .polaroid { width: min(170px, 46vw); padding: 7px 7px 0; margin-top: 4px; }
  .polaroid figcaption { font-size: 14px; padding: 6px 2px 10px; }
}
@media (prefers-reduced-motion: reduce) { .j-card.in, .j-stamp, .polaroid, .polaroid img, .flash { animation: none; } .flash { opacity: 0; } }

/* ---------- the crew way: who's coming (crewpick.js), stacking the roof (2026-11-24) ---------- */
.crewpick .j-page { width: min(520px, 100%); }
.cp-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.cp-card {
  position: relative; width: 100%; min-height: 44px; display: grid; justify-items: center; gap: 2px; padding: 8px 6px 9px;
  border: 2px solid #d9c09a; border-radius: 12px; background: #f8f0de; color: var(--ink); font: inherit; cursor: pointer;
  transition: transform 0.12s, background 0.12s, border-color 0.12s;
}
.cp-card:hover { background: #fffdf6; }
.cp-card[aria-pressed="true"] { background: #fffdf6; border-color: var(--accent); box-shadow: 0 3px 0 rgba(227, 91, 79, 0.35); }
.cp-card[aria-pressed="false"] .cp-face { filter: grayscale(0.55); opacity: 0.75; }
.cp-card.must { cursor: default; }
.cp-card.shake { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.cp-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cp-face { position: relative; width: 76px; height: 76px; border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--jacket, #c9ab80) 28%, #fffaf0); display: grid; place-items: center; box-shadow: 0 0 0 3px #fffdf8; }
.cp-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.cp-face img:not([hidden]) ~ i { display: none; }
.cp-face i { font-style: normal; font-weight: 900; font-size: 30px; color: var(--jacket, #6a4a2c); }
.cp-name { font-size: 15px; margin-top: 4px; }
.cp-item { display: flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.cp-item svg { width: 18px; height: 18px; flex: none; }
.cp-size { font-size: 12px; font-weight: 900; padding: 1px 8px; border-radius: 99px; background: #efe1c4; }
.cp-size.s-l { background: #f6d38b; }
.cp-size.s-xl { background: #f2a25c; color: #fffdf8; }
.cp-must { position: absolute; top: 6px; right: -4px; padding: 1px 6px; border: 2px solid #2f7a35; border-radius: 6px; color: #2f7a35; background: rgba(255, 253, 248, 0.85); font-size: 11px; font-weight: 900; transform: rotate(8deg); }
.cp-tick { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c9ab80; background: #fffdf8; }
.cp-card[aria-pressed="true"] .cp-tick { border-color: var(--accent); background: var(--accent); }
.cp-card[aria-pressed="true"] .cp-tick::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 900; }
.cp-sum { margin: 0 0 10px; font-weight: 900; }

.stackbar { position: fixed; left: max(16px, 3vw); bottom: 16px; z-index: 10; width: min(360px, calc(100vw - 32px)); padding: 12px 14px 14px; border-radius: 16px; color: var(--ink);
  background: repeating-linear-gradient(0deg, transparent 0 27px, rgba(120, 90, 50, 0.1) 27px 28px), #ecdcbc; box-shadow: 0 4px 0 #b8946a, 0 14px 30px rgba(40, 25, 10, 0.3); animation: rise 0.35s cubic-bezier(.2, 1.3, .5, 1); }
.sb-card { display: flex; align-items: center; gap: 12px; text-align: left; }
.sb-face { width: 64px; height: 64px; flex: none; }
.sb-txt h2 { margin: 0; font-size: 20px; }
.sb-what { margin: 0; font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.sb-help { margin: 8px 0; border-radius: 10px; background: rgba(255, 253, 246, 0.55); }
.sb-help summary { min-height: 36px; display: flex; align-items: center; gap: 6px; padding: 0 10px; font-size: 13px; font-weight: 900; color: #6a4a2c; cursor: pointer; list-style: none; border-radius: 10px; }
.sb-help summary::-webkit-details-marker { display: none; }
.sb-help summary::after { content: '▾'; margin-left: auto; transition: transform 0.15s; }
.sb-help:not([open]) summary::after { transform: rotate(-90deg); }
.sb-help summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.sb-keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; padding: 0 10px 10px; font-size: 13px; }
.sb-keys dt { font-weight: 900; color: var(--ink); white-space: nowrap; }
.sb-keys dd { margin: 0; color: #6a4a2c; font-weight: 700; }
.sb-keys kbd { display: inline-block; min-width: 18px; padding: 0 4px; border: 1px solid #cdb08a; border-bottom-width: 2px; border-radius: 4px; background: #fffdf6; font: inherit; font-size: 12px; text-align: center; }
.sb-oops { margin: -4px 0 8px; font-weight: 900; color: #c2382e; }
.stackbar .row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.stackbar .row-btns .big-btn { flex: 1 1 auto; padding: 8px 14px; font-size: 16px; min-height: 44px; }
/* set off before all is up: a quiet text button under the others; pressed once it asks, in the accent colour */
.stackbar .sb-early { display: block; width: 100%; margin-top: 6px; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft, #6b5440); font: inherit; font-size: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.stackbar .sb-early:hover { background: rgba(0, 0, 0, 0.05); }
.stackbar .sb-early:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stackbar .sb-early.armed { color: #fff; background: var(--accent); text-decoration: none; }
.stackbar .sb-early[hidden] { display: none; }
@media (max-width: 640px) {
  .crewpick .cp-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cp-face { width: 60px; height: 60px; }
  .stackbar { left: 0; right: 0; bottom: 0; width: 100%; border-radius: 18px 18px 0 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .sb-face { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) { .cp-card.shake, .stackbar { animation: none; } }
/* (two ways to start when the trip has a crew: "Bring the crew" beside "Let's go", in teal) */
.modes:has(#btn-crew:not([hidden])) { grid-template-columns: 1fr 1fr; }
.mode[data-mode="crew"] { background: #2f8f83; border-color: #1f6b62; box-shadow: 0 4px 0 #1f6b62; }
.mode[data-mode="crew"]:hover { background: #2f8f83; }
.mode[data-mode="crew"]:active { box-shadow: 0 1px 0 #1f6b62; }
/* (the crew way's check at the camp: their square portrait on the card) */
.j-card.face { width: min(250px, 100%); }
/* (the companions' pictures are the game's 3D campers on a clear background, tools/portraits.html: a pale tint of their jacket behind) */
.j-card.face img { aspect-ratio: 1 / 1; object-position: 50% 50%; background: color-mix(in srgb, var(--jacket, #c9ab80) 28%, #fffaf0); }
@media (max-width: 640px) { .j-card.face { width: min(170px, 55%); } }
/* (the crew page: its total and buttons stay at the bottom while the cards scroll) */
.crewpick .j-page { padding-bottom: 0; }
.cp-foot { position: sticky; bottom: 0; margin: 0 -22px 0 -30px; padding: 8px 22px 16px 30px; background: linear-gradient(rgba(236, 220, 188, 0.85), #ecdcbc 30%); }
.cp-list { gap: 8px; }
.cp-card { padding: 6px 6px 8px; }
.cp-face { width: 64px; height: 64px; }
@media (max-width: 640px) { .cp-foot { margin: 0 -16px; padding: 8px 16px max(14px, env(safe-area-inset-bottom)); } .cp-face { width: 54px; height: 54px; } }

/* ---------- the title: a page of the camp journal (2026-11-25, version C of tools/menu-versions.html) ---------- */
.title-screen { place-items: center start; padding-left: clamp(16px, 5vw, 72px); background: linear-gradient(90deg, rgba(60,40,20,.18), transparent 55%); }
.title-page { position: relative; width: 430px; text-align: left; rotate: -1.2deg; padding: 24px 24px 18px 58px; border-radius: 8px 14px 14px 8px; color: var(--ink);
  background: #fbf4e2 repeating-linear-gradient(transparent 0 31px, #e6d9bd 31px 32px); box-shadow: 0 7px 0 #4e3d2d, 0 20px 40px rgba(0,0,0,.3); }
.title-page::before { content: ''; position: absolute; left: 18px; top: 16px; bottom: 16px; width: 16px; background: radial-gradient(circle at 8px 12px, #6f5a45 5px, transparent 6px) 0 0 / 16px 34px repeat-y; pointer-events: none; }
.tp-head { display: grid; grid-template-columns: 1fr 124px; gap: 10px; align-items: start; }
.title-page h1 { font-size: 46px; line-height: .95; }
.title-page h1::after { margin: 10px 0 0; }
/* (the Chinese name, main.js nameZh: two halves that never break inside; set a little smaller and looser, the
   characters being wider and taller than the Latin letters) */
.title-page h1.zh { font-size: 40px; line-height: 1.12; letter-spacing: 1px; }
.title-page h1.zh span { display: inline-block; }
.title-page .subtitle { margin: 8px 0 0; font-size: 12.5px; letter-spacing: 1.6px; white-space: nowrap; }
.tp-photo { position: relative; display: block; background: #fff; padding: 6px 6px 22px; rotate: 4deg; box-shadow: 0 3px 8px rgba(60,40,20,.25); margin-top: 4px; }
.tp-photo .pic { display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.tp-photo .pic svg { display: block; width: 100%; height: 100%; }
.tp-photo .cap { position: absolute; left: 0; right: 0; bottom: 3px; text-align: center; font-size: 11px; font-weight: 900; color: var(--ink-soft); }
.tp-photo::before { content: ''; position: absolute; top: -9px; left: 50%; translate: -50% 0; rotate: -6deg; width: 54px; height: 18px; background: rgba(242,181,58,.55); z-index: 1; }
.title-page .trip { margin: 14px 0 12px; grid-template-columns: 44px 1fr 44px; }
.title-page .trip-card { text-align: center; }
.title-page .trip-blurb { min-height: 0; font-size: 13px; margin-bottom: 4px; }
.trip-stars.next { color: var(--accent); font-size: 13px; font-weight: 900; letter-spacing: 0; }
.title-page .modes, .title-page .modes:has(#btn-crew:not([hidden])) { grid-template-columns: 1fr; gap: 10px; }
.title-page .mode { min-height: 60px; border-radius: 6px 14px 14px 6px; padding: 6px 14px; }
.title-page .mode b { font-size: 21px; }
.tp-row { display: grid; grid-template-columns: 1fr 1fr 44px 44px; gap: 8px; margin-top: 16px; }
.tp-btn { min-height: 48px; padding: 4px 8px; border: 2px solid var(--wood); border-radius: 10px; background: #fffdf6; color: var(--ink); font-weight: 900; font-size: 15px; white-space: nowrap; box-shadow: 0 3px 0 rgba(120,80,40,.25); }
.tp-btn:hover, .tp-ico:hover { background: #fff3dc; }
.tp-ico { width: 44px; height: 48px; padding: 0; display: grid; place-items: center; border: 2px solid var(--wood); border-radius: 10px; background: #fffdf6; color: var(--ink); box-shadow: 0 3px 0 rgba(120,80,40,.25); }
.tp-ico svg { width: 22px; height: 22px; }
.tp-ico[aria-pressed=false] { opacity: .55; }
.tp-ico[aria-pressed=false] .on, .tp-ico[aria-pressed=true] .off { display: none; }
.title-page .best { margin: 10px 0 0; text-align: center; }
.title-page .best:empty { display: none; }
/* its Settings sheet */
.menu-set { z-index: 12; background: rgba(40,28,16,.22); }
.menu-set .sheet-card { position: relative; text-align: left; }
.sheet-x { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; background: none; font-size: 22px; color: var(--ink-soft); border-radius: 10px; }
.sheet-x:hover { background: rgba(155,109,67,.12); }
.menu-set .looks-row { display: block; margin: 0 0 12px; }
.menu-set .looks-row .pick-h { display: block; margin: 0 0 6px; font-size: 14px; }
.how-to { border-top: 2px dashed #e3d3b6; margin: 8px 0 12px; padding-top: 4px; }
.how-to summary { min-height: 44px; display: flex; align-items: center; font-weight: 900; cursor: pointer; }
.how-to .tag { margin: 0 0 10px; font-size: 14px; }
.how-to .how { margin-bottom: 4px; }
@media (max-width: 640px), (orientation: portrait) {
  .title-screen { place-items: end stretch; padding: 12px; background: linear-gradient(0deg, rgba(60,40,20,.22), transparent 60%); }
  .title-page { width: auto; rotate: none; max-height: 66dvh; padding: 16px 14px 14px 42px; }
  .title-page::before { left: 10px; }
  .title-page h1 { font-size: 34px; }
  .title-page h1.zh { font-size: 31px; }
  .tp-head { grid-template-columns: 1fr 96px; }
  .tp-photo { padding: 4px 4px 18px; }
  .title-page .trip { margin: 10px 0 8px; }
  .title-page .trip-blurb { display: none; }
  .title-page .mode { min-height: 52px; }
  .title-page .mode b { font-size: 19px; }
  .tp-row { grid-template-columns: 1fr 1fr 44px 44px; gap: 6px; }
  .tp-btn { font-size: 14px; padding: 4px; }
}
@media (max-width: 400px) { .tp-btn .ic { display: none; } }
.title-page .mode { flex-direction: column; justify-content: center; text-align: center; }
.title-page .mode span { text-align: center; }
.best:empty { margin-bottom: 0; }
/* the volume under Sound and Music in the title's Settings (2026-11-25) */
.menu-vol { margin-top: 6px; }
.menu-vol label { font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.menu-vol input { height: 32px; }
.reset-ask { margin: 10px 0 0; padding: 12px; border: 2px solid #e8b3a8; border-radius: 12px; background: #fff3ef; }
.reset-ask p { margin: 0 0 12px; font-weight: 800; font-size: 14px; }
.reset-ask .row-btns { justify-content: flex-start; }
.reset-ask .big-btn { padding: 8px 16px; font-size: 16px; min-height: 44px; }
.reset-done { margin: 8px 0 0; font-weight: 800; font-size: 14px; color: #2e8a7b; }
.reset-done:empty { display: none; }

/* the music switched off: its sliders say so (2026-11-25) */
.vol-off-help { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }

/* the player's own pictures (mydecals.js): the list in the Car sheet, and the bar while one is being placed */
.mine-n { margin-left: 6px; font-weight: 800; font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.liveries.mine { margin-bottom: 14px; }
.mine .livery img { border-radius: 8px; background: repeating-conic-gradient(#efe6d4 0 25%, #fffdf6 0 50%) 0 0 / 16px 16px; }
.mine-add:disabled { opacity: 0.5; cursor: default; }
.mine-add:disabled:hover { background: #fffdf6; }
.mine-msg { margin: -4px 0 12px; min-height: 1.3em; font-weight: 800; font-size: 13.5px; color: var(--accent-dark); }
.mine-msg:empty { min-height: 0; margin: 0; }
.minebar h2 { margin: 0 0 2px; font-size: 20px; }
.mb-how { margin: 0 0 10px; font-weight: 700; font-size: 13.5px; line-height: 1.4; color: #6a4a2c; }
.mb-spots { display: flex; flex-wrap: wrap; gap: 8px; }
.mb-spots .look { flex: 1 1 auto; padding: 6px 10px; }
.minebar .sliders { margin: 10px 0 10px; }
.minebar .slider output { min-width: 3.6em; }
#game.placing { cursor: crosshair; }

/* the one-time tip about the car's look (main.js carTipAtTitle): everything dark but for a hole over the button meant
   (the hole's own huge shadow is the dark), a ring pulsing round the hole, a note beside it with a point at the hole.
   The layer takes every tap: main.js passes on the ones in the hole */
.spot { position: fixed; inset: 0; z-index: 50; overflow: hidden; touch-action: none; animation: fade .25s ease-out; }
.spot[hidden] { display: none; }
.spot-hole { position: fixed; border-radius: 16px; box-shadow: 0 0 0 200vmax rgba(20, 14, 8, .62); cursor: pointer; }
.spot-hole::after { content: ""; position: absolute; inset: -3px; border-radius: 19px; border: 3px solid #ffd23f; animation: spotRing 1.3s ease-in-out infinite; }
@keyframes spotRing { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.07); opacity: .45; } }
.spot-note { position: fixed; display: flex; align-items: center; gap: 4px; width: max-content; max-width: min(320px, calc(100vw - 24px)); padding: 4px 4px 4px 14px; border: 2px solid var(--wood); border-radius: 12px; background: #fff3c4; color: var(--ink); font-size: 15px; line-height: 1.45; text-align: left; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.spot-note::before { content: ""; position: absolute; top: -8px; left: var(--ax, 50%); width: 12px; height: 12px; margin-left: -7px; background: #fff3c4; border-left: 2px solid var(--wood); border-top: 2px solid var(--wood); transform: rotate(45deg); }
.spot-note.over::before { top: auto; bottom: -8px; transform: rotate(225deg); }
.spot-note > span { flex: 1; min-width: 0; padding: 6px 0; }
.spot-x { flex: none; width: 44px; height: 44px; border: 0; border-radius: 8px; background: none; color: var(--ink); font-size: 16px; font-weight: 900; cursor: pointer; }
.spot-x:hover { background: rgba(120,80,40,.14); }
@media (prefers-reduced-motion: reduce) { .spot, .spot-hole::after { animation: none; } }

/* ---------- a phone held upright: keep the road in sight (2026-11-26) ----------
   The user, with a picture from a phone: "怎麼教學的提示都在中間看不到路了". The clock, the roof row and the distance
   took three rows, the minimap sat under them, and the guide's card under that: 34–45 % of the height, right over
   the road ahead of the car; the hint line sat on the car itself. Now: the roof row and the distance share a row
   when they fit; the minimap, the notices and the guide's card start right under the HUD, wherever it ends
   (--hud-b, main.js layTop); the minimap is put away while the guide's card is up (the flags and the ring of light
   show the way then); the hint line joins the notices at the top (main.js hint). */
@media (max-width: 640px) {
  #hud { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
  #hud::after { content: ""; order: 2; flex-basis: 100%; height: 0; margin-top: -6px; }   /* (the clock has the first row to itself, beside the corner buttons) */
  .hud-left { order: 1; }
  .hud-right { order: 3; }
  .hud-mid { order: 4; font-size: 16px; gap: 6px; }
  #hud > .card { padding: 4px 8px; }
  .hud-mid .flag { display: none; }
  .hud-mid .arrow { width: 24px; height: 24px; }
  #hud-dist { min-width: 3.3em; }
  .gear-row li { width: 26px; height: 26px; }
  .gear-row li svg { width: 21px; height: 21px; }
  .minimap { top: calc(var(--hud-b, 150px) + 6px); width: clamp(76px, 22vw, 100px); }
  #popups { top: calc(var(--hud-b, 150px) + 6px); max-width: calc(100vw - 28px - clamp(76px, 22vw, 100px)); }
  .lesson { top: calc(var(--hud-b, 150px) + 6px); left: 10px; right: 10px; padding: 6px 12px 8px; gap: 2px; }
  .lesson-skip { min-height: 30px; padding: 2px 6px; }
  body.lessoning .minimap { display: none; }
  body.lessoning #popups { top: calc(var(--hud-b, 150px) + var(--lesson-h, 84px) + 12px); max-width: calc(100vw - 20px); }
  /* (the hint line: one of the notices, not a line over the car) */
  #popups > .hint { position: static; transform: none; width: auto; max-width: 100%; padding: 5px 12px; font-size: 14px; text-align: left; animation: popIn .25s ease-out; }
}

/* ---------- a phone held sideways (short and wide): the same care (2026-11-26) ----------
   The guide's card and the notices sat in the middle at the top, over the road ahead, and the roof row ran under
   the corner buttons. Now the HUD's cards wrap when they do not fit, and the guide's card, the notices and the hint
   line go to the left under the HUD, clear of the middle. */
@media (max-height: 480px) and (min-width: 641px) {
  #hud { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
  #hud > .card { padding: 4px 8px; min-height: 40px; }
  .hud-left { order: 1; font-size: 19px; }
  .hud-mid { order: 2; font-size: 16px; gap: 6px; }
  .hud-right { order: 3; }
  .hud-mid .flag { display: none; }
  .hud-mid .arrow { width: 24px; height: 24px; }
  #hud-dist { min-width: 3.3em; }
  .gear-row li { width: 26px; height: 26px; }
  .gear-row li svg { width: 21px; height: 21px; }
  .lesson { top: calc(var(--hud-b, 56px) + 6px); left: 16px; right: auto; transform: none; width: max-content; max-width: min(300px, 38vw); padding: 6px 12px 8px; gap: 2px; font-size: 15px; }
  .lesson-skip { min-height: 30px; padding: 2px 6px; }
  #popups { left: 16px; top: calc(var(--hud-b, 56px) + 6px); transform: none; justify-items: start; gap: 5px; max-width: min(340px, 42vw); }
  body.lessoning #popups { top: calc(var(--hud-b, 56px) + var(--lesson-h, 70px) + 12px); }
  .popup { font-size: 15px; padding: 4px 12px 4px 5px; }
  #popups > .hint { position: static; transform: none; width: auto; max-width: 100%; padding: 5px 12px; font-size: 14px; text-align: left; animation: popIn .25s ease-out; }
}
/* (the narrowest phones, 320 wide: the clock without its star time, so it clears the corner buttons, and smaller
   squares in the roof row, so the distance still shares its row) */
@media (max-width: 350px) {
  #hud-star { display: none; }
  .gear-row { gap: 3px; }
  .gear-row li { width: 22px; height: 22px; border-radius: 6px; }
  .gear-row li svg { width: 18px; height: 18px; }
  .hud-mid { font-size: 15px; gap: 4px; }
  #hud-dist { min-width: 3em; }
  .lesson { font-size: 14px; }
}
/* (with the browser's tap box off, the buttons that had no press of their own get one) */
.tp-btn:active, .tp-ico:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(120,80,40,.25); }
.look:active, .trip-arrow:active { transform: translateY(1px); filter: brightness(.96); }
