:root {
  --bg: #0b1021;
  --panel: rgba(18, 22, 38, 0.75);
  --panel-strong: rgba(26, 33, 55, 0.9);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8ecff;
  --muted: #9fb2d8;
  --accent: #60f6c2;
  --accent-2: #c668ff;
  --shadow: 0 10px 50px rgba(0, 0, 0, 0.35);
  font-family: "Space Grotesk", "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(96, 246, 194, 0.09), transparent 25%),
              radial-gradient(circle at 80% 0%, rgba(198, 104, 255, 0.12), transparent 28%),
              radial-gradient(circle at 50% 90%, rgba(96, 246, 194, 0.08), transparent 24%),
              var(--bg);
  color: var(--text);
  padding: 32px clamp(16px, 3vw, 32px) 48px;
}

.bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 15% 50%, rgba(255, 255, 255, 0.05), transparent 35%),
              radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.03), transparent 30%);
}

.page { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; }

.hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.brand:hover { filter: brightness(1.04); }
.logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0b1021;
  background: linear-gradient(140deg, #7cf7d8, #7aa7ff, #c97bff);
}

.hero h1 { margin: 0 0 8px; font-size: clamp(28px, 5vw, 42px); letter-spacing: -0.01em; }
.hero .lede { margin: 0; color: var(--muted); max-width: 720px; }
.hero-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
}
.pill.accent { background: linear-gradient(90deg, rgba(96, 246, 194, 0.16), rgba(198, 104, 255, 0.18)); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.page.admin .grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.table-wrap { overflow-x: auto; }
.picker { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: rgba(255,255,255,0.02); }
.picker-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.picker-row:last-child { border-bottom: none; }
.picker-title { font-weight: 600; }
.picker-meta { color: var(--muted); font-size: 13px; }
.options-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.options-list li { color: var(--muted); }
.tiny { font-size: 11px; padding: 2px 6px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.card-head, .panel-head, .runner-head, .availability-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.card h2, .card h3 { margin: 4px 0 0; }
.panel { background: var(--panel-strong); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.panel + .panel { margin-top: 12px; }

.eyebrow { letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-size: 12px; margin: 0 0 4px; }
.lede, .meta, .hint { color: var(--muted); }
.meta { margin: 2px 0 0; }
.hint { margin: 8px 0 0; font-size: 13px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.gap-sm { gap: 10px; }
.gap-xs { gap: 6px; }

label { display: flex; flex-direction: column; gap: 6px; color: var(--text); font-weight: 500; }
input, textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 15px;
}
textarea { resize: vertical; min-height: 72px; }

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  color: var(--bg);
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); filter: brightness(1.05); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.primary { color: #0b0f1d; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }

.status { color: var(--muted); font-size: 14px; }

.options .option-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.availability-head, .runner-head { margin: 10px 0; }
#quiz-list .quiz-chip {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.quiz-chip .quiz-meta { display: flex; flex-direction: column; gap: 2px; }
.quiz-chip .status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  margin-right: 6px;
}
.quiz-chip .status-dot.open { background: var(--accent); }
.quiz-chip .status-dot.scheduled { background: var(--accent-2); }

.timer {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

#question-container .question {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.question h4 { margin: 0 0 8px; }
.option { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.option input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th, .table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.table th { color: var(--muted); font-weight: 600; }

.hidden { display: none !important; }

@media (max-width: 860px) {
  body { padding: 20px 14px 32px; }
  .hero { gap: 12px; }
  .card, .panel { padding: 14px; }
  .card-head, .panel-head, .runner-head, .availability-head { flex-direction: column; align-items: flex-start; }
  .quiz-chip { align-items: flex-start; }
}
