@font-face { font-family: Lilita; src: url(fonts/lilita.woff2) format('woff2'); font-display: block; }
@font-face { font-family: Nunito; src: url(fonts/nunito.woff2) format('woff2'); font-weight: 200 1000; font-display: swap; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #141826; overscroll-behavior: none; touch-action: none; position: fixed; inset: 0; }
body { font-family: Nunito, system-ui, sans-serif; color: #fff; }
#game { position: fixed; inset: 0; display: block; image-rendering: pixelated; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; pointer-events: none; }
.screen > * { pointer-events: auto; }
.pill { background: linear-gradient(#2c3350, #1d2238); border: 2.5px solid #0b0e18; border-radius: 14px; box-shadow: inset 0 2px 0 rgba(255,255,255,.12), 0 3px 0 #06080f, 0 6px 14px rgba(0,0,0,.35); color: #fff; }
.round { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(#2c3350, #1d2238); border: 2.5px solid #0b0e18; box-shadow: 0 3px 0 #06080f; display: grid; place-items: center; flex: none; }
.round svg { width: 22px; height: 22px; color: #fff; }
#muteBtn .x { display: none; } #muteBtn.off .x { display: inline; } #muteBtn.off .w { display: none; }
.coin { width: 26px; height: 26px; border-radius: 50%; display: inline-block; flex: none; background: radial-gradient(circle at 35% 32%, #fff6c0 0 14%, #ffd84a 15% 55%, #e0a010 56% 100%); box-shadow: inset 0 -2px 0 #a8700a, 0 0 0 2px #6a4410; position: relative; }
.coin::after { content: '$'; position: absolute; inset: 0; display: grid; place-items: center; font: 15px Lilita; color: #a8700a; }
.topbar { position: absolute; top: calc(env(safe-area-inset-top) + 8px); left: 10px; right: 10px; display: flex; gap: 8px; align-items: center; }
.cash { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 7px; min-width: 120px; transition: transform .1s; }
.cash.bump { transform: scale(1.1); }
.cash b { font: 22px/1 Lilita; letter-spacing: .5px; color: #ffe066; text-shadow: 0 2px 0 #000; }
.sponsor { flex: 1; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; padding: 5px 10px; text-align: left; align-items: center; }
.sponsor .spT { grid-row: 1 / 3; font: 11px Lilita; letter-spacing: 1px; background: #ffd23a; color: #3a2a00; border-radius: 6px; padding: 3px 5px; }
.sponsor b { font: 17px/1 Lilita; color: #8dff7a; text-shadow: 0 2px 0 #000; }
.sponsor small { font-size: 11px; font-weight: 800; opacity: .75; }
.sponsor.ready { animation: glow 1.2s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 3px rgba(141,255,122,.55), 0 3px 0 #06080f; } }
.logo { position: absolute; top: calc(env(safe-area-inset-top) + 62px); left: 0; right: 0; text-align: center; font: 40px/1 Lilita; letter-spacing: 2px; color: #ffd23a; text-shadow: 0 3px 0 #b8560e, 0 6px 0 #0b0e18, 0 10px 18px rgba(0,0,0,.5); transform: rotate(-3deg); pointer-events: none; }
.logo span { display: block; font-size: 30px; color: #fff; text-shadow: 0 3px 0 #e3412b, 0 6px 0 #0b0e18; margin-top: 2px; letter-spacing: 6px; }
.carCard { position: absolute; top: calc(env(safe-area-inset-top) + 152px); left: 50%; transform: translateX(-50%); width: min(92vw, 360px); height: 178px; border-radius: 20px; border: 3px solid #0b0e18; background: repeating-linear-gradient(90deg, #3a3f52 0 38px, #343949 38px 40px), #3a3f52; box-shadow: inset 0 -40px 0 rgba(0,0,0,.18), inset 0 3px 0 rgba(255,255,255,.1), 0 5px 0 #06080f, 0 10px 24px rgba(0,0,0,.45); overflow: hidden; }
.carCard::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 26px; background: repeating-linear-gradient(-45deg, #ffd23a 0 12px, #1b1b22 12px 24px); opacity: .9; }
.carCard canvas { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); width: 280px; height: 150px; image-rendering: pixelated; }
.carInfo { position: absolute; left: 10px; right: 10px; bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.carInfo > b { font: 20px Lilita; letter-spacing: .5px; text-shadow: 0 2px 0 #000; }
.pwr { font: 13px Lilita; letter-spacing: 1px; background: #0b0e18; border-radius: 10px; padding: 4px 9px; color: #9fb4ff; }
.pwr b { color: #fff; font-size: 17px; }
.trackCard { position: absolute; top: calc(env(safe-area-inset-top) + 342px); left: 50%; transform: translateX(-50%); width: min(92vw, 360px); display: flex; align-items: stretch; gap: 6px; padding: 8px 6px; }
.trackCard { background: linear-gradient(#2c3350, #1d2238); border: 3px solid #0b0e18; border-radius: 18px; box-shadow: inset 0 2px 0 rgba(255,255,255,.12), 0 4px 0 #06080f, 0 8px 18px rgba(0,0,0,.4); }
.arrow { width: 34px; flex: none; border-radius: 12px; background: #0f1322; font-size: 16px; color: #ffd23a; }
.arrow:disabled { opacity: .25; }
.trMid { flex: 1; min-width: 0; text-align: center; }
.trName span { font: 22px Lilita; letter-spacing: .5px; text-shadow: 0 2px 0 #000; }
.trName small { display: block; font: 11px Lilita; letter-spacing: 2px; color: #9fb4ff; margin-top: -2px; }
.prizes { display: flex; justify-content: center; gap: 5px; margin: 6px 0 5px; }
.prz { border-radius: 9px; padding: 3px 7px; font: 14px Lilita; color: #241800; border: 2px solid #0b0e18; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.prz small { font: 10px Lilita; display: block; opacity: .75; line-height: 1; }
.p1 { background: linear-gradient(#ffe680, #f2b51c); } .p2 { background: linear-gradient(#f2f4fa, #b9c0d2); } .p3 { background: linear-gradient(#f2b27a, #c4733a); }
.p4 { background: #39405a; color: #8a93b0; }
.trMeta { font-size: 12.5px; font-weight: 800; color: #c8d2f0; }
.trMeta b { color: #fff; } .trMeta .lock { color: #ffb36b; }
.row { position: absolute; left: 50%; transform: translateX(-50%); width: min(92vw, 360px); display: flex; gap: 10px; bottom: calc(env(safe-area-inset-bottom) + 100px); }
.btn { position: relative; border: 3px solid #0b0e18; border-radius: 18px; color: #fff; font: 19px Lilita; letter-spacing: .5px; text-shadow: 0 2px 0 rgba(0,0,0,.45); box-shadow: inset 0 3px 0 rgba(255,255,255,.35), inset 0 -4px 0 rgba(0,0,0,.2), 0 5px 0 #06080f, 0 9px 18px rgba(0,0,0,.35); transition: transform .06s; }
.btn:active { transform: translateY(4px); box-shadow: inset 0 3px 0 rgba(255,255,255,.35), 0 1px 0 #06080f; }
.row .btn { flex: 1; height: 54px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.row .btn svg { width: 26px; height: 26px; }
.blue { background: linear-gradient(#5aa0ff, #2f6fe0); } .purple { background: linear-gradient(#b07aff, #7a44e0); }
.green { background: linear-gradient(#7af06a, #2fbf4a); } .red { background: linear-gradient(#ff7a5a, #e3412b); } .gray { background: linear-gradient(#5a6178, #3c4258); }
.race { position: absolute; left: 50%; transform: translateX(-50%); width: min(92vw, 360px); height: 76px; bottom: calc(env(safe-area-inset-bottom) + 12px); font-size: 36px; letter-spacing: 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; animation: breathe 1.6s ease-in-out infinite; }
.race:active { transform: translateX(-50%) translateY(4px); }
.race small { font: 12px Nunito; font-weight: 900; letter-spacing: .5px; opacity: .9; margin-top: 3px; }
.race:disabled { filter: grayscale(.8) brightness(.7); animation: none; }
@keyframes breathe { 50% { box-shadow: inset 0 3px 0 rgba(255,255,255,.35), inset 0 -4px 0 rgba(0,0,0,.2), 0 5px 0 #06080f, 0 0 0 5px rgba(122,240,106,.35), 0 9px 18px rgba(0,0,0,.35); } }
.dot { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: #ff3b30; border: 2.5px solid #fff; display: none; animation: pulse 1s infinite; }
.dot.on { display: block; }
@keyframes pulse { 50% { transform: scale(1.2); } }
/* race hud */
.hudTop { position: absolute; top: calc(env(safe-area-inset-top) + 8px); left: 10px; right: 10px; display: flex; align-items: center; justify-content: space-between; }
.lap { padding: 7px 12px; font: 15px Lilita; letter-spacing: 1px; } .lap b { font-size: 20px; color: #ffd23a; }
.posBig { font: 44px/1 Lilita; color: #fff; text-shadow: 0 3px 0 #e3412b, 0 6px 0 #0b0e18; letter-spacing: 1px; transition: transform .15s; }
.posBig.pop { transform: scale(1.25); }
.posBig.top3 { color: #ffe066; text-shadow: 0 3px 0 #b8560e, 0 6px 0 #0b0e18; }
.spd { padding: 8px 12px; font: 16px Lilita; letter-spacing: 1px; }
.spd.on { background: linear-gradient(#ffd23a, #f29a1c); color: #2a1a00; }
.standings { position: absolute; top: calc(env(safe-area-inset-top) + 62px); left: 8px; right: 8px; display: flex; gap: 4px; }
.st { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; padding: 4px 5px; border-radius: 10px; background: rgba(11,14,24,.82); border: 2px solid #0b0e18; font: 12.5px Lilita; letter-spacing: .3px; transition: transform .2s; }
.st i { width: 10px; height: 10px; border-radius: 3px; flex: none; border: 1.5px solid rgba(0,0,0,.6); }
.st span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st em { font-style: normal; color: #9fb4ff; }
.st.me { background: linear-gradient(#ffe066, #f2b51c); color: #241800; } .st.me em { color: #6a4a00; }
.st.pz { box-shadow: inset 0 -2px 0 #ffd23a; }
.gapPill { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 18px); background: rgba(11,14,24,.85); border: 2px solid #0b0e18; border-radius: 14px; padding: 7px 14px; font: 15px Lilita; letter-spacing: .5px; white-space: nowrap; }
.gapPill:empty { display: none; } .gapPill b { color: #ffd23a; }
.lights { position: absolute; top: 36%; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; background: #0b0e18; border-radius: 22px; padding: 10px 14px; border: 3px solid #000; box-shadow: 0 8px 20px rgba(0,0,0,.5); }
.lights i { width: 36px; height: 36px; border-radius: 50%; background: #2a1414; border: 3px solid #000; }
.lights i.r { background: radial-gradient(circle at 35% 35%, #ffb0a0, #ff2a1a 60%); box-shadow: 0 0 16px #ff2a1a; }
.lights.go i { background: radial-gradient(circle at 35% 35%, #d0ffc0, #2fdf3a 60%); box-shadow: 0 0 16px #2fdf3a; }
.lights b { position: absolute; top: 100%; left: 0; right: 0; text-align: center; font: 46px Lilita; color: #fff; text-shadow: 0 4px 0 #0b0e18; margin-top: 8px; }
.banner { position: absolute; top: 40%; left: 0; right: 0; text-align: center; font: 50px/1 Lilita; color: #fff; text-shadow: 0 4px 0 #e3412b, 0 8px 0 #0b0e18; animation: slam .45s cubic-bezier(.2,1.6,.4,1); pointer-events: none; }
.banner.gold { color: #ffe066; text-shadow: 0 4px 0 #b8560e, 0 8px 0 #0b0e18; }
.banner small { display: block; font-size: 20px; margin-top: 8px; color: #fff; text-shadow: 0 3px 0 #0b0e18; }
@keyframes slam { from { transform: scale(2.4); opacity: 0; } }
/* sheet / modal */
#sheetWrap, #modalWrap { position: fixed; inset: 0; z-index: 10; }
.scrim { position: absolute; inset: 0; background: rgba(5,8,16,.55); }
#sheet { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(#262c45, #1a1e33); border-top: 3px solid #0b0e18; border-radius: 24px 24px 0 0; padding: 10px 14px calc(env(safe-area-inset-bottom) + 18px); box-shadow: 0 -8px 30px rgba(0,0,0,.5); animation: up .22s cubic-bezier(.2,1.2,.4,1); max-height: 82vh; overflow-y: auto; touch-action: pan-y; }
@keyframes up { from { transform: translateY(100%); } }
.grab { width: 44px; height: 5px; border-radius: 3px; background: #4a5272; margin: 0 auto 6px; }
.close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border-radius: 50%; background: #0f1322; border: 2px solid #000; font: 16px Lilita; color: #fff; }
h2 { font: 26px Lilita; margin: 4px 0 2px; letter-spacing: .5px; text-shadow: 0 2px 0 #000; }
.sub { font-weight: 800; font-size: 13.5px; color: #9fb4ff; margin-bottom: 8px; }
.part { display: flex; align-items: center; gap: 10px; background: #0f1322; border: 2px solid #000; border-radius: 16px; padding: 9px 10px; margin-top: 8px; }
.part canvas { width: 46px; height: 46px; border-radius: 12px; background: #262c45; flex: none; image-rendering: pixelated; }
.part .info { flex: 1; min-width: 0; }
.part .info b { font: 18px Lilita; letter-spacing: .3px; } .part .info small { display: block; font-size: 12px; font-weight: 800; color: #9fb4ff; }
.pips { display: flex; gap: 2px; margin-top: 4px; } .pips i { flex: 1; height: 6px; border-radius: 2px; background: #2c3350; max-width: 16px; } .pips i.on { background: #7af06a; }
.buy { min-width: 86px; height: 46px; border-radius: 14px; font: 17px Lilita; padding: 0 10px; }
.buy:disabled { filter: grayscale(.9) brightness(.6); }
.carRow { display: flex; align-items: center; gap: 10px; background: #0f1322; border: 2px solid #000; border-radius: 16px; padding: 8px 10px; margin-top: 8px; }
.carRow canvas { width: 96px; height: 60px; flex: none; image-rendering: pixelated; background: #262c45; border-radius: 10px; }
.carRow .info { flex: 1; min-width: 0; } .carRow .info b { font: 18px Lilita; } .carRow .info small { display: block; font-size: 12px; font-weight: 800; color: #9fb4ff; }
.carRow.locked canvas { filter: brightness(0) invert(.32); }
#modal { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 370px); background: linear-gradient(#262c45, #1a1e33); border: 3px solid #0b0e18; border-radius: 24px; padding: 14px 14px 16px; box-shadow: 0 10px 0 #06080f, 0 20px 40px rgba(0,0,0,.6); animation: pop .3s cubic-bezier(.2,1.5,.4,1); text-align: center; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.7); opacity: 0; } }
.resPos { font: 64px/1 Lilita; letter-spacing: 1px; margin-top: 2px; color: #fff; text-shadow: 0 4px 0 #e3412b, 0 8px 0 #0b0e18; }
.resPos.gold { color: #ffe066; text-shadow: 0 4px 0 #b8560e, 0 8px 0 #0b0e18; }
.resTag { font: 18px Lilita; letter-spacing: 2px; color: #9fb4ff; margin: 6px 0 10px; }
.pool { display: flex; align-items: center; justify-content: center; gap: 6px; font: 14px Lilita; letter-spacing: 1px; color: #ffd23a; margin-bottom: 6px; }
.res { width: 100%; border-collapse: separate; border-spacing: 0 4px; font: 15px Lilita; }
.res td { background: #0f1322; padding: 6px 8px; } .res td:first-child { border-radius: 10px 0 0 10px; width: 32px; } .res td:last-child { border-radius: 0 10px 10px 0; text-align: right; }
.res tr.me td { background: linear-gradient(#ffe066, #f2b51c); color: #241800; }
.res .nm { text-align: left; } .res .nm i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; border: 1.5px solid rgba(0,0,0,.6); vertical-align: -1px; }
.res .gap { color: #8a93b0; font-size: 12px; text-align: right; } .res tr.me .gap { color: #6a4a00; }
.res .mo { color: #8dff7a; } .res .mo.z { color: #4a5272; } .res tr.me .mo { color: #1f6a10; }
.won { font: 26px Lilita; margin: 10px 0 2px; color: #8dff7a; text-shadow: 0 3px 0 #0b0e18; display: flex; align-items: center; justify-content: center; gap: 8px; }
.won.z { color: #c8d2f0; font-size: 18px; }
.hint { font-size: 13.5px; font-weight: 800; color: #c8d2f0; margin: 4px 0 12px; } .hint b { color: #ffd23a; }
.unlock { background: linear-gradient(#ffe066, #f2b51c); color: #241800; border-radius: 14px; padding: 8px; font: 18px Lilita; margin: 4px 0 10px; border: 2px solid #0b0e18; animation: pulse 1s 3; }
.mBtns { display: flex; gap: 10px; } .mBtns .btn { flex: 1; height: 56px; font-size: 20px; }
#toasts { position: fixed; top: 47%; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 20; }
.toast { background: linear-gradient(#2c3350, #1d2238); border: 2px solid #0b0e18; border-radius: 14px; padding: 8px 14px; font: 15px Lilita; letter-spacing: .3px; box-shadow: 0 4px 12px rgba(0,0,0,.4); animation: tin .3s cubic-bezier(.2,1.6,.4,1), tout .4s 2.4s forwards; }
@keyframes tin { from { transform: translateY(-14px) scale(.9); opacity: 0; } }
@keyframes tout { to { opacity: 0; transform: translateY(-8px); } }
.fly { position: fixed; font: 22px Lilita; color: #8dff7a; text-shadow: 0 2px 0 #000; pointer-events: none; z-index: 30; animation: flyup 1s ease-out forwards; }
@keyframes flyup { to { transform: translateY(-60px); opacity: 0; } }
@media (max-height: 740px) { .logo { font-size: 30px; top: calc(env(safe-area-inset-top) + 58px); } .logo span { font-size: 22px; } .carCard { top: calc(env(safe-area-inset-top) + 126px); height: 160px; } .trackCard { top: calc(env(safe-area-inset-top) + 296px); } .row { bottom: calc(env(safe-area-inset-bottom) + 94px); } }
