/* Road Trip: a desert highway at dusk. Big type to read out loud in a moving car, big targets for the passenger's
   taps. The title screen and the sheets are shared/mainmenu.js (menu.css, loaded after this); only their colors are
   set here (--sg-*). */
:root {
  --bg1: #2a2047; --bg2: #140f24; --accent: #ffbe76; --card: #352a58;
  --ink: #fbf3ea; --soft: #c3b6d8; --line: rgba(251, 243, 234, 0.16);
  --ok: #49d17d; --bad: #ff7a6b; --yes: #49d17d; --no: #ff7a6b; --sort: #ffd166;
  --sheet: #fdf6ee; --sheet-ink: #2a2047; --sheet-soft: #6b5f82;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
* { touch-action: manipulation; }
html, body { margin: 0; }
body {
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif; color: var(--ink); min-height: 100vh;
  background: radial-gradient(130% 90% at 50% 0%, var(--bg1), var(--bg2)) fixed; overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
.box, .play, .over { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

.btn {
  min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 800; font-size: 17px;
  background: rgba(255, 255, 255, 0.1); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line);
}
.btn.primary { background: var(--accent); color: #2a2047; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
.btn.big { min-height: 60px; font-size: 20px; flex: 1; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 15px; }
.btn.round { width: 60px; min-width: 60px; padding: 0; display: grid; place-items: center; font-size: 28px; line-height: 1; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:active:not(:disabled) { transform: translateY(2px); }
.iconbtn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.1); color: var(--ink); font: 800 italic 20px/1 Georgia, serif; box-shadow: inset 0 0 0 2px var(--line);
}

/* ---- the game box ---- */
.box { padding: 0 12px 40px; }
.box-head { display: flex; align-items: center; gap: 12px; padding: var(--sg-corner-top, 12px) 12px 6px var(--sg-corner-left, 12px); margin: 0 -12px; }
.box-head h1 { margin: 0; font-size: 26px; line-height: 1.1; }
.car { margin: 8px auto 14px; max-width: 640px; padding: 12px 14px; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 2px var(--line); }
.car-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.car-label { font-weight: 800; font-size: 15px; color: var(--soft); text-transform: uppercase; letter-spacing: 0.06em; }
.car-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.car-empty { color: var(--soft); font-size: 16px; }
.pchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-weight: 700; font-size: 16px; }
.pchip i, .pl-dot { font-style: normal; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--p); color: #2a2047; font-weight: 800; font-size: 15px; flex: none; }
.games { max-width: 640px; margin: 0 auto; display: grid; gap: 10px; }
.game {
  display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 10px 14px 10px 10px; border: 0; border-radius: 20px; cursor: pointer; text-align: left;
  background: var(--card); box-shadow: inset 0 0 0 2px var(--line), inset 6px 0 0 var(--g);
}
.game:active { transform: scale(0.98); }
.game-art { flex: none; width: 56px; height: 56px; }
.game-art img, .game-art svg { display: block; width: 56px; height: 56px; border-radius: 14px; }
.game-txt { display: grid; min-width: 0; flex: 1; }
.game-txt b { font-size: 20px; line-height: 1.15; }
.game-txt small { color: var(--soft); font-weight: 600; font-size: 15px; line-height: 1.3; margin-top: 2px; }
.game-go { font-size: 26px; color: var(--soft); font-weight: 800; }

/* ---- a round ---- */
.play { padding: 0 12px calc(110px + env(safe-area-inset-bottom, 0px)); max-width: 680px; margin: 0 auto; }
.hud { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 10px; padding: var(--sg-corner-top, 12px) 0 4px var(--sg-corner-left, 12px); margin-left: -12px; }
.hud-mid { display: grid; text-align: center; line-height: 1.15; min-width: 0; }
.hud-mid b { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-mid small { color: var(--soft); font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pips { list-style: none; display: flex; gap: 4px; margin: 6px 0 10px; padding: 0; }
.pips li { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.pips li.past { background: var(--soft); }
.pips li.past.hit { background: var(--ok); }
.pips li.now { background: var(--accent); }
.ask { margin: 0 0 10px; min-height: 2.7em; font-weight: 700; font-size: 18px; line-height: 1.35; color: var(--accent); }
.dcard { padding: 14px 14px 16px; border-radius: 22px; background: var(--card); box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.7), inset 0 0 0 2px var(--line); }
.dcard.slide { animation: slidein 0.32s ease-out; }
.dlead { margin: 0 0 10px 4px; color: var(--soft); font-weight: 800; font-size: 16px; text-transform: uppercase; letter-spacing: 0.06em; }
.opt {
  width: 100%; display: grid; grid-template-columns: 44px 1fr; align-items: center; column-gap: 12px; min-height: 92px; padding: 12px 14px 12px 10px;
  border: 0; border-radius: 18px; cursor: pointer; text-align: left; background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 2px var(--line);
  transition: opacity .2s, box-shadow .2s, background .2s;
}
.opt-k { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: #2a2047; font-weight: 800; font-size: 24px; }
#opt-b .opt-k { background: #8fd0ff; }
.opt-t { font-weight: 700; font-size: clamp(21px, 5.8vw, 27px); line-height: 1.25; }
.opt-tags { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.opt-tags:empty { display: none; }
.tag { margin-top: 6px; padding: 0 10px; border-radius: 999px; font-weight: 800; font-size: 14px; line-height: 26px; }
.tag.guess { background: rgba(255, 190, 118, 0.2); color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.tag.pick { background: var(--ok); color: #10351f; }
.opt.guessed { box-shadow: inset 0 0 0 3px var(--accent); }
.opt.picked { background: rgba(73, 209, 125, 0.16); box-shadow: inset 0 0 0 3px var(--ok); }
.opt.dim { opacity: 0.45; }
.opt:disabled { cursor: default; }
.opt:active:not(:disabled) { transform: scale(0.985); }
.or { margin: 6px 0; text-align: center; font-weight: 800; font-size: 17px; color: var(--soft); }
.verdict { margin: 12px 0 0; padding: 12px 14px; border-radius: 16px; font-weight: 700; font-size: 18px; line-height: 1.35; background: rgba(255, 255, 255, 0.08); }
.verdict.hit { background: rgba(73, 209, 125, 0.16); box-shadow: inset 0 0 0 2px var(--ok); }
.verdict.miss { background: rgba(255, 122, 107, 0.14); box-shadow: inset 0 0 0 2px var(--bad); }
.verdict.pop { animation: pop 0.35s ease-out; }
.controls { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(rgba(0, 0, 0, 0), var(--bg2) 38%); }
.controls .row, .tq-tools { display: flex; gap: 8px; max-width: 680px; margin: 0 auto; }
.controls #tq-giveup { min-width: 120px; }

/* ---- 20 Questions ---- */
.secret { margin-top: 6px; padding: 14px 16px 16px; border-radius: 22px; background: var(--card); box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.7), inset 0 0 0 2px var(--line); }
.secret-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kind { padding: 0 12px; border-radius: 999px; font-weight: 800; font-size: 15px; line-height: 30px; color: #1d1530; background: var(--k, var(--accent)); }
.secret-name { margin: 10px 0 2px; font-weight: 800; font-size: clamp(34px, 10vw, 46px); line-height: 1.1; }
.secret-cover { margin: 10px 0 2px; min-height: 50px; display: grid; place-items: center; border-radius: 14px; font-weight: 700; color: var(--soft);
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 0 10px, rgba(255, 255, 255, 0.1) 10px 20px); }
.secret-say { margin: 6px 0 0; color: var(--soft); font-weight: 600; font-size: 17px; line-height: 1.35; }
.clue { margin: 10px 0 0; padding: 10px 12px; border-radius: 14px; background: rgba(255, 209, 102, 0.14); font-size: 17px; line-height: 1.35; }
.counter { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 10px; margin: 14px 2px 10px; }
.counter b { font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); }
.counter b.bump { animation: pop 0.3s ease-out; }
.counter span { color: var(--soft); font-weight: 700; font-size: 17px; }
.qdots { grid-column: 1 / -1; list-style: none; display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; margin: 8px 0 0; padding: 0; }
.qdots li { height: 10px; border-radius: 3px; background: var(--line); }
.qdots li.y { background: var(--yes); }
.qdots li.n { background: var(--no); }
.qdots li.s { background: var(--sort); }
.qdots li.c { background: var(--soft); }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ans { min-height: 76px; font-size: 24px; border-radius: 20px; color: #1d1530; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
.ans.yes { background: var(--yes); }
.ans.no { background: var(--no); }
.ans.sort { grid-column: 1 / -1; min-height: 56px; font-size: 20px; background: var(--sort); }
.tq-tools { margin-top: 10px; }
@media (max-height: 700px) {
  .secret { padding: 10px 14px 12px; } .secret-name { margin-top: 6px; font-size: 32px; } .secret-say { font-size: 15px; }
  .counter { margin: 8px 2px 6px; } .counter b { font-size: 36px; } .ans { min-height: 58px; } .ans.sort { min-height: 48px; }
  .opt { min-height: 72px; } .ask { font-size: 16px; }
}
.tq-tools .btn { flex: 1; }

/* ---- the end of a round ---- */
.over { padding: 0 12px 40px; }
.over-head { padding: var(--sg-corner-top, 12px) 0 0 var(--sg-corner-left, 12px); margin-left: -12px; min-height: 56px; }
.over-card { max-width: 560px; margin: 0 auto; text-align: center; animation: rise 0.4s ease-out; }
.over-kicker { margin: 0; color: var(--accent); font-weight: 800; font-size: 18px; }
.over-card h2 { margin: 0 0 12px; font-size: 32px; line-height: 1.15; }
.over-big { margin: 0 0 8px; font-weight: 700; font-size: 21px; line-height: 1.3; }
.over-line { margin: 8px 0 0; color: var(--soft); font-size: 16px; line-height: 1.35; }
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.board .row { width: 100%; }
.board .row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 2px var(--line), inset 5px 0 0 var(--p); }
.who { display: grid; min-width: 0; line-height: 1.2; }
.who b { font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--soft); font-weight: 700; font-size: 14px; }
.score { display: grid; text-align: right; line-height: 1; }
.score b { font-size: 28px; font-variant-numeric: tabular-nums; }
.score small { color: var(--soft); font-weight: 700; font-size: 13px; }
.over-new { margin: 14px 0 0; display: grid; gap: 8px; }
.new-line { margin: 0; font-weight: 700; font-size: 16px; color: var(--accent); }
.over-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }

/* ---- sheets ---- */
.pl-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.pl-list li { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 8px; border-radius: 14px; background: rgba(42, 32, 71, 0.06); }
.pl-name { flex: 1; font-weight: 700; font-size: 18px; }
.pl-x { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: var(--sheet-soft); }
.pl-add { display: flex; gap: 8px; }
.pl-input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 2px solid rgba(42, 32, 71, 0.2); background: #fff; color: var(--sheet-ink);
  font: 700 18px/1.2 "Baloo 2", ui-rounded, system-ui, sans-serif; -webkit-user-select: text; user-select: text;
}
.pl-sheet .btn, .setup .btn { background: #2a2047; color: #fff; box-shadow: none; }
.pl-note, .setup-note { margin: 10px 0 0; color: var(--sheet-soft); font-size: 15px; line-height: 1.35; }
.setup { display: grid; gap: 6px; }
.setup-q { margin: 6px 0 2px; font-weight: 800; font-size: 17px; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 16px; color: var(--sheet-ink);
  background: rgba(42, 32, 71, 0.07); box-shadow: inset 0 0 0 2px rgba(42, 32, 71, 0.12), inset 4px 0 0 var(--p, transparent); }
.chip.on { background: #2a2047; color: #fff; box-shadow: none; }
.tg { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 0 4px; border: 0; background: none; cursor: pointer; font-weight: 700; font-size: 16px; color: var(--sheet-ink); text-align: left; }
.tg i { flex: none; width: 50px; height: 30px; border-radius: 999px; background: rgba(42, 32, 71, 0.18); position: relative; transition: background .2s; }
.tg i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.tg.on i { background: #2f8f5a; }
.tg.on i::after { transform: translateX(20px); }
.setup .setup-go { margin-top: 12px; background: #e0563f; }
.rt-how p { margin: 0 0 10px; font-size: 16px; line-height: 1.45; }
.rt-ach { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rt-ach li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.35; }
.rt-ach li span:last-child { display: grid; }
.rt-ach .dot { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #ffbe76; color: #2a2047; font-weight: 800; }
.rt-ach li.no .dot { background: rgba(42, 32, 71, 0.12); color: transparent; }

/* ---- the title screen's colors (the layout is shared/mainmenu.js) ---- */
#mm {
  --sg-bg: radial-gradient(130% 90% at 50% 0%, var(--bg1), var(--bg2));
  --sg-ink: var(--ink); --sg-ink-soft: var(--soft);
  --sg-title: var(--accent); --sg-title-shadow: 0 3px 0 rgba(0, 0, 0, 0.45);
  --sg-accent: var(--accent); --sg-accent-ink: #2a2047;
  --sg-card: var(--card); --sg-card-ink: var(--ink); --sg-line: var(--line);
}
.rt-title { height: 100%; display: grid; place-items: center; }
.rt-title-svg { display: block; height: 100%; width: auto; max-width: 100%; border-radius: 18px; box-shadow: 0 16px 34px -18px rgba(0, 0, 0, 0.8); }
.sg-sheet { --sg-sheet-bg: var(--sheet); --sg-sheet-ink: var(--sheet-ink); --sg-accent: #2a2047; --sg-accent-ink: #fff; --sg-ink-soft: var(--sheet-soft); }

@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
@keyframes pop { 0% { transform: scale(0.92); } 60% { transform: scale(1.04); } 100% { transform: none; } }
@keyframes slidein { from { transform: translateX(18px); opacity: 0.3; } }
@media (max-width: 370px) { .btn.big { font-size: 18px; } .opt { min-height: 80px; } .game-txt b { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) {
  .dcard.slide, .verdict.pop, .counter b.bump, .over-card { animation: none; }
}
#mm.sg-scened .rt-title-svg { border-radius: 0; box-shadow: none; }

/* ---- the car's miles: one progression from every box (car.js) ---- */
.miles { max-width: 640px; margin: 8px auto 10px; padding: 12px 14px 10px; border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 26%, var(--card)), var(--card)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.mi-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mi-top b { font-weight: 800; font-size: 19px; line-height: 1.1; color: var(--accent); }
.mi-top span { font-weight: 700; font-size: 15px; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mi-bar { position: relative; height: 10px; margin: 8px 0 6px; border-radius: 99px; overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 14px, transparent 14px 26px), rgba(0, 0, 0, 0.28); }
.mi-bar i { position: absolute; inset: 0; transform-origin: left; border-radius: inherit; background: linear-gradient(90deg, #ff9a5a, var(--accent)); transition: transform 0.6s ease-out; }
.miles small { display: block; font-size: 14px; line-height: 1.25; color: var(--soft); }
/* in the Achievements sheet (light): the same card, its own colors */
.rt-achs .miles.big { --accent: #c2573a; --card: #f3e6d8; --ink: #2a2047; --soft: #6b5f82; margin: 0 0 12px; }
.rt-achs .miles.big .mi-bar { background: repeating-linear-gradient(90deg, rgba(42, 32, 71, 0.1) 0 14px, transparent 14px 26px), rgba(42, 32, 71, 0.12); }
.rt-ranks { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rt-ranks li { display: grid; padding: 6px 10px; border-radius: 10px; background: rgba(42, 32, 71, 0.06); color: var(--sheet-soft); line-height: 1.2; }
.rt-ranks li b { font-size: 14px; }
.rt-ranks li small { font-size: 12px; }
.rt-ranks li.got { color: var(--sheet-ink); }
.rt-ranks li.now { background: #ffbe76; color: #2a2047; box-shadow: 0 0 0 2px #c2573a inset; }
.rt-note { margin: 0 0 10px; font-size: 14px; line-height: 1.35; color: var(--sheet-soft); }
.rt-achs h3 { margin: 16px 0 8px; font-size: 17px; }
@media (prefers-reduced-motion: reduce) { .mi-bar i { transition: none; } }
