*{box-sizing:border-box;margin:0;padding:0;font-family:"Cairo","Tajawal","Tahoma",sans-serif;}
body{
  background:radial-gradient(circle at top,#0f172a,#020617 45%,#000 90%);
  color:#fff;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
.hidden{display:none!important;}
.top-bar{
  width:100%;
  background:rgba(2,6,23,.35);
  padding:.6rem .7rem .7rem;
  text-align:center;
  border-bottom:1px solid rgba(148,163,184,.12);
}
.top-bar .name{
  color:#38bdf8;
  font-size:clamp(1.6rem,6vw,2.6rem);
  font-weight:700;
}
.top-bar .phone{
  color:#38bdf8;
  font-size:clamp(.9rem,3.4vw,1.1rem);
  font-weight:600;
}
.top-bar .grade{
  color:#fff;
  font-weight:600;
}
.top-bar .unit{
  color:#fef9c3;
  background:rgba(250,204,21,.12);
  border:1px solid rgba(250,204,21,.4);
  width:min(520px,100% - 1rem);
  margin:.25rem auto 0;
  border-radius:.9rem;
  padding:.2rem 0;
  font-weight:600;
}
.container{
  width:100%;
  max-width:580px;
  margin:0 auto;
  padding:.7rem .55rem 4.5rem;
  flex:1;
}
.page-title{
  text-align:center;
  color:#38bdf8;
  margin:.6rem 0 1rem;
  font-weight:700;
}
.home-btn{
  width:100%;
  border:none;
  border-radius:1rem;
  padding:1rem .8rem;
  font-size:1.1rem;
  font-weight:700;
  margin-bottom:.7rem;
  cursor:pointer;
}
.speak-btn{background:#fb923c;color:#0f172a;}
.practice-btn{background:#38bdf8;color:#0f172a;}
.alltest-btn{background:#22c55e;color:#020617;}
.randomtest-btn{background:#facc15;color:#020617;}
.screen-title-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:.5rem;
}
.home-link{
  background:#f43f5e;
  border:1px solid rgba(244,63,94,.4);
  border-radius:.7rem;
  color:#fff;
  font-weight:700;
  padding:.55rem 1.1rem;
  font-size:1rem;
  cursor:pointer;
}
.speak-cards{display:flex;flex-direction:column;gap:.6rem;}
.speak-card{
  direction:ltr;
  background:rgba(2,6,23,.35);
  border:1px solid rgba(148,163,184,.25);
  border-radius:.85rem;
  padding:.7rem .8rem .6rem;
  display:flex;
  justify-content:space-between;
  align-items:center;
  cursor:pointer;
}
.speak-card .en{font-size:1.45rem;font-weight:700;color:#fff;}
.speak-card .ar{color:#fde68a;font-weight:700;}
.speaking{color:#38bdf8!important;}
.card-wrapper{display:flex;}
.card{
  width:100%;
  background:rgba(2,6,23,.35);
  border:1px solid rgba(148,163,184,.25);
  border-radius:1.25rem;
  padding:1rem 1.2rem 1.1rem;
}
.word-row{
  direction:ltr;
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:.8rem;
}
.word-en{font-size:2.2rem;font-weight:700;color:#fff;cursor:pointer;}
.word-ar{font-size:1.25rem;font-weight:700;color:#fde68a;}
.answers-group{display:flex;flex-direction:column;gap:.55rem;}
.answer-box{
  background:rgba(15,23,42,.35);
  border:1px solid rgba(148,163,184,.25);
  border-radius:.7rem;
  min-height:2.6rem;
  padding:.4rem .6rem;
  font-size:1.5rem;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  direction:ltr;
  outline:none;
}
.answer-box span.correct{color:#22c55e;font-weight:700;}
.answer-box span.error{color:#f43f5e;font-weight:700;}
.bottom-shell{
  width:100%;
  position:fixed;
  bottom:0;
  left:0;
  display:flex;
  justify-content:center;
  background:rgba(2,6,23,.95);
  z-index:50;
}
.nav-bar{
  width:min(580px,100%);
  display:flex;
  gap:.6rem;
  padding:.55rem .7rem .65rem;
  align-items:center;
  direction:ltr;
}
.nav-btn{
  flex:1;
  border:none;
  border-radius:1.5rem;
  padding:.65rem 0;
  font-weight:700;
  font-size:1.1rem;
  text-align:center;
  cursor:pointer;
}
.prev-btn{background:#64748b;color:#020617;}
.next-btn{background:#38bdf8;color:#020617;}
.page-indicator{
  background:rgba(2,6,23,.35);
  border:1px solid rgba(148,163,184,.25);
  padding:.45rem 1.6rem;
  border-radius:1.8rem;
  font-weight:700;
  font-size:1.05rem;
  text-align:center;
  color:#fff;
}
.praise-overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:radial-gradient(circle,rgba(250,204,21,.35),rgba(2,6,23,.9));
  font-size:3rem;
  font-weight:800;
  color:#fef3c7;
  opacity:0;
  pointer-events:none;
  transition:.2s;
  z-index:999;
}
.praise-overlay.show{opacity:1;}
.test-btn{
  width:100%;
  border:none;
  border-radius:1rem;
  padding:.6rem .5rem;
  font-size:1rem;
  font-weight:700;
  margin-bottom:.55rem;
  cursor:pointer;
}
.test-btn.green{background:#22c55e;color:#020617;}
.test-btn.blue{background:#38bdf8;color:#020617;}
.test-btn.orange{background:#fb923c;color:#020617;}
.all-list{display:flex;flex-direction:column;gap:.55rem;}
.all-item{
  background:rgba(2,6,23,.4);
  border:1px solid rgba(148,163,184,.3);
  border-radius:.85rem;
  padding:.55rem .75rem;
}
.all-ar{color:#fde68a;font-weight:700;margin-bottom:.4rem;}
.all-input{
  background:rgba(15,23,42,.45);
  border:1px solid rgba(148,163,184,.25);
  border-radius:.6rem;
  min-height:2.4rem;
  padding:.35rem .5rem;
  font-size:1.5rem;
  direction:ltr;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  outline:none;
  color:#38bdf8;
  font-weight:700;
}
.all-input span.correct{color:#22c55e;font-weight:700;}
.all-input span.error{color:#f43f5e;font-weight:700;}
.score-box{
  background:#facc15;
  color:#b91c1c;
  font-weight:800;
  text-align:center;
  border-radius:1rem;
  padding:.5rem .3rem;
  margin-bottom:.6rem;
  font-size:2.2rem;
}
.random-top-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.5rem;
  direction:ltr;
}
.small-home{font-size:.8rem;padding:.4rem .8rem;}
.small-title{font-size:1.15rem;}

/* ===== Score badge on home ===== */
.score-fab{
  width:190px;
  height:190px;
  border-radius:50%;
  background:#7c3aed;
  color:#fff;
  font-weight:900;
  font-size:4.2rem;
  display:flex;
  align-items:center;
  justify-content:center;
  margin:1.3rem auto 0;
  border:4px solid rgba(255,255,255,.12);
  box-shadow:0 10px 24px rgba(124,58,237,.4), inset 0 0 18px rgba(255,255,255,.12);
}
.score-cards{
  display:grid;
  grid-template-columns:1fr;
  gap:.75rem;
  margin:.8rem 0 1.2rem;
}
.score-card{
  background:rgba(2,6,23,.55);
  border:1px solid rgba(148,163,184,.4);
  border-radius:1rem;
  padding:.75rem .9rem;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.score-label{
  color:#fde68a;
  font-weight:700;
  font-size:1rem;
}
.score-value{
  color:#38bdf8;
  font-weight:900;
  font-size:1.9rem;
}
@media (min-width:520px){
  .score-cards{grid-template-columns:repeat(3,1fr);}
}

.all-feedback{
  margin-top:.25rem;
  min-height:1.4rem;
  font-size:1.6rem;
  text-align:left;
  direction:ltr;
}
.all-feedback .correct{color:#22c55e;font-weight:700;}
.all-feedback .error{color:#f97373;font-weight:700;}


/* ===== Spinner Wheel Reward Screen ===== */
.spinner-wrapper{
  text-align:center;
  width:100%;
  max-width:420px;
  margin:0 auto;
  padding:0.8rem 0.3rem 1.4rem;
}

.celebrate-title{
  font-size:1.5rem;
  font-weight:800;
  margin-bottom:0.8rem;
  background:linear-gradient(90deg,#f97316,#facc15,#22c55e,#38bdf8,#ec4899);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  text-shadow:0 0 10px rgba(250,204,21,0.45);
}

.spinner-container{
  position:relative;
  width:min(88vw,320px);
  margin:0.1rem auto 0.25rem;
}

.wheel{
  display:block;
  width:100%;
  height:auto;
  transform:rotate(0deg);
  transform-origin:50% 50%;
  transition:transform 4s cubic-bezier(0.12,0.65,0.1,1);
}

.pointer{
  width:0;
  height:0;
  margin:0.15rem auto 0.5rem;
  border-left:22px solid transparent;
  border-right:22px solid transparent;
  border-bottom:34px solid #fde047;
  filter:drop-shadow(0 0 6px rgba(0,0,0,0.8));
}

.wheel-result{
  background:#facc15;
  color:#1f2933;
  font-weight:800;
  border-radius:1.1rem;
  padding:0.45rem 0.7rem;
  margin:0.6rem auto 0.4rem;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0.4rem;
  max-width:260px;
  box-shadow:0 7px 18px rgba(250,204,21,0.45);
  font-size:1.5rem;
}

.wheel-result-label{
  font-size:1rem;
}

.wheel-result-value{
  font-size:2rem;
}

.wheel-note{
  margin-top:0.4rem;
  font-size:0.8rem;
  color:#cbd5f5;
}

#spinBtn:disabled{
  opacity:0.45;
  cursor:not-allowed;
}
