/* Amdavad. Quiet glass panels in indigo, ivory and old gold, so the city is what you look at. */
:root { --ink: #0e1630; --glass: rgba(14, 22, 48, .62); --line: rgba(232, 200, 130, .55); --gold: #e3c078; --ivory: #f7f0e1; --dim: rgba(247, 240, 225, .72); --madder: #d8574f; --sap: #6fcf97;
  --serif: "Rasa", Georgia, serif; --sans: "Hind Vadodara", system-ui, sans-serif; --display: "Shrikhand", "Rasa", serif;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--ivory); font: 15px/1.4 var(--sans); overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-text-size-adjust: 100%; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#swipe { position: fixed; inset: 0; touch-action: none; z-index: 1; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; padding: 0; }
[hidden] { display: none !important; }
.glass, .pill, .round, .wide, .toast { background: var(--glass); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); border: 1px solid var(--line); box-shadow: 0 6px 22px rgba(4, 8, 24, .28); }

/* top */
#top { position: fixed; z-index: 3; top: calc(10px + var(--st)); left: calc(14px + var(--sl)); right: calc(12px + var(--sr)); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; }
#area { display: grid; max-width: 58vw; background: var(--glass); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); border: 1px solid var(--line); border-radius: 16px; padding: 7px 14px 5px; box-shadow: 0 6px 22px rgba(4, 8, 24, .28); }
#area b { font: 600 26px/1.05 var(--serif); letter-spacing: .005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#area span { font-size: 14px; color: var(--gold); }
#area em { font-style: normal; font-size: 12.5px; color: var(--dim); } #area em:empty { display: none; }
#area.flash b { animation: rise .5s ease-out; } @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#meters { display: flex; gap: 8px; align-items: center; pointer-events: auto; }
.pill { border-radius: 999px; padding: 6px 14px 4px; display: inline-flex; align-items: baseline; gap: 5px; font-variant-numeric: tabular-nums; position: relative; }
.pill b { font: 600 18px/1.1 var(--serif); } .pill.money b { color: var(--gold); }
.pill.icon { width: 40px; height: 40px; padding: 0; justify-content: center; align-items: center; font-size: 17px; }
#cash-d { position: absolute; right: 12px; top: 100%; font: 600 15px var(--serif); font-style: normal; opacity: 0; transition: opacity .15s, transform .5s; text-shadow: 0 1px 6px rgba(6, 10, 30, .8); }
#cash-d.show { opacity: 1; transform: translateY(5px); } #cash-d.up { color: var(--sap); } #cash-d.down { color: var(--madder); }

/* minimap */
#dock { position: fixed; z-index: 3; left: calc(14px + var(--sl)); top: calc(92px + var(--st)); display: grid; gap: 7px; justify-items: start; pointer-events: none; }
#mini { width: 92px; height: 92px; border-radius: 50%; border: 1.5px solid var(--gold); box-shadow: 0 6px 20px rgba(4, 8, 24, .4); pointer-events: auto; }
#nitro { width: 92px; height: 5px; border-radius: 3px; background: rgba(14, 22, 48, .6); overflow: hidden; }
#nitro i { display: block; height: 100%; background: linear-gradient(90deg, var(--madder), var(--gold)); transform-origin: left; }
.tiny { font-size: 12px; color: var(--ivory); background: var(--glass); border-radius: 999px; padding: 3px 10px 2px; display: flex; gap: 5px; align-items: baseline; font-variant-numeric: tabular-nums; }
.tiny #speed { font: 600 14px var(--serif); margin-left: 4px; } .tiny small { opacity: .75; } .tiny #kites { margin-left: 4px; }

/* goal, hints */
#fare { position: fixed; z-index: 3; top: calc(64px + var(--st)); left: 50%; transform: translateX(-50%); border-radius: 16px; display: flex; align-items: center; gap: 10px; padding: 8px 16px 7px 12px; max-width: min(92vw, 460px); overflow: hidden; pointer-events: none; }
#fare > div { display: flex; flex-direction: column; min-width: 0; }
#fare b { font: 600 17px/1.15 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#fare span { font-size: 12.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
#fare-a { font-size: 20px; color: var(--gold) !important; width: 24px; text-align: center; display: inline-block; }
#fare-p { color: var(--gold); letter-spacing: 1px; white-space: nowrap; }
#fare-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--gold); transform-origin: left; transform: scaleX(0); }
#hint { position: fixed; z-index: 3; top: 30%; left: 50%; transform: translateX(-50%); font: 600 15px var(--sans); color: var(--ink); background: var(--gold); border-radius: 999px; padding: 7px 18px 5px; box-shadow: 0 6px 22px rgba(4, 8, 24, .35); pointer-events: none; animation: nudge 0.9s ease-in-out infinite; }
#hint.l { --dx: -8px; } #hint.r { --dx: 8px; } @keyframes nudge { 50% { transform: translateX(calc(-50% + var(--dx, 0px))); } }
#turn { position: fixed; z-index: 3; top: calc(30% + 44px); left: 50%; transform: translateX(-50%); font-size: 13px; pointer-events: none; }
#gear { position: fixed; z-index: 3; left: 50%; bottom: calc(96px + var(--sb)); transform: translateX(-50%); font-size: 13px; pointer-events: none; }

/* words */
#toasts { position: fixed; z-index: 3; left: 50%; bottom: calc(132px + var(--sb)); transform: translateX(-50%); width: min(480px, 88vw); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { border-radius: 14px; padding: 7px 16px 5px; font: 500 16px/1.3 var(--serif); text-align: center; transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateY(6px); }
#banner { position: fixed; z-index: 4; top: 24%; left: 50%; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none; text-align: center; white-space: nowrap; }
#banner b { display: block; font: 400 clamp(30px, 8vw, 56px)/1.05 var(--display); color: var(--gold); text-shadow: 0 3px 0 var(--ink), 0 8px 30px rgba(4, 8, 24, .5); }
#banner span { display: inline-block; margin-top: 8px; font: 600 17px var(--serif); color: var(--ivory); background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 4px 16px 2px; }
#banner.show { animation: banner 2.2s cubic-bezier(.2, 1.2, .4, 1) forwards; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.7); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.03); } 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -64%) scale(1); } }
#combo { position: fixed; z-index: 3; top: 40%; right: calc(16px + var(--sr)); opacity: 0; pointer-events: none; text-align: right; transition: opacity .3s; text-shadow: 0 2px 12px rgba(4, 8, 24, .6); }
#combo.show { opacity: 1; } #combo b { display: block; font: 400 clamp(22px, 5.5vw, 36px)/1 var(--display); color: var(--ivory); } #combo span { font: 600 17px var(--serif); color: var(--gold); }
#combo.pop b { animation: pop .25s ease-out; } @keyframes pop { from { transform: scale(1.4); } to { transform: none; } }
#card { position: fixed; z-index: 3; left: 50%; top: calc(126px + var(--st)); transform: translateX(-50%); width: min(400px, 90vw); border-radius: 18px; padding: 12px 16px 10px; }
#card h2 { margin: 0; font: 600 21px/1.15 var(--serif); } #card p { margin: 3px 0 0; font-size: 14px; color: var(--dim); } #card .tag { color: var(--gold); font-weight: 600; font-size: 12.5px; } #card .gu { color: var(--gold); }

/* bottom bar */
#bar { position: fixed; z-index: 3; left: 0; right: 0; bottom: calc(18px + var(--sb)); display: flex; justify-content: center; align-items: center; gap: 14px; pointer-events: none; }
#bar button { pointer-events: auto; }
.round { width: 64px; height: 64px; border-radius: 50%; font: 600 14px var(--sans); } .round.gold { background: rgba(227, 192, 120, .92); color: var(--ink); border-color: rgba(255, 255, 255, .6); }
.wide { height: 52px; padding: 2px 30px 0; border-radius: 999px; font: 600 17px var(--serif); letter-spacing: .01em; }
.round:active, .wide:active, .cta:active { transform: scale(.95); }

/* free-steer pad (optional mode) */
#pad { position: fixed; z-index: 2; left: 0; right: 0; bottom: calc(96px + var(--sb)); height: 150px; pointer-events: none; }
#steer { position: absolute; left: 0; bottom: 0; width: 52%; height: 100%; pointer-events: auto; touch-action: none; }
#track { position: absolute; left: calc(18px + var(--sl)); bottom: 8px; width: 150px; height: 60px; border-radius: 30px; border: 1px solid var(--line); background: var(--glass); display: grid; place-items: center; }
#knob { width: 50px; height: 50px; border-radius: 50%; background: var(--ivory); }
#keys { position: absolute; right: calc(12px + var(--sr)); bottom: 0; display: grid; grid-template-columns: repeat(2, auto); gap: 8px; pointer-events: auto; }
.k { border: 1px solid var(--line) !important; background: var(--glass) !important; border-radius: 14px; font: 600 14px var(--sans); touch-action: none; }
.k.s { width: 70px; height: 40px; } .k.l { width: 70px; height: 56px; } .k.gas { background: rgba(60, 150, 100, .8) !important; } .k.brake { background: rgba(200, 70, 62, .8) !important; } .k.on { filter: brightness(1.3); }

/* sheets */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(6, 10, 26, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: grid; place-items: center; padding: calc(12px + var(--st)) 12px calc(12px + var(--sb)); }
.sheet-in { position: relative; width: min(760px, 100%); max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; background: #101a38; border: 1px solid var(--line); border-radius: 22px; padding: 20px 20px 18px; box-shadow: 0 24px 80px rgba(2, 4, 16, .6); }
.sheet-in.narrow { width: min(420px, 100%); }
.sheet-in h2 { margin: 0 40px 4px 0; font: 600 26px/1.1 var(--serif); color: var(--ivory); }
.sheet-in p { margin: 0 0 10px; font-size: 14px; color: var(--dim); }
.x { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; font-size: 17px; color: var(--dim); }
.mapwrap { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); } #bigmap { display: block; width: 100%; height: auto; }
.row { display: block; width: 100%; text-align: left; padding: 13px 2px 11px; border-top: 1px solid rgba(232, 200, 130, .22) !important; font-weight: 500; color: var(--ivory); text-decoration: none; }
.fine { margin-top: 14px !important; font-size: 13px !important; }
.cta { height: 54px; border-radius: 999px; background: var(--ivory) !important; color: var(--ink); font: 600 18px var(--serif); width: 100%; } .cta.gold { background: var(--gold) !important; }
.how .lead { font: 500 17px var(--serif); color: var(--gold); } .how ul { list-style: none; margin: 8px 0 18px; padding: 0; display: grid; gap: 12px; }
.how li { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px; } .how li b { font: 600 20px var(--serif); color: var(--ink); background: var(--gold); border-radius: 12px; text-align: center; padding: 8px 0 5px; } .how li span { font-size: 15px; color: var(--ivory); }
/* tasks */
.task { display: flex; gap: 14px; align-items: center; border-top: 1px solid rgba(232, 200, 130, .22); padding: 13px 0 11px; }
.task > div { flex: 1; min-width: 0; } .task h3 { margin: 0; font: 600 18px/1.2 var(--serif); color: var(--ivory); } .task h3 span { font: 500 13.5px var(--sans); color: var(--gold); margin-left: 6px; }
.task p { margin: 3px 0 0; font-size: 13.5px; } .task.done h3::before { content: "✓ "; color: var(--sap); }
.task button { flex: none; width: 78px; height: 54px; border-radius: 16px; background: var(--ivory); color: var(--ink); font: 600 16px var(--serif); display: grid; align-content: center; }
.task button small { font: 500 12px var(--sans); opacity: .7; } .task.on button { background: var(--madder); color: #fff; } .task.done button { background: transparent; color: var(--ivory); border: 1px solid var(--line); }
/* kite duel */
.kite-in { width: min(540px, 100%); display: grid; gap: 10px; text-align: center; padding: 14px; }
#kite-cv { width: 100%; height: min(44vh, 330px); display: block; border-radius: 14px; }
#kite-say { margin: 0; font: 500 16.5px/1.3 var(--serif); color: var(--ivory); min-height: 2.6em; }
#kite-bar { position: relative; height: 22px; border-radius: 11px; background: rgba(247, 240, 225, .14); overflow: hidden; }
#kite-bar .zone { position: absolute; top: 0; bottom: 0; left: var(--z); width: var(--w); background: var(--madder); } #kite-bar .pin { position: absolute; top: 0; bottom: 0; left: var(--p); width: 5px; margin-left: -2.5px; background: var(--ivory); border-radius: 3px; }
#kite-score { margin: 0; font: 600 19px var(--serif); color: var(--gold); letter-spacing: 3px; min-height: 1.2em; }
.kite-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

#speedlines { position: fixed; inset: -20%; pointer-events: none; opacity: 0; transition: opacity .2s; background: repeating-conic-gradient(from 0deg at 50% 46%, rgba(255,255,255,0) 0deg 5deg, rgba(255,255,255,.5) 5deg 5.5deg, rgba(255,255,255,0) 5.5deg 11deg); -webkit-mask-image: radial-gradient(circle at 50% 46%, transparent 0 36%, #000 64%); mask-image: radial-gradient(circle at 50% 46%, transparent 0 36%, #000 64%); animation: lines .35s steps(3) infinite; }
@keyframes lines { to { transform: rotate(4deg); } }

/* opening screen */
#boot { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 30%, #1c2b5c 0%, #0b1228 70%); transition: opacity .6s; }
#boot.gone { opacity: 0; pointer-events: none; }
.boot-in { text-align: center; padding: 24px; }
.boot-gu { font: 400 clamp(52px, 16vw, 120px)/1.05 var(--display); margin: 0; color: var(--gold); text-shadow: 0 10px 40px rgba(227, 192, 120, .25); }
#boot h1 { font: 500 clamp(18px, 4vw, 26px)/1 var(--serif); letter-spacing: .32em; text-transform: none; margin: 6px 0 22px; color: var(--ivory); }
#boot-status { margin: 0; font-size: 13.5px; color: var(--dim); }

@media (max-width: 520px) { #area b { font-size: 22px; } #mini { width: 78px; height: 78px; } #nitro { width: 78px; } #fare { top: calc(92px + var(--st)); left: calc(104px + var(--sl)); right: calc(12px + var(--sr)); transform: none; max-width: none; } #card { top: calc(214px + var(--st)); } }
@media (orientation: landscape) and (max-height: 520px) { #bar { justify-content: flex-end; right: calc(16px + var(--sr)); bottom: calc(12px + var(--sb)); gap: 10px; } .round { width: 56px; height: 56px; } .wide { height: 46px; padding: 2px 22px 0; } #toasts { bottom: calc(14px + var(--sb)); } #gear { bottom: calc(76px + var(--sb)); left: auto; right: calc(40px + var(--sr)); transform: none; } #hint { top: 22%; } #card { top: calc(60px + var(--st)); left: auto; right: calc(14px + var(--sr)); transform: none; width: min(340px, 40vw); } }
@media (min-width: 900px) { #mini { width: 130px; height: 130px; } #nitro { width: 130px; } #area b { font-size: 32px; } #card { left: auto; right: 18px; top: 74px; transform: none; } }
@media (prefers-reduced-motion: reduce) { #banner.show, #area.flash b, #combo.pop b, #hint { animation-duration: .01s; } }
