:root {
  --bg: #0f172a;
  --card: #1e293b;
  --blue: #0f6fff;
  --lightblue: #38bdf8;
  --red: #dc2626;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --yellow: #facc15;
  --repeat-blue: #3b82f6;
}

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;
  background: rgba(15,23,42,0.7);
  backdrop-filter: blur(7px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.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: #ffffff;
  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 !important;
  font-weight: 700;
  direction: ltr;
  text-shadow: 0 0 6px rgba(255,255,255,0.35);
}

.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;
  align-items: center;
  gap: 0.7rem;
  margin: 1rem auto;
}

.controls .row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
}

.btn-test,
.score-pill,
.btn-random,
.btn-repeat {
  width: 180px;
  height: 50px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-test:hover,
.score-pill:hover,
.btn-random:hover,
.btn-repeat:hover {
  transform: scale(1.04);
  opacity: 0.92;
}

.btn-test   { background: #f97316; color: #fff; }
.score-pill { background: #16a34a; color: #fff; }
.btn-random { background: #facc15; color: #1f2937; }
.btn-repeat { background: #3b82f6; color: #fff; }

.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;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.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.2rem;
  text-align: center;
  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;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
}
.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%, 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); }
}
