/* AD&D 2.5 Wiki — tema medieval / grimório */

@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Crimson+Pro:ital,wght@0,400;0,600;1,400&display=swap");

:root {
  --bg-deep: #0f0c09;
  --bg-overlay: rgba(15, 12, 9, 0.82);
  --parchment: #f4e8c8;
  --parchment-dark: #e8d4a8;
  --parchment-edge: #c4a574;
  --ink: #2a1f14;
  --ink-muted: #5c4a32;
  --gold: #c9a227;
  --gold-bright: #e8c547;
  --gold-dim: #8a7020;
  --burgundy: #6b2d2d;
  --forest: #2d4a35;
  --danger: #9e3a3a;
  --success: #3d6b4a;
  --border-ornate: #8a7020;
  --shadow: rgba(0, 0, 0, 0.45);
  --font-display: "Cinzel", "Palatino Linotype", serif;
  --font-body: "Crimson Pro", Georgia, serif;
  --font-ui: "Cinzel", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  background: var(--bg-deep);
  color: var(--parchment);
  line-height: 1.6;
  min-height: 100vh;
}

/* Fundo: textura + vinheta */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(107, 45, 45, 0.15), transparent 55%),
    radial-gradient(ellipse 100% 100% at 50% 100%, rgba(0, 0, 0, 0.5), transparent 40%),
    url("img/parchment-texture.jpg") center / 512px repeat;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--gold-bright); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold); text-decoration: underline; }

/* —— Hero —— */
.site-hero {
  position: relative;
  min-height: 200px;
  background: var(--bg-deep) url("img/hero-banner.jpg") center 40% / cover no-repeat;
  border-bottom: 3px solid var(--gold-dim);
  box-shadow: 0 8px 32px var(--shadow);
  z-index: 1;
}

.site-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 12, 9, 0.35) 0%,
    rgba(15, 12, 9, 0.75) 70%,
    var(--bg-deep) 100%
  );
}

.site-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.25rem;
  text-align: center;
}

.site-hero .brand {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
  text-decoration: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8), 0 0 40px rgba(201, 162, 39, 0.3);
}

.site-hero .brand:hover {
  color: #fff;
  text-decoration: none;
}

.site-hero .tagline {
  margin: 0.5rem 0 0;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--parchment-dark);
  opacity: 0.9;
}

.hero-ornament {
  display: block;
  width: min(280px, 70%);
  height: 24px;
  margin: 0.75rem auto 0;
  opacity: 0.85;
}

/* —— Barra de navegação —— */
.site-nav {
  position: relative;
  z-index: 10;
  background: linear-gradient(180deg, #1a1410 0%, #12100c 100%);
  border-bottom: 1px solid var(--border-ornate);
  box-shadow: 0 4px 16px var(--shadow);
}

.site-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem 2rem;
  flex-wrap: wrap;
}

.site-nav a {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--parchment-dark);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
  text-decoration: none;
}

.site-nav .user-badge {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-muted);
  color: #a89f8f;
  border: none;
}

.badge {
  background: var(--burgundy);
  color: var(--parchment);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  margin-left: 0.35rem;
  border: 1px solid var(--gold-dim);
}

/* —— Conteúdo principal —— */
main {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

main.wide { max-width: 1180px; }

/* Painel pergaminho */
.scroll-panel {
  position: relative;
  background:
    linear-gradient(135deg, rgba(255, 248, 230, 0.03) 0%, transparent 50%),
    linear-gradient(180deg, var(--parchment) 0%, var(--parchment-dark) 100%);
  color: var(--ink);
  border: 2px solid var(--parchment-edge);
  border-radius: 2px;
  padding: 2rem 2.25rem 2.5rem;
  box-shadow:
    0 0 0 1px var(--gold-dim),
    0 12px 40px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.scroll-panel::before,
.scroll-panel::after {
  content: "";
  position: absolute;
  width: 48px;
  height: 48px;
  background: url("img/corner-ornament.svg") no-repeat;
  opacity: 0.5;
  pointer-events: none;
}

.scroll-panel::before { top: 8px; left: 8px; }
.scroll-panel::after {
  bottom: 8px;
  right: 8px;
  transform: rotate(180deg);
}

.scroll-panel h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  letter-spacing: 0.06em;
  color: var(--burgundy);
  text-align: center;
  margin: 0 0 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--parchment-edge);
}

.scroll-panel > .ornament-divider {
  display: block;
  width: min(320px, 80%);
  margin: 0 auto 1.5rem;
}

.scroll-panel .hint {
  color: var(--ink-muted);
  text-align: center;
  font-style: italic;
}

/* Flash (sobre fundo escuro, fora do pergaminho) */
main > .flash {
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--gold-dim);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  background: rgba(244, 232, 200, 0.95);
  color: var(--ink);
  box-shadow: 0 4px 16px var(--shadow);
}
main > .flash.success {
  border-color: var(--success);
  border-left: 4px solid var(--success);
}
main > .flash.error {
  border-color: var(--danger);
  border-left: 4px solid var(--danger);
}

/* Grade de capítulos com miniaturas */
.chapter-grid {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.chapter-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--parchment-edge);
  box-shadow: 0 2px 8px rgba(42, 31, 20, 0.12);
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.chapter-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 8px 24px rgba(42, 31, 20, 0.3);
  text-decoration: none;
}

.chapter-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 6;
  background: var(--bg-deep);
  overflow: hidden;
}

.chapter-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.95) brightness(0.92);
  transition: transform 0.4s, filter 0.3s;
}

.chapter-card:hover .chapter-thumb img {
  transform: scale(1.06);
  filter: saturate(1.1) brightness(1);
}

.chapter-thumb .chapter-num {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gold-bright);
  text-shadow: 0 1px 4px #000, 0 0 12px rgba(0,0,0,0.8);
}

.chapter-info {
  padding: 0.7rem 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.chapter-info .chapter-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--burgundy);
  line-height: 1.25;
}

.chapter-info .meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-style: italic;
}

/* Banner no topo de cada capítulo */
.chapter-banner {
  position: relative;
  margin-bottom: 1.25rem;
  border: 2px solid var(--gold-dim);
  box-shadow: 0 8px 28px var(--shadow);
  overflow: hidden;
  max-height: 260px;
}

.chapter-banner img {
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}

.chapter-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(15, 12, 9, 0.85) 100%);
}

.chapter-banner-title {
  position: absolute;
  left: 50%;
  bottom: 0.85rem;
  transform: translateX(-50%);
  z-index: 2;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  text-align: center;
  text-shadow: 0 2px 10px #000, 0 0 30px rgba(0, 0, 0, 0.9);
  padding: 0 1rem;
}

/* Conteúdo wiki (dentro do pergaminho) */
.wiki-content {
  font-family: var(--font-body);
  font-size: 1.12rem;
  line-height: 1.65;
}

.wiki-content h1,
.wiki-content h2,
.wiki-content h3,
.wiki-content h4 {
  font-family: var(--font-display);
  color: var(--burgundy);
  letter-spacing: 0.04em;
}

.wiki-content h1 { font-size: 1.6rem; margin-top: 0; }
.wiki-content h2 {
  font-size: 1.25rem;
  margin-top: 1.75em;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--parchment-edge);
}
.wiki-content h3 { font-size: 1.1rem; color: var(--gold-dim); }

.wiki-content a { color: var(--burgundy); font-weight: 600; }
.wiki-content a:hover { color: var(--gold-dim); }

.wiki-content table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin: 1.25rem 0;
  box-shadow: 0 2px 8px rgba(42, 31, 20, 0.08);
}

.wiki-content th,
.wiki-content td {
  border: 1px solid var(--parchment-edge);
  padding: 0.5rem 0.7rem;
  text-align: left;
}

.wiki-content th {
  background: linear-gradient(180deg, #ddd0b0 0%, #cfc0a0 100%);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
}

.wiki-content tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.25);
}

.wiki-content hr {
  border: none;
  height: 24px;
  margin: 1.75rem 0;
  background: url("img/ornament-divider.svg") center / contain no-repeat;
  opacity: 0.7;
}

.wiki-content code {
  background: rgba(42, 31, 20, 0.08);
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--parchment-edge);
  font-size: 0.9em;
}

.wiki-content ul, .wiki-content ol {
  padding-left: 1.5rem;
}

.wiki-content blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 4px solid var(--gold);
  background: rgba(201, 162, 39, 0.1);
  font-style: italic;
}

/* Ações e botões */
.page-actions {
  margin: 0 0 1.25rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Fora do pergaminho (nav escura) */
.page-actions-outside {
  margin-bottom: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--gold-dim);
  background: linear-gradient(180deg, #2a2218 0%, #1a1410 100%);
  color: var(--parchment);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 6px var(--shadow);
}

.btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.2);
  text-decoration: none;
}

.scroll-panel .btn {
  background: linear-gradient(180deg, #f8f0dc 0%, #e8d4a8 100%);
  color: var(--ink);
  border-color: var(--parchment-edge);
}

.scroll-panel .btn:hover {
  border-color: var(--gold);
  color: var(--burgundy);
}

.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold-dim) 100%);
  border-color: var(--gold);
  color: #1a1008;
}

.btn-primary:hover {
  background: var(--gold-bright);
  color: #1a1008;
}

.btn-danger {
  border-color: var(--danger);
  color: #f0c0c0;
}

.btn-danger:hover {
  background: rgba(158, 58, 58, 0.25);
}

/* Formulários no pergaminho */
form label {
  display: block;
  margin: 1rem 0 0.3rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--parchment-edge);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.25);
}

textarea {
  font-family: ui-monospace, "Consolas", monospace;
  font-size: 0.88rem;
  min-height: 320px;
}

textarea.content-editor { min-height: 480px; }

/* Cards admin (pergaminho escuro) */
.card {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--parchment-edge);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: inset 0 0 20px rgba(42, 31, 20, 0.04);
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--burgundy);
  margin-top: 0;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 800px) {
  .compare { grid-template-columns: 1fr; }
  .scroll-panel { padding: 1.25rem 1rem 1.75rem; }
}

.compare h3 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 0;
}

.history {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--parchment-edge);
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.history h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--burgundy);
}

.history table { width: 100%; font-size: 0.88rem; }
.history th {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  border-bottom: 2px solid var(--parchment-edge);
}
.history td { padding: 0.4rem 0.5rem; border-bottom: 1px solid rgba(196, 165, 116, 0.5); }

.status-pending { color: #8a6020; font-weight: 600; }
.status-approved { color: var(--success); font-weight: 600; }
.status-rejected { color: var(--danger); font-weight: 600; }

.login-panel {
  max-width: 400px;
  margin: 2rem auto;
}

.login-panel h1 { margin-bottom: 1rem; }

.hint {
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin-top: 0.5rem;
}

/* Rodapé decorativo */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 232, 200, 0.35);
  position: relative;
  z-index: 1;
}

/* —— Apêndice de magias —— */
.appendix-section {
  margin-top: 2.5rem;
  padding-top: 0.5rem;
}

.appendix-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--burgundy);
  margin: 0 0 1rem;
}

.appendix-grid {
  max-width: 720px;
  margin: 0 auto;
}

.spells-hub-grid {
  margin-top: 1.5rem;
}

.appendix-thumb-spells-arcanas {
  background:
    radial-gradient(circle at 30% 40%, rgba(45, 74, 53, 0.5), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(201, 162, 39, 0.25), transparent 50%),
    linear-gradient(135deg, #121810, #1e2a20);
}

.appendix-thumb-spells-divinas {
  background:
    radial-gradient(circle at 30% 40%, rgba(201, 162, 39, 0.4), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(107, 45, 45, 0.45), transparent 50%),
    linear-gradient(135deg, #1a1410, #2d2218);
}

.appendix-thumb-spells {
  background:
    radial-gradient(circle at 30% 40%, rgba(201, 162, 39, 0.35), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(107, 45, 45, 0.45), transparent 50%),
    linear-gradient(135deg, #1a1410, #2d2218);
}

.spell-tradition-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.spell-tradition-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--parchment-edge);
  background: rgba(255, 255, 255, 0.35);
  color: var(--ink-muted);
  text-decoration: none;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.spell-tradition-tab:hover {
  border-color: var(--gold);
  color: var(--ink);
  text-decoration: none;
}

.spell-tradition-tab.is-active {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink);
  font-weight: 600;
}

.spell-tradition-tab-arcanas.is-active {
  border-color: var(--forest);
  color: var(--forest);
}

.spell-tradition-tab-divinas.is-active {
  border-color: var(--burgundy);
  color: var(--burgundy);
}

.spell-tab-count {
  font-size: 0.65rem;
  opacity: 0.75;
}

.spell-filters-row-arcane {
  grid-template-columns: 2fr repeat(2, minmax(140px, 1fr));
}

.spells-panel .hint code {
  font-size: 0.85em;
  background: rgba(42, 31, 20, 0.08);
  padding: 0.1rem 0.35rem;
}

.spell-filters {
  margin: 1.5rem 0 1rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid var(--parchment-edge);
}

.spell-filters-row {
  display: grid;
  grid-template-columns: 2fr repeat(4, minmax(120px, 1fr));
  gap: 0.75rem;
}

.spell-filters-row-arcane {
  grid-template-columns: 2fr repeat(3, minmax(140px, 1fr));
}

.spell-filters label span {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
}

.spell-filters input,
.spell-filters select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--parchment-edge);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
}

.spell-filters-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

.spell-result-count {
  margin-left: auto;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.spell-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.spell-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--parchment-edge);
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}

.spell-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(42, 31, 20, 0.18);
  text-decoration: none;
}

.spell-card[hidden] {
  display: none;
}

.spell-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.spell-level {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--burgundy);
}

.spell-tradition {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--parchment-edge);
}

.spell-tradition-mago {
  background: rgba(45, 74, 53, 0.12);
  color: var(--forest);
}

.spell-tradition-clerigo {
  background: rgba(107, 45, 45, 0.1);
  color: var(--burgundy);
}

.spell-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
}

.spell-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.3;
}

.spell-source {
  font-style: italic;
  opacity: 0.9;
}

.spell-source-line {
  margin: 0.85rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.4;
}

.spell-source-label {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--burgundy);
  margin-right: 0.35rem;
}

.spell-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-muted);
}

.spell-detail-header {
  text-align: center;
}

.spell-detail-tradition {
  display: inline-block;
  margin: 0 0 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.spell-detail-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.spell-badge {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--parchment-edge);
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink-muted);
}

.spell-level-badge {
  color: var(--burgundy);
  border-color: var(--burgundy);
}

.spell-sphere-badge {
  color: var(--forest);
}

.spell-stats {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 1.5rem;
  font-size: 0.98rem;
}

.spell-stats th,
.spell-stats td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid rgba(196, 165, 116, 0.55);
  text-align: left;
  vertical-align: top;
}

.spell-stats th {
  width: 38%;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.spell-description p {
  margin: 0 0 1rem;
}

body.spell-modal-open {
  overflow: hidden;
}

.spell-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.spell-modal[hidden] {
  display: none;
}

.spell-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 12, 9, 0.78);
  backdrop-filter: blur(2px);
}

.spell-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
}

.spell-modal-body {
  overflow-y: auto;
  max-height: min(88vh, 900px);
  margin: 0;
  padding: 2rem 2.25rem 2.5rem;
}

.spell-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--parchment-edge);
  background: rgba(255, 255, 255, 0.85);
  color: var(--burgundy);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}

.spell-modal-close:hover {
  border-color: var(--gold);
  background: #fff;
}

.spell-modal-loading {
  text-align: center;
  color: var(--ink-muted);
  font-style: italic;
  margin: 2rem 0;
}

@media (max-width: 520px) {
  .spell-modal {
    padding: 0.5rem;
  }

  .spell-modal-body {
    padding: 1.5rem 1.25rem 2rem;
  }
}

@media (max-width: 900px) {
  .spell-filters-row {
    grid-template-columns: 1fr 1fr;
  }

  .spell-filters-row label:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .spell-filters-row {
    grid-template-columns: 1fr;
  }
}

