/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy:   #0f1f3d;
  --gold:   #f59e0b;
  --purple: #6d28d9;
  --green:  #16a34a;
  --red:    #dc2626;
  --blue:   #2563eb;
  --sky:    #60aee6;
  --font:   'Nunito', sans-serif;
  --display:'Fredoka One', 'Nunito', sans-serif;
}
html, body { height: 100%; font-family: var(--font); overflow: hidden; background: #0a1628; }

/* ── Screen system ───────────────────────────────────────── */
.screen { height: 100vh; display: flex; flex-direction: column; }
.screen.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   MAP SCREEN
═══════════════════════════════════════════════════════════ */

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  flex-shrink: 0;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-snake {
  font-size: 2.2rem;
  animation: owlieBob 3s ease-in-out infinite;
  display: block;
  line-height: 1;
}
@keyframes owlieBob { 0%,100%{transform:rotate(-6deg) scale(1)} 50%{transform:rotate(6deg) scale(1.08)} }

.brand-name {
  font-family: var(--display);
  font-size: 1.55rem;
  color: #fff;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.brand-name span { color: var(--gold); }
.brand-tag { font-size: 0.68rem; color: #7f9ab3; font-weight: 700; letter-spacing: 0.03em; }

.top-right { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }

.tbtn {
  border: none; border-radius: 10px;
  padding: 7px 14px;
  font-family: var(--font); font-size: 0.82rem; font-weight: 800;
  cursor: pointer; transition: transform 0.12s, opacity 0.12s;
}
.tbtn:hover { transform: scale(1.06); }
.tbtn.gold   { background: var(--gold); color: #78350f; }
.tbtn.mute   { background: #1e3a5f; color: #93c5fd; border: 2px solid #2d5986; }
.tbtn.purple { background:linear-gradient(135deg,#7c3aed,#6d28d9); color:#fff; }
.tbtn.purple:hover { background:linear-gradient(135deg,#6d28d9,#5b21b6); }
.tbtn.green  { background:linear-gradient(135deg,#059669,#047857); color:#fff; }
.tbtn.green:hover  { background:linear-gradient(135deg,#047857,#065f46); }
.tbtn.cyan {
  background: linear-gradient(135deg, #0891b2, #0e7490);
  color: #fff;
}
.tbtn.cyan:hover { background: linear-gradient(135deg, #0e7490, #155e75); }
.tbtn.dark  { background: linear-gradient(135deg,#1e293b,#0f172a); color:#94a3b8; border:1.5px solid #334155; }
.tbtn.dark:hover { color:#e2e8f0; border-color:#475569; }
.tbtn.reset { background: rgba(239,68,68,.15); color:#fca5a5; border:1.5px solid rgba(239,68,68,.3); }
.tbtn.reset:hover { background: rgba(239,68,68,.3); }
.tbtn.hamburger { background: #1e3a5f; color: #93c5fd; border: 2px solid #2d5986; font-size: 1.15rem; padding: 6px 11px; line-height: 1; }
.tbtn.report { background: linear-gradient(135deg,#0ea5e9,#0284c7); color:#fff; }
.tbtn.report:hover { background: linear-gradient(135deg,#0284c7,#0369a1); }

.star-count {
  background: rgba(255,255,255,0.07);
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 900; font-size: 0.95rem;
  color: var(--gold);
  min-width: 65px; text-align: center;
}

/* Map body */
.map-body { display: flex; flex: 1; overflow: hidden; }

/* Panels */
.panel {
  width: 215px; min-width: 195px;
  display: flex; flex-direction: column;
  padding: 12px 10px; gap: 8px;
  overflow-y: auto; flex-shrink: 0;
}
.side-panel  { background: #fff9e6; border-right: 3px solid #fde68a; transition: width 0.25s ease, min-width 0.25s ease, padding 0.25s ease; }
.map-body.sidebar-hidden .side-panel { width: 0 !important; min-width: 0 !important; padding: 0 !important; overflow: hidden !important; border: none !important; }
.side-panel-divider { height: 2px; background: linear-gradient(90deg, #fde68a, #ddd6fe); margin: 6px 0; border-radius: 999px; }
.side-right .info-card { border-color: #ddd6fe; }

/* Pip / Owlie area */
.pip-area {
  display: flex; flex-direction: column;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 2px dashed #fde68a;
  margin-bottom: 4px;
}
.pip-char { font-size: 4rem; line-height: 1; animation: owlieBob 2.5s ease-in-out infinite; }
.pip-label {
  font-family: var(--display);
  font-size: 0.72rem; letter-spacing: 0.1em;
  background: var(--gold); color: #78350f;
  border-radius: 999px; padding: 2px 10px;
  margin-top: -4px; margin-bottom: 8px;
}
.pip-bubble {
  background: #fff; border: 2.5px solid var(--gold);
  border-radius: 14px; padding: 9px 11px;
  font-size: 0.8rem; font-weight: 800; color: #1c1917;
  text-align: center; line-height: 1.5;
  position: relative;
}
.pip-bubble::before {
  content: ''; position: absolute; top: -12px; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent; border-bottom-color: var(--gold);
}

/* Info cards */
.info-card {
  background: #fff; border-radius: 14px;
  border: 2px solid #fde68a;
  padding: 10px 12px;
}
.side-right .profile-card { margin-bottom: 8px; }

.card-title {
  font-size: 0.68rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: #92400e; margin-bottom: 7px;
}
.card-title.orange { color: #c2410c; }

.how-ul { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.how-ul li { font-size: 0.79rem; font-weight: 700; color: #374151; }

/* Progress */
.prog-outer { height: 13px; background: #e5e7eb; border-radius: 999px; overflow: hidden; border: 2px solid #d1d5db; margin-bottom: 4px; }
.prog-inner { height: 100%; background: linear-gradient(90deg, #22c55e, #86efac); border-radius: 999px; transition: width 0.7s ease; }
.prog-nums  { font-size: 0.74rem; font-weight: 800; color: #6b7280; text-align: right; }
.prog-cheer { font-size: 0.79rem; font-weight: 800; color: #374151; text-align: center; margin-top: 4px; }

/* Profile */
.profile-card {
  background: linear-gradient(135deg, #3b0764, #6d28d9);
  border-radius: 16px; padding: 14px;
  text-align: center; margin-bottom: 4px;
}
.prof-avatar { font-size: 2.8rem; line-height: 1; margin-bottom: 4px; cursor: pointer; transition: transform 0.2s; }
.prof-avatar:hover { transform: scale(1.15); }
.prof-name { font-family: var(--display); font-size: 1rem; color: #fff; letter-spacing: 0.08em; margin-bottom: 6px; }
.prof-stats { display: flex; justify-content: center; gap: 14px; }
.prof-stats span { font-size: 0.88rem; font-weight: 900; color: #e9d5ff; }
.prof-stats b { color: #fff; }

/* Badges */
.badge-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #f3f4f6; opacity: 0.35; transition: opacity 0.4s; }
.badge-row.earned { opacity: 1; }
.badge-ico { width: 32px; height: 32px; border-radius: 50%; background: #e5e7eb; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; transition: background 0.4s; }
.badge-row.earned .badge-ico { background: var(--gold); }
.badge-name { font-size: 0.76rem; font-weight: 900; color: #1c1917; }
.badge-desc { font-size: 0.65rem; font-weight: 700; color: #6b7280; }

/* Achievements */
.achieve-row { display: flex; align-items: center; gap: 7px; padding: 5px 0; border-bottom: 1px solid #f3f4f6; opacity: 0.35; transition: opacity 0.4s; }
.achieve-row.earned { opacity: 1; }
.achieve-ico { font-size: 1.1rem; flex-shrink: 0; }
.achieve-name { font-size: 0.75rem; font-weight: 800; color: #1c1917; }
.achieve-desc { font-size: 0.62rem; color: #6b7280; }

/* Mission */
.mission-card { background: #fff7ed !important; border-color: #fed7aa !important; }
.mission-text { font-size: 0.78rem; font-weight: 700; color: #7c2d12; line-height: 1.4; margin-bottom: 6px; }
.mission-prog { font-size: 0.95rem; font-weight: 900; color: #ea580c; text-align: center; }

/* Day streak */
.day-streak-card { background:#fff7ed !important; border-color:#fed7aa !important; }
.day-streak-body { display:flex; align-items:center; gap:6px; padding:4px 0; }
.day-streak-fire { font-size:1.5rem; animation:owlieBob 1.5s ease-in-out infinite; }
.day-streak-val  { font-family:var(--display); font-size:2rem; color:#ea580c; line-height:1; }
.day-streak-label { font-size:0.72rem; font-weight:800; color:#9a3412; }

/* ── Map center ───────────────────────────────────────────── */
.map-center {
  flex: 1; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.ground {
  flex: 1; position: relative; overflow-y: auto; overflow-x: hidden;
  background: linear-gradient(180deg, #86efac 0%, #4ade80 60%, #22c55e 100%);
  border-top: 4px solid #15803d;
  padding: 14px 16px 80px;
}
.ground::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.3) 3px, transparent 3px);
  background-size: 26px 26px; pointer-events: none;
}
.trees {
  position: absolute; bottom: 50px; left: 0; right: 0;
  text-align: center; font-size: 1.6rem;
  letter-spacing: 10px; pointer-events: none; z-index: 1;
}

/* ── Level grid ──────────────────────────────────────────── */
.level-grid {
  display: flex; flex-direction: column; gap: 12px;
  position: relative; z-index: 2;
}

/* ── Zone sections ── */
.zone-section {
  border-radius: 16px; overflow: hidden;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.6);
}
.zone-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; gap: 10px;
  border-bottom: 1px solid rgba(0,0,0,.07);
}
.zone-hdr-left { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }
.zone-label {
  font-family: var(--font); font-size: .8rem; font-weight: 900;
  white-space: nowrap;
}
.zone-ages {
  font-size: .63rem; font-weight: 800; color: #64748b;
  background: #f1f5f9; padding: 2px 9px; border-radius: 999px;
  white-space: nowrap;
}
.zone-cards {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 8px; padding: 10px;
  background: rgba(255,255,255,.3);
}

/* ── Level cards ── */
.level-card {
  background: #fff; border-radius: 14px;
  border: 3px solid #e2e8f0;
  padding: 10px 6px 8px;
  text-align: center; cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  min-height: 110px;
}
.level-card:not(.locked):hover { transform: translateY(-5px) scale(1.04); box-shadow: 0 12px 30px rgba(0,0,0,.2); }
.level-card.locked  { cursor: not-allowed; filter: grayscale(0.4); opacity: 0.65; }
.level-card.complete { border-color: var(--lc, #22c55e); background: #f0fdf4; }
.level-card.started  { border-color: #f59e0b; }

.lc-top  { display: flex; align-items: center; justify-content: center; gap: 5px; }
.lc-icon { font-size: 1.8rem; line-height: 1; }
.lc-id   { font-size: .55rem; font-weight: 900; letter-spacing: .08em; color: #94a3b8; text-transform: uppercase; }
.lc-name { font-size: .72rem; font-weight: 900; color: #1e293b; line-height: 1.25; }
.lc-learn { font-size: .58rem; font-weight: 800; color: #6b7280; background: #f1f5f9; padding: 2px 6px; border-radius: 999px; }
.lc-stars { font-size: .85rem; letter-spacing: 2px; }
.lcs     { color: #d1d5db; }
.lcs.lit { color: #f59e0b; }
.lc-done { font-size: .55rem; font-weight: 900; color: var(--lc, #16a34a); letter-spacing: .05em; text-transform: uppercase; }

/* admin eye badge */
.lv-admin-eye { position: absolute; top: 6px; left: 6px; font-size: 0.75rem; opacity: 0.7; }

.start-adv-btn {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #78350f;
  border: none; border-radius: 999px;
  padding: 12px 36px;
  font-family: var(--display); font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(245,158,11,.55);
  transition: transform .15s, box-shadow .15s;
  z-index: 10;
  animation: glowPulse 2s ease-in-out infinite;
}
.start-adv-btn:hover { transform: translateX(-50%) translateY(-4px); box-shadow: 0 10px 32px rgba(245,158,11,.75); }
@keyframes glowPulse { 0%,100%{box-shadow:0 6px 24px rgba(245,158,11,.55)} 50%{box-shadow:0 8px 36px rgba(245,158,11,.9)} }

/* Zone guide button */
.zone-guide-btn {
  background: #f59e0b; color: #fff; border: none; border-radius: 8px;
  padding: 4px 10px; font-size: .63rem; font-weight: 900;
  cursor: pointer; white-space: nowrap; font-family: var(--font);
  transition: background .15s; flex-shrink: 0; line-height: 1.4;
}
.zone-guide-btn:hover { background: #d97706; }


/* ═══════════════════════════════════════════════════════════
   ENGLISH LAB SCREEN
═══════════════════════════════════════════════════════════ */
#screen-lab { display:flex; flex-direction:column; }

.play-ribbon {
  background:linear-gradient(90deg,#0f172a,#1e293b);
  border-bottom:3px solid #10b981;
  padding:10px 18px; display:flex; align-items:center; gap:16px; flex-shrink:0;
}
.play-ribbon-title { font-family:var(--font); font-size:1.1rem; font-weight:900; color:#fff; }
.play-ribbon-sub   { font-size:.75rem; font-weight:800; color:#94a3b8; }

/* Tab bar */
.lab-tabs {
  display: flex; gap: 0; flex-shrink: 0;
  background: #0f172a; border-bottom: 2px solid #1e3a5f;
  padding: 0 16px;
}
.lab-tab {
  padding: 11px 20px;
  background: transparent; border: none; border-bottom: 3px solid transparent;
  font-family: var(--font); font-size: 0.85rem; font-weight: 800;
  color: #64748b; cursor: pointer; transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.lab-tab:hover { color: #94a3b8; }
.lab-tab.active { color: #10b981; border-bottom-color: #10b981; }

.lab-body {
  flex: 1; overflow: hidden; display: flex; flex-direction: column;
  background: #0f172a;
}
.lab-wrap {
  flex: 1; display: flex; overflow: hidden; padding: 14px; gap: 14px;
}

/* Lab sidebar */
.lab-sidebar {
  width: 200px; flex-shrink: 0; display: flex; flex-direction: column;
  gap: 10px; overflow-y: auto; padding-right: 4px;
}
.lab-owlie { font-size: 3rem; text-align: center; animation: owlieBob 3s ease-in-out infinite; }
.lab-title { font-family: var(--font); font-size: 1rem; font-weight: 900; color: #f1f5f9; text-align: center; }
.lab-subtitle { font-size: .73rem; color: #94a3b8; text-align: center; font-weight: 700; }
.lab-tip-box {
  display: flex; flex-direction: column; gap: 6px; margin-top: 4px;
}
.lab-tip-item {
  font-size: .72rem; font-weight: 700; color: #64748b;
  background: rgba(255,255,255,.05); border-radius: 8px;
  padding: 7px 10px; line-height: 1.4;
}

/* Lab main */
.lab-main {
  flex: 1; display: flex; flex-direction: column;
  border-radius: 16px; overflow-y: auto;
  background: #fff; padding: 24px 28px;
}
.lab-panel-title {
  font-family: var(--display); font-size: 1.3rem; color: #0f172a;
  margin-bottom: 6px;
}
.lab-panel-sub {
  font-size: .88rem; font-weight: 700; color: #64748b; margin-bottom: 20px;
}

/* Lab action buttons */
.lab-btns { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.lab-btn-check {
  background: linear-gradient(135deg, #10b981, #059669); color: #fff;
  border: none; border-radius: 12px; padding: 11px 24px;
  font-family: var(--font); font-size: .9rem; font-weight: 900;
  cursor: pointer; transition: transform .15s;
}
.lab-btn-check:hover { transform: scale(1.04); }
.lab-btn-new {
  background: #f1f5f9; color: #475569;
  border: 2px solid #e2e8f0; border-radius: 12px; padding: 11px 20px;
  font-family: var(--font); font-size: .88rem; font-weight: 800;
  cursor: pointer; transition: background .15s;
}
.lab-btn-new:hover { background: #e2e8f0; }

/* ── Scramble ── */
.scr-build-label, .scr-words-label {
  font-size: .72rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: .07em; color: #64748b; margin-bottom: 6px;
}
.scr-words-label { margin-top: 16px; }

.scramble-input {
  min-height: 52px; background: #f0fdf4;
  border: 2px dashed #86efac; border-radius: 14px;
  padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 7px;
  align-items: center;
}
.scr-placeholder { font-size: .82rem; color: #86efac; font-weight: 700; }
.scr-chosen {
  background: #10b981; color: #fff;
  border-radius: 8px; padding: 5px 12px;
  font-size: .88rem; font-weight: 800; cursor: pointer;
  transition: background .15s;
}
.scr-chosen:hover { background: #059669; }

.scramble-words {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.scr-word {
  background: #eff6ff; border: 2px solid #bfdbfe; border-radius: 10px;
  padding: 7px 14px; cursor: pointer; font-family: var(--font);
  font-size: .9rem; font-weight: 800; color: #1e40af;
  transition: all .15s;
}
.scr-word:hover { background: #dbeafe; border-color: #93c5fd; transform: translateY(-2px); }

.scramble-result {
  font-size: .92rem; font-weight: 800; margin-top: 14px;
  min-height: 24px;
}

/* ── Spelling ── */
.spell-hint-box {
  background: #fffbeb; border: 2px solid #fde68a; border-radius: 14px;
  padding: 14px 18px; margin-bottom: 18px;
}
.spell-hint-label { font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; color: #d97706; margin-bottom: 6px; }
.spell-hint-text { font-size: 1.1rem; font-weight: 900; color: #1c1917; line-height: 1.5; }

.spell-input-row { display: flex; gap: 10px; align-items: center; }
.spell-inp {
  flex: 1; padding: 12px 16px; border-radius: 12px;
  border: 2.5px solid #6366f1; outline: none;
  font-family: var(--font); font-size: 1rem; font-weight: 800;
  background: #f8f7ff; color: #1e1b4b; transition: border-color .15s;
}
.spell-inp:focus { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.spell-check-btn {
  background: #4f46e5; border: none; border-radius: 12px;
  padding: 12px 20px; cursor: pointer; color: #fff;
  font-family: var(--font); font-size: .88rem; font-weight: 900;
  transition: background .15s; white-space: nowrap;
}
.spell-check-btn:hover { background: #4338ca; }
.spell-result { font-size: .92rem; font-weight: 800; margin-top: 14px; min-height: 24px; }

/* ── Typing ── */
.typing-passage-box {
  background: #1e293b; border-radius: 14px;
  padding: 16px 20px; margin-bottom: 16px;
}
.typing-passage-label { font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; color: #94a3b8; margin-bottom: 8px; }
.typing-passage-text {
  font-size: 1.05rem; font-weight: 800; color: #e2e8f0; line-height: 1.7;
  letter-spacing: .01em;
}
.typing-inp {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  border: 2.5px solid #6366f1; outline: none; resize: vertical;
  font-family: var(--font); font-size: .95rem; font-weight: 800;
  background: #f8f7ff; color: #1e1b4b; line-height: 1.6;
  min-height: 90px; transition: border-color .15s;
}
.typing-inp:focus { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.typing-stats {
  font-size: .88rem; font-weight: 800; color: #64748b; margin-top: 10px;
}


/* ═══════════════════════════════════════════════════════════
   CHALLENGE SCREEN
═══════════════════════════════════════════════════════════ */
#screen-challenge {
  background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 100%);
}

.chall-ribbon {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: rgba(255,255,255,0.06);
  border-bottom: 2px solid rgba(255,255,255,0.1);
  flex-shrink: 0; gap: 10px;
}
.ribbon-back {
  background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.2);
  border-radius: 10px; padding: 7px 14px;
  color: #e2e8f0; font-family: var(--font); font-size: 0.85rem; font-weight: 800;
  cursor: pointer; transition: background .15s;
}
.ribbon-back:hover { background: rgba(255,255,255,0.18); }
.ribbon-center { flex: 1; text-align: center; }
.ribbon-level {
  font-family: var(--display); font-size: 1.1rem;
  color: #e2e8f0; letter-spacing: 0.04em;
}
.ribbon-right { display: flex; align-items: center; gap: 10px; }
.ribbon-stars { font-size: 1.4rem; letter-spacing: 3px; min-width: 80px; text-align: right; }
.ribbon-voice-btn, .ribbon-stop-btn {
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.22);
  border-radius: 10px; padding: 6px 12px;
  font-family: var(--font); font-size: 0.8rem; font-weight: 800;
  color: #e2e8f0; cursor: pointer; transition: background .15s;
  white-space: nowrap;
}
.ribbon-voice-btn:hover { background: rgba(255,255,255,0.22); }
.ribbon-stop-btn { border-color: rgba(239,68,68,0.5); color: #fca5a5; }
.ribbon-stop-btn:hover { background: rgba(239,68,68,0.25); }

.chall-split { flex: 1; display: flex; overflow: hidden; }

.chall-pip-col {
  width: 32%; min-width: 220px; max-width: 280px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px 16px; gap: 16px; flex-shrink: 0;
}
.chall-pip-emoji {
  font-size: 7rem; line-height: 1;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.5));
  animation: owlieBob 2.5s ease-in-out infinite;
}
.chall-pip-bubble {
  background: #fff; border: 3px solid var(--gold);
  border-radius: 20px 20px 20px 4px;
  padding: 14px 16px;
  font-size: 0.95rem; font-weight: 800; color: #1c1917;
  line-height: 1.6; width: 100%;
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
  animation: popBubble .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes popBubble { from{transform:scale(0.85);opacity:0} to{transform:scale(1);opacity:1} }

.chall-q-col {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 20px 24px; overflow-y: auto;
}
.q-card {
  background: #ffffff; border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  width: 100%; max-width: 520px; overflow: hidden;
}
.q-num-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: #1e1b4b;
  border-bottom: 3px solid var(--gold);
}
.q-progress-dots { display: flex; align-items: center; gap: 7px; }
.q-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  display: inline-block;
}
.q-dot.dot-done    { background: #22c55e; transform: scale(0.85); }
.q-dot.dot-current { background: #3b82f6; transform: scale(1.25); box-shadow: 0 0 0 3px rgba(59,130,246,0.22); }
.q-type-tag {
  background: rgba(255,255,255,0.15); color: #e2e8f0;
  font-size: 0.8rem; font-weight: 800;
  padding: 4px 12px; border-radius: 999px;
}
.q-timer-badge {
  font-size: 0.7rem; font-weight: 700; color: #64748b;
  font-variant-numeric: tabular-nums; letter-spacing: 0.5px;
  min-width: 28px; text-align: right; transition: color 0.4s ease;
}
.q-timer-badge.timer-warning { color: #d97706; }
.q-timer-badge.timer-danger  { color: #ef4444; animation: timer-pulse 0.55s ease-in-out infinite alternate; }
@keyframes timer-pulse { from{opacity:1} to{opacity:0.4} }
.q-timer-track { width:100%; height:3px; background:#e2e8f0; border-radius:999px; overflow:hidden; margin-top:8px; }
.q-timer-fill  { height:100%; width:100%; background:#3b82f6; border-radius:999px; transition:width 0.95s linear, background 0.6s ease; }
.q-timer-fill.timer-warning { background: #f59e0b; }
.q-timer-fill.timer-danger  { background: #ef4444; }

.q-question {
  padding: 20px 22px 8px;
  font-size: 1.15rem; font-weight: 900;
  color: #0f172a; line-height: 1.5; background: #fff;
}
.q-code {
  margin: 0 22px 12px;
  background: #1e293b; color: #e2e8f0;
  border-radius: 12px; padding: 14px 18px;
  font-family: 'Courier New', monospace;
  font-size: 0.92rem; font-weight: 700;
  line-height: 1.7; white-space: pre;
  border-left: 4px solid var(--gold);
}
.q-code.hidden { display: none; }
.q-opts {
  display: flex; flex-direction: column; gap: 10px;
  padding: 8px 22px 20px; background: #fff;
}
.opt-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border: 2.5px solid #e2e8f0; border-radius: 14px; background: #f8fafc;
  font-family: var(--font); font-size: 1rem; font-weight: 800;
  color: #1e293b; cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s, transform .12s;
}
.opt-btn:hover:not(:disabled) { border-color: var(--purple); background: #f5f3ff; transform: scale(1.015); }
.opt-btn:disabled { cursor: default; }
.opt-label {
  width: 30px; height: 30px; border-radius: 50%;
  background: #e2e8f0; color: #475569;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 900; flex-shrink: 0;
  transition: background .15s, color .15s;
}
.opt-emoji { font-size: 1.4rem; flex-shrink: 0; line-height: 1; }
.opt-text  { line-height: 1.35; flex: 1; }
.opt-btn.correct { border-color: #16a34a; background: #f0fdf4; color: #14532d; }
.opt-btn.correct .opt-label { background: #16a34a; color: #fff; }
.opt-btn.wrong   { border-color: #dc2626; background: #fef2f2; color: #7f1d1d; animation: optWiggle .3s ease; }
.opt-btn.wrong .opt-label { background: #dc2626; color: #fff; }
@keyframes optWiggle { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-7px)} 75%{transform:translateX(7px)} }

.q-result { margin: 0 22px 20px; border-radius: 16px; overflow: hidden; border: 2.5px solid transparent; animation: popBubble .35s ease; }
.q-result.hidden { display: none !important; }
.q-result.is-right { border-color: #86efac; }
.q-result.is-wrong { border-color: #fca5a5; }
.result-body { padding: 14px 16px; font-size: 0.95rem; font-weight: 800; line-height: 1.6; }
.q-result.is-right .result-body { background: #f0fdf4; color: #14532d; }
.q-result.is-wrong .result-body { background: #fef2f2; color: #7f1d1d; }
.result-action-btn {
  width: 100%; padding: 13px; border: none; border-radius: 0 0 13px 13px;
  font-family: var(--display); font-size: 1rem;
  cursor: pointer; transition: opacity .15s;
}
.result-action-btn:hover { opacity: 0.88; }
.q-result.is-right .result-action-btn { background: #16a34a; color: #fff; }
.q-result.is-wrong .result-action-btn { background: #dc2626; color: #fff; }

/* Streak badge */
.streak-badge {
  background:linear-gradient(135deg,#f97316,#ef4444);
  border-radius:999px; padding:3px 10px;
  font-family:var(--font); font-size:.78rem; font-weight:900;
  color:#fff; white-space:nowrap;
  animation:streakPop .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes streakPop { from{transform:scale(0)} to{transform:scale(1)} }

/* Pip animations */
@keyframes pipCorrect { 0%,100%{transform:scale(1) rotate(0)} 25%{transform:scale(1.3) rotate(15deg)} 50%{transform:scale(1.2) rotate(-10deg)} 75%{transform:scale(1.25) rotate(8deg)} }
@keyframes pipWrong   { 0%,100%{transform:translateX(0) scale(1)} 20%{transform:translateX(-12px) scale(0.95)} 40%{transform:translateX(10px) scale(0.95)} 60%{transform:translateX(-8px)} 80%{transform:translateX(6px)} }
.pip-correct { animation:pipCorrect .6s ease forwards !important; }
.pip-wrong   { animation:pipWrong   .45s ease forwards !important; }
@keyframes pip-bounce { 0%{transform:scale(1) translateY(0)} 28%{transform:scale(1.38) translateY(-14px)} 55%{transform:scale(0.88) translateY(0)} 75%{transform:scale(1.12) translateY(-5px)} 100%{transform:scale(1) translateY(0)} }
.pip-bounce { animation:pip-bounce 0.58s cubic-bezier(.34,1.56,.64,1) forwards; }


/* ═══════════════════════════════════════════════════════════
   WIN SCREEN
═══════════════════════════════════════════════════════════ */
.win-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #052e16, #14532d); padding: 20px;
}
.win-card {
  background: #fff; border-radius: 28px;
  padding: 36px 32px; max-width: 440px; width: 100%;
  text-align: center; box-shadow: 0 24px 70px rgba(0,0,0,0.45);
  animation: popBubble .5s cubic-bezier(.34,1.56,.64,1);
}
.win-pip { font-size: 5rem; margin-bottom: 8px; animation: winBounce .6s ease; line-height: 1; }
@keyframes winBounce { 0%,100%{transform:scale(1)} 40%{transform:scale(1.3) rotate(12deg)} 65%{transform:scale(0.92)} }
.win-headline { font-family: var(--display); font-size: 2.2rem; color: #15803d; margin-bottom: 6px; }
.win-stars { font-size: 2.5rem; letter-spacing: 4px; margin-bottom: 10px; animation: winBounce .6s .15s ease; }
.win-sub { font-size: 1.05rem; font-weight: 800; color: #374151; margin-bottom: 14px; }
.win-fact {
  background: #f0fdf4; border: 2px solid #86efac;
  border-radius: 14px; padding: 14px 16px;
  font-size: 0.9rem; font-weight: 700; color: #166534;
  line-height: 1.55; margin-bottom: 20px; text-align: left;
}
.win-buttons { display: flex; flex-direction: column; gap: 8px; }
.win-btn-main {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff; border: none; border-radius: 16px;
  padding: 15px; font-family: var(--display); font-size: 1.1rem;
  cursor: pointer; transition: transform .15s;
}
.win-btn-main:hover { transform: scale(1.04); }
.win-btn-next {
  background: linear-gradient(135deg,#2563eb,#1d4ed8);
  color:#fff; border:none; border-radius:16px;
  padding:15px; font-family:var(--display); font-size:1.1rem;
  cursor:pointer; transition:transform .15s; margin-top:4px;
}
.win-btn-next:hover { transform:scale(1.04); }


/* ═══════════════════════════════════════════════════════════
   MODALS — Base
═══════════════════════════════════════════════════════════ */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 900; padding: 20px;
}
.modal-bg.hidden { display: none !important; }
.modal-card {
  background: #fffbeb; border: 3px solid var(--gold);
  border-radius: 24px; padding: 24px;
  max-width: 540px; width: 100%;
  max-height: 82vh; overflow-y: auto;
  position: relative; box-shadow: 0 24px 64px rgba(0,0,0,0.45);
}
.modal-x {
  position: absolute; top: 14px; right: 14px;
  background: #f3f4f6; border: none; border-radius: 50%;
  width: 32px; height: 32px; font-size: 1rem; font-weight: 900;
  cursor: pointer; color: #6b7280;
  display: flex; align-items: center; justify-content: center;
}
.modal-x:hover { background: #e5e7eb; }
.modal-title { font-family: var(--display); font-size: 1.25rem; color: #78350f; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid #fde68a; }
.modal-hint { font-size: 0.9rem; font-weight: 700; color: #78350f; }

/* Teacher modal content */
.tc-block { margin-bottom: 16px; }
.tc-lbl { font-size: 0.67rem; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; color: #d97706; margin-bottom: 5px; }
.tc-txt { font-size: 0.88rem; font-weight: 700; color: #1c1917; line-height: 1.68; background: #fff; border: 2px solid #fde68a; border-radius: 12px; padding: 12px 14px; }
.tc-txt b { color: var(--purple); }
.tc-board { background: #f0fdf4; border: 2px dashed #6ee7b7; border-radius: 10px; padding: 10px 14px; font-size: 0.88rem; font-weight: 800; color: #064e3b; font-family: 'Courier New', monospace; }


/* ═══════════════════════════════════════════════════════════
   NAME MODAL
═══════════════════════════════════════════════════════════ */
.name-card {
  max-width: 380px !important; text-align: center;
  background: linear-gradient(160deg, #0f1f3d, #1e3a5f) !important;
  border-color: var(--gold) !important; padding: 32px 28px !important;
}
.name-pip { font-size: 5rem; line-height: 1; animation: owlieBob 2.5s ease-in-out infinite; margin-bottom: 8px; }
.name-title { font-family: var(--display); font-size: 1.5rem; color: #fff; margin-bottom: 4px; }
.name-title b { color: var(--gold); }
.name-sub { font-size: 0.9rem; color: #94a3b8; font-weight: 700; margin-bottom: 20px; line-height: 1.5; }
.name-inp {
  width: 100%; padding: 13px 16px; border-radius: 14px;
  border: 2.5px solid var(--gold); background: rgba(255,255,255,0.07); color: #fff;
  font-family: var(--font); font-size: 1.1rem; font-weight: 800;
  outline: none; text-align: center; margin-bottom: 14px;
  transition: border-color 0.2s, background 0.2s;
}
.name-inp::placeholder { color: #64748b; }
.name-inp:focus { border-color: #22d3ee; background: rgba(255,255,255,0.12); }
.name-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--gold), #d97706);
  border: none; border-radius: 14px;
  font-family: var(--display); font-size: 1.1rem; color: #78350f;
  cursor: pointer; margin-bottom: 8px; transition: transform 0.15s;
}
.name-btn:hover { transform: scale(1.04); }
.name-skip { background: none; border: none; color: #64748b; font-size: 0.78rem; font-weight: 700; cursor: pointer; text-decoration: underline; font-family: var(--font); }
.name-skip:hover { color: #94a3b8; }

/* Arabic translation ? badge */
.tr-q {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: #3b82f6; color: #fff;
  font-size: 0.55rem; font-weight: 900;
  cursor: pointer; margin-left: 4px;
  vertical-align: middle; flex-shrink: 0; user-select: none;
  transition: background 0.15s, transform 0.15s;
}
.tr-q:hover { background: #1d4ed8; transform: scale(1.2); }

/* Fixed-position JS tooltip — never clipped by overflow */
#tr-tip {
  position: fixed;
  background: #1e293b; color: #f1f5f9;
  font-size: 0.76rem; font-weight: 700; line-height: 1.45;
  padding: 5px 10px; border-radius: 7px;
  direction: rtl; text-align: right;
  max-width: 200px; width: max-content;
  pointer-events: none; z-index: 99999;
  opacity: 0; transition: opacity 0.15s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  font-family: 'Segoe UI', Arial, sans-serif;
}
#tr-tip.on { opacity: 1; }

/* Language selection modal */
.lang-card {
  max-width: 420px !important; text-align: center;
  background: linear-gradient(160deg, #0f1f3d, #1e3a5f) !important;
  border-color: var(--gold) !important; padding: 36px 28px !important;
}
.lang-pip { font-size: 5rem; line-height: 1; animation: owlieBob 2.5s ease-in-out infinite; margin-bottom: 10px; }
.lang-title { font-family: var(--display); font-size: 1.5rem; color: #fff; margin-bottom: 6px; }
.lang-title b { color: var(--gold); }
.lang-sub { font-size: 0.82rem; color: #94a3b8; font-weight: 700; margin-bottom: 28px; line-height: 1.6; }
.lang-options { display: flex; flex-direction: column; gap: 12px; }
.lang-opt-btn {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.07);
  color: #fff; font-family: var(--font); font-size: 1.05rem; font-weight: 800;
  cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.lang-opt-btn:hover { border-color: var(--gold); background: rgba(251,191,36,0.12); transform: scale(1.03); }
.lang-flag  { font-size: 2rem; line-height: 1; }
.lang-name  { font-size: 1rem; }
.lang-sub2  { font-size: 0.72rem; color: #94a3b8; font-weight: 600; margin-left: auto; }
.lang-opt-skip { border-color: rgba(255,255,255,0.08); opacity: 0.75; }
.lang-opt-skip:hover { border-color: #64748b; background: rgba(255,255,255,0.05); opacity: 1; }


/* ═══════════════════════════════════════════════════════════
   CERTIFICATE MODAL
═══════════════════════════════════════════════════════════ */
.cert-card {
  max-width: 500px; width: 96vw;
  background: linear-gradient(160deg,#fffbeb,#fef3c7) !important;
  border: 4px solid #f59e0b !important; text-align: center;
}
.cert-top         { font-size:4rem; line-height:1; margin-bottom:6px; animation:winBounce .6s ease; }
.cert-title-big   { font-family:var(--display); font-size:1.4rem; color:#78350f; margin-bottom:6px; }
.cert-sub         { font-size:0.8rem; font-weight:700; color:#92400e; margin-bottom:4px; }
.cert-student-name { font-family:var(--display); font-size:2rem; color:#1d4ed8; margin:8px 0; padding:10px 0; border-top:2px dashed #fde68a; border-bottom:2px dashed #fde68a; text-shadow:0 2px 8px rgba(29,78,216,.15); }
.cert-course-name { font-family:var(--display); font-size:1.2rem; color:#15803d; margin:6px 0; }
.cert-detail      { font-size:0.78rem; font-weight:700; color:#64748b; margin-bottom:6px; }
.cert-stars-row   { font-size:1.5rem; letter-spacing:4px; margin:8px 0; }
.cert-date        { font-size:0.82rem; font-weight:800; color:#78350f; margin:8px 0 12px; }
.cert-footer-row  { display:flex; align-items:center; justify-content:center; gap:8px; margin-bottom:16px; border-top:2px solid #fde68a; padding-top:12px; }
.cert-logo        { height:32px; width:auto; }
.cert-org         { font-size:0.78rem; font-weight:800; color:#78350f; }
.cert-actions     { display:flex; gap:8px; justify-content:center; }
.cert-print-btn { background:linear-gradient(135deg,#1d4ed8,#1e40af); color:#fff; border:none; border-radius:10px; padding:10px 22px; font-family:var(--font); font-size:.85rem; font-weight:900; cursor:pointer; transition:transform .15s; }
.cert-print-btn:hover { transform:scale(1.04); }
.cert-close-btn { background:#f1f5f9; color:#475569; border:2px solid #e2e8f0; border-radius:10px; padding:10px 18px; font-family:var(--font); font-size:.85rem; font-weight:800; cursor:pointer; }
.cert-close-btn:hover { background:#e2e8f0; }


/* ═══════════════════════════════════════════════════════════
   RESET MODAL
═══════════════════════════════════════════════════════════ */
.reset-card { max-width:360px; width:94vw; text-align:center; background:#fff !important; }
.reset-icon  { font-size:3rem; margin-bottom:8px; }
.reset-title { font-family:var(--display); font-size:1.25rem; color:#1e293b; margin-bottom:8px; }
.reset-body  { font-size:0.88rem; font-weight:700; color:#475569; line-height:1.6; margin-bottom:20px; }
.reset-btns  { display:flex; gap:8px; justify-content:center; }
.reset-confirm-btn { background:linear-gradient(135deg,#16a34a,#15803d); color:#fff; border:none; border-radius:10px; padding:10px 20px; font-family:var(--font); font-size:.85rem; font-weight:900; cursor:pointer; transition:transform .15s; }
.reset-confirm-btn:hover { transform:scale(1.04); }
.reset-cancel-btn { background:#f1f5f9; color:#475569; border:2px solid #e2e8f0; border-radius:10px; padding:10px 16px; font-family:var(--font); font-size:.85rem; font-weight:800; cursor:pointer; }
.reset-cancel-btn:hover { background:#e2e8f0; }


/* ═══════════════════════════════════════════════════════════
   AVATAR PICKER MODAL
═══════════════════════════════════════════════════════════ */
.avatar-card { max-width: 480px; padding: 28px 24px 24px; text-align: center; }
.avatar-modal-title { font-size: 1.4rem; font-weight: 800; color: #1e3a5f; margin-bottom: 4px; }
.avatar-modal-sub { font-size: 0.9rem; color: #64748b; margin-bottom: 16px; }
.avatar-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; margin-bottom: 20px; max-height: 280px; overflow-y: auto; }
.av-btn {
  background: #f1f5f9; border: 3px solid transparent; border-radius: 10px;
  font-size: 1.6rem; padding: 6px 2px; cursor: pointer;
  transition: transform 0.15s, border-color 0.15s; line-height: 1;
}
.av-btn:hover { transform: scale(1.15); background: #e0f2fe; }
.av-btn.selected { border-color: #3b82f6; background: #dbeafe; transform: scale(1.2); }
.avatar-modal-btns { display: flex; gap: 10px; justify-content: center; }
.avatar-save-btn { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; border: none; border-radius: 10px; padding: 10px 24px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: transform 0.15s; }
.avatar-save-btn:hover { transform: scale(1.04); }
.avatar-cancel-btn { background: #e2e8f0; color: #475569; border: none; border-radius: 10px; padding: 10px 20px; font-size: 1rem; font-weight: 600; cursor: pointer; }


/* ═══════════════════════════════════════════════════════════
   ADMIN LOGIN
═══════════════════════════════════════════════════════════ */
.admin-footer-btn { background: none; border: none; cursor: pointer; font-size: .85rem; opacity: .45; transition: opacity .2s; padding: 0 2px; line-height: 1; }
.admin-footer-btn:hover { opacity: 1; }
.admin-login-card { background: #0f172a !important; border: 2px solid #334155 !important; text-align: center; max-width: 340px !important; }
.adm-login-icon  { font-size: 2.5rem; margin-bottom: 8px; }
.adm-login-title { font-family: var(--display); font-size: 1.3rem; font-weight: 900; color: #f1f5f9; margin-bottom: 4px; }
.adm-login-sub   { font-size: .8rem; color: #64748b; margin-bottom: 16px; }
.adm-pw-inp { width: 100%; padding: 11px 14px; border-radius: 10px; border: 2px solid #334155; background: #1e293b; color: #f1f5f9; font-size: 1rem; font-family: var(--font); margin-bottom: 10px; outline: none; }
.adm-pw-inp:focus { border-color: #0891b2; }
.adm-pw-error { font-size: .82rem; color: #f87171; margin-bottom: 10px; font-weight: 700; }
.adm-pw-error.hidden { display: none; }
.adm-enter-btn { width: 100%; padding: 11px; border-radius: 10px; border: none; background: linear-gradient(135deg,#0891b2,#0284c7); color: #fff; font-size: .95rem; font-weight: 900; cursor: pointer; font-family: var(--font); margin-bottom: 8px; transition: opacity .15s; }
.adm-enter-btn:hover { opacity: .88; }
.adm-cancel-btn { width: 100%; padding: 9px; border-radius: 10px; border: 1.5px solid #334155; background: transparent; color: #94a3b8; font-size: .85rem; font-weight: 700; cursor: pointer; font-family: var(--font); }
.adm-cancel-btn:hover { background: #1e293b; }


/* ═══════════════════════════════════════════════════════════
   ADMIN PANEL
═══════════════════════════════════════════════════════════ */
#admin-panel-modal { align-items: flex-start; overflow-y: auto; padding: 20px 16px; }
.adm-panel-card { background: #0f172a; border-radius: 20px; width: 100%; max-width: 860px; margin: 0 auto; box-shadow: 0 24px 80px rgba(0,0,0,.7); padding: 0 0 24px; overflow: hidden; color: #f1f5f9; font-family: var(--font); }
.adm-header { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg,#0891b2,#0284c7); padding: 18px 24px; }
.adm-title  { font-family: var(--display); font-size: 1.4rem; font-weight: 900; color: #fff; }
.adm-date   { font-size: .75rem; color: rgba(255,255,255,.75); margin-top: 2px; }
.adm-logout-btn { background: rgba(255,255,255,.15); color: #fff; border: 1.5px solid rgba(255,255,255,.3); border-radius: 8px; padding: 8px 16px; font-size: .85rem; font-weight: 900; cursor: pointer; font-family: var(--font); transition: background .15s; }
.adm-logout-btn:hover { background: rgba(255,255,255,.25); }
.adm-student-strip { display: flex; align-items: center; gap: 14px; background: #1e293b; padding: 14px 24px; border-bottom: 1px solid #334155; }
.adm-strip-avatar { font-size: 2.2rem; flex-shrink: 0; }
.adm-strip-name   { font-size: 1.1rem; font-weight: 900; color: #f1f5f9; }
.adm-strip-stats  { font-size: .78rem; color: #94a3b8; font-weight: 700; margin-top: 3px; }
.adm-section-title { font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #64748b; padding: 18px 24px 8px; }
.adm-zone-table { width: 100%; border-collapse: collapse; font-size: .85rem; margin: 0 0 4px; }
.adm-zone-table th { background: #1e293b; text-align: left; padding: 8px 12px; font-size: .68rem; font-weight: 900; letter-spacing: .05em; color: #64748b; text-transform: uppercase; }
.adm-zone-table td { padding: 9px 12px; border-bottom: 1px solid #1e293b; color: #e2e8f0; }
.adm-zone-table tr:hover td { background: #1e293b; }
.adm-mini-bar  { background:#334155; border-radius:999px; height:7px; width:80px; overflow:hidden; display:inline-block; vertical-align:middle; }
.adm-mini-fill { height:100%; border-radius:999px; background:linear-gradient(90deg,#0891b2,#22d3ee); min-width:2px; }
.adm-mini-pct  { font-size:.72rem; color:#94a3b8; margin-left:6px; }
.adm-guide-btn { background: #1e3a5f; color: #60aee6; border: 1.5px solid #2d5986; border-radius: 7px; padding: 4px 10px; font-size: .72rem; font-weight: 800; cursor: pointer; font-family: var(--font); white-space: nowrap; transition: background .15s; }
.adm-guide-btn:hover { background: #243f63; }
.adm-actions-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 24px 10px; }
.adm-act { border: none; border-radius: 10px; padding: 10px 18px; font-size: .85rem; font-weight: 900; cursor: pointer; font-family: var(--font); transition: opacity .15s; color: #fff; }
.adm-act:hover { opacity: .85; }
.adm-act.blue  { background: linear-gradient(135deg,#0891b2,#0284c7); }
.adm-act.amber { background: linear-gradient(135deg,#d97706,#b45309); }
.adm-act.red   { background: linear-gradient(135deg,#dc2626,#b91c1c); }
.adm-close-row { text-align: center; padding: 16px 24px 0; }
.adm-close-btn { background: #1e293b; color: #94a3b8; border: 1.5px solid #334155; border-radius: 10px; padding: 10px 32px; font-size: .9rem; font-weight: 900; cursor: pointer; font-family: var(--font); transition: background .15s; }
.adm-close-btn:hover { background: #334155; color: #e2e8f0; }


/* ═══════════════════════════════════════════════════════════
   ADMIN LEVEL PREVIEW
═══════════════════════════════════════════════════════════ */
#level-preview-modal { align-items: center; justify-content: center; }
.lp-card { background: #fff; border-radius: 20px; max-width: 760px; width: 93vw; max-height: 87vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.lp-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: #0f172a; gap: 14px; flex-shrink: 0; border-radius: 20px 20px 0 0; }
.lp-header-left { display: flex; align-items: center; gap: 14px; }
.lp-icon { font-size: 2.2rem; line-height: 1; }
.lp-name { font-family: var(--display); font-size: 1.05rem; color: #fff; }
.lp-learn { font-size: 0.7rem; font-weight: 700; color: #94a3b8; }
.lp-close-btn { background: #dc2626; color: #fff; border: none; border-radius: 10px; padding: 8px 16px; font-weight: 800; cursor: pointer; font-size: 0.82rem; flex-shrink: 0; font-family: var(--font); }
.lp-close-btn:hover { background: #b91c1c; }
.lp-questions { overflow-y: auto; padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.lp-q-card { background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; }
.lp-q-num { font-size: 0.67rem; font-weight: 900; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; }
.lp-q-type { color: #6d28d9; }
.lp-q-text { font-size: 0.88rem; font-weight: 800; color: #1e293b; margin-bottom: 9px; line-height: 1.4; }
.lp-code { background: #0f172a; color: #7dd3fc; padding: 9px 12px; border-radius: 9px; font-size: 0.8rem; margin-bottom: 9px; white-space: pre-wrap; overflow-x: auto; }
.lp-answers { display: flex; flex-direction: column; gap: 5px; }
.lp-opt { padding: 7px 11px; border-radius: 9px; font-size: 0.8rem; font-weight: 700; }
.lp-correct { background: #dcfce7; border: 2px solid #22c55e; color: #166534; }
.lp-wrong   { background: #fef2f2; border: 2px solid #fca5a5; color: #991b1b; }


/* ═══════════════════════════════════════════════════════════
   PARENT PROGRESS REPORT
═══════════════════════════════════════════════════════════ */
#report-modal { align-items: flex-start; overflow-y: auto; padding: 24px 16px; }
.rp-card {
  background: #fff; border-radius: 18px;
  width: 100%; max-width: 680px; margin: 0 auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
  padding: 28px 32px; color: #0f172a; font-family: var(--font);
}
.rp-header { display: flex; align-items: center; justify-content: space-between; background: #f0f9ff; border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; }
.rp-icon   { font-size: 2rem; }
.rp-title  { font-family: var(--display); font-size: 1.2rem; color: #0891b2; flex: 1; margin: 0 12px; }
.rp-student { font-size: .88rem; font-weight: 800; color: #0f172a; }
.rp-close  { background: #ef4444; color: #fff; border: none; border-radius: 8px; padding: 7px 14px; font-size: .82rem; font-weight: 900; cursor: pointer; font-family: var(--font); }
.rp-body   { display: flex; flex-direction: column; gap: 8px; }
.rp-stat   { font-size: .9rem; font-weight: 700; color: #1e293b; padding: 6px 0; border-bottom: 1px solid #f1f5f9; }
.rp-prog-outer { height: 18px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin: 8px 0; }
.rp-prog-inner { height: 100%; background: linear-gradient(90deg,#0891b2,#22d3ee); border-radius: 999px; min-width: 4px; transition: width .4s; }
.rp-zone-title { font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin-top: 12px; margin-bottom: 6px; }
.rp-zone-row { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 700; padding: 5px 8px; border-radius: 8px; background: #f8fafc; margin-bottom: 4px; }
.rp-footer { text-align: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid #f1f5f9; }
.rp-print-btn { background: linear-gradient(135deg,#0891b2,#0284c7); color:#fff; border: none; border-radius: 10px; padding: 10px 24px; font-size: .9rem; font-weight: 900; cursor: pointer; font-family: var(--font); transition: opacity .15s; }
.rp-print-btn:hover { opacity: .88; }


/* ═══════════════════════════════════════════════════════════
   ZONE GUIDE MODAL
═══════════════════════════════════════════════════════════ */
#zone-guide-modal { align-items: flex-start; overflow-y: auto; padding: 20px; }
.zg-card { background: #fff; border-radius: 20px; width: 100%; max-width: 860px; margin: 0 auto; box-shadow: 0 24px 80px rgba(0,0,0,.55); display: flex; flex-direction: column; max-height: calc(100vh - 40px); overflow: hidden; }
.zg-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 4px solid #10b981; flex-shrink: 0; flex-wrap: wrap; gap: 10px; }
.zg-header-left  { display: flex; flex-direction: column; gap: 4px; }
.zg-header-right { display: flex; align-items: center; gap: 10px; }
.zg-title { font-family: var(--display); font-size: 1.35rem; font-weight: 900; color: #0f172a; }
.zg-age-badge { font-size: .72rem; font-weight: 800; color: #64748b; letter-spacing: .06em; text-transform: uppercase; }
.zg-print-btn { background: #e2e8f0; color: #334155; border: none; border-radius: 8px; padding: 7px 14px; font-size: .8rem; font-weight: 800; cursor: pointer; font-family: var(--font); transition: background .15s; }
.zg-print-btn:hover { background: #cbd5e1; }
.zg-close-btn { background: #ef4444; color: #fff; border: none; border-radius: 8px; padding: 7px 16px; font-size: .85rem; font-weight: 900; cursor: pointer; font-family: var(--font); transition: background .15s; }
.zg-close-btn:hover { background: #dc2626; }
.zg-body { overflow-y: auto; padding: 20px 24px; flex: 1; display: flex; flex-direction: column; gap: 16px; }

/* Zone guide level cards */
.zg-level { border: 2px solid #e2e8f0; border-radius: 14px; padding: 16px 18px; }
.zg-lv-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.zg-lv-icon { font-size: 1.5rem; }
.zg-lv-name { font-family: var(--display); font-size: 1rem; color: #0f172a; flex: 1; }
.zg-lv-stars { font-size: 1rem; letter-spacing: 2px; }
.zg-lv-learn { font-size: .78rem; font-weight: 800; color: #64748b; background: #f1f5f9; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; display: inline-block; }
.zg-teacher-say { font-size: .88rem; font-weight: 700; color: #334155; line-height: 1.65; background: #f8fafc; border-left: 4px solid #10b981; border-radius: 0 10px 10px 0; padding: 10px 14px; margin-bottom: 8px; }
.zg-teacher-board { background: #0f172a; color: #86efac; border-radius: 10px; padding: 12px 16px; }
.zg-teacher-board pre { font-family: 'Courier New', monospace; font-size: .82rem; line-height: 1.6; white-space: pre-wrap; }


/* ═══════════════════════════════════════════════════════════
   BRAND TV LOGO
═══════════════════════════════════════════════════════════ */
.brand-tv-link { display: flex; align-items: center; margin-left: 10px; opacity: 0.85; transition: opacity 0.2s; }
.brand-tv-link:hover { opacity: 1; }
.brand-tv-logo { height: 38px; width: auto; filter: brightness(1.1); }


/* ═══════════════════════════════════════════════════════════
   SITE FOOTER
═══════════════════════════════════════════════════════════ */
.site-footer { flex-shrink: 0; background: #060e1e; border-top: 2px solid #1e3a5f; padding: 10px 20px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; max-width: 1400px; margin: 0 auto; }
.footer-brand { display: flex; align-items: center; gap: 8px; color: #94a3b8; font-size: 0.78rem; }
.footer-tv-logo { height: 28px; width: auto; }
.footer-brand-name { color: #22d3ee; font-weight: 700; letter-spacing: 0.04em; }
.footer-sep { color: #334155; }
.footer-tagline { color: #64748b; font-size: 0.72rem; }
.footer-projects { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.footer-proj { display: flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; border: 1px solid #1e3a5f; background: #0a1628; color: #94a3b8; text-decoration: none; font-size: 0.73rem; font-weight: 700; transition: border-color 0.2s, color 0.2s, background 0.2s; }
.footer-proj:hover { border-color: #22d3ee; color: #22d3ee; background: #0f2640; }
.fp-logo  { height: 18px; width: auto; border-radius: 3px; }
.fp-emoji { font-size: 1rem; line-height: 1; }
.footer-legal { display: flex; align-items: center; gap: 6px; font-size: 0.7rem; color: #475569; }
.footer-legal-link { color: #64748b; text-decoration: none; transition: color 0.2s; }
.footer-legal-link:hover { color: #22d3ee; }


/* ═══════════════════════════════════════════════════════════
   CONFETTI
═══════════════════════════════════════════════════════════ */
#confetti-box { position:fixed; inset:0; pointer-events:none; z-index:9999; overflow:hidden; }
.cp { position:absolute; top:-20px; animation:fall linear forwards; border-radius:3px; }
@keyframes fall { to { transform:translateY(110vh) rotate(900deg); opacity:0; } }


/* ═══════════════════════════════════════════════════════════
   SCREEN TRANSITION OVERLAY
═══════════════════════════════════════════════════════════ */
#screen-overlay { position:fixed; inset:0; background:#0a1628; opacity:0; pointer-events:none; transition:opacity 0.22s ease; z-index:9990; }
#screen-overlay.fading { opacity:0.5; pointer-events:all; }


/* ═══════════════════════════════════════════════════════════
   DARK MODE
═══════════════════════════════════════════════════════════ */
:root.dark { --navy: #020917; }
:root.dark .side-panel   { background:#0f1c2e; border-right-color:#1e3a5f; }
:root.dark .side-panel-divider { background: linear-gradient(90deg, #1e3a5f, #2d1b69); }
:root.dark .info-card    { background:#0f2040; border-color:#1e3a5f; }
:root.dark .card-title   { color:#60a5fa; }
:root.dark .how-ul li    { color:#cbd5e1; }
:root.dark .prog-cheer   { color:#94a3b8; }
:root.dark .badge-name   { color:#e2e8f0; }
:root.dark .badge-desc   { color:#64748b; }
:root.dark .mission-card { background:#1c1208 !important; border-color:#78350f !important; }
:root.dark .mission-text { color:#fed7aa; }
:root.dark .zone-section  { background: rgba(15,28,46,0.7); border-color: #1e3a5f; }
:root.dark .zone-header   { background: #0f1c2e !important; }
:root.dark .zone-label    { /* color comes from inline style, keep it */ }
:root.dark .zone-ages     { background: #1e293b; color: #94a3b8; }
:root.dark .zone-cards    { background: rgba(15,28,46,.3); }
:root.dark .level-card    { background: #0f2040; border-color: #1e3a5f; }
:root.dark .level-card.complete { background: #052e16; border-color: #16a34a; }
:root.dark .lc-name       { color: #e2e8f0; }
:root.dark .lc-id         { color: #475569; }
:root.dark .lc-learn      { background: #1e3a5f; color: #93c5fd; }
:root.dark .lcs            { color: #334155; }
:root.dark .ground { background: linear-gradient(180deg, #0a1628 0%, #0d1f3c 100%); border-top-color: #1e3a5f; }
:root.dark .ground::before { background-image: radial-gradient(circle, rgba(255,255,255,.04) 3px, transparent 3px); }
:root.dark .q-timer-track { background: #1e3a5f; }
:root.dark .q-timer-badge { color: #94a3b8; }
:root.dark .q-timer-badge.timer-warning { color: #fbbf24; }
:root.dark .q-timer-badge.timer-danger  { color: #f87171; }
:root.dark .q-dot { background: #334155; }
:root.dark .q-dot.dot-done { background: #16a34a; }
:root.dark .q-dot.dot-current { background: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,0.25); }
:root.dark .zg-card       { background: #1e293b; }
:root.dark .zg-title      { color: #f1f5f9; }
:root.dark .zg-lv-name    { color: #f1f5f9; }
:root.dark .zg-lv-learn   { background: #1e3a5f; color: #93c5fd; }
:root.dark .zg-level      { border-color: #334155; }
:root.dark .zg-teacher-say { background: #0f172a; color: #cbd5e1; }
:root.dark .av-btn { background: #1e293b; }
:root.dark .av-btn:hover { background: #1e3a5f; }
:root.dark .av-btn.selected { background: #1e3a5f; border-color: #60a5fa; }
:root.dark .avatar-modal-title { color: #e2e8f0; }
:root.dark .avatar-cancel-btn { background: #334155; color: #cbd5e1; }
:root.dark .level-card:not(.locked):hover { box-shadow: 0 10px 30px rgba(0,0,0,0.45); }

/* Dark mode — lab */
:root.dark .lab-main { background: #1e293b; }
:root.dark .lab-panel-title { color: #f1f5f9; }
:root.dark .lab-panel-sub   { color: #94a3b8; }
:root.dark .scramble-input  { background: #052e16; border-color: #16a34a; }
:root.dark .scr-placeholder { color: #4ade80; }
:root.dark .scr-word { background: #1e3a5f; border-color: #2d5986; color: #93c5fd; }
:root.dark .scr-word:hover { background: #243f63; border-color: #4d7aad; }
:root.dark .spell-hint-box { background: #1c1208; border-color: #92400e; }
:root.dark .spell-hint-text { color: #fde68a; }
:root.dark .spell-inp { background: #1e293b; color: #e2e8f0; border-color: #4f46e5; }
:root.dark .typing-inp { background: #1e293b; color: #e2e8f0; border-color: #4f46e5; }
:root.dark .typing-stats { color: #94a3b8; }
:root.dark .scr-build-label, :root.dark .scr-words-label { color: #94a3b8; }
:root.dark .lab-btn-new { background: #1e293b; color: #94a3b8; border-color: #334155; }
:root.dark .lab-btn-new:hover { background: #334155; }


/* ═══════════════════════════════════════════════════════════
   ARABIC RTL SUPPORT
═══════════════════════════════════════════════════════════ */
:root[dir="rtl"] .top-bar       { direction:rtl; }
:root[dir="rtl"] .brand         { flex-direction:row-reverse; }
:root[dir="rtl"] .top-right     { flex-direction:row-reverse; }
:root[dir="rtl"] .map-body      { flex-direction:row-reverse; }
:root[dir="rtl"] .age-hdr-left  { flex-direction:row-reverse; }
:root[dir="rtl"] .age-hdr-right { flex-direction:row-reverse; }
:root[dir="rtl"] .pip-bubble    { text-align:right; direction:rtl; }
:root[dir="rtl"] .chall-pip-bubble { text-align:right; direction:rtl; }
:root[dir="rtl"] .q-question    { direction:rtl; text-align:right; }
:root[dir="rtl"] .opt-btn       { flex-direction:row-reverse; text-align:right; }
:root[dir="rtl"] .result-body   { direction:rtl; text-align:right; }
:root[dir="rtl"] .ribbon-center { direction:rtl; }
:root[dir="rtl"] .chall-ribbon  { flex-direction:row-reverse; }
:root[dir="rtl"] .lab-tabs      { direction:rtl; }


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  html, body { overflow: auto; height: auto; }
  .screen { height: auto; min-height: 100dvh; }

  .top-bar { padding: 8px 10px; flex-wrap: wrap; gap: 6px; }
  .brand { gap: 7px; }
  .brand-snake { font-size: 1.6rem; }
  .brand-name { font-size: 1.05rem; }
  .brand-tag { display: none; }
  .brand-tv-logo { height: 26px; }
  .top-right { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 5px; }
  .tbtn { padding: 5px 9px; font-size: 0.72rem; border-radius: 8px; }
  .star-count { padding: 4px 10px; font-size: 0.82rem; min-width: 50px; }

  .map-body { flex-direction: column; overflow: auto; }
  .panel { width: 100%; min-width: unset; flex-shrink: 1; padding: 8px; gap: 6px; }
  .side-panel { border-right: none; border-bottom: 3px solid #fde68a; }
  .map-body.sidebar-hidden .side-panel { display: none !important; width: auto !important; min-width: unset !important; padding: 8px !important; overflow: auto !important; border: none !important; }

  .pip-area { flex-direction: row; align-items: center; gap: 10px; padding-bottom: 8px; }
  .pip-char { font-size: 2.5rem; flex-shrink: 0; }
  .pip-label { display: none; }
  .pip-bubble { font-size: 0.73rem; text-align: left; }

  .info-card { padding: 8px 10px; }
  .card-title { font-size: 0.62rem; margin-bottom: 5px; }
  .how-ul li { font-size: 0.72rem; }
  .profile-card { display: flex; align-items: center; gap: 10px; padding: 10px; }
  .prof-avatar { font-size: 1.8rem; margin-bottom: 0; }
  .prof-name { font-size: 0.85rem; margin-bottom: 0; }
  .prof-stats { gap: 8px; }

  .ground { overflow-y: visible; padding: 10px 8px 60px; }
  .zone-cards { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 8px; }
  .level-card { min-height: 100px; padding: 8px 5px 7px; border-radius: 12px; }
  .lc-icon  { font-size: 1.5rem; }
  .lc-name  { font-size: 0.68rem; }
  .lc-learn { font-size: 0.55rem; padding: 1px 5px; }
  .lc-stars { font-size: 0.78rem; }
  .zone-label { font-size: 0.72rem; }
  .zone-ages  { display: none; }
  .start-adv-btn { font-size: 0.9rem; padding: 10px 24px; bottom: 6px; }

  .site-footer { padding: 8px 12px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
  .footer-brand { font-size: 0.7rem; }
  .footer-tv-logo { height: 20px; }
  .footer-projects { gap: 5px; }
  .footer-proj { font-size: 0.65rem; padding: 3px 8px; }
  .fp-logo { height: 14px; }
  .footer-legal { font-size: 0.62rem; }

  /* Lab screen mobile */
  .lab-tabs { padding: 0 8px; overflow-x: auto; }
  .lab-tab { padding: 9px 12px; font-size: .75rem; }
  .lab-wrap { flex-direction: column; padding: 8px; gap: 8px; }
  .lab-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; gap: 6px; overflow-y: visible; }
  .lab-owlie, .lab-title, .lab-subtitle { display: none; }
  .lab-tip-box { flex-direction: row; flex-wrap: wrap; gap: 5px; }
  .lab-tip-item { font-size: .65rem; padding: 5px 8px; }
  .lab-main { padding: 14px 16px; border-radius: 10px; }
  .lab-panel-title { font-size: 1.05rem; }
  .lab-panel-sub { font-size: .78rem; margin-bottom: 14px; }
  .scr-word { font-size: .78rem; padding: 5px 10px; }
  .scr-chosen { font-size: .78rem; padding: 4px 9px; }
  .spell-hint-text { font-size: .95rem; }
  .typing-passage-text { font-size: .9rem; }

  /* Challenge screen mobile */
  .chall-ribbon { padding: 8px 10px; flex-wrap: wrap; gap: 6px; }
  .ribbon-level { font-size: 0.85rem; }
  .ribbon-stars { font-size: 1.1rem; min-width: 60px; }
  .ribbon-voice-btn, .ribbon-stop-btn { font-size: 0.7rem; padding: 5px 8px; }
  .chall-split { flex-direction: column; overflow: auto; }
  .chall-pip-col { width: 100%; max-width: 100%; min-width: unset; flex-direction: row; align-items: center; padding: 10px 12px; gap: 10px; justify-content: flex-start; border-bottom: 2px solid rgba(255,255,255,0.08); }
  .chall-pip-emoji { font-size: 3.5rem; }
  .chall-pip-bubble { font-size: 0.78rem; padding: 9px 11px; border-radius: 12px; flex: 1; }
  .chall-q-col { align-items: flex-start; padding: 10px 12px 20px; overflow-y: auto; }
  .q-card { max-width: 100%; border-radius: 16px; }
  .q-question { font-size: 0.97rem; padding: 14px 14px 6px; }
  .q-code { margin: 0 14px 10px; font-size: 0.78rem; padding: 10px 12px; }
  .q-opts { padding: 6px 14px 14px; gap: 7px; }
  .opt-btn { padding: 10px 12px; font-size: 0.85rem; gap: 8px; border-radius: 10px; }
  .opt-label { width: 26px; height: 26px; font-size: 0.75rem; }
  .opt-emoji { font-size: 1.1rem; }
  .q-result { margin: 0 14px 14px; }
  .result-body { font-size: 0.82rem; padding: 10px 12px; }
  .result-action-btn { font-size: 0.88rem; padding: 11px; }

  /* Win screen mobile */
  .win-card { padding: 24px 18px; border-radius: 20px; }
  .win-pip { font-size: 3.5rem; }
  .win-headline { font-size: 1.6rem; }
  .win-stars { font-size: 1.8rem; }
  .win-sub { font-size: 0.9rem; }
  .win-fact { font-size: 0.8rem; padding: 10px 12px; }

  /* Modals mobile */
  .modal-card { padding: 16px; border-radius: 18px; }
  .name-card { max-width: 92vw !important; padding: 24px 18px !important; }
  .name-pip { font-size: 3.5rem; }
  .name-title { font-size: 1.2rem; }
  .name-inp { font-size: 0.95rem; padding: 11px 14px; }
  .name-btn { font-size: 0.95rem; padding: 12px; }
  .avatar-grid { grid-template-columns: repeat(6, 1fr); }
  .avatar-card { padding: 20px 16px; }

  /* Admin mobile */
  .adm-panel-card { border-radius: 14px; }
  .adm-zone-table { font-size: .75rem; }
  .adm-zone-table th, .adm-zone-table td { padding: 7px 8px; }
  .adm-mini-bar { width: 50px; }
  .adm-actions-row { gap: 8px; }
  .adm-act { font-size: .78rem; padding: 9px 12px; }

  /* Report mobile */
  .rp-card { padding: 20px 16px; }

  /* Zone guide mobile */
  #zone-guide-modal { padding: 8px; }
  .zg-card { border-radius: 14px; }
  .zg-header { padding: 12px 14px; }
  .zg-title { font-size: 1rem; }
  .zg-body { padding: 12px 14px; }
  .zg-lv-name { font-size: .88rem; }

  /* RTL mobile */
  :root[dir="rtl"] .map-body        { flex-direction: column; }
  :root[dir="rtl"] .side-panel      { border-right: none; border-bottom: 3px solid #fde68a; }
  :root[dir="rtl"] .pip-bubble      { text-align: right; }
  :root[dir="rtl"] .footer-inner    { align-items: flex-end; }
  :root[dir="rtl"] .lc-done  { right: auto; left: 6px; }
}

/* ── Tablet ── */
@media (min-width: 769px) and (max-width: 1024px) {
  .panel { width: 170px; min-width: 155px; }
  .zone-cards { grid-template-columns: repeat(3, 1fr); }
  .tbtn { padding: 6px 10px; font-size: 0.75rem; }
}

/* ── Very small phones ── */
@media (max-width: 380px) {
  .age-grid { grid-template-columns: repeat(2, 1fr); }
  .tbtn { padding: 4px 7px; font-size: 0.65rem; }
  .opt-btn { font-size: 0.78rem; padding: 8px 10px; }
}


/* ═══════════════════════════════════════════════════════════
   BADGE + ACHIEVEMENT ITEMS (sidebar)
═══════════════════════════════════════════════════════════ */
.badge-item {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 4px; border-bottom: 1px solid #f3f4f6;
  font-size: .78rem; font-weight: 800; color: #1c1917;
}
.badge-item span:first-child { font-size: 1.1rem; flex-shrink: 0; }
.badge-item .badge-name { font-size: .74rem; font-weight: 900; color: #1c1917; }
.no-badges { font-size: .74rem; font-weight: 700; color: #94a3b8; font-style: italic; padding: 4px 0; }
:root.dark .badge-item .badge-name { color: #e2e8f0; }
:root.dark .badge-item { border-bottom-color: #1e3a5f; }


/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATION
═══════════════════════════════════════════════════════════ */
.ea-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1e293b; color: #f1f5f9;
  border-radius: 12px; padding: 12px 24px;
  font-family: var(--font); font-size: .9rem; font-weight: 800;
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
  z-index: 9998; opacity: 0;
  transition: opacity .35s ease, transform .35s ease;
  border: 1.5px solid #334155;
  pointer-events: none; white-space: nowrap;
}
.ea-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }


/* ═══════════════════════════════════════════════════════════
   PRINT
═══════════════════════════════════════════════════════════ */
@media print {
  body > * { display:none !important; }
  #cert-modal:not(.hidden)       { display:block !important; position:static !important; background:#fff !important; }
  #zone-guide-modal:not(.hidden) { display:block !important; position:static !important; background:#fff !important; padding:0 !important; }
  #zone-guide-modal .zg-card     { box-shadow:none !important; max-height:none !important; border-radius:0 !important; }
  #zone-guide-modal .zg-body     { overflow:visible !important; }
  #report-modal:not(.hidden)     { display:block !important; position:static !important; background:#fff !important; padding:0 !important; }
  #report-modal .rp-card         { box-shadow:none !important; border-radius:0 !important; max-width:none !important; }
  .modal-card  { box-shadow:none !important; max-height:none !important; overflow:visible !important; }
  .cert-actions, .cert-close-btn, .cert-print-btn, .modal-x { display:none !important; }
  .zg-header-right { display:none !important; }
  .rp-footer { display:none !important; }
}
