/* Brakes Out's own look: "Sunset 3D" from the style library (Doug picked it with gameplay A on 2026-10-06): chunky
   Pixar-style shapes, golden-hour light, warm and friendly. Lilita One (self-hosted, SIL OFL) for the logo, numbers
   and buttons; Fredoka from games.css for reading. The street is painted behind every screen (draw.js).
   Loaded after games.css, which keeps the shared rules. */
@font-face { font-family: "Lilita One"; src: url(/fonts/lilita-one.woff2) format('woff2'); font-weight: 400; font-display: swap; }
:root {
  --bg: #3b2a4a; --panel: #4a2f45ee; --line: #f2b27a; --ink: #2a1626;
  --text: #ffffff; --soft: #ffe2cc; --accent: #ffd23f; --gold: #ffb23a; --hot: #ff6a3c; --red: #e0352b; --good: #6fe08f;
}
body.bo { background: var(--bg); overflow-x: hidden; min-height: 100dvh; }
.bo h1, .bo h2, .bo .big-num b, .bo dd, .bo .score b, .bo .gauge b { font-family: "Lilita One", Fredoka, system-ui, sans-serif; font-weight: 400; letter-spacing: .01em; }
.bo button { font-family: "Lilita One", Fredoka, system-ui, sans-serif; font-weight: 400; border: 2px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); }
.bo button.go {
  background: linear-gradient(180deg, #fff1c8 0%, var(--accent) 35%, var(--gold) 70%, #e07b12 100%);
  color: #3a1800; font-size: 22px; min-height: 58px; text-shadow: 0 1px 0 #fff8;
  box-shadow: 0 4px 0 var(--ink), 0 0 24px #ffb23a55, inset 0 2px 0 #fff9;
}
.bo button.go.endless { background: linear-gradient(180deg, #ffc2a8 0%, #ff7a52 35%, var(--red) 75%, #9a1c16 100%); color: #fff; text-shadow: 0 2px 0 #0006; box-shadow: 0 4px 0 var(--ink), 0 0 24px #ff6a3c55, inset 0 2px 0 #fff9; }
.bo button.big { display: grid; gap: 2px; width: 100%; }
.bo button.big b { font-weight: 400; }
.bo button.big small { font-family: Fredoka, system-ui, sans-serif; font-weight: 600; font-size: 14px; opacity: .9; }
.bo button.quiet, .bo button.link { background: #ffffff14; color: var(--text); border: 2px solid var(--line); box-shadow: none; font-family: Fredoka, system-ui, sans-serif; font-weight: 700; }
.bo button.link { min-height: 44px; padding: 6px 14px; font-size: 16px; }
.bo button.small { min-height: 44px; padding: 6px 16px; font-size: 16px; }
.bo .muted { color: var(--soft); margin: 0; }
.bo a { color: var(--accent); font-weight: 700; }

#street { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; z-index: 0; touch-action: none; }
main { position: relative; z-index: 2; }
.bo-top { display: flex; align-items: center; gap: 8px; padding: 10px 16px; min-height: 60px; position: relative; z-index: 5; }
.bo-top .grow { flex: 1; min-width: 0; }
.bo .bo-top .back, .bo .lock-btn { background: #3b2a4ae6; color: var(--text); border-color: var(--line); }
.bo .icon { min-width: 44px; min-height: 44px; padding: 0; background: #3b2a4acc; border: 2px solid var(--line); box-shadow: none; color: var(--text); font-size: 18px; border-radius: 12px; }

/* warm glassy cards over the street */
.card-glass {
  max-width: 520px; width: calc(100% - 32px); margin: 2vh auto 24px; padding: 20px 16px; display: grid; gap: 12px; text-align: center;
  background: linear-gradient(180deg, #5a3550ee, #3b2238e6); border: 2px solid #ffb27a66; border-radius: 26px;
  box-shadow: 0 10px 30px #0008, inset 0 1px 0 #ffffff33; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.logo { font-size: clamp(46px, 14vw, 80px); line-height: .95; margin: 0; }
.logo span { color: #fff; text-shadow: 0 0 16px #ffb27aaa, 0 4px 0 #5a2a1e; }
.logo em { font-style: normal; background: linear-gradient(180deg, #fff1c8, var(--accent) 40%, var(--hot)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #5a2a1e) drop-shadow(0 0 16px #ff8a2a88); }
.tag { margin: 0; color: var(--soft); font-weight: 600; }
.label { margin: 4px 0 -4px; font-weight: 700; color: var(--soft); font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.bo .chip { min-height: 44px; padding: 6px 16px; font-size: 17px; background: #2a162699; color: var(--text); border: 2px solid var(--line); box-shadow: none; }
.bo .chip[aria-pressed="true"] { background: linear-gradient(180deg, #ffd8a8, #ff8a3c); color: #3a1800; border-color: var(--ink); box-shadow: 0 0 14px #ffb27a88, inset 0 2px 0 #fff8; }
.best { margin: 0; color: var(--accent); font-family: "Lilita One", sans-serif; white-space: pre-line; min-height: 1px; }
.links { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }

.street-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.street-list button { width: 100%; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 10px; text-align: left; background: linear-gradient(180deg, #7a4a5e, #4a2c40); color: #fff; min-height: 64px; padding: 8px 12px; }
.street-list button:disabled { opacity: .5; cursor: default; }
.street-list .num { font-size: 26px; color: var(--accent); text-align: center; }
.street-list .nm { display: grid; }
.street-list .nm small { font-family: Fredoka, sans-serif; font-weight: 600; font-size: 13px; color: var(--soft); }
.street-list .md { font-size: 26px; min-width: 32px; text-align: center; }
.how { text-align: left; margin: 0; padding-left: 20px; display: grid; gap: 8px; }

/* the drive's heads-up display */
#play { position: fixed; inset: 0; pointer-events: none; }
.hud { position: absolute; top: max(64px, env(safe-area-inset-top)); left: 0; right: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; padding: 0 12px; gap: 8px; }
.fuel { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; gap: 2px 6px; max-width: 150px; }
.fuel-ico { grid-row: span 2; font-size: 26px; filter: drop-shadow(0 2px 0 #0008); }
.fuel-tank { position: relative; height: 16px; border-radius: 9px; background: #2a1626cc; border: 2px solid #f2e6d4; overflow: hidden; box-shadow: 0 2px 0 #0006; }
.fuel-tank i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, #ff3b2f, #ffd23f 45%, #7cc240); transition: width .2s linear; }
.fuel-word { font-family: "Lilita One", sans-serif; font-weight: 400; font-size: 11px; letter-spacing: .08em; color: #fff; text-shadow: 0 1px 0 #0008; }
.fuel.low .fuel-tank { border-color: #ff3b2f; animation: flash 0.6s steps(2) infinite; }
.fuel.empty .fuel-word::after { content: ' EMPTY!'; color: #ff7a8a; }
.score { text-align: center; display: grid; justify-items: center; background: linear-gradient(180deg, #5a3550ee, #3b2238e6); border: 2px solid #ffb27a88; border-radius: 16px; padding: 4px 14px; box-shadow: inset 0 1px 0 #fff4; }
.score b { font-size: clamp(26px, 8vw, 42px); line-height: 1; background: linear-gradient(180deg, #fff1c8, var(--accent) 50%, var(--hot)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 #5a2a1e); }
.score span { font-size: 11px; color: var(--soft); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.gauge { justify-self: end; position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.gauge svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.g-face { fill: #2a1626e6; stroke: #f2e6d4; stroke-width: 4; }
.g-arc { fill: none; stroke: #ffffff55; stroke-width: 5; stroke-linecap: round; }
.g-red { fill: none; stroke: #ff3b2f; stroke-width: 5; stroke-linecap: round; }
.g-needle { stroke: #ff3b2f; stroke-width: 4; stroke-linecap: round; transform-origin: 50px 50px; transform: rotate(-130deg); transition: transform .15s linear; }
.g-hub { fill: #f2e6d4; }
.gauge b { position: relative; margin-top: 30px; font-size: 20px; line-height: 1; color: #fff; }
.gauge small { position: absolute; bottom: 4px; font-size: 10px; color: var(--soft); font-weight: 700; }
.nobrakes { position: absolute; left: -54px; bottom: -14px; font-family: "Lilita One", sans-serif; font-size: 14px; color: #fff; background: radial-gradient(circle, #ff6a3c, #c4161c); border: 2px solid var(--ink); border-radius: 12px; padding: 3px 8px; transform: rotate(-10deg); box-shadow: 0 3px 0 var(--ink); animation: flash 1s steps(2) infinite; white-space: nowrap; }
@keyframes flash { 50% { filter: brightness(1.5); transform: rotate(-10deg) scale(1.08); } }
.prog { position: absolute; top: calc(max(64px, env(safe-area-inset-top)) + 96px); left: 50%; transform: translateX(-50%); width: min(180px, 46vw); height: 8px; border-radius: 6px; background: #2a1626aa; border: 2px solid #ffb27a88; }
.prog i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 4px; background: linear-gradient(90deg, #ffd23f, #ff6a3c); }

.call { position: absolute; left: 0; right: 0; top: 36%; text-align: center; font-family: "Lilita One", sans-serif; font-size: clamp(28px, 9vw, 50px); color: var(--accent); text-shadow: 0 3px 0 #5a2a1e, 0 0 18px #ffb23a99; animation: pop .7s ease-out both; }
.call.bad { color: #ff7a8a; text-shadow: 0 3px 0 #3a0820, 0 0 18px #ff4d6d99; }
.call small { display: block; font-size: .45em; color: #fff; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 25% { transform: scale(1.12); opacity: 1; } 70% { transform: scale(1); opacity: 1; } 100% { transform: translateY(-16px); opacity: 0; } }

/* thumbs: steer left, HORN, steer right */
.pads { position: absolute; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: end; padding: 0 14px; gap: 10px; pointer-events: none; }
.bo .pad, .bo .horn { pointer-events: auto; touch-action: none; }
.bo .pad { width: min(30vw, 120px); height: 92px; font-size: 38px; color: #fff; background: linear-gradient(180deg, #ffffff40, #ffffff18); border: 2px solid #fff8; border-radius: 26px; box-shadow: 0 4px 0 #0006, inset 0 2px 0 #fff6; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.bo .pad.on { background: linear-gradient(180deg, #fff1c8, var(--accent)); color: #3a1800; }
.bo .horn { width: 92px; height: 92px; border-radius: 50%; font-size: 20px; color: #fff; background: radial-gradient(circle at 40% 35%, #ffb0a0, #ff3b2f 50%, #a01810); box-shadow: 0 5px 0 var(--ink), 0 0 20px #ff3b2f88, inset 0 3px 0 #fff8; }
.bo .horn.cool { filter: grayscale(.7) brightness(.8); }
body.tilt-steer .pad { opacity: .45; }
.tip { position: absolute; left: 16px; right: 16px; bottom: 124px; margin: 0; text-align: center; background: #fff; color: #5a2a1e; font-weight: 700; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--ink); }

/* end card */
.endc { margin-top: 6vh; }
.medal { width: 96px; height: 96px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-family: "Lilita One", sans-serif; font-size: 18px; color: #3a1800; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink), 0 0 30px #ffd23f88, inset 0 4px 0 #fff9; animation: pop2 .6s ease-out both; }
.medal.gold { background: radial-gradient(circle at 35% 30%, #fff6c8, #ffd23f 45%, #d48a12); }
.medal.silver { background: radial-gradient(circle at 35% 30%, #ffffff, #cfd8ee 45%, #8a95b8); }
.medal.bronze { background: radial-gradient(circle at 35% 30%, #ffe0c2, #e0915a 45%, #9a5428); }
@keyframes pop2 { 0% { transform: scale(.3) rotate(-30deg); } 70% { transform: scale(1.1) rotate(6deg); } 100% { transform: scale(1); } }
.big-num { margin: 0; }
.big-num b { font-size: clamp(44px, 14vw, 68px); background: linear-gradient(180deg, #fff1c8, var(--accent) 50%, var(--hot)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #5a2a1e); }
.new { margin: 0; color: var(--good); font-weight: 700; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.stats div { background: #ffffff12; border-radius: 12px; padding: 8px; }
.stats dt { font-size: 13px; color: var(--soft); font-weight: 700; }
.stats dd { margin: 0; font-size: 22px; color: #fff; }
.row { display: flex; gap: 10px; justify-content: center; }
.route { margin: 0; font-size: 13px; color: var(--soft); font-weight: 700; }
.row button { flex: 1; }

/* short sideways screens: a slimmer HUD and smaller thumbs */
@media (orientation: landscape) and (max-height: 500px) {
  .hud { top: 8px; padding-right: 64px; }
  .fuel { margin-top: 50px; }
  .prog { top: 96px; }
  .bo .pad { height: 72px; }
  .bo .horn { width: 76px; height: 76px; }
  .call { top: 30%; }
}
@media (prefers-reduced-motion: reduce) {
  .call, .medal, .nobrakes, .fuel.low .fuel-tank { animation: none; }
  .fuel-tank i { transition: none; }
  .g-needle { transition: none; }
}

/* Drive my street */
.bo button.go.mine { background: linear-gradient(180deg, #b8f0c8 0%, #3fae7a 40%, #1f6e44 100%); color: #fff; text-shadow: 0 2px 0 #0006; }
.town-list button { grid-template-columns: 1fr auto; }
.find { display: grid; gap: 6px; margin: 4px 0 8px; }
.find-row { display: flex; gap: 8px; }
.find-row input { flex: 1; min-width: 0; font: 600 17px Fredoka, sans-serif; padding: 12px; border-radius: 12px; border: 2px solid rgba(255,255,255,.35); background: rgba(0,0,0,.25); color: #fff; }
.find-row button { min-width: 64px; }
.credit { margin: 8px 0 0; font-size: 12px; color: var(--soft); }
.credit a { color: inherit; }
.osm-credit { display: none; position: fixed; left: 8px; bottom: calc(2px + env(safe-area-inset-bottom)); margin: 0; font-size: 10px; color: rgba(255,255,255,.75); text-shadow: 0 1px 2px #000; pointer-events: none; z-index: 5; }
body.on-map .osm-credit { display: block; }
