/* Sentence Train, Which Word Fits?, Syllable Car Wash, Garage Job Cards and Time Trial. */

/* Shared: big tappable word buttons with clear right, wrong and hint states. */
.ng-word, .ng-opt, .ng-car {
  border: 3px solid var(--ink); border-radius: 14px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow);
  font-family: var(--read); font-weight: 700; cursor: pointer; touch-action: manipulation; transition: transform .12s ease-out, opacity .2s;
}
.ng-word:active, .ng-opt:active, .ng-car:active { transform: translateY(2px) scale(.97); box-shadow: var(--shadow-press); }
.ng-word.wrong, .ng-opt.wrong, .ng-car.wrong { animation: wobble .4s ease-out; border-color: #e2392c; }
.ng-opt.wrong:disabled, .ng-car.wrong:disabled { opacity: .45; }
.ng-word.hint, .ng-opt.hint, .ng-car.hint { border-color: var(--go); animation: ngGlow 1s ease-in-out infinite; }
.ng-opt.right, .ng-car.right { border-color: var(--go); background: #e5f7ea; animation: pop .45s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes ngGlow { 50% { transform: scale(1.06); box-shadow: 0 0 0 7px rgba(35, 160, 80, .35), var(--shadow); } }

/* Sentence Train */
.ng-truck { position: relative; display: flex; align-items: flex-end; gap: 6px; max-width: 100%; transition: transform 1.2s cubic-bezier(.5, 0, .7, 1); }
.ng-truck.go { transform: translateX(110vw); }
.ng-slots { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border-radius: 12px; background: var(--asphalt, #3a3f4a); border-bottom: 8px solid #1d2027; max-width: calc(100vw - 120px); }
.ng-slot { min-width: 54px; height: clamp(40px, 8dvh, 54px); padding: 0 10px; display: grid; place-items: center; border: 3px dashed #cfd5df; border-radius: 10px; font-family: var(--read); font-weight: 700; font-size: clamp(1.1rem, 4dvh, 1.6rem); color: var(--ink); }
.ng-slot.filled { border-style: solid; border-color: var(--gold); background: var(--paper); animation: pop .3s ease-out; }
.ng-cab { font-size: clamp(2.4rem, 9dvh, 3.6rem); line-height: 1; transform: scaleX(-1); }
.ng-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 100%; }
.ng-word { min-height: 56px; padding: 6px 18px; font-size: clamp(1.3rem, 5dvh, 2rem); }
.ng-word.used { visibility: hidden; }

/* Which Word Fits? */
.ng-sentence { max-width: 90%; padding: 12px 22px; border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); font-family: var(--read); font-weight: 700; font-size: clamp(1.3rem, 5.2dvh, 2.1rem); text-align: center; line-height: 1.35; }
.ng-gap { display: inline-block; min-width: 3.4em; border-bottom: 4px solid var(--ink); }
.ng-gap.filled { border-color: var(--go); color: var(--go-dark, #157a3c); animation: pop .4s ease-out; }
.ng-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 100%; }
.ng-opt { min-height: 60px; min-width: 110px; padding: 8px 22px; font-size: clamp(1.3rem, 5dvh, 2rem); }
.ng-options.long { flex-direction: column; align-items: stretch; width: min(560px, 92%); gap: 8px; }
.ng-options.long .ng-opt { font-size: clamp(1.1rem, 4dvh, 1.5rem); text-align: left; min-height: 52px; }

/* Syllable Car Wash */
.ng-wash { position: relative; display: flex; align-items: center; gap: 14px; padding: 10px 22px; border-radius: 20px; background: linear-gradient(#bfe8ff, #e6f6ff); box-shadow: var(--shadow); overflow: hidden; }
.ng-washword { font-family: var(--read); font-weight: 700; font-size: clamp(1.8rem, 7dvh, 3rem); letter-spacing: .02em; }
.ng-washword b { padding: 0 .12em; margin: 0 .08em; border-radius: 8px; background: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); animation: pop .4s ease-out backwards; }
.ng-washword b:nth-child(2) { animation-delay: .15s; } .ng-washword b:nth-child(3) { animation-delay: .3s; } .ng-washword b:nth-child(4) { animation-delay: .45s; }
.ng-wash.washing::after { content: "🫧"; position: absolute; left: -40px; top: 50%; font-size: 2rem; transform: translateY(-50%); animation: ngBubbles 1s ease-out forwards; }
@keyframes ngBubbles { to { left: 110%; } }
.ng-wash + .ng-options .ng-opt { letter-spacing: .04em; }

/* Garage Job Cards */
.ng-card { max-width: 92%; padding: 10px 20px; border: 3px solid var(--ink); border-left: 14px solid var(--gold); border-radius: 12px; background: #fffaf0; box-shadow: var(--shadow); font-family: var(--read); font-weight: 700; font-size: clamp(1.25rem, 5dvh, 1.9rem); text-align: center; }
.ng-cars { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.ng-car { width: clamp(150px, 26vw, 240px); padding: 6px 8px; }
.ng-car svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Time Trial */
.ng-trial { display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 2dvh, 14px); width: 100%; }
.ng-trialbar { position: relative; width: min(640px, 92%); height: 44px; border-radius: 22px; background: #e9e3d4; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .12); }
.ng-time { position: absolute; left: 0; bottom: 0; height: 6px; width: 100%; background: var(--gold); }
.ng-me, .ng-ghost { position: absolute; top: 4px; left: 0; font-size: 1.7rem; line-height: 1; transition: left .25s ease-out; }
.ng-ghost { opacity: .55; top: 6px; }
.ng-me { transform: scaleX(-1); z-index: 1; }
.ng-score { margin: 0; font-family: var(--display); font-size: clamp(1.1rem, 4dvh, 1.5rem); }
.ng-flash.pop { animation: pop .25s ease-out; }
.ng-flash.best { color: var(--go-dark, #157a3c); }

body.calm .ng-word.hint, body.calm .ng-opt.hint, body.calm .ng-car.hint, body.calm .ng-wash.washing::after, body.calm .ng-washword b, body.calm .ng-flash.pop { animation: none; }
body.calm .ng-truck { transition: none; }

/* Phones held sideways */
@media (max-height: 430px) {
  .ng-slot { height: 38px; min-width: 44px; font-size: 1.05rem; }
  .ng-word, .ng-opt { min-height: 48px; font-size: 1.15rem; padding: 4px 14px; }
  .ng-sentence { font-size: 1.2rem; padding: 6px 14px; }
  .ng-car { width: 130px; }
  .ng-cab { font-size: 2rem; }
  .ng-washword { font-size: 1.6rem; }
  .ng-trialbar { height: 36px; }
}

/* Weekly Cup and daily challenge */
.cup-line { font-family: var(--display); color: var(--ink) !important; }
.daily-btn { background: #2b2f5a !important; color: #fff; }
.daily-btn.done { background: #e5f7ea !important; color: var(--go-dark, #157a3a); }
.cup { margin-top: 12px; padding: 10px 16px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.cup h3 { margin: 0; font-family: var(--display); font-weight: 400; }
.cup .note { margin: 2px 0 8px; color: var(--ink-soft); }
.cup-table { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cup-table li { display: grid; grid-template-columns: 3.2em 1fr auto; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 12px; background: #f6f1e4; font-size: 1.1rem; }
.cup-table li.me { background: #fff1b8; outline: 3px solid var(--gold); }
.ng-listen { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.ng-listen .prompt { margin: 0; }

/* Reading streak */
.streak-chip { position: absolute; top: 64px; left: 12px; z-index: 3; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 4px 14px; border: 0; border-radius: 999px; background: #fff1d6; box-shadow: var(--shadow); font-family: var(--display); font-size: 1.1rem; color: #b5530a; }
.streak-chip span { font-size: 1.3rem; }
.streak-cal { margin-top: 12px; padding: 10px 16px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.streak-cal h3 { margin: 0 0 8px; font-family: var(--display); font-weight: 400; }
.streak-cal .days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; }
.streak-cal .day { display: grid; justify-items: center; gap: 2px; padding: 4px 0; border-radius: 10px; background: #f3eee2; }
.streak-cal .day b { height: 1.4em; font-size: 1.1rem; }
.streak-cal .day.on { background: #ffe1b3; }
.streak-cal .day.today { outline: 3px solid var(--gold); }
.streak-cal small { color: var(--ink-soft); }

.ng-mode { display: inline-flex; align-items: center; gap: 8px; }
.ng-mode-name { margin: 0; font-family: var(--display); color: var(--ink-soft); }

.practice-mark { background: #e2392c !important; color: #fff !important; }
.coach-panel p { margin: 6px 0; line-height: 1.5; }

/* Level ladder */
.level-sheet { width: min(760px, 94vw); max-height: 92dvh; overflow-y: auto; padding: 14px 18px 18px; border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.level-sheet header { display: flex; align-items: center; gap: 10px; }
.level-sheet h2 { flex: 1; margin: 0; font-family: var(--display); font-weight: 400; }
.level-sheet h2 small { font-family: var(--read); font-size: 1rem; color: var(--ink-soft); }
.gem-pill { padding: 6px 12px; border-radius: 999px; background: #e9f3ff; font-family: var(--display); }
.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.level { min-height: 64px; display: grid; place-items: center; gap: 0; padding: 4px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; font-family: var(--display); color: var(--ink); }
.level b { font-size: 1.3rem; font-weight: 400; line-height: 1; }
.level .lv-stars { font-size: .8rem; color: var(--gold-dark); letter-spacing: 1px; }
.level.bonus { background: #fff3c4; border-color: var(--gold-dark); }
.level.is-next { outline: 4px solid var(--go); }
.level.locked { opacity: .45; }

/* Word Catcher: a slow three-lane road with his car at the bottom */
.wc { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; height: 100%; }
.wc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.wc-slots { display: flex; gap: 6px; padding: 6px 8px; border-radius: 12px; background: var(--asphalt); }
.wc-slot { min-width: 48px; height: clamp(40px, 8dvh, 54px); padding: 0 8px; display: grid; place-items: center; border: 3px dashed #cfd5df; border-radius: 10px; font: 700 clamp(1.3rem, 5dvh, 2rem) var(--read); color: var(--ink); }
.wc-slot.filled { border-style: solid; border-color: var(--gold); background: var(--paper); animation: pop .3s ease-out; }
.wc-ask { margin: 0; }
.wc-count { font-family: var(--display); font-size: 1.3rem; }
.wc-road { position: relative; flex: 1; min-height: 180px; width: min(620px, 96%); border-radius: 16px; overflow: hidden; display: grid; grid-template-columns: repeat(3, 1fr);
  background: repeating-linear-gradient(90deg, #4a505d 0 calc(33.33% - 2px), #f3eedf calc(33.33% - 2px) 33.33%); box-shadow: var(--shadow); touch-action: none; }
.wc-lane { border: 0; background: transparent; cursor: pointer; }
.wc-lane:active { background: rgba(255, 255, 255, .08); }
.wc-car { position: absolute; bottom: 6px; width: 30%; max-width: 150px; transform: translateX(-50%); transition: left .22s ease-out; pointer-events: none; z-index: 2; }
.wc-car svg { display: block; width: 100%; height: auto; }
.wc-sign { position: absolute; top: 0; transform: translate3d(-50%, 0, 0); padding: 6px 14px; min-width: 64px; text-align: center; border: 3px solid var(--ink); border-radius: 12px; background: #fffaf0; box-shadow: var(--shadow);
  font: 700 clamp(1.4rem, 5.5dvh, 2.2rem) var(--read); color: var(--ink); pointer-events: none; z-index: 1; }
.wc-sign.caught { border-color: var(--go); background: #e5f7ea; animation: pop .3s ease-out; }
.wc-sign.wrong { border-color: #e2392c; opacity: .6; }
.wc-sign.wrong::after { content: "✕"; position: absolute; right: -8px; top: -12px; color: #e2392c; font-size: 1.4rem; }
body.calm .wc-sign.caught, body.calm .wc-slot.filled { animation: none; }
@media (max-height: 430px) { .wc-slot { height: 36px; min-width: 40px; font-size: 1.2rem; } .wc-road { min-height: 120px; } .wc-sign { font-size: 1.2rem; padding: 3px 10px; } }

/* Brick Garage */
#bricks { flex-direction: column; }
.brick-note { margin: 4px 16px 8px; color: var(--ink-soft); text-align: center; }
.kit-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); grid-auto-rows: max-content; gap: 12px; padding: 4px 16px 16px; align-content: start; }
.kit { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.kit h3 { margin: 0; font-family: var(--display); font-weight: 400; }
.kit-progress { margin: 0; } .kit-progress small { color: var(--ink-soft); }
.kit-bar { height: 10px; border-radius: 5px; background: #e9e3d4; overflow: hidden; } .kit-bar i { display: block; height: 100%; background: #e2392c; }
/* The car builds up from the bottom: everything above the built line is a faint outline. */
.kit-art { position: relative; aspect-ratio: 290 / 100; }
.kit-art svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.kit-ghost svg { opacity: .16; filter: grayscale(1); }
.kit-real svg { clip-path: inset(calc(100% - var(--built)) 0 0 0); transition: clip-path .5s ease-out; }
.kit-studs { position: absolute; inset: 0; pointer-events: none; clip-path: inset(calc(100% - var(--built)) 0 0 0);
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .35) 0 2.2px, transparent 2.6px) 0 0 / 12px 12px; mix-blend-mode: soft-light; }
.kit.locked { opacity: .55; }
.kit.built { outline: 3px solid var(--go); }
.kit.just-step .kit-art { animation: pop .35s ease-out; }
.kit.just-built .kit-art { animation: carBuy .8s cubic-bezier(.3, 1.3, .5, 1); }
.brick-pill { background: #ffe1d6; }
body.calm .kit.just-step .kit-art, body.calm .kit.just-built .kit-art { animation: none; }
body.calm .kit-real svg { transition: none; }

/* Brick town: scenes built a piece at a time */
.brick-tabs { display: flex; justify-content: center; gap: 8px; margin: 2px 16px 0; }
.brick-tab { border: 0; border-radius: 999px; padding: 8px 16px; min-height: 44px; font: 700 1rem var(--read); color: var(--ink); background: #e9e3d4; cursor: pointer; }
.brick-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.kit-grid.scene-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.scene-art, .scene-big { border-radius: 12px; overflow: hidden; background: linear-gradient(#8fd0f5, #d9f1ff); }
.scene-art { aspect-ratio: 320 / 180; }
.scene-big { width: 100%; aspect-ratio: 320 / 180; max-height: 70dvh; }
.scene-sheet { width: min(900px, 96vw); }
.bs-svg { display: block; width: 100%; height: 100%; }
.bs-svg.bs-night { background: linear-gradient(#141a33, #33405f); }
.scene-art:has(.bs-night), .scene-big:has(.bs-night) { background: linear-gradient(#141a33, #33405f); }
.bs-todo { opacity: .12; filter: grayscale(1); }
.bs-next { opacity: .4; animation: bsNext 1.4s ease-in-out infinite; }
@keyframes bsNext { 50% { opacity: .75; } }
/* Animations only run once the scene is finished, and never in calm mode */
.bs-live .bs-drive { animation: bsDrive 7s linear infinite; }
.bs-live .bs-blink { animation: bsBlink 2.2s ease-in-out infinite; }
.bs-live .bs-flag { animation: bsFlag 1.6s ease-in-out infinite; }
.bs-live .bs-spin { animation: bsSpin 1.8s linear infinite; }
.bs-live .bs-bob { animation: bsBob 2.4s ease-in-out infinite; }
.bs-live .bs-bird { animation: bsBird 6s ease-in-out infinite; }
.bs-svg:not(.bs-live) .bs-drive { transform: translateX(150px); }
@keyframes bsDrive { from { transform: translateX(0); } to { transform: translateX(440px); } }
@keyframes bsBlink { 50% { opacity: .35; } }
@keyframes bsFlag { 50% { transform: skewY(-8deg) scaleX(.9); } }
@keyframes bsSpin { to { transform: rotate(360deg); } }
@keyframes bsBob { 50% { transform: translateY(-3px); } }
@keyframes bsBird { 50% { transform: translate(30px, -6px); } }
.bs-svg * { transform-box: view-box; }
body.calm .bs-live * { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .bs-live * { animation: none !important; } }
.kit.just-step .scene-art { animation: pop .35s ease-out; }
.kit.just-built .scene-art { animation: carBuy .8s cubic-bezier(.3, 1.3, .5, 1); }
body.calm .kit.just-step .scene-art, body.calm .kit.just-built .scene-art { animation: none; }

/* Police car lights take turns flashing */
.siren-r { animation: sirenR 1s steps(1) infinite; }
.siren-b { animation: sirenR 1s steps(1) infinite .5s; }
@keyframes sirenR { 50% { opacity: .25; } }
body.calm .siren-r, body.calm .siren-b { animation: none; }

/* Wallet: coins, gems and bricks together in the top bar */
.wallet { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.topbar-right .wallet { margin-left: 0; }
.wallet .coins { margin-left: 0; }
.wallet .coins > span[aria-hidden] { font-size: 1.15em; line-height: 1; }
.gem-wallet { background: #e9f3ff; }
@media (max-width: 560px) { .wallet { gap: 4px; } .wallet .coins { font-size: 1rem; padding: 4px 10px 4px 6px; } }

/* Brick by brick (brickbuild.js): the built bricks show in colour over a faint outline */
.kit-open { display: block; width: 100%; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 12px; }
.kit-open:disabled { cursor: default; }
.bb-art { position: relative; width: 100%; }
.bb-art.car { aspect-ratio: 290 / 88; }
.bb-art.scene { aspect-ratio: 320 / 180; border-radius: 12px; overflow: hidden; background: linear-gradient(#8fd0f5, #d9f1ff); }
.bb-art.scene:has(.bs-night) { background: linear-gradient(#141a33, #33405f); }
.bb-art > span { position: absolute; inset: 0; }
.bb-art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bb-art.scene svg { overflow: hidden; }
.bb-ghost { opacity: .16; filter: grayscale(1); }
.bb-art.whole .bb-ghost { display: none; }
.bb-real { -webkit-mask-image: var(--bb-mask, none); mask-image: var(--bb-mask, none); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
/* Studs on the built bricks, so it reads as Lego */
.bb-real::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: radial-gradient(circle, rgba(255, 255, 255, .45) 0 18%, transparent 22%) 0 0 / calc(100% / var(--bb-cols, 16) / 2) calc(100% / var(--bb-rows, 10)); }
.bb-art.whole .bb-real::after { display: none; }
.bb-sheet { width: min(900px, 96vw); }
.bb-stage { position: relative; display: flex; align-items: flex-end; gap: 10px; }
.bb-tap { flex: 1; border: 0; padding: 8px; background: #f4efe2; border-radius: 16px; cursor: pointer; }
.bb-tap:disabled { cursor: default; }
.bb-pile { width: 64px; flex: none; display: flex; flex-wrap: wrap-reverse; gap: 3px; justify-content: center; align-content: flex-start; padding-bottom: 8px; }
.bb-pile i, .bb-fly { display: block; width: 26px; height: 14px; border-radius: 3px; background: #e2392c; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2);
  background-image: radial-gradient(circle at 25% 30%, rgba(255, 255, 255, .5) 0 2px, transparent 2.5px), radial-gradient(circle at 75% 30%, rgba(255, 255, 255, .5) 0 2px, transparent 2.5px); }
.bb-pile i:nth-child(3n + 2) { background-color: #f4c430; } .bb-pile i:nth-child(3n) { background-color: #2f6fd6; }
.bb-fly { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; border-radius: 4px; opacity: .95; }
.bb-count { margin: 0; text-align: center; font-family: var(--display); font-size: 1.1rem; }
.bb-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.bb-buttons .btn { min-height: 56px; font-size: 1.15rem; }
@media (max-height: 520px) { .bb-sheet { gap: 6px; } .bb-art.scene { max-height: 46dvh; width: auto; margin: 0 auto; } }

/* Convoy Run: a two-lane road, gates coming down, his car and convoy at the bottom */
.cv { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; height: 100%; }
.cv-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.cv-ask { margin: 0; }
.cv-count { font-family: var(--display); font-size: 1.3rem; background: var(--paper); border-radius: 999px; padding: 4px 14px; box-shadow: var(--shadow); }
.cv-road { position: relative; flex: 1; min-height: 200px; width: min(560px, 96%); border-radius: 16px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr;
  background: linear-gradient(90deg, #3f9a45 0 4%, #4a505d 4% 49.3%, #f3eedf 49.3% 50.7%, #4a505d 50.7% 96%, #3f9a45 96%); box-shadow: var(--shadow); touch-action: none; }
.cv-road::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(180deg, transparent 0 26px, rgba(255, 255, 255, .5) 26px 40px) 25% 0 / 4px 100% no-repeat, repeating-linear-gradient(180deg, transparent 0 26px, rgba(255, 255, 255, .5) 26px 40px) 75% 0 / 4px 100% no-repeat;
  animation: cvRoad .8s linear infinite; }
@keyframes cvRoad { to { background-position: 25% 40px, 75% 40px; } }
.cv-lane { border: 0; background: transparent; cursor: pointer; z-index: 3; }
.cv-lane:active { background: rgba(255, 255, 255, .08); }
.cv-gate { position: absolute; left: 4%; right: 4%; top: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6%; z-index: 1; pointer-events: none; }
.cv-half { position: relative; text-align: center; padding: 8px 6px; border: 4px solid #2b2f3a; border-radius: 12px 12px 4px 4px; background: #fffaf0;
  font: 700 clamp(1.4rem, 6dvh, 2.3rem)/1.1 var(--read); color: var(--ink); box-shadow: 0 6px 0 #2b2f3a; }
.cv-half.hit { border-color: var(--go); background: #e5f7ea; animation: pop .3s ease-out; }
.cv-half.hit::after { content: attr(data-gain) " 🚗"; position: absolute; left: 50%; top: -1.6em; transform: translateX(-50%); font: 400 1.1rem var(--display); color: var(--go-dark, #157a3a); white-space: nowrap; }
.cv-half.miss { border-color: #e2392c; opacity: .6; animation: shake .4s ease-in-out; }
.cv-car { position: absolute; bottom: 30px; width: 34%; max-width: 170px; transform: translateX(-50%); transition: left .25s ease-out; z-index: 2; pointer-events: none; }
.cv-car > svg { display: block; width: 100%; height: auto; }
.cv-tail { display: inline-flex; gap: 3px; margin-right: 8px; vertical-align: middle; }
.cv-tail i { display: block; width: 16px; height: 10px; border-radius: 3px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25); animation: pop .3s ease-out; }
.cv-truck { position: absolute; left: 50%; bottom: 40%; transform: translate(-50%, 0); font-size: clamp(3rem, 14dvh, 5rem); z-index: 1; transition: bottom 1.8s ease-out; }
.cv-push .cv-truck { bottom: calc(40% + var(--push, 20%) * .5); }
body.calm .cv-road::before, body.calm .cv-half.hit, body.calm .cv-half.miss { animation: none; }
@media (max-height: 430px) { .cv-road { min-height: 140px; } .cv-half { font-size: 1.2rem; padding: 4px; } }

/* The builder always fits on one screen: the picture takes whatever height is left after the
   title, count, bar and buttons (about 300px), so he never scrolls between tapping and watching. */
.bb-sheet { overflow: hidden; max-height: 94dvh; }
.bb-stage { flex: 1 1 auto; min-height: 0; }
.bb-tap { display: flex; align-items: center; justify-content: center; min-height: 0; }
.bb-art.car { width: min(100%, calc((94dvh - 300px) * 3.3)); margin-inline: auto; }
.bb-art.scene { width: min(100%, calc((94dvh - 300px) * 1.78)); margin-inline: auto; }
@media (max-height: 520px) {
  .bb-sheet { gap: 6px; padding: 10px 14px 12px; }
  .bb-sheet header h2 { font-size: 1.2rem; }
  .bb-buttons .btn { min-height: 48px; }
  .bb-art.car { width: min(100%, calc((94dvh - 230px) * 3.3)); }
  .bb-art.scene { width: min(100%, calc((94dvh - 230px) * 1.78)); max-height: none; }
}

/* Slow-down lockout (lockout.js): a red cross over the answers for a moment */
[data-stage] { position: relative; }
.lockout { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255, 245, 245, .82); border-radius: 18px; text-align: center; animation: lockIn .2s ease-out; }
.lockout-x { display: grid; place-items: center; width: clamp(70px, 18dvh, 120px); aspect-ratio: 1; border-radius: 50%; background: #e2392c; color: #fff;
  font: 700 clamp(2.6rem, 10dvh, 4.4rem)/1 var(--read); box-shadow: 0 6px 0 #a3241b; animation: lockShake .4s ease-in-out; }
.lockout b { font: 400 clamp(1.2rem, 4.5dvh, 1.8rem) var(--display); color: #a3241b; }
.lockout-bar { display: block; width: min(260px, 60%); height: 8px; border-radius: 4px; background: #e2392c; transform-origin: left; animation: lockBar linear forwards; }
@keyframes lockIn { from { opacity: 0; } }
@keyframes lockShake { 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes lockBar { to { transform: scaleX(0); } }
body.calm .lockout, body.calm .lockout-x { animation: none; }
