:root {
  --bg: #e8f3ff;
  --card: #ffffff;
  --blue: #0f6fff;
  --lightblue: #38bdf8;
  --red: #dc2626;
}
body {
  margin: 0;
  background: var(--bg);
  font-family: "Tajawal", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #002244;
  text-align: center;
  padding-bottom: 100px;
}
.topbar { padding: 0.8rem 0.5rem 0.3rem; }
.main-title { margin: 0; font-size: 30px; color: var(--blue); font-weight: 700; }
.unit-title { margin: 0.2rem 0 0; color: var(--red); font-weight: 700; font-size: 1.05rem; }
.hint { margin: 0.25rem 0 0.4rem; color: #0f172a; font-weight: 500; }
.author { margin: 0.2rem 0 0.6rem; color: #0f172a; font-size: 0.85rem; direction: ltr; }
.controls {
  display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center;
  margin: 0.6rem auto 0.8rem; max-width: 1100px;
}
.btn-random, .btn-repeat, .btn-test, .score-pill {
  border-radius: 1.4rem; padding: 0.45rem 1.2rem; font-weight: 700; border: none;
  cursor: pointer; font-size: 1rem;
}
.btn-random, .btn-repeat { background: #fff; color: #0f172a; box-shadow: 0 6px 20px rgba(15,23,42,.06); }
.btn-test { background: #f97316; color: #fff; }
.score-pill { background: #16a34a; color: #fff; min-width: 120px; }
.words-wrap { max-width: 500px; margin: 0 auto; }
.word { background: var(--card); border-radius: 1rem; margin: 0.45rem auto;
  padding: 0.55rem; box-shadow: 0 6px 18px rgba(15,23,42,0.06); }
.word .en { display: flex; gap: 0.55rem; justify-content: center;
  align-items: center; flex-direction: row-reverse; }
.word .num { color: var(--lightblue); font-weight: 700; font-size: 1.05rem; }
.word .en-text { font-weight: 700; font-size: 1.7rem; color: #0f3b8f; }
.word .ar { font-size: 1.02rem; margin-top: 0.35rem; }
.input-word { width: 100%; margin-top: 0.4rem; padding: 0.35rem 0.5rem; border-radius: 0.6rem; border: 1px solid #cbd5f5; direction: ltr; }
.correct-answer { margin-top: 0.35rem; font-weight: 700; font-size: 1.6rem; color: var(--red); }
.bottom-nav {
  position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%);
  background: #ffffffd9; display: flex; gap: 1rem; align-items: center;
  padding: 0.4rem 1.3rem; border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.nav-btn { background: #0f6fff; color: #fff; border: none; padding: 0.35rem 0.8rem; border-radius: 999px; font-weight: 600; }
.page-info { font-weight: 600; }
.excellent {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(15,23,42,0.0) 0%, rgba(15,23,42,0.35) 65%, rgba(15,23,42,0.65) 100%);
  z-index: 999; font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800;
  color: #fef9c3; text-shadow: 0 0 10px rgba(250,204,21,.9), 0 0 24px rgba(250,204,21,.8);
  animation: popIn 1.1s ease, goldPulse 2.4s ease-in-out infinite;
}
.hidden { display: none !important; }
@keyframes popIn { 0% { transform: scale(0.4); opacity: 0; } 40% { transform: scale(1.04); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes goldPulse { 0% { filter: drop-shadow(0 0 9px #fde68a); } 50% { filter: drop-shadow(0 0 18px #f59e0b); } 100% { filter: drop-shadow(0 0 9px #fde68a); } }
