

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body, #root { height: 100%; }
body { overflow: hidden; font-family: 'Vazirmatn', system-ui, sans-serif; background: #0b4f6c; user-select: none; -webkit-user-select: none; }
canvas { display: block; touch-action: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { -webkit-user-drag: none; }

:root {
  --teal: #0b5d78; --teal-d: #073e52; --turq: #22c6cf; --sand: #ffe7b0; --sand-d: #e8c27a;
  --coral: #ff6a45; --coral-d: #c9402a; --sun: #ffc93c; --sun-d: #d99a0b; --leaf: #3fbf6a; --ink: #3a2410;
}

.app { position: fixed; inset: 0; overflow: hidden; direction: rtl; }
.game-canvas { position: absolute !important; inset: 0; }
.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }

.screen { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; padding: max(14px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)); line-height: 1.7; }
.loading { background: url(../../assets/title_bg.webp) center/cover, linear-gradient(#3fd0e6, #0b5d78); justify-content: center; gap: 6px; }
.logo { width: min(52vw, 230px); filter: drop-shadow(0 8px 14px rgba(0,0,0,.3)); }
.float { animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-1deg); } }
.title { font-weight: 900; font-size: clamp(26px, 7.6vw, 40px); color: #fff; text-align: center; line-height: 1.5;
  text-shadow: 0 3px 0 var(--coral-d), 0 6px 0 rgba(0,0,0,.25), 0 0 18px rgba(255,180,80,.5); -webkit-text-stroke: 1px rgba(120,40,10,.35); }
.tagline { color: var(--sand); font-weight: 700; font-size: 17px; text-shadow: 0 2px 4px rgba(0,0,0,.45); }
.bar-wrap { width: min(80vw, 320px); margin-top: 26px; text-align: center; }
.bar { height: 18px; border-radius: 12px; background: rgba(0,0,0,.35); border: 3px solid #fff; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--sun), var(--coral)); transition: width .25s; border-radius: 8px; }
.bar-txt { color: #fff; margin-top: 8px; font-weight: 700; text-shadow: 0 2px 3px rgba(0,0,0,.5); font-size: 14px; }

.btn { position: relative; min-height: 50px; padding: 6px 26px; border-radius: 18px; font-weight: 900; font-size: 18px; color: #fff;
  background: linear-gradient(#ffd35a, #ff9a2a); border-bottom: 6px solid var(--coral-d); box-shadow: 0 6px 14px rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.6);
  text-shadow: 0 2px 0 rgba(150,60,0,.5); transition: transform .08s, filter .15s; }
.btn:active { transform: translateY(4px); border-bottom-width: 2px; }
.btn.big { font-size: 22px; min-height: 62px; padding: 6px 40px; }
.btn.alt { background: linear-gradient(#5fe3ea, #17a6c4); border-bottom-color: #0b5d78; text-shadow: 0 2px 0 rgba(0,60,90,.45); }
.btn.ghost { background: rgba(255,255,255,.88); color: var(--teal); border-bottom-color: #9fc7cf; text-shadow: none; }
.btn.wide { width: 100%; }
.btn:disabled { filter: grayscale(.8) brightness(.95); opacity: .75; cursor: default; }
.pulse { animation: pulse 1.2s ease-in-out infinite; margin-top: 30px; }
@keyframes pulse { 50% { transform: scale(1.06); } }

.topbar { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(7,40,56,.62); color: #fff; font-weight: 800; padding: 3px 12px; border-radius: 999px; border: 2px solid rgba(255,255,255,.55); font-size: 16px; backdrop-filter: blur(4px); white-space: nowrap; }
.gem-ico { width: 24px; height: 24px; object-fit: contain; }
.icon-btn { width: 46px; height: 46px; border-radius: 14px; background: #fff; display: grid; place-items: center; border-bottom: 4px solid #9fc7cf; }
.icon-btn svg { width: 26px; height: 26px; fill: none; stroke: var(--teal); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.menu { justify-content: space-between; background: linear-gradient(rgba(10,60,90,.35), transparent 30%, transparent 60%, rgba(5,40,60,.55)); }
.menu-head { display: flex; flex-direction: column; align-items: center; margin-top: 2vh; }
.menu-head .logo { width: min(36vw, 160px); }
.menu-btns { display: flex; flex-direction: column; gap: 12px; width: min(86vw, 330px); }

.map { background: radial-gradient(circle at 30% 20%, #4fe0ea 0, transparent 50%), repeating-radial-gradient(circle at 70% 60%, #1aa9c4 0 18px, #179dbb 18px 36px); padding-inline: 0; }
.map .topbar { padding-inline: 16px; }
.map-title { color: #fff; font-weight: 900; font-size: 22px; text-shadow: 0 3px 0 rgba(0,0,0,.25); }
.map-scroll { position: relative; flex: 1; width: 100%; overflow-y: auto; padding: 14px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.map-path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-path path { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1.2; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.node { position: relative; display: flex; align-items: center; gap: 8px; width: min(92%, 380px); align-self: flex-start; background: linear-gradient(#fff8e6, #ffe6ad); border-radius: 22px; padding: 8px; border-bottom: 6px solid var(--sand-d); box-shadow: 0 8px 18px rgba(0,40,60,.3); text-align: start; animation: nodeIn .45s backwards cubic-bezier(.3,1.6,.5,1); }
.node.odd { align-self: flex-end; }
.node:active { transform: scale(.97); }
@keyframes nodeIn { from { transform: scale(.6); opacity: 0; } }
.node-img { width: 44%; max-width: 160px; aspect-ratio: 2/1; object-fit: contain; flex-shrink: 0; }
.node-info { min-width: 0; flex: 1; color: var(--ink); line-height: 1.6; }
.node-num { font-size: 12px; font-weight: 700; color: #a06a2a; }
.node-name { font-size: 18px; font-weight: 900; color: var(--teal-d); overflow-wrap: anywhere; }
.node-desc { font-size: 12px; opacity: .8; overflow-wrap: anywhere; }
.node-stars img { width: 26px; height: 26px; }
.node-lock { display: flex; align-items: center; gap: 4px; font-weight: 800; color: #7a5a3a; font-size: 14px; }
.node-lock img { width: 26px; height: 26px; }
.node.locked { background: linear-gradient(#e8e4dc, #cfc8bb); border-bottom-color: #a59d8f; }
.toast { position: absolute; bottom: max(30px, env(safe-area-inset-bottom)); inset-inline: 20px; background: #fff; color: var(--teal-d); border-radius: 16px; padding: 12px 16px; font-weight: 800; text-align: center; box-shadow: 0 10px 24px rgba(0,0,0,.3); animation: popIn .3s cubic-bezier(.3,1.6,.5,1); z-index: 5; }

.shop { justify-content: space-between; background: linear-gradient(rgba(10,60,90,.3), transparent 25%); pointer-events: none; }
.shop > * { pointer-events: auto; }
.shop-sheet { width: min(100%, 440px); background: linear-gradient(#fff8e6, #ffe3a6); border-radius: 26px; padding: 12px 12px 14px; border-bottom: 6px solid var(--sand-d); box-shadow: 0 -6px 24px rgba(0,0,0,.25); }
.shop-name { text-align: center; font-weight: 900; font-size: 20px; color: var(--teal-d); margin-bottom: 6px; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; background: #fff; border-radius: 16px; border: 3px solid transparent; border-bottom: 4px solid #e6cf9b; min-width: 0; }
.card.sel { border-color: var(--coral); transform: translateY(-2px); }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.card-name { font-size: 12px; font-weight: 800; color: var(--ink); text-align: center; line-height: 1.5; overflow-wrap: anywhere; }
.card-price { display: flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; color: var(--teal); }
.card-price .gem-ico { width: 18px; height: 18px; }

.overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(4,30,44,.55); backdrop-filter: blur(3px); padding: 16px; line-height: 1.7; }
.panel { width: min(100%, 340px); background: linear-gradient(#fffaf0, #ffe4a8); border-radius: 28px; padding: 22px 18px 18px; display: flex; flex-direction: column; gap: 10px; border: 4px solid #fff; border-bottom: 8px solid var(--sand-d); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.panel h2 { text-align: center; color: var(--teal-d); font-weight: 900; font-size: 24px; }
.pop-in { animation: popIn .4s cubic-bezier(.3,1.6,.5,1); }
@keyframes popIn { from { transform: scale(.5); opacity: 0; } }
.result { position: relative; padding-top: 34px; gap: 6px; max-height: 100%; overflow-y: auto; }
.ribbon { position: absolute; top: -20px; inset-inline: 30px; text-align: center; background: linear-gradient(#ff8a5c, var(--coral)); color: #fff; font-weight: 900; font-size: 22px; padding: 4px 0; border-radius: 14px; border-bottom: 5px solid var(--coral-d); text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.result.fail .ribbon { background: linear-gradient(#7fd3e6, #2a9ec0); border-bottom-color: #0b5d78; }
.stars { display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin-top: 6px; }
.stars img { width: 68px; height: 68px; }
.stars img.mid { width: 86px; height: 86px; transform: translateY(-8px); }
.star-on { animation: starPop .45s cubic-bezier(.3,1.8,.5,1); }
.stars img.mid.star-on { animation-name: starPopMid; }
@keyframes starPop { from { transform: scale(2.2) rotate(-30deg); opacity: 0; } }
@keyframes starPopMid { from { transform: translateY(-8px) scale(2.2) rotate(-30deg); opacity: 0; } }
.res-sub { text-align: center; font-weight: 800; color: var(--teal); }
.res-rows { background: rgba(255,255,255,.7); border-radius: 16px; padding: 6px 12px; }
.res-rows div { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink); padding: 2px 0; border-bottom: 1px dashed #e7cf97; }
.res-rows div:last-child { border: none; }
.reward { display: flex; justify-content: center; align-items: center; gap: 6px; font-weight: 900; color: var(--coral-d); font-size: 17px; }
.star-rules { list-style: none; font-size: 12px; color: #8a6a44; }
.star-rules li::before { content: "○ "; }
.star-rules li.ok { color: #2e8f4a; font-weight: 800; }
.star-rules li.ok::before { content: "● "; }
.need-note { text-align: center; font-size: 13px; font-weight: 800; color: #8a5a2a; background: rgba(255,255,255,.7); border-radius: 12px; padding: 6px; }
.res-btns { display: flex; gap: 8px; }
.res-btns .btn { flex: 1; padding-inline: 8px; }

/* HUD */
.hud { position: absolute; inset: 0; z-index: 8; pointer-events: none; line-height: 1.7; }
.hud-top { position: absolute; top: max(10px, env(safe-area-inset-top)); inset-inline: 12px; display: flex; justify-content: space-between; align-items: flex-start; }
.hud-group { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.hearts { gap: 2px; padding: 4px 10px; }
.heart { width: 24px; height: 24px; fill: #ff4d6d; stroke: #fff; stroke-width: 1.5; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); transition: transform .2s; }
.heart.off { fill: rgba(255,255,255,.18); transform: scale(.82); }
.lvl { font-size: 13px; }
.pause-btn { pointer-events: auto; width: 50px; height: 50px; border-radius: 16px; background: rgba(255,255,255,.92); display: grid; place-items: center; border-bottom: 4px solid #9fc7cf; }
.pause-btn img { width: 34px; height: 34px; }
.hud-row2 { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 90px); inset-inline: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.stat img { width: 24px; height: 24px; object-fit: contain; }
.stat small { opacity: .7; font-size: 12px; }
.time { font-size: 14px; }
.hint { position: absolute; top: 34%; inset-inline: 24px; margin-inline: auto; max-width: 320px; text-align: center; background: rgba(255,255,255,.95); color: var(--teal-d); font-weight: 900; font-size: 16px; padding: 10px 14px; border-radius: 18px; box-shadow: 0 8px 20px rgba(0,0,0,.25); animation: hintIn .5s cubic-bezier(.3,1.6,.5,1), bob 1.6s ease-in-out .5s infinite; }
@keyframes hintIn { from { transform: scale(.4); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-6px); } }
.joy-zone { position: absolute; left: 0; bottom: 0; width: 62%; height: 46%; pointer-events: auto; touch-action: none; }
.joy-base { position: absolute; left: 90px; top: calc(100% - 120px); width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: rgba(255,255,255,.18); border: 3px solid rgba(255,255,255,.6); box-shadow: inset 0 0 20px rgba(0,0,0,.15); opacity: .65; transition: opacity .15s; }
.joy-base.on { opacity: 1; }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #ffd35a 60%, #ff9a2a); border-bottom: 4px solid var(--coral-d); box-shadow: 0 4px 10px rgba(0,0,0,.3); }
.jump-btn { position: absolute; right: 22px; bottom: max(36px, calc(env(safe-area-inset-bottom) + 20px)); width: 96px; height: 96px; border-radius: 50%; pointer-events: auto; touch-action: none; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle at 35% 30%, #ff9f7a, var(--coral)); border-bottom: 7px solid var(--coral-d); box-shadow: 0 8px 18px rgba(0,0,0,.3), inset 0 3px 0 rgba(255,255,255,.4); color: #fff; font-weight: 900; font-size: 15px; line-height: 1.2; }
.jump-btn:active { transform: translateY(4px) scale(.96); border-bottom-width: 3px; }
.jump-btn svg { width: 36px; height: 36px; fill: #fff; }
.pop { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 20px; color: #fff; white-space: nowrap; text-shadow: 0 2px 0 rgba(0,0,0,.35); animation: popUp .95s ease-out forwards; }
.pop.gem { color: #b9f6ff; text-shadow: 0 2px 0 #0b5d78; }
.pop.gold { color: #ffe066; text-shadow: 0 2px 0 #a8580a; font-size: 22px; }
.pop.bad { color: #ff8f8f; text-shadow: 0 2px 0 #6a1010; }
@keyframes popUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.5); } 20% { opacity: 1; transform: translate(-50%, -60%) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -220%) scale(1); } }

@media (min-width: 900px) {
  .joy-zone { width: 40%; }
}

/* SAZITO_PLATFORM_CONTAINER_FIX_SCRUM_4531 */
/* No author .container rule found; Tailwind's built-in .container
   utility never had a phone gutter in EITHER preview or a real build
   (width:100% + breakpoint max-width, no padding/margin, ever) — see
   platformContainerFix.ts for the full mechanism, verified both ways.
   Scoped to @layer components (not unlayered) so a REAL utility class the
   author DID apply — e.g. class="container px-8" — still wins: Tailwind's
   own @layer utilities (publish) and its unlayered runtime injection
   (preview) both outrank @layer components; this default only applies
   when nothing else sets padding/margin at all. */
@layer components {
  .container {
    margin-inline: auto;
    padding-inline: 1rem;
  }
  @media (min-width: 640px) {
    .container {
      padding-inline: 1.5rem;
    }
  }
}
