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

:root {
  --bg-0: #0a0706;
  --bg-1: #14100c;
  --bg-2: #1f160f;
  --panel: rgba(18, 13, 9, 0.95);
  --panel-strong: #1a120d;
  --ink: #efe2c5;
  --muted: #b9aa96;
  --accent: #d2b36a;
  --accent-2: #a85b3d;
  --line: #3b2a1a;
  --shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
  --glow: 0 0 20px rgba(210, 179, 106, 0.25);
  --danger: #b24a3f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Crimson Pro", "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 20%, rgba(168, 91, 61, 0.2), transparent 45%),
    radial-gradient(circle at 80% 12%, rgba(210, 179, 106, 0.18), transparent 50%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1) 45%, var(--bg-2));
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 2px,
      transparent 2px,
      transparent 6px
    );
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.6));
  pointer-events: none;
  z-index: 0;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 52px 24px 88px;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  align-items: center;
  margin-bottom: 36px;
  opacity: 0;
  transform: translateY(12px);
  animation: rise 0.8s ease forwards;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 12px;
  font-weight: 600;
  font-family: "Cinzel", serif;
}

h1,
h2,
h3 {
  font-family: "Cinzel", serif;
  font-weight: 600;
  color: var(--ink);
}

h1 {
  font-size: clamp(34px, 4vw, 52px);
  margin: 0 0 12px;
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.lead {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 16px;
}

.source {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.source a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.source a:hover {
  border-color: var(--accent);
}

.hero-card {
  background: linear-gradient(160deg, rgba(30, 21, 14, 0.95), rgba(15, 11, 8, 0.95));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(210, 179, 106, 0.2);
  border-radius: 14px;
  pointer-events: none;
}

.hero-card-title {
  margin: 0 0 12px;
  font-weight: 600;
  color: var(--accent);
}

.hero-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.hero-card li::before {
  content: ">";
  color: var(--accent-2);
  margin-right: 8px;
}

.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.panel {
  background: linear-gradient(160deg, rgba(24, 17, 12, 0.98), rgba(12, 9, 6, 0.98));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
  opacity: 0;
  transform: translateY(12px);
  animation: rise 0.8s ease forwards;
}

.panel:nth-of-type(1) {
  animation-delay: 0.08s;
}

.panel:nth-of-type(2) {
  animation-delay: 0.16s;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(210, 179, 106, 0.12);
  border-radius: 14px;
  pointer-events: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}

.panel h2 {
  margin: 0 0 6px;
}

.muted {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

.count,
.pill {
  background: linear-gradient(160deg, rgba(210, 179, 106, 0.2), rgba(210, 179, 106, 0.05));
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid rgba(210, 179, 106, 0.35);
  box-shadow: var(--glow);
}

.input-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

#tagInput {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 16px;
  font-family: "Crimson Pro", "Times New Roman", serif;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: rgba(8, 6, 5, 0.7);
  color: var(--ink);
}

#tagInput::placeholder {
  color: rgba(239, 226, 197, 0.45);
}

#tagInput:focus {
  border-color: rgba(210, 179, 106, 0.6);
  box-shadow: 0 0 0 3px rgba(210, 179, 106, 0.18);
}

.status {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 14px;
}

.results {
  margin-top: 18px;
}

.results h3 {
  margin: 0 0 12px;
}

.results-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.results-list li {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(20, 14, 10, 0.9);
  border: 1px solid rgba(210, 179, 106, 0.18);
  font-size: 14px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.results-list li.missing {
  background: rgba(30, 12, 9, 0.9);
  border-color: rgba(178, 74, 63, 0.4);
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  max-height: 520px;
  overflow-y: auto;
  background: rgba(10, 8, 6, 0.6);
}

.character-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.character-table thead {
  background: rgba(18, 13, 9, 0.9);
}

.character-table th,
.character-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(59, 42, 26, 0.7);
  text-align: left;
}

.character-table th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.character-table tbody tr:hover {
  background: rgba(210, 179, 106, 0.08);
}

.character-table th:first-child,
.character-table td:first-child {
  width: 90px;
  text-align: center;
  font-weight: 600;
  color: var(--accent);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .panel {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}
