/* ═══ app.css — ادغام theme + components (فاز ۱۴: یک رفت‌وبرگشت شبکه کمتر برای اولین رنگ — Lighthouse) ═══ */
/* ============================================================
   AlphabetPlay — theme.css
   تم پاستلی کودکانه با CSS Variables (سند 06، بخش 2)
   بدون build الزامی — این فایل معادل theme.scss در نسخه‌ی build دار
   ============================================================ */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --c-bg: #FFF7EC;
  --c-bg-2: #FFEEDB;
  --c-card: #FFFFFF;
  --c-ink: #3A2E39;
  --c-ink-soft: #6E5F69; /* فاز ۱۳: تیره‌تر از #8A7A85 — کنتراست ≥4.5 روی کارت سفید (Lighthouse a11y) */
  --c-primary: #FF7B54;   /* مرجانی — برند */
  --c-primary-d: #E05A34;
  --c-teal: #4ECDC4;      --c-teal-d: #2FA89F;
  --c-yellow: #FFD166;    --c-yellow-d: #E8B84B;
  --c-purple: #9B5DE5;    --c-purple-d: #7C43BD;
  --c-green: #06D6A0;     --c-green-d: #05A97E;
  --c-blue: #4D96FF;
  --c-locked: #CFC5CE;
  --c-primary-ink: #C24A1D; /* موج ۲ a11y: مرجانیِ تیره‌تر برای متن روی سفید/کرم — کنتراست ≥4.5 */
  --radius: 1.4rem;
  --radius-sm: 0.9rem;
  --shadow-pop: 0 5px 0 rgba(58, 46, 57, 0.16);
  --font-main: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
}

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

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: var(--font-main);
  color: var(--c-ink);
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 209, 102, 0.28) 0, transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(78, 205, 196, 0.25) 0, transparent 38%),
    radial-gradient(circle at 50% 100%, rgba(155, 93, 229, 0.16) 0, transparent 46%),
    var(--c-bg);
  background-attachment: fixed;
  user-select: none;
  touch-action: manipulation; /* حذف delay 300ms دابل‌تپ */
  overflow-x: hidden;
}

.app-root {
  max-width: 640px;
  margin-inline: auto;
  min-height: 100dvh;
  padding: 10px 14px 28px;
  position: relative;
}

/* ---------------- دکمه‌های کودکانه (استیکری) ---------------- */
.btn-kid {
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--c-ink); /* موج ۲ a11y: جوهری روی زمینه‌های روشن (coral 5.0 · teal 6.7 · green 6.8 · yellow 8.9) */
  border: none;
  border-radius: 1.6rem;
  padding: 0.85rem 1.7rem;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  min-height: 48px;
}
.btn-kid:active { transform: translateY(4px); box-shadow: none; }
.btn-kid.coral  { background: var(--c-primary); }
.btn-kid.teal   { background: var(--c-teal); }
.btn-kid.yellow { background: var(--c-yellow); color: var(--c-ink); }
.btn-kid.purple { background: var(--c-purple-d); color: #fff; } /* موج ۲ a11y: سفید روی purple-d=6.2 */
.btn-kid.green  { background: var(--c-green); }
.btn-kid.big    { font-size: 1.35rem; padding: 1.05rem 2.2rem; border-radius: 2rem; }
.btn-kid.small  { font-size: 0.9rem; padding: 0.55rem 1.1rem; min-height: 44px; } /* موج ۲ a11y: هدف لمسی ≥44px */

.icon-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--c-card);
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.12s;
}
.icon-btn:active { transform: scale(0.92); }

.link-btn {
  background: none; border: none;
  color: var(--c-ink-soft);
  font-family: inherit; font-size: 0.95rem;
  text-decoration: underline dotted;
  cursor: pointer; margin-top: 10px;
  min-height: 44px; /* موج ۲ a11y: هدف لمسی */
  display: inline-flex; align-items: center; justify-content: center;
  padding-inline: 10px;
}

/* ---------------- چیپ‌ها و هدر ---------------- */
.kid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 2px 14px;
  flex-wrap: wrap;
}
.app-brand { font-weight: 700; font-size: 1.15rem; }
.game-title { font-weight: 700; font-size: 1.05rem; margin: 0; } /* موج ۲ a11y: h1 بدون حاشیه‌ی پیش‌فرض */
.header-actions { display: flex; align-items: center; gap: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--c-card);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.95rem;
  box-shadow: 0 3px 0 rgba(58, 46, 57, 0.1);
}
.avatar-chip { border: 3px solid var(--avatar-color, var(--c-teal)); }
.avatar-emoji { font-size: 1.3rem; }
.star-chip { font-weight: 700; }

.screen { display: flex; flex-direction: column; gap: 14px; }

/* ---------------- فرم‌ها ---------------- */
.field-label { font-weight: 700; margin: 12px 0 8px; color: var(--c-ink); }
.kid-input {
  font-family: inherit;
  font-size: 1.15rem;
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 3px solid #ffe1c4;
  background: #fff;
  width: 100%;
  max-width: 320px;
  color: var(--c-ink);
  text-align: start;
}
.kid-input:focus { outline: none; border-color: var(--c-primary); }

.pick-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.pick-item {
  width: 60px; height: 60px;
  border-radius: 1.1rem;
  border: 3px solid transparent;
  background: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  display: flex; align-items: center; justify-content: center;
}
.pick-item.sel { border-color: var(--c-primary); background: #FFF1E8; }
.pick-item.color { background: var(--c); }
.pick-item.color.sel { border-color: var(--c-ink); transform: scale(1.1); }

/* ---------------- کاهش حرکت (دسترس‌پذیری) ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}

/* ---------------- صفحه‌ی خطای بوت ---------------- */
.boot-error { text-align: center; padding-top: 40px; }
.boot-error div { font-size: 4rem; }
.boot-error pre {
  text-align: start; direction: ltr;
  background: #fff; padding: 12px; border-radius: 12px;
  overflow: auto; font-size: 0.8rem;
}

/* ============================================================
   AlphabetPlay — components.css
   کامپوننت‌های بازی و صفحات (همه با CSS Logical Properties — RTL/LTR آزاد)
   ============================================================ */

/* ---------------- صفحه‌ی خانه ---------------- */
.home-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 16px; text-align: center; }
.home-hello { font-size: 1.7rem; margin: 6px 0 0; }
.tagline { color: var(--c-ink-soft); margin: 0; }
.avatar-badge {
  width: 84px; height: 84px; border-radius: 50%;
  background: #fff; border: 4px solid var(--avatar-color, var(--c-teal));
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-pop);
}
.avatar-badge .avatar-emoji { font-size: 2.6rem; }
.home-hero .btn-kid.big { margin-top: 12px; min-width: 230px; }
.mascot { display: block; }

/* ---------------- نوار هدف بازی ---------------- */
.prompt-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--c-card);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow-pop);
}
.prompt-bar.small { padding: 8px 12px; }
.prompt-mascot { flex-shrink: 0; line-height: 0; }
.prompt-info { flex: 1; min-width: 0; }
.prompt-label { font-size: 0.95rem; color: var(--c-ink-soft); font-weight: 700; }
.prompt-target {
  font-size: 2.2rem; font-weight: 700; color: var(--c-primary);
  line-height: 1.25;
}

/* ---------------- 🎈 حباب حروف ---------------- */
.bubbles {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 20px;
  min-height: 46vh;
  padding: 12px;
}
.bubble {
  border-radius: 50%;
  border: 5px solid #fff;
  background: radial-gradient(circle at 32% 28%, #ffffffcc 0 18%, var(--b, var(--c-teal)) 19%);
  color: var(--c-ink); /* موج ۲ a11y: جوهری روی رنگ‌های روشن حباب */
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(58, 46, 57, 0.22);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s;
}
.bubble:active { transform: scale(0.94); }
.bubble span { font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,.18); }
.bubble.xl { width: 150px; height: 150px; font-size: 4.2rem; }
.bubble.lg { width: 118px; height: 118px; font-size: 3.2rem; }
.bubble.md { width: 96px;  height: 96px;  font-size: 2.6rem; }
.bubble:nth-child(4n+1) { --b: var(--c-primary); }
.bubble:nth-child(4n+2) { --b: var(--c-teal); }
.bubble:nth-child(4n+3) { --b: var(--c-purple); }
.bubble:nth-child(4n+4) { --b: var(--c-blue); }

.round-dots { display: flex; justify-content: center; gap: 9px; padding-block: 6px; }
.round-dots .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: #ffffffaa; border: 2px solid #e5d8cd;
}
.round-dots .dot.done { background: var(--c-green); border-color: var(--c-green-d); }

/* ---------------- 🃏 جفت گنج ---------------- */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 8px 2px;
}
.memory-card {
  aspect-ratio: 1;
  border: none; padding: 0;
  background: none;
  cursor: pointer;
  perspective: 700px;
  font-family: inherit;
}
.memory-card .card-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.5, 1);
}
.memory-card.flipped .card-inner { transform: rotateY(180deg); }
.memory-card .face {
  position: absolute; inset: 0;
  border-radius: 1.1rem;
  backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  border: 4px solid #fff;
  box-shadow: var(--shadow-pop);
}
.memory-card .front { background: linear-gradient(145deg, var(--c-yellow), #ffdf8e); font-size: 1.9rem; }
.memory-card .back { transform: rotateY(180deg); background: #fff; }
.memory-card .back .char { font-size: 2.4rem; font-weight: 700; color: var(--c-primary); }
.memory-card .back .emoji { font-size: 2rem; }
.memory-card .back .word-text { font-size: 0.85rem; font-weight: 700; }
.memory-card.matched .face { border-color: var(--c-green); }
.memory-card.matched .back { background: #E9FBF4; }
.memory-meta { text-align: center; color: var(--c-ink-soft); font-weight: 700; }

/* ---------------- 🦁 سافاری ---------------- */
.safari-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.safari-tile {
  aspect-ratio: 1;
  border-radius: 1rem;
  border: 4px solid #fff;
  background: #fff;
  font-family: inherit;
  font-size: 1.9rem; font-weight: 700;
  color: var(--c-ink);
  cursor: pointer;
  box-shadow: var(--shadow-pop);
}
.safari-tile.visited-yes { background: #E9FBF4; color: var(--c-green-d); }
.safari-tile:active { transform: scale(0.93); }

.safari-detail {
  position: fixed; inset-inline: 0; bottom: 0;
  max-width: 640px; margin-inline: auto;
  background: var(--c-card);
  border-radius: 1.8rem 1.8rem 0 0;
  box-shadow: 0 -8px 30px rgba(58, 46, 57, 0.2);
  padding: 18px 20px calc(20px + env(safe-area-inset-bottom));
  text-align: center;
  z-index: 60;
}
.safari-detail.hidden { display: none; }
.detail-close {
  position: absolute; top: 12px; inset-inline-end: 14px;
  border: none; background: var(--c-bg-2);
  width: 38px; height: 38px; border-radius: 50%;
  font-size: 1rem; cursor: pointer;
}
.detail-char { font-size: 4.2rem; font-weight: 700; color: var(--c-primary); line-height: 1.1; }
.detail-name { font-size: 1.25rem; font-weight: 700; color: var(--c-ink-soft); }
.detail-forms { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.form-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--c-bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.form-chip .form-char, .form-chip b { font-size: 1.5rem; font-weight: 700; }
.form-chip label { font-size: 0.72rem; color: var(--c-ink-soft); }
.detail-word {
  font-family: inherit; font-size: 1.15rem; font-weight: 700;
  background: var(--c-bg); border: 3px dashed var(--c-yellow-d);
  border-radius: var(--radius-sm);
  padding: 8px 16px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.detail-word .word-emoji { font-size: 1.6rem; }
.detail-actions { margin-top: 12px; }

/* ---------------- نقشه‌ی ماجراجویی ---------------- */
.map-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action-card {
  display: flex; align-items: center; gap: 12px;
  border: 4px solid #fff;
  border-radius: var(--radius);
  padding: 14px;
  color: var(--c-ink); /* موج ۲ a11y */
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  text-align: start;
}
.action-card.coral { background: var(--c-primary); }
.action-card.teal  { background: var(--c-teal); }
.action-card.purple { background: var(--c-purple-d); color: #fff; } /* فاز ۱۱: داستان‌ها · موج ۲ a11y */
.action-card .action-emoji { font-size: 2.1rem; }
.action-card .action-text { display: flex; flex-direction: column; gap: 3px; font-size: 1rem; }
.action-card .action-text i { font-style: normal; font-size: 0.85rem; } /* موج ۲ a11y: opacity حذف شد — 4.45 → 5.04 */
.action-card:active { transform: translateY(3px); box-shadow: none; }

.map-title { text-align: center; font-size: 1.2rem; margin: 8px 0 0; }
.map-path { display: flex; flex-direction: column; gap: 26px; padding-bottom: 20px; }
.map-row {
  display: flex; justify-content: space-evenly;
  position: relative;
}
.map-row::before {
  content: '';
  position: absolute; top: 50%; inset-inline: 10%;
  border-top: 4px dotted rgba(58, 46, 57, 0.12);
}
.map-row:nth-child(even) { flex-direction: row-reverse; } /* مارپیچ */
.map-row .station:nth-child(2) { margin-top: -16px; } /* با margin نه transform — تداخل با GSAP ندارد */

.station {
  position: relative;
  width: 66px; height: 66px;
  border-radius: 50%;
  border: 4px solid #fff;
  font-family: inherit;
  font-size: 1.8rem; font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  z-index: 1;
}
.station.open    { background: #fff; color: var(--c-teal-d); }
.station.done    { background: var(--c-green); color: var(--c-ink); } /* موج ۲ a11y: 6.8 */
.station.current { background: var(--c-primary); color: var(--c-ink); animation: pulse-ring 1.6s ease-out infinite; } /* موج ۲ a11y */
.station.locked  { background: var(--c-locked); color: var(--c-ink); opacity: 0.62; } /* موج ۲ a11y */
.station .lock-ico, .station .mini-star, .station .due-dot {
  position: absolute; font-size: 0.9rem;
}
.station .lock-ico  { top: -7px; inset-inline-end: -7px; }
.station .mini-star { bottom: -7px; inset-inline-end: -7px; }
.station .due-dot   { top: -9px; inset-inline-start: -5px; font-size: 0.85rem; }

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(255, 123, 84, 0.55), var(--shadow-pop); }
  75%  { box-shadow: 0 0 0 14px rgba(255, 123, 84, 0), var(--shadow-pop); }
  100% { box-shadow: 0 0 0 0 rgba(255, 123, 84, 0), var(--shadow-pop); }
}

/* ---------------- مودال ---------------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(58, 46, 57, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100;
}
.modal-card {
  background: var(--c-card);
  width: 100%; max-width: 640px;
  border-radius: 1.8rem 1.8rem 0 0;
  padding: 20px 20px calc(18px + env(safe-area-inset-bottom));
  max-height: 88dvh;
  overflow-y: auto;
}
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.modal-title { font-weight: 700; text-align: center; margin: 10px 0 4px; }

.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 4px; font-weight: 700;
  border-bottom: 2px dashed #f0e5da;
  cursor: pointer;
}
.setting-row input { width: 30px; height: 30px; accent-color: var(--c-primary); } /* موج ۲ a11y: ≥24px */
.remember-row input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--c-primary); } /* موج ۲ a11y */
.setting-danger { text-align: center; margin-top: 16px; }

/* مودال ایستگاه */
.station-head { display: flex; align-items: center; gap: 16px; }
.station-char {
  font-size: 4rem; font-weight: 700; color: var(--c-primary);
  background: var(--c-bg); border-radius: 1.2rem;
  padding: 6px 22px;
}
.station-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.station-name { font-size: 1.3rem; font-weight: 700; }
.station-forms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; justify-content: center; }

/* ---------------- گالری واژه‌های حرف (فاز ۹) ---------------- */
.station-hint { text-align: center; font-size: 0.78rem; color: var(--c-ink-soft); margin: 2px 0 0; }
.station-words {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px; margin-top: 10px;
}
.word-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px 10px;
  background: var(--c-card);
  border: 2px solid var(--c-bg-2); border-radius: 1rem;
  cursor: pointer; font-family: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.word-card:hover { border-color: var(--c-teal); transform: translateY(-2px); }
.word-card:active { transform: scale(0.94); }
.word-card .wc-emoji { font-size: 2.1rem; line-height: 1.15; }
.word-card .wc-text {
  font-size: 1.05rem; font-weight: 700; color: var(--c-ink);
  /* حفظ اتصال حروف RTL: بدون تغییر فونت/اندازه در .hl — فقط رنگ */
}
.word-card .wc-text .hl { color: var(--c-primary-ink); } /* موج ۲ a11y: ≥4.5 روی کارت سفید */
.word-card.playing { animation: wcPulse 0.55s ease; border-color: var(--c-primary); }
.word-card.heard::after {
  content: '✓'; position: absolute; top: 5px; inset-inline-end: 8px;
  font-size: 0.72rem; font-weight: 700; color: var(--c-green-d);
}
@keyframes wcPulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.09); }
  100% { transform: scale(1); }
}
/* حالت کم‌حرکت (فاز ۴) — پالس حذف، تغییر رنگ می‌ماند */
body.reduced-motion .word-card.playing { animation: none; }

/* ---------------- مراسم پاداش ---------------- */
.reward-card { position: relative; text-align: center; overflow: hidden; }
.reward-title { font-size: 1.5rem; margin: 6px 0 4px; }
.reward-praise { color: var(--c-ink-soft); font-weight: 700; margin-bottom: 6px; }

/* مودال استراحت (فاز ۴) */
.break-card { text-align: center; padding-block: 8px; }
.break-emoji { font-size: 3rem; }
.break-title { margin: 8px 0 6px; }
.break-body { color: var(--c-ink-soft); margin: 0 0 8px; }
.break-card.gate { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gate-wrong { color: var(--c-primary-d); font-weight: 700; margin: 4px 0 0; }
.reward-stars { font-size: 2.6rem; min-height: 3rem; }
.reward-stars .star.empty { opacity: 0.25; }
.reward-score { font-weight: 700; color: var(--c-ink-soft); margin-bottom: 6px; }
.reward-badges { margin-top: 8px; }
.reward-badge-label { font-weight: 700; margin-bottom: 6px; }
.reward-badge {
  display: inline-block; background: var(--c-bg);
  border: 3px solid var(--c-yellow-d);
  border-radius: var(--radius-sm);
  padding: 8px 16px; font-weight: 700; margin: 4px;
}
.confetti-host { position: absolute; inset: 0; pointer-events: none; }
.confetti-piece {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 3px;
  pointer-events: none;
}

/* ---------------- اتاق جوایز ---------------- */
.room-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 6px; }
.room-stars { font-size: 2rem; }
.room-stat { font-weight: 700; color: var(--c-ink-soft); }
/* فاز ۱۲ — شمارنده‌ی قصه‌های خوانده‌شده */
.room-stories b { color: var(--c-ink); font-size: 1.15em; }
.room-progress { width: min(360px, 84%); height: 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.5); overflow: hidden; margin-top: 2px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12); }
.room-progress-fill { height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #ffd54f, #ffb300);
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.section-title { margin: 14px 0 8px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.badge {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--c-card); border-radius: var(--radius);
  padding: 14px 8px; text-align: center;
  box-shadow: var(--shadow-pop);
  border: 3px solid transparent;
}
.badge.earned { border-color: var(--c-yellow-d); background: #FFFBF0; }
.badge.locked { opacity: 0.55; }
.badge-ico { font-size: 2rem; }
.badge-label { font-size: 0.85rem; font-weight: 700; }
.mastered-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mastered-chip {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--c-green); color: var(--c-ink); /* موج ۲ a11y */
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700;
  box-shadow: var(--shadow-pop);
}
.empty-note { color: var(--c-ink-soft); text-align: center; }

/* ---------------- HUD بازی ---------------- */
.game-hud .hud-score { display: flex; gap: 8px; align-items: center; }
.score-chip b, .combo-chip b { font-size: 1.05rem; }
.combo-chip { background: #FFE9E1; color: var(--c-primary-d); }
.game-mascot-corner {
  position: fixed; bottom: 10px; inset-inline-start: 10px;
  opacity: 0.92; pointer-events: none; z-index: 40;
}

/* ---------------- توست + نشانگر صدا ---------------- */
.toast-msg {
  position: fixed; bottom: 22px; inset-inline: 0;
  margin-inline: auto; width: max-content; max-width: 86vw;
  background: var(--c-ink); color: #fff;
  border-radius: 1.2rem;
  padding: 12px 22px;
  font-weight: 700;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
#audio-cue {
  position: fixed; top: 14px; inset-inline-end: 14px;
  font-size: 1.9rem;
  opacity: 0; pointer-events: none; z-index: 300;
  transition: opacity 0.25s;
}
#audio-cue.show { opacity: 1; animation: cue-pulse 0.8s ease 2; }
@keyframes cue-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.35); }
}

/* ---------------- موبایل کوچک ---------------- */
@media (max-width: 380px) {
  .memory-grid { gap: 8px; }
  .bubble.xl { width: 130px; height: 130px; font-size: 3.6rem; }
  .bubble.lg { width: 104px; height: 104px; font-size: 2.8rem; }
  .bubble.md { width: 84px; height: 84px; font-size: 2.3rem; }
  .station { width: 58px; height: 58px; font-size: 1.6rem; }
  .map-row .station:nth-child(2) { transform: translateY(-12px); }
}

/* ---------------- موج ۲ a11y: ابزار دسترس‌پذیری ---------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
