:root {
  --bg: #080713;
  --bg-soft: #111025;
  --panel: rgba(255, 255, 255, 0.07);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --white: #ffffff;
  --text: #f5f3ff;
  --muted: #c3bdd8;
  --violet: #7c3aed;
  --violet-2: #a855f7;
  --violet-3: #c4b5fd;
  --cyan: #22d3ee;
  --gold: #fbbf24;
  --pink: #fb4fa3;
  --blue: #38bdf8;
  --orange: #fb923c;
  --green: #22c55e;
  --red: #fb7185;
  --border: rgba(226, 232, 240, 0.18);
  --shadow: 0 24px 80px rgba(10, 9, 28, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(124, 58, 237, 0.22) 0%, transparent 28%),
    linear-gradient(240deg, rgba(34, 211, 238, 0.14) 0%, transparent 26%),
    linear-gradient(160deg, rgba(251, 79, 163, 0.13) 0%, transparent 24%),
    linear-gradient(135deg, #070611 0%, #171034 34%, #091525 70%, #090713 100%);
  color: var(--text);
  font-family: "Cairo", "Tajawal", "Segoe UI", Tahoma, sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 86%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.55;
}

.line {
  position: absolute;
  width: 40rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 181, 253, 0.32), transparent);
  animation: drift 12s ease-in-out infinite;
}

.line-a {
  top: 18%;
  right: -12rem;
  transform: rotate(-18deg);
}

.line-b {
  top: 52%;
  left: -12rem;
  transform: rotate(24deg);
  animation-delay: -4s;
}

.line-c {
  bottom: 12%;
  right: 8rem;
  transform: rotate(8deg);
  animation-delay: -7s;
}

@keyframes drift {
  0%, 100% { opacity: 0.2; translate: 0 0; }
  50% { opacity: 0.8; translate: 1.5rem -0.8rem; }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
  padding: 0.85rem clamp(1rem, 4vw, 3.2rem);
  background: linear-gradient(90deg, rgba(7, 7, 15, 0.92), rgba(24, 16, 55, 0.88));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  text-decoration: none;
  direction: ltr;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, var(--violet), var(--pink) 55%, var(--cyan));
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.72), 0 0 12px rgba(34, 211, 238, 0.45);
  font-weight: 900;
  font-size: 1.35rem;
}

.brand-copy {
  display: grid;
  gap: 0.1rem;
  text-align: left;
}

.brand-copy strong {
  font-family: "Space Mono", Consolas, monospace;
  letter-spacing: 0.18rem;
  font-size: 0.95rem;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  direction: rtl;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.nav-tab,
.primary-action,
.ghost-action {
  min-height: 2.65rem;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  color: var(--text);
  transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.nav-tab {
  padding: 0.55rem 1rem;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.92rem;
  border-color: rgba(255, 255, 255, 0.06);
}

.nav-tab:hover,
.nav-tab.active {
  color: var(--white);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.34), rgba(251, 79, 163, 0.14));
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.18);
}

.nav-tab.quiz-link.active,
.nav-tab.quiz-link:hover {
  background: var(--cyan);
  color: #07111a;
  border-color: var(--cyan);
}

main {
  min-height: calc(100vh - 140px);
}

.page {
  display: none;
  animation: pageIn 0.34s ease;
}

.page.active {
  display: block;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.78fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  min-height: calc(100vh - 72px);
  padding: clamp(3rem, 7vw, 6.5rem) clamp(1rem, 5vw, 5rem);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 82%);
}

.hero::after {
  content: "ZAINAB";
  position: absolute;
  left: 50%;
  bottom: 4%;
  translate: -50% 0;
  z-index: -1;
  color: rgba(255, 255, 255, 0.035);
  font-family: "Space Mono", Consolas, monospace;
  font-size: clamp(4rem, 16vw, 13rem);
  font-weight: 900;
  letter-spacing: 0.12rem;
}

.hero-content {
  max-width: 830px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(196, 181, 253, 0.26);
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.12);
  color: var(--violet-3);
  font-weight: 900;
  letter-spacing: 0.04rem;
}

.hero h1 {
  margin: 0;
  color: var(--white);
  font-size: clamp(2.6rem, 7vw, 6rem);
  line-height: 1.08;
  font-weight: 950;
}

.hero h1 span {
  display: inline-block;
  color: transparent;
  background: linear-gradient(90deg, var(--cyan), var(--violet-3), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-subtitle {
  max-width: 680px;
  margin: 1.35rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 2;
}

.hero-actions,
.review-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.primary-action,
.ghost-action {
  padding: 0.65rem 1.15rem;
  font-weight: 900;
}

.primary-action {
  background: linear-gradient(135deg, var(--violet), var(--pink));
  color: var(--white);
  box-shadow: 0 16px 42px rgba(124, 58, 237, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.ghost-action {
  background: rgba(255, 255, 255, 0.075);
  border-color: var(--border);
  color: var(--text);
}

.primary-action:hover,
.ghost-action:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.32);
}

.full {
  width: 100%;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 0.75rem;
  max-width: 590px;
  margin-top: 2rem;
}

.stat {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(100%);
  animation: sheen 5s ease-in-out infinite;
}

.stat strong {
  display: block;
  color: var(--white);
  font-size: 1.55rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.86rem;
}

.study-visual {
  position: relative;
  min-height: 420px;
  border: 1px solid rgba(196, 181, 253, 0.2);
  border-radius: 2rem;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(145deg, rgba(124, 58, 237, 0.18), rgba(34, 211, 238, 0.08), rgba(251, 79, 163, 0.1));
  background-size: 34px 34px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.study-visual::before {
  content: "";
  position: absolute;
  inset: 13%;
  border: 1px dashed rgba(34, 211, 238, 0.34);
  border-radius: 999px;
  animation: spin 18s linear infinite;
}

.study-visual::after {
  content: "";
  position: absolute;
  inset: 22%;
  border: 1px solid rgba(168, 85, 247, 0.32);
  border-radius: 1.5rem;
  transform: rotate(14deg);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.visual-core {
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 6rem;
  height: 6rem;
  border-radius: 1.7rem;
  background: linear-gradient(135deg, #ffffff, #e9d5ff 45%, #cffafe);
  color: var(--violet);
  font: 950 3.2rem "Space Mono", Consolas, monospace;
  box-shadow: 0 0 60px rgba(168, 85, 247, 0.45);
}

@keyframes sheen {
  0%, 45% { transform: translateX(110%); }
  65%, 100% { transform: translateX(-110%); }
}

.visual-card {
  position: absolute;
  display: grid;
  gap: 0.25rem;
  min-width: 150px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(9, 9, 19, 0.78);
  backdrop-filter: blur(12px);
  animation: floaty 5.5s ease-in-out infinite;
}

.visual-card span {
  color: var(--muted);
  font-size: 0.85rem;
  direction: ltr;
}

.visual-card strong {
  color: var(--white);
  direction: ltr;
}

.card-one {
  top: 16%;
  right: 10%;
}

.card-two {
  top: 46%;
  left: 6%;
  animation-delay: -1.7s;
}

.card-three {
  right: 12%;
  bottom: 13%;
  animation-delay: -3.2s;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.section-wrap,
.page-head,
.subjects-grid,
.chapter-selector,
.chapter-view,
.toolbar,
.terms-grid,
.quiz-shell,
.review-actions,
.mistakes-list {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.section-wrap {
  padding: 5rem 0;
}

.section-title {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
}

.section-title span {
  color: var(--cyan);
  font-weight: 900;
  direction: ltr;
}

.section-title h2,
.page-head h2 {
  margin: 0;
  color: var(--white);
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.path-card,
.chapter-card,
.lesson-card,
.decoder-item,
.term-card,
.quiz-settings,
.question-box,
.score-card,
.mistake-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.045));
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

.path-card {
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.path-card::after,
.lesson-card::after,
.decoder-item::after {
  content: "";
  position: absolute;
  inset: auto 1rem 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--cyan), var(--violet-2), var(--pink), var(--gold));
  opacity: 0.78;
}

.path-number {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 0.9rem;
  border-radius: 0.8rem;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(168, 85, 247, 0.24));
  color: var(--white);
  font-weight: 950;
}

.path-card h3,
.chapter-card h3,
.question-box h3 {
  margin: 0 0 0.55rem;
  color: var(--white);
}

.path-card p,
.page-head p,
.chapter-card p,
.term-card p,
.question-box p,
.mistake-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
}

.page-head {
  padding: 3rem 0 1.4rem;
  position: relative;
}

.page-head::after {
  content: "";
  display: block;
  width: min(220px, 50%);
  height: 4px;
  margin-top: 1.1rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--violet-2), var(--pink));
}

.chapter-selector {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.5rem 0 1.2rem;
  position: sticky;
  top: 72px;
  z-index: 20;
  background: linear-gradient(180deg, rgba(8, 7, 19, 0.95), rgba(8, 7, 19, 0.72));
  backdrop-filter: blur(14px);
}

.chapter-pill {
  flex: 0 0 auto;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 900;
}

.chapter-pill.active {
  background: linear-gradient(135deg, var(--cyan), var(--violet-3));
  color: #080713;
  border-color: transparent;
  box-shadow: 0 14px 34px rgba(34, 211, 238, 0.18);
}

.chapter-view {
  padding-bottom: 4rem;
}

.chapter-hero {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.chapter-card {
  padding: 1.25rem;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.chapter-card:hover,
.lesson-card:hover,
.term-card:hover,
.mistake-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.28);
}

.chapter-card.highlight {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.28), rgba(34, 211, 238, 0.13), rgba(251, 79, 163, 0.11));
}

.chapter-intro {
  min-height: 100%;
}

.chapter-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.chapter-actions span {
  color: var(--violet-3);
  font-weight: 900;
}

.study-route-card p {
  margin-bottom: 1rem;
}

.route-steps {
  display: grid;
  gap: 0.65rem;
}

.route-steps span {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.72rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.85rem;
  background: rgba(0, 0, 0, 0.16);
  line-height: 1.65;
}

.route-steps b {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 0.55rem;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: var(--white);
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.lesson-card {
  position: relative;
  overflow: hidden;
  padding: 1.2rem;
}

.lesson-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 0.8rem;
  border-radius: 0.75rem;
  background: rgba(251, 191, 36, 0.16);
  color: #fde68a;
  font-weight: 950;
}

.lesson-card h3 {
  margin: 0 0 0.6rem;
  color: var(--white);
}

.lesson-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.95;
}

.exam-clue {
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 0.85rem;
  background: rgba(34, 211, 238, 0.08);
  color: #e0fbff;
  line-height: 1.85;
}

.chapter-label {
  color: var(--cyan);
  font-weight: 900;
  direction: ltr;
}

.key-list,
.memorize-list {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.key-list li,
.memorize-list li {
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.8rem;
  background: rgba(0, 0, 0, 0.15);
  line-height: 1.8;
}

.memorize-list li {
  direction: ltr;
  text-align: left;
  color: #ede9fe;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.mini-terms {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.mini-term {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) 1fr;
  gap: 0.8rem;
  align-items: start;
  padding: 0.75rem;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.045);
}

.mini-term strong {
  direction: ltr;
  text-align: left;
  color: var(--white);
}

.exam-note {
  margin-top: 1rem;
  padding: 1rem;
  border-right: 3px solid var(--cyan);
  border-radius: 0.8rem;
  background: rgba(34, 211, 238, 0.08);
  color: #dff9ff;
  line-height: 1.9;
}

.decoder-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

.decoder-item {
  position: relative;
  overflow: hidden;
  padding: 1rem;
}

.decoder-item strong {
  display: block;
  direction: ltr;
  text-align: left;
  color: var(--white);
  margin-bottom: 0.35rem;
}

.decoder-item span {
  display: block;
  color: var(--cyan);
  font-weight: 900;
  margin-bottom: 0.45rem;
}

.decoder-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.terms-panel {
  margin-top: 1rem;
}

.pro-study {
  display: grid;
  gap: 1rem;
}

.pro-hero-card,
.study-map-panel,
.compare-panel,
.trap-panel,
.final-voice {
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.045));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.pro-hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.5rem;
  align-items: center;
  padding: clamp(1.2rem, 3vw, 2rem);
  overflow: hidden;
}

.pro-hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.12), transparent 18rem),
    linear-gradient(120deg, rgba(124, 58, 237, 0.22), transparent 42%),
    linear-gradient(260deg, rgba(34, 211, 238, 0.14), transparent 38%);
  pointer-events: none;
}

.pro-hero-copy,
.chapter-picture {
  position: relative;
  z-index: 1;
}

.pro-hero-copy h3 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.55rem 0;
  color: var(--white);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.25;
}

.kid-title {
  margin: 0.2rem 0 0.8rem;
  color: #fde68a;
  font-size: 1.16rem;
  font-weight: 950;
}

.simple-line {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.2);
  color: var(--white);
  font-weight: 950;
  line-height: 1.9;
}

.chapter-picture {
  min-height: 260px;
  display: grid;
  place-items: center;
}

.picture-emoji {
  display: grid;
  place-items: center;
  width: 8.2rem;
  height: 8.2rem;
  border-radius: 2.2rem;
  background: linear-gradient(135deg, #ffffff, #e9d5ff 45%, #cffafe);
  box-shadow: 0 25px 80px rgba(124, 58, 237, 0.38), 0 0 0 14px rgba(255, 255, 255, 0.035);
  font-size: 4rem;
  animation: pulseCard 3.6s ease-in-out infinite;
}

.picture-orbit {
  position: absolute;
  width: 15rem;
  height: 15rem;
  border: 1px dashed rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  animation: spin 18s linear infinite;
}

.spark {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  animation: floaty 4.8s ease-in-out infinite;
}

.spark-a {
  top: 1.2rem;
  right: 2.5rem;
}

.spark-b {
  bottom: 1.6rem;
  right: 1.1rem;
  animation-delay: -1.4s;
}

.spark-c {
  left: 1.7rem;
  top: 48%;
  animation-delay: -2.4s;
}

@keyframes pulseCard {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.04) rotate(-2deg); }
}

.study-map-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1rem;
  padding: 1.2rem;
}

.section-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  color: #cffafe;
  font-weight: 950;
}

.study-map-panel h3,
.compare-panel h3 {
  margin: 0 0 0.55rem;
  color: var(--white);
}

.study-map-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.study-map-steps {
  display: grid;
  gap: 0.65rem;
}

.study-map-steps span {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: 0.9rem;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-weight: 850;
  line-height: 1.6;
}

.study-map-steps b {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, var(--cyan), var(--violet-2));
  color: #060611;
  font-weight: 950;
}

.pro-blocks {
  display: grid;
  gap: 1rem;
}

.pro-block {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: clamp(1rem, 2.4vw, 1.45rem);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045)),
    linear-gradient(90deg, rgba(124, 58, 237, 0.11), transparent 48%, rgba(34, 211, 238, 0.06));
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
  animation: blockIn 0.45s ease both;
}

.pro-block::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0.35rem;
  height: 100%;
  background: linear-gradient(var(--cyan), var(--violet-2), var(--pink));
}

.block-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.block-emoji {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 4rem;
  height: 4rem;
  border-radius: 1.1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 2rem;
}

.block-head h3 {
  margin: 0.3rem 0 0;
  color: var(--white);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

@keyframes blockIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.explain-strip {
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: 1rem;
  line-height: 1.95;
}

.explain-strip strong,
.memory-card strong,
.exam-clue strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--white);
}

.explain-strip p,
.memory-card p,
.exam-clue p {
  margin: 0;
}

.child-strip {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.18);
  color: #fff7d6;
}

.book-strip {
  background: rgba(124, 58, 237, 0.13);
  border: 1px solid rgba(196, 181, 253, 0.18);
  color: #ede9fe;
}

.english-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
  direction: ltr;
  justify-content: flex-start;
}

.english-chips span {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.22);
  color: #cffafe;
  font-weight: 850;
}

.memory-card {
  margin-top: 0.8rem;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.18);
  color: #dcfce7;
  line-height: 1.85;
}

.compare-panel,
.trap-panel,
.final-voice {
  padding: 1.2rem;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 0.7rem;
}

.compare-grid article {
  display: grid;
  gap: 0.4rem;
  min-height: 9rem;
  padding: 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.16);
}

.compare-grid strong {
  direction: ltr;
  text-align: left;
  color: var(--white);
}

.compare-grid span {
  color: var(--muted);
  line-height: 1.6;
}

.compare-grid em {
  align-self: end;
  direction: ltr;
  text-align: left;
  color: #fde68a;
  font-style: normal;
  font-weight: 900;
}

.trap-list {
  display: grid;
  gap: 0.7rem;
}

.trap-list p {
  display: flex;
  gap: 0.75rem;
  margin: 0;
  padding: 0.9rem;
  border-radius: 0.95rem;
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.18);
  line-height: 1.8;
}

.trap-list b {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 0.55rem;
  background: rgba(251, 113, 133, 0.22);
  color: var(--white);
}

.final-voice {
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(124, 58, 237, 0.12)),
    rgba(255, 255, 255, 0.055);
}

.final-voice span {
  display: block;
  color: #fde68a;
  font-weight: 950;
  margin-bottom: 0.5rem;
}

.final-voice p {
  margin: 0;
  color: var(--text);
  line-height: 1.95;
}

.study-purple .pro-hero-card::before { background: linear-gradient(120deg, rgba(124, 58, 237, 0.28), transparent 48%), radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.15), transparent 18rem); }
.study-cyan .pro-hero-card::before { background: linear-gradient(120deg, rgba(34, 211, 238, 0.22), transparent 48%), radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.18), transparent 18rem); }
.study-pink .pro-hero-card::before { background: linear-gradient(120deg, rgba(251, 79, 163, 0.22), transparent 48%), radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.14), transparent 18rem); }
.study-blue .pro-hero-card::before { background: linear-gradient(120deg, rgba(56, 189, 248, 0.2), transparent 48%), radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.18), transparent 18rem); }
.study-gold .pro-hero-card::before { background: linear-gradient(120deg, rgba(251, 191, 36, 0.18), transparent 48%), radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.18), transparent 18rem); }

.mastery-lab {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 1.4rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
    linear-gradient(90deg, rgba(124, 58, 237, 0.12), transparent 42%, rgba(34, 211, 238, 0.08));
  box-shadow: var(--shadow);
}

.mastery-title {
  padding: 1rem;
  border-radius: 1.1rem;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.mastery-title h3,
.mastery-section-head h3 {
  margin: 0 0 0.35rem;
  color: var(--white);
}

.mastery-title p,
.mastery-section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.mastery-section {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 1.2rem;
  background: rgba(3, 2, 10, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mastery-section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.mastery-section-head > span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  border-radius: 0.95rem;
  background: linear-gradient(135deg, var(--cyan), var(--violet-2), var(--pink));
  color: var(--white);
  font-weight: 950;
  box-shadow: 0 14px 30px rgba(124, 58, 237, 0.22);
}

.core-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

.core-study-card,
.phrase-card,
.term-learning-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.core-study-card {
  display: grid;
  gap: 0.55rem;
  min-height: 13rem;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.core-study-card::after,
.term-learning-card::after {
  content: "";
  position: absolute;
  inset: auto 1rem 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--cyan), var(--violet-2), var(--pink));
}

.card-tag {
  width: fit-content;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  color: #cffafe;
  direction: ltr;
  font-size: 0.78rem;
  font-weight: 950;
}

.core-study-card h4 {
  margin: 0;
  color: var(--white);
}

.core-study-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.core-study-card div {
  align-self: end;
  display: grid;
  gap: 0.25rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.core-study-card div strong {
  color: #fde68a;
}

.core-study-card div em {
  direction: ltr;
  text-align: left;
  color: var(--white);
  font-style: normal;
  line-height: 1.6;
}

.phrase-study-list {
  display: grid;
  gap: 0.75rem;
}

.phrase-card {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) minmax(260px, 0.65fr);
  gap: 0.85rem;
  align-items: stretch;
  padding: 0.85rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.phrase-card:hover,
.core-study-card:hover,
.term-learning-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.28);
}

.phrase-number {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.85rem;
  background: rgba(251, 191, 36, 0.15);
  color: #fde68a;
  font-weight: 950;
}

.phrase-main {
  display: grid;
  gap: 0.45rem;
}

.phrase-main strong {
  direction: ltr;
  text-align: left;
  color: var(--white);
  line-height: 1.65;
}

.phrase-main p {
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
}

.phrase-notes {
  display: grid;
  gap: 0.5rem;
}

.phrase-notes span {
  display: block;
  padding: 0.65rem;
  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted);
  line-height: 1.65;
}

.phrase-notes b {
  color: var(--cyan);
}

.term-learning-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.term-learning-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.term-topline {
  display: grid;
  gap: 0.4rem;
}

.term-topline strong {
  direction: ltr;
  text-align: left;
  color: var(--white);
  font-size: 1rem;
}

.term-topline span {
  color: var(--cyan);
  font-weight: 950;
}

.term-learning-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
}

.term-definition-en {
  direction: ltr;
  text-align: left;
  padding: 0.75rem;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.055);
  color: #ede9fe;
  line-height: 1.65;
}

.decoder-grid.refined {
  margin: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

input,
select {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

select option {
  color: #111827;
}

input:focus,
select:focus {
  border-color: var(--violet-3);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2);
}

.terms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-bottom: 4rem;
}

.subjects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding-bottom: 4rem;
}

.subject-card {
  position: relative;
  min-height: 260px;
  display: grid;
  align-content: space-between;
  gap: 1rem;
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: 1.35rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045)),
    radial-gradient(circle at 12% 0%, rgba(34, 211, 238, 0.18), transparent 16rem),
    radial-gradient(circle at 90% 20%, rgba(251, 79, 163, 0.14), transparent 14rem);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.subject-card:hover,
.subject-card.active {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.32);
}

.subject-card::after {
  content: "";
  position: absolute;
  inset: auto 1.2rem 0;
  height: 4px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--cyan), var(--violet-2), var(--pink), var(--gold));
}

.subject-card span {
  width: fit-content;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fde68a;
  font-weight: 950;
}

.subject-card h3 {
  margin: 0;
  color: var(--white);
  font-size: clamp(1.35rem, 3vw, 2.2rem);
}

.subject-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
}

.term-card {
  padding: 1rem;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.term-card strong {
  display: block;
  color: var(--white);
  direction: ltr;
  text-align: left;
  font-size: 1.02rem;
  margin-bottom: 0.4rem;
}

.term-meta {
  display: inline-flex;
  margin-bottom: 0.7rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.18);
  color: var(--violet-3);
  font-size: 0.78rem;
  font-weight: 900;
}

.quiz-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1rem;
  padding-bottom: 4rem;
}

.quiz-settings {
  align-self: start;
  position: sticky;
  top: 92px;
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  background: linear-gradient(160deg, rgba(124, 58, 237, 0.15), rgba(255, 255, 255, 0.055));
}

.quiz-settings label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 900;
}

.score-card {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(168, 85, 247, 0.12));
}

.score-card span {
  color: var(--muted);
}

.score-card strong {
  color: var(--white);
  font-size: 1.35rem;
}

.quiz-area {
  display: grid;
  gap: 0.75rem;
}

.quiz-progress {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.16), rgba(34, 211, 238, 0.08));
  color: var(--text);
  font-weight: 900;
}

.question-box {
  min-height: 380px;
  padding: clamp(1rem, 3vw, 1.5rem);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.045)),
    linear-gradient(90deg, rgba(34, 211, 238, 0.08), transparent 36%, rgba(251, 79, 163, 0.07));
}

.question-box.empty {
  display: grid;
  place-content: center;
  text-align: center;
}

.question-text {
  direction: ltr;
  text-align: left;
  color: var(--white);
  font-size: 1.2rem;
  line-height: 1.65;
}

.question-ar {
  margin-top: 0.65rem;
  color: var(--muted);
  line-height: 1.8;
}

.option-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.option-btn {
  width: 100%;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.065);
  color: var(--text);
  text-align: start;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.option-btn:hover {
  transform: translateX(-3px);
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(34, 211, 238, 0.08);
}

.option-btn.correct {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 211, 238, 0.08));
  border-color: rgba(34, 197, 94, 0.75);
}

.option-btn.wrong {
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.2), rgba(251, 79, 163, 0.08));
  border-color: rgba(251, 113, 133, 0.72);
}

.option-en {
  display: block;
  direction: ltr;
  text-align: left;
  color: var(--white);
  font-weight: 900;
}

.option-ar {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
}

.feedback {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.095), rgba(34, 211, 238, 0.06));
  border: 1px solid var(--border);
  line-height: 1.85;
}

.feedback.show {
  display: block;
}

.quiz-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.difficulty-badge {
  display: inline-flex;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(251, 146, 60, 0.12));
  color: #fde68a;
  font-size: 0.82rem;
  font-weight: 900;
}

.mistakes-list {
  display: grid;
  gap: 1rem;
  padding-bottom: 4rem;
}

.mistake-card {
  padding: 1rem;
}

.mistake-card h3 {
  margin: 0.35rem 0;
  direction: ltr;
  text-align: left;
}

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-height: 70px;
  padding: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

footer strong {
  color: var(--white);
  letter-spacing: 0.16rem;
  direction: ltr;
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .chapter-hero,
  .pro-hero-card,
  .study-map-panel,
  .quiz-shell {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .study-visual {
    min-height: 340px;
  }

  .path-grid,
  .chapter-grid,
  .lesson-grid,
  .compare-grid,
  .core-card-grid,
  .term-learning-grid,
  .terms-grid {
    grid-template-columns: 1fr 1fr;
  }

  .phrase-card {
    grid-template-columns: 3rem minmax(0, 1fr);
  }

  .phrase-notes {
    grid-column: 2;
  }

  .decoder-grid {
    grid-template-columns: 1fr;
  }

  .quiz-settings {
    position: static;
  }
}

@media (max-width: 640px) {
  .nav-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-tab {
    width: 100%;
  }

  .hero-stats,
  .path-grid,
  .chapter-grid,
  .lesson-grid,
  .compare-grid,
  .core-card-grid,
  .term-learning-grid,
  .subjects-grid,
  .terms-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .mastery-lab,
  .mastery-section {
    padding: 0.75rem;
  }

  .mastery-section-head {
    flex-direction: column;
  }

  .phrase-card {
    grid-template-columns: 1fr;
  }

  .phrase-notes {
    grid-column: auto;
  }

  .pro-hero-card,
  .study-map-panel,
  .compare-panel,
  .trap-panel,
  .final-voice {
    border-radius: 1rem;
  }

  .chapter-picture {
    min-height: 220px;
  }

  .picture-emoji {
    width: 6.8rem;
    height: 6.8rem;
    font-size: 3.2rem;
  }

  .picture-orbit {
    width: 12rem;
    height: 12rem;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action,
  .ghost-action {
    width: 100%;
  }

  .mini-term {
    grid-template-columns: 1fr;
  }

  .study-visual {
    min-height: 300px;
  }

  .visual-card {
    min-width: 125px;
    padding: 0.75rem;
  }

  .brand-copy strong {
    font-size: 0.82rem;
  }
}
