
body { display: flex; flex-direction: column; }

/* ── HEADER ── */
header {
  text-align: center;
  padding: 50px 24px 30px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(139,26,26,0.18) 0%, transparent 70%),
    linear-gradient(180deg, #060403 0%, #0e0a06 100%);
  border-bottom: 1px solid rgba(201,168,76,0.1);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding-top: 10px;
}

.nav-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 24px;
  border: 1px solid rgba(201,168,76,0.35);
  color: var(--gold);
  background: transparent;
  transition: all 0.25s ease;
}

.nav-btn:hover, .nav-btn.active {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(201,168,76,0.08);
}

.page-header {
  text-align: center;
  padding: 40px 24px 20px;
  animation: fadeUp 0.9s ease both;
}

.page-rule {
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 16px auto 0;
}

.page-footer-wrap { margin-top: auto; }

/* ── SEARCH ── */
.char-search-wrap {
  text-align: center;
  padding: 20px 24px 10px;
}

.char-search {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1rem;
  font-style: italic;
  padding: 10px 20px;
  width: 100%;
  max-width: 380px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--parchment);
  outline: none;
  transition: border-color 0.25s;
}

.char-search::placeholder { color: rgba(201,168,76,0.3); }
.char-search:focus { border-color: rgba(201,168,76,0.5); }

/* ── FEATURED CHARACTERS ── */
.featured-characters {
  width: 100%;
  max-width: 1100px;
  margin: 10px auto 0;
  padding: 20px 48px 30px;
  border-bottom: 1px solid rgba(201,168,76,0.12);
}

.featured-label {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.65;
  text-align: center;
  margin-bottom: 20px;
}

.featured-characters .char-grid {
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 28px;
}

.featured-characters .char-card {
  border-color: rgba(201,168,76,0.25);
  box-shadow: 0 0 18px rgba(255,185,60,0.35);
}

.featured-characters .char-card:hover {
  border-color: rgba(201,168,76,0.6);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 18px rgba(255,185,60,0.35);
}

/* ── CHARACTER GRID ── */
.char-page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 24px 80px;
}

.faction-block {
  margin-bottom: 56px;
}

.faction-title {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.55;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(201,168,76,0.12);
}

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

/* ── CHARACTER CARD ── */
.char-card {
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(201,168,76,0.15);
  background: rgba(255,255,255,0.02);
  transition: all 0.28s ease;
  overflow: hidden;
}

.char-card:hover {
  border-color: rgba(201,168,76,0.45);
  background: rgba(201,168,76,0.04);
  transform: translateY(-10px) scale(1.1);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 20px rgba(201,168,76,0.08);
}

.char-card-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: top;
  display: block;
  filter: grayscale(20%) contrast(1.05);
  transition: filter 0.28s ease;
}

.char-card:hover .char-card-img {
  filter: grayscale(0%) contrast(1.1);
}

.featured-characters .char-card:hover {
  transform: translateY(-12px) scale(1.08);
}


.char-card-body {
  padding: 12px 14px;
}

.char-card-name {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  margin-bottom: 4px;
  line-height: 1.3;
}

.char-card-tag {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--parchment-dim);
  line-height: 1.3;
}

.char-card-faction-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.7rem;
  background: rgba(8,6,4,0.75);
  padding: 3px 6px;
  border: 1px solid rgba(201,168,76,0.2);
  color: var(--gold);
}

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #0e0a06;
  border: 1px solid rgba(201,168,76,0.25);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
  box-shadow: 0 0 60px rgba(0,0,0,0.8), 0 0 30px rgba(201,168,76,0.05);
}

.modal-close {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px 0;
  background: #0e0a06;
  z-index: 10;
}

.modal-close-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.5;
  background: none;
  border: 1px solid rgba(201,168,76,0.2);
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close-btn:hover { opacity: 1; border-color: var(--gold); }

.modal-inner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
}

@media (max-width: 600px) {
  .modal-inner { grid-template-columns: 1fr; }
  .modal-img-col { max-height: 300px; overflow: hidden; }
}

.modal-img-col {
  position: relative;
}

.modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  min-height: 300px;
}

.modal-img-placeholder {
  width: 100%;
  min-height: 300px;
  background: linear-gradient(180deg, #1a1208 0%, #0e0a06 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(201,168,76,0.15);
}

.modal-content-col {
  padding: 30px 32px 32px;
}

.modal-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.55;
  margin-bottom: 8px;
}

.modal-name {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.2rem, 3vw, 1.9rem);
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(201,168,76,0.2);
  margin-bottom: 6px;
  line-height: 1.2;
}

.modal-title {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--parchment-dim);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.modal-rule {
  width: 50px;
  height: 1px;
  background: linear-gradient(90deg, var(--blood), var(--ember));
  margin-bottom: 20px;
}

.modal-bio {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--parchment);
  margin-bottom: 20px;
}

.modal-bio p { margin-bottom: 14px; }
.modal-bio p:last-child { margin-bottom: 0; }

.modal-quote {
  font-style: italic;
  font-size: 1rem;
  color: #c8b888;
  border-left: 2px solid rgba(201,168,76,0.3);
  padding: 10px 0 10px 16px;
  margin-top: 20px;
  line-height: 1.7;
}

/* ── FOOTER NOTE ── */
.char-footer-note {
  text-align: center;
  padding: 0 24px 40px;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(201,168,76,0.25);
}

/* ── HIDDEN CARD ── */
.char-card.hidden { display: none; }

/* ── ANIMATIONS ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── MOBILE ── */
@media (max-width: 480px) {
  nav { gap: 8px; }
  .nav-btn { padding: 9px 16px; font-size: 0.65rem; }
  .char-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .modal { max-height: 95vh; }
  .modal-content-col { padding: 20px; }
}

@media (max-width: 700px) {
  .char-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* ── LIGHTBOX ── */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-img {
  max-width: 600px;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 0 60px rgba(0,0,0,0.8), 0 0 20px rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.15);
}

.lightbox-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  background: none;
  border: 1px solid rgba(201,168,76,0.3);
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.lightbox-close-btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}
