* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { min-height: 100%; }

body {
  font-family: 'Cairo', 'Noto Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif, 'Noto Color Emoji';
  background: #eef1f8;
  color: #1e293b;
  min-height: 100vh;
}

.app {
  max-width: 440px;
  margin: 0 auto;
  padding: 18px 14px 40px;
}

/* ---------- brand ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 14px;
}
.brand-tile {
  background: #0A1D4C;
  border-radius: 16px;
  padding: 7px 10px;
  box-shadow: 0 6px 16px rgba(10, 29, 76, .28);
  display: flex; align-items: center; justify-content: center;
}
.brand-logo { height: 46px; width: auto; display: block; }
.brand-name { color: #0A1D4C; font-weight: 800; font-size: 19px; letter-spacing: .3px; }
.brand-sub  { color: #5a6b8c; font-size: 13px; }

/* ---------- card ---------- */
.card {
  background: #fff;
  border-radius: 22px;
  padding: 22px 18px;
  box-shadow: 0 10px 26px rgba(10, 29, 76, .10);
  margin-bottom: 14px;
}

h1 { font-size: 24px; font-weight: 800; margin-bottom: 4px; color: #0A1D4C; }
h2 { font-size: 20px; font-weight: 800; margin-bottom: 6px; color: #0A1D4C; }
.muted { color: #68789a; font-size: 14px; margin-bottom: 16px; }

/* ---------- buttons ---------- */
.btn-primary {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  color: #0A1D4C;
  background: linear-gradient(135deg, #E8C862, #D4AF37);
  box-shadow: 0 4px 0 #a3891f, 0 8px 18px rgba(212, 175, 55, .35);
  cursor: pointer;
  margin-top: 14px;
  transition: transform .08s;
}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #a3891f; }

.btn-secondary {
  width: 100%;
  border: 2px solid #dde3ee;
  border-radius: 14px;
  padding: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #3c4a68;
  background: #fff;
  cursor: pointer;
  margin-top: 10px;
}

.btn-google {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 2px solid #dde3ee;
  border-radius: 14px;
  padding: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #26345a;
  background: #fff;
  cursor: pointer;
}
.google-note { font-size: 12.5px; color: #8a6d1a; margin-top: 8px; }

.linklike {
  display: block;
  margin: 16px auto 0;
  border: 0; background: none;
  color: #0A1D4C;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.divider {
  display: flex; align-items: center; gap: 10px;
  color: #9aa7c2; font-size: 13px;
  margin: 16px 0;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: #dde3ee;
}

/* ---------- fields ---------- */
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13.5px; font-weight: 700; color: #3c4a68; margin-bottom: 5px; }
.field input {
  width: 100%;
  border: 2px solid #dde3ee;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  color: #16224a;
  background: #f7f9fd;
  outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: #D4AF37; background: #fff; }

.error { color: #dc2626; font-size: 13px; font-weight: 700; min-height: 18px; }
.hint  { color: #68789a; font-size: 12.5px; margin-top: 10px; text-align: center; }

.teacher-gate { margin-top: 10px; border-top: 1px dashed #dde3ee; padding-top: 12px; }

/* ---------- HUD ---------- */
.hud { padding: 14px 16px; }
.hud-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hud-row.small { margin-top: 8px; font-size: 12.5px; color: #68789a; font-weight: 700; }
.hud-name { font-weight: 800; font-size: 15px; color: #0A1D4C; }
.hud-pills { display: flex; gap: 6px; }
.pill {
  border-radius: 999px;
  padding: 4px 12px;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}
.pill b { font-size: 15px; font-weight: 800; color: #0A1D4C; }
.pill span { font-size: 11px; font-weight: 700; color: #68789a; }
.pill-star   { background: #FBF3D9; }
.pill-points { background: #E7ECF8; }

.progress {
  height: 10px;
  background: #e4e9f4;
  border-radius: 999px;
  margin-top: 10px;
  overflow: hidden;
}
#progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #E8C862, #D4AF37);
  transition: width .4s;
}

/* ---------- welcome back ---------- */
.welcome-back {
  background: #ecfdf5;
  border: 2px solid #a7f3d0;
  color: #047857;
  font-weight: 700;
  font-size: 14px;
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  text-align: center;
}

/* ---------- question ---------- */
.qcard { padding: 20px 16px; }
.q-text {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.55;
  text-align: left;
  color: #0f1b3d;
  margin-bottom: 6px;
}
.q-hint { font-size: 13.5px; color: #8a6d1a; font-weight: 600; margin-bottom: 16px; }

#options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  width: 100%;
  text-align: left;
  border: 2px solid #dde3ee;
  border-radius: 14px;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  color: #16224a;
  background: #f7f9fd;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  direction: ltr;
}
.opt:active { transform: scale(.99); }
.opt.correct { border-color: #16a34a; background: #dcfce7; color: #14532d; }
.opt.wrong   { border-color: #dc2626; background: #fee2e2; color: #7f1d1d; }
.opt.dim     { opacity: .55; }
.opt:disabled { cursor: default; }

/* ---------- feedback ---------- */
.feedback { margin-top: 16px; border-top: 2px dashed #dde3ee; padding-top: 14px; }
#fb-banner {
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
}
#fb-banner.ok  { background: #dcfce7; color: #15803d; }
#fb-banner.no  { background: #fee2e2; color: #b91c1c; }
#fb-detail { font-size: 14.5px; font-weight: 700; color: #8a6d1a; text-align: center; min-height: 20px; }
#fb-explain {
  font-size: 14px;
  color: #45536e;
  background: #f1f4fa;
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 8px;
  text-align: left;
  line-height: 1.6;
}
#fb-explain:empty { display: none; }

/* ---------- end ---------- */
.end-card { text-align: center; }
.trophy { font-size: 64px; margin-bottom: 6px; }
.end-msg { color: #45536e; font-size: 15px; margin-bottom: 14px; }
.end-stats {
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.end-stats .stat {
  background: #f7f9fd;
  border: 2px solid #dde3ee;
  border-radius: 14px;
  padding: 10px 18px;
  min-width: 96px;
}
.end-stats .stat b { display: block; font-size: 22px; color: #0A1D4C; }
.end-stats .stat span { font-size: 12.5px; color: #68789a; font-weight: 700; }

/* ---------- teacher ---------- */
.t-table { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 6px; }
.t-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  border: 2px solid #dde3ee;
  border-radius: 14px;
  padding: 10px 14px;
  background: #f7f9fd;
}
.t-name { font-weight: 800; font-size: 15px; color: #0A1D4C; }
.t-mail { font-size: 12px; color: #9aa7c2; direction: ltr; text-align: right; }
.t-stats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; font-weight: 700; color: #45536e; margin-top: 4px; }
.t-stats span { white-space: nowrap; }
.t-stats b { color: #0A1D4C; }
.t-done { color: #16a34a; }
.t-empty { text-align: center; color: #9aa7c2; font-size: 14px; padding: 20px 0; }

.hidden { display: none !important; }

/* ---------- selects ---------- */
.field select, .t-filter {
  width: 100%;
  border: 2px solid #dde3ee;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #16224a;
  background: #f7f9fd;
  outline: none;
}
.field select:focus, .t-filter:focus { border-color: #D4AF37; background: #fff; }
.t-filter { margin-bottom: 10px; font-size: 14px; padding: 10px 12px; }
