/* ─── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1a1c2e;
  --surface: #23263a;
  --surface2: #2d3048;
  --border: rgba(255,255,255,0.08);
  --text: #e8eaf2;
  --text-muted: #8b8fa8;
  --accent: #5865F2;      /* Discord blurple */
  --accent-hover: #4752c4;
  --success: #3ba55c;
  --error: #ed4245;
  --error-bg: rgba(237,66,69,0.12);
  --success-bg: rgba(59,165,92,0.12);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Layout ────────────────────────────────────────────────────── */
.page-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.card-wide {
  max-width: 680px;
  text-align: left;
}

/* ─── Typography ────────────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.2; }
h2 { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.5rem; }
p  { line-height: 1.6; }

.subtitle {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
}

/* ─── Discord logo / icon ───────────────────────────────────────── */
.discord-logo {
  color: var(--accent);
  margin-bottom: 1.25rem;
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  width: 100%;
  margin-top: 0.5rem;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-discord {
  background: var(--accent);
  color: #fff;
}
.btn-discord:hover { background: var(--accent-hover); }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ─── Steps (landing page) ──────────────────────────────────────── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.step-num {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--accent);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── User badge (landing) ──────────────────────────────────────── */
.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.user-name { font-size: 0.9rem; margin-bottom: 0.1rem; }

/* ─── Avatars ───────────────────────────────────────────────────── */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; }

.avatar-placeholder {
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 1.1rem;
}

/* ─── Quiz header ───────────────────────────────────────────────── */
.quiz-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.user-name-small { font-size: 0.85rem; color: var(--text-muted); }
.ml-auto { margin-left: auto; }

/* ─── Questions ─────────────────────────────────────────────────── */
.question-block {
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s;
}

.question-block.question-wrong {
  border-color: var(--error);
  background: var(--error-bg);
}

.question-text {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  line-height: 1.5;
}

.question-num {
  background: var(--accent);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
  font-size: 0.9rem;
}

.option-label:hover {
  background: rgba(88, 101, 242, 0.1);
  border-color: var(--accent);
}

.option-label input[type="radio"] {
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.option-label:has(input:checked) {
  background: rgba(88, 101, 242, 0.15);
  border-color: var(--accent);
}

.option-label.option-wrong  { background: var(--error-bg);   border-color: var(--error); }
.option-label.option-correct{ background: var(--success-bg); border-color: var(--success); }

/* ─── Alerts ────────────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: var(--error-bg);
  color: #f5a5a6;
  border: 1px solid rgba(237,66,69,0.3);
}

/* ─── Result boxes ──────────────────────────────────────────────── */
.result-box {
  text-align: center;
  padding: 2rem;
  border-radius: 10px;
  margin-top: 1rem;
}

.result-success {
  background: var(--success-bg);
  border: 1px solid rgba(59,165,92,0.3);
}

.result-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}

/* ─── Links ─────────────────────────────────────────────────────── */
.link-muted {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
}
.link-muted:hover { color: var(--text); text-decoration: underline; }

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .card { padding: 1.5rem 1.25rem; }
  h1 { font-size: 1.4rem; }
}
