:root {
  --void: #0B0D10;
  --surface: #14171C;
  --surface-2: #1C2028;
  --border: #2A2F38;
  --text-primary: #ECEEF1;
  --text-secondary: #8B94A3;
  --text-tertiary: #6B7280;
  --accent: #4FA8AE;
  --gold: #CEAE33;
  --partial: #E0A83E;
  --bad: #566072;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--void);
  color: var(--text-primary);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: "Exo 2", sans-serif; }

/* Nav */
.topnav {
  position: sticky;
  top: 0;
  background: rgba(20, 23, 28, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }

.topnav a {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0 1.1rem;
  height: 48px;
  font-family: "Outfit", sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.15s ease, background 0.15s ease;
  border-bottom: 2px solid transparent;
}

.topnav a:hover, .topnav a.active {
  color: var(--accent);
  background: rgba(79, 168, 174, 0.08);
  border-bottom-color: var(--accent);
}

.topnav a.brand { color: var(--text-primary); font-weight: 600; padding-right: 0.6rem; }
.topnav a.brand:hover { background: none; border-bottom-color: transparent; }
.topnav a.external { margin-left: auto; }

.symbol { flex-shrink: 0; }

/* Hero — flat, no gradient/glow per brand rules */
.hero {
  text-align: center;
  padding: 3.5rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.hero.compact { padding: 2rem; }

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.hero.compact h1 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); }

.hero h3 {
  font-family: "Outfit", sans-serif;
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  font-weight: 400;
  color: var(--text-secondary);
}

.header-actions { display: flex; gap: 0.6rem; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 1.25rem; }

.main-content { max-width: 1280px; margin: 0 auto; padding: 2.5rem 2rem 4rem; }

.section-title {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  text-align: center;
  margin: 0 0 2rem 0;
  color: var(--text-primary);
  font-weight: 600;
}
.section-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  background: var(--accent);
  margin: 0.85rem auto 0;
}

a.btn, button.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: var(--void);
  border: none;
  border-radius: var(--radius);
  padding: 0.65rem 1.25rem;
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
a.btn:hover, button.btn:hover:not(:disabled) { opacity: 0.85; }
button.btn:disabled { opacity: 0.5; cursor: default; }

button.btn.ghost, a.btn.ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
button.btn.ghost:hover, a.btn.ghost:hover { color: var(--text-primary); border-color: var(--accent); opacity: 1; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.5rem;
}
.panel p { color: var(--text-secondary); font-size: 0.92rem; }

.player-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.player-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
}

/* Raid card grid */
.raid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.raid-card {
  position: relative;
  height: 220px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface) center / cover no-repeat;
  transition: transform 0.15s ease, border-color 0.15s ease;
  text-align: left;
}
.raid-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.raid-card.selected { border-color: var(--gold); }

.raid-card .scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,13,16,0.15) 0%, rgba(11,13,16,0.55) 55%, rgba(11,13,16,0.92) 100%);
}

.raid-card .card-icon {
  position: absolute; top: 0.85rem; right: 0.85rem;
  width: 34px; height: 34px;
  object-fit: contain;
  opacity: 0.9;
}

.raid-card .card-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}

.raid-card .card-title { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }
.raid-card .card-sub { font-size: 0.8rem; color: var(--text-secondary); }

.card-status-strip { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.2rem; }

.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 0.4rem;
  border-radius: var(--radius);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: rgba(11, 13, 16, 0.6);
}
.chip.unlocked { color: var(--gold); border-color: var(--gold); background: rgba(206,174,51,0.14); }
.chip.incomplete { color: var(--partial); border-color: var(--partial); background: rgba(224,168,62,0.1); }
.chip.unknown { color: var(--bad); border-style: dashed; }

/* Detail panel */
#detail-panel { margin-top: 2.5rem; }
#detail-panel.hidden { display: none; }

.detail-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.2rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.detail-header img { width: 40px; height: 40px; object-fit: contain; }
.detail-header .title { font-family: "Exo 2", sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--text-primary); }
.detail-header .sub { color: var(--text-secondary); font-size: 0.85rem; }
.detail-header button.btn.ghost { margin-left: auto; }

.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
}

table.compare { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 560px; }
table.compare th, table.compare td { padding: 0.7rem 0.9rem; text-align: center; border-bottom: 1px solid var(--border); }
table.compare th:first-child, table.compare td:first-child { text-align: left; min-width: 220px; }
table.compare thead th {
  color: var(--text-secondary);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--surface-2);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tr.triumph-row td { background: rgba(0,0,0,0.18); font-size: 0.82rem; color: var(--text-secondary); }
tr.triumph-row td:first-child { padding-left: 1.8rem; }
tr.triumph-row .featured-star { color: var(--gold); margin-right: 0.3rem; }

.title-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  background: rgba(206, 174, 51, 0.14);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
}

.progress-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 0.3rem; min-width: 60px; }
.fraction-text { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 0.82rem; color: var(--partial); }
.progress-bar { width: 100%; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.08); overflow: hidden; }
.progress-fill { height: 100%; background: var(--partial); }

.checkbox {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 3px;
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  font-size: 0.7rem; font-weight: 700;
}
.checkbox.done { background: var(--accent); border-color: var(--accent); color: var(--void); }
.checkbox.unknown { border-style: dashed; color: var(--bad); }

.muted { color: var(--text-secondary); }

.error-banner {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid #e74c3c;
  color: #ff8a80;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

footer {
  background: var(--surface);
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}
footer p { margin: 0.3rem 0; }
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .main-content { padding: 1.5rem 1rem 3rem; }
  .hero { padding: 2rem 1rem; }
  .hero.compact { padding: 1.5rem 1rem; }
  .raid-grid { grid-template-columns: 1fr; }
}
