:root {
  --bg: #0f172a;
  --card: #1e293b;
  --blue: #0f6fff;
  --lightblue: #38bdf8;
  --red: #dc2626;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --yellow: #facc15;
  --repeat-blue: #3b82f6;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  text-align: center;
  padding-bottom: 95px;
}
.topbar {
  padding: 0.9rem 0.5rem 0.2rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15,23,42,0.7);
  backdrop-filter: blur(7px);
}
.title-box {
  display: inline-block;
  background: rgba(248,250,252,0.04);
  padding: 0.4rem 1.1rem 0.65rem;
  border-radius: 18px;
}
.main-title {
  margin: 0;
  font-size: 28px;
  color: var(--blue);
  font-weight: 800;
}
.sub-title {
  margin: 0.15rem 0 0.25rem;
}
.name-red { color: var(--red); font-weight: 700; font-size: 1.05rem; }
.phone-white { color: #ffffff; font-weight: 700; direction: ltr; }
.unit-title { margin: 0.1rem 0; color: var(--red); font-weight: 700; }
.hint { margin: 0.1rem 0; color: var(--muted); }

.controls {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  justify-content: center;
  align-items: center;
  margin: 0.7rem auto 0.85rem;
}
.controls .row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: center;
}
button { font-family: inherit; }

.btn-test {
  background: #f97316;
  color: #fff;
  border: none;
  padding: 0.48rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
}
.score-pill {
  background: #16a34a;
  color: #fff;
  border: none;
  padding: 0.48rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  min-width: 140px;
}
.btn-random {
  background: var(--yellow);
  color: #1f2937;
  border: none;
  padding: 0.48rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
}
.btn-repeat {
  background: var(--repeat-blue);
  color: #fff;
  border: none;
  padding: 0.48rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
}

.words-wrap {
  max-width: 520px;
  margin: 0 auto;
}
.word {
  background: var(--card);
  border-radius: 1rem;
  margin: 0.5rem auto;
  padding: 0.6rem 0.5rem 0.75rem;
}
.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.8rem;
  color: #bfdbfe;
}
.word .ar {
  font-size: 1.02rem;
  margin-top: 0.4rem;
  color: #e2e8f0;
}

/* مربع التسميع */
.input-word {
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.55rem 0.6rem;
  border-radius: 0.7rem;
  border: 1px solid #38bdf8;
  direction: ltr;
  background: #dbeafe;   /* أزرق فاتح */
  color: #0f3ccc;        /* أزرق غامق */
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 0 6px rgba(59,130,246,0.3);
}
.input-word:focus {
  outline: none;
  border-color: #60a5fa;
  background: #eff6ff;
  box-shadow: 0 0 10px rgba(96,165,250,0.6);
}

.correct-answer {
  margin-top: 0.35rem;
  font-weight: 700;
  font-size: 1.6rem;
  color: #f43f5e;
}

.bottom-nav {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,23,42,0.5);
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.4rem 1.3rem;
  border-radius: 999px;
}
.nav-btn {
  background: #0f6fff;
  color: #fff;
  border: none;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
}
.page-info { font-weight: 600; color: #e2e8f0; }

.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); }
}
