:root {
  --ink: #1b2547;
  --ink2: #2c3c72;
  --gold: #ffc93c;
  --gold2: #f39a1d;
  --snow: #f7faff;
  --sky: #8fd0f5;
  --rose: #ff5d55;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; }
body { overflow: hidden; font-family: "Vazirmatn", system-ui, sans-serif; background: #9ccbea; color: var(--ink); -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
canvas { display: block; touch-action: none; }
.app { position: fixed; inset: 0; overflow: hidden; }
button { font-family: inherit; cursor: pointer; border: 0; }
img { -webkit-user-drag: none; pointer-events: none; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; z-index: 10; line-height: 1.7; }

/* buttons */
.btn { min-height: 54px; padding: 0 28px; border-radius: 18px; font-size: 19px; font-weight: 900; color: var(--ink); position: relative; transition: transform .12s ease, filter .12s; width: 100%; }
.btn:active { transform: translateY(3px) scale(.98); }
.btn.gold { background: linear-gradient(#ffe07a, var(--gold) 45%, var(--gold2)); box-shadow: 0 5px 0 #b8620c, 0 10px 22px rgba(120,60,0,.35), inset 0 2px 0 rgba(255,255,255,.7); }
.btn.blue { background: linear-gradient(#9fe0ff, #4fb2ec); color: #fff; text-shadow: 0 2px 0 rgba(20,60,120,.35); box-shadow: 0 5px 0 #2a6ea8, 0 10px 20px rgba(20,60,120,.25), inset 0 2px 0 rgba(255,255,255,.6); }
.btn.ghost { background: rgba(255,255,255,.75); box-shadow: 0 4px 0 rgba(27,37,71,.18); font-size: 16px; min-height: 48px; }
.btn.big { min-height: 66px; font-size: 24px; max-width: 320px; }
.btn:disabled { filter: grayscale(.6) brightness(.95); }
.pulse:not(:disabled) { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.05); } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.82); color: var(--ink); font-weight: 800; font-size: 14px; box-shadow: 0 3px 0 rgba(27,37,71,.15); min-height: 36px; }
.icon-btn { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.9); color: var(--ink); box-shadow: 0 4px 0 rgba(27,37,71,.22); flex: none; }
.icon-btn:active { transform: translateY(2px); }

.star path { fill: rgba(27,37,71,.22); stroke: rgba(255,255,255,.8); stroke-width: 1.2; }
.star.on path { fill: url(#none) var(--gold); fill: #ffc93c; stroke: #c76a0a; }

/* title */
.title { justify-content: space-between; align-items: center; padding: calc(28px + var(--safe-t)) 20px calc(34px + var(--safe-b)); background: linear-gradient(rgba(20,40,90,.35), transparent 38%, transparent 62%, rgba(20,40,90,.45)); }
.title-bg { position: absolute; inset: 0; background: url(../../assets/bg_title.webp) center/cover; transition: opacity 1.2s ease; z-index: -1; }
.title-bg.faded { opacity: 0; }
.title-top { text-align: center; display: flex; flex-direction: column; align-items: center; animation: drop .8s cubic-bezier(.2,1.4,.4,1) both; }
.logo { width: min(46vw, 210px); filter: drop-shadow(0 8px 16px rgba(0,0,0,.3)); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes drop { from { transform: translateY(-40px); opacity: 0; } }
.title h1 { font-size: clamp(32px, 10vw, 54px); font-weight: 900; color: #fff; line-height: 1.35; text-shadow: 0 3px 0 var(--ink), 0 6px 18px rgba(10,20,60,.5); }
.sub { color: #fff; font-weight: 700; font-size: 17px; text-shadow: 0 2px 6px rgba(10,20,60,.6); }
.title-bottom { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.title-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* map */
.map { background: linear-gradient(rgba(214,234,250,.82), rgba(240,246,252,.9)), url(../../assets/bg_title.webp) center/cover; }
.map-head { display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-t)) 14px 10px; background: rgba(255,255,255,.55); backdrop-filter: blur(8px); box-shadow: 0 2px 12px rgba(27,37,71,.1); z-index: 2; }
.map-head h2 { flex: 1; font-size: 21px; font-weight: 900; min-width: 0; }
.map-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.map-canvas { position: relative; width: 100%; max-width: 520px; margin: 0 auto; }
.map-path { position: absolute; inset: 0; pointer-events: none; }
.path-bg { fill: none; stroke: rgba(255,255,255,.95); stroke-width: 16; stroke-linecap: round; }
.path-dash { fill: none; stroke: #e0a54a; stroke-width: 4; stroke-dasharray: 2 12; stroke-linecap: round; }
.peak-label { position: absolute; inset-inline: 0; text-align: center; font-weight: 900; color: var(--ink2); font-size: 15px; }
.node { position: absolute; transform: translate(50%, -50%); background: none; display: flex; flex-direction: column; align-items: center; width: 120px; }
.node-disc { position: relative; width: 82px; height: 82px; display: grid; place-items: center; transition: transform .15s; }
.node:active .node-disc { transform: scale(.92); }
.node-disc > img:first-child { display: none; }
.node-disc { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe48a, #f4a524 60%, #c66d0c); box-shadow: 0 6px 0 #9a520a, 0 10px 16px rgba(27,37,71,.3), inset 0 0 0 5px rgba(255,255,255,.55); }
.node.locked .node-disc { background: radial-gradient(circle at 35% 30%, #e6ecf3, #aab6c6); box-shadow: 0 6px 0 #7c8798, inset 0 0 0 5px rgba(255,255,255,.5); }
.logo { display: none; }
.node-disc b { position: relative; font-size: 28px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 var(--ink), 0 0 6px rgba(0,0,0,.4); }
.node-disc .lock { position: relative; width: 40px; height: 40px; }
.node.locked .node-disc > img:first-child { filter: grayscale(1) brightness(.9) drop-shadow(0 4px 4px rgba(0,0,0,.2)); }
.node-stars { display: flex; gap: 1px; margin-top: -8px; position: relative; }
.node-stars .star:nth-child(2) { transform: translateY(-4px); }
.node-name { font-weight: 800; font-size: 14px; background: rgba(255,255,255,.88); padding: 0 10px; border-radius: 10px; color: var(--ink); white-space: nowrap; }
.node.locked .node-name { opacity: .6; }
.node.current .node-disc { animation: bob 1.2s ease-in-out infinite; }
.node-eagle { position: absolute; top: -46px; width: 62px; animation: float 2s ease-in-out infinite; filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
@keyframes bob { 50% { transform: translateY(-6px) scale(1.04); } }

/* HUD */
.hud { position: absolute; inset-inline: 0; top: 0; padding: calc(10px + var(--safe-t)) 12px 0; pointer-events: none; z-index: 5; line-height: 1.5; }
.hud-row { display: flex; align-items: flex-start; gap: 8px; }
.hud-box { background: rgba(255,255,255,.86); border-radius: 16px; padding: 4px 12px 6px; box-shadow: 0 4px 0 rgba(27,37,71,.18); }
.hud-box .lbl { display: block; font-size: 12px; font-weight: 700; color: #5a668c; }
.hud-box b { font-size: 22px; font-weight: 900; }
.score { min-width: 110px; }
.hearts { display: flex; gap: 2px; margin-top: 2px; }
.heart path { fill: rgba(27,37,71,.18); }
.heart.on path { fill: var(--rose); stroke: #b8302c; stroke-width: 1; }
.rings { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.rings img { width: 40px; height: 40px; }
.rings small { font-size: 14px; color: #5a668c; }
.pause-btn { pointer-events: auto; }
.progress { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.bar { flex: 1; height: 12px; border-radius: 99px; background: rgba(27,37,71,.25); position: relative; box-shadow: inset 0 2px 3px rgba(0,0,0,.2); }
.bar i { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, var(--gold2), var(--gold)); }
.bird { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--gold2); transform: translate(50%, -50%); }
.peak { flex: none; }
.dist { text-align: center; font-size: 13px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(10,20,60,.7); margin-top: 2px; }
.combo { margin: 4px auto 0; width: fit-content; padding: 2px 14px; border-radius: 99px; background: linear-gradient(#ffe07a, var(--gold2)); font-weight: 900; font-size: 14px; box-shadow: 0 3px 0 #b8620c; animation: popin .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes popin { from { transform: scale(.4); opacity: 0; } }
.pops { position: absolute; inset-inline: 0; top: 30%; display: flex; flex-direction: column; align-items: center; pointer-events: none; z-index: 6; }
.pop { font-size: clamp(30px, 9vw, 46px); font-weight: 900; color: #fff; text-shadow: 0 3px 0 var(--gold2), 0 6px 0 #9a4f0a, 0 10px 20px rgba(0,0,0,.3); animation: popword 1.3s ease-out forwards; }
@keyframes popword { 0% { transform: scale(.3); opacity: 0; } 15% { transform: scale(1.15); opacity: 1; } 25% { transform: scale(1); } 75% { opacity: 1; } 100% { transform: translateY(-50px); opacity: 0; } }
.hit-flash { position: absolute; inset: 0; pointer-events: none; z-index: 7; background: radial-gradient(transparent 40%, rgba(255,40,40,.65)); animation: flash .5s ease-out forwards; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

.tutorial { position: absolute; inset-inline: 0; bottom: calc(40px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; z-index: 6; text-align: center; padding: 0 20px; animation: popin .4s ease; }
.tutorial p { font-weight: 900; font-size: 18px; color: #fff; text-shadow: 0 2px 0 var(--ink), 0 4px 10px rgba(0,0,0,.4); }
.tutorial small { font-weight: 700; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.7); font-size: 13px; }
.hand-zone { position: relative; width: 130px; height: 130px; }
.hand { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px; border-radius: 50%; background: rgba(255,255,255,.95); box-shadow: 0 0 0 8px rgba(255,255,255,.35), 0 6px 14px rgba(0,0,0,.25); animation: cross 3.2s ease-in-out infinite; }
@keyframes cross { 0%,100% { transform: translate(0,0); } 12% { transform: translate(0,-40px); } 25% { transform: translate(0,0); } 37% { transform: translate(0,40px); } 50% { transform: translate(0,0); } 62% { transform: translate(-40px,0); } 75% { transform: translate(0,0); } 87% { transform: translate(40px,0); } }
.arr { position: absolute; width: 0; height: 0; border: 9px solid transparent; opacity: .9; }
.arr.u { left: 56px; top: 0; border-bottom: 12px solid #fff; }
.arr.d { left: 56px; bottom: 0; border-top: 12px solid #fff; }
.arr.l { top: 56px; left: 0; border-right: 12px solid #fff; }
.arr.r { top: 56px; right: 0; border-left: 12px solid #fff; }

/* cards */
.veil { background: rgba(20,30,70,.45); backdrop-filter: blur(3px); align-items: center; justify-content: center; padding: 20px; z-index: 20; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } }
.card { width: 100%; max-width: 360px; background: linear-gradient(#ffffff, #eef5fc); border-radius: 28px; padding: 40px 20px 20px; position: relative; text-align: center; box-shadow: 0 8px 0 rgba(27,37,71,.25), 0 24px 50px rgba(10,20,60,.35); animation: cardin .45s cubic-bezier(.2,1.4,.4,1); max-height: 100%; overflow-y: auto; }
@keyframes cardin { from { transform: translateY(40px) scale(.85); opacity: 0; } }
.ribbon { position: absolute; top: -22px; inset-inline: 30px; min-height: 52px; display: grid; place-items: center; font-size: 24px; font-weight: 900; color: #fff; border-radius: 16px; background: linear-gradient(#ffb347, #f27a1a); box-shadow: 0 5px 0 #a8480a; text-shadow: 0 2px 0 rgba(120,40,0,.4); }
.ribbon.blue, .result.lost .ribbon { background: linear-gradient(#7fc8f5, #3d8fd6); box-shadow: 0 5px 0 #24609a; }
.card.result { padding-top: 46px; }
.result-eagle { position: absolute; width: 92px; top: -96px; inset-inline-start: calc(50% - 46px); filter: drop-shadow(0 6px 8px rgba(0,0,0,.3)); animation: float 2.4s ease-in-out infinite; }
.result.lost .result-eagle { filter: grayscale(.4) drop-shadow(0 6px 8px rgba(0,0,0,.3)); }
.result-level { font-weight: 800; color: #5a668c; font-size: 14px; }
.result-stars { display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin: 6px 0 10px; }
.result-stars .star { animation: starpop .5s cubic-bezier(.2,1.8,.4,1) both; }
@keyframes starpop { from { transform: scale(0) rotate(-40deg); } }
.stats { display: grid; gap: 6px; margin-bottom: 12px; }
.stats div { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: rgba(27,37,71,.06); border-radius: 12px; padding: 6px 12px; }
.stats span { font-weight: 700; color: #5a668c; font-size: 14px; }
.stats b { font-weight: 900; font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
.badge { font-style: normal; font-size: 11px; background: var(--rose); color: #fff; border-radius: 8px; padding: 1px 7px; margin-inline-start: 6px; vertical-align: middle; }
.hint { font-size: 13px; color: #5a668c; margin-bottom: 10px; font-weight: 600; }
.btns { display: grid; gap: 12px; }
.pause-sub { font-weight: 800; color: #5a668c; margin-bottom: 16px; }
