/* Character Creator - shared stylesheet for the wizard, result pages and admin. */

:root {
  --bg: #16181d;
  --panel: #1f232b;
  --panel-2: #262b35;
  --border: #333a47;
  --text: #eef0f3;
  --muted: #9aa3b2;
  --accent: #c9a24a;
  --accent-2: #8f6fd8;
  --danger: #d9534f;
  --ok: #4caf7d;
  --radius: 10px;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; margin: 0 0 0.5em; }

a { color: var(--accent); }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}
.container.narrow { max-width: 420px; }

.loading { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---------------- Wizard shell ---------------- */

.wizard-page { max-width: 760px; }

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 28px;
}
.step-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}
.step-pill.active { background: var(--accent); color: #1a1a1a; border-color: var(--accent); font-weight: 600; }
.step-pill.done { border-color: var(--ok); color: var(--ok); }

.step { animation: fadein 0.15s ease-in; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.hint { color: var(--muted); margin-top: -6px; margin-bottom: 20px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.error {
  background: rgba(217, 83, 79, 0.12);
  border: 1px solid var(--danger);
  color: #f3b6b4;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin: 14px 0;
}
.error:empty { display: none; }

/* Pickers */
.picker-section { margin-bottom: 26px; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.pick-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.pick-card:hover { border-color: var(--accent); }
.pick-card.selected { border-color: var(--accent); background: rgba(201, 162, 74, 0.14); }
.pick-card.small { padding: 8px 12px; }
.pick-card strong { font-size: 0.98rem; }
.pick-card .muted { font-size: 0.8rem; }

/* Attributes */
.attr-grid { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.attr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
}
.attr-controls { display: flex; align-items: center; gap: 10px; }
.attr-value { min-width: 2.5em; text-align: center; font-weight: 600; }

.btn {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn:hover { border-color: var(--accent); }
.btn.tiny { padding: 5px 10px; font-size: 0.85rem; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a1a1a; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.secondary { background: transparent; }
.btn.danger { border-color: var(--danger); color: #f3b6b4; }
.btn.large { font-size: 1.1rem; padding: 14px 28px; }
.btn:disabled { opacity: 0.6; cursor: default; }

.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
}

/* Info / choice blocks (bonuses step) */
.info-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.info-block h3 { margin-bottom: 8px; font-size: 1rem; color: var(--accent); }
.info-block p { margin: 4px 0; }
.skill-line { padding: 3px 0; border-bottom: 1px dashed var(--border); }
.skill-line:last-child { border-bottom: none; }

.choice-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.choice-row:last-child { border-bottom: none; }
.choice-row label { flex: 1 1 220px; }
.choice-row input[type="text"], .choice-row select {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 6px;
}
.choice-options { display: flex; flex-wrap: wrap; gap: 6px; }

/* Point-buy */
.pb-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.pb-section h3 { font-size: 1rem; color: var(--accent-2); margin-bottom: 10px; }
.pb-section select { min-width: 220px; }
.pb-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pb-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel-2);
  padding: 6px 12px;
  border-radius: 6px;
}

/* Reminders */
.reminders-list { padding-left: 20px; }
.reminders-list li { margin-bottom: 8px; }

/* Finale */
.finale {
  text-align: center;
  padding-top: 12vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.finale-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin-bottom: 20px;
  color: var(--accent);
  text-shadow: 0 2px 12px rgba(201, 162, 74, 0.25);
}
.finale-input {
  font-size: 1.4rem;
  text-align: center;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--accent);
  color: var(--text);
  padding: 8px 4px;
  width: min(420px, 80vw);
  margin-bottom: 8px;
}
.finale-input:focus { outline: none; border-bottom-color: var(--accent-2); }
.finale-input.small { font-size: 1rem; width: min(300px, 70vw); }
.finale-sub { color: var(--muted); margin: 18px 0 4px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
.finale .error { margin-top: 10px; }
.finale .nav-buttons { margin-top: 30px; width: min(420px, 80vw); }

/* ---------------- Result page (character.php / admin view) ---------------- */

.result-page main.container { padding-top: 40px; }
.not-found { text-align: center; color: var(--muted); padding: 80px 0; }
.back-link { display: inline-block; margin-bottom: 20px; }

.checklist {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.checklist-head {
  background: var(--panel-2);
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
}
.checklist-head h1 { color: var(--accent); font-size: 1.9rem; }
.checklist-head .sub { color: var(--muted); margin: 4px 0 0; }

.checklist-section { padding: 18px 28px; border-bottom: 1px solid var(--border); }
.checklist-section:last-child { border-bottom: none; }
.checklist-section h2 { font-size: 1.05rem; color: var(--accent-2); margin-bottom: 10px; }

.checklist-table { width: 100%; border-collapse: collapse; }
.checklist-table tr { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.checklist-table tr:last-child { border-bottom: none; }
.checklist-table td { padding: 6px 4px; vertical-align: top; }
.checklist-table td.label { color: var(--muted); width: 45%; }
.checklist-table td.value { font-weight: 600; }

.save-hint { margin-top: 20px; color: var(--muted); font-size: 0.9rem; }
.save-hint code { background: var(--panel); padding: 2px 6px; border-radius: 4px; word-break: break-all; }

/* ---------------- Admin ---------------- */

.admin-login-page { display: flex; align-items: center; min-height: 100vh; }
.login-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.login-form label { color: var(--muted); font-size: 0.85rem; }
.login-form input {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 1rem;
}
.login-form button {
  background: var(--accent);
  border: none;
  color: #1a1a1a;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 6px;
}

.admin-page .container { max-width: 1100px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.logout-link { color: var(--muted); }

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.admin-filters input, .admin-filters select {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.admin-filters input[type="search"] { flex: 1 1 260px; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; background: var(--panel-2); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table td a { white-space: nowrap; }

#no-results { color: var(--muted); text-align: center; padding: 30px 0; }

.export-links { margin-bottom: 16px; }
.export-links a { margin-right: 12px; }

/* ---------------- Small screens ---------------- */

@media (max-width: 560px) {
  .container { padding: 20px 14px 48px; }
  .checklist-head, .checklist-section { padding: 16px; }
  .admin-table { display: block; overflow-x: auto; }
  .finale { padding-top: 8vh; }
}
