/* ============================================================
   Hifz Quest — gamified Quran memorization
   ============================================================ */
:root {
  --bg: #081410;
  --bg-2: #0c1d16;
  --card: #122419;
  --card-2: #16301f;
  --line: rgba(126, 231, 163, 0.14);
  --line-soft: rgba(126, 231, 163, 0.08);
  --text: #eafff2;
  --muted: #9dc4ab;
  --green: #2ee66f;
  --green-deep: #16a34a;
  --gold: #f5c451;
  --gold-deep: #d99a1f;
  --cyan: #4cc9f0;
  --red: #ff6b6b;
  --purple: #b388ff;
  --grad-xp: linear-gradient(90deg, #ffd76a, #ff9d2e);
  --grad-btn: linear-gradient(135deg, #2ee66f, #0f9d58);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --arabic-font: "Amiri Quran", "Scheherazade New", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
.ornament {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(46, 230, 111, 0.12), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(245, 196, 81, 0.08), transparent 60%),
    radial-gradient(600px 400px at 50% 120%, rgba(76, 201, 240, 0.06), transparent 60%);
}
::selection { background: rgba(46, 230, 111, 0.35); }

/* ---------- Top bar ---------- */
#topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 18px;
  background: rgba(8, 20, 16, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.brand-mark {
  font-size: 30px; color: var(--gold);
  filter: drop-shadow(0 0 8px rgba(245, 196, 81, 0.5));
}
.brand-name { font-weight: 900; font-size: 22px; letter-spacing: 0.5px; }
.brand-name .accent { color: var(--green); }

#main-nav { display: flex; gap: 6px; margin-inline-start: 8px; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; color: var(--muted);
  border: 1px solid transparent; border-radius: 999px;
  padding: 8px 14px; font-family: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: all 0.15s ease;
}
.nav-btn:hover { color: var(--text); background: rgba(46, 230, 111, 0.08); }
.nav-btn.active {
  color: #052012; background: var(--green);
  box-shadow: 0 4px 14px rgba(46, 230, 111, 0.35);
}
.hud { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.hud-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--text); border-radius: 999px; padding: 7px 12px;
  font-family: inherit; font-weight: 800; font-size: 14px; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.hud-pill:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.hud-streak i { color: #ff8a3d; }
.hud-gems i { color: var(--cyan); }
.hud-level { gap: 9px; }
.lvl-badge {
  min-width: 26px; height: 26px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-xp); color: #3a2500;
  border-radius: 8px; font-weight: 900; font-size: 14px;
}
.xp-bar {
  width: 90px; height: 8px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.12); overflow: hidden;
}
.xp-fill {
  display: block; height: 100%; width: 0%;
  background: var(--grad-xp); border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.2, 0.9, 0.2, 1);
}
.xp-text { font-size: 12px; color: var(--muted); min-width: 44px; text-align: right; }
.bump { animation: bump 0.45s ease; }
@keyframes bump { 30% { transform: scale(1.18); } }

/* ---------- Layout ---------- */
#view { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 22px 18px 90px; outline: none; }
#app-footer { position: relative; z-index: 1; text-align: center; color: var(--muted); font-size: 12px; padding: 18px 14px 30px; }

/* ---------- Generic UI ---------- */
.card {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 800; font-size: 15px;
  border: none; border-radius: 12px; padding: 11px 18px;
  cursor: pointer; transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
  color: var(--text); background: var(--card-2); border: 1px solid var(--line);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.primary { background: var(--grad-btn); color: #04180c; box-shadow: 0 6px 18px rgba(46, 230, 111, 0.28); }
.btn.gold { background: linear-gradient(135deg, #ffd76a, #e8a020); color: #3a2500; box-shadow: 0 6px 18px rgba(245, 196, 81, 0.25); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(46, 230, 111, 0.1); color: var(--green);
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 12px; font-weight: 800; padding: 4px 11px;
}
.chip.gold { background: rgba(245, 196, 81, 0.12); color: var(--gold); }
.chip.muted { background: rgba(255,255,255,0.05); color: var(--muted); }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- Home / Dashboard ---------- */
.hero { text-align: center; padding: 34px 10px 10px; }
.hero h1 {
  font-size: clamp(28px, 5vw, 44px); font-weight: 900; line-height: 1.15;
  background: linear-gradient(90deg, #eafff2, #7be8a4 55%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); max-width: 620px; margin: 12px auto 0; font-size: 15px; }
.hero .bismillah {
  font-family: var(--arabic-font); font-size: 30px; color: var(--gold);
  margin-bottom: 10px; text-shadow: 0 0 24px rgba(245,196,81,0.35);
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 22px 0; }
.stat-card { text-align: center; padding: 16px 10px; position: relative; overflow: hidden; }
.stat-card .ic { font-size: 22px; margin-bottom: 6px; }
.stat-card .v { font-size: 26px; font-weight: 900; }
.stat-card .l { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 900; margin: 28px 0 14px; }
.section-title i { color: var(--green); }

.level-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.level-orb {
  width: 92px; height: 92px; border-radius: 50%; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 25%, #ffefbe, var(--gold) 45%, var(--gold-deep));
  color: #3a2500; box-shadow: 0 0 34px rgba(245, 196, 81, 0.45), inset 0 -6px 14px rgba(0,0,0,0.25);
  font-weight: 900;
}
.level-orb .n { font-size: 34px; line-height: 1; }
.level-orb .t { font-size: 10px; letter-spacing: 1px; }
.big-xpbar { flex: 1; min-width: 220px; }
.big-xpbar .track { height: 16px; background: rgba(255,255,255,0.1); border-radius: 99px; overflow: hidden; }
.big-xpbar .fill { height: 100%; background: var(--grad-xp); border-radius: 99px; transition: width 0.8s cubic-bezier(0.2,0.9,0.2,1); }
.big-xpbar .labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 700; }
.level-name { font-size: 20px; font-weight: 900; color: var(--gold); }

.continue-card { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.continue-card .ar-snip { font-family: var(--arabic-font); font-size: 24px; color: var(--gold); direction: rtl; flex: 1; min-width: 240px; line-height: 1.9; }
.daily-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-color: rgba(245,196,81,0.3); }
.daily-card .star { font-size: 30px; color: var(--gold); }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.quick-tile { text-align: left; display: flex; gap: 13px; align-items: center; padding: 16px; cursor: pointer; }
.quick-tile .ic {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  background: rgba(46, 230, 111, 0.12); color: var(--green);
}
.quick-tile.gold .ic { background: rgba(245,196,81,0.13); color: var(--gold); }
.quick-tile.cyan .ic { background: rgba(76,201,240,0.12); color: var(--cyan); }
.quick-tile.purple .ic { background: rgba(179,136,255,0.13); color: var(--purple); }
.quick-tile b { display: block; font-size: 15px; }
.quick-tile span { font-size: 12px; color: var(--muted); }

/* ---------- Surah browser ---------- */
.browser-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search-wrap { position: relative; flex: 1; min-width: 220px; }
.search-wrap i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
#search-input {
  width: 100%; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px 11px 38px;
  color: var(--text); font-family: inherit; font-size: 15px; outline: none;
}
#search-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(46,230,111,0.15); }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button {
  background: transparent; border: none; color: var(--muted); font-family: inherit;
  font-weight: 800; font-size: 13px; padding: 7px 13px; border-radius: 9px; cursor: pointer;
}
.seg button.active { background: var(--green); color: #052012; }
.surah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 12px; }
.surah-card {
  position: relative; cursor: pointer; padding: 14px 15px;
  display: flex; align-items: center; gap: 12px;
  transition: transform 0.13s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.surah-card:hover { transform: translateY(-3px); border-color: rgba(46,230,111,0.45); box-shadow: 0 10px 26px rgba(0,0,0,0.4); }
.surah-num {
  width: 42px; height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px; color: var(--gold);
  background: rgba(245,196,81,0.09);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  border: 1px solid rgba(245,196,81,0.3);
}
.surah-info { flex: 1; min-width: 0; }
.surah-info .en { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.surah-info .sub { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.surah-ar { font-family: var(--arabic-font); font-size: 22px; color: var(--green); }
.surah-prog { margin-top: 5px; height: 6px; background: rgba(255,255,255,0.09); border-radius: 99px; overflow: hidden; }
.surah-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--cyan)); border-radius: 99px; }
.surah-card .done-seal { position: absolute; top: 8px; right: 10px; color: var(--gold); font-size: 15px; }

/* ---------- Study ---------- */
.study-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.study-top h2 { font-size: 22px; font-weight: 900; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.study-top .ar-name { font-family: var(--arabic-font); color: var(--green); font-size: 26px; }
.jump-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.jump-form select, .jump-form input {
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; font-family: inherit; font-weight: 700; font-size: 14px;
  padding: 9px 11px; outline: none; max-width: 200px;
}
.jump-form input { width: 80px; }
.jump-form select:focus, .jump-form input:focus { border-color: var(--green); }

.mode-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.mode-btn {
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 8px 15px; font-family: inherit; font-weight: 800;
  font-size: 13px; cursor: pointer; transition: all 0.14s ease;
  display: inline-flex; align-items: center; gap: 7px;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active { background: var(--grad-btn); color: #04180c; border-color: transparent; box-shadow: 0 4px 14px rgba(46,230,111,0.3); }
.mode-btn.quiz-link.active { background: linear-gradient(135deg, #ffd76a, #e8a020); color: #3a2500; }

.ayah-card { position: relative; overflow: hidden; padding: 26px 22px 20px; }
.ayah-card .frame-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(600px 200px at 50% -60px, rgba(245,196,81,0.12), transparent 70%); }
.ayah-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; position: relative; }
.ayah-meta .spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--muted); cursor: pointer; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.13s ease;
}
.icon-btn:hover { color: var(--text); border-color: rgba(46,230,111,0.4); }
.icon-btn.on { color: var(--green); border-color: var(--green); box-shadow: 0 0 10px rgba(46,230,111,0.25); }
.icon-btn.fav.on { color: var(--gold); border-color: var(--gold); box-shadow: 0 0 10px rgba(245,196,81,0.25); }

.arabic-wrap { position: relative; text-align: center; padding: 12px 6px 4px; }
.arabic-text {
  font-family: var(--arabic-font); direction: rtl;
  font-size: clamp(28px, 4.6vw, 42px); line-height: 2.15; color: #f4fff8;
  text-shadow: 0 2px 18px rgba(46,230,111,0.12);
}
.arabic-text.blurred { filter: blur(9px); opacity: 0.55; user-select: none; }
.arabic-text.partial .hide-part { color: transparent; text-shadow: 0 0 14px rgba(244,255,248,0.65); }
.reveal-fab {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
}
.reveal-fab span {
  background: rgba(8,20,16,0.85); border: 1px solid var(--line); color: var(--green);
  border-radius: 999px; padding: 9px 18px; font-weight: 800; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; backdrop-filter: blur(4px);
}
.ayah-num-seal {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; margin-inline-start: 12px; padding: 0 8px;
  font-size: 18px; color: var(--gold); vertical-align: middle;
  border: 2px solid rgba(245,196,81,0.55); border-radius: 50%;
  font-family: "Nunito", sans-serif; font-weight: 900;
}
.translit { text-align: center; color: var(--cyan); font-style: italic; font-size: 16px; margin: 14px auto 4px; max-width: 720px; line-height: 1.7; }
.translation { text-align: center; color: var(--muted); font-size: 15.5px; margin: 8px auto 0; max-width: 720px; line-height: 1.75; }
.translation.blurred, .translit.blurred { filter: blur(7px); opacity: 0.6; user-select: none; }

.ayah-image-wrap { margin: 18px auto 4px; max-width: 760px; text-align: center; }
.ayah-image-wrap img {
  max-width: 100%; border-radius: 12px; border: 1px solid var(--line);
  background: #fdfaf1; padding: 6px;
}
.ayah-image-wrap .cap { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

.audio-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; position: relative; }
.play-btn {
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--grad-btn); color: #04180c; font-size: 19px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(46,230,111,0.35); transition: transform 0.12s ease;
}
.play-btn:hover { transform: scale(1.06); }
.play-btn.playing { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(46,230,111,0.45); } 50% { box-shadow: 0 0 0 12px rgba(46,230,111,0); } }
.audio-row select {
  background: var(--card-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; font-family: inherit; font-weight: 700; font-size: 13px; padding: 9px 10px; outline: none;
}
.loop-pill { display: inline-flex; align-items: center; gap: 6px; }
.loop-pill input { width: 46px; background: var(--card-2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 7px 8px; font-family: inherit; font-weight: 800; text-align: center; outline: none; }
.audio-status { font-size: 12.5px; color: var(--muted); font-weight: 700; }

.study-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); }
.memorized-btn { flex: 1; min-width: 220px; font-size: 16px; padding: 14px 20px; }
.memorized-btn.is-done { background: linear-gradient(135deg, #ffd76a, #e8a020); color: #3a2500; }
.memorized-btn.just-leveled { background: linear-gradient(135deg, #ffd76a, #e8a020); color: #3a2500; }

.practice-panel { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 18px; }
.practice-panel h3 { font-size: 16px; font-weight: 900; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.practice-panel h3 i { color: var(--purple); }
.typing-input {
  width: 100%; min-height: 110px; resize: vertical;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; font-family: var(--arabic-font);
  font-size: 24px; direction: rtl; line-height: 2; outline: none;
}
.typing-input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(179,136,255,0.15); }
.typing-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.typing-feedback { margin-top: 14px; font-family: var(--arabic-font); font-size: 24px; direction: rtl; line-height: 2.1; }
.typing-feedback .ok { color: var(--green); }
.typing-feedback .miss { color: var(--red); text-decoration: underline wavy rgba(255,107,107,0.6); }
.typing-feedback .extra { color: var(--gold); }
.typing-score { font-family: "Nunito", sans-serif; font-size: 14px; font-weight: 900; margin-top: 8px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.pager .dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; flex: 1; }
.pager .dot {
  width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.16);
  cursor: pointer; border: none; padding: 0; transition: all 0.15s ease;
}
.pager .dot.memorized { background: var(--gold); }
.pager .dot.current { transform: scale(1.5); background: var(--green); box-shadow: 0 0 8px rgba(46,230,111,0.6); }

/* ---------- Quiz ---------- */
.quiz-setup { max-width: 640px; margin: 0 auto; }
.quiz-opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 16px 0; }
.quiz-opt {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 12px; text-align: center; cursor: pointer; transition: all 0.14s ease;
  color: var(--text); font-family: inherit;
}
.quiz-opt:hover { border-color: rgba(46,230,111,0.4); transform: translateY(-2px); }
.quiz-opt.selected { border-color: var(--green); background: rgba(46,230,111,0.1); box-shadow: 0 0 0 3px rgba(46,230,111,0.15); }
.quiz-opt b { display: block; font-size: 15px; margin-bottom: 4px; }
.quiz-opt span { font-size: 12px; color: var(--muted); }
.quiz-scope-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.quiz-scope-row select { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-family: inherit; font-weight: 700; outline: none; }

.quiz-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.quiz-head .q-count { font-weight: 900; font-size: 15px; }
.quiz-score-pill { margin-left: auto; }
.quiz-prompt { text-align: center; padding: 24px 18px; }
.quiz-prompt .ar { font-family: var(--arabic-font); font-size: clamp(24px, 4vw, 34px); line-height: 2.1; direction: rtl; margin: 10px 0; }
.quiz-prompt .q-label { color: var(--muted); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.quiz-answers { display: grid; gap: 10px; margin-top: 18px; }
.answer-btn {
  text-align: left; background: var(--card-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; color: var(--text);
  font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 12px; transition: all 0.13s ease;
}
.answer-btn .key {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: rgba(255,255,255,0.08); display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900;
}
.answer-btn:hover:not(:disabled) { border-color: rgba(46,230,111,0.45); transform: translateX(3px); }
.answer-btn.correct { background: rgba(46,230,111,0.16); border-color: var(--green); color: #b8f7cf; }
.answer-btn.wrong { background: rgba(255,107,107,0.13); border-color: var(--red); color: #ffc9c9; }
.answer-btn:disabled { cursor: default; opacity: 0.85; }
.answer-btn.ar-answer { font-family: var(--arabic-font); font-size: 22px; direction: rtl; text-align: right; line-height: 1.9; }
.quiz-feedback { margin-top: 14px; text-align: center; font-weight: 800; min-height: 26px; }
.quiz-feedback.good { color: var(--green); }
.quiz-feedback.bad { color: var(--red); }
.quiz-result { text-align: center; padding: 30px 18px; }
.quiz-result .big { font-size: 52px; font-weight: 900; }
.quiz-result .stars { font-size: 34px; margin: 10px 0; }
.quiz-result .stars .lit { color: var(--gold); }
.quiz-result .stars .dim { color: rgba(255,255,255,0.18); }

/* ---------- Awards ---------- */
.awards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.award-card { display: flex; gap: 13px; align-items: center; padding: 15px; position: relative; }
.award-card .ic {
  width: 50px; height: 50px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: rgba(245,196,81,0.13); color: var(--gold);
}
.award-card.locked { opacity: 0.55; }
.award-card.locked .ic { background: rgba(255,255,255,0.06); color: var(--muted); }
.award-card b { display: block; font-size: 14.5px; }
.award-card span { font-size: 12px; color: var(--muted); }
.award-card .unlock-tag { position: absolute; top: 8px; right: 10px; font-size: 11px; color: var(--gold); font-weight: 900; }

/* ---------- Overlays ---------- */
#overlay-root .xp-pop {
  position: fixed; z-index: 200; pointer-events: none;
  font-weight: 900; font-size: 20px; color: var(--gold);
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
  animation: xp-rise 1.5s ease forwards;
}
@keyframes xp-rise {
  0% { opacity: 0; transform: translateY(6px) scale(0.7); }
  15% { opacity: 1; transform: translateY(0) scale(1.12); }
  30% { transform: translateY(-8px) scale(1); }
  100% { opacity: 0; transform: translateY(-80px); }
}
#toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(10, 24, 18, 0.95); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 18px; font-weight: 800; font-size: 14px;
  box-shadow: var(--shadow); animation: toast-in 0.25s ease;
  display: flex; align-items: center; gap: 9px; max-width: 90vw;
}
.toast i { color: var(--green); }
.toast.gold i { color: var(--gold); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(3, 10, 7, 0.78); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: toast-in 0.22s ease;
}
.levelup-modal { text-align: center; max-width: 420px; width: 100%; padding: 36px 26px; position: relative; overflow: hidden; }
.levelup-modal .orb-big {
  width: 120px; height: 120px; margin: 0 auto 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; font-weight: 900; color: #3a2500;
  background: radial-gradient(circle at 30% 25%, #ffefbe, var(--gold) 45%, var(--gold-deep));
  box-shadow: 0 0 60px rgba(245,196,81,0.6), inset 0 -8px 18px rgba(0,0,0,0.25);
  animation: orb-in 0.7s cubic-bezier(0.2, 1.4, 0.3, 1);
}
@keyframes orb-in { from { transform: scale(0) rotate(-160deg); } }
.levelup-modal h2 { font-size: 30px; font-weight: 900; color: var(--gold); margin-bottom: 6px; }
.levelup-modal .rank { font-size: 18px; font-weight: 900; margin: 8px 0 4px; }
.confetti-piece { position: fixed; z-index: 500; top: -12px; pointer-events: none; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0.8; } }

.loading-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 80px 0; color: var(--muted); font-weight: 800; }
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid rgba(46,230,111,0.15); border-top-color: var(--green);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav-btn span { display: none; }
  .nav-btn { padding: 8px 12px; }
  .xp-bar { width: 56px; }
  .xp-text { display: none; }
  .brand-name { font-size: 19px; }
  #view { padding: 16px 12px 80px; }
  .jump-form { margin-left: 0; width: 100%; }
  .jump-form select { flex: 1; max-width: none; }
  .memorized-btn { min-width: 100%; }
}
