/* Salaah Activity — station colours + station-specific UI.
   Layered on top of style.css (the shared base). */
:root {
  --scenario: #2D7A4C;   /* green */
  --categories: #C8A165; /* gold */
  --detective: #9b59b6;  /* purple */
  --order: #e67e22;      /* orange */
  --timetable: #3498db;  /* blue */
}

/* Landing + station pips/borders for the 5 salaah stations */
.card.station.scenario { border-left: 6px solid var(--scenario); }
.card.station.categories { border-left: 6px solid var(--categories); }
.card.station.detective { border-left: 6px solid var(--detective); }
.card.station.order { border-left: 6px solid var(--order); }
.card.station.timetable { border-left: 6px solid var(--timetable); }
.station-name.scenario .pip { background: var(--scenario); }
.station-name.categories .pip { background: var(--categories); }
.station-name.detective .pip { background: var(--detective); }
.station-name.order .pip { background: var(--order); }
.station-name.timetable .pip { background: var(--timetable); }

/* Leaderboard per-station dots */
.ps-row.st-scenario .ps-dot { background: var(--scenario); }
.ps-row.st-categories .ps-dot { background: var(--categories); }
.ps-row.st-detective .ps-dot { background: var(--detective); }
.ps-row.st-order .ps-dot { background: var(--order); }
.ps-row.st-timetable .ps-dot { background: var(--timetable); }

/* ─── Timed quiz countdown ─────────────────────────────────── */
.countdown-wrap { margin: 10px 0 4px; }
.countdown-bar {
  height: 14px; border-radius: 999px; overflow: hidden;
  background: var(--card2);
}
.countdown-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--green), var(--accent));
  transition: width 0.1s linear;
}
.countdown-fill.warn { background: linear-gradient(90deg, var(--accent), var(--red)); }
.countdown-num {
  text-align: center; font-size: 18px; font-weight: 800;
  color: var(--muted); margin-top: 6px;
}

/* ─── Manage Questions (admin) ─────────────────────────────── */
.admin-view { max-width: 920px; margin: 0 auto; padding: 24px 18px 80px; }
.admin-gate { max-width: 360px; margin: 18vh auto 0; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.admin-gate h1 { font-size: 30px; margin: 0; }
.admin-gate .sub { color: var(--muted); margin: 0; }
.admin-gate input { padding: 16px; font-size: 24px; text-align: center; letter-spacing: 6px; border-radius: 12px; border: 2px solid var(--card2); background: var(--bg); color: var(--text); }
.admin-err { color: #ffb4b4; font-size: 15px; min-height: 18px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-top h1 { font-size: 30px; margin: 0; }
.admin-home { color: var(--muted); text-decoration: none; font-weight: 600; }
.admin-home:hover { color: var(--accent); }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 18px; }
.admin-tab { background: var(--card); color: var(--muted); border: 0; padding: 12px 16px; border-radius: 10px; font-size: 15px; font-weight: 700; }
.admin-tab.active { background: var(--scenario); color: #fff; }
.admin-hint { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.admin-form { background: var(--card); border-radius: 14px; padding: 18px; margin-bottom: 22px; }
.admin-form-title { font-size: 18px; font-weight: 800; margin-bottom: 12px; color: var(--accent); }
.admin-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.admin-field span { font-size: 13px; color: var(--muted); }
.admin-field textarea, .admin-field input, .admin-field select {
  width: 100%; box-sizing: border-box; padding: 12px; font-size: 16px; font-family: inherit;
  border-radius: 10px; border: 2px solid var(--card2); background: var(--bg); color: var(--text); resize: vertical;
}
.admin-field .invalid { border-color: var(--red); }
.admin-field textarea:focus, .admin-field input:focus, .admin-field select:focus { outline: none; border-color: var(--accent); }
.admin-form-actions { display: flex; gap: 10px; margin-top: 6px; }
.admin-form-actions .btn-submit, .admin-form-actions .btn-secondary { font-size: 16px; padding: 14px 22px; flex: 0 0 auto; }
.admin-listhead { font-size: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin: 8px 0 12px; }
.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-item { background: var(--card); border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.admin-item-text { flex: 1; font-size: 15px; line-height: 1.4; }
.admin-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.admin-item-actions button { background: var(--card2); color: var(--text); border: 0; padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.admin-item-actions button:hover { background: var(--accent); color: #1a1308; }
.admin-item-actions button.del:hover { background: var(--red); color: #fff; }
.admin-item-actions button:disabled { opacity: 0.35; cursor: default; }

/* ─── Ready gate (timed stations wait for a Start tap) ─────── */
.ready-card { background: var(--card); border-radius: 16px; padding: 30px 22px; text-align: center; }
.ready-title { font-size: 26px; font-weight: 800; margin-bottom: 12px; }
.ready-hint { font-size: 18px; color: var(--muted); line-height: 1.55; }
.btn-start { width: 100%; font-size: 28px; padding: 28px; margin-top: 16px; }

/* ─── End session button + class average ───────────────────── */
.btn-end {
  border: 0; border-radius: 14px; font-size: 18px; font-weight: 800;
  padding: 16px; color: #1a1308; background: var(--accent); margin-top: 10px;
}
.toolbar .btn-end { margin-top: 0; font-size: 16px; padding: 14px; }
.session-avg {
  background: linear-gradient(135deg, var(--scenario), #21603c);
  color: #fff; border-radius: 18px; padding: 22px; text-align: center;
  font-size: 20px; font-weight: 700; display: flex; flex-direction: column; gap: 2px;
}
.session-avg .big { font-size: 64px; font-weight: 800; line-height: 1.05; }
.session-avg small { font-size: 15px; font-weight: 500; opacity: 0.85; }

/* ─── Category / option grid (tap to answer) ───────────────── */
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.opt-grid.single { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
.opt-btn {
  background: var(--card2); color: var(--text); border: 2px solid transparent;
  padding: 22px 16px; border-radius: 14px;
  font-size: 22px; font-weight: 700; text-align: center;
}
.opt-btn:active { transform: scale(0.97); }
.opt-btn.correct { background: var(--green); color: #06210f; border-color: #21d469; }
.opt-btn.wrong { background: var(--red); color: #2a0606; border-color: #f1655a; }
.opt-btn.reveal { border-color: var(--green); }
.opt-btn:disabled { opacity: 0.85; }

/* ─── Detective checklist ──────────────────────────────────── */
.detective-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.detective-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card2); padding: 12px 14px; border-radius: 10px;
  font-size: 16px; cursor: pointer; border: 2px solid transparent;
}
.detective-item .box {
  width: 26px; height: 26px; border-radius: 7px; background: var(--bg);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: transparent;
}
.detective-item.spotted { border-color: var(--green); background: rgba(46,204,113,0.14); }
.detective-item.spotted .box { background: var(--green); color: #06210f; }
.detective-count { font-size: 48px; font-weight: 800; text-align: center; color: var(--accent); }

/* ─── Order reference list ─────────────────────────────────── */
.order-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.order-item {
  background: var(--card2); padding: 10px 12px; border-radius: 10px;
  font-size: 15px; display: flex; gap: 10px; align-items: center;
}
.order-item .n {
  width: 26px; height: 26px; border-radius: 50%; background: var(--order);
  color: #1a1308; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.field-row { display: flex; gap: 12px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.field-row label { font-size: 16px; color: var(--muted); flex: 1; min-width: 140px; }
.field-row input {
  width: 110px; padding: 12px; font-size: 20px; text-align: center;
  border-radius: 10px; border: 0; background: var(--bg); color: var(--text);
}
