/* ============================================================
   QUR'AN QUIZ — COMPLETE DESIGN SYSTEM
   ============================================================ */

:root {
  --primary: hsl(150, 58%, 26%);
  --primary-h: hsl(150, 55%, 32%);
  --primary-light: hsl(150, 45%, 94%);
  --primary-mid: hsl(150, 38%, 88%);

  --gold: hsl(38, 92%, 44%);
  --gold-light: hsl(38, 100%, 94%);
  --red: hsl(4, 72%, 52%);
  --red-light: hsl(4, 72%, 95%);
  --blue: hsl(212, 76%, 50%);
  --blue-light: hsl(212, 76%, 95%);

  --surface: hsl(0, 0%, 100%);
  --surface-2: hsl(150, 12%, 97%);
  --surface-3: hsl(150, 8%, 93%);
  --border: hsl(150, 10%, 88%);
  --border-2: hsl(150, 6%, 92%);

  --text-1: hsl(160, 18%, 11%);
  --text-2: hsl(160, 8%, 40%);
  --text-3: hsl(160, 5%, 60%);

  --font: 'Inter', -apple-system, sans-serif;
  --font-ar: 'Scheherazade New', 'Traditional Arabic', serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-full: 9999px;

  --sh-sm: 0 1px 3px hsl(150 20% 10% / .05), 0 1px 2px hsl(150 20% 10% / .04);
  --sh-md: 0 4px 14px hsl(150 20% 10% / .08), 0 2px 4px hsl(150 20% 10% / .04);
  --sh-lg: 0 10px 30px hsl(150 20% 10% / .11), 0 4px 8px hsl(150 20% 10% / .05);
  --sh-xl: 0 24px 60px hsl(150 20% 10% / .16);

  --ease: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--text-1);
  background: var(--surface-2);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

select {
  font-family: inherit;
}

ul {
  list-style: none;
}

.hidden {
  display: none !important;
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: #fff;
}

.loading-logo {
  width: 80px;
  height: 80px;
  background: hsl(150 58% 22%);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px hsl(150 60% 10% / .4);
  margin-bottom: 4px;
}

.loading-logo svg {
  width: 48px;
  height: 48px;
}

.loading-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #fff;
}

.loading-bar-wrap {
  width: 220px;
  height: 4px;
  background: hsl(150 58% 36%);
  border-radius: 4px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: #fff;
  border-radius: 4px;
  width: 0%;
  transition: width .3s var(--ease);
}

.loading-status {
  font-size: .8rem;
  color: hsl(150 40% 80%);
  letter-spacing: .03em;
}

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  overflow: hidden;
}

.splash-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, hsl(150 58% 26% / .06) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, hsl(150 58% 26% / .04) 0%, transparent 50%);
  pointer-events: none;
}

.splash-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 44px 40px 40px;
  width: min(480px, 94vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--sh-xl);
  animation: popIn .4s var(--spring);
}

.splash-logo {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px hsl(150 58% 26% / .35);
  margin-bottom: 6px;
}

.splash-logo svg {
  width: 52px;
  height: 52px;
}

.splash-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--text-1);
}

.splash-tagline {
  font-size: .85rem;
  color: var(--text-3);
}

.splash-divider {
  width: 100%;
  height: 1px;
  background: var(--border-2);
  margin: 16px 0 12px;
}

.splash-stats {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  justify-content: center;
  margin-bottom: 6px;
}

.splash-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 20px;
}

.ss-num {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.02em;
  line-height: 1;
}

.ss-lbl {
  font-size: .72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.splash-stat-sep {
  width: 1px;
  height: 32px;
  background: var(--border-2);
}

.splash-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.form-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.form-row {
  display: flex;
  gap: 12px;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  padding: 10px 36px 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: .9rem;
  color: var(--text-1);
  appearance: none;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}

.select-wrap select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px hsl(150 58% 26% / .12);
}

.sel-arrow {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.btn-start {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--r-md);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px hsl(150 58% 26% / .32);
  transition: background .2s, transform .15s var(--spring), box-shadow .2s;
  margin-top: 4px;
}

.btn-start:hover {
  background: var(--primary-h);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px hsl(150 58% 26% / .4);
}

.btn-start:active {
  transform: translateY(0);
}

/* Per-Juz info banner */
.perjuz-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: var(--primary-light);
  border: 1.5px solid var(--primary-mid);
  border-radius: var(--r-md);
  font-size: .8rem;
  font-weight: 500;
  color: var(--primary);
  animation: fadeUp .25s var(--ease);
}

.perjuz-banner svg {
  flex-shrink: 0;
  stroke: var(--primary);
}

/* ============================================================
   QUIZ APP SHELL
   ============================================================ */
.quiz-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- TOP NAV --- */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 24px;
  box-shadow: 0 2px 12px hsl(150 58% 10% / .25);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: hsl(150 58% 22%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.brand-sub {
  font-size: .65rem;
  color: hsl(150 40% 70%);
}

.nav-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: hsl(150 58% 22%);
  border-radius: var(--r-full);
  color: #fff;
}

.np-icon {
  display: flex;
  align-items: center;
  font-size: 1.05rem;
}

.np-icon svg {
  stroke: hsl(150 40% 70%);
}

.np-body {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.np-label {
  font-size: .6rem;
  color: hsl(150 35% 65%);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.np-val {
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
}

.nav-pill.timer-warn .np-val {
  color: hsl(4 80% 70%);
  animation: blink 1s infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .45
  }
}

.btn-exit {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1.5px solid hsl(4 72% 62%);
  border-radius: var(--r-md);
  color: hsl(4 72% 70%);
  font-size: .82rem;
  font-weight: 600;
  transition: background .2s, color .2s, transform .15s;
}

.btn-exit:hover {
  background: var(--red);
  color: #fff;
  transform: translateY(-1px);
}

/* --- QUIZ BODY --- */
.quiz-body {
  display: grid;
  grid-template-columns: 272px 1fr;
  gap: 20px;
  padding: 20px 24px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  align-items: start;
}

/* --- SIDEBAR --- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 74px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--sh-sm);
}

.card-title {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 14px;
}

/* Progress ring */
.ring-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
}

.ring-svg {
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 8;
}

.ring-prog {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset .6s var(--ease);
}

.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

/* Prog list */
.prog-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.prog-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .8rem;
}

.pi-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pi-neutral {
  background: var(--surface-3);
  color: var(--text-2);
}

.pi-green {
  background: hsl(150 55% 90%);
  color: var(--primary);
}

.pi-red {
  background: var(--red-light);
  color: var(--red);
}

.pi-gold {
  background: var(--gold-light);
  color: var(--gold);
}

.pi-label {
  flex: 1;
  color: var(--text-2);
}

.pi-green-lbl {
  color: var(--primary);
}

.pi-red-lbl {
  color: var(--red);
}

.pi-gold-lbl {
  color: var(--gold);
}

.pi-val {
  font-weight: 700;
  font-size: .82rem;
  color: var(--text-1);
}

.pi-green-val {
  color: var(--primary);
}

.pi-red-val {
  color: var(--red);
}

.pi-gold-val {
  color: var(--gold);
}

/* Nav grid */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-bottom: 12px;
}

.ngb {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: not-allowed;
  pointer-events: none;
  transition: border-color .15s, background .15s, color .15s, transform .15s var(--spring);
}

.ngb:disabled {
  opacity: 1;
}

.ngb:hover {
  border-color: var(--border);
  color: var(--text-3);
  transform: none;
}

.ngb.ngb-current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px hsl(150 58% 26% / .28);
}

.ngb.ngb-correct {
  background: hsl(150 50% 90%);
  border-color: var(--primary);
  color: var(--primary);
}

.ngb.ngb-wrong {
  background: var(--red-light);
  border-color: var(--red);
  color: var(--red);
}

.ngb.ngb-visited {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue);
}

.nav-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.leg-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .68rem;
  color: var(--text-3);
}

.leg-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  border: 1.5px solid;
}

.ld-correct {
  background: hsl(150 50% 90%);
  border-color: var(--primary);
}

.ld-wrong {
  background: var(--red-light);
  border-color: var(--red);
}

.ld-visited {
  background: var(--blue-light);
  border-color: var(--blue);
}

.ld-unvisited {
  background: var(--surface);
  border-color: var(--border);
}

/* --- QUESTION PANEL --- */
.q-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px 30px 24px;
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
  min-height: 500px;
}

.q-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.q-badge {
  padding: 5px 14px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  font-size: .78rem;
  font-weight: 600;
}

.q-juz-tag {
  padding: 5px 12px;
  border-radius: var(--r-full);
  background: var(--primary-light);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .01em;
}

.q-pts {
  margin-left: auto;
  padding: 5px 14px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-size: .78rem;
  font-weight: 600;
}

.q-instruction {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 7px;
}

.q-underline {
  width: 44px;
  height: 2.5px;
  background: var(--primary);
  border-radius: 2px;
  margin-bottom: 20px;
}

/* Verse box */
.verse-box {
  background: hsl(150 18% 97%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 28px;
  margin-bottom: 8px;
  position: relative;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.verse-box::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid hsl(150 25% 86%);
  border-radius: calc(var(--r-lg) - 3px);
  pointer-events: none;
}

.verse-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.verse-text {
  font-family: var(--font-ar);
  font-size: 1.9rem;
  line-height: 2;
  color: var(--text-1);
  direction: rtl;
  text-align: center;
  animation: fadeUp .35s var(--ease);
}

.verse-ref {
  text-align: center;
  font-size: .82rem;
  font-weight: 500;
  color: var(--primary);
  font-style: italic;
  margin-bottom: 20px;
  animation: fadeUp .35s var(--ease);
}

/* Fill-in-blank verse display */
.verse-gap-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-ar);
  font-size: 1.8rem;
  line-height: 2;
  direction: rtl;
  text-align: center;
  width: 100%;
  animation: fadeUp .35s var(--ease);
}

.verse-part {
  color: var(--text-1);
  direction: rtl;
  unicode-bidi: embed;
}

.verse-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 18px;
  min-width: 80px;
  background: var(--primary-light);
  border: 2px dashed var(--primary);
  border-radius: var(--r-md);
  color: var(--primary);
  font-family: var(--font);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .12em;
  vertical-align: middle;
  transition: background .25s;
  position: relative;
}

/* When answered — show filled-in word */
.verse-gap.gap-filled {
  background: hsl(150 52% 90%);
  border-color: var(--primary);
  border-style: solid;
  color: var(--primary);
  font-family: var(--font-ar);
  font-size: 1.6rem;
  letter-spacing: 0;
}

.verse-gap.gap-wrong {
  background: var(--red-light);
  border-color: var(--red);
  border-style: solid;
  color: var(--red);
  flex-direction: column;
  gap: 2px;
}

/* Small green hint showing the correct word beneath the wrong guess */
.gap-correct-hint {
  font-family: var(--font-ar);
  font-size: .85rem;
  color: var(--primary);
  border-top: 1px solid hsl(150 40% 70%);
  padding-top: 2px;
  margin-top: 1px;
  font-weight: 600;
}

/* Fill-blank option: centered, Arabic word only */
.opt-btn.opt-fillblank {
  direction: ltr;
  text-align: left;
  justify-content: center;
  padding: 10px 16px;
  gap: 14px;
}

.opt-btn.opt-fillblank .opt-text {
  font-size: 1.35rem;
  line-height: 1.6;
  text-align: left;
  flex: 1;
  display: flex;
  justify-content: center;
}

.opt-btn.opt-fillblank .opt-letter {
  order: 0;
  flex-shrink: 0;
  margin-right: 0;
}

.opt-btn.opt-fillblank .opt-text {
  order: 1;
}

.opt-btn.opt-fillblank .opt-result {
  order: 2;
  margin-left: auto;
}

/* Type indicator on q-badge */
.q-type-pill {
  padding: 4px 11px;
  border-radius: var(--r-full);
  background: var(--primary);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.q-type-pill.pill-identify {
  background: var(--blue);
  color: #fff;
}

/* Options */
.options {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.opt-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  direction: ltr;
  transition: border-color .2s, background .2s, transform .15s var(--spring), box-shadow .2s;
  animation: slideUp .28s var(--ease) both;
}

.opt-btn:nth-child(1) {
  animation-delay: .03s
}

.opt-btn:nth-child(2) {
  animation-delay: .07s
}

.opt-btn:nth-child(3) {
  animation-delay: .11s
}

.opt-btn:nth-child(4) {
  animation-delay: .15s
}

.opt-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(-3px);
  box-shadow: var(--sh-sm);
}

.opt-btn:disabled {
  cursor: default;
}

.opt-letter {
  order: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: .78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}

.opt-text {
  order: 1;
  flex: 1;
  font-family: var(--font-ar);
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--text-1);
  text-align: left;
  direction: ltr;
}

.opt-result {
  order: 2;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

/* Option states */
.opt-btn.opt-selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.opt-btn.opt-selected .opt-letter {
  background: var(--primary);
  color: #fff;
}

.opt-btn.opt-correct {
  border-color: var(--primary);
  background: hsl(150 52% 92%);
}

.opt-btn.opt-correct .opt-letter {
  background: var(--primary);
  color: #fff;
}

.opt-btn.opt-correct .opt-result {
  display: flex;
  background: var(--primary);
}

.opt-btn.opt-wrong {
  border-color: var(--red);
  background: var(--red-light);
}

.opt-btn.opt-wrong .opt-letter {
  background: var(--red);
  color: #fff;
}

.opt-btn.opt-wrong .opt-result {
  display: flex;
  background: var(--red);
}

.opt-btn.opt-dimmed {
  opacity: .42;
}

/* Footer */
.q-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.btn-bookmark {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  color: var(--text-2);
  font-size: .82rem;
  font-weight: 500;
  transition: border-color .2s, color .2s, background .2s;
}

.btn-bookmark:hover,
.btn-bookmark.is-bookmarked {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-light);
}

.btn-bookmark.is-bookmarked svg {
  fill: var(--gold);
  stroke: var(--gold);
}

.q-nav-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-prev {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  color: var(--text-2);
  font-size: .82rem;
  font-weight: 600;
  transition: border-color .2s, color .2s, transform .15s;
}

.btn-prev:hover:not(:disabled) {
  border-color: var(--text-2);
  color: var(--text-1);
  transform: translateX(-2px);
}

.btn-prev:disabled {
  opacity: .4;
  cursor: default;
}

.btn-next {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  background: var(--primary);
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  box-shadow: 0 3px 10px hsl(150 58% 26% / .25);
  transition: background .2s, transform .15s;
}

.btn-next:hover {
  background: var(--primary-h);
  transform: translateX(2px);
}

.btn-next.is-finish {
  background: var(--gold);
  box-shadow: 0 3px 10px hsl(38 92% 44% / .3);
}

.btn-next.is-finish:hover {
  background: hsl(38 88% 38%);
}

.tip-box {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 13px;
  background: var(--gold-light);
  border: 1px solid hsl(38 80% 80%);
  border-radius: var(--r-md);
  max-width: 210px;
  flex-shrink: 0;
}

.tip-bulb {
  flex-shrink: 0;
  margin-top: 1px;
}

.tip-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: .72rem;
  color: var(--text-2);
}

.tip-content strong {
  color: var(--gold);
  font-size: .74rem;
}

/* ============================================================
   RESULTS SCREEN
   ============================================================ */
.results-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(0 0% 0% / .5);
  backdrop-filter: blur(5px);
  padding: 20px;
  overflow-y: auto;
}

.results-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 40px 36px 32px;
  width: min(520px, 96vw);
  text-align: center;
  box-shadow: var(--sh-xl);
  animation: popIn .4s var(--spring);
  margin: auto;
}

/* Juz breakdown */
.juz-breakdown {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-2);
  text-align: left;
}

.juz-bd-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-2);
  margin-bottom: 12px;
  text-align: center;
}

.juz-bd-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.juz-bd-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: var(--r-sm);
  border: 1.5px solid;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  cursor: default;
  transition: transform .15s var(--spring);
}

.juz-bd-cell:hover {
  transform: scale(1.1);
}

.juz-bd-cell .juz-num {
  font-size: .6rem;
  color: inherit;
  opacity: .75;
}

.juz-bd-cell .juz-icon {
  font-size: .8rem;
}

.juz-bd-cell.jb-correct {
  background: hsl(150 52% 91%);
  border-color: var(--primary);
  color: var(--primary);
}

.juz-bd-cell.jb-wrong {
  background: var(--red-light);
  border-color: var(--red);
  color: var(--red);
}

.juz-bd-cell.jb-partial {
  background: hsl(38 90% 92%);
  border-color: var(--gold);
  color: var(--gold);
}

.juz-bd-cell.jb-unanswered {
  background: var(--surface-3);
  border-color: var(--border);
  color: var(--text-3);
}

.juz-bd-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.juz-leg-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .7rem;
  color: var(--text-3);
}

.juz-leg-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1.5px solid;
}

.juz-leg-dot.correct {
  background: hsl(150 52% 91%);
  border-color: var(--primary);
}

.juz-leg-dot.partial {
  background: hsl(38 90% 92%);
  border-color: var(--gold);
}

.juz-leg-dot.wrong {
  background: var(--red-light);
  border-color: var(--red);
}

.res-trophy {
  font-size: 3.2rem;
  margin-bottom: 10px;
  animation: bounceIn .5s var(--spring) .15s both;
}

.res-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.025em;
  margin-bottom: 4px;
}

.res-sub {
  font-size: .88rem;
  color: var(--text-3);
  margin-bottom: 28px;
}

.res-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.res-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 8px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
}

.res-stat.primary {
  background: var(--primary-light);
  border-color: var(--primary-mid);
}

.rs-val {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.02em;
  line-height: 1.1;
}

.rs-val.green {
  color: var(--primary);
}

.rs-val.red {
  color: var(--red);
}

.rs-val.gold {
  color: var(--gold);
}

.rs-lbl {
  font-size: .7rem;
  color: var(--text-3);
  font-weight: 500;
}

.res-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-review {
  padding: 11px 26px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  color: var(--text-1);
  font-size: .875rem;
  font-weight: 600;
  transition: border-color .2s, background .2s, color .2s;
}

.btn-review:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.btn-restart {
  padding: 11px 26px;
  border-radius: var(--r-md);
  background: var(--primary);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  box-shadow: 0 4px 14px hsl(150 58% 26% / .3);
  transition: background .2s, transform .15s;
}

.btn-restart:hover {
  background: var(--primary-h);
  transform: translateY(-1px);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(0 0% 0% / .45);
  backdrop-filter: blur(4px);
  padding: 20px;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  width: min(360px, 94vw);
  box-shadow: var(--sh-xl);
  animation: popIn .3s var(--spring);
}

.modal-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 7px;
}

.modal-card p {
  font-size: .87rem;
  color: var(--text-2);
  margin-bottom: 22px;
}

.modal-btns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-m-cancel {
  padding: 9px 20px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  color: var(--text-2);
  font-size: .85rem;
  font-weight: 600;
  transition: border-color .2s;
}

.btn-m-cancel:hover {
  border-color: var(--text-2);
}

.btn-m-exit {
  padding: 9px 20px;
  border-radius: var(--r-md);
  background: var(--red);
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  transition: background .2s, transform .15s;
}

.btn-m-exit:hover {
  background: hsl(4 72% 46%);
  transform: scale(1.02);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(14px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(.88)
  }

  to {
    opacity: 1;
    transform: scale(1)
  }
}

@keyframes bounceIn {
  0% {
    transform: scale(.4) rotate(-12deg);
    opacity: 0
  }

  60% {
    transform: scale(1.18) rotate(4deg)
  }

  100% {
    transform: scale(1) rotate(0);
    opacity: 1
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media(max-width:920px) {
  .quiz-body {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar .card {
    flex: 1;
    min-width: 200px;
  }

  .top-nav {
    padding: 8px 14px;
  }
}

@media(max-width:640px) {
  .q-panel {
    padding: 16px;
  }

  .verse-text {
    font-size: 1.5rem;
  }

  .res-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tip-box {
    display: none;
  }

  .nav-pills {
    gap: 5px;
  }

  .np-label {
    display: none;
  }

  .nav-pill {
    padding: 6px 10px;
    gap: 6px;
  }
}

@media(max-width:420px) {
  .splash-card {
    padding: 30px 20px 26px;
  }

  .form-row {
    flex-direction: column;
  }

  .brand-sub {
    display: none;
  }
}