:root{
  --bg:#071225;
  --card:#0B1B35;
  --card2:#0E254A;
  --text:#EAF2FF;
  --muted:rgba(234,242,255,.70);
  --border:rgba(255,255,255,.10);

  --primary:#3B82F6;
  --secondary:#06B6D4;
  --accent:#8B5CF6;

  --ok:#22C55E;
  --bad:#EF4444;
  --warn:#F59E0B;

  --r:20px;
  --shadow:0 12px 30px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{
  overflow-x: hidden;
height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, -apple-system, system-ui, "Segoe UI", Roboto, Arial;
  background: radial-gradient(1200px 800px at 20% 0%, rgba(59,130,246,.20), transparent 60%),
              radial-gradient(900px 700px at 90% 30%, rgba(6,182,212,.18), transparent 55%),
              var(--bg);
  color:var(--text);
}

.topbar{
  position:sticky; top:0; z-index:50;
  padding: env(safe-area-inset-top) 14px 12px;
  background: rgba(7,18,37,.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}


.brand-name{
  font-weight: 800;
  color: rgba(234,242,255,.95);
  letter-spacing: .2px;
  font-size: 18px;
}
.brand-phone{
  margin-top: 2px;
  color: rgba(59,130,246,.95);
  font-weight: 700;
  font-size: 14px;
  user-select:none;
}
.meta-line{font-size: 12.5px}
.pill{
  display:inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  margin-right: 6px;
}
.muted{color:var(--muted)}
.small{font-size:12px}

.score-badge{
  width: 68px; height: 68px;
  border-radius: 999px;
  border: 1px solid rgba(59,130,246,.55);
  background: linear-gradient(180deg, rgba(59,130,246,.16), rgba(255,255,255,.03));
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  box-shadow: var(--shadow);
}
.score-num{font-weight:900; font-size:18px}
.score-lbl{font-size:11px; color:var(--muted)}

.wrap{max-width: 980px; margin: 14px auto 60px; padding: 0 14px}

.screen{display:none}
.screen.active{display:block}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border:1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px;
}

.hero{
  display:flex;
  gap: 12px;
  align-items:stretch;
}
.hero-left{flex:1}
.hero-right{width: 140px; display:flex; align-items:center; justify-content:center}
.hero h1{margin: 4px 0 6px; font-size: 22px}
.hero p{margin: 0 0 10px}

.hero-row{display:flex; gap:10px; flex-wrap:wrap}
.bigstat{
  width: 120px; height: 120px;
  border-radius: 26px;
  border:1px solid rgba(6,182,212,.45);
  background: linear-gradient(180deg, rgba(6,182,212,.14), rgba(255,255,255,.03));
  display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.bigstat-num{font-weight:900; font-size: 22px}
.bigstat-lbl{font-size: 12px; color: var(--muted)}

.grid2x2{
  margin-top: 14px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tile{
  border:1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(11,27,53,.65), rgba(255,255,255,.02));
  box-shadow: var(--shadow);
  padding: 16px;
  text-align:left;
  cursor:pointer;
  color:var(--text);
}
.tile:active{transform: scale(.99)}
.tile-ico{font-size: 26px}
.tile-title{font-weight:900; margin-top: 6px}
.tile-sub{color:var(--muted); font-size:12.5px; margin-top: 2px}

.row{display:flex}
.gap{gap:10px}
.space-between{justify-content:space-between}
.align-start{align-items:flex-start}
.divider{height:1px; background: var(--border); margin: 12px 0}

.btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding: 11px 14px;
  border-radius: 16px;
  font-weight: 800;
  cursor:pointer;
}
.btn:active{transform: scale(.99)}
.btn-primary{
  background: linear-gradient(180deg, rgba(59,130,246,.92), rgba(59,130,246,.65));
  border-color: rgba(59,130,246,.85);
}
.btn-secondary{
  background: linear-gradient(180deg, rgba(6,182,212,.90), rgba(6,182,212,.60));
  border-color: rgba(6,182,212,.80);
}
.btn-ghost{
  background: transparent;
  border-color: rgba(255,255,255,.16);
}

.qmeta{font-size:12.5px; color:var(--muted); font-weight:700}
.qtext{
  margin-top: 8px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.chips{display:flex; gap:8px; flex-wrap:wrap; margin-top: 10px}
.chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 7px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  font-weight: 800;
  font-size: 12.5px;
  user-select:none;
}
.chip-primary{
  border-color: rgba(59,130,246,.70);
  background: rgba(59,130,246,.12);
}
.chip-ghost{
  background: transparent;
  border-color: rgba(255,255,255,.16);
  cursor:pointer;
}
.chip-soft{
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.10);
}

.tinyprogress{
  width: 86px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.10);
  margin-top: 6px;
  overflow:hidden;
}
.tinyprogress-bar{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(59,130,246,.95), rgba(6,182,212,.95));
  border-radius: 999px;
}

.subcard{
  margin-top: 10px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 12px;
}

.lbl{display:block; margin: 12px 0 8px; font-weight:900}
.input{
  width:100%;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.18);
  color: rgba(147,197,253,.98); /* light blue default */
  padding: 14px 14px;
  outline:none;
  font-family: inherit; /* match question font */
  font-size: 18px; /* same as question */
  font-weight: 800;          /* same bold feel */
  line-height:1.35;
}
.input:focus{border-color: rgba(59,130,246,.55); box-shadow: 0 0 0 4px rgba(59,130,246,.12)}

.minihelp{margin-top: 12px}
.minihelp-title{font-weight:900; margin-bottom: 6px}
.minihelp-chips{display:flex; gap:8px; flex-wrap:wrap}

.rules-grid{
  margin-top: 10px;
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.rule{
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  padding: 12px;
}
.rule-title{font-weight:900; margin-bottom: 6px}
.rule-ex{font-weight:800}
.rule-ar{margin-top: 6px; color: var(--muted)}

.resultTop{
  display:flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap:wrap;
}
.ring{
  width: 160px; height: 160px;
  border-radius: 999px;
  border: 1px solid rgba(59,130,246,.65);
  background: radial-gradient(circle at 30% 30%, rgba(59,130,246,.18), transparent 60%),
              radial-gradient(circle at 70% 70%, rgba(6,182,212,.12), transparent 55%),
              rgba(255,255,255,.03);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  box-shadow: var(--shadow);
}
.ring-num{font-size: 24px; font-weight: 950}
.ring-lbl{font-size: 12px; color: var(--muted); font-weight: 800}
.resultStats{display:flex; gap: 10px; flex:1; min-width: 240px}
.stat{
  flex:1;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  padding: 12px;
}
.stat-num{font-weight:950; font-size: 20px}
.stat-lbl{color:var(--muted); font-size: 12px; margin-top: 2px}

.reviewList{display:flex; flex-direction:column; gap: 10px; margin-top: 10px}
.review{
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  padding: 12px;
}
.reviewTop{display:flex; align-items:center; justify-content:space-between; gap:10px}
.reviewQ{font-weight: 950}
.badge{
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  border:1px solid rgba(255,255,255,.12);
}
.badge.ok{background: rgba(34,197,94,.14); border-color: rgba(34,197,94,.35)}
.badge.bad{background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35)}
.reviewBody{margin-top: 10px; display:grid; gap: 8px}
.blockTitle{font-weight: 900; color: rgba(234,242,255,.92)}
.blockText{color: rgba(234,242,255,.90)}
.hl{color: rgba(6,182,212,.95); font-weight: 950}

.scoreGrid{
  margin-top: 10px;
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.scoreCard{
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  padding: 14px;
  text-align:center;
}
.scoreCardNum{font-weight: 950; font-size: 22px}
.scoreCardLbl{color:var(--muted); font-size: 12px; margin-top: 4px}

.toast{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  border:1px solid rgba(255,255,255,.12);
  color: var(--text);
  box-shadow: var(--shadow);
  display:none;
  z-index: 80;
  max-width: calc(100% - 24px);
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

.ltr{direction:ltr; text-align:left}
.rtl{direction:rtl; text-align:right}
.ar{font-family: "Cairo", "Tahoma", Arial, sans-serif}

@media (max-width: 720px){
  /* --mobilefit */
  .wrap{max-width: 100%; padding: 0 12px}
  .card{padding: 12px}
  .btn{width:auto}
  .row.gap{flex-wrap:wrap}
  .chips{gap:6px}
  .tile{padding: 14px}

  .topbar-inner{grid-template-columns: 1fr; gap: 10px}
  .score-badge{justify-self: start}
  .grid2x2{grid-template-columns: 1fr}
  .hero{flex-direction:column}
  .hero-right{width:100%; justify-content:flex-start}
  .scoreGrid{grid-template-columns: 1fr}
}

/* Inline result under the student's answer */
.inlineFeedback{
  margin-top: 10px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  padding: 12px;
}
.inlineFeedback .title{
  font-weight: 950;
  margin-bottom: 6px;
}
.inlineFeedback.ok{
  border-color: rgba(34,197,94,.40);
  background: rgba(34,197,94,.08);
}
.inlineFeedback.bad{
  border-color: rgba(239,68,68,.40);
  background: rgba(239,68,68,.08);
}
.input.ans-ok{
  color: rgba(34,197,94,.98);
  border-color: rgba(34,197,94,.55);
  box-shadow: 0 0 0 4px rgba(34,197,94,.10);
}
.input.ans-bad{
  color: rgba(239,68,68,.98);
  border-color: rgba(239,68,68,.55);
  box-shadow: 0 0 0 4px rgba(239,68,68,.10);
}


.input::placeholder{color: rgba(234,242,255,.45); font-weight:700}

.modelAnswer{
  color: rgba(34,197,94,.98);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.wraprow{flex-wrap:wrap}

.mustInline{
  margin-top: 6px;
  font-size: 18px;
  font-weight: 950;
  color: rgba(185,28,28,.98); /* dark red */
}

.topbar-center{
  max-width: 980px;
  margin: 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  position: relative;
  gap: 12px;
}
.brand-center{
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
}
.brand-sub{
  margin-top: 6px;
  font-weight: 800;
  font-size: 13px;
  color: rgba(234,242,255,.75);
}
.topbar-center .score-badge{
  position:absolute;
  right: 0;
}
@media (max-width: 720px){
  .topbar-center{padding-right: 78px;} /* leave space for badge */
  .topbar-center .score-badge{right: 0;}
}
