:root {
  --bg: #f6f6f8;
  --card: #ffffff;
  --text: #1c1c21;
  --muted: #6b6b76;
  --border: #e3e3ea;
  --accent: #5b5bd6;
  --accent-hover: #4c4cc4;
  --accent-soft: #eeeefb;
  --danger: #c93b3b;
  --danger-soft: #fdeeee;
  --ok: #1d7a3f;
  --ok-soft: #e8f6ed;
  --discord: #5865f2;
  --discord-hover: #4752c4;
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.05), 0 4px 16px rgba(20, 20, 30, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101014;
    --card: #17171d;
    --text: #e7e7ec;
    --muted: #9a9aa6;
    --border: #26262f;
    --accent: #8b8bf0;
    --accent-hover: #a0a0f5;
    --accent-soft: #22223a;
    --danger: #f07575;
    --danger-soft: #2c1b1b;
    --ok: #5fd68a;
    --ok-soft: #14261b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: light dark; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header / footer ─────────────────────────────────────────────────────── */

header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 32px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--discord));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.logo-name { font-weight: 650; font-size: 16px; }
.logo-name a { color: inherit; text-decoration: none; }
header .spacer { flex: 1; }
header .session { font-size: 13px; color: var(--muted); }

main { flex: 1; }

footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
}

/* ── Typography ──────────────────────────────────────────────────────────── */

h1 { font-size: 30px; line-height: 1.25; letter-spacing: -0.02em; margin-bottom: 12px; }
h2 { font-size: 19px; letter-spacing: -0.01em; margin-bottom: 10px; }
.lede { color: var(--muted); font-size: 16.5px; margin-bottom: 28px; max-width: 52ch; }
p + p { margin-top: 10px; }
a { color: var(--accent); }
small, .muted { color: var(--muted); }

code {
  background: var(--accent-soft);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

pre {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
  max-height: 340px;
}
pre code { background: none; padding: 0; font-size: inherit; }

/* ── Cards & steps ───────────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.card + .card, .card + form, form + .card { margin-top: 16px; }

.steps {
  display: grid;
  gap: 12px;
  margin: 28px 0;
}

.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  margin-top: 2px;
}

.step b { display: block; margin-bottom: 2px; }
.step p { color: var(--muted); font-size: 14px; line-height: 1.5; }

ol.plain {
  margin: 12px 0 12px 20px;
  display: grid;
  gap: 8px;
}

/* ── Buttons & forms ─────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

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

.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--muted); }

.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger:hover { border-color: var(--danger); }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }

label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }

input[type="text"] {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 15px;
  font-family: inherit;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */

.alert {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }

/* ── Slots & badges ──────────────────────────────────────────────────────── */

.slot-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.slot-head h2 { margin-bottom: 0; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 650;
  background: var(--accent-soft);
  color: var(--muted);
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-error { background: var(--danger-soft); color: var(--danger); }
.badge-pending { background: var(--accent-soft); color: var(--accent); }

/* ── Verification code ───────────────────────────────────────────────────── */

.code-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 10px;
  padding: 16px 12px;
  user-select: all;
  overflow-wrap: break-word;
}

/* ── Character card ──────────────────────────────────────────────────────── */

.char-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.char-card img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  object-position: top;
  border-radius: 12px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.char-card .char-name { font-size: 19px; font-weight: 700; }
.char-card .char-title { color: var(--muted); font-size: 14px; font-style: italic; margin-bottom: 8px; }

.char-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 14px;
  font-size: 14px;
}
.char-meta dt { color: var(--muted); }
.char-meta dd { font-weight: 550; }

@media (max-width: 480px) {
  h1 { font-size: 25px; }
  .char-card { flex-direction: column; }
}
