:root {
  --bg: #f4f5f7;
  --sidebar: #1e2541;
  --sidebar-text: #c8cddc;
  --sidebar-active: #29abe0;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  max-height: 100vh;
  position: sticky;
  top: 0;
}

.brand {
  padding: 18px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
}

.sidebar nav {
  overflow-y: auto;
  padding: 8px 0 12px;
  flex: 1;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}

.sidebar a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.sidebar a.active {
  background: rgba(41, 171, 224, 0.15);
  color: #fff;
  border-left-color: var(--sidebar-active);
}

.sidebar .count {
  color: #8b93a7;
  font-size: 0.75rem;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-admin-btn {
  display: block !important;
  justify-content: center;
  text-align: center;
  padding: 9px 12px !important;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.18) !important;
  background: rgba(41, 171, 224, 0.12);
  color: #fff !important;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sidebar-admin-btn:hover {
  background: rgba(41, 171, 224, 0.28) !important;
  border-color: var(--sidebar-active) !important;
  color: #fff !important;
}

.sidebar-admin-btn.active {
  background: rgba(41, 171, 224, 0.35) !important;
  border-color: var(--sidebar-active) !important;
  border-left-color: var(--sidebar-active) !important;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 24px 28px 48px;
}

.page-header {
  margin-bottom: 18px;
}

.page-header h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
}

.filename {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.version-note {
  margin: 8px 0 0;
  max-width: 70ch;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.45;
}

tbody tr.has-alt {
  cursor: help;
}

tbody tr.has-alt:hover {
  background: #eef6fb;
}

.table-block {
  margin-bottom: 28px;
}

.table-block h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.table-wrap {
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #f9fafb;
}

tbody tr.section-row:hover {
  background: transparent;
}

tbody tr.section-row th {
  background: #e8eef6;
  color: #1f2937;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: left;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

table.has-subheaders thead th.group-head {
  text-align: center;
  border-bottom: 1px solid var(--border);
}

table.has-subheaders thead tr:first-child th {
  top: 0;
  z-index: 3;
}

table.has-subheaders thead tr:last-child th {
  top: 38px;
  z-index: 2;
  font-weight: 600;
  font-size: 0.85rem;
  color: #4b5563;
}

.star-level {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.star-gold {
  color: #d4a017;
  text-shadow: 0 0 1px rgba(120, 80, 0, 0.25);
}

.star-red {
  color: #c62828;
}

.star-silver {
  color: #90a4ae;
}

.star-black {
  color: #111827;
}

.icon {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.empty {
  color: #9ca3af;
}

.empty-note {
  color: var(--muted);
}

.source-credit {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.source-credit a {
  color: #2563eb;
  word-break: break-all;
}

.credit-note {
  margin-top: 6px;
}

.nav-section {
  margin: 14px 16px 6px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b93a7;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.season-intro {
  margin: 0 0 22px;
  max-width: 70ch;
  color: #374151;
  line-height: 1.55;
}

.btn {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 16px;
  border-radius: 8px;
}

.btn:hover {
  background: #1d4ed8;
}

.page-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 28px;
}

.page-jump a {
  color: var(--accent, #2563eb);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.page-jump a:hover {
  text-decoration: underline;
}

.season-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.season-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.season-card.season-themed {
  border-color: color-mix(in srgb, var(--season-accent, var(--border)) 35%, var(--border));
  background:
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--season-soft, var(--card)) 88%, #fff) 0%,
      var(--card) 55%
    );
  box-shadow: inset 4px 0 0 var(--season-accent, transparent);
}

.season-card:hover {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.season-card.season-themed:hover {
  box-shadow:
    inset 4px 0 0 var(--season-accent, transparent),
    0 8px 22px color-mix(in srgb, var(--season-accent, #000) 18%, transparent);
}

.season-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.season-badge,
.season-status,
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
}

.season-badge {
  background: #e8f6fc;
  color: #0b6e99;
  padding: 3px 8px;
  border-radius: 999px;
}

.season-themed .season-badge {
  background: var(--season-soft, #e8f6fc);
  color: var(--season-ink, #0b6e99);
}

.season-status {
  background: #ecfdf3;
  color: #067647;
  padding: 3px 8px;
  border-radius: 999px;
}

.season-themed .tag {
  background: color-mix(in srgb, var(--season-accent, #64748b) 14%, #fff);
  color: var(--season-ink, #334155);
  border: 1px solid color-mix(in srgb, var(--season-accent, #64748b) 28%, transparent);
}

.season-palette {
  margin: 10px 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--season-ink, var(--muted));
}

.season-swatches {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}

.season-swatches span {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

body.season-themed .page-header .eyebrow {
  color: var(--season-accent);
}

body.season-themed .season-section h2 {
  color: var(--season-ink);
}

body.season-themed .info-card,
body.season-themed .asset-card {
  border-color: color-mix(in srgb, var(--season-accent, var(--border)) 30%, var(--border));
}

.season-card h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
}

.season-subtitle {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.season-card p {
  margin: 0;
  color: #4b5563;
  font-size: 0.92rem;
  line-height: 1.45;
}

.season-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  background: #f3f4f6;
  color: #4b5563;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.season-section {
  margin: 28px 0;
}

.season-section h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.section-heading p {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.section-heading code {
  font-size: 0.85em;
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 4px;
}

.info-grid,
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.info-card,
.asset-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.info-card {
  padding: 14px;
}

.info-card h3,
.asset-body h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.info-card p,
.asset-body p {
  margin: 0;
  color: #4b5563;
  font-size: 0.92rem;
  line-height: 1.45;
}

.priority-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #374151;
  line-height: 1.55;
}

.priority-list li + li {
  margin-top: 6px;
}

.asset-media {
  background: #eef2f7;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.asset-media.square {
  min-height: 160px;
}

.asset-media img {
  width: 100%;
  height: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.resource-media {
  min-height: 120px;
  padding: 16px;
}

.resource-media img {
  width: auto;
  height: auto;
  max-width: 96px;
  max-height: 96px;
  object-fit: contain;
}

.season-resource-block + .season-resource-block {
  margin-top: 28px;
}

.season-resource-block h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.season-resource-block h3 a {
  color: inherit;
  text-decoration: none;
}

.season-resource-block h3 a:hover {
  color: var(--accent);
}

.icon-cell {
  width: 48px;
  text-align: center;
}

.asset-placeholder {
  color: #9aa3b2;
  font-size: 0.9rem;
  padding: 24px;
  text-align: center;
}

.asset-body {
  padding: 12px 14px 14px;
}

.creature-type {
  margin: 0 0 4px !important;
  color: var(--muted) !important;
  font-size: 0.75rem !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier-block {
  margin-bottom: 22px;
}

.tier-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.tier-heading h3 {
  margin: 0;
  font-size: 1rem;
}

@media (max-width: 800px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    max-height: none;
    position: static;
  }

  .sidebar nav {
    max-height: 280px;
  }

  .content {
    padding: 16px;
  }
}
