:root {
  --bg: #14110e;
  --bg-alt: #1c1712;
  --card: #22190f;
  --border: #3a2c1a;
  --text: #f7f1e6;
  --text-muted: #c9b89e;
  --accent: #E39A2D;
  --accent-soft: #F5C566;
  --accent-2: #7052C2;
  --danger: #ff5c5c;
  --radius: 14px;
  --max-w: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(112, 82, 194, 0.22) 0%, transparent 60%),
    radial-gradient(1200px 600px at 15% -10%, rgba(227, 154, 45, 0.16) 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(20, 17, 14, 0.8);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
}

.brand img.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: block;
}

.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px 2px rgba(227, 154, 45, 0.6);
}

.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-muted); font-weight: 600; font-size: 14px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #241a08;
}
.btn.btn-primary:hover { text-decoration: none; filter: brightness(1.05); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { text-decoration: none; border-color: var(--accent); }

/* Hero */
.hero {
  padding: 80px 0 0;
  display: block;
}

.hero-copy {
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}

.hero .eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(112, 82, 194, 0.18);
  color: #cabdf5;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(32px, 4.6vw, 50px);
  margin: 0 0 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero p.lead {
  max-width: 620px;
  margin: 0 auto 36px;
  color: var(--text-muted);
  font-size: 18px;
}

.cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.store-badge img { height: 62px; display: block; }

/* Hero character lineup */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-top: 24px;
  min-height: 380px;
}

.hero-visual .glow {
  position: absolute;
  bottom: 0;
  width: min(760px, 92%);
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(227, 154, 45, 0.30) 0%, transparent 70%);
  filter: blur(14px);
  z-index: 0;
}

/* All four cast members render at full brightness/saturation — no dimmed
   "background" characters. Slight negative margins overlap them into a single
   group shot, and the featured character is a touch taller and stacked on top. */
.hero-visual .char {
  position: relative;
  z-index: 1;
  height: clamp(220px, 27vw, 340px);
  width: auto;
  margin: 0 -22px;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.45));
}

.hero-visual .char.char-featured {
  height: clamp(250px, 30vw, 380px);
  z-index: 2;
  filter: drop-shadow(0 22px 32px rgba(0, 0, 0, 0.5));
}

/* Sections */
.section { padding: 64px 0; }
.section h2 {
  font-size: 30px;
  margin: 0 0 8px;
  font-weight: 800;
  text-align: center;
}
.section .subhead {
  text-align: center;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 40px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}

.card .icon {
  font-size: 26px;
  margin-bottom: 12px;
  display: inline-block;
}

.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--text-muted); font-size: 14.5px; }

/* Character roster */
.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 18px;
}

.roster-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 12px 16px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.roster-card:hover,
.roster-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.roster-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.roster-card img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  margin-bottom: 10px;
  background: var(--bg-alt);
}

.roster-card:hover img { border-color: var(--accent); }

.roster-card .name { font-weight: 700; font-size: 14.5px; }
.roster-card .role { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 40px;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
}

.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-size: 14px; }
.footer-note { color: #8a7a5f; font-size: 13px; margin-top: 16px; }

/* Legal pages */
.legal {
  padding: 56px 0 100px;
}

.legal h1 {
  font-size: 36px;
  margin-bottom: 4px;
}

.legal .updated {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 36px;
}

.legal h2 {
  font-size: 22px;
  margin-top: 42px;
  margin-bottom: 12px;
  color: var(--accent);
}

.legal h3 {
  font-size: 17px;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal p, .legal li { color: #e2d8c6; font-size: 15.5px; }
.legal ul { padding-left: 20px; }
.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14.5px;
}
.legal th, .legal td {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
}
.legal th { background: var(--bg-alt); color: var(--text); }
.legal td { color: var(--text-muted); }

.callout {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-2);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14.5px;
  color: var(--text-muted);
}

.callout.danger { border-left-color: var(--danger); }

/* Deletion form */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 640px;
  margin: 32px auto 0;
}

.form-card label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin: 18px 0 6px;
}

.form-card input,
.form-card select,
.form-card textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
}

.form-card textarea { resize: vertical; min-height: 100px; }

.form-card .hint { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.form-card button.btn { margin-top: 24px; width: 100%; justify-content: center; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 18px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #241a08;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

@media (max-width: 860px) {
  .hero { padding-top: 56px; }
  .hero-visual { min-height: 260px; margin-top: 12px; }
  .hero-visual .char { margin: 0 -16px; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  /* Four full-height characters don't fit on a phone — keep the featured
     character plus one companion. */
  .hero-visual .char.hide-sm { display: none; }
  .hero-visual .char { margin: 0 -12px; }
}

/* Companion detail modal */
body.modal-open { overflow: hidden; }

.companion-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 8, 6, 0.78);
  backdrop-filter: blur(4px);
  padding: 24px;
  overflow-y: auto;
  align-items: flex-start;
  justify-content: center;
}

.companion-modal-overlay.open { display: flex; }

.companion-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 720px;
  width: 100%;
  margin: 32px 0;
  display: grid;
  grid-template-columns: 260px 1fr;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.companion-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 17, 14, 0.6);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.companion-modal-close:hover { background: rgba(20, 17, 14, 0.85); }

.companion-modal-media {
  background: linear-gradient(180deg, rgba(227, 154, 45, 0.12), transparent 60%), var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}

.companion-modal-img {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: contain;
  object-position: center;
  display: block;
}

.companion-modal-img.is-avatar-fallback {
  object-fit: contain;
  padding: 32px;
  max-height: 320px;
}

.companion-modal-body {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.companion-modal-name {
  font-size: 26px;
  font-weight: 800;
  margin: 0;
}

.companion-modal-role {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.companion-modal-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 14px 0 6px;
}

.companion-modal-backstory {
  color: #e2d8c6;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

.companion-modal-intro {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent-2);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0;
  font-size: 14.5px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .companion-modal {
    grid-template-columns: 1fr;
  }
  .companion-modal-media { min-height: 200px; }
  .companion-modal-img { max-height: 320px; }
}


