/* Hajj Quiz — shared styles. Touch-friendly. */
:root {
  --bg: #0c1024;
  --card: #1b2046;
  --card2: #252b5b;
  --text: #f4f4f8;
  --muted: #8a90b8;
  --accent: #f4c430;
  --green: #2ecc71;
  --red: #e74c3c;
  --blue: #3498db;
  --mina: #e67e22;
  --arafat: #27ae60;
  --muzdalifa: #9b59b6;
  --jamarat: #e74c3c;
  --ihram: #3498db;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
}
button { font-family: inherit; cursor: pointer; }

/* ─── Landing ────────────────────────────────────────────── */
.landing { padding: 32px 24px; max-width: 920px; margin: 0 auto; }
.landing h1 { font-size: 48px; margin: 0 0 8px; letter-spacing: 0.5px; }
.landing h2 { margin: 32px 0 12px; font-size: 22px; color: var(--muted); font-weight: 600; }
.sub { color: var(--muted); margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.card {
  background: var(--card); border-radius: 14px; padding: 22px 18px;
  text-decoration: none; color: var(--text); font-weight: 700; font-size: 22px;
  display: flex; flex-direction: column; gap: 4px; min-height: 110px;
  transition: transform 80ms ease;
}
.card:active { transform: scale(0.97); }
.card small { font-weight: 400; font-size: 13px; color: var(--muted); }
.card.station.mina { border-left: 6px solid var(--mina); }
.card.station.arafat { border-left: 6px solid var(--arafat); }
.card.station.muzdalifa { border-left: 6px solid var(--muzdalifa); }
.card.station.jamarat { border-left: 6px solid var(--jamarat); }
.card.station.ihram { border-left: 6px solid var(--ihram); }
.card.teacher { border-left: 6px solid var(--accent); }
.card.display { border-left: 6px solid var(--green); }

/* ─── Station view ───────────────────────────────────────── */
.station-view {
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.station-header {
  padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  background: rgba(0,0,0,0.25);
  position: sticky; top: 0; z-index: 10;
}
.station-name { font-size: 24px; font-weight: 800; letter-spacing: 0.5px; }
.station-name .pip { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.station-name.mina .pip { background: var(--mina); }
.station-name.arafat .pip { background: var(--arafat); }
.station-name.muzdalifa .pip { background: var(--muzdalifa); }
.station-name.jamarat .pip { background: var(--jamarat); }
.station-name.ihram .pip { background: var(--ihram); }
.progress { color: var(--muted); font-weight: 600; }

.station-body { flex: 1; padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 16px; }
.placeholder {
  margin-top: 30vh; text-align: center; color: var(--muted); font-size: 20px;
}

.class-picker { display: flex; flex-direction: column; gap: 10px; }
.class-picker .heading { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.class-btn {
  background: var(--card2); color: var(--text);
  border: 0; padding: 22px; border-radius: 14px;
  font-size: 26px; font-weight: 700; text-align: left;
}
.class-btn small { display: block; color: var(--muted); font-weight: 500; font-size: 14px; margin-top: 4px; }

.student-spotlight {
  background: linear-gradient(135deg, var(--accent), #f6a40b);
  color: #1a1308; border-radius: 18px; padding: 14px 18px;
  font-size: 22px; font-weight: 800;
}
.student-spotlight small { font-weight: 500; font-size: 13px; opacity: 0.7; display: block; }

.question-card {
  background: var(--card); border-radius: 16px; padding: 22px;
  font-size: 24px; line-height: 1.35; font-weight: 600;
}
.options { display: grid; gap: 10px; }
.option {
  background: var(--card2); color: var(--text); border: 2px solid transparent;
  padding: 18px 20px; border-radius: 14px;
  font-size: 22px; font-weight: 600; text-align: left;
}
.option:active { transform: scale(0.98); }
.option.correct { background: var(--green); color: #06210f; border-color: #21d469; }
.option.wrong { background: var(--red); color: #2a0606; border-color: #f1655a; }
.option.locked { opacity: 0.6; pointer-events: none; }
.option.selected { border-color: var(--accent); }

.tj-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-correct, .btn-wrong, .btn-next, .btn-submit, .btn-secondary, .btn-danger {
  border: 0; border-radius: 14px; font-size: 22px; font-weight: 700;
  padding: 20px; color: white;
}
.btn-correct { background: var(--green); color: #06210f; }
.btn-wrong { background: var(--red); }
.btn-next { background: var(--blue); width: 100%; }
.btn-secondary { background: var(--card2); }
.btn-danger { background: var(--red); }
.btn-submit { background: var(--accent); color: #1a1308; }

.answer-note {
  background: rgba(255,255,255,0.05);
  padding: 14px; border-radius: 10px;
  font-size: 16px; color: var(--muted); line-height: 1.4;
}
.answer-note strong { color: var(--text); }

.toolbar { display: flex; gap: 10px; margin-top: 8px; }
.toolbar > * { flex: 1; padding: 14px; font-size: 16px; }

.multi-select { display: grid; gap: 8px; }
.multi-option {
  background: var(--card2); padding: 16px 18px; border-radius: 12px;
  font-size: 19px; display: flex; align-items: center; gap: 12px;
  border: 2px solid transparent;
}
.multi-option.ticked { border-color: var(--green); background: rgba(46,204,113,0.15); }
.multi-option .check { width: 24px; height: 24px; border-radius: 6px; background: var(--bg); display: inline-block; }
.multi-option.ticked .check { background: var(--green); }

/* ─── Game stations ───────────────────────────────────────── */
.game-card { background: var(--card); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.counter { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.counter .label { font-size: 18px; color: var(--muted); }
.counter .value { font-size: 42px; font-weight: 800; }
.counter .btns { display: flex; gap: 8px; }
.counter button { width: 56px; height: 56px; border-radius: 50%; font-size: 28px; font-weight: 800; background: var(--card2); color: var(--text); border: 0; }
.live-pct { font-size: 56px; font-weight: 800; text-align: center; color: var(--accent); }

.student-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.student-row {
  background: var(--card2); padding: 12px 14px; border-radius: 10px;
  display: flex; align-items: center; gap: 10px;
}
.student-row .name { flex: 1; font-size: 16px; }
.student-row input { width: 64px; padding: 8px; font-size: 18px; text-align: center; border-radius: 8px; border: 0; background: var(--bg); color: var(--text); }

/* ─── Teacher / Admin view ───────────────────────────────── */
.teacher-view { max-width: 920px; margin: 0 auto; padding: 24px 18px 60px; }
.teacher-view h1 { font-size: 32px; margin: 0 0 16px; }
.teacher-view h2 { font-size: 22px; margin-top: 28px; color: var(--accent); }
.attendance-class { background: var(--card); padding: 16px; border-radius: 14px; margin-bottom: 14px; }
.attendance-class .title { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.attendance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.attendance-item {
  background: var(--card2); padding: 10px 12px; border-radius: 10px;
  font-size: 16px; display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.attendance-item.absent { opacity: 0.45; text-decoration: line-through; }

/* ─── Display / leaderboard ───────────────────────────────── */
.display-view { padding: 32px; max-width: 1600px; margin: 0 auto; }
.display-view h1 { font-size: 64px; margin: 0 0 12px; text-align: center; letter-spacing: 1px; }
.display-view .ticker { text-align: center; color: var(--muted); margin-bottom: 28px; font-size: 22px; }
.lb { display: grid; grid-template-columns: 60px 1fr 1fr 1fr 1fr 1fr 1fr 140px; gap: 6px; }
.lb .h, .lb .row > div { padding: 16px 12px; border-radius: 8px; font-size: 20px; }
.lb .h { color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }
.lb .row { display: contents; }
.lb .row > div { background: var(--card); }
.lb .row.rank-1 > div { background: linear-gradient(135deg, var(--accent), #f0a000); color: #1a1308; font-weight: 800; }
.lb .row.rank-2 > div { background: #c0c8d0; color: #15171a; font-weight: 700; }
.lb .row.rank-3 > div { background: #c69060; color: #1a0c00; font-weight: 700; }
.lb .total { font-size: 26px; font-weight: 800; text-align: center; }
.lb .station-cell { text-align: center; }
.lb .station-cell.empty { color: var(--muted); font-style: italic; }
.lb .rank { font-size: 26px; font-weight: 800; text-align: center; }
.lb .name { font-size: 26px; font-weight: 700; }

@media (max-width: 900px) {
  .lb { grid-template-columns: 1fr; }
  .lb .h { display: none; }
}

/* ─── v2: AI-judged answer input ───────────────────────────── */
.answer-input {
  width: 100%; box-sizing: border-box;
  padding: 18px; margin-top: 16px;
  font-size: 22px; line-height: 1.4;
  border-radius: 14px; border: 2px solid var(--card2);
  background: var(--bg); color: var(--text);
  font-family: inherit; resize: vertical;
  -webkit-appearance: none;
}
.answer-input:focus { outline: none; border-color: var(--accent); }
.btn-submit { margin-top: 12px; }

.conf-badge {
  display: inline-block; padding: 2px 8px; margin-left: 6px;
  border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.conf-high { background: #1e6f3a; color: #cdf7d6; }
.conf-medium { background: #8a6612; color: #ffe6a8; }
.conf-low { background: #6f1e1e; color: #ffcfcf; }
