:root {
  --green: #1e463b;
  --green-deep: #13302a;
  --brass: #c79a4b;
  --brass-deep: #a9803f;
  --paper: #fbfaf6;
  --ink: #201d1a;
  --muted: #6b645a;
  --danger: #b3261e;
  --wa: #1fa855;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #0d1f1a;
  color: var(--ink);
  font-family: "Poppins", "Noto Sans Sinhala", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #3b3f3a;
  box-shadow: 0 0 60px rgba(0, 0, 0, .5);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

[hidden] { display: none !important; }

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  padding: max(10px, env(safe-area-inset-top)) 12px 0;
}
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; }
.hud-score { font-weight: 800; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.hud-score small, .over-score small {
  display: block; font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; opacity: .8;
}
.hud-right { text-align: right; font-variant-numeric: tabular-nums; }
.hud-dist { font-weight: 700; font-size: 18px; }
.hud-speed { font-size: 12px; opacity: .85; }

.route { position: relative; height: 22px; margin: 10px 6px 0; }
.route-text { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; margin: 0 2px; }
.route-text #route-here { color: var(--brass); text-transform: uppercase; letter-spacing: .08em; }
.route-line { position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .35); }
.route-fill { height: 100%; width: 0; border-radius: 2px; background: var(--brass); }
.route-dots { position: absolute; inset: 0; }
.route-dot { position: absolute; top: 6px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #fff; border: 2px solid var(--green); }
.route-dot.done { background: var(--brass); }
.route-bike { position: absolute; top: -8px; font-size: 18px; margin-left: -11px; transform: scaleX(-1); transition: left .2s linear; }

.hud-row { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.fuel { display: flex; align-items: center; gap: 6px; }
.fuel-ico { font-size: 16px; }
.fuel-bar { width: 110px; height: 10px; border-radius: 5px; background: rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .5); overflow: hidden; }
.fuel-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #e2b33c, #6fc16b); transition: width .15s linear; }
.fuel-fill.low { background: var(--danger); animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.hud-items { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 4px; }
.helmet-ico { margin-left: 8px; font-size: 18px; }

.coin {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3d189, var(--brass-deep));
  color: var(--green-deep); font-size: 8px; font-weight: 800; text-shadow: none;
  vertical-align: middle;
}

.banner {
  position: absolute; left: 0; right: 0; top: 43%;
  text-align: center; font-weight: 800; font-size: 26px; letter-spacing: .02em;
  opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .35s;
}
.banner small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; color: var(--brass); }
.banner.show { opacity: 1; transform: none; }

.countdown {
  position: absolute; left: 0; right: 0; top: 40%;
  text-align: center; font-weight: 800; font-size: 84px; line-height: 1;
}
.countdown.pop { animation: pop .6s ease-out; }
@keyframes pop { from { transform: scale(1.8); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); opacity: 1; } }

/* ---------- Screens ---------- */
.screen {
  position: absolute; inset: 0;
  overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top)) 16px 24px;
  background: linear-gradient(180deg, rgba(13, 31, 26, .55), rgba(13, 31, 26, .85));
  -webkit-overflow-scrolling: touch;
}
.screen-pause { display: grid; align-content: center; }

.card {
  position: relative;
  background: var(--paper);
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  border-top: 4px solid var(--brass);
  text-align: center;
}

.logo { width: 120px; height: auto; display: block; margin: 0 auto 2px; }
.title {
  margin: 0; font-size: 34px; font-weight: 800; line-height: 1.05; color: var(--green);
  text-transform: uppercase; letter-spacing: .02em;
}
.title .b { color: var(--brass-deep); }
.tagline { margin: 6px 0 14px; color: var(--muted); font-size: 14px; }

form { text-align: left; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--green); margin-bottom: 10px; letter-spacing: .02em; }
input {
  display: block; width: 100%; margin-top: 4px;
  padding: 12px 14px; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink);
  border: 1.5px solid #d8d1c3; border-radius: 12px; background: #fff;
}
input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(30, 70, 59, .15); }
.form-error { min-height: 1em; margin: 0 0 8px; color: var(--danger); font-size: 13px; font-weight: 600; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 50px; padding: 12px 18px;
  font: inherit; font-size: 17px; font-weight: 700; text-decoration: none;
  border: 0; border-radius: 14px; cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn-go { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-deep); }
.btn-go:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--green-deep); }
.btn-wa { background: var(--wa); color: #fff; font-size: 15px; min-height: 44px; }
.btn-ghost { background: transparent; color: var(--green); border: 1.5px solid var(--green); font-size: 15px; min-height: 44px; }
.btn-row { display: flex; gap: 8px; margin-top: 10px; }
.btn-fb {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 10px; min-height: 42px; font-size: 14px; background: #1877f2; color: #fff; text-decoration: none;
}
.btn-fb svg { width: 18px; height: 18px; flex: none; }
.link { background: none; border: 0; font: inherit; color: var(--muted); font-size: 13px; text-decoration: underline; margin-top: 10px; cursor: pointer; }

.howto { list-style: none; padding: 0; margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.howto li { margin: 3px 0; }
.howto b { color: var(--ink); }

.over-reason { margin: 4px 0 2px; font-weight: 700; color: var(--danger); font-size: 16px; }
.over-score { font-size: 56px; font-weight: 800; color: var(--green); line-height: 1; font-variant-numeric: tabular-nums; }
.over-score small { color: var(--muted); }
.over-meta { margin: 8px 0 2px; font-size: 14px; color: var(--ink); }
.over-status { margin: 4px 0 12px; font-size: 14px; color: var(--muted); min-height: 1.4em; }
.over-status.best { color: var(--brass-deep); font-weight: 700; }
.over-status.err { color: var(--danger); font-weight: 600; }

/* ---------- Leaderboard ---------- */
.board { margin-top: 16px; text-align: left; }
.board-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.board-tabs button {
  flex: 1; padding: 8px; font: inherit; font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--green); border-radius: 10px; background: transparent; color: var(--green); cursor: pointer;
}
.board-tabs button.on { background: var(--green); color: #fff; }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center;
  padding: 7px 4px; border-bottom: 1px solid #e9e3d6; font-size: 14px;
}
.board li.me { background: #f3ead6; border-radius: 8px; }
.board .rk { font-weight: 800; color: var(--muted); text-align: center; }
.board li:nth-child(1) .rk { color: #b8860b; }
.board li:nth-child(2) .rk { color: #8a8f96; }
.board li:nth-child(3) .rk { color: #a0522d; }
.board .who { min-width: 0; }
.board .nm { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .pl { font-size: 11px; color: var(--muted); letter-spacing: .05em; }
.board .sc { font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; text-align: right; }
.board .sc small { display: block; font-size: 10px; font-weight: 500; color: var(--muted); }
.board-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 10px 0; }
.board-more { display: block; margin-top: 8px; text-align: center; font-size: 13px; color: var(--green); font-weight: 600; }

/* ---------- Language switch & Sinhala ---------- */
.lang {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  display: flex; border: 1.5px solid var(--green); border-radius: 999px; overflow: hidden;
}
.lang button {
  font: inherit; font-size: 12px; font-weight: 700; line-height: 1;
  padding: 7px 10px; border: 0; background: transparent; color: var(--green); cursor: pointer;
}
.lang button.on { background: var(--green); color: #fff; }

/* Sinhala vowel signs sit above and below the line, and words run longer. */
html[lang="si"] .title { font-size: 30px; line-height: 1.35; letter-spacing: 0; }
html[lang="si"] .title .b { display: inline-block; }
html[lang="si"] .tagline, html[lang="si"] .howto { line-height: 1.6; }
html[lang="si"] .hud-score small, html[lang="si"] .over-score small,
html[lang="si"] .banner small, html[lang="si"] .route-text #route-here, html[lang="si"] .jc-kicker { letter-spacing: 0; }
html[lang="si"] .banner { font-size: 24px; line-height: 1.5; }
html[lang="si"] .btn { font-size: 16px; line-height: 1.35; }
html[lang="si"] .btn-wa, html[lang="si"] .btn-ghost { font-size: 14px; }
html[lang="si"] .over-reason { font-size: 17px; line-height: 1.5; }
html[lang="si"] .board-tabs button { font-size: 12.5px; }
#screen-over .card { padding-top: 46px; }

/* ---------- Pause & resume ---------- */
.hud-pause {
  pointer-events: auto;
  position: absolute; left: 50%; top: max(10px, env(safe-area-inset-top)); transform: translateX(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  background: rgba(0, 0, 0, .45); border: 1.5px solid rgba(255, 255, 255, .7); cursor: pointer;
}
.hud-pause span { display: block; width: 5px; height: 16px; border-radius: 2px; background: #fff; }
.screen { z-index: 2; }
#screen-pause .card { padding-top: 46px; }
.pause-title { margin: 0; font-size: 28px; font-weight: 800; color: var(--green); }
.pause-meta { margin: 4px 0 0; font-size: 15px; font-weight: 600; }
.pause-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.notice {
  margin: 10px 0 12px; padding: 10px 12px; border-radius: 12px;
  background: #e7f0ea; color: var(--green); font-size: 13.5px; font-weight: 600;
}
.resume-box {
  margin: 12px 0 14px; padding: 14px; border-radius: 14px;
  background: #f3ead6; border: 1.5px solid var(--brass);
}
.resume-title { margin: 0; font-weight: 800; color: var(--green); font-size: 16px; }
.resume-meta { margin: 4px 0 10px; font-size: 14px; }
.resume-box .form-error { margin-bottom: 6px; }
html[lang="si"] .pause-title { font-size: 26px; line-height: 1.4; }
html[lang="si"] .resume-title { line-height: 1.5; }

/* ---------- Sound toggle ---------- */
.hud-sound, .card-sound {
  display: grid; place-items: center; padding: 0; cursor: pointer; font-size: 18px; line-height: 1;
}
.hud-sound {
  pointer-events: auto;
  position: absolute; left: calc(50% + 4px); top: max(10px, env(safe-area-inset-top));
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0, 0, 0, .45); border: 1.5px solid rgba(255, 255, 255, .7);
}
.card-sound {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  width: 38px; height: 34px; border-radius: 999px;
  background: transparent; border: 1.5px solid var(--green);
}
.hud-pause { left: calc(50% - 26px); }

/* ---------- BLACK WIDGETS portal ---------- */
.rider-box { margin: 4px 0 2px; }
.who { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
#who-signed { color: var(--green); font-weight: 700; }
.who a, .over-signin { color: var(--green); font-weight: 700; }
#who-guest a { display: inline-block; margin-top: 2px; }
.over-signin { display: block; margin: -4px 0 12px; font-size: 14px; }
.over-signin[hidden] { display: none; }
.card-back {
  display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 600;
  color: var(--muted); text-decoration: none; letter-spacing: .04em;
}
.card-back:hover { color: var(--green); }
a.link { display: inline-block; }
.t-box {
  margin: 8px 0 12px; padding: 10px 12px; border-radius: 12px;
  background: #1e463b; color: #fff; text-align: center;
}
.t-title { margin: 0; font-weight: 800; font-size: 15px; }
.t-meta { margin: 2px 0 0; font-size: 12.5px; opacity: .85; }
html[lang="si"] .t-meta { line-height: 1.6; }
html[lang="si"] .who { line-height: 1.6; }

/* =================== Rider Life =================== */
.hud-gn { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: center; column-gap: 6px; font-weight: 800; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.hud-gn small { grid-column: 1 / -1; margin-top: 3px; font-size: 11px; font-weight: 700; color: #f3d189; }
.hud-gn .coin { width: 24px; height: 24px; font-size: 9px; }
.hud-place { display: flex; justify-content: space-between; margin: 12px 2px 0; font-size: 12px; font-weight: 600; }
#hud-town { color: var(--brass); text-transform: uppercase; letter-spacing: .08em; }
.fuel-l { font-size: 12px; font-weight: 700; min-width: 42px; font-variant-numeric: tabular-nums; }
.fuel-l.dark { color: var(--green); text-shadow: none; }

.shed-btn {
  pointer-events: auto;
  position: absolute; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  min-width: 220px; padding: 14px 20px; border: 0; border-radius: 999px;
  font: inherit; font-size: 17px; font-weight: 800; color: #fff; cursor: pointer; white-space: nowrap;
  background: #c4432b; box-shadow: 0 4px 0 #8f2d1b, 0 10px 30px rgba(0, 0, 0, .35);
  animation: nudge 1s ease-in-out infinite;
}
.shed-btn:active { transform: translateX(-50%) translateY(2px); box-shadow: 0 2px 0 #8f2d1b; }
.shed-btn.braking { animation: none; background: #7a7a7a; box-shadow: 0 4px 0 #555; }
@keyframes nudge { 50% { transform: translateX(-50%) scale(1.05); } }

.screen-mid { display: grid; align-content: center; }
#screen-shed .card, #screen-pause .card { padding-top: 22px; }
#screen-pause .card { padding-top: 46px; }

.guest-box { margin: 6px 0 4px; }
.guest-gift { margin: 0 0 12px; font-size: 15px; }
.guest-box .link { display: inline-block; }

.journey { margin: 4px 0 2px; }
.wallet {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-radius: 14px; background: var(--green); color: #fff; text-align: left;
}
.wallet-gn { display: flex; align-items: center; gap: 8px; font-size: 34px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.coin.big { width: 30px; height: 30px; font-size: 10px; }
.wallet-bits { display: grid; gap: 2px; font-size: 13px; font-weight: 600; text-align: right; }
.tank { display: flex; align-items: center; gap: 8px; margin: 12px 2px 2px; }
.fuel-bar.wide { flex: 1; width: auto; height: 12px; border-color: #cfc6b4; background: #ece6d9; }
.j-shed { margin: 4px 0 10px; font-size: 13px; color: var(--muted); }

.pump {
  margin: 0 0 12px; padding: 12px; border-radius: 14px;
  background: #fbeee9; border: 1.5px solid #e2a595;
}
.pump-title { margin: 0 0 8px; font-weight: 800; color: #9a2f1c; }
.pump .btn-row { margin-top: 0; }
.btn-fuel { background: #c4432b; color: #fff; font-size: 15px; min-height: 44px; box-shadow: 0 3px 0 #8f2d1b; }
.btn-brass { background: var(--brass); color: var(--green-deep); font-size: 15px; min-height: 44px; margin-top: 8px; box-shadow: 0 3px 0 var(--brass-deep); }

.mudalali {
  display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start; text-align: left;
  margin: 0 0 12px; padding: 12px; border-radius: 14px; background: #f3ead6; border: 1.5px solid var(--brass);
}
.mudalali-face { font-size: 34px; line-height: 1; }
.mudalali-says { margin: 0; font-size: 14px; font-style: italic; }
.mudalali .btn { width: 100%; }

#btn-push { margin-top: 8px; }
.roadside { margin: 0 0 12px; }
.roadside .btn { margin-top: 6px; font-size: 14px; min-height: 46px; }
.j-rest { margin: 0 0 4px; padding: 10px 12px; border-radius: 12px; background: #eef1f6; color: #2d4f7c; font-size: 13.5px; font-weight: 700; }
.book { margin-top: 14px; text-align: left; font-size: 13px; }
.book summary { cursor: pointer; font-weight: 700; color: var(--green); }
.book ol { list-style: none; margin: 8px 0 0; padding: 0; }
.book li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 2px; border-bottom: 1px solid #e9e3d6; }
.book .amt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.book .amt.in { color: #2f7d4f; }
.book .amt.out { color: var(--danger); }
.book .what { color: var(--ink); }
.book .when { display: block; font-size: 11px; color: var(--muted); }

.shed-title { margin: 0; font-size: 24px; font-weight: 800; color: #9a2f1c; }
.shed-meta { margin: 4px 0 0; font-size: 14px; }
#btn-shed-go { margin-top: 10px; }

.over-score { color: #2f7d4f; }
.over-loan { margin: 2px 0; font-size: 13px; color: var(--brass-deep); font-weight: 600; }
.over-where { margin: 6px 0 2px; font-size: 14px; font-weight: 700; color: var(--green); }

html[lang="si"] .mudalali-says, html[lang="si"] .guest-gift, html[lang="si"] .j-shed { line-height: 1.6; }
html[lang="si"] .shed-btn { font-size: 15px; }
html[lang="si"] .shed-title { font-size: 21px; line-height: 1.5; }
.over-reason.calm { color: var(--green); }

/* ---------- Garage ---------- */
.meter { display: flex; align-items: center; gap: 8px; margin: 6px 2px 0; }
.fuel-fill.energy { background: linear-gradient(90deg, #e8872b, #f0c541); }
.fuel-fill.cond { background: linear-gradient(90deg, #8a8f96, #3f7fb5); }
.fuel-fill.clean { background: linear-gradient(90deg, #9fd3e6, #2f9fc8); }
.fuel-fill.low.energy, .fuel-fill.low.cond { background: var(--danger); }
.fuel-bar.sm { width: 54px; height: 8px; }
.energy-ico, .shine-ico { font-size: 14px; }
.hud-items { gap: 5px; }
.j-shine { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--brass-deep); min-height: 1em; }
.services {
  margin: 0 0 12px; padding: 12px; border-radius: 14px;
  background: #eef4ee; border: 1.5px solid #9cc0a5;
}
.services .pump-title { color: var(--green); }
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.btn-svc {
  min-height: 58px; padding: 6px 4px; font-size: 13px; line-height: 1.25;
  background: #fff; color: var(--green); border: 1.5px solid var(--green); white-space: pre-line;
}
#btn-mechanic { margin: 0 0 12px; }
.garage-note { margin: 8px 0 4px; font-size: 12.5px; color: var(--muted); }
.bikes { display: grid; gap: 8px; margin-top: 6px; }
.bike-card {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center;
  padding: 10px; border-radius: 12px; border: 1.5px solid #e2dccd; background: #fff;
}
.bike-card.on { border-color: var(--green); background: #eef4ee; }
.bike-dot { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 -4px 0 rgba(0,0,0,.2); }
.bike-name { font-weight: 800; color: var(--ink); font-size: 14px; }
.bike-stats { font-size: 11.5px; color: var(--muted); }
.bike-card .btn { width: auto; min-height: 38px; padding: 6px 12px; font-size: 13px; }
.bike-tag { font-size: 12px; font-weight: 700; color: var(--green); }
.over-bike { margin: 2px 0; font-size: 13px; color: var(--muted); font-weight: 600; }
html[lang="si"] .btn-svc { font-size: 12px; }

/* ---------- Businesses ---------- */
.plots {
  margin: 0 0 12px; padding: 12px; border-radius: 14px; text-align: left;
  background: #f6f1e4; border: 1.5px solid var(--brass);
}
.plots .pump-title { color: var(--brass-deep); text-align: center; }
.plots ol, #j-mybiz-list { list-style: none; margin: 0; padding: 0; }
.plot { padding: 8px 2px; border-bottom: 1px solid #e9e3d6; font-size: 13px; }
.plot:last-child { border-bottom: 0; }
.plot-name { font-weight: 700; color: var(--ink); }
.plot-owner { color: var(--muted); font-size: 12px; }
.plot-open { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.plot-open .btn { min-height: 40px; padding: 5px 8px; font-size: 12px; line-height: 1.25; }
.mybiz-stats { display: block; font-size: 11.5px; color: var(--muted); }
.svc-by { display: block; font-size: 10.5px; font-weight: 600; color: var(--brass-deep); margin-top: 2px; }
#j-mybiz-list li { display: block; }
#j-mybiz-list .link { margin-top: 4px; font-size: 12px; }

/* ---------- Friends & loans ---------- */
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800;
}
.fr-add { display: flex; gap: 6px; margin-top: 10px; }
.fr-add input { margin: 0; padding: 9px 12px; font-size: 14px; }
.fr-add .btn { width: auto; min-height: 42px; padding: 6px 14px; font-size: 14px; }
.fr-note { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.fr-list li { display: block; }
.fr-head { margin: 10px 0 2px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brass-deep); border: 0 !important; padding: 0 !important; }
.fr-who { font-weight: 700; color: var(--ink); }
.fr-meta { display: block; font-size: 12px; color: var(--muted); }
.fr-meta.late { color: var(--danger); font-weight: 700; }
.fr-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fr-acts .btn { width: auto; min-height: 34px; padding: 4px 12px; font-size: 12.5px; }
.fr-acts .link { margin: 0; font-size: 12px; }

/* ---------- Goals ---------- */
.hud-job {
  display: inline-block; margin: 5px 0 0; padding: 4px 10px 5px; border-radius: 10px;
  background: rgba(196, 112, 32, .88); border: 1px solid #f3c27a;
  font-size: 12px; font-weight: 700; color: #fff; text-shadow: none; min-width: 150px;
}
.hud-job-bar { height: 4px; margin-top: 3px; border-radius: 2px; background: rgba(0, 0, 0, .3); overflow: hidden; }
.hud-job-bar div { height: 100%; width: 0; background: #fff3d6; transition: width .3s linear; }
.hud-job.lost { background: rgba(120, 72, 40, .88); border-color: #b98a62; }
.hud-job.done { background: rgba(47, 125, 79, .92); border-color: #9be3b3; animation: jobpop .5s ease-out; }
.hud-job.done .hud-job-bar { display: none; }
@keyframes jobpop { from { transform: scale(1.25); } to { transform: none; } }

/* Goals as they happen on the road: never in the way of the traffic. */
.goal-toast {
  position: absolute; left: 50%; top: 21%; width: min(320px, calc(100% - 32px));
  display: flex; gap: 10px; align-items: center;
  padding: 10px 14px; border-radius: 14px;
  background: rgba(19, 48, 42, .92); border: 1.5px solid var(--brass);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35); text-shadow: none;
  opacity: 0; transform: translate(-50%, -14px) scale(.96); transition: opacity .3s, transform .3s;
}
.goal-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.goal-toast.show.big { animation: toastpop .55s ease-out; }
@keyframes toastpop { 0% { transform: translate(-50%, 0) scale(.7); } 60% { transform: translate(-50%, 0) scale(1.07); } 100% { transform: translate(-50%, 0) scale(1); } }
.gt-icon { font-size: 30px; line-height: 1; }
.gt-body { min-width: 0; }
.gt-title { display: block; font-size: 16px; font-weight: 800; color: #fff; line-height: 1.2; }
.gt-sub { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 600; color: #f3d189; }
.gt-list { margin: 4px 0 0; padding-left: 16px; font-size: 12px; font-weight: 600; color: #e9efe9; }
.goal-toast.job { background: rgba(150, 82, 20, .94); border-color: #f3c27a; }
.goal-toast.win { background: rgba(33, 102, 62, .95); border-color: #9be3b3; }
.goal-toast.win .gt-icon { font-size: 36px; }
.goal-toast.bad { background: rgba(140, 32, 26, .94); border-color: #f09a92; }
.goal-toast.small { padding: 7px 12px; }
.goal-toast.small .gt-icon { font-size: 22px; }
.goal-toast.small .gt-title { font-size: 14px; }

.level-badge {
  display: inline-block; margin-left: 6px; padding: 2px 8px 3px; border-radius: 999px;
  background: var(--brass); color: var(--green-deep); font-size: 11px; font-weight: 800;
  letter-spacing: .02em; vertical-align: middle;
}
.over-level {
  margin: 10px 0 6px; padding: 14px; border-radius: 14px; text-align: center;
  background: linear-gradient(160deg, #1e463b, #13302a); color: #fff;
  border: 2px solid var(--brass); animation: jobpop .5s ease-out;
}
.ol-icon { font-size: 44px; line-height: 1; }
.ol-title { display: block; margin-top: 4px; font-size: 21px; font-weight: 800; color: #f3d189; }
.ol-sub { display: block; font-size: 15px; font-weight: 700; }
.over-level ul { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13.5px; font-weight: 600; }
.over-level li { margin: 3px 0; }

/* A police check on the road. */
.check-card { text-align: center; padding-top: 22px; }
.ck-icon { font-size: 52px; line-height: 1; }
.ck-title { margin: 6px 0 0; font-size: 22px; font-weight: 800; color: var(--green); }
.ck-says { margin: 6px 0 0; font-size: 15px; font-weight: 600; color: var(--ink); min-height: 1.4em; }
.ck-result { margin: 8px 0 12px; font-size: 15px; font-weight: 700; color: #2f7d4f; min-height: 1.4em; }
.ck-result.fined { color: var(--danger); }
.shed-btn.police { background: #1f4d8c; }

/* The job card, as a job is taken. */
.job-card { text-align: center; padding-top: 22px; }
.jc-icon { font-size: 56px; line-height: 1; animation: jcdrop .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes jcdrop { from { transform: translateY(-40px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.jc-kicker { margin: 8px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #b0661c; }
.jc-cargo { margin: 2px 0 10px; font-size: 22px; font-weight: 800; color: var(--green); }
.jc-route { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.jc-route span:first-child, .jc-route span:last-child { flex: 0 0 auto; }
.jc-line { flex: 1; height: 0; border-top: 3px dashed #d9a066; position: relative; }
.jc-line::after { content: "🛵"; position: absolute; left: 0; top: -14px; font-size: 16px; animation: jcride 2.4s ease-in-out infinite; }
@keyframes jcride { from { left: 0; } to { left: calc(100% - 18px); } }
.jc-meta { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.jc-pay { margin: 6px 0 14px; font-size: 15px; font-weight: 800; color: #2f7d4f; }
.job-card .link { display: block; margin: 10px auto 0; }

/* The ride summary's job card. */
.over-job {
  margin: 10px 0 6px; padding: 12px 14px; border-radius: 14px; text-align: left;
  background: #fdf1df; border: 1.5px solid #e7b574;
}
.over-job.won { background: #e7f5ec; border-color: #7fcf9b; animation: jobpop .5s ease-out; }
.over-job.bad { background: #fbe9e7; border-color: #ec9f97; }
.oj-head { display: flex; align-items: center; gap: 10px; }
.oj-icon { font-size: 34px; line-height: 1; }
.oj-title { display: block; font-size: 18px; font-weight: 800; color: var(--green); }
.over-job.bad .oj-title { color: var(--danger); }
.oj-route { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.oj-lines { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13.5px; font-weight: 700; }
.oj-lines li { margin: 2px 0; }
.oj-lines .gold { color: #a9803f; }
.oj-lines .lost { color: var(--muted); font-weight: 600; }
.over-job .btn { margin-top: 10px; min-height: 42px; font-size: 14px; }
.job.flash { animation: jobflash 1.4s ease-out; }
@keyframes jobflash { 0%, 40% { box-shadow: 0 0 0 4px rgba(224, 138, 44, .7); } 100% { box-shadow: 0 0 0 0 rgba(224, 138, 44, 0); } }
.goals { margin: 0 0 4px; }
.job {
  margin: 0 0 10px; padding: 12px; border-radius: 14px; text-align: left;
  background: #eef1f6; border: 1.5px solid #9aaecb;
}
.job:empty { display: none; }
.job-title { margin: 0 0 6px; font-weight: 800; color: #2d4f7c; }
.job-now { font-size: 14px; }
.job-now b { color: var(--ink); }
.job-meta { display: block; font-size: 12px; color: var(--muted); }
.job-offer { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid #d9e0ea; }
.job-offer:first-of-type { border-top: 0; }
.job .btn { width: auto; min-height: 36px; padding: 5px 12px; font-size: 12.5px; }
.job .link { margin-top: 6px; font-size: 12px; }
.ch-list { list-style: none; margin: 8px 0 0; padding: 0; }
.ch-list li { padding: 7px 2px; border-bottom: 1px solid #e9e3d6; }
.ch-text { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.ch-text b { color: var(--brass-deep); white-space: nowrap; }
.ch-bar { height: 6px; margin-top: 5px; border-radius: 3px; background: #ece6d9; overflow: hidden; }
.ch-bar > div { height: 100%; background: linear-gradient(90deg, var(--brass), #6fc16b); }
.ch-list li.done .ch-text { color: #2f7d4f; font-weight: 700; }
.towns { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.towns span { padding: 3px 8px; border-radius: 999px; font-size: 11.5px; background: #ece6d9; color: #a39a8a; }
.towns span.seen { background: var(--green); color: #fff; }
.over-goals { list-style: none; margin: 6px 0 4px; padding: 0; font-size: 13.5px; font-weight: 700; color: #2f7d4f; }
.over-goals li { margin: 2px 0; }
.over-goals li.fine { color: var(--danger); }
.shed-btn.rail { background: #b3261e; box-shadow: 0 4px 0 #7d1a15, 0 10px 30px rgba(0, 0, 0, .35); }

summary .badge { margin-left: 4px; vertical-align: 1px; }

/* ---------- News & alerts ---------- */
.alerts {
  margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; text-align: left;
  background: #fff6dc; border: 1.5px solid var(--brass);
}
.alerts-title { margin: 0 0 6px; font-weight: 800; color: var(--brass-deep); }
.alerts ul { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.alerts li { padding: 3px 0; }
.alerts .link { margin-top: 6px; }
.news { margin-top: 14px; }
.news-list { list-style: none; margin: 8px 0 0; padding: 0; }
.news-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 2px; border-bottom: 1px solid #e9e3d6; font-size: 13px; text-align: left; }
.news-list .when { flex-shrink: 0; font-size: 11px; color: var(--muted); }
