* { box-sizing: border-box; }
/* The game's font where Chalkboard SE (Apple only, not ours to ship) is missing:
   Balsamiq Sans (SIL OFL, assets/fonts/OFL.txt; the user's pick F2 on font-designs.html),
   Google Fonts' subsets, so a browser loads only the ones its text needs. 700 serves 800/900. */
@font-face { font-family: 'Balsamiq Sans'; font-style: normal; font-weight: 400; font-display: block; src: url(../assets/fonts/balsamiq-sans-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Balsamiq Sans'; font-style: normal; font-weight: 400; font-display: block; src: url(../assets/fonts/balsamiq-sans-400-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Balsamiq Sans'; font-style: normal; font-weight: 400; font-display: block; src: url(../assets/fonts/balsamiq-sans-400-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Balsamiq Sans'; font-style: normal; font-weight: 700; font-display: block; src: url(../assets/fonts/balsamiq-sans-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Balsamiq Sans'; font-style: normal; font-weight: 700; font-display: block; src: url(../assets/fonts/balsamiq-sans-700-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Balsamiq Sans'; font-style: normal; font-weight: 700; font-display: block; src: url(../assets/fonts/balsamiq-sans-700-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
/* UI style D "Çizgi roman çıkartması" (chosen 2026-10-24): plain cream panels
   (no texture, user's pick from ui-bg.html), thick ink edges, hard offset
   shadow, slight tilt, and no rounded or oval corners anywhere.
   The interface is laid out for a 844x390 / 390x844 phone and scaled as a
   whole (#ui, see js/ui.js) so it keeps its proportions on any screen. */
:root {
  --ink: #222; --paper: #fff7e0; --white: #ffffff; --ui-yellow: #ffd21f; --ui-red: #ff5a3c; --ui-blue: #2f8cff; --ui-green: #3cc46a;
  --p1: #ff4f9a; --p2: #2f8cff;
  --comic: "Chalkboard SE", "Balsamiq Sans", "Comic Sans MS", sans-serif;
  --edge: 3px solid var(--ink); --drop: 4px 4px 0 var(--ink);
  --title-ink: 3px 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink);
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
}
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #9fd6ef;
  font-family: var(--comic); color: var(--ink);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: none;
}
:lang(zh), :lang(ja), :lang(ko) { --comic: "PingFang SC", "Hiragino Sans", "Apple SD Gothic Neo", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif; }
:lang(ar) { --comic: "Geeza Pro", "Noto Sans Arabic", Tahoma, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; transition: filter .6s; }
#game.gray { filter: grayscale(1) contrast(1.05); }
#loading {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 20;
  background: var(--paper); color: var(--ink); font: 800 26px var(--comic); letter-spacing: .05em;
}

/* --- scaled UI layer ----------------------------------------------------------------- */
#ui { position: fixed; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
#ui [hidden] { display: none !important; }
.ico { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: square; stroke-linejoin: miter; flex: none; }
.paper { background: var(--paper); color: var(--ink); border: var(--edge); box-shadow: var(--drop); border-radius: 0; }

/* buttons */
.btn, .tile, .ibtn, .round {
  pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--white); color: var(--ink); border: var(--edge); box-shadow: var(--drop); border-radius: 0;
  font-family: var(--comic); font-weight: 800; transition: transform .06s, box-shadow .06s;
}
.btn:active, .tile:active, .ibtn:active, .round:active { transform: translate(3px, 3px) !important; box-shadow: 1px 1px 0 var(--ink); }
.btn { min-height: 52px; padding: 6px 20px; font-size: 20px; white-space: nowrap; }
.btn.primary, .round.big { background: var(--ui-red); color: #fff; }
.btn.big { min-height: 74px; padding: 8px 30px; font-size: 32px; transform: rotate(-1.5deg); }
.btn .txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.02; }
.btn .txt small { font-size: 13px; opacity: .9; font-weight: 800; }
.btn.wide { width: 100%; min-height: 56px; font-size: 24px; }
.tile { width: 92px; height: 92px; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.05; text-align: center; transform: rotate(-1.5deg); }
.tile:nth-child(3) { transform: rotate(2deg); }
.tile .ico { width: 34px; height: 34px; }
.ibtn { width: 50px; height: 50px; padding: 0; }
.round { width: 66px; height: 66px; padding: 0; }
.round.big { width: 96px; height: 96px; }
.round .ico { width: 32px; height: 32px; }
.round.big .ico { width: 46px; height: 46px; }
.round.sm { width: 44px; height: 44px; }
.round.sm .ico { width: 24px; height: 24px; }
.title { font-weight: 900; color: var(--ui-yellow); text-shadow: var(--title-ink); letter-spacing: .02em; font-size: 40px; line-height: 1.05; text-align: center; white-space: nowrap; }
.title.small { font-size: 28px; }
.chip { display: inline-block; padding: 1px 9px; font-weight: 900; font-size: 14px; color: #fff; border: 2px solid var(--ink); }
.chip.p1, .p1 .chip { background: var(--p1); }
.chip.p2, .p2 .chip { background: var(--p2); }
/* coin: C1 "yıldızlı sekizgen" from icons.html (chosen 2026-10-24) */
.coin { display: inline-block; flex: none; width: 22px; height: 22px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolygon points='7,1 17,1 23,7 23,17 17,23 7,23 1,17 1,7' fill='%23ffc21a' stroke='%23222' stroke-width='2'/%3E%3Cpolygon points='8.5,4.5 15.5,4.5 19.5,8.5 19.5,15.5 15.5,19.5 8.5,19.5 4.5,15.5 4.5,8.5' fill='none' stroke='%23d38a00' stroke-width='1.4'/%3E%3Cpolygon points='12,6.6 13.6,10.2 17.4,10.4 14.5,12.9 15.4,16.6 12,14.6 8.6,16.6 9.5,12.9 6.6,10.4 10.4,10.2' fill='%23fff1a0' stroke='%23222' stroke-width='1.3'/%3E%3C/svg%3E") center / contain no-repeat; }

/* overlays: one shown at a time (js/ui.js) */
.overlay { position: absolute; inset: 0; display: none; }
.overlay.show { display: block; animation: ovIn .18s ease-out; }
@keyframes ovIn { from { opacity: 0; } }
.overlay.solid { background: rgba(40, 30, 10, .42); pointer-events: auto; }
.overlay.dim { background: rgba(40, 30, 10, .38); pointer-events: auto; }
.center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.ibtn.back, .ibtn.tl { position: absolute; left: calc(14px + var(--sl)); top: calc(14px + var(--st)); }

/* brand block: logo with "© Made by" right-aligned above it */
.brand { position: absolute; display: flex; flex-direction: column; align-items: flex-end; pointer-events: auto; right: calc(14px + var(--sr)); bottom: calc(10px + var(--sb)); }
.brand small { padding-right: 6px; font: 800 10px/1.2 system-ui, sans-serif; letter-spacing: .04em; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); }
.brand img { width: 104px; display: block; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .3)); }
.brand a:not([href]) { pointer-events: none; }
.port .brand { right: auto; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--sb)); }

/* --- menu (layout A: bottom dock) ------------------------------------------------------ */
.topleft { position: absolute; left: calc(14px + var(--sl)); top: calc(14px + var(--st)); display: flex; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px 0 8px; background: var(--paper); border: var(--edge); box-shadow: 3px 3px 0 var(--ink); font-weight: 900; font-size: 19px; }
/* rewarded ads: the coin pill's "+", the garage's try button, the coin offer */
.pill .plus { pointer-events: auto; display: grid; place-items: center; width: 30px; height: 30px; margin: 0 -6px 0 2px; padding: 0; border: 2px solid var(--ink); border-radius: 0; font-size: 0; /* the + is drawn: a font's glyph sits off centre */
  background:
    linear-gradient(#fff, #fff) center / 14px 4px no-repeat, linear-gradient(#fff, #fff) center / 4px 14px no-repeat,
    linear-gradient(var(--ink), var(--ink)) calc(50% + 1px) calc(50% + 1px) / 14px 4px no-repeat, linear-gradient(var(--ink), var(--ink)) calc(50% + 1px) calc(50% + 1px) / 4px 14px no-repeat,
    var(--ui-green); }
.pill .plus:active { transform: translate(2px, 2px); }
.adcoins { width: 300px; max-width: calc(100% - 28px); padding: 14px 18px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; transform: rotate(-1.5deg); box-shadow: 6px 6px 0 var(--ink); pointer-events: auto; }
.adcoins p { margin: 0; font-size: 17px; font-weight: 800; }
.adc-coin { display: flex; align-items: center; gap: 8px; font-size: 34px; font-weight: 900; }
.adc-coin .coin { width: 40px; height: 40px; }
.adcoins .btn:not(.wide) { min-height: 40px; font-size: 17px; }
.topright { position: absolute; right: calc(14px + var(--sr)); top: calc(14px + var(--st)); display: flex; gap: 10px; }
/* portrait: the coin bar and Market take the top row, the other buttons stack down the right edge */
.port #ov-menu .topright { flex-direction: column; }
/* landscape: More games sits under Settings, out of the row (portrait: the column already puts it there) */
.land #moreGames { position: absolute; right: 0; top: 60px; }
.logo { position: absolute; left: 50%; top: calc(18px + var(--st)); transform: translateX(-50%) rotate(-4deg); text-align: center; line-height: .88; font-family: var(--comic); font-weight: 900; }
.logo b { display: block; font-size: 50px; color: var(--ui-yellow); text-shadow: 4px 4px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink); }
.logo span { display: block; font-size: 64px; color: var(--ui-red); text-shadow: 4px 4px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink); }
.port .logo { top: calc(110px + var(--st)); }
.port .logo b { font-size: 58px; } .port .logo span { font-size: 74px; }
.hint { position: absolute; left: 50%; transform: translateX(-50%); top: 62%; font-weight: 900; font-size: 20px; color: #fff; text-shadow: var(--title-ink); white-space: nowrap; animation: pulse 1.6s ease-in-out infinite; }
.port .hint { top: 58%; } /* above the two-row dock */
@keyframes pulse { 50% { opacity: .55; } }
.dock { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--sb)); display: flex; gap: 14px; align-items: flex-end; }
.port .dock { bottom: calc(132px + var(--sb)); gap: 10px; }
.port .dock .tile { width: 80px; height: 80px; font-size: 11px; }
.port .dock .tile .ico { width: 30px; height: 30px; }
.port .dock .btn.big { min-height: 66px; padding: 6px 20px; font-size: 27px; }

/* --- HUD --------------------------------------------------------------------------------- */
#hud { position: absolute; inset: 0; }
.hud-pause { position: absolute; left: calc(14px + var(--sl)); top: calc(14px + var(--st)); }
#wanted { position: absolute; top: calc(12px + var(--st)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 7px; }
#stars, .vs-stars { display: flex; gap: 4px; padding: 5px 9px; box-shadow: 3px 3px 0 var(--ink); }
#stars i, .vs-stars i {
  width: 22px; height: 22px; display: block; background: rgba(34, 34, 34, .22);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); transition: background .2s;
}
#stars i.on, .vs-stars i.on { background: #ffcf3f; }
#stars.flash { animation: starFlash .9s ease-out; }
@keyframes starFlash { 0% { transform: scale(1.35) rotate(-3deg); } 30% { background: var(--ui-red); } 100% { transform: scale(1); } }
#health { width: 150px; height: 11px; background: var(--paper); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); overflow: hidden; }
#healthFill, .vbar i { display: block; height: 100%; width: 100%; background: var(--ui-green); transition: width .15s; }
#healthFill.mid, .vbar i.mid { background: #ffb347; }
#healthFill.low, .vbar i.low { background: #ff4d4d; }
#ability { display: flex; align-items: center; gap: 6px; background: var(--paper); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); font-weight: 800; font-size: 11px; padding: 2px 8px; }
#ability i { width: 54px; height: 7px; border: 1.5px solid var(--ink); background: #fff; overflow: hidden; display: block; }
#ability s { display: block; height: 100%; width: 0; background: var(--ui-blue); text-decoration: none; }
#ability.ready s { background: var(--ui-yellow); }
#scoreBox { position: absolute; top: calc(14px + var(--st)); right: calc(14px + var(--sr)); padding: 3px 12px; text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; transform: rotate(1.5deg); box-shadow: 3px 3px 0 var(--ink); }
#scoreBox small { display: block; font-size: 10px; opacity: .65; letter-spacing: .08em; }
#scoreBox span { font-size: 24px; line-height: 1.05; }
/* coins picked up this run (coin packs on the road) */
#runCoins { position: absolute; top: calc(70px + var(--st)); right: calc(14px + var(--sr)); display: flex; align-items: center; gap: 5px; padding: 2px 10px 2px 6px; font-weight: 900; font-size: 18px; font-variant-numeric: tabular-nums; transform: rotate(-1deg); box-shadow: 3px 3px 0 var(--ink); }
#runCoins.pop { animation: coinPop .35s ease-out; }
@keyframes coinPop { 0% { transform: scale(1.35) rotate(-4deg); background: var(--ui-yellow); } 100% { transform: scale(1) rotate(-1deg); } }
.reduce-motion #runCoins.pop { animation: none; }
/* drift points (game/drift.js): the drift going on, then what it gave (yellow) or lost (struck out) */
#drift { position: absolute; top: calc(108px + var(--st)); right: calc(14px + var(--sr)); display: flex; align-items: baseline; gap: 6px; padding: 2px 10px; font-weight: 900; font-size: 18px; font-variant-numeric: tabular-nums; transform: rotate(1deg); box-shadow: 3px 3px 0 var(--ink); }
#runCoins[hidden] + #drift { top: calc(70px + var(--st)); } /* no coins this run: in their place */
#drift small { font-size: 11px; letter-spacing: .08em; }
#drift.done { background: var(--ui-yellow); animation: coinPop .35s ease-out; }
#drift.lost span { text-decoration: line-through; opacity: .55; }
.reduce-motion #drift.done { animation: none; }
#speedBox { position: absolute; left: calc(14px + var(--sl)); bottom: calc(14px + var(--sb)); padding: 3px 12px; font-weight: 900; font-size: 26px; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 6px; transform: rotate(-1.5deg); box-shadow: 3px 3px 0 var(--ink); }
#speedBox small { font-size: 12px; opacity: .7; }
/* touch screens: left / right pads in the bottom corners, a guide for where to tap
   (each half of the screen steers), mostly see-through (user, 2026-10-27); a pad
   lights up, more solid, while its side is held. The
   speed moves to the bottom middle between them. */
.steer { position: absolute; bottom: calc(14px + var(--sb)); width: 111px; height: 111px; display: grid; place-items: center; background: var(--paper); border: var(--edge); box-shadow: var(--drop); opacity: .2; pointer-events: none; transition: transform .06s, box-shadow .06s, background-color .06s, opacity .06s; }
.steer .ico { width: 63px; height: 63px; stroke-width: 3.4; }
.steer.left { left: calc(14px + var(--sl)); transform: rotate(-2deg); }
.steer.right { right: calc(14px + var(--sr)); transform: rotate(2deg); }
.steer.on { background: var(--ui-yellow); box-shadow: 1px 1px 0 var(--ink); opacity: .5; }
.steer.left.on { transform: translate(3px, 3px) rotate(-2deg); } .steer.right.on { transform: translate(3px, 3px) rotate(2deg); }
.hb { position: absolute; bottom: calc(135px + var(--sb)); width: 72px; height: 72px; display: grid; place-items: center; background: var(--paper); border: var(--edge); box-shadow: var(--drop); pointer-events: auto; touch-action: none; opacity: .8; }
.hb .ico { width: 44px; height: 44px; }
.hb.left { left: calc(14px + var(--sl)); } .hb.right { right: calc(14px + var(--sr)); }
.hb.on { background: var(--ui-yellow); box-shadow: 1px 1px 0 var(--ink); transform: translate(3px, 3px); }
@media (hover: hover) { .steer, .hb { display: none; } }
@media (hover: none) { #speedBox { left: 50%; transform: translateX(-50%) rotate(-1.5deg); } }
#toast {
  position: absolute; top: calc(98px + var(--st)); left: 50%; transform: translateX(-50%) rotate(-2deg);
  background: var(--ui-yellow); border: var(--edge); box-shadow: var(--drop); font-weight: 900; font-size: 19px; letter-spacing: .03em;
  padding: 5px 18px; opacity: 0; white-space: nowrap; z-index: 40; pointer-events: none;
}
#toast.show { animation: toast 2.6s ease-out forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -8px) rotate(-2deg) scale(1.2); } 12% { opacity: 1; transform: translate(-50%, 0) rotate(-2deg); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* --- settings ------------------------------------------------------------------------------- */
.settings { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-1deg); width: 400px; max-width: calc(100% - 28px); padding: 14px 18px 14px; display: flex; flex-direction: column; gap: 8px; pointer-events: auto; }
.settings .row { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; min-height: 38px; }
.settings .row > span { flex: 1; }
.settings .row .ico { width: 22px; height: 22px; opacity: .8; }
.settings .row.end { justify-content: space-between; margin-top: 4px; }
.settings .link { font-size: 13px; opacity: .8; text-decoration: underline; color: var(--ink); }
.settings .btn { min-height: 44px; font-size: 18px; padding: 4px 22px; }
.toggle { width: 54px; height: 30px; background: rgba(120, 120, 130, .45); border: var(--edge); position: relative; flex: none; padding: 0; border-radius: 0; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border: 2px solid var(--ink); }
.toggle.on { background: var(--ui-green); }
.toggle.on::after { left: auto; right: 2px; }
[dir="rtl"] .toggle.on::after { right: auto; left: 2px; }
[dir="rtl"] .toggle:not(.on)::after { left: auto; right: 2px; }
.seg { display: inline-flex; border: var(--edge); }
.settings .row > .seg { flex: none; } /* only as wide as its buttons, right-aligned like the other controls */
.seg button { border: 0; padding: 3px 12px; font-size: 14px; font-weight: 800; background: #fff; }
.seg button.on { background: var(--ui-yellow); }
#langSelect { font: 800 15px var(--comic); padding: 4px 8px; border: var(--edge); background: #fff; color: var(--ink); border-radius: 0; box-shadow: 2px 2px 0 var(--ink); }

/* --- pause ----------------------------------------------------------------------------------- */
.rowbtns { display: flex; gap: 16px; align-items: center; }
.lbl { font-size: 14px; font-weight: 900; text-align: center; margin-top: 8px; color: #fff; text-shadow: 2px 2px 0 var(--ink), -1px 0 0 var(--ink), 1px 0 0 var(--ink), 0 -1px 0 var(--ink); }
#ov-pause .center { padding-bottom: 50px; }
.port #ov-pause .center { padding-bottom: 150px; }

/* --- result card ------------------------------------------------------------------------------ */
.result { width: 340px; max-width: calc(100% - 28px); padding: 16px 18px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; transform: rotate(-1.5deg); box-shadow: 6px 6px 0 var(--ink); pointer-events: auto; }
.result .title { font-size: 34px; color: var(--ui-red); }
.result .title.wrecked { color: #ff9f1c; }
.rstars { display: flex; gap: 3px; }
.rstars .ico { width: 24px; height: 24px; color: rgba(34, 34, 34, .2); }
.rstars .ico.on { color: #ffcf3f; filter: drop-shadow(1px 1px 0 var(--ink)); }
.muted { font-size: 12px; font-weight: 800; opacity: .65; letter-spacing: .06em; }
.bignum { font-size: 48px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; transform: rotate(-4deg); background: var(--ui-green); color: #fff; padding: 2px 10px; border: 2px solid var(--ink); font-weight: 900; font-size: 14px; }
.tag.plain { background: transparent; color: var(--ink); border-color: transparent; transform: none; font-weight: 800; opacity: .75; }
.coins-line { display: flex; align-items: center; gap: 6px; font-size: 22px; font-weight: 900; }
.result .btns { display: flex; flex-direction: column; gap: 9px; width: 100%; margin-top: 6px; }
.result .row2 { display: flex; gap: 9px; }
.result .row2 .btn { flex: 1; min-height: 46px; font-size: 17px; padding: 4px 8px; }
.keyhint { font-size: 11px; opacity: .55; margin-top: 2px; }
@media (hover: none) { .keyhint, .vscard .keys { display: none; } }
.land .result { padding: 10px 18px 10px; gap: 3px; }
.land .result .bignum { font-size: 40px; }

/* --- garage --------------------------------------------------------------------------------- */
#ov-garage > .title { position: absolute; left: 50%; top: calc(12px + var(--st)); transform: translateX(-50%) rotate(-2deg); font-size: 34px; }
.garage { position: absolute; left: calc(14px + var(--sl)); right: calc(14px + var(--sr)); top: calc(66px + var(--st)); bottom: calc(12px + var(--sb)); display: flex; gap: 14px; }
.g-detail { width: 300px; flex: none; padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 5px; pointer-events: auto; overflow: hidden; }
.g-detail img { width: 100%; height: 118px; object-fit: contain; display: block; background: #f2e8cc; border: 2px solid var(--ink); }
.g-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.g-name b { font-size: 19px; }
.rarity { font-size: 11px; font-weight: 900; color: #fff; padding: 0 8px; border: 2px solid var(--ink); }
.g-bars { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; align-items: center; font-size: 12px; font-weight: 800; line-height: 1.15; }
.g-bars .bar { height: 8px; border: 2px solid var(--ink); background: #fff; }
.g-bars .bar i { display: block; height: 100%; background: var(--ui-blue); }
.g-ability { font-size: 12px; font-weight: 700; line-height: 1.18; padding: 3px 7px; border: 2px dashed rgba(34, 34, 34, .45); }
.g-ability b { display: block; font-size: 13px; color: #a43cff; }
.g-ability.none { opacity: .6; }
.g-info { display: flex; flex-direction: column; gap: 5px; }
.g-info > * { flex: none; }
/* landscape: name across the top, picture left of the stats, buttons across
   the bottom (the stats scroll in the rare case they need more room) */
.land .g-detail { width: 410px; display: grid; grid-template-columns: 128px 1fr; grid-template-rows: auto 1fr auto; grid-template-areas: "name name" "img info" "btns btns"; gap: 6px 10px; }
.land .g-name { grid-area: name; }
.land .g-detail img { grid-area: img; height: 100%; min-height: 0; }
.land .g-info { grid-area: info; min-height: 0; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.land .g-btns { grid-area: btns; }
.g-note:empty { display: none; }
.g-btns { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.g-detail .btn { min-height: 42px; font-size: 20px; }
/* "watch an ad, try it for one run": a slim bar right above the buy button */
.g-detail .btn.ad { min-height: 30px; padding: 2px 10px; font-size: 14px; gap: 6px; background: var(--ui-yellow); box-shadow: 3px 3px 0 var(--ink); }
.g-detail .btn.ad .ico { width: 20px; height: 20px; }
.g-detail .btn.chosen { background: var(--ui-green); }
.g-side { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.g-tabs { flex: none; display: flex; gap: 5px; overflow-x: auto; padding: 2px 4px 4px 2px; pointer-events: auto; touch-action: pan-x; scrollbar-width: none; }
.g-tabs::-webkit-scrollbar { display: none; }
.g-tab { flex: 1 0 auto; min-height: 34px; padding: 2px 7px; font: inherit; font-size: 14px; font-weight: 900; color: var(--ink); background: #fff; border: var(--edge); box-shadow: 3px 3px 0 var(--ink); cursor: pointer; white-space: nowrap; }
.g-tab.on { background: var(--ui-yellow); }
.g-class { font-size: 11px; font-weight: 900; color: var(--ink); background: #fff; padding: 0 8px; border: 2px solid var(--ink); }
.g-card[hidden] { display: none; }
.g-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; align-content: start; overflow-y: auto; padding: 2px 6px 8px 2px; pointer-events: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.g-grid, .lb-list { cursor: grab; }
.g-grid.dragging, .lb-list.dragging { cursor: grabbing; }
.g-card { position: relative; background: #fff; border: var(--edge); box-shadow: 3px 3px 0 var(--ink); padding: 2px 2px 4px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; font-weight: 800; text-align: center; line-height: 1.1; min-height: 98px; }
.g-card img { width: 100%; height: 73px; object-fit: contain; display: block; pointer-events: none; -webkit-user-drag: none; }
.g-card .r { position: absolute; left: 0; top: 0; width: 8px; height: 100%; }
.g-card.sel { background: var(--ui-yellow); }
.g-card.cur::after { content: ""; position: absolute; right: -8px; top: -8px; width: 22px; height: 22px; background: var(--ui-green) url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='white' stroke-width='3.5'/%3E%3C/svg%3E") center / 16px no-repeat; border: 2px solid var(--ink); }
.port .garage { flex-direction: column; }
.port .g-detail { width: auto; }
.port .g-detail img { flex-basis: 130px; }

/* --- two players ------------------------------------------------------------------------------ */
#ov-vs > .title { position: absolute; left: 50%; top: calc(14px + var(--st)); transform: translateX(-50%) rotate(-2deg); }
.vs-cards { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); display: flex; gap: 16px; }
.port .vs-cards { flex-direction: column; transform: translate(-50%, -56%); }
.vscard { width: 280px; padding: 8px 10px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: auto; border-top-width: 9px; }
.vscard.p1 { border-top-color: var(--p1); } .vscard.p2 { border-top-color: var(--p2); }
.carpick { display: flex; align-items: center; gap: 6px; }
.carpick img { width: 150px; height: 103px; object-fit: contain; background: #f2e8cc; border: 2px solid var(--ink); display: block; }
.vscard .name { font-size: 17px; font-weight: 900; }
.vscard .keys { font-size: 12px; opacity: .7; font-weight: 700; }
.vs-note { position: absolute; left: 50%; bottom: calc(96px + var(--sb)); transform: translateX(-50%); font-size: 13px; font-weight: 800; color: #fff; text-shadow: 2px 2px 0 var(--ink); white-space: nowrap; }
#ov-vs > .btn.big { position: absolute; left: 50%; bottom: calc(18px + var(--sb)); transform: translateX(-50%) rotate(-1.5deg); }
/* pressed: the usual 3px push, keeping the centring (.btn:active's translate alone dropped it and the button jumped right) */
#ov-vs > .btn.big:active { transform: translateX(-50%) translate(3px, 3px) !important; }
.port .vs-note { bottom: calc(110px + var(--sb)); }

#vsHud { position: absolute; inset: 0; }
.vs-half { position: absolute; left: 0; right: 0; height: 50%; }
.vs-half.top { top: 0; } .vs-half.bottom { bottom: 0; }
.vs-half .who { position: absolute; left: calc(10px + var(--sl)); top: 10px; display: flex; align-items: center; gap: 6px; }
.vs-half.top .who { top: calc(10px + var(--st)); }
/* the middle strip (stars, score, pause) hangs ~23 px into the lower half: P2's row goes under it */
.vs-half.bottom .who { top: 32px; }
.vbar { width: 96px; height: 10px; background: var(--paper); border: 2px solid var(--ink); overflow: hidden; }
.vspeed { font-size: 14px; font-weight: 900; color: #fff; text-shadow: 2px 2px 0 var(--ink); font-variant-numeric: tabular-nums; }
/* where each player taps: 50 % bigger and as see-through as the one-player pads (user, 2026-10-27) */
.vs-half .tz { position: absolute; bottom: 10px; width: 69px; height: 69px; display: grid; place-items: center; font-size: 45px; font-weight: 900; color: var(--ink); background: var(--paper); border: var(--edge); box-shadow: 3px 3px 0 var(--ink); opacity: .2; transition: opacity .06s, background-color .06s; }
.vs-half.bottom .tz { bottom: calc(10px + var(--sb)); }
.vs-half .tz.left { left: calc(10px + var(--sl)); } .vs-half .tz.right { right: calc(10px + var(--sr)); }
.vs-half.p1 .tz { border-color: var(--p1); } .vs-half.p2 .tz { border-color: var(--p2); }
.vs-half .tz.on { opacity: .5; background: var(--ui-yellow); }
.vs-half.top .tz { bottom: 34px; }   /* clear of the star / score strip across the middle */
#vsHud.side .vs-half.top .tz { bottom: calc(10px + var(--sb)); }
/* each car's busted bar, under its name, health and speed */
.vs-half .arrest { position: absolute; left: calc(10px + var(--sl)); top: calc(38px + var(--st)); }
.vs-half.bottom .arrest { top: 60px; }
#vsHud.side .vs-half .arrest { top: calc(38px + var(--st)); }
#vsHud.side .vs-half.p2 .arrest { left: auto; right: calc(10px + var(--sr)); }
.vs-half .out { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(60, 60, 60, .45); -webkit-backdrop-filter: grayscale(1); backdrop-filter: grayscale(1); }
.vs-half .out span { font-size: 34px; font-weight: 900; color: #fff; background: var(--ui-red); border: var(--edge); box-shadow: var(--drop); padding: 4px 18px; transform: rotate(-6deg); }
.vs-mid { position: absolute; left: 0; right: 0; top: 50%; height: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 calc(10px + var(--sr)) 0 calc(10px + var(--sl)); }
.vs-mid::before { content: ""; position: absolute; left: 0; right: 0; top: -3px; height: 6px; background: var(--ink); }
.vs-mid > * { position: relative; }
.vs-mid .ibtn { width: 42px; height: 42px; }
.vs-stars i { width: 16px; height: 16px; }
.vs-score { display: flex; align-items: center; gap: 8px; padding: 3px 10px; font-weight: 900; font-size: 18px; box-shadow: 3px 3px 0 var(--ink); }
.vs-score.big { font-size: 28px; padding: 4px 14px; }
.vs-half .count { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-4deg); font-size: 96px; font-weight: 900; color: var(--ui-yellow); text-shadow: 6px 6px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink), 0 3px 0 var(--ink); }
/* side by side (CONFIG.vsSplit): P1 left, P2 right, the divider runs down the middle */
#vsHud.side .vs-half { top: 0; bottom: 0; height: auto; width: 50%; }
#vsHud.side .vs-half.p1 { left: 0; right: auto; } #vsHud.side .vs-half.p2 { left: auto; right: 0; }
#vsHud.side .vs-half .who { top: calc(10px + var(--st)); }
#vsHud.side .vs-half.p2 .who { left: auto; right: calc(10px + var(--sr)); flex-direction: row-reverse; }
#vsHud.side .vs-half .tz { bottom: calc(10px + var(--sb)); }
#vsHud.side .vs-half.p1 .tz.right { right: 10px; } #vsHud.side .vs-half.p2 .tz.left { left: 10px; }
#vsHud.side .vs-mid { left: 50%; right: auto; top: 0; bottom: 0; width: 0; height: auto; flex-direction: column; justify-content: flex-start; gap: 8px; padding: calc(10px + var(--st)) 0 0; }
#vsHud.side .vs-mid::before { left: -3px; right: auto; top: 0; bottom: 0; width: 6px; height: auto; }
#vsHud.side .vs-mid > * { white-space: nowrap; }
#vsHud.side .vs-mid .vs-stars { order: 3; } #vsHud.side .vs-mid .vs-score { order: 2; } #vsHud.side .vs-mid .ibtn { order: 1; }
#vrCard .title { color: var(--ink); }
#vrCard.p1 { border-top: 9px solid var(--p1); } #vrCard.p1 .title { color: var(--p1); }
#vrCard.p2 { border-top: 9px solid var(--p2); } #vrCard.p2 .title { color: var(--p2); }

/* reduce motion: no tilts animating, no pulses */
.reduce-motion .hint, .reduce-motion #stars.flash, .reduce-motion .overlay.show { animation: none; }

/* --- dev panel (T or ?dev=1) ------------------------------------------------------------------ */
#devToggle {
  position: fixed; bottom: max(12px, env(safe-area-inset-bottom)); right: max(12px, env(safe-area-inset-right));
  width: 42px; height: 42px; border: var(--edge); box-shadow: 3px 3px 0 var(--ink); background: var(--paper); color: var(--ink); font-size: 20px; cursor: pointer; border-radius: 0; z-index: 30;
}
#dev {
  position: fixed; top: 60px; right: max(12px, env(safe-area-inset-right)); bottom: 12px; width: min(360px, calc(100vw - 24px)); z-index: 30;
  overflow-y: auto; background: rgba(18, 22, 31, .92); color: #e8ecf2; border: 3px solid #222; border-radius: 0; padding: 10px 12px;
  font: 12px system-ui, sans-serif; -webkit-user-select: text; user-select: text; touch-action: pan-y;
}
#dev[hidden] { display: none; }
.devTop { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.devTop strong { font-size: 14px; }
.devHint { opacity: .6; }
#dev section { border-top: 1px solid rgba(255, 255, 255, .1); padding: 8px 0 4px; }
#dev h3 { margin: 0 0 6px; font-size: 12px; letter-spacing: .06em; color: #ffd166; }
.tele { margin: 0; white-space: pre-wrap; font: 11px/1.45 ui-monospace, Menlo, monospace; background: rgba(0, 0, 0, .25); padding: 6px 8px; }
.btnRow { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.btnRow button { background: #2c3446; color: #fff; border: 1px solid #3c4760; border-radius: 0; padding: 5px 8px; font-size: 11px; cursor: pointer; }
.btnRow button:hover { background: #3a4560; }
.palRow button.on, .carRow button.on { background: #ffd166; color: #222; border-color: #ffd166; }
.palSw { display: inline-block; width: 9px; height: 9px; margin-right: 1px; vertical-align: middle; }
.sl { display: grid; grid-template-columns: 118px 1fr 44px; align-items: center; gap: 6px; margin: 2px 0; }
.slName { opacity: .85; }
.slVal { text-align: right; font-variant-numeric: tabular-nums; }
.sl input { width: 100%; }
.g-card .n { min-width: 0; max-width: 100%; padding: 0 2px 0 9px; white-space: normal; overflow-wrap: anywhere; }
@media (hover: hover) { .vs-half .tz { display: none; } }
.g-coins { position: absolute; right: calc(14px + var(--sr)); top: calc(14px + var(--st)); }
.g-card.locked img { opacity: .45; filter: grayscale(.5); }
.g-card .price { display: none; position: absolute; right: 3px; top: 3px; align-items: center; gap: 3px; font-size: 11px; font-weight: 900; background: #fff; border: 2px solid var(--ink); padding: 0 4px; }
.g-card.locked .price { display: inline-flex; }
.g-card .price .ico { width: 12px; height: 12px; stroke-width: 3; }
.g-card .price .coin { width: 12px; height: 12px; }
.g-card.locked.afford .price { color: #1f8a3f; }
.g-note { font-size: 12px; font-weight: 800; color: var(--ui-red); min-height: 15px; text-align: center; }
.g-detail .btn.buy { background: var(--ui-yellow); color: var(--ink); }
.g-detail .btn.poor { background: #d9d3c2; color: rgba(34, 34, 34, .6); }
.g-detail .btn .coin { width: 20px; height: 20px; }
.g-detail .lockimg { opacity: .55; filter: grayscale(.4); }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.g-detail .btn.shake { animation: shake .2s 2; }

/* --- first-run hints -------------------------------------------------------------------------- */
.tut { position: absolute; inset: 0; pointer-events: none; }
.tut-box { position: absolute; left: 50%; top: 64%; transform: translateX(-50%) rotate(-1.5deg); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.port .tut-box { top: 60%; }
.tut-text { padding: 6px 14px; font-weight: 900; font-size: 18px; text-align: center; max-width: 520px; white-space: normal; }
.port .tut-text { max-width: 330px; }
.tut.cops .tut-text { background: var(--ui-yellow); }
.tut-keys { display: flex; gap: 10px; }
.tut-keys kbd { display: grid; place-items: center; min-width: 52px; height: 52px; padding: 0 10px; background: #fff; border: var(--edge); box-shadow: 0 5px 0 var(--ink); font: 900 26px var(--comic); color: var(--ink); animation: keyPress 1.2s ease-in-out infinite; }
.tut-keys kbd:nth-child(2) { animation-delay: .6s; }
.tut.reverse .tut-keys kbd { animation-delay: 0s; }
@keyframes keyPress { 0%, 35%, 100% { transform: translateY(0); box-shadow: 0 5px 0 var(--ink); } 15% { transform: translateY(5px); box-shadow: 0 0 0 var(--ink); } }
.tut-hand { position: absolute; bottom: 16%; width: 86px; height: 86px; }
.tut-hand.left { left: 14%; } .tut-hand.right { right: 14%; }
.port .tut-hand { bottom: 12%; }
.tut-hand svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: #fff; stroke: var(--ink); stroke-width: 3.5; stroke-linejoin: round; filter: drop-shadow(3px 3px 0 var(--ink)); transform-origin: 40% 10%; animation: handTap 1.2s ease-in-out infinite; }
.tut-hand.left svg { transform: scaleX(-1); animation-name: handTapL; }
.tut-hand i { position: absolute; left: 30%; top: -6%; width: 28px; height: 28px; border: 3px solid var(--ui-yellow); opacity: 0; animation: tapRing 1.2s ease-out infinite; }
.tut-hand.left i { left: auto; right: 30%; }
.tut.turn .tut-hand.right svg, .tut.turn .tut-hand.right i { animation-delay: .6s; }
@keyframes handTap { 0%, 40%, 100% { transform: translateY(0); } 15% { transform: translateY(10px) scale(.94); } }
@keyframes handTapL { 0%, 40%, 100% { transform: scaleX(-1) translateY(0); } 15% { transform: scaleX(-1) translateY(10px) scale(.94); } }
@keyframes tapRing { 0%, 12% { opacity: 0; transform: scale(.4); } 18% { opacity: 1; } 45% { opacity: 0; transform: scale(1.8); } 100% { opacity: 0; } }
.reduce-motion .tut-hand svg, .reduce-motion .tut-hand i, .reduce-motion .tut-keys kbd { animation: none; }
.ibtn.small { width: 40px; height: 40px; box-shadow: 3px 3px 0 var(--ink); }
.ibtn.small .ico { width: 20px; height: 20px; }
.tut.off { visibility: hidden; }

/* --- online leaderboard -------------------------------------------------------------------------- */
#ov-leaderboard > .title { position: absolute; left: 50%; top: calc(12px + var(--st)); transform: translateX(-50%) rotate(-2deg); font-size: 34px; }
.lb { position: absolute; left: 50%; transform: translateX(-50%) rotate(-.6deg); top: calc(62px + var(--st)); bottom: calc(12px + var(--sb)); width: 520px; max-width: calc(100% - 28px); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
.lb-tabs { align-self: center; }
.lb-tabs button { font-size: 15px; padding: 4px 14px; }
.lb-resets { text-align: center; font-size: 12px; font-weight: 800; opacity: .65; min-height: 14px; }
.lb-list { flex: 1; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; border: 2px solid var(--ink); background: #fff; }
.lb-row-e, .lb-me { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; padding: 4px 10px; font-weight: 800; font-size: 15px; border-bottom: 1.5px solid rgba(34, 34, 34, .15); }
.lb-row-e .r, .lb-me .r { font-weight: 900; text-align: center; }
.lb-row-e .s, .lb-me .s { font-variant-numeric: tabular-nums; }
.lb-row-e .n, .lb-me .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row-e.g1 .r { background: #ffcf3f; border: 2px solid var(--ink); } .lb-row-e.g2 .r { background: #d6dbe3; border: 2px solid var(--ink); } .lb-row-e.g3 .r { background: #e0a26b; border: 2px solid var(--ink); }
.lb-row-e.me, .lb-me { background: var(--ui-yellow); }
.lb-me { border: 2px solid var(--ink); }
.lb-state { padding: 18px 12px; text-align: center; font-weight: 800; opacity: .7; }
.lb-form label { font-size: 12px; font-weight: 800; opacity: .75; }
.lb-form .lb-row { display: flex; gap: 8px; margin-top: 2px; }
.lb-form input { flex: 1; min-width: 0; font: 800 16px var(--comic); padding: 6px 8px; border: var(--edge); border-radius: 0; background: #fff; color: var(--ink); -webkit-user-select: text; user-select: text; touch-action: auto; }
.lb-form .btn { min-height: 40px; font-size: 16px; padding: 2px 16px; }
.lb-msg { font-size: 12px; font-weight: 800; min-height: 15px; }
.lb-msg.ok { color: #1f8a3f; } .lb-msg.err { color: var(--ui-red); }
.port .lb { width: auto; }
.result .rank { min-height: 14px; letter-spacing: 0; }
.port #ov-leaderboard > .title, .port #ov-garage > .title { font-size: 27px; top: calc(22px + var(--st)); }

/* --- meta loop (designs G1, H1, S1, P1 on meta-designs.html) ------------------------------------- */
.mis-tile { position: relative; }
.badge { position: absolute; right: -10px; top: -10px; min-width: 24px; height: 24px; padding: 0 4px; display: grid; place-items: center; background: var(--ui-red); color: #fff; border: 2px solid var(--ink); font-size: 13px; font-weight: 900; }
.port .dock { flex-wrap: wrap; justify-content: center; width: 360px; }
.port .dock .btn.big { order: -1; flex-basis: 100%; }

/* mission / achievement rows */
.mislist { display: flex; flex-direction: column; width: 100%; }
.mis { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: center; padding: 6px 8px; border-bottom: 2px dashed rgba(34, 34, 34, .28); font-size: 14px; font-weight: 800; text-align: start; }
.mis:last-child { border-bottom: 0; }
.mis .mt small { opacity: .6; font-weight: 700; }
.mis .bar { grid-column: 1; height: 9px; background: #fff; border: 2px solid var(--ink); }
.mis .bar i { display: block; height: 100%; background: var(--ui-green); }
.mis .rw { grid-row: 1 / 3; grid-column: 2; display: flex; align-items: center; gap: 3px; font-weight: 900; }
.mis .rw .coin { width: 16px; height: 16px; }
.mis .claim { grid-row: 1 / 3; grid-column: 2; min-height: 34px; padding: 2px 10px; font-size: 14px; gap: 4px; background: var(--ui-green); }
.mis .claim .coin { width: 16px; height: 16px; }
.mis.done { background: #e3f6d8; }
.mpanel { width: 440px; max-width: calc(100% - 28px); padding: 10px 14px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: rotate(-1deg); pointer-events: auto; }
.dailyrow { pointer-events: auto; display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; background: var(--ui-yellow); border: var(--edge); box-shadow: 3px 3px 0 var(--ink); font: 800 15px var(--comic); color: var(--ink); cursor: pointer; }
.dailyrow .ico { width: 22px; height: 22px; }
#pauseMis { width: 380px; max-width: calc(100% - 28px); padding: 2px 6px; pointer-events: none; }
#pauseMis .mis { font-size: 12px; padding: 4px 6px; }
#pauseMis .bar { height: 7px; }

/* daily gift calendar */
.dpanel { width: 700px; max-width: calc(100% - 20px); padding: 12px 14px 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; transform: rotate(-1deg); pointer-events: auto; }
.days { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }
.day { width: 84px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--paper); border: var(--edge); box-shadow: 3px 3px 0 var(--ink); font-weight: 900; font-size: 13px; }
.day span { display: flex; align-items: center; gap: 3px; font-size: 16px; }
.day small { min-height: 15px; font-size: 11px; }
.day.past { opacity: .55; }
.day.today { background: var(--ui-yellow); transform: scale(1.08); }
.day.last { background: #ffe2d6; }
.day.last.today { background: var(--ui-yellow); }
.dbtns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.dbtns .btn { min-height: 46px; font-size: 18px; }
.dbtns .btn.ad { background: var(--ui-yellow); }
.port .day { width: 76px; }

/* result: WANTED poster */
.poster-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 24px; pointer-events: none; }
.poster { position: relative; width: 300px; max-height: calc(100% - 16px); padding: 6px 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; color: #5a3a1e;
  background: #f1dfb4; border: var(--edge); box-shadow: 6px 6px 0 var(--ink); transform: rotate(-2deg); pointer-events: auto; }
.p-title { font-size: 34px; font-weight: 900; letter-spacing: .06em; line-height: 1; }
.p-photo { flex: none; width: 100%; height: 78px; background: #e6cf9c; border: 3px solid #5a3a1e; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.p-photo img { display: block; flex: none; height: 116px; width: auto; } /* the thumbnail has wide margins: crop to the car */
.p-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 900; }
.p-name .rstars .ico { width: 15px; height: 15px; }
.p-reward { font-size: 13px; font-weight: 900; letter-spacing: .1em; opacity: .8; }
.poster .bignum { font-size: 34px; color: #5a3a1e; }
.poster .coins-line { font-size: 17px; }
.poster .coins-line { color: var(--ink); }
.p-done { font-size: 12px; font-weight: 800; color: #2f6d1f; line-height: 1.25; }
.p-done small { display: block; font-weight: 700; color: #5a3a1e; opacity: .75; }
.p-stamp { position: absolute; left: 50%; top: 58px; transform: translateX(-12%) rotate(-14deg); padding: 1px 10px; font-size: 24px; font-weight: 900; letter-spacing: .04em;
  color: var(--ui-red); border: 4px solid var(--ui-red); background: rgba(255, 255, 255, .18); white-space: nowrap; pointer-events: none; }
.p-stamp.wrecked { color: #e07a00; border-color: #e07a00; }
.poster-wrap .btns { display: flex; flex-direction: column; gap: 10px; width: 220px; pointer-events: auto; }
.poster-wrap .btns .btn { min-height: 48px; font-size: 18px; }
.poster-wrap .btns .try-offer { display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 66px; padding: 4px 8px 4px 4px; background: var(--ui-blue); color: #fff; font-size: 15px; line-height: 1.1; text-align: start; }
.poster-wrap .btns .try-offer.free { background: var(--ui-yellow); color: var(--ink); }
.to-photo { flex: none; width: 78px; height: 54px; background: #fff; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.to-photo img { display: block; flex: none; height: 74px; width: auto; pointer-events: none; }
.to-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.to-text small { font-size: 11px; font-weight: 800; opacity: .9; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.to-text small b { font-weight: 900; text-transform: uppercase; }
.to-cta { display: flex; align-items: center; gap: 4px; font-weight: 900; white-space: normal; text-align: start; }
.to-cta .ico { flex: none; width: 16px; height: 16px; }
.try-offer.free .to-cta .ico { display: none; }
.poster-wrap .btns .btn.wide { min-height: 62px; font-size: 24px; }
.port .poster-wrap { flex-direction: column; gap: 14px; }
.port .poster-wrap .btns { width: 300px; }

/* passport / achievements / stats */
#ov-album > .title { position: absolute; left: 50%; top: calc(12px + var(--st)); transform: translateX(-50%) rotate(-2deg); font-size: 34px; }
.album { position: absolute; left: 50%; transform: translateX(-50%) rotate(-.6deg); top: calc(62px + var(--st)); bottom: calc(12px + var(--sb)); width: 620px; max-width: calc(100% - 28px);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; pointer-events: auto; }
.album-tabs { align-self: center; }
.album-tabs button { font-size: 15px; padding: 4px 14px; }
.album-tabs button.on { background: var(--ui-yellow); }
.album-body { flex: 1; min-height: 0; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.pp-count { font-size: 14px; font-weight: 900; text-align: center; margin-bottom: 6px; }
.stamps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 4px; background: #1f3b5a; border: 2px solid var(--ink); }
.stampbox { height: 64px; display: grid; place-items: center; text-align: center; padding: 2px; border: 3px dashed #6b7f95; color: #6b7f95; font-weight: 900; font-size: 24px; }
.stampbox.on { border: 3px solid var(--c); color: var(--c); font-size: 12px; line-height: 1.1; transform: rotate(var(--r)); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; padding: 4px 6px; }
.stats div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 2px dashed rgba(34, 34, 34, .25); font-size: 14px; font-weight: 800; }
.stats b { font-weight: 900; }
.port .album { width: auto; }
.port .stamps { grid-template-columns: repeat(3, 1fr); }
.port .stats { grid-template-columns: 1fr; }
.poster .rank { min-height: 13px; font-size: 11px; color: #5a3a1e; }

/* arrest meter: fills while the cops have the car boxed in */
#arrest, .vs-half .arrest { display: flex; align-items: center; gap: 6px; padding: 2px 8px; background: var(--ui-red); color: #fff; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); font-weight: 900; font-size: 12px; white-space: nowrap; }
#arrest i, .vs-half .arrest i { display: block; width: 80px; height: 9px; background: #fff; border: 2px solid var(--ink); }
#arrest s, .vs-half .arrest s { display: block; height: 100%; width: 0; background: var(--ink); text-decoration: none; }

/* opening heist banner: "BANK ROBBERY! / Escape the police!" for the first seconds of a run */
#banner { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%) rotate(-4deg); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; text-align: center; }
#banner b { font-size: 44px; font-weight: 900; color: var(--ui-yellow); text-shadow: var(--title-ink); white-space: nowrap; }
#banner span { font-size: 18px; font-weight: 900; color: #fff; background: var(--ui-red); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 2px 12px; }
#banner.show { animation: bannerIn 2.6s ease-out forwards; }
@keyframes bannerIn { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-4deg) scale(1.6); } 12% { opacity: 1; transform: translate(-50%, -50%) rotate(-4deg) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.port #banner b { font-size: 34px; }
.reduce-motion #banner.show { animation: none; }

/* revive offer */
.rpanel { width: 340px; max-width: calc(100% - 28px); padding: 12px 18px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; transform: rotate(-1.5deg); box-shadow: 6px 6px 0 var(--ink); pointer-events: auto; }
.rpanel .title { font-size: 36px; }
.rcount { width: 64px; height: 64px; display: grid; place-items: center; font-size: 36px; font-weight: 900; background: var(--ui-yellow); border: var(--edge); box-shadow: 3px 3px 0 var(--ink); }
.rpanel .btn:not(.wide) { min-height: 40px; font-size: 16px; }

/* platform leaderboards (Yandex): sign in to be on the board */
.lb-signin { align-self: center; min-height: 40px; font-size: 16px; background: var(--ui-yellow); }

/* --- in-app store (js/shop.js; layout M-A, starter offer T-B of iap-designs.html) --- */
#ov-shop > .title { position: absolute; left: 50%; top: calc(12px + var(--st)); transform: translateX(-50%) rotate(-2deg); font-size: 34px; }
.port #ov-shop > .title { font-size: 27px; top: calc(22px + var(--st)); }
.s-coins { position: absolute; right: calc(14px + var(--sr)); top: calc(14px + var(--st)); }
.shop { position: absolute; left: calc(14px + var(--sl)); right: calc(14px + var(--sr)); top: calc(70px + var(--st)); bottom: calc(30px + var(--sb)); display: flex; gap: 12px; }
.port .shop { flex-direction: column; top: calc(74px + var(--st)); }
.s-feat { position: relative; width: 236px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px; text-align: center; background: #fff3c4; pointer-events: auto; }
.s-feat .tx { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.s-feat b { font-size: 20px; line-height: 1.1; } .s-feat small { font-size: 12px; line-height: 1.2; }
.port .s-feat { width: auto; flex-direction: row; text-align: left; padding: 10px; gap: 12px; }
.port .s-feat .tx { align-items: flex-start; flex: 1; min-width: 0; }
.s-grid { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; align-content: start; overflow-y: auto; padding: 8px 6px 8px 2px; pointer-events: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.port .s-grid { grid-template-columns: repeat(2, 1fr); }
.s-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 6px 7px; text-align: center; }
.s-item b { font-size: 13px; line-height: 1.05; margin-top: 2px; }
.s-item small { font-size: 10px; line-height: 1.15; opacity: .8; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.s-item.own { opacity: .7; }
.s-tag { position: absolute; right: -6px; top: -8px; z-index: 2; background: var(--ui-red); color: #fff; font-size: 11px; font-weight: 900; padding: 1px 6px; border: 2px solid var(--ink); transform: rotate(6deg); }
.s-ribbon { background: var(--ui-red); color: #fff; font-weight: 900; font-size: 12px; padding: 1px 8px; border: 2px solid var(--ink); transform: rotate(-3deg); }
.port .s-feat .s-ribbon { position: absolute; left: 6px; top: -10px; }
.btn.sb { min-height: 32px; padding: 2px 12px; font-size: 16px; box-shadow: 3px 3px 0 var(--ink); gap: 5px; pointer-events: auto; }
.btn.sb.big { min-height: 42px; font-size: 21px; padding: 2px 22px; }
.btn.sb.green { background: var(--ui-green); color: #fff; text-shadow: 1px 1px 0 var(--ink); }
.btn.sb.yellow { background: var(--ui-yellow); }
.btn.sb.own { background: #eee; color: #777; box-shadow: none; }
.btn.sb:disabled:not(.own) { opacity: .6; }
.btn .cur, .o-buy .cur { width: 20px; height: 20px; object-fit: contain; }
.s-timer { background: var(--ink); color: var(--ui-yellow); font-weight: 900; font-size: 15px; padding: 1px 10px; font-variant-numeric: tabular-nums; }
.s-restore { position: absolute; left: calc(16px + var(--sl)); bottom: calc(6px + var(--sb)); pointer-events: auto; background: none; border: 0; padding: 2px 0; font: 800 12px var(--comic); color: #fff; text-decoration: underline; text-shadow: 1px 1px 0 var(--ink); cursor: pointer; }
/* product pictures */
.s-ic { position: relative; display: grid; place-items: center; border: 2px solid var(--ink); flex: none; overflow: hidden; }
.s-ic .ico { stroke-width: 2.2; }
.s-ic .slash { position: absolute; left: 8%; right: 8%; top: 50%; height: 12%; background: var(--ui-red); border: 2px solid var(--ink); transform: rotate(-40deg); }
.s-ic .x2 { position: absolute; right: 6%; bottom: 2%; color: var(--ui-red); font-weight: 900; text-shadow: 2px 2px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink), 0 1px 0 var(--ink); }
.s-ic .pile { position: relative; } .s-ic .pile .coin { position: absolute; }
.s-ic .gift { position: absolute; left: 6%; top: 6%; color: #b83b3b; }
.s-ic img.c1 { width: 88%; position: absolute; left: 10%; top: 18%; }
.s-ic .pile.sm { position: absolute; right: 6%; bottom: 8%; }
.s-ic.trio img { position: absolute; width: 62%; }
.s-ic.trio .t0 { left: -4%; top: 6%; } .s-ic.trio .t1 { right: -4%; top: 22%; } .s-ic.trio .t2 { left: 16%; bottom: 0; }
.s-ic.six { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); padding: 4%; }
.s-ic.six img { width: 100%; height: 100%; object-fit: contain; }
/* the starter offer */
.offer { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 22px 10px; width: 470px; text-align: center; pointer-events: auto; }
.port .offer { width: 340px; }
.offer .title.small { transform: rotate(-2deg); }
.o-row { display: flex; align-items: center; gap: 10px; }
.port .o-row { flex-direction: column; gap: 2px; }
.o-car { display: flex; flex-direction: column; align-items: center; }
.o-car img { width: 170px; } .port .o-car img { width: 200px; }
.o-car b { font-size: 18px; } .o-car small { font-size: 11px; opacity: .8; max-width: 210px; }
.land .o-car small { display: none; }
.o-plus { font-size: 34px; font-weight: 900; color: var(--ui-red); text-shadow: 2px 2px 0 var(--ink); }
.o-coins { display: flex; flex-direction: column; align-items: center; } .o-coins .coin { width: 64px; height: 64px; } .o-coins b { font-size: 26px; }
.o-value { background: var(--ui-green); color: #fff; font-weight: 900; font-size: 13px; padding: 2px 10px; border: 2px solid var(--ink); transform: rotate(-2deg); text-shadow: 1px 1px 0 var(--ink); }
.o-buy { min-height: 48px; font-size: 24px; padding: 4px 40px; gap: 6px; }
.o-no { background: none; border: 0; font: 800 13px var(--comic); text-decoration: underline; opacity: .7; cursor: pointer; padding: 2px 6px; color: var(--ink); }
