@import url('https://fonts.googleapis.com/css2?family=Lalezar&display=swap');
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; }
body { overflow: hidden; font-family: 'Vazirmatn', system-ui, sans-serif; background: #0b0518; color: #fff; user-select: none; -webkit-user-select: none; }
canvas { display: block; touch-action: none; }
button { font-family: inherit; }
.app { position: fixed; inset: 0; overflow: hidden; touch-action: none; }
.gl { position: absolute; inset: 0; width: 100%; height: 100%; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 55%, transparent 55%, rgba(10,0,25,.65)); }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)); z-index: 5; }
.screen.bg { background-size: cover; background-position: center; }
.screen.bg::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,4,30,.55), rgba(12,4,30,.85)); z-index: -1; }
.menu { background: linear-gradient(180deg, rgba(12,4,30,.75), rgba(12,4,30,0) 30%, rgba(12,4,30,0) 55%, rgba(12,4,30,.9)); }
.center-col { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; margin: auto; max-width: 440px; }
.grow { flex: 1; }
.logo { width: min(44vw, 190px); filter: drop-shadow(0 0 24px rgba(255,61,165,.7)); }
.float { animation: float 3s ease-in-out infinite; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-2deg); } }
@keyframes pulse { 50% { transform: scale(1.06); } }
.title { font-family: 'Lalezar', 'Vazirmatn'; font-size: 32px; line-height: 1.5; color: #fff; text-shadow: 0 0 10px #ff3da5, 0 0 28px #ff3da5, 0 3px 0 #6a0b45; }
.title.big { font-size: clamp(34px, 10vw, 54px); }
.subtitle { font-size: 15px; line-height: 1.9; color: #d6ccff; max-width: 330px; text-shadow: 0 2px 6px #000; }
.muted { color: #b9aee6; font-size: 13px; line-height: 1.8; }
.loadbar { width: 240px; height: 10px; border-radius: 10px; background: rgba(255,255,255,.12); overflow: hidden; }
.loadbar div { height: 100%; background: linear-gradient(90deg, #22e3ff, #ff3da5); box-shadow: 0 0 12px #ff3da5; transition: width .2s; }

.menu-top, .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.head { margin-bottom: 14px; }
.h-title { font-family: 'Lalezar', 'Vazirmatn'; font-size: 26px; text-shadow: 0 0 14px #22e3ff; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(15,6,40,.75); border: 1px solid rgba(255,255,255,.18); font-weight: 800; font-size: 15px; backdrop-filter: blur(6px); }
.coin { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6b0, #ffc531 45%, #c97a00); box-shadow: 0 0 8px #ffb02e; flex: none; }
.star-ic { display: inline-block; width: 20px; height: 20px; background: #ffc531; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); filter: drop-shadow(0 0 6px #ffb02e); }
.star-ic.off { background: rgba(255,255,255,.18); filter: none; }
.star-ic.big { width: 58px; height: 58px; }
.pop-in { animation: starIn .5s cubic-bezier(.3,1.8,.5,1) both; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } }

.btn { min-height: 50px; padding: 0 22px; border-radius: 16px; border: 1px solid rgba(255,255,255,.22); background: rgba(25,12,60,.8); color: #fff; font-size: 17px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .1s; backdrop-filter: blur(6px); }
.btn:active { transform: scale(.95); }
.btn.primary { background: linear-gradient(180deg, #ff5bb5, #d4127a); border-color: #ff9ad5; box-shadow: 0 5px 0 #7d0c4a, 0 0 24px rgba(255,61,165,.55); }
.btn.big { min-height: 62px; font-size: 21px; width: 100%; }
.btn.ghost { background: transparent; border-color: transparent; color: #c9bfff; }
.btn:disabled { opacity: .45; filter: grayscale(.6); }
.icon-btn { min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,.2); background: rgba(15,6,40,.75); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; display: grid; place-items: center; }
.menu-btns { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 420px; margin: 0 auto; }
.row { display: flex; gap: 12px; } .row .btn { flex: 1; }

.map-list { display: flex; flex-direction: column-reverse; gap: 14px; overflow-y: auto; padding: 8px 4px 20px; max-width: 460px; width: 100%; margin: 0 auto; }
.lvl-card { width: 82%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; border: 2px solid var(--c); background: rgba(15,6,40,.82); color: #fff; box-shadow: 0 0 18px color-mix(in srgb, var(--c) 60%, transparent), inset 0 0 18px color-mix(in srgb, var(--c) 25%, transparent); cursor: pointer; text-align: start; }
.lvl-card.locked { filter: grayscale(1); opacity: .55; box-shadow: none; }
.lc-no { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-family: 'Lalezar','Vazirmatn'; font-size: 24px; background: var(--c); color: #160626; flex: none; }
.lc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.7; }
.lc-txt b { font-size: 18px; } .lc-txt small { color: #c9bfff; font-size: 12px; overflow-wrap: anywhere; }
.lc-stars { display: flex; gap: 2px; }

.shop-list { display: flex; flex-direction: column; gap: 14px; max-width: 460px; width: 100%; margin: 0 auto; }
.up-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 20px; background: rgba(15,6,40,.85); border: 2px solid var(--c); box-shadow: 0 0 16px color-mix(in srgb, var(--c) 45%, transparent); }
.up-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.8; }
.up-txt b { font-size: 18px; color: var(--c); } .up-txt small { font-size: 12.5px; color: #d6ccff; overflow-wrap: anywhere; }
.pips { display: flex; gap: 3px; margin-top: 4px; } .pips i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.14); } .pips i.on { background: var(--c); box-shadow: 0 0 6px var(--c); }
.up-card .btn { min-width: 104px; padding: 0 12px; }

.hud { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.hud button { pointer-events: auto; }
.topbar { position: absolute; top: max(12px, env(safe-area-inset-top)); inset-inline: 12px; display: flex; align-items: center; gap: 10px; }
.lvl { flex: 1; min-width: 0; text-align: center; }
.lvl-name { font-weight: 800; font-size: 14px; text-shadow: 0 2px 6px #000; }
.prog { position: relative; height: 10px; border-radius: 10px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.2); margin-top: 4px; direction: ltr; }
.prog-fill { position: absolute; inset-block: 0; left: 0; width: 0; border-radius: 10px; background: linear-gradient(90deg, #22e3ff, #ff3da5); box-shadow: 0 0 10px #ff3da5; }
.truck-ic { position: absolute; right: -6px; top: -5px; width: 18px; height: 18px; border-radius: 4px; background: #ff2d55; box-shadow: 0 0 10px #ff2d55; }
.pz { width: 14px; height: 16px; border-inline: 5px solid #fff; display: block; }
.crowd-badge { position: absolute; left: 0; top: 0; padding: 2px 16px; border-radius: 14px; background: linear-gradient(180deg, #1ec8ff, #0a6fd1); border: 2px solid #b8f3ff; font-family: 'Lalezar','Vazirmatn'; font-size: 26px; line-height: 1.5; box-shadow: 0 0 18px rgba(34,227,255,.8); opacity: 0; transition: opacity .2s; will-change: transform; }
.truck-hp { position: absolute; left: 0; top: 0; width: 210px; text-align: center; opacity: 0; transition: opacity .3s; }
.hp-label { font-weight: 900; font-size: 14px; text-shadow: 0 2px 6px #000; }
.hp-bar { height: 14px; border-radius: 8px; background: rgba(0,0,0,.6); border: 2px solid #ff9aab; overflow: hidden; direction: ltr; }
.hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff2d55, #ffb02e); transition: width .1s; }
.pops { position: absolute; inset: 0; overflow: hidden; }
.pop { position: absolute; transform: translate(-50%, -50%); font-family: 'Lalezar','Vazirmatn'; font-size: 30px; white-space: nowrap; text-shadow: 0 0 12px currentColor, 0 3px 0 #000; animation: popUp 1s ease-out forwards; direction: ltr; }
.pop.big { font-size: 46px; }
@keyframes popUp { 0% { transform: translate(-50%,-50%) scale(.4); opacity: 0; } 15% { transform: translate(-50%,-80%) scale(1.25); opacity: 1; } 100% { transform: translate(-50%,-260%) scale(1); opacity: 0; } }
.flash { position: absolute; inset: 0; opacity: 0; }
.hint { position: absolute; bottom: max(70px, 12vh); inset-inline: 0; text-align: center; transition: opacity .3s; }
.hint-t { font-family: 'Lalezar','Vazirmatn'; font-size: 26px; text-shadow: 0 0 12px #ff3da5, 0 3px 0 #000; }
.hint-s { font-size: 13px; color: #e0d8ff; text-shadow: 0 2px 4px #000; line-height: 1.8; padding: 0 20px; }
.hand { width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 18px #22e3ff; animation: swipe 1.4s ease-in-out infinite; }
@keyframes swipe { 0%,100% { transform: translateX(-70px); } 50% { transform: translateX(70px); } }

.modal { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(8,2,22,.55); backdrop-filter: blur(3px); padding: 16px; animation: fadeIn .25s; }
@keyframes fadeIn { from { opacity: 0; } }
.card { width: min(360px, 100%); display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; padding: 24px 20px; border-radius: 26px; background: rgba(20,8,50,.92); border: 2px solid #ff3da5; box-shadow: 0 0 40px rgba(255,61,165,.45); animation: cardIn .4s cubic-bezier(.3,1.5,.5,1); }
@keyframes cardIn { from { transform: scale(.7); opacity: 0; } }
.card.lose { border-color: #ff2d55; }
.card.win { border-color: #3dff9a; box-shadow: 0 0 40px rgba(61,255,154,.4); }
.res-title { font-family: 'Lalezar','Vazirmatn'; font-size: 36px; line-height: 1.5; text-shadow: 0 0 16px currentColor; }
.win .res-title { color: #3dff9a; } .lose .res-title { color: #ff4d6d; }
.res-sub { color: #d6ccff; font-size: 14px; line-height: 1.8; }
.res-stars { display: flex; justify-content: center; gap: 8px; }
.res-stars .star-ic:nth-child(2) { transform: translateY(-12px); }
.res-rows { display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,.06); border-radius: 14px; padding: 10px 14px; }
.res-rows div { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.res-rows b { display: inline-flex; gap: 6px; align-items: center; font-size: 18px; }
