@font-face { font-family: "Lilita One"; src: url(assets/fonts/lilita-one-latin.woff2) format("woff2"); font-display: swap; }
:root { --f: "Lilita One", Impact, "Arial Black", sans-serif; --gold: #ffc93a; --org: #ff7a1a; --grn: #6fdc6a; --ink: #0b1510; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1510; color: #fff; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; touch-action: none; user-select: none; -webkit-user-select: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
/* screen effects */
#fxLayer > div { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s; }
#stink { background: radial-gradient(ellipse at center, rgba(120,170,40,.15) 0%, rgba(90,130,20,.55) 70%, rgba(60,90,10,.8) 100%); }
#flash { background: #fff; transition: opacity .05s !important; }
#vignette { background: radial-gradient(ellipse at center, transparent 55%, rgba(200,0,0,.55) 100%); }
#tranqLayer { background: radial-gradient(circle at 50% 50%, rgba(140,80,255,0) 30%, rgba(140,80,255,.35) 100%); }
#mudLayer { opacity: 1 !important; }
.splat { position: absolute; border-radius: 50%; background: radial-gradient(circle at 40% 40%, rgba(110,80,45,.95), rgba(70,48,25,.9) 60%, rgba(60,40,20,0) 72%); transition: opacity 1.2s; }
#pops { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.pop { position: absolute; left: 0; top: 0; font-family: var(--f); font-size: 24px; color: #fff; white-space: nowrap; -webkit-text-stroke: 2px #1a0d00; paint-order: stroke fill; text-shadow: 0 4px 0 rgba(0,0,0,.45); will-change: transform; }
.pop.good { color: var(--gold); font-size: 30px; }
.pop.big { color: #ff5a2a; font-size: 38px; }
.pop.bad { color: #ff4a4a; }
.pop.cam { color: #ff3a3a; font-size: 27px; }
.pop.info { color: #bfefff; font-size: 19px; }
.pop.coin { color: var(--gold); font-size: 17px; }
.pop.talk { font-family: system-ui, sans-serif; font-weight: 800; font-size: 15px; -webkit-text-stroke: 0; color: #111; background: #fff; padding: 5px 9px; border-radius: 12px; text-shadow: none; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; font-family: var(--f); }
#hudTL { position: absolute; left: max(12px, env(safe-area-inset-left)); top: max(10px, env(safe-area-inset-top)); }
#scoreBox small { display: block; font-size: 13px; letter-spacing: 2px; opacity: .8; }
#scoreBox b { font-size: 46px; line-height: .95; text-shadow: 0 3px 0 #000, 0 0 18px rgba(0,0,0,.4); -webkit-text-stroke: 1.5px #120a02; paint-order: stroke fill; }
#comboBox { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
#comboBox b { font-size: 30px; color: var(--gold); -webkit-text-stroke: 1.5px #3a1a00; paint-order: stroke fill; transition: transform .1s; }
#comboBox b.pulse { transform: scale(1.35); }
.bar { width: 110px; height: 10px; background: rgba(0,0,0,.5); border-radius: 6px; overflow: hidden; border: 2px solid rgba(255,255,255,.25); }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb020, #ff5a1a); border-radius: 4px; transition: width .1s; }
#zoneTag { margin-top: 6px; font-size: 15px; color: #d6f7c8; text-shadow: 0 2px 0 #000; }
#hudTR { position: absolute; right: max(12px, env(safe-area-inset-right)); top: max(10px, env(safe-area-inset-top)); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: auto; }
.pill { display: flex; align-items: center; gap: 6px; background: rgba(8,16,10,.6); border: 2px solid rgba(255,255,255,.18); padding: 3px 10px 3px 6px; border-radius: 20px; font-size: 18px; backdrop-filter: blur(3px); }
.pill img { width: 22px; height: 22px; border-radius: 50%; }
#wanted { font-size: 22px; letter-spacing: 1px; color: rgba(255,255,255,.25); text-shadow: 0 2px 0 #000; }
#wanted .on { color: #ffdd33; text-shadow: 0 0 10px #ff4400, 0 2px 0 #000; }
#wanted.flash .on { animation: wf .5s infinite alternate; }
@keyframes wf { to { color: #ff3a3a; } }
.iconBtn { width: 42px; height: 42px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); background: rgba(8,16,10,.6); color: #fff; font-size: 16px; font-weight: 900; cursor: pointer; }
#hudBL { position: absolute; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); }
#speedo { display: flex; align-items: baseline; gap: 6px; }
#speedo b { font-size: 52px; line-height: 1; text-shadow: 0 3px 0 #000; -webkit-text-stroke: 1.5px #120a02; paint-order: stroke fill; }
#speedo small { font-size: 16px; opacity: .8; }
.gauge { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 16px; }
.gauge .bar { width: 140px; height: 12px; }
#fuelBar { background: linear-gradient(90deg, #ff3a2a, #ffb020 30%, #6fdc6a 60%); background-size: 140px 100%; }
.hp #hpBar { background: linear-gradient(90deg, #4ab0ff, #8ae0ff); }
#status { position: absolute; left: 50%; top: max(70px, calc(env(safe-area-inset-top) + 60px)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; }
.st { font-size: 17px; padding: 4px 12px; border-radius: 14px; background: rgba(0,0,0,.6); border: 2px solid; white-space: nowrap; }
.st.warn { border-color: #ffb020; color: #ffd27a; animation: blink .6s infinite alternate; }
.st.cam { border-color: #ff3a3a; color: #ff8a8a; animation: blink .35s infinite alternate; }
.st.good { border-color: #3ad0ff; color: #aef0ff; }
.st.stink { border-color: #9ad02a; color: #d8ff8a; }
@keyframes blink { to { opacity: .55; } }
#banner { position: absolute; left: 50%; top: 30%; transform: translate(-50%,-50%); font-size: 44px; text-align: center; color: #fff; -webkit-text-stroke: 2px #1a0d00; paint-order: stroke fill; text-shadow: 0 5px 0 rgba(0,0,0,.4); opacity: 0; transition: opacity .3s, transform .3s; white-space: nowrap; }
#banner small { display: block; font-size: 20px; color: var(--gold); }
#banner.show { opacity: 1; transform: translate(-50%,-50%) scale(1.05); }
#inv { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; gap: 10px; font-size: 22px; text-shadow: 0 2px 0 #000; }
body.touch #inv { bottom: 236px; }
/* touch */
#touch { position: fixed; inset: auto 0 0 0; height: 230px; pointer-events: none; }
#touch .tl { position: absolute; left: max(10px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; gap: 12px; pointer-events: auto; }
#touch .tr { position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 74px 74px; gap: 10px; pointer-events: auto; }
.tbtn { border: 3px solid rgba(255,255,255,.35); background: rgba(10,20,12,.45); color: #fff; border-radius: 20px; font-family: var(--f); font-size: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; backdrop-filter: blur(2px); touch-action: none; }
.tbtn small { font-size: 11px; letter-spacing: 1px; }
.tbtn.steer { width: 92px; height: 92px; font-size: 40px; }
.tbtn.act { width: 74px; height: 66px; }
.tbtn.small { width: 74px; height: 66px; font-size: 15px; }
.tbtn.on { background: rgba(255,180,40,.45); border-color: #ffd27a; transform: scale(.95); }
.tbtn.fart { border-color: rgba(150,230,60,.6); } .tbtn.boost { border-color: rgba(255,140,60,.6); }
.tbtn.dis { opacity: .4; }
body.touch #hudBL { bottom: 120px; }
/* screens */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(0,0,0,.05), rgba(0,0,0,.55)); z-index: 5; overflow-y: auto; }
#menu { justify-content: flex-start; padding-left: max(4vw, 16px); background: linear-gradient(90deg, rgba(6,14,8,.82) 0%, rgba(6,14,8,.4) 45%, rgba(0,0,0,0) 70%); }
.panel { background: rgba(10,22,14,.88); border: 3px solid rgba(255,201,58,.45); border-radius: 22px; padding: 20px 22px; max-width: 460px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.5); text-align: center; margin: auto 0; }
.panel.title { background: rgba(10,22,14,.72); max-width: 470px; }
.panel.wide { max-width: 760px; }
.logoRow { display: flex; align-items: center; gap: 14px; justify-content: center; }
.avatar { width: 92px; height: 92px; border-radius: 50%; border: 3px solid var(--gold); box-shadow: 0 0 24px rgba(255,201,58,.4); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
h1 { font-family: var(--f); font-size: 54px; line-height: .9; margin: 0; text-align: left; color: #fff; -webkit-text-stroke: 2px #1a0d00; paint-order: stroke fill; text-shadow: 0 5px 0 #000; letter-spacing: 1px; }
h1 span { color: var(--gold); font-size: 50px; }
h2 { font-family: var(--f); font-size: 32px; margin: 0 0 10px; color: var(--gold); text-shadow: 0 3px 0 #000; }
h2 small { font-size: 16px; color: #ccc; }
.tag { color: #d8e8d0; font-size: 15px; margin: 10px 0 14px; }
button { font-family: var(--f); font-size: 18px; color: #fff; background: #2a4a30; border: 2px solid rgba(255,255,255,.2); border-radius: 14px; padding: 10px 14px; cursor: pointer; transition: transform .08s, background .15s; }
button:hover { background: #35603c; } button:active { transform: scale(.96); }
button.big { width: 100%; font-size: 32px; padding: 12px; background: linear-gradient(180deg, #ffb020, #ff6a10); border-color: #ffe08a; color: #2a1200; text-shadow: 0 2px 0 rgba(255,255,255,.4); box-shadow: 0 6px 0 #8a3a00, 0 10px 24px rgba(255,120,0,.35); margin-bottom: 12px; }
button.big:active { box-shadow: 0 2px 0 #8a3a00; transform: translateY(4px); }
.row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.row button { flex: 1 1 40%; }
.howto { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px; font-size: 13px; color: #cfe3c9; text-align: left; }
.howto div { background: rgba(255,255,255,.06); border-radius: 10px; padding: 6px 8px; }
.keys { font-size: 12px; color: #9fb79a; margin: 10px 0 0; }
.fine { font-size: 11px; color: #7d9478; margin: 8px 0 0; }
.back { margin-top: 12px; width: 100%; }
label { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 4px; font-size: 17px; border-bottom: 1px solid rgba(255,255,255,.08); }
select { font-size: 16px; padding: 6px; border-radius: 8px; }
input[type=checkbox] { width: 22px; height: 22px; }
.coinTag { font-size: 20px; color: #fff; display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; }
.coinTag img { width: 24px; height: 24px; border-radius: 50%; }
#gList, #achList { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; max-height: 58vh; overflow-y: auto; text-align: left; }
.item { background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.1); border-radius: 12px; padding: 8px 10px; }
.item b { font-family: var(--f); font-size: 17px; display: block; }
.item p { margin: 3px 0 6px; font-size: 12px; color: #b9cdb4; }
.item button { font-size: 14px; padding: 6px 10px; width: 100%; }
.item.owned { border-color: rgba(111,220,106,.5); }
.item.locked { opacity: .45; }
.item.got { border-color: rgba(255,201,58,.6); background: rgba(255,201,58,.08); }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: middle; margin-right: 6px; border: 1px solid #fff4; }
#scoreList { text-align: left; font-size: 17px; padding-left: 28px; } #scoreList li { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.07); } #scoreList span { float: right; color: var(--gold); font-family: var(--f); }
.final b { font-family: var(--f); font-size: 64px; display: block; color: var(--gold); text-shadow: 0 4px 0 #000; line-height: 1; } .final small { letter-spacing: 3px; color: #ccc; } .final span { display: block; font-size: 14px; color: #bde; margin-top: 4px; }
#oStats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 14px; margin: 12px 0; text-align: left; color: #d5e6d0; }
#oStats b { float: right; color: #fff; }
#nameRow { display: flex; gap: 8px; margin-bottom: 12px; } #nameRow input { flex: 1; font-size: 17px; padding: 8px 10px; border-radius: 10px; border: 2px solid #3a5a3a; background: #0d1a10; color: #fff; }
#toast { position: fixed; left: 50%; top: 14%; transform: translateX(-50%) translateY(20px); background: rgba(20,14,4,.92); border: 2px solid var(--gold); color: #fff; padding: 10px 16px; border-radius: 14px; font-family: var(--f); font-size: 18px; opacity: 0; transition: all .3s; pointer-events: none; z-index: 10; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast small { display: block; font-family: system-ui; font-size: 12px; color: #d8cfa8; }
#fps { position: fixed; left: 50%; bottom: 4px; transform: translateX(-50%); font: 12px monospace; background: rgba(0,0,0,.5); padding: 2px 6px; border-radius: 4px; z-index: 9; }
#loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #0b1510; z-index: 20; font-family: var(--f); font-size: 20px; color: var(--gold); }
.spin { width: 54px; height: 54px; border-radius: 50%; border: 6px solid rgba(255,201,58,.25); border-top-color: var(--gold); animation: sp 1s linear infinite; } @keyframes sp { to { transform: rotate(360deg); } }
#err { position: fixed; inset: 0; z-index: 30; background: #0b1510; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; font-size: 17px; }
@media (max-width: 700px), (max-height: 500px) {
  h1 { font-size: 40px; } h1 span { font-size: 38px; } .avatar { width: 70px; height: 70px; }
  #menu { justify-content: center; padding-left: 16px; background: linear-gradient(180deg, rgba(6,14,8,.2), rgba(6,14,8,.75)); }
  #scoreBox b { font-size: 36px; } #speedo b { font-size: 40px; } #banner { font-size: 32px; }
  .gauge .bar { width: 100px; }
}
@media (max-height: 500px) { .panel { padding: 12px 14px; } .howto, .keys { display: none; } button.big { font-size: 24px; padding: 8px; } #touch { height: 180px; } .tbtn.steer { width: 80px; height: 80px; } body.touch #hudBL { bottom: 104px; } #status { top: 52px; } }
@media (orientation: portrait) and (max-width: 700px) {
  #menu { align-items: flex-end; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  #menu .panel { margin: 0; }
  #status { top: max(118px, calc(env(safe-area-inset-top) + 108px)); }
  .pop { font-size: 18px; } .pop.good { font-size: 21px; } .pop.big { font-size: 27px; } .pop.cam { font-size: 18px; } .pop.info { font-size: 14px; } .pop.talk { font-size: 12px; }
  #banner { font-size: 28px; top: 26%; } #banner small { font-size: 15px; }
}
#garage { justify-content: flex-start; padding-left: max(4vw, 16px); background: linear-gradient(90deg, rgba(6,14,8,.75) 0%, rgba(6,14,8,.3) 45%, rgba(0,0,0,0) 65%); }
#garage .panel { max-width: 480px; }
#garage #gList { grid-template-columns: 1fr 1fr; }
@media (orientation: portrait) and (max-width: 700px) {
  #garage { align-items: flex-end; justify-content: center; padding-left: 16px; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(6,14,8,.7)); }
  #garage #gList { max-height: 36vh; }
  #menu .keys { display: none; }
}

/* ---- global leaderboard ---- */
.lbTabs { display: flex; gap: 6px; margin: 4px 0 10px; } .lbTabs button { flex: 1; font-size: 14px; padding: 7px 4px; border-radius: 10px; background: #1c3020; }
.lbTabs button.on { background: linear-gradient(180deg, #ffb020, #ff6a10); color: #2a1200; border-color: #ffe08a; }
#scoreList { max-height: 46vh; overflow-y: auto; margin: 0; }
#scoreList li.me { background: rgba(255,201,58,.16); border-radius: 6px; } #scoreList li.dim { list-style: none; color: #9ab49a; text-align: center; margin-left: -28px; }
#scoreList small { color: #8fa88a; font-size: 12px; margin-left: 6px; }
.lbMe { font-size: 14px; color: #ffe08a; min-height: 18px; margin: 8px 0 4px; }
.lbMore { font-size: 14px; padding: 6px 12px; margin: 2px 0 6px; }
.lbMsg { font-size: 14px; min-height: 18px; margin: -4px 0 10px; color: #d5e6d0; } .lbMsg.ok { color: var(--grn); } .lbMsg.err { color: #ff9a7a; }
.lbOpen { width: 100%; margin-bottom: 10px; font-size: 16px; padding: 8px; }
#nameRow input { min-width: 0; } #nameRow button { flex: 0 0 auto; white-space: nowrap; font-size: 16px; padding: 8px 12px; }

/* contest banner + private prize wallet field */
.contest { font-size: 13px; line-height: 1.35; margin: 2px 0 10px; padding: 7px 10px; border-radius: 12px; background: linear-gradient(180deg, rgba(255,176,32,.18), rgba(255,106,16,.12)); border: 1px solid rgba(255,201,58,.55); color: #ffe7a8; }
.contest b { color: #ffd34d; }
#walletRow { display: flex; margin: -4px 0 2px; } #walletRow input { flex: 1; min-width: 0; font-size: 15px; padding: 7px 10px; border-radius: 10px; border: 2px solid #3a5a3a; background: #0d1a10; color: #fff; font-family: ui-monospace, Menlo, Consolas, monospace; }
#walletRow input.bad { border-color: #ff7a5a; }
.walletNote { margin: 0 0 10px; }
@media (max-height: 500px) { .contest { font-size: 11px; padding: 4px 8px; margin-bottom: 6px; } #menu .tag { display: none; } }
/* short landscape phones: smaller score popups so they stay off the road */
@media (max-height: 500px) { .pop { font-size: 18px; } .pop.good { font-size: 21px; } .pop.big { font-size: 26px; } .pop.cam { font-size: 18px; } .pop.info { font-size: 14px; } .pop.talk { font-size: 11px; } }
