:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --surface2: #0f3460;
  --border: #2a2a4a;
  --text: #e0e0e0;
  --text-dim: #8888aa;
  --text-bright: #ffffff;

  --adventurer-bg: #1e3a5f;
  --veteran-bg: #3b1f6e;
  --champion-bg: #78350f;
  --hero-bg: #7f1d1d;
  --myth-bg: #831843;

  --adventurer-text: #93c5fd;
  --veteran-text: #c4b5fd;
  --champion-text: #fcd34d;
  --hero-text: #fca5a5;
  --myth-text: #f9a8d4;

  --accent-blue: #60a5fa;
  --accent-indigo: #6366f1;
  --accent-teal: #0d9488;
  --accent-red: #ef4444;
  --accent-gold: #fbbf24;

  --highlight: #fbbf24;
  --highlight-blue: #60a5fa;
  --info-heading: #f472b6;
  --item-ring: #f472b6;
  --item-neck: #a78bfa;

  --title-gradient: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);

  --craft-adv-bg: rgba(59, 130, 246, 0.12);
  --craft-adv-text: #93c5fd;
  --craft-vet-bg: rgba(99, 102, 241, 0.18);
  --craft-vet-text: #a5b4fc;
  --craft-spark-bg: rgba(251, 191, 36, 0.15);
  --craft-spark-text: #fcd34d;
  --craft-hero-bg: rgba(239, 68, 68, 0.18);
  --craft-hero-text: #fca5a5;
  --craft-myth-bg: rgba(236, 72, 153, 0.2);
  --craft-myth-text: #f9a8d4;

  --td-bg: rgba(255, 255, 255, 0.02);
  --hover-outline: rgba(255, 255, 255, 0.15);
  --hover-brightness: 1.3;

  --bg-glow-1: rgba(59, 130, 246, 0.05);
  --bg-glow-2: rgba(168, 85, 247, 0.05);
}

/* ─── Light Theme: Gilded Parchment ─── */
[data-theme="light"] {
  --bg: #f8f4ee;
  --surface: #efe9df;
  --surface2: #e4dacb;
  --border: #d0c4b0;
  --text: #3d352c;
  --text-dim: #8a7e6e;
  --text-bright: #1c1710;

  --adventurer-bg: #dbeafe;
  --veteran-bg: #ede9fe;
  --champion-bg: #fef3c7;
  --hero-bg: #fee2e2;
  --myth-bg: #fce7f3;

  --adventurer-text: #1e40af;
  --veteran-text: #5b21b6;
  --champion-text: #92400e;
  --hero-text: #991b1b;
  --myth-text: #9d174d;

  --accent-blue: #2563eb;
  --accent-indigo: #4f46e5;
  --accent-teal: #0f766e;
  --accent-red: #dc2626;
  --accent-gold: #d97706;

  --highlight: #b45309;
  --highlight-blue: #1d4ed8;
  --info-heading: #be185d;
  --item-ring: #be185d;
  --item-neck: #6d28d9;

  --title-gradient: linear-gradient(135deg, #1e40af, #6d28d9, #be185d);

  --craft-adv-bg: rgba(37, 99, 235, 0.08);
  --craft-adv-text: #1e40af;
  --craft-vet-bg: rgba(79, 70, 229, 0.08);
  --craft-vet-text: #4338ca;
  --craft-spark-bg: rgba(217, 119, 6, 0.1);
  --craft-spark-text: #92400e;
  --craft-hero-bg: rgba(220, 38, 38, 0.08);
  --craft-hero-text: #991b1b;
  --craft-myth-bg: rgba(190, 24, 93, 0.08);
  --craft-myth-text: #9d174d;

  --td-bg: rgba(0, 0, 0, 0.015);
  --hover-outline: rgba(0, 0, 0, 0.12);
  --hover-brightness: 0.95;

  --bg-glow-1: rgba(217, 119, 6, 0.04);
  --bg-glow-2: rgba(190, 24, 93, 0.03);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  container-type: inline-size;
  min-height: 100vh;
  padding: 1.667rem;
  background-image:
    radial-gradient(ellipse at 20% 50%, var(--bg-glow-1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, var(--bg-glow-2) 0%, transparent 50%);
  transition:
    background 0.3s,
    color 0.3s;
}

h1 {
  font-family: "Chakra Petch", sans-serif;
  font-size: 2.333rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.333rem;
  background: var(--title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.167rem;
  text-transform: uppercase;
}

.subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.917rem;
  margin-bottom: 1.667rem;
  letter-spacing: 0.083rem;
}

.layout {
  display: flex;
  gap: 1.667rem;
  max-width: 95rem;
  margin: 0 auto;
  align-items: flex-start;
  justify-content: center;
}

.left-col {
  width: 15.833rem;
  flex-shrink: 0;
}
.main-col {
  flex: 1;
  min-width: 0;
}
.side-col {
  width: 20.833rem;
  flex-shrink: 0;
  overflow-wrap: break-word;
}

.section-title {
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.167rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.667rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(90deg, var(--surface2), transparent);
  border-left: 3px solid var(--accent-blue);
  letter-spacing: 0.083rem;
  text-transform: uppercase;
}

.section-title-teal {
  border-left-color: var(--accent-teal);
}
.section-title-indigo {
  border-left-color: var(--accent-indigo);
}
.section-title-gold {
  border-left-color: var(--accent-gold);
}
.section-title-red {
  border-left-color: var(--accent-red);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.333rem;
  font-size: 0.917rem;
}

.main-table {
  table-layout: fixed;
}
.main-table .col-first {
  width: 8%;
}
.main-table .col-track {
  width: 15%;
}
.main-table .col-last {
  width: 17%;
}

th {
  background: var(--surface);
  color: var(--text-bright);
  font-weight: 600;
  font-size: 0.833rem;
  text-transform: uppercase;
  letter-spacing: 0.042rem;
  padding: 0.5rem 0.417rem;
  border: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

td {
  padding: 0.333rem 0.417rem;
  border: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
  background: var(--td-bg);
}

#raid-extras {
  margin-top: 0.667rem;
}

table:has(+ .affix-note) {
  margin-bottom: 0.167rem;
}
table + .affix-note {
  margin-bottom: 1.333rem;
}

.raid-boss-table td[colspan] {
  white-space: normal;
}

.cell-left {
  text-align: left;
}

.raid-separator {
  text-align: left;
  border: none;
  background: none;
}
.raid-separator-first {
  padding: 0.333rem 0;
}
.raid-separator-rest {
  padding: 1.333rem 0 0.333rem;
}

.col-ilvl {
  font-weight: 600;
  color: var(--text-bright);
}


/* Compact lookup tables */
.lookup-table {
  font-size: 0.917rem;
}
.lookup-table th {
  font-size: 0.75rem;
  padding: 0.417rem 0.5rem;
}
.lookup-table td {
  padding: 0.25rem 0.5rem;
}
.affix-note {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.wrap-cell {
  white-space: normal;
}

table tbody tr:hover td {
  outline: 1px solid var(--hover-outline);
  background-blend-mode: lighten;
  filter: brightness(var(--hover-brightness));
}

/* Side panel */
.info-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.167rem;
  margin-bottom: 1.333rem;
}

.info-box h3 {
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.083rem;
  font-weight: 700;
  margin-bottom: 0.833rem;
  color: var(--info-heading);
  text-transform: uppercase;
  letter-spacing: 0.083rem;
}

.info-box ul {
  list-style: none;
  padding: 0;
}

.info-box li {
  padding: 0.25rem 0;
  font-size: 0.917rem;
  color: var(--text);
  line-height: 1.5;
}

.info-box li::before {
  content: ">";
  color: var(--text-dim);
  margin-right: 0.5rem;
  font-weight: 600;
}

.highlight {
  color: var(--highlight);
  font-weight: 600;
}
.highlight-blue {
  color: var(--highlight-blue);
  font-weight: 600;
}

.raid-label {
  font-family: "Chakra Petch", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
  letter-spacing: 0.042rem;
}

.item-ring {
  color: var(--item-ring);
}
.item-neck {
  color: var(--item-neck);
}
.schedule-box {
  text-align: left;
}
.schedule-box .date {
  color: var(--highlight);
  font-weight: 700;
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.083rem;
  margin-top: 0.667rem;
}
.schedule-box .detail {
  font-size: 0.833rem;
  color: var(--text-dim);
  margin-bottom: 0.333rem;
}

.signature {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
  margin-top: 1.333rem;
  letter-spacing: 0.042rem;
}
.signature a {
  color: var(--text-dim);
  text-decoration: underline;
}
.signature a:hover {
  color: var(--text-bright);
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 1.333rem;
  right: 1.333rem;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 0.5rem 1rem;
  color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.833rem;
  cursor: pointer;
  letter-spacing: 0.042rem;
  transition:
    background 0.3s,
    border-color 0.3s,
    color 0.3s;
}
.theme-toggle:hover {
  color: var(--text-bright);
  border-color: var(--text-dim);
}

@container (max-width: 70rem) {
  .layout {
    flex-direction: column;
  }
  .left-col,
  .side-col {
    width: 100%;
  }
  .left-col {
    display: flex;
    gap: 1.333rem;
  }
  .left-col > div {
    flex: 1;
  }
}

@container (max-width: 30rem) {
  .left-col {
    flex-direction: column;
  }
  td {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .main-table .col-first {
    width: 14%;
  }
  .col-ilvl {
    white-space: nowrap;
  }
}
