:root {
  --navy: #0d315f;
  --navy-2: #123d73;
  --navy-3: #eaf0f7;
  --ink: #102f57;
  --muted: #8d99a8;
  --muted-2: #a8b0bb;
  --gold: #d6b574;
  --gold-soft: #f5edde;
  --paper: #fbf8f2;
  --paper-2: #f5f0e7;
  --white: #ffffff;
  --line: #e8e1d7;
  --line-2: #edf0f3;
  --success: #3ba678;
  --danger: #c95f66;
  --shadow: 0 18px 50px rgba(19, 43, 72, .07);
  --shadow-soft: 0 8px 24px rgba(19, 43, 72, .055);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 84% 7%, rgba(214,181,116,.09), transparent 24rem),
    radial-gradient(circle at 7% 56%, rgba(13,49,95,.035), transparent 30rem),
    var(--paper);
  color: var(--ink);
  font-family: "Tajawal", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { border: 0; }

.page-shell {
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
}

.site-header {
  min-height: 116px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.site-header .brand { justify-self: start; display: inline-flex; align-items: center; }
.site-header .brand img {
  display: block;
  width: 104px;
  height: auto;
  max-height: 58px;
  object-fit: contain;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 38px;
  font-size: 14px;
  font-weight: 700;
  color: #66788c;
}
.main-nav a { position: relative; transition: color .18s ease; }
.main-nav a:hover, .main-nav a.is-active { color: var(--ink); }
.main-nav a.is-active::after {
  content: "";
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 999px;
  background: var(--gold);
  right: 50%;
  transform: translateX(50%);
  bottom: -12px;
}

.home-link {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 39px;
  padding: 0 16px;
  border: 1px solid #d9dfe6;
  border-radius: 999px;
  background: rgba(255,255,255,.48);
  font-size: 13px;
  font-weight: 700;
  transition: .18s ease;
}
.home-link:hover {
  background: var(--white);
  border-color: #c8d0da;
  transform: translateY(-1px);
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 342px;
  border-radius: var(--radius-lg);
  padding: 54px 62px;
  background:
    radial-gradient(circle at 17% 112%, rgba(255,255,255,.06) 0 85px, transparent 86px),
    radial-gradient(circle at 17% 112%, transparent 0 133px, rgba(255,255,255,.06) 134px 135px, transparent 136px),
    linear-gradient(135deg, #0a2a52 0%, #123d73 100%);
  color: var(--white);
  display: grid;
  grid-template-columns: 1.45fr .55fr;
  align-items: center;
  box-shadow: 0 18px 50px rgba(13,49,95,.11);
}
.hero::after {
  content: "";
  position: absolute;
  width: 270px; height: 270px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 50%;
  left: -122px;
  bottom: -165px;
}
.hero-copy { justify-self: end; width: min(100%, 610px); z-index: 1; }
.hero-kicker {
  margin-bottom: 12px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}
.hero h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.14;
  letter-spacing: -.035em;
  font-weight: 800;
}
.hero h1 span { color: #efd69e; }
.hero p {
  max-width: 610px;
  margin: 22px 0 0;
  color: rgba(255,255,255,.67);
  font-size: 15px;
  line-height: 2;
}
.hero-mark { justify-self: start; z-index: 1; }
.hero-mark-inner {
  width: 172px; height: 172px;
  display: grid; place-items: center;
  border-radius: 26px;
  color: #e7ca90;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
}
.hero-mark svg { width: 86px; height: 86px; }

.content-section { padding: 72px 0 34px; }
#vt-app { width: 100%; color: var(--ink); }

.loading-state {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}
.loading-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 7px rgba(214,181,116,.13);
  animation: pulse 1.3s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: .45; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.08); }
}

.vt-dashboard { display: grid; gap: 34px; }
.vt-section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 28px;
}
.vt-section-title small {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}
.vt-section-title h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.2;
  letter-spacing: -.025em;
}
.vt-section-title p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.vt-overview {
  min-width: 310px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.62);
  overflow: hidden;
}
.vt-stat { padding: 17px 18px 15px; text-align: center; position: relative; }
.vt-stat + .vt-stat { border-right: 1px solid var(--line); }
.vt-stat strong {
  display: block;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-size: 20px;
  line-height: 1.1;
}
.vt-stat span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }

.vt-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.vt-group-card {
  appearance: none;
  position: relative;
  min-height: 154px;
  padding: 22px 22px 19px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.83);
  color: var(--ink);
  text-align: right;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 3px 14px rgba(19,43,72,.025);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.vt-group-card::after {
  content: "";
  position: absolute;
  width: 94px; height: 94px;
  border-radius: 50%;
  left: -57px;
  bottom: -51px;
  background: var(--paper-2);
  transition: transform .25s ease;
}
.vt-group-card:hover {
  transform: translateY(-3px);
  border-color: #d9c8a7;
  background: var(--white);
  box-shadow: var(--shadow-soft);
}
.vt-group-card:hover::after { transform: scale(1.18); }

.vt-group-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.vt-group-icon {
  width: 42px; height: 42px; flex: 0 0 42px;
  display: grid; place-items: center;
  border: 1px solid #eadfc9;
  border-radius: 12px;
  background: #fbf7ef;
  color: var(--ink);
}
.vt-group-icon svg { width: 21px; height: 21px; }
.vt-group-index {
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #a7b1bd;
  letter-spacing: .08em;
}
.vt-group-name {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 18px;
  font-size: 18px;
  font-weight: 800;
}
.vt-group-meta {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}
.vt-group-progress {
  position: relative;
  z-index: 1;
  display: block;
  height: 3px;
  margin-top: 17px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf0f2;
}
.vt-group-progress > i {
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  border-radius: inherit;
  background: var(--gold);
}
.vt-group-arrow {
  position: relative;
  z-index: 1;
  width: 28px; height: 28px;
  display: inline-grid; place-items: center;
  border: 1px solid #e1e6eb;
  border-radius: 50%;
  background: rgba(255,255,255,.8);
  color: var(--ink);
  font-size: 17px;
  transition: .18s ease;
}
.vt-group-card:hover .vt-group-arrow {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
  transform: translateX(-2px);
}

.vt-study { width: min(780px, 100%); margin: 0 auto; }
.vt-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}
.vt-back {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.vt-back-icon {
  width: 31px; height: 31px;
  display: grid; place-items: center;
  border: 1px solid #dde3e9;
  border-radius: 50%;
  background: rgba(255,255,255,.6);
}
.vt-session-name { color: var(--muted); font-size: 12px; font-weight: 700; }

.vt-progress-shell {
  margin-bottom: 20px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.65);
}
.vt-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  font-weight: 700;
}
.vt-progress-row span:last-child {
  font-family: "DM Sans", sans-serif;
  color: var(--muted);
}
.vt-progress-track {
  height: 5px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8ecef;
}
.vt-progress-track > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width .3s ease;
}

.vt-card-wrap { position: relative; perspective: 1400px; margin-bottom: 16px; }
.vt-card-inner {
  position: relative;
  width: 100%;
  min-height: 340px;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
  cursor: pointer;
}
.vt-card-inner.flipped { transform: rotateY(180deg); }
.vt-face {
  position: absolute;
  inset: 0;
  padding: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 102%, rgba(214,181,116,.11) 0 72px, transparent 73px),
    var(--white);
  box-shadow: var(--shadow);
  text-align: center;
}
.vt-face-back {
  transform: rotateY(180deg);
  background:
    radial-gradient(circle at 90% -10%, rgba(13,49,95,.045) 0 110px, transparent 111px),
    var(--white);
}
.vt-word {
  direction: ltr;
  font-family: "DM Sans", sans-serif;
  font-size: clamp(42px, 7vw, 66px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.035em;
  color: var(--ink);
}
.vt-meaning { font-size: clamp(28px, 4vw, 38px); font-weight: 800; }
.vt-example {
  max-width: 590px;
  margin-top: 16px;
  direction: ltr;
  color: var(--muted);
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  line-height: 1.75;
}
.vt-hint { margin-top: 18px; color: var(--muted-2); font-size: 12px; }

.vt-speak {
  position: absolute;
  top: 18px; right: 18px;
  z-index: 5;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid #e3e7eb;
  border-radius: 50%;
  background: #fbfaf7;
  color: var(--ink);
  cursor: pointer;
  transition: .18s ease;
}
.vt-speak:hover, .vt-speak.is-speaking {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}
.vt-speak svg { width: 18px; height: 18px; fill: currentColor; }

.vt-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.vt-btn {
  appearance: none;
  min-height: 46px;
  padding: 0 25px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: .18s ease;
}
.vt-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(16,47,87,.14); }
.vt-btn-ghost { background: transparent; color: var(--ink); border: 1px solid #dfe4e9; }
.vt-btn:disabled { opacity: .42; cursor: default; transform: none; box-shadow: none; }

.vt-prev-corner {
  appearance: none;
  position: absolute;
  bottom: 18px; right: 18px;
  z-index: 5;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid #e3e7eb;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.vt-spell-box {
  position: relative;
  min-height: 340px;
  padding: 56px 52px 42px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 8% 108%, rgba(214,181,116,.11) 0 90px, transparent 91px),
    var(--white);
  box-shadow: var(--shadow);
  text-align: center;
}
.vt-spell-label { margin-bottom: 8px; color: var(--gold); font-size: 11px; font-weight: 800; }
.vt-spell-box .vt-meaning { font-size: 28px; }

#vt-spell-input {
  width: min(470px, 100%);
  min-height: 57px;
  margin: 24px auto 6px;
  padding: 0 18px;
  border: 1.5px solid #dce2e8;
  border-radius: 14px;
  outline: none;
  background: #fbfcfd;
  color: var(--ink);
  direction: ltr;
  text-align: center;
  font-family: "DM Sans", sans-serif;
  font-size: 20px;
  transition: .18s ease;
}
#vt-spell-input:focus {
  background: #fff;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(214,181,116,.12);
}
.vt-feedback { min-height: 34px; margin-top: 14px; font-size: 13px; font-weight: 800; }
.vt-feedback.ok { color: var(--success); }
.vt-feedback.fail { color: var(--danger); }
.vt-answer-details { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line-2); }
.vt-answer-details .vt-word { font-size: 30px; }
.vt-answer-details .vt-meaning { margin-top: 6px; font-size: 18px; }

.vt-summary, .vt-empty {
  padding: 48px 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.vt-summary-mark {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: var(--gold-soft);
  color: var(--ink);
  font-size: 24px;
}
.vt-summary .vt-big {
  font-family: "DM Sans", sans-serif;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -.04em;
}
.vt-summary p, .vt-empty { color: var(--muted); }

.site-footer {
  margin-top: 42px;
  padding: 28px 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: #9aa4b1;
  font-size: 11px;
}
.site-footer span:first-child { color: var(--ink); font-weight: 800; }

@media (max-width: 900px) {
  .site-header { grid-template-columns: auto 1fr; }
  .main-nav { display: none; }
  .home-link { justify-self: end; }
  .hero { min-height: 300px; padding: 44px 38px; grid-template-columns: 1fr auto; }
  .hero-mark-inner { width: 136px; height: 136px; }
  .vt-section-head { grid-template-columns: 1fr; align-items: stretch; }
  .vt-overview { min-width: 0; }
  .vt-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .page-shell { width: min(100% - 22px, 1080px); }
  .site-header { min-height: 88px; }
  .site-header .brand img { width: 86px; }
  .home-link span:first-child { display: none; }
  .home-link { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .hero { min-height: 310px; padding: 34px 26px; grid-template-columns: 1fr; }
  .hero-copy { justify-self: stretch; }
  .hero h1 { font-size: 40px; }
  .hero-mark { display: none; }
  .content-section { padding-top: 46px; }
  .vt-section-title h2 { font-size: 31px; }
  .vt-overview { grid-template-columns: repeat(3, 1fr); }
  .vt-stat { padding: 14px 7px; }
  .vt-stat strong { font-size: 17px; }
  .vt-groups { grid-template-columns: 1fr; }
  .vt-group-card { min-height: 142px; }
  .vt-face { padding: 40px 25px; }
  .vt-card-inner, .vt-spell-box { min-height: 320px; }
  .vt-spell-box { padding: 58px 22px 34px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}

