:root {
  --bg-deep: #070a14;
  --bg-card: rgba(17, 24, 39, 0.88);
  --bg-glass: rgba(30, 41, 59, 0.72);
  --border-glow: rgba(148, 163, 184, 0.2);
  --gold-primary: #fbbf24;
  --phys-color: #ff5252;
  --ment-color: #38bdf8;
  --emot-color: #fbbf24;
  --soci-color: #34d399;
  --safe-top: max(16px, env(safe-area-inset-top, 0px));
  --safe-bottom: max(20px, env(safe-area-inset-bottom, 0px));
}

/* تنظیم دقیق Safe Area برای تمام مدل‌های آیفون (آیفون ۱۶، ۱۵، ۱۴، ۱۳، ۱۲، مینی، پرو مکس و SE) */
@media (max-width: 600px) {
  :root {
    --safe-top: max(66px, calc(env(safe-area-inset-top, 54px) + 14px));
    --safe-bottom: max(28px, calc(env(safe-area-inset-bottom, 20px) + 12px));
  }
}

@supports (-webkit-touch-callout: none) {
  :root {
    --safe-top: max(66px, calc(env(safe-area-inset-top, 54px) + 14px));
    --safe-bottom: max(28px, calc(env(safe-area-inset-bottom, 20px) + 12px));
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: 'Vazirmatn', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at 50% 0%, #161f38 0%, #070a14 75%);
  color: #f8fafc;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  direction: rtl;
  overflow-x: hidden;
  user-select: none;
  line-height: 1.6;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.5);
  border-radius: 999px;
}

/* Mobile Game Shell Container */
.game-shell {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  background: linear-gradient(180deg, rgba(11, 16, 30, 0.97) 0%, rgba(7, 10, 20, 0.99) 100%);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.85), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  padding-bottom: calc(88px + var(--safe-bottom));
}

.safe-modal {
  padding: calc(var(--safe-top) + 6px) 14px calc(var(--safe-bottom) + 10px) !important;
}

.safe-modal > .glass-panel {
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 16px) !important;
  overflow-y: auto;
}

/* Entrance & Story Animations */
@keyframes slideFadeUp {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes scalePopIn {
  0% {
    opacity: 0;
    transform: scale(0.84);
  }
  70% {
    opacity: 1;
    transform: scale(1.03);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ctaPulseGlow {
  0%, 100% {
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.35), 0 0 0 0 rgba(251, 191, 36, 0.45);
  }
  50% {
    box-shadow: 0 10px 32px rgba(251, 191, 36, 0.55), 0 0 0 6px rgba(251, 191, 36, 0);
  }
}

@keyframes floatIdle {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.02);
  }
}

@keyframes bossPulse {
  0%, 100% {
    transform: translateY(0px) scale(1);
    filter: drop-shadow(0 0 14px rgba(239, 68, 68, 0.45));
  }
  50% {
    transform: translateY(-7px) scale(1.03);
    filter: drop-shadow(0 0 26px rgba(239, 68, 68, 0.78));
  }
}

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  15% { transform: translate(-8px, -5px) rotate(-1.2deg); }
  30% { transform: translate(8px, 4px) rotate(1.2deg); }
  45% { transform: translate(-6px, 5px) rotate(-0.8deg); }
  60% { transform: translate(6px, -4px) rotate(0.8deg); }
  75% { transform: translate(-3px, 2px) rotate(-0.4deg); }
}

@keyframes bossHitFlash {
  0% {
    filter: brightness(3) contrast(2) saturate(0) drop-shadow(0 0 30px #ffffff);
    transform: scale(0.88) translateX(-14px) rotate(-6deg);
  }
  40% {
    filter: brightness(1.8) sepia(1) hue-rotate(-40deg) saturate(4) drop-shadow(0 0 28px #ef4444);
    transform: scale(1.06) translateX(8px) rotate(4deg);
  }
  100% {
    filter: brightness(1);
    transform: scale(1) translateX(0) rotate(0deg);
  }
}

@keyframes damageFloatUp {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.6);
  }
  20% {
    opacity: 1;
    transform: translateY(-10px) scale(1.25);
  }
  80% {
    opacity: 1;
    transform: translateY(-38px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-56px) scale(0.85);
  }
}

@keyframes slashBeam {
  0% {
    opacity: 0;
    transform: scaleX(0.1) rotate(-28deg);
  }
  30% {
    opacity: 1;
    transform: scaleX(1.15) rotate(-28deg);
  }
  100% {
    opacity: 0;
    transform: scaleX(1.35) rotate(-28deg);
  }
}

.animate-slide-in {
  animation: slideFadeUp 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-pop-in {
  animation: scalePopIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cta-pulse {
  animation: ctaPulseGlow 2.2s infinite;
}

.animate-float-hero {
  animation: floatIdle 3.4s ease-in-out infinite;
}

.animate-float-boss {
  animation: bossPulse 3.1s ease-in-out infinite;
}

.shake-active {
  animation: screenShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.boss-hit-active {
  animation: bossHitFlash 0.48s ease-out both !important;
}

.damage-popup {
  animation: damageFloatUp 1.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}

.slash-vfx {
  position: absolute;
  width: 170px;
  height: 12px;
  background: linear-gradient(90deg, transparent, #ffffff, #fbbf24, #ef4444, transparent);
  border-radius: 999px;
  box-shadow: 0 0 24px #fbbf24, 0 0 45px #ef4444;
  animation: slashBeam 0.38s ease-out forwards;
  pointer-events: none;
  z-index: 30;
}

/* Collectible Card Styling */
.powerup-card {
  position: relative;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 20px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.powerup-card:hover {
  transform: translateY(-4px);
  border-color: rgba(251, 191, 36, 0.65);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.7), 0 0 18px rgba(251, 191, 36, 0.22);
}

.powerup-card:active {
  transform: scale(0.97);
}

/* Glass Panels */
.glass-panel {
  background: rgba(17, 24, 39, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
}

/* Guided Step Banner */
.journey-coach-banner {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18) 0%, rgba(16, 185, 129, 0.15) 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* Comic Book Panels */
.comic-panel {
  border: 3px solid #f8fafc;
  box-shadow: 6px 6px 0px #000000;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}

.comic-caption {
  background: #fef08a;
  color: #0f172a;
  font-weight: 800;
  border: 2px solid #0f172a;
  box-shadow: 3px 3px 0px #0f172a;
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 6px;
}

.comic-speech {
  background: #ffffff;
  color: #0f172a;
  border: 2px solid #0f172a;
  border-radius: 14px;
  padding: 7px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.85);
}


/* ============================================================
   V16 ZEN MINIMALIST RPG — Breathable, Single-Focus, Zero Noise
   ============================================================ */

.arena-page { padding: 12px 14px 28px; }

/* Segmented Control (Clean 2-tab switcher for Minimal Views) */
.zen-seg-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(15, 23, 42, 0.78);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 12px;
}
.zen-seg-btn {
  padding: 9px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.zen-seg-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Coach row (Slim & Minimal) */
.coach-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px; padding: 8px 12px; margin-bottom: 10px;
}
.coach-title { flex: 1; min-width: 0; font-size: 0.76rem; font-weight: 800; color: #e2e8f0; line-height: 1.4; }
.coach-sub { font-size: 0.72rem; color: #94a3b8; font-weight: 700; }
.coach-dots { display: flex; gap: 4px; flex-shrink: 0; }
.coach-dots .dot {
  width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center;
  font-size: 0.66rem; background: rgba(255,255,255,0.05); filter: grayscale(1); opacity: 0.4;
  transition: all .25s;
}
.coach-dots .dot.on { filter: none; opacity: 1; background: rgba(251,191,36,0.2); border: 1px solid rgba(251,191,36,0.5); }
.coach-btn {
  border: none; border-radius: 10px; padding: 6px 10px; font-family: inherit; font-weight: 900;
  background: #fbbf24; color: #0f172a; cursor: pointer; font-size: 0.74rem; flex-shrink: 0;
}

/* Stage (Calm, Focused, Uncluttered) */
.arena-stage {
  position: relative; border-radius: 22px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.09); box-shadow: 0 12px 32px rgba(0,0,0,0.55);
  background: #0b101e; margin-bottom: 12px;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 14px;
}
.arena-bg { position: absolute; inset: 0; background: url('../public/assets/arena/arena-bg.png') center/cover; opacity: 0.28; pointer-events: none; }
.arena-fade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,13,24,0.88) 0%, rgba(9,13,24,0.45) 50%, rgba(9,13,24,0.95) 100%); pointer-events: none; }

.boss-head { position: relative; z-index: 5; width: 100%; }
.boss-name-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.boss-name { font-size: 0.92rem; font-weight: 900; color: #fff; line-height: 1.35; }
.boss-plain { font-size: 0.72rem; color: #94a3b8; font-weight: 700; line-height: 1.35; }
.info-chip {
  height: 28px; min-width: 28px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(15,23,42,0.8); color: #cbd5e1; font-weight: 800; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
}

.hp-bar {
  position: relative; height: 16px; border-radius: 99px; overflow: hidden;
  background: rgba(15,23,42,0.9); border: 1px solid rgba(255,255,255,0.1);
}
.hp-fill {
  position: absolute; inset: 0 auto 0 0; z-index: 2;
  background: linear-gradient(90deg, #ef4444, #f59e0b);
}
.hp-fill.low { background: linear-gradient(90deg, #991b1b, #ef4444); animation: hpBlink .6s infinite alternate; }
.hp-ghost {
  position: absolute; inset: 0 auto 0 0; z-index: 1; background: #fff; opacity: 0.85;
  width: var(--from); animation: hpDrain .6s .2s cubic-bezier(.4,0,.2,1) forwards;
}
.hp-text { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; font-size: 0.66rem; font-weight: 900; color: #fff; text-shadow: 0 1px 2px #000; }
@keyframes hpDrain { from { width: var(--from); } to { width: var(--to); } }
@keyframes hpBlink { from { opacity: 1; } to { opacity: 0.65; } }

.boss-zone { position: relative; z-index: 4; display: flex; flex-direction: column; align-items: center; padding: 10px 0 8px; }
.taunt-bubble {
  background: rgba(15,23,42,0.85); color: #cbd5e1; border: 1px solid rgba(255,255,255,0.1);
  font-weight: 700; font-size: 0.72rem; line-height: 1.45; padding: 5px 12px;
  border-radius: 99px; max-width: 94%; text-align: center; margin-top: 8px; position: relative;
}

.boss-figure {
  position: relative; width: 138px; height: 138px; border-radius: 24px; overflow: hidden;
  border: 2px solid rgba(239,68,68,0.65); box-shadow: 0 10px 28px rgba(0,0,0,0.6);
}
.boss-figure img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .3s; }
.boss-stage-1 img { filter: saturate(1.1) contrast(1.05); }
.boss-stage-2 { border-color: #ef4444; animation: bossHurt 1.1s ease-in-out infinite !important; }
.boss-stage-2 img { filter: sepia(0.35) hue-rotate(-25deg) saturate(1.7) brightness(0.85); }
@keyframes bossHurt {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(-2.5deg) translateY(2px); }
  75% { transform: rotate(2.5deg) translateY(-2px); }
}

.crack-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.crack-overlay path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.crack-glow path { stroke: #ef4444; stroke-width: 4; opacity: 0.7; filter: blur(1.5px); }
.crack-core path { stroke: #fff; stroke-width: 1.4; }
.weak-badge {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  background: rgba(15,23,42,0.92); color: #fca5a5; font-size: 0.64rem; font-weight: 800; padding: 2px 8px;
  border-radius: 99px; white-space: nowrap; border: 1px solid rgba(239,68,68,0.4);
}

/* KO shatter */
.boss-figure.ko { overflow: visible; border-color: transparent; box-shadow: none; }
.shard { position: absolute; width: 50%; height: 50%; background-size: 200% 200%; border-radius: 6px; }
.shard-tl { top: 0; left: 0; background-position: 0 0; animation: shardTL 1s cubic-bezier(.2,.7,.3,1) forwards; }
.shard-tr { top: 0; right: 0; background-position: 100% 0; animation: shardTR 1s cubic-bezier(.2,.7,.3,1) forwards; }
.shard-bl { bottom: 0; left: 0; background-position: 0 100%; animation: shardBL 1s cubic-bezier(.2,.7,.3,1) forwards; }
.shard-br { bottom: 0; right: 0; background-position: 100% 100%; animation: shardBR 1s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes shardTL { to { transform: translate(-90px, -80px) rotate(-40deg); opacity: 0; } }
@keyframes shardTR { to { transform: translate(90px, -90px) rotate(45deg); opacity: 0; } }
@keyframes shardBL { to { transform: translate(-80px, 110px) rotate(-60deg); opacity: 0; } }
@keyframes shardBR { to { transform: translate(100px, 100px) rotate(55deg); opacity: 0; } }

/* Hero chip */
.hero-chip {
  position: absolute; z-index: 6; bottom: 14px; right: 14px; width: 72px; height: 72px;
  border-radius: 18px; padding: 3px; background: var(--aura);
}
.hero-chip img { width: 100%; height: 100%; object-fit: cover; border-radius: 15px; display: block; }
.hero-lvl {
  position: absolute; top: -5px; left: -5px; width: 20px; height: 20px; border-radius: 99px;
  background: #fbbf24; color: #0f172a; font-weight: 900; font-size: 0.66rem; display: grid; place-items: center;
  border: 2px solid #0f172a;
}

.combo-badge {
  display: inline-block;
  font-weight: 900; font-size: 0.74rem; color: #fde047;
  background: rgba(124,45,18,0.85); border: 1px solid rgba(251,191,36,0.5);
  padding: 2px 10px; border-radius: 99px;
  animation: comboPop .35s cubic-bezier(.2,1.6,.4,1);
}
@keyframes comboPop { from { transform: scale(1.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.hit-toast {
  position: relative; z-index: 6; width: 100%; margin-bottom: 6px;
  background: rgba(16,185,129,0.18);
  border: 1px solid rgba(52,211,153,0.4); color: #a7f3d0; font-weight: 800; font-size: 0.72rem; line-height: 1.4;
  padding: 6px 10px; border-radius: 10px; text-align: center; animation: slideFadeUp .25s both;
}

/* Section titles */
.section-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  font-size: 0.84rem; font-weight: 900; color: #cbd5e1; margin: 2px 2px 8px; line-height: 1.4;
}
.section-hint { font-size: 0.7rem; color: #94a3b8; font-weight: 700; }

/* Strategy buttons (Clean Minimal Cards) */
.strat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.strat-btn {
  position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px;
  padding: 12px 8px; border-radius: 16px; cursor: pointer; font-family: inherit; color: #fff;
  background: rgba(17, 24, 39, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform .12s, border-color .2s;
}
.strat-btn:active { transform: scale(0.96); }
.strat-btn.crit { border-color: rgba(251, 191, 36, 0.45); background: rgba(30, 41, 59, 0.9); }
.sb-icon { font-size: 1.5rem; line-height: 1.1; }
.sb-label { font-size: 0.74rem; font-weight: 900; color: #f8fafc; text-align: center; line-height: 1.25; }
.sb-sub { font-size: 0.68rem; color: #94a3b8; text-align: center; line-height: 1.4; word-break: break-word; }
.sb-dmg { font-size: 0.68rem; font-weight: 900; background: rgba(255,255,255,0.07); color: #fde047; padding: 3px 8px; border-radius: 8px; margin-top: 2px; }

/* Card hand (2-Column Minimalist Grid — Breathable & Calm) */
.hand-row {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  padding: 2px 0 10px; width: 100%;
}
.hand-card {
  position: relative; min-width: 0; min-height: 126px;
  display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 6px;
  padding: 11px 10px; border-radius: 16px; cursor: pointer; font-family: inherit; color: #fff;
  background: rgba(17, 24, 39, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: transform .14s ease, border-color .14s ease;
}
.hand-card:active { transform: scale(0.97); }
.hand-card.add {
  min-height: 46px; flex-direction: row; align-items: center; justify-content: center; gap: 6px;
  background: rgba(15,23,42,0.6); border: 1px dashed rgba(255,255,255,0.14); padding: 9px 8px;
}
.hc-icon { font-size: 1.75rem; line-height: 1.1; }
.hand-card.add .hc-icon { font-size: 1.1rem; }
.hc-text { font-size: 0.78rem; font-weight: 800; text-align: center; line-height: 1.38; color: #f1f5f9; word-break: break-word; }
.hand-card.add .hc-text { font-size: 0.73rem; color: #cbd5e1; }
.hc-time { font-size: 0.64rem; color: #94a3b8; }
.hc-dmg {
  font-size: 0.64rem; font-weight: 800;
  background: rgba(255,255,255,0.06); color: #cbd5e1; padding: 2px 7px; border-radius: 8px;
}

/* Interactive iOS Dynamic Island / Push Notification Banner */
.pwa-push-banner {
  position: fixed;
  top: max(10px, calc(var(--safe-top, 66px) - 52px));
  right: 12px;
  left: 12px;
  max-width: 460px;
  margin: 0 auto;
  z-index: 220;
  background: rgba(11, 15, 28, 0.98);
  border: 1.5px solid rgba(251, 191, 36, 0.6);
  border-radius: 20px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: slideFadeUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Tutorial */
.tutorial-tip {
  background: #fbbf24; color: #0f172a; font-weight: 900; font-size: 0.85rem;
  padding: 8px 12px; border-radius: 12px; margin-bottom: 6px; text-align: center;
  animation: tipBounce 1s ease-in-out infinite;
}
@keyframes tipBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
.tutorial-pulse { border-radius: 20px; animation: tutPulse 1.4s infinite; }
@keyframes tutPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(251,191,36,0.6); } 50% { box-shadow: 0 0 0 8px rgba(251,191,36,0); } }

.tut-backdrop {
  position: fixed; inset: 0; z-index: 130; background: rgba(4,7,15,0.88); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.tut-card {
  width: 100%; max-width: 400px; text-align: center; padding: 22px 18px;
  border-radius: 26px; background: linear-gradient(170deg, #1e293b, #0b1020); border: 2px solid #ef4444;
}
.tut-boss { width: 130px; height: 130px; margin: -70px auto 10px; border-radius: 26px; overflow: hidden; border: 3px solid #ef4444; box-shadow: 0 0 40px rgba(239,68,68,0.6); }
.tut-boss img { width: 100%; height: 100%; object-fit: cover; }
.tut-kicker { font-size: 0.85rem; color: #fca5a5; font-weight: 800; }
.tut-title { font-size: 1.5rem; font-weight: 900; color: #fff; }
.tut-plain { font-size: 0.95rem; color: #e2e8f0; margin-bottom: 16px; }
.tut-equation { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.eq-a, .eq-b { font-size: 1.05rem; font-weight: 900; padding: 8px 12px; border-radius: 14px; }
.eq-a { background: rgba(56,189,248,0.18); color: #7dd3fc; }
.eq-b { background: rgba(239,68,68,0.22); color: #fca5a5; }
.eq-arrow { font-size: 1.4rem; font-weight: 900; color: #fbbf24; }
.tut-line { font-size: 0.88rem; color: #cbd5e1; margin-bottom: 18px; }
.tut-cta {
  width: 100%; padding: 15px; border: none; border-radius: 16px; font-family: inherit; font-weight: 900;
  font-size: 1.05rem; background: linear-gradient(135deg, #ef4444, #f59e0b); color: #fff; cursor: pointer;
}

/* Action sheet + hold-to-fire */
.sheet-backdrop { position: fixed; inset: 0; z-index: 140; background: rgba(4,7,15,0.7); backdrop-filter: blur(4px); animation: fadeIn .2s both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.action-sheet {
  position: fixed; z-index: 141; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; padding: 10px 20px calc(18px + var(--safe-bottom)); text-align: center;
  border-radius: 28px 28px 0 0; background: linear-gradient(180deg, #1e293b, #0b1020);
  border-top: 3px solid var(--c); box-shadow: 0 -20px 50px rgba(0,0,0,0.7);
  animation: sheetUp .32s cubic-bezier(.16,1,.3,1) both;
}
@keyframes sheetUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.sheet-handle { width: 44px; height: 5px; border-radius: 99px; background: rgba(255,255,255,0.25); margin: 0 auto 10px; }
.sheet-icon { font-size: 4rem; line-height: 1.1; filter: drop-shadow(0 0 20px var(--c)); animation: scalePopIn .45s both, floatIdle 2.4s .45s ease-in-out infinite; }
.sheet-label { font-size: 0.8rem; color: #94a3b8; font-weight: 700; margin-top: 4px; }
.sheet-instruction { font-size: 1.35rem; font-weight: 900; color: #fff; margin: 6px 0 4px; line-height: 1.5; }
.sheet-dmg { display: inline-block; font-size: 0.8rem; font-weight: 900; color: #fecaca; background: rgba(239,68,68,0.2); padding: 3px 12px; border-radius: 99px; margin-bottom: 16px; }

.hold-btn {
  position: relative; width: 150px; height: 150px; margin: 0 auto 12px; display: block;
  border: none; border-radius: 99px; cursor: pointer; font-family: inherit; color: #0f172a;
  background: radial-gradient(circle at 50% 35%, #fff 0%, var(--c) 55%, color-mix(in srgb, var(--c) 60%, #000) 100%);
  box-shadow: 0 0 30px color-mix(in srgb, var(--c) 60%, transparent);
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: transform .15s;
}
.hold-btn svg { position: absolute; inset: -10px; width: calc(100% + 20px); height: calc(100% + 20px); transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.12); stroke-width: 6; }
.ring-fg { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; transition: stroke-dashoffset .2s ease-out; filter: drop-shadow(0 0 6px #fff); }
.hold-btn.charging { transform: scale(1.08); animation: chargeShake .12s linear infinite; }
.hold-btn.charging .ring-fg { stroke-dashoffset: 0; transition: stroke-dashoffset 1.1s linear; }
@keyframes chargeShake { 0%,100% { translate: 0 0; } 25% { translate: -1.5px 1px; } 75% { translate: 1.5px -1px; } }
.hold-inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.hold-main { font-size: 1.05rem; font-weight: 900; }
.hold-sub { font-size: 0.75rem; font-weight: 800; opacity: 0.75; }

.sheet-why { font-size: 0.82rem; color: #94a3b8; text-align: right; }
.sheet-why summary { cursor: pointer; text-align: center; color: #7dd3fc; font-weight: 800; list-style: none; }
.sheet-why p { margin-top: 8px; background: rgba(7,10,20,0.7); padding: 10px 12px; border-radius: 12px; color: #e2e8f0; line-height: 1.7; }

/* Onboarding demo (metaphor) */
.demo-box { position: relative; height: 210px; border-radius: 22px; overflow: hidden; border: 2px solid rgba(239,68,68,0.5); background: #0b1020; margin-bottom: 16px; }
.demo-boss { position: absolute; top: 34px; left: 22px; width: 130px; height: 130px; border-radius: 20px; overflow: hidden; border: 3px solid #ef4444; animation: demoHit 2.4s infinite; }
.demo-boss img { width: 100%; height: 100%; object-fit: cover; }
.demo-hp { position: absolute; top: 12px; left: 22px; width: 130px; height: 12px; border-radius: 99px; background: #1e293b; overflow: hidden; }
.demo-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #dc2626, #fbbf24); animation: demoHp 2.4s infinite; }
.demo-label { position: absolute; bottom: 10px; left: 22px; width: 130px; text-align: center; font-size: 0.75rem; font-weight: 800; color: #fca5a5; }
.demo-hero { position: absolute; bottom: 30px; right: 22px; text-align: center; }
.demo-hero .face { font-size: 2.6rem; }
.demo-hero .lbl { font-size: 0.75rem; font-weight: 800; color: #7dd3fc; }
.demo-shot { position: absolute; bottom: 70px; right: 60px; font-size: 2rem; animation: demoFly 2.4s infinite; }
.demo-boom { position: absolute; top: 70px; left: 70px; font-size: 2.6rem; opacity: 0; animation: demoBoom 2.4s infinite; }
@keyframes demoFly { 0%, 15% { transform: translate(0,0) scale(1); opacity: 0; } 20% { opacity: 1; } 50% { transform: translate(-200px,-40px) scale(1.2); opacity: 1; } 52%, 100% { opacity: 0; } }
@keyframes demoBoom { 0%, 49% { opacity: 0; transform: scale(.3); } 55% { opacity: 1; transform: scale(1.4); } 75%, 100% { opacity: 0; transform: scale(1); } }
@keyframes demoHit { 0%, 49% { filter: none; transform: none; } 52% { filter: brightness(2.5) saturate(0); transform: translateX(-8px) rotate(-5deg); } 60%, 100% { filter: none; transform: none; } }
@keyframes demoHp { 0%, 49% { width: 100%; } 60%, 100% { width: 55%; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ───────── میدان نبرد مینیمال (فاز ۱) ─────────
   ۴ اندازه‌ی فونت، ۳ رنگ متن، یک رنگ تأکید.
   حرکت فقط در لحظه‌ی نگه داشتن و ضربه؛ بقیه‌ی صفحه ساکت است. */
:root {
  --fs-xs: 13px;
  --fs-sm: 15px;
  --fs-md: 18px;
  --fs-xl: 28px;
  --tx-1: #f1f5f9;
  --tx-2: #94a3b8;
  --tx-3: #64748b;
  --accent: #fbbf24;
  --surface: #0f1524;
  --line: rgba(255, 255, 255, 0.08);
}

/* هدر تک‌ردیفه */
.hd {
  position: sticky; top: 0; z-index: 45;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: rgba(7, 10, 20, 0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.hd-streak { font-size: var(--fs-sm); font-weight: 800; color: var(--tx-1); justify-self: start; }
.hd-streak.is-zero { opacity: 0.4; }
.hd-menu {
  justify-self: end; width: 44px; height: 44px; border: none; background: none;
  color: var(--tx-2); font-size: var(--fs-md); font-weight: 800; cursor: pointer;
}
.hd-today {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 99px; background: var(--surface);
  color: var(--tx-1); font-family: inherit; font-size: var(--fs-xs); font-weight: 800; cursor: pointer;
}
.hd-group { display: flex; gap: 4px; }
.hd-dot { width: 8px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); }
.hd-dot.on { background: var(--accent); }
.hd-today.is-ready { background: var(--accent); border-color: var(--accent); color: #111827; }
.hd-today.is-won .hd-dot { background: var(--accent); }

/* صحنه: فقط هیولا */
.ar { display: flex; flex-direction: column; gap: 18px; padding: 20px 16px 24px; }
.ar-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ar-boss-fig {
  position: relative; width: 176px; height: 176px; border-radius: 28px; overflow: hidden;
  background: var(--surface);
  animation: arBreathe 4.2s ease-in-out infinite;
}
.ar-boss-fig img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .4s; }
.ar-boss-fig.stage-1 img { filter: saturate(0.85) brightness(0.92); }
.ar-boss-fig.stage-2 img { filter: saturate(0.7) brightness(0.8) sepia(0.25) hue-rotate(-20deg); }
.ar-boss-fig.is-ko { overflow: visible; background: none; animation: none; }
@keyframes arBreathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-4px) scale(1.012); } }

.ar-boss-name {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: none; background: none; color: inherit; font-family: inherit; cursor: pointer; min-height: 44px;
}
.ar-title { font-size: var(--fs-xl); font-weight: 800; color: var(--tx-1); line-height: 1.3; text-align: center; }
.ar-sub { font-size: var(--fs-xs); font-weight: 600; color: var(--tx-2); }
.ar-info { color: var(--tx-3); }

.ar-hp { position: relative; width: 100%; max-width: 260px; height: 6px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
.ar-hp .hp-ghost { border-radius: 99px; inset: 0 0 0 auto; }
.ar-hp-fill { position: absolute; inset: 0 0 0 auto; z-index: 2; border-radius: 99px; background: #ef4444; transition: width .5s cubic-bezier(.4, 0, .2, 1); }

.ar-hint { text-align: center; font-size: var(--fs-xs); font-weight: 600; color: var(--accent); margin-bottom: -8px; }

/* دست: ۳ کارت */
.ar-hand { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ar-card {
  position: relative; overflow: hidden; min-height: 132px; padding: 16px 8px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; text-align: center;
  touch-action: pan-y; -webkit-touch-callout: none; user-select: none;
  transition: transform .15s ease;
}
.ar-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); opacity: 0.8;
}
.ar-card-icon { position: relative; z-index: 1; font-size: 34px; line-height: 1; }
.ar-card-text { position: relative; z-index: 1; font-size: var(--fs-xs); font-weight: 600; color: var(--tx-1); line-height: 1.5; }
.ar-card-check {
  position: absolute; top: 10px; left: 10px; z-index: 1; width: 20px; height: 20px; border-radius: 99px;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #111827; background: var(--accent);
}
.ar-card.is-done { border-color: rgba(251, 191, 36, 0.35); }
.ar-card:focus-visible, .sh-hold:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* پر شدن هنگام نگه داشتن (۱.۱ ثانیه) */
.ar-card-fill, .sh-hold-fill {
  position: absolute; inset: 0; z-index: 0; transform: scaleY(0); transform-origin: bottom;
  background: rgba(251, 191, 36, 0.22);
}
.is-holding .ar-card-fill, .is-holding .sh-hold-fill { transform: scaleY(1); transition: transform 1.1s linear; }
.ar-card.is-holding { transform: scale(0.97); }

/* دکمه‌ی مقابله؛ با هر کارت امروز کمی پرتر می‌شود */
.ar-battle {
  position: relative; overflow: hidden; min-height: 52px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--tx-1); font-family: inherit; font-size: var(--fs-sm); font-weight: 800; cursor: pointer;
}
.ar-battle-fill {
  position: absolute; inset: 0 0 0 auto; width: calc(var(--charge, 0) * 100%);
  background: rgba(251, 191, 36, 0.12); transition: width .5s ease;
}
.ar-battle-label { position: relative; }
.ar-battle.is-charged { border-color: var(--accent); }
.ar-battle.is-charged .ar-battle-fill { background: var(--accent); }
.ar-battle.is-charged .ar-battle-label { color: #111827; }
.ar-battle.is-done { border-color: var(--line); color: var(--tx-2); }
.ar-battle.is-done .ar-battle-fill { background: rgba(255, 255, 255, 0.04); }
.ar-battle.is-done .ar-battle-label { color: var(--tx-2); }

/* برگه‌ی پایینی */
.action-sheet.sh {
  background: #111827; border-top: 1px solid var(--line); box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column; gap: 14px; text-align: center;
  max-height: 86dvh; overflow-y: auto;
}
.sh-icon { font-size: 48px; line-height: 1.1; }
.sh-title { font-size: var(--fs-md); font-weight: 800; color: var(--tx-1); }
.sh-title-start { text-align: right; }
.sh-text { font-size: var(--fs-sm); font-weight: 600; color: var(--tx-2); line-height: 1.7; }
.sh-text:empty { display: none; }
.sh-note { font-size: var(--fs-xs); color: var(--tx-3); }
.sh-hold {
  position: relative; overflow: hidden; min-height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; padding: 0 16px;
  background: var(--surface); border: 1px solid rgba(251, 191, 36, 0.4);
  cursor: pointer; touch-action: pan-y; -webkit-touch-callout: none; user-select: none;
}
.sh-hold-label { position: relative; z-index: 1; font-size: var(--fs-sm); font-weight: 800; color: var(--tx-1); }
.sh-list { display: flex; flex-direction: column; gap: 10px; }
.sh-row { justify-content: flex-start; text-align: right; }
.sh-why { font-size: var(--fs-xs); color: var(--tx-2); text-align: right; }
.sh-why summary { cursor: pointer; text-align: center; font-weight: 600; color: var(--tx-2); list-style: none; min-height: 32px; }
.sh-why p { margin-top: 8px; line-height: 1.8; }
.sh-link, .sh-step-go {
  border: none; background: none; font-family: inherit; font-size: var(--fs-xs); font-weight: 800;
  color: var(--accent); cursor: pointer; min-height: 40px;
}
.sh-primary {
  min-height: 52px; border: none; border-radius: 16px; background: var(--accent); color: #111827;
  font-family: inherit; font-size: var(--fs-sm); font-weight: 800; cursor: pointer;
}
.sh-steps { display: flex; flex-direction: column; gap: 8px; text-align: right; }
.sh-step { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 14px; background: var(--surface); }
.sh-step-mark {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 99px; border: 1.5px solid var(--tx-3);
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #111827;
}
.sh-step.is-done .sh-step-mark { background: var(--accent); border-color: var(--accent); }
.sh-step-label { flex: 1; font-size: var(--fs-sm); font-weight: 600; color: var(--tx-1); }
.sh-step.is-done .sh-step-label { color: var(--tx-2); }
.sh-bosses { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.sh-bosses::-webkit-scrollbar { display: none; }
.sh-boss {
  flex: 0 0 auto; width: 56px; height: 56px; padding: 0; border-radius: 14px; overflow: hidden;
  border: 2px solid transparent; background: var(--surface); cursor: pointer;
}
.sh-boss img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sh-boss.is-active { border-color: var(--accent); }
.sh-boss-add { border: 1px dashed var(--tx-3); color: var(--tx-2); font-size: var(--fs-md); font-family: inherit; }
.sh-menu { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.sh-menu button {
  min-height: 52px; border: none; border-bottom: 1px solid var(--line); background: none; text-align: right;
  font-family: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--tx-1); cursor: pointer;
}
.sh-menu button:last-child { border-bottom: none; }

/* ───────── فاز ۲: ۳ تب ───────── */
.nv {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 50;
  width: 100%; max-width: 520px; display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 6px 12px calc(env(safe-area-inset-bottom, 0px) + 8px);
  background: rgba(7, 10, 20, 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.nv-tab {
  position: relative; min-height: 48px; border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--tx-2);
}
.nv-tab.is-on { color: var(--tx-1); font-weight: 800; }
.nv-tab.is-on::after {
  content: ''; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 3px; border-radius: 99px; background: var(--accent);
}
.game-shell { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

.pg { display: flex; flex-direction: column; gap: 16px; padding: 20px 16px 24px; }
.pg-title { font-size: var(--fs-md); font-weight: 800; color: var(--tx-1); }
.pg-note { font-size: var(--fs-xs); color: var(--tx-3); text-align: center; }
.pg-note-start { text-align: right; line-height: 1.8; color: var(--tx-2); }

/* مأموریت */
.q-list { display: flex; flex-direction: column; gap: 10px; }
.q-row {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 12px 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; touch-action: pan-y; -webkit-touch-callout: none; user-select: none;
}
.q-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.q-mark {
  position: relative; z-index: 1; flex-shrink: 0; width: 24px; height: 24px; border-radius: 99px;
  border: 1.5px solid var(--tx-3); display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: #111827;
}
.q-title { position: relative; z-index: 1; flex: 1; font-size: var(--fs-sm); font-weight: 600; color: var(--tx-1); line-height: 1.6; }
.q-row.is-done { cursor: default; }
.q-row.is-done .q-mark { background: var(--accent); border-color: var(--accent); }
.q-row.is-done .q-title { color: var(--tx-2); }
.q-add { cursor: default; padding: 6px 6px 6px 6px; }
.q-add input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 10px; border: none; background: none;
  font-family: inherit; font-size: var(--fs-sm); color: var(--tx-1); user-select: text;
}
.q-add input::placeholder { color: var(--tx-3); }
.q-add input:focus { outline: none; }
.q-add button, .q-chip {
  min-height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: none;
  font-family: inherit; font-size: var(--fs-xs); font-weight: 800; color: var(--tx-1); cursor: pointer;
}
.q-timer {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 8px; padding-inline-start: 14px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
}
.q-timer-label { flex: 1; font-size: var(--fs-sm); font-weight: 600; color: var(--tx-2); }
.q-timer-clock { flex: 1; font-size: var(--fs-md); font-weight: 800; color: var(--tx-1); font-variant-numeric: tabular-nums; }
.q-timer.is-active { border-color: rgba(251, 191, 36, 0.4); }
.q-chip-main { background: var(--accent); border-color: var(--accent); color: #111827; }

/* من */
.me-hero { display: flex; align-items: center; gap: 14px; }
.me-avatar { width: 64px; height: 64px; flex-shrink: 0; padding: 0; border: none; border-radius: 18px; overflow: hidden; cursor: pointer; background: var(--surface); }
.me-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-hero-text { flex: 1; min-width: 0; }
.me-name { font-size: var(--fs-md); font-weight: 800; color: var(--tx-1); }
.me-meta { font-size: var(--fs-xs); font-weight: 600; color: var(--tx-2); }
.me-label { font-size: var(--fs-xs); font-weight: 600; color: var(--tx-2); }
.me-link, .me-info {
  min-height: 40px; min-width: 40px; border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: var(--fs-xs); font-weight: 800; color: var(--accent);
}
.me-info { color: var(--tx-3); font-size: var(--fs-sm); }
.me-goal { display: flex; flex-direction: column; gap: 6px; }
.me-goal-input {
  min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  font-family: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--tx-1); user-select: text;
}
.me-goal-input:focus { outline: none; border-color: rgba(251, 191, 36, 0.5); }
.me-block {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); text-align: right; font-family: inherit; color: inherit;
}
.me-path { cursor: pointer; width: 100%; }
.me-block-head { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.me-stat { display: grid; grid-template-columns: 64px 1fr 36px; align-items: center; gap: 10px; }
.me-stat-name { font-size: var(--fs-xs); font-weight: 600; color: var(--tx-1); }
.me-stat-val { font-size: var(--fs-xs); font-weight: 600; color: var(--tx-2); text-align: left; font-variant-numeric: tabular-nums; }
.me-stat-bar { position: relative; display: block; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.me-stat-bar i { position: absolute; inset: 0 0 0 auto; border-radius: 99px; background: var(--c, var(--accent)); }
.me-menu { border-top: none; }
.me-menu button { display: flex; align-items: center; gap: 8px; }
.me-dot { display: inline-block; width: 7px; height: 7px; border-radius: 99px; background: var(--accent); }

.me-sub-head { display: flex; align-items: center; gap: 8px; }
.me-back { width: 40px; height: 40px; border: none; background: none; color: var(--tx-2); font-size: var(--fs-md); cursor: pointer; }
.me-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.me-chips::-webkit-scrollbar { display: none; }
.me-chip {
  flex: 0 0 auto; min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: none;
  font-family: inherit; font-size: var(--fs-xs); font-weight: 600; color: var(--tx-2); cursor: pointer;
}
.me-chip.is-on { border-color: var(--accent); color: var(--tx-1); }
.me-list { display: flex; flex-direction: column; gap: 8px; }
.me-row { display: flex; align-items: center; gap: 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.me-card { border-right: 3px solid var(--c); }
.me-row-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 14px;
  border: none; background: none; cursor: pointer; font-family: inherit; text-align: right;
}
.me-card-icon { font-size: 24px; }
.me-row-label { flex: 1; font-size: var(--fs-sm); font-weight: 600; color: var(--tx-1); }
.me-tag { font-size: var(--fs-xs); font-weight: 600; color: var(--accent); }
.me-toggle {
  width: 44px; height: 44px; margin-left: 6px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--line); background: none;
  font-family: inherit; font-size: var(--fs-sm); font-weight: 800; color: var(--tx-2); cursor: pointer;
}
.me-toggle.is-on { background: var(--accent); border-color: var(--accent); color: #111827; }
.me-add {
  min-height: 52px; border-radius: 16px; border: 1px dashed var(--tx-3); background: none;
  font-family: inherit; font-size: var(--fs-sm); font-weight: 800; color: var(--tx-1); cursor: pointer;
}
.me-add-quiet { border: none; color: var(--tx-2); font-weight: 600; min-height: 40px; }
.me-heroes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.me-hero-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 16px;
  border: 2px solid transparent; background: var(--surface); cursor: pointer; font-family: inherit;
  font-size: var(--fs-xs); font-weight: 600; color: var(--tx-1);
}
.me-hero-opt img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.me-hero-opt.is-on { border-color: var(--accent); }
.me-comic { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.me-panel { position: relative; margin: 0; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--surface); }
.me-panel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-panel.is-hit img { filter: saturate(0.6) sepia(0.3) hue-rotate(-20deg); }
.me-panel figcaption {
  position: absolute; inset: auto 0 0 0; padding: 28px 10px 10px;
  background: linear-gradient(transparent, rgba(7, 10, 20, 0.92));
  font-size: var(--fs-xs); font-weight: 600; color: var(--tx-1); line-height: 1.6;
}
.me-rules { display: flex; flex-direction: column; gap: 10px; padding-right: 20px; color: var(--tx-3); font-size: var(--fs-xs); }
.me-rules li { display: flex; flex-direction: column; gap: 2px; }
.me-rules strong { font-size: var(--fs-sm); font-weight: 800; color: var(--tx-1); }
.me-rules span { font-size: var(--fs-xs); color: var(--tx-2); line-height: 1.7; }

/* ───────── فاز ۳: پنجره‌های مشترک ───────── */
.md-wrap {
  position: fixed; inset: 0; z-index: 160; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(4, 7, 15, 0.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .2s both;
}
.md {
  width: 100%; max-width: 420px; max-height: calc(100dvh - 32px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px; padding: 20px;
  border-radius: 24px; background: #111827; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  color: var(--tx-1); text-align: right;
}
.md-center { text-align: center; align-items: center; }
.md-head { display: flex; align-items: center; gap: 12px; }
.md-head-text { flex: 1; min-width: 0; }
.md-avatar { width: 44px; height: 44px; border-radius: 14px; object-fit: cover; }
.md-title { font-size: var(--fs-md); font-weight: 800; color: var(--tx-1); line-height: 1.5; }
.md-sub { font-size: var(--fs-xs); font-weight: 600; color: var(--tx-2); }
.md-close {
  width: 40px; height: 40px; flex-shrink: 0; border: none; border-radius: 12px; background: none;
  color: var(--tx-2); font-size: var(--fs-sm); cursor: pointer;
}
.md-text { font-size: var(--fs-sm); font-weight: 600; color: var(--tx-2); line-height: 1.8; white-space: pre-line; }
.md-strong { font-size: var(--fs-sm); font-weight: 800; color: var(--tx-1); line-height: 1.7; }
.md-icon { font-size: 48px; line-height: 1.1; }
.md-big { font-size: var(--fs-xl); font-weight: 800; color: var(--accent); line-height: 1.3; }
.md-box { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 16px; background: var(--surface); }
.md-list { display: flex; flex-direction: column; gap: 8px; padding-right: 18px; font-size: var(--fs-sm); color: var(--tx-2); line-height: 1.7; }
.md-list b { color: var(--tx-1); }
.md-primary, .md-secondary {
  width: 100%; min-height: 52px; border-radius: 16px; font-family: inherit; font-size: var(--fs-sm); font-weight: 800; cursor: pointer;
}
.md-primary { border: none; background: var(--accent); color: #111827; }
.md-primary:disabled { opacity: 0.5; cursor: default; }
.md-secondary { border: 1px solid var(--line); background: none; color: var(--tx-1); }
.md-link {
  min-height: 40px; border: none; background: none; font-family: inherit; font-size: var(--fs-xs); font-weight: 800;
  color: var(--accent); cursor: pointer;
}
.md-quiet { color: var(--tx-2); font-weight: 600; }
.md-seg, .md-steps { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: var(--surface); }
.md-seg button, .md-steps button {
  flex: 1; min-height: 40px; padding: 0 8px; border: none; border-radius: 10px; background: none;
  font-family: inherit; font-size: var(--fs-xs); font-weight: 600; color: var(--tx-2); cursor: pointer; white-space: nowrap;
}
.md-steps { overflow-x: auto; scrollbar-width: none; }
.md-steps::-webkit-scrollbar { display: none; }
.md-steps button { flex: 0 0 auto; }
.md-seg button.is-on, .md-steps button.is-on { background: #1f2937; color: var(--tx-1); font-weight: 800; }
.md-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.md-opt {
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); text-align: right;
  font-family: inherit; font-size: var(--fs-xs); font-weight: 600; color: var(--tx-1); cursor: pointer;
}
.md-opt.is-on { border-color: var(--accent); }
.md-field { display: flex; flex-direction: column; gap: 6px; }
.md-label { font-size: var(--fs-xs); font-weight: 600; color: var(--tx-2); }
.md-input {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  font-family: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--tx-1); user-select: text;
}
.md-input:focus { outline: none; border-color: rgba(251, 191, 36, 0.5); }
.md-input::placeholder { color: var(--tx-3); }
.md-icons { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.md-icons::-webkit-scrollbar { display: none; }
.md-icons button {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  font-size: 22px; cursor: pointer;
}
.md-icons button.is-on { border-color: var(--accent); }
.md-error { font-size: var(--fs-xs); font-weight: 600; color: #fca5a5; }
.md-ok { font-size: var(--fs-xs); font-weight: 600; color: var(--accent); }
.md-steps-list { display: flex; flex-direction: column; gap: 8px; counter-reset: s; }
.md-steps-list li { display: flex; gap: 10px; font-size: var(--fs-sm); color: var(--tx-2); line-height: 1.7; list-style: none; }
.md-steps-list li::before {
  counter-increment: s; content: counter(s, persian); flex-shrink: 0; width: 24px; height: 24px; border-radius: 99px;
  display: grid; place-items: center; background: #1f2937; color: var(--tx-1); font-size: var(--fs-xs); font-weight: 800;
}
.md-reward { color: var(--accent); }
.sg-row { padding: 0 14px; min-height: 56px; gap: 12px; }
.sg-row:not(.is-reached) { opacity: 0.55; }
.sg-day {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 99px; display: grid; place-items: center;
  background: #1f2937; font-size: var(--fs-xs); font-weight: 800; color: var(--tx-1);
}
.sg-row.is-reached .sg-day { background: var(--accent); color: #111827; }
.sg-done { font-size: var(--fs-sm); font-weight: 800; color: var(--accent); padding: 0 8px; }
.md-icons .cb-img { padding: 0; overflow: hidden; }
.md-icons .cb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.md-grow { flex: 1; }
.md-a { display: grid; place-items: center; text-decoration: none; }
.md-input[dir="ltr"] { text-align: left; }
.st-preview { position: relative; width: 200px; height: 200px; margin: 0 auto; border-radius: 24px; overflow: hidden; background: var(--surface); }
.st-preview img, .st-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-preview video { transform: scaleX(-1); }
.st-guide { position: absolute; inset: 22px 40px 50px; border: 2px dashed rgba(251, 191, 36, 0.7); border-radius: 50%; }
.md-icons button { color: var(--tx-2); }
.md-icons button:not(.cb-img):not([data-icon]) { font-size: var(--fs-md); font-family: inherit; }

/* ───────── فاز ۴: آنبوردینگ ───────── */
.ob {
  min-height: 100dvh; display: flex; flex-direction: column; gap: 20px;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px calc(env(safe-area-inset-bottom, 0px) + 24px);
}
.ob-top { display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.ob-dots { display: flex; gap: 6px; }
.ob-dots i { width: 8px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); }
.ob-dots i.on { background: var(--accent); }
.ob-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.ob-start { justify-content: flex-start; }
.ob-title { font-size: var(--fs-xl); font-weight: 800; color: var(--tx-1); line-height: 1.4; }
.ob-start .ob-title { font-size: var(--fs-md); }
.ob-fig { width: 200px; height: 200px; }
.ob-boss-name { font-size: var(--fs-md); }
.ob-grid { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ob-pick {
  display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 12px; border-radius: 18px;
  border: 2px solid transparent; background: var(--surface); cursor: pointer;
  font-family: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--tx-1); line-height: 1.5;
}
.ob-pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.ob-pick.is-on { border-color: var(--accent); }
.ob-card { min-height: 88px; flex-direction: row; gap: 14px; }
.ob-card { border-color: rgba(251, 191, 36, 0.4); }

/* ───────── فاز ۵: سپر و یادآوری ───────── */
.sg-url {
  padding: 12px 14px; border-radius: 12px; background: #0b1020; color: var(--tx-1);
  font-size: var(--fs-xs); font-weight: 600; word-break: break-all; text-align: left; user-select: text;
}
.sh-breath {
  width: 140px; height: 140px; border-radius: 99px; border: 2px solid rgba(251, 191, 36, 0.6);
  animation: shBreath 12s ease-in-out infinite;
}
@keyframes shBreath { 0%, 100% { transform: scale(0.7); } 33% { transform: scale(1); } }
