/* Isaac Save Advisor — Dark basement theme */

@font-face {
  font-family: "Upheaval";
  src: url("upheaval.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surfaces */
  --basement:    #12121a;
  --parchment:   #1a1a2e;
  --paper:       #2a2a3e;

  /* Text */
  --ink:         #d4d4dc;
  --pencil:      #9898a8;

  /* Accents */
  --brass:       #c8a84e;
  --dried-blood: #9e0b0f;
  --mold:        #4caf50;
  --bruise:      #6699dd;
  --shadow:      #555568;
  --wound:       #ef6b6b;
  --cursed:      #9b59b6;
  --brimstone:   #ff6b35;
  --basement-alt: #151520;

  /* New: depth & radius tokens */
  --glow-brass: rgba(200, 168, 78, 0.15);
  --card-bg: linear-gradient(168deg, rgba(42,42,62,0.9) 0%, rgba(26,26,46,0.95) 100%);
  --card-hover-bg: linear-gradient(168deg, rgba(50,50,72,0.9) 0%, rgba(30,30,52,0.95) 100%);
  --panel-bg: linear-gradient(172deg, rgba(20,20,30,0.92) 0%, rgba(14,14,22,0.9) 100%);
  --panel-border: rgba(85,85,104,0.3);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at top, rgba(200,168,78,0.08), transparent 28%),
    linear-gradient(180deg, #0f1118 0%, #11141d 44%, #0d0f16 100%);
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}
/* Basement texture — the ONE texture layer we keep */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("img/basement-bg.png") repeat;
  opacity: 0.14;
  pointer-events: none;
  z-index: -1;
  image-rendering: pixelated;
}
/* grain/vignette overlay REMOVED */
/* sketches overlay REMOVED */

header {
  text-align: center;
  padding: 2.7rem 1rem 1.35rem;
  position: relative;
  overflow: hidden;
}
/* Warm radial glow behind header (replaces removed overlays) */
header::after {
  content: "";
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse at center, rgba(200,168,78,0.06), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.title-art {
  margin: 0 auto;
  max-width: 200px;
  opacity: 0.35;
  pointer-events: none;
  mix-blend-mode: screen;
}
.title-postit {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.title-logo {
  display: block;
  margin: -1.5rem auto 0.25rem;
  height: 80px;
  width: auto;
  image-rendering: pixelated;
  position: relative;
  filter: drop-shadow(0 0 12px rgba(200,168,78,0.25));
}
header h1 {
  font-family: "Upheaval", system-ui, sans-serif;
  color: var(--brass);
  font-size: 2.2rem;
  letter-spacing: 0.05em;
  position: relative;
  text-shadow: 0 0 20px rgba(200,168,78,0.2), 0 2px 4px rgba(0,0,0,0.5);
}
.subtitle {
  color: var(--pencil);
  margin: 0.45rem auto 0;
  max-width: 52ch;
  font-size: 1rem;
  position: relative;
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

/* Upload zone */
#upload-section {
  text-align: center;
  padding: 2rem 0;
  transition: all 0.3s;
}
#upload-section.collapsed {
  padding: 0.5rem 0;
}
#upload-section.collapsed #drop-zone {
  padding: 0.75rem;
  border-style: solid;
  border-width: 1px;
}
#upload-section.collapsed .drop-icon,
#upload-section.collapsed .file-path-hint,
#upload-section.collapsed .hint,
#upload-section.collapsed .path-helper {
  display: none;
}

#drop-zone {
  max-width: 820px;
  margin: 0 auto;
  border: 1px dashed rgba(200,168,78,0.32);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  cursor: pointer;
  background: linear-gradient(160deg, rgba(28,31,42,0.78), rgba(18,20,29,0.88));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.03),
    0 10px 26px rgba(0,0,0,0.24);
  backdrop-filter: blur(10px);
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}
#drop-zone:hover,
#drop-zone.drag-over {
  border-color: var(--brass);
  background: linear-gradient(160deg, rgba(42,38,28,0.8), rgba(24,24,32,0.92));
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 14px 32px rgba(0,0,0,0.34);
}
@keyframes loadingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
#drop-zone.drop-zone--loading {
  pointer-events: none;
  border-color: var(--brass);
}
#drop-zone.drop-zone--loading p,
#drop-zone.drop-zone--loading .drop-icon,
#drop-zone.drop-zone--loading .hint {
  display: none;
}
#drop-zone.drop-zone--loading::after {
  content: "Analyzing...";
  display: block;
  font-size: 1.1rem;
  color: var(--brass);
  font-weight: 600;
  letter-spacing: 0.05em;
  animation: loadingPulse 1.2s ease-in-out infinite;
}
.drop-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.hint { color: var(--pencil); font-size: 0.85rem; }
.file-path-hint { color: var(--pencil); font-size: 0.85rem; margin-top: 0.75rem; }

/* Path helper */
.path-helper { margin-top: 0.75rem; text-align: left; max-width: 820px; margin-inline: auto; }
.path-helper-toggle { margin-top: 0.5rem; }
.path-helper-summary {
  cursor: pointer;
  color: var(--pencil);
  font-size: 0.85rem;
  text-align: center;
  list-style: none;
  transition: color 0.15s;
}
.path-helper-summary::-webkit-details-marker { display: none; }
.path-helper-summary::before {
  content: "▸ ";
  font-size: 0.75rem;
}
.path-helper-toggle[open] .path-helper-summary::before {
  content: "▾ ";
}
.path-helper-summary:hover { color: var(--brass); }
.path-helper-body { margin-top: 0.65rem; }
.path-label {
  font-size: 0.85rem;
  color: var(--pencil);
  margin-bottom: 0.55rem;
}
.path-groups {
  display: grid;
  gap: 0.75rem;
}
.path-os-group {
  overflow: hidden;
  padding: 0.8rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(85,85,104,0.25);
  background: rgba(255,255,255,0.03);
}
.path-os-group[open] {
  padding-bottom: 0.85rem;
}
.path-os-group.current {
  border-color: rgba(200,168,78,0.35);
  background: linear-gradient(160deg, rgba(40,36,26,0.4), rgba(18,20,29,0.88));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.03),
    0 8px 18px rgba(0,0,0,0.2);
}
.path-os-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
}
.path-os-header::-webkit-details-marker {
  display: none;
}
.path-os-header-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.path-os-title {
  font-family: "Upheaval", system-ui, sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: var(--brass);
}
.path-os-toggle {
  display: inline-flex;
  align-items: center;
  color: var(--pencil);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.path-os-toggle::before {
  content: "Show";
}
.path-os-group[open] .path-os-toggle::before {
  content: "Hide";
  color: var(--brass);
}
.path-os-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(200,168,78,0.35);
  background: rgba(200,168,78,0.12);
  color: var(--brass);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.path-os-body {
  margin-top: 0.55rem;
}
.path-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.4rem 0;
}
.path-row-main {
  flex: 1;
  min-width: 0;
}
.path-row-label {
  display: block;
  margin-bottom: 0.12rem;
  color: var(--pencil);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.path-row code {
  display: block;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.path-copy-btn {
  font-size: 0.75rem;
  padding: 0.2em 0.6em;
  border: 1px solid var(--shadow);
  border-radius: 4px;
  background: transparent;
  color: var(--pencil);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.path-copy-btn:hover { color: var(--brass); border-color: var(--brass); }
.path-copy-btn.copied { color: var(--mold); border-color: var(--mold); }
.path-tip { font-size: 0.8rem; color: var(--pencil); margin-top: 0.5rem; }
.path-tip-secondary {
  margin-top: 0.35rem;
  font-size: 0.78rem;
}
.path-tip kbd {
  display: inline-block;
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  padding: 0.1em 0.35em;
  border: 1px solid var(--shadow);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  line-height: 1;
  vertical-align: baseline;
}

code { background: var(--paper); padding: 0.15em 0.4em; border-radius: 3px; font-size: 0.9em; }

/* Error */
#error {
  background: rgba(224, 85, 85, 0.15);
  color: var(--wound);
  border: 1px solid var(--wound);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

/* Sections */
section { margin-top: 2rem; }

#results {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

#results > section {
  grid-column: 1 / -1;
  margin-top: 0;
  padding: 1.15rem 1.2rem 1.35rem;
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.03),
    0 12px 28px rgba(0,0,0,0.24);
  scroll-margin-top: 6rem;
}

#boss-milestones-section,
#challenges-section,
#characters-section {
  grid-column: span 6;
}

#summary-section,
#path-section {
  border-color: rgba(200,168,78,0.35);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 14px 32px rgba(0,0,0,0.28),
    0 0 0 1px rgba(200,168,78,0.08);
}

h2 {
  font-family: "Upheaval", system-ui, sans-serif;
  color: var(--brass);
  font-size: 1.28rem;
  border-bottom: none;
  padding-bottom: 0.4rem;
  margin-bottom: 0.95rem;
  letter-spacing: 0.01em;
  text-shadow: 0 0 16px rgba(200,168,78,0.12);
}
h2::after {
  content: "";
  display: block;
  margin-top: 0.35rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--shadow) 15%, var(--brass) 50%, var(--shadow) 85%, transparent);
}
h3 {
  color: var(--ink);
  font-size: 1.05rem;
  margin: 1rem 0 0.5rem;
}

.section-intro {
  margin: -0.35rem 0 1rem;
  max-width: 68ch;
  color: var(--pencil);
  font-size: 0.9rem;
}

.hidden { display: none !important; }

.results-nav {
  grid-column: 1 / -1;
  position: sticky;
  top: 0.65rem;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  justify-self: center;
  margin-inline: auto;
  margin-bottom: 0.15rem;
  padding: 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(85,85,104,0.4);
  background: rgba(10, 10, 16, 0.88);
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
}
.results-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(85,85,104,0.25);
  background: rgba(42,42,62,0.55);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.results-nav a:hover {
  color: #0e0e12;
  border-color: rgba(200,168,78,0.45);
  background: linear-gradient(168deg, rgba(215,183,92,0.95), rgba(175,140,50,0.95));
}
.nav-action {
  color: var(--brass);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(200,168,78,0.35);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
  margin-left: 0.15rem;
}
.nav-action:hover {
  background: rgba(200,168,78,0.12);
  border-color: rgba(200,168,78,0.55);
  color: #f1d589;
}

/* Summary deck */

.summary-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(31,34,44,0.94), rgba(18,20,29,0.96));
  border: 1px solid rgba(85,85,104,0.25);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.15rem;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 10px 24px rgba(0,0,0,0.22);
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: auto auto -40px -30px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(200,168,78,0.08), transparent 72%);
  pointer-events: none;
}

.summary-hero {
  border-color: rgba(200,168,78,0.28);
  background: linear-gradient(155deg, rgba(40,36,26,0.62), rgba(18,20,29,0.96));
}

.summary-kicker,
.summary-card-heading {
  font-family: "Upheaval", system-ui, sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pencil);
}

.summary-title {
  margin-top: 0.25rem;
  font-family: "Upheaval", system-ui, sans-serif;
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  line-height: 0.94;
  color: #f1d589;
  text-shadow: 0 0 26px rgba(200,168,78,0.18);
}

.summary-title-total {
  font-size: 0.42em;
  color: var(--pencil);
}

.summary-subtitle {
  margin-top: 0.3rem;
  font-size: 0.95rem;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-copy,
.summary-card-copy {
  margin-top: 0.75rem;
  color: var(--pencil);
  font-size: 0.9rem;
}

.summary-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.95rem;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(85,85,104,0.3);
  background: rgba(255,255,255,0.04);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.summary-pill.warning {
  border-color: rgba(239,107,107,0.25);
  background: rgba(239,107,107,0.08);
  color: var(--wound);
}

.summary-progress-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  color: var(--pencil);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-progress-label strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.summary-hero-phase {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(85,85,104,0.24);
}

.summary-hero-phase .summary-card-copy {
  max-width: 44ch;
}

.summary-route {
  margin-top: 0.9rem;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(200,168,78,0.14);
  background: rgba(255,255,255,0.03);
}

.summary-route-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
}

.summary-route-character {
  color: var(--brass);
}

.summary-route-arrow {
  color: var(--shadow);
}

.summary-route-destination {
  color: var(--ink);
}

.summary-route-why,
.summary-route-goal {
  margin-top: 0.55rem;
  font-size: 0.88rem;
}

.summary-route-why {
  color: var(--pencil);
}

.summary-focus-list {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.summary-focus-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(85,85,104,0.18);
}

.summary-focus-index {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(200,168,78,0.16);
  color: var(--brass);
  font-family: "Upheaval", system-ui, sans-serif;
  font-size: 0.9rem;
}

.summary-focus-detail {
  display: block;
  margin-top: 0.18rem;
  color: var(--pencil);
  font-size: 0.83rem;
}

.summary-phase-name {
  margin-top: 0.5rem;
  font-family: "Upheaval", system-ui, sans-serif;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--brass);
}

.summary-phase-next {
  margin-top: 0.85rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(85,85,104,0.24);
}

.summary-phase-next-label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--pencil);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.summary-phase-next.complete strong {
  color: var(--mold);
}

.phase-criteria-toggle {
  margin-top: 0.85rem;
}
.phase-criteria-toggle-summary {
  cursor: pointer;
  color: var(--pencil);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  list-style: none;
  transition: color 0.15s;
}
.phase-criteria-toggle-summary::-webkit-details-marker { display: none; }
.phase-criteria-toggle-summary::before { content: "▸ "; font-size: 0.72rem; }
.phase-criteria-toggle[open] .phase-criteria-toggle-summary::before { content: "▾ "; }
.phase-criteria-toggle-summary:hover { color: var(--brass); }
.phase-criteria-toggle .summary-phase-criteria { margin-top: 0.5rem; }

.summary-empty {
  margin-top: 0.8rem;
  color: var(--pencil);
  font-style: italic;
}

.summary-callout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(200,168,78,0.2);
  background: rgba(200,168,78,0.06);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.summary-callout:hover {
  border-color: rgba(200,168,78,0.4);
  background: rgba(200,168,78,0.1);
}
.summary-callout-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.95rem;
}
.summary-callout-label {
  color: var(--pencil);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.15rem;
}
.summary-callout-arrow {
  color: var(--shadow);
}
.summary-callout-alt {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  padding-left: 0.9rem;
}
.summary-callout-alt a {
  color: var(--pencil);
  text-decoration: none;
  transition: color 0.15s;
}
.summary-callout-alt a:hover {
  color: var(--brass);
}

.summary-metrics,
.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.summary-metric,
.quick-stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(85,85,104,0.2);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.9rem;
}

.summary-metric-label {
  color: var(--pencil);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.summary-metric-value {
  margin-top: 0.2rem;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 700;
}

.summary-metric-subtitle {
  color: var(--pencil);
  font-size: 0.82rem;
}

.summary-metric .progress-bar {
  height: 6px;
  margin-top: 0.65rem;
}

.quick-stat {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.quick-stat .hud-icon {
  width: 20px;
  height: 20px;
  margin-right: 0;
}

.quick-stat-label {
  display: block;
  color: var(--pencil);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.quick-stat-value {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

/* Card depth treatment — no rotation */
.summary-card,
.summary-metric,
.quick-stat,
.overview-panel,
.stat-card,
.rec-card,
.run-plan,
.phase-banner {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
/* Rotation REMOVED — no --card-rot system */

.stat-card,
.rec-card,
.run-plan,
.phase-banner {
  background: var(--card-bg);
  border: 1px solid rgba(85,85,104,0.2);
  border-top-color: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.03),
    0 2px 8px rgba(0,0,0,0.3);
}

.stat-card.primary {
  grid-column: 1 / -1;
  background: linear-gradient(168deg, rgba(26,26,46,1) 0%, rgba(18,18,26,1) 100%);
  border: 1px solid rgba(200,168,78,0.3);
  box-shadow:
    inset 0 1px 0 rgba(200,168,78,0.06),
    0 0 24px rgba(200,168,78,0.06),
    0 4px 12px rgba(0,0,0,0.4);
}

.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--brass); }
.stat-value-hero {
  font-size: 2.4rem;
  text-shadow: 0 0 20px rgba(200,168,78,0.25);
}
.stat-value-hero .hud-icon {
  width: 32px;
  height: 32px;
}
.stat-card.primary .progress-bar {
  height: 10px;
}
.stat-label { font-size: 0.85rem; color: var(--pencil); margin-top: 0.2rem; }

/* Progress bars — taller, gradient, glow */
.progress-bar {
  height: 10px;
  background: rgba(85,85,104,0.25);
  border-radius: 5px;
  margin-top: 0.5rem;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #a08030 0%, var(--brass) 50%, #d4b856 100%);
  border-radius: 5px;
  transition: width 0.6s ease-out;
  box-shadow: 0 0 8px rgba(200,168,78,0.2);
}

/* Progress section — merged Completion + Stats */
.progress-stats-toggle {
  margin-top: 1rem;
}
.progress-stats-summary {
  cursor: pointer;
  color: var(--ink);
  font-family: "Upheaval", system-ui, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
  padding: 0.6rem 0.9rem;
  background: linear-gradient(168deg, rgba(26,26,46,1), rgba(20,20,32,1));
  border: 1px solid rgba(85,85,104,0.15);
  border-radius: var(--radius-sm);
  list-style: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.progress-stats-summary::-webkit-details-marker { display: none; }
.progress-stats-summary::before { content: "\25B8 "; color: var(--pencil); }
.progress-stats-toggle[open] .progress-stats-summary::before { content: "\25BE "; }
.progress-stats-summary:hover {
  color: var(--brass);
  border-color: rgba(200,168,78,0.2);
}
.progress-stats-toggle[open] .progress-stats-summary {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: 0.5rem;
}

/* Detailed stats */
.overview-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.overview-panel {
  background: linear-gradient(160deg, rgba(30,33,43,0.88), rgba(18,20,29,0.94));
  border: 1px solid rgba(85,85,104,0.22);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.03),
    0 8px 20px rgba(0,0,0,0.18);
}

.overview-panel h3 {
  margin: 0;
  font-family: "Upheaval", system-ui, sans-serif;
  font-size: 0.98rem;
  letter-spacing: 0.05em;
  color: var(--brass);
}

.overview-panel-copy {
  margin-top: 0.35rem;
  color: var(--pencil);
  font-size: 0.84rem;
}

.overview-stat-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.overview-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(85,85,104,0.18);
}

.overview-stat-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
}

.overview-stat-label .hud-icon {
  width: 18px;
  height: 18px;
  margin-right: 0;
}

.overview-stat-value {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: right;
}

/* Completion grid table */
.marks-table-wrapper {
  overflow-x: auto;
}
.marks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.marks-table thead { position: sticky; top: 0; }
.marks-table th {
  background: linear-gradient(180deg, rgba(26,26,46,1), rgba(18,18,30,1));
  color: var(--pencil);
  padding: 0.5rem 0.5rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  vertical-align: bottom;
  border-bottom: 2px solid rgba(200,168,78,0.15);
}
.marks-table td {
  padding: 0.45rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(85,85,104,0.12);
  transition: background 0.15s;
}
.marks-table td.mark {
  line-height: 0;
}
/* Row hover */
.marks-table tbody tr:hover td {
  background: rgba(200,168,78,0.04);
}
.char-name {
  text-align: left !important;
  font-weight: 600;
  white-space: nowrap;
  padding-right: 0.5rem !important;
}
.char-done-count {
  font-weight: 600;
  font-size: 0.8em;
  color: var(--pencil);
  margin-left: 0.4rem;
  white-space: nowrap;
}

/* Game sprite global treatment */
.mark-icon,
.boss-icon,
.char-portrait,
.run-portrait,
.char-unlock-portrait,
.hud-icon {
  image-rendering: pixelated;
  vertical-align: middle;
}

/* HUD stat card icons (24x24) */
.hud-icon {
  width: 24px;
  height: 24px;
  margin-right: 6px;
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}
.filter-btn {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(85,85,104,0.25);
  background: rgba(42,42,62,0.55);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.filter-btn:hover {
  border-color: rgba(200,168,78,0.4);
  color: var(--brass);
}
.filter-btn.active {
  background: linear-gradient(168deg, rgba(200,168,78,0.2), rgba(175,140,50,0.15));
  border-color: rgba(200,168,78,0.5);
  color: var(--brass);
}

/* Filter visibility — JS-toggled class */
.filter-hidden { display: none !important; }

/* Desktop/mobile toggle helpers */
.mobile-only { display: none !important; }
.desktop-only { display: block; }

/* Mobile character cards for completion grids */
.mobile-char-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mobile-char-card {
  background: var(--card-bg);
  border: 1px solid rgba(85,85,104,0.2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
}
.mobile-card-header {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.mobile-card-header .char-portrait {
  width: 32px;
  height: 32px;
}
.mobile-card-missing {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}
.mobile-mark {
  display: inline-flex;
  align-items: center;
}
.mobile-mark .mark-icon {
  width: 24px;
  height: 24px;
  filter: saturate(0.25) brightness(0.5) opacity(0.7);
}
.mobile-card-complete {
  color: var(--mold);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}
.mobile-char-card .progress-bar { margin-top: 0.25rem; height: 6px; }

/* Completion mark icons — pre-scaled 32×32 (2× of 16px source) */
.mark-icon {
  width: 32px;
  height: 32px;
  display: block;
  margin: 0 auto;
  overflow: visible;
}
.mark.done .mark-icon { /* full color, no filter */ }
.mark.missing .mark-icon {
  filter: saturate(0.25) brightness(0.5) opacity(0.7);
}

/* Boss column header icons — 1.5× native 24px */
.boss-icon {
  width: 36px;
  height: 36px;
  display: block;
  margin: 0 auto 2px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}
.boss-label {
  display: block;
  font-size: 0.8rem;
}

/* Character portraits in grid — 1× native 48px */
.char-portrait {
  width: 48px;
  height: 48px;
  margin-right: 4px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* Character portraits in run plan cards */
.run-portrait {
  width: 32px;
  height: 32px;
  margin-right: 4px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

/* Character portraits in unlock list */
.char-unlock-portrait {
  width: 24px;
  height: 24px;
  margin-right: 4px;
}
.char-unlock.locked .char-unlock-portrait {
  filter: saturate(0.3) brightness(0.6);
}

.mark.done { color: var(--mold); }
.mark.missing { color: var(--wound); }
.mark.na { color: var(--shadow); }

tr.near-complete { background: rgba(200, 168, 78, 0.08); }
tr.near-complete .char-name { color: var(--brass); text-shadow: 0 0 8px rgba(200,168,78,0.15); }
tr.complete { background: rgba(76, 175, 80, 0.08); }
tr.complete .char-name { color: var(--mold); text-shadow: 0 0 8px rgba(76,175,80,0.15); }

/* Recommendations */
.rec-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.85rem;
  margin-bottom: 0;
  border-left: 3px solid var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.rec-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  line-height: 1.38;
}
.rec-header .item-badge {
  margin-left: auto;
}
.rec-reason {
  color: var(--pencil);
  font-size: 0.82rem;
  line-height: 1.45;
}
.rec-reason-preview,
.run-why-preview {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.rec-reason-full,
.run-why-full {
  display: block;
}

/* Run plan cards — "What Next" as visual hero */
.run-plan {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 0;
  border-left: 3px solid var(--brass);
  border-top: 1px solid rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.run-plan-header {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.run-character { color: var(--brass); font-weight: 700; }
.run-destination { color: var(--ink); font-weight: 600; }
.run-arrow { color: var(--shadow); }
.run-timed {
  font-size: 0.75rem;
  color: var(--wound);
  background: rgba(239,107,107,0.1);
  border: 1px solid rgba(239,107,107,0.2);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  cursor: help;
}
.run-goals {
  margin-top: 0.1rem;
  padding-left: 0.8rem;
  border-left: 1px solid rgba(200,168,78,0.1);
  margin-left: 0.35rem;
}
.run-goals-primary,
.run-goals-secondary {
  margin-top: 0.1rem;
  padding-left: 0.8rem;
  border-left: 1px solid rgba(200,168,78,0.1);
  margin-left: 0.35rem;
}
.run-goals-secondary {
  margin-top: 0.6rem;
}
.run-goal {
  font-size: 0.82rem;
  color: var(--ink);
  padding: 0.15rem 0;
}
.run-goal.primary { font-weight: 600; }
.run-goal.gate, .run-goal.bundled {
  color: var(--pencil);
  font-size: 0.85rem;
  font-style: italic;
}
.run-goal.note,
.run-why {
  color: var(--pencil);
  font-size: 0.82rem;
}
.run-why {
  padding-left: 0;
  font-style: normal;
}
.run-goal-boss {
  color: var(--pencil);
  margin-right: 0.3rem;
}

/* Badges — consistent contrast */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 0.3rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.badge.high { background: var(--wound); color: #000; }
.badge.med { background: var(--brass); color: #000; }
.badge.low { background: var(--bruise); color: #000; }
.badge.opt { background: var(--shadow); color: var(--ink); }

/* Lane recommendations */
.rec-card.lane-progression-gate { border-left-color: var(--wound); }
.rec-card.lane-character-unlock { border-left-color: var(--brass); }
.rec-card.lane-completion-mark { border-left-color: var(--bruise); }
.rec-card.lane-challenge { border-left-color: var(--cursed); }
.rec-card.lane-donation { border-left-color: var(--mold); }
.rec-card.lane-guardrail { border-left-color: var(--shadow); }

.blocked-by {
  font-size: 0.8rem;
  color: var(--wound);
  margin-top: 0.45rem;
  padding: 0.35rem 0.55rem;
  background: rgba(224, 85, 85, 0.08);
  border-radius: 4px;
}

.card-details {
  margin-top: 0.1rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(85,85,104,0.18);
}
.card-details summary {
  list-style: none;
}
.card-details summary::-webkit-details-marker {
  display: none;
}
.card-details-summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--brass);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.card-details-summary::before {
  content: "+";
  color: var(--pencil);
}
.card-details[open] .card-details-summary::before {
  content: "-";
}
.card-details-body {
  margin-top: 0.55rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(85,85,104,0.16);
}
.card-details-body .rec-reason,
.card-details-body .run-why {
  margin-top: 0;
}
.card-details-body .blocked-by {
  margin-top: 0.6rem;
}

/* Guardrails panel */
.guardrails-panel {
  background: var(--parchment);
  border: 1px solid var(--shadow);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}
.guardrail-item {
  padding: 0.4rem 0;
}
.guardrail-item + .guardrail-item {
  border-top: 1px solid rgba(85, 85, 104, 0.25);
}
.guardrail-item strong {
  font-size: 0.9rem;
  color: var(--ink);
}
.guardrail-item p {
  font-size: 0.85rem;
  color: var(--pencil);
  margin-top: 0.1rem;
}

/* Lane drill-down sections */
.lane-section {
  margin-top: 0.75rem;
}
.lane-section summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 0.9rem;
  background: linear-gradient(168deg, rgba(26,26,46,1), rgba(20,20,32,1));
  border: 1px solid rgba(85,85,104,0.15);
  border-radius: var(--radius-sm);
  list-style: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lane-section summary:hover {
  color: var(--brass);
  border-color: rgba(200,168,78,0.2);
}
.lane-section summary::-webkit-details-marker { display: none; }
.lane-section summary::before {
  content: "\25B8 ";
  color: var(--pencil);
}
.lane-section[open] summary::before {
  content: "\25BE ";
}
.lane-section[open] summary {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: 0;
}
.lane-section .rec-card {
  border-radius: 0;
}
.lane-section .rec-card:last-child {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* Characters */
.char-group-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pencil);
  margin: 0.6rem 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.char-unlocked-toggle { margin-top: 0.5rem; }
.char-unlocked-toggle summary {
  cursor: pointer;
  color: var(--pencil);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(168deg, rgba(26,26,46,1), rgba(20,20,32,1));
  border: 1px solid rgba(85,85,104,0.15);
  border-radius: var(--radius-sm);
  list-style: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.char-unlocked-toggle summary::-webkit-details-marker { display: none; }
.char-unlocked-toggle summary::before { content: "\25B8 "; color: var(--pencil); }
.char-unlocked-toggle[open] summary::before { content: "\25BE "; }
.char-unlocked-toggle summary:hover { color: var(--brass); border-color: rgba(200,168,78,0.2); }
.char-unlocked-toggle[open] summary { border-radius: var(--radius-sm) var(--radius-sm) 0 0; margin-bottom: 0.35rem; }
.char-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.char-unlock {
  background: var(--card-bg);
  border: 1px solid rgba(85,85,104,0.15);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  transition: border-color 0.2s, transform 0.15s;
}
.char-unlock:hover {
  border-color: rgba(200,168,78,0.2);
  transform: translateY(-1px);
}
.char-unlock .status { margin-right: 0.25rem; }
.char-unlock.unlocked .status { color: var(--mold); }
.char-unlock.locked .status { color: var(--wound); }
.char-unlock.unlocked { border-left: 2px solid var(--mold); }
.char-unlock.locked { border-left: 2px solid rgba(158,11,15,0.4); opacity: 0.85; }
.unlock-how { font-size: 0.85rem; color: var(--pencil); margin-top: 0.15rem; }

/* Challenges */
.challenge-rows { display: flex; flex-direction: column; gap: 0.25rem; }
.challenge-row {
  background: var(--card-bg);
  border: 1px solid rgba(85,85,104,0.15);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.2s;
}
.challenge-row:hover {
  border-color: rgba(200,168,78,0.2);
}
.challenge-row:not(.done) { border-left: 2px solid rgba(155,89,182,0.4); }
.challenge-row.done { opacity: 0.45; border-left: 2px solid rgba(76,175,80,0.3); }
.challenge-rec-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brass);
  border: 1px solid rgba(200,168,78,0.35);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  margin-left: auto;
  white-space: nowrap;
}
.challenge-completed-toggle { margin-top: 0.5rem; }
.challenge-completed-toggle summary {
  cursor: pointer;
  color: var(--pencil);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(168deg, rgba(26,26,46,1), rgba(20,20,32,1));
  border: 1px solid rgba(85,85,104,0.15);
  border-radius: var(--radius-sm);
  list-style: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.challenge-completed-toggle summary::-webkit-details-marker { display: none; }
.challenge-completed-toggle summary::before { content: "\25B8 "; color: var(--pencil); }
.challenge-completed-toggle[open] summary::before { content: "\25BE "; }
.challenge-completed-toggle summary:hover { color: var(--brass); border-color: rgba(200,168,78,0.2); }
.challenge-completed-toggle[open] summary { border-radius: var(--radius-sm) var(--radius-sm) 0 0; margin-bottom: 0.25rem; }
.ch-id { color: var(--pencil); font-size: 0.85em; }
.reward { color: var(--brass); font-size: 0.85em; margin-left: 0.3rem; }
/* Legacy chip layout (kept for compat) */
.challenge-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.challenge {
  background: var(--card-bg);
  border: 1px solid rgba(85,85,104,0.15);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
  transition: border-color 0.2s, transform 0.15s;
}
.challenge:hover {
  border-color: rgba(200,168,78,0.2);
  transform: translateY(-1px);
}
.challenge:not(.done) { border-left: 2px solid rgba(155,89,182,0.4); }
.challenge.done { opacity: 0.45; border-left: 2px solid rgba(76,175,80,0.3); }

.empty { color: var(--pencil); font-style: italic; }

/* Bestiary */
.bestiary-collapse-summary {
  cursor: pointer;
  color: var(--pencil);
  font-size: 0.9rem;
  padding: 0.5rem 0;
  list-style: none;
}
.bestiary-collapse-summary::-webkit-details-marker { display: none; }
.bestiary-collapse-summary::before { content: "\25B8 "; color: var(--pencil); }
.bestiary-collapse[open] .bestiary-collapse-summary::before { content: "\25BE "; }
.bestiary-collapse-summary:hover { color: var(--brass); }
.bestiary-collapse[open] .bestiary-collapse-summary { margin-bottom: 0.5rem; }
.bestiary-summary { color: var(--pencil); margin-bottom: 0.75rem; }
.bestiary-group { margin-top: 0.5rem; }
.bestiary-group summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 0.9rem;
  background: linear-gradient(168deg, rgba(26,26,46,1), rgba(20,20,32,1));
  border: 1px solid rgba(85,85,104,0.15);
  border-radius: var(--radius-sm);
  list-style: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.bestiary-group summary:hover {
  color: var(--brass);
  border-color: rgba(200,168,78,0.2);
}
.bestiary-group summary::-webkit-details-marker { display: none; }
.bestiary-group summary::before { content: "\25B8 "; color: var(--pencil); }
.bestiary-group[open] summary::before { content: "\25BE "; }
.bestiary-group[open] summary { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.bestiary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.bestiary-table th {
  background: var(--parchment);
  color: var(--pencil);
  padding: 0.4rem 0.5rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.bestiary-table th:first-child { text-align: left; }
.bestiary-table td {
  padding: 0.35rem 0.5rem;
  text-align: right;
  border-bottom: 1px solid rgba(85, 85, 104, 0.3);
}
.bestiary-table td:first-child { text-align: left; font-weight: 600; white-space: nowrap; }
.bestiary-table tr.not-encountered td { color: var(--shadow); }
.bestiary-table tr.not-encountered td:first-child { color: var(--pencil); }

/* Missing Unlocks */
.unlock-category { margin-top: 0.5rem; }
.unlock-category summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 0.9rem;
  background: linear-gradient(168deg, rgba(26,26,46,1), rgba(20,20,32,1));
  border: 1px solid rgba(85,85,104,0.15);
  border-radius: var(--radius-sm);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.unlock-category summary:hover {
  color: var(--brass);
  border-color: rgba(200,168,78,0.2);
}
.unlock-category summary::-webkit-details-marker { display: none; }
.unlock-category summary::before { content: "\25B8 "; color: var(--pencil); flex-shrink: 0; }
.unlock-category[open] summary::before { content: "\25BE "; }
.unlock-category[open] summary { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.unlock-category.complete summary { color: var(--mold); }
.unlock-category.complete .progress-fill {
  background: linear-gradient(90deg, #2e7d32, var(--mold), #66bb6a);
  box-shadow: 0 0 8px rgba(76,175,80,0.2);
}

.category-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.category-progress .progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(85,85,104,0.25);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0;
}
.category-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #a08030, var(--brass), #d4b856);
  border-radius: 3px;
  transition: width 0.5s;
}
.category-progress .progress-text {
  font-size: 0.85rem;
  color: var(--pencil);
  white-space: nowrap;
}

.unlock-entries {
  background: var(--paper);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 0.5rem 0;
}
.unlock-entry {
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(85, 85, 104, 0.2);
}
.unlock-entry:last-child { border-bottom: none; }
.unlock-entry .unlock-name { font-weight: 600; }
.unlock-entry .unlock-how {
  color: var(--pencil);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

/* Wiki links */
.wiki-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}
.wiki-link:hover {
  text-decoration-style: solid;
  filter: brightness(1.2);
}

/* Staggered fade-up on results — more travel, longer duration */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
#results:not(.hidden) > section {
  opacity: 0;
  animation: fadeUp 0.35s ease-out forwards;
}
#results:not(.hidden) > section:nth-of-type(1) { animation-delay: 0ms; }
#results:not(.hidden) > section:nth-of-type(2) { animation-delay: 60ms; }
#results:not(.hidden) > section:nth-of-type(3) { animation-delay: 120ms; }
#results:not(.hidden) > section:nth-of-type(4) { animation-delay: 180ms; }
#results:not(.hidden) > section:nth-of-type(5) { animation-delay: 240ms; }
#results:not(.hidden) > section:nth-of-type(6) { animation-delay: 300ms; }
#results:not(.hidden) > section:nth-of-type(7) { animation-delay: 360ms; }
#results:not(.hidden) > section:nth-of-type(8) { animation-delay: 420ms; }
#results:not(.hidden) > section:nth-of-type(9) { animation-delay: 480ms; }
#results:not(.hidden) > section:nth-of-type(10) { animation-delay: 540ms; }
#results:not(.hidden) > section:nth-of-type(11) { animation-delay: 600ms; }
#results:not(.hidden) > section:nth-of-type(12) { animation-delay: 660ms; }

/* Card hover lift — no rotation */
.summary-card:hover,
.summary-metric:hover,
.quick-stat:hover,
.overview-panel:hover,
.stat-card:hover,
.rec-card:hover,
.run-plan:hover,
.phase-banner:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 4px 16px rgba(0,0,0,0.4),
    0 0 1px rgba(200,168,78,0.12);
  border-color: rgba(200,168,78,0.15);
}

/* Mark hover glow */
.mark.done .mark-icon:hover {
  filter: drop-shadow(0 0 3px var(--mold));
  transform: scale(1.1);
  transition: filter 0.15s, transform 0.15s;
}
.mark.missing .mark-icon:hover {
  filter: saturate(0.25) brightness(0.5) opacity(0.7) drop-shadow(0 0 3px var(--wound));
  transform: scale(1.1);
  transition: filter 0.15s, transform 0.15s;
}

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--pencil);
  font-size: 0.85rem;
}

.github-star {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.github-star:hover {
  color: var(--brass);
  border-color: var(--brass);
}
.github-star svg {
  flex-shrink: 0;
}

@media (max-width: 980px) {
  #results {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  #results > section,
  #progress-section,
  #boss-milestones-section,
  #challenges-section,
  #characters-section {
    grid-column: 1 / -1;
  }
  .results-nav {
    top: 0.4rem;
    border-radius: var(--radius-md);
  }
  .overview-panels {
    grid-template-columns: 1fr;
  }
}

/* Responsive */
@media (max-width: 700px) {
  main {
    padding-inline: 0.7rem;
  }
  #results > section {
    padding: 0.85rem 0.8rem 1rem;
  }
  .results-nav {
    position: static;
    padding: 0.4rem;
    margin-bottom: 0;
  }
  .results-nav a {
    font-size: 0.72rem;
    padding: 0.25rem 0.45rem;
  }
  .summary-title {
    font-size: 2.55rem;
  }
  .summary-metrics,
  .summary-stats,
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .summary-card,
  .summary-metric,
  .quick-stat,
  .overview-panel {
    padding-inline: 0.85rem;
  }
  .path-row {
    align-items: flex-start;
  }
  .path-os-header-main {
    flex-wrap: wrap;
  }
  .path-copy-btn {
    margin-top: 1.25rem;
  }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card.primary { grid-column: 1 / -1; }
  .marks-table { font-size: 0.75rem; }
  .phase-header { flex-direction: column; }
  header::after { display: none; }
  .stat-value-hero { font-size: 2rem; }
  .run-goals,
  .run-goals-primary,
  .run-goals-secondary {
    padding-left: 0.5rem;
    border-left: none;
    margin-left: 0;
  }
  .run-why {
    padding-left: 0;
  }
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
  .mobile-char-cards { display: flex !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  #results > section { opacity: 1 !important; }
  .summary-card, .summary-metric, .quick-stat, .overview-panel, .stat-card, .rec-card, .run-plan, .phase-banner { transform: none !important; }
  .char-unlock, .challenge { transform: none !important; }
}

/* Phase banner */
.phase-banner {
  background: linear-gradient(168deg, rgba(26,26,46,1), rgba(18,18,30,1));
  border: 1px solid rgba(200,168,78,0.25);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
}
/* Warm glow in corner */
.phase-banner::before {
  content: "";
  position: absolute;
  top: -30px; left: -30px;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(200,168,78,0.08), transparent 70%);
  pointer-events: none;
}
.phase-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.phase-label {
  font-family: "Upheaval", system-ui, sans-serif;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--pencil);
}
.phase-name {
  font-family: "Upheaval", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--brass);
  text-shadow: 0 0 12px rgba(200,168,78,0.15);
}
.phase-description {
  color: var(--pencil);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.phase-criteria {
  list-style: none;
}
.phase-criterion {
  padding: 0.2rem 0;
  font-size: 0.85rem;
}
.phase-criterion::before {
  display: inline-block;
  width: 1.2em;
  margin-right: 0.3rem;
  font-weight: 700;
}
.phase-criterion.met { color: var(--mold); }
.phase-criterion.met::before { content: "\2713"; text-shadow: 0 0 6px rgba(76,175,80,0.3); }
.phase-criterion.unmet { color: var(--wound); }
.phase-criterion.unmet::before { content: "\2717"; text-shadow: 0 0 6px rgba(239,107,107,0.3); }
.phase-how-to {
  display: block;
  font-size: 0.85rem;
  color: var(--pencil);
  margin-left: 1.5em;
}
.rec-wiki-link {
  font-size: 0.8rem;
  color: var(--pencil);
  margin-left: 0.3rem;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}
.rec-wiki-link:hover {
  text-decoration-style: solid;
  filter: brightness(1.2);
}

/* Item quality badges — compact grade stamp */
.item-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 1.6em;
  padding: 0.1em 0.35em;
  border-radius: 2px;
  vertical-align: middle;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.1);
  opacity: 0.85;
}
.item-badge.s-tier {
  background: linear-gradient(135deg, #ff6b35, #ff8c42);
  color: #000;
  border-color: rgba(255,107,53,0.3);
}
.item-badge.a-tier { background: var(--brass); color: #000; }
.item-badge.b-tier { background: var(--bruise); color: #000; }
.item-badge.c-tier { background: var(--shadow); color: var(--ink); }
.item-badge.toxic {
  background: linear-gradient(135deg, #7a0a0d, var(--dried-blood));
  color: #fff;
  border-color: rgba(158,11,15,0.3);
}

/* Toxic warning */
.rec-card.toxic-warning {
  border-left-color: var(--dried-blood);
  background:
    linear-gradient(90deg, rgba(122, 27, 27, 0.1), rgba(122, 27, 27, 0.02) 42%, transparent 100%),
    var(--card-bg);
}

/* Path containers */
.path-group {
  margin-bottom: 1.15rem;
}
.path-group-cards {
  display: grid;
  gap: 0.55rem;
}
.path-group-header {
  font-family: "Upheaval", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  border-bottom: none;
  padding-bottom: 0.3rem;
  margin-bottom: 0.5rem;
}
.path-group-header::after {
  content: "";
  display: block;
  margin-top: 0.3rem;
  height: 1px;
  background: linear-gradient(90deg, var(--brass), rgba(85,85,104,0.3) 40%, transparent 80%);
}
.warning-lane {
  margin-bottom: 1.25rem;
}
.warning-lane-header {
  font-family: "Upheaval", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--wound);
  margin-bottom: 0.6rem;
}
.warning-lane-header::after {
  content: "";
  display: block;
  margin-top: 0.35rem;
  height: 1px;
  background: linear-gradient(90deg, var(--dried-blood), rgba(122,27,27,0.3) 40%, transparent 80%);
}
.warning-lane-cards {
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 1100px) {
  .path-group-grid .path-group-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

/* DLC badge pill */
.dlc-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15em 0.6em;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dlc-rebirth      { background: rgba(85,85,104,0.3); color: var(--ink); }
.dlc-afterbirth   { background: rgba(102,153,221,0.2); color: var(--bruise); border: 1px solid rgba(102,153,221,0.25); }
.dlc-afterbirth-plus { background: rgba(155,89,182,0.2); color: var(--cursed); border: 1px solid rgba(155,89,182,0.25); }
.dlc-repentance   { background: rgba(200,168,78,0.15); color: var(--brass); border: 1px solid rgba(200,168,78,0.25); }

/* Boss Kill Milestones */
.milestone-group { margin-top: 0.5rem; }
.milestone-group summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  background: var(--paper);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.milestone-group summary:hover {
  color: var(--brass);
  border-color: rgba(200,168,78,0.2);
}
.milestone-group summary::-webkit-details-marker { display: none; }
.milestone-group summary::before { content: "\25B8 "; color: var(--pencil); flex-shrink: 0; }
.milestone-group[open] summary::before { content: "\25BE "; }
.milestone-group[open] summary { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.milestone-group.complete summary { color: var(--mold); }
.milestone-group.complete .milestone-progress .progress-fill {
  background: linear-gradient(90deg, #2e7d32, var(--mold), #66bb6a);
  box-shadow: 0 0 8px rgba(76,175,80,0.2);
}
.milestone-summary {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.milestone-summary .progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(85,85,104,0.25);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0;
}
.milestone-summary .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #a08030, var(--brass), #d4b856);
  border-radius: 3px;
  transition: width 0.5s;
}
.milestone-summary .milestone-count {
  font-size: 0.85rem;
  color: var(--pencil);
  white-space: nowrap;
}
.milestone-rows {
  background: var(--paper);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 0.5rem 0;
}
.milestone-row {
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(85,85,104,0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.milestone-row:last-child { border-bottom: none; }
.milestone-row.unlocked .milestone-icon { color: var(--mold); }
.milestone-row.locked .milestone-icon { color: var(--pencil); }
.milestone-row.next { background: rgba(200,168,78,0.06); }
.milestone-kills { color: var(--pencil); min-width: 3.5rem; }
.milestone-name { flex: 1; }
.milestone-row.unlocked .milestone-name { color: var(--ink); }
.milestone-row.locked .milestone-name { color: var(--pencil); }
.milestone-completed-toggle { margin-top: 0.25rem; }
.milestone-completed-summary {
  cursor: pointer;
  color: var(--pencil);
  font-size: 0.78rem;
  padding: 0.3rem 1rem;
  list-style: none;
  transition: color 0.15s;
}
.milestone-completed-summary::-webkit-details-marker { display: none; }
.milestone-completed-summary::before { content: "▸ "; font-size: 0.7rem; }
.milestone-completed-toggle[open] .milestone-completed-summary::before { content: "▾ "; }
.milestone-completed-summary:hover { color: var(--brass); }
.milestone-inferred {
  font-size: 0.75rem;
  color: var(--pencil);
  font-style: italic;
}

.summary-feature-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.summary-card-subheading {
  margin-top: 1rem;
}

#tier-1,
#tier-2-3 {
  display: grid;
  gap: 1rem;
}

.tier-1 .path-group-cards {
  display: grid;
  gap: 0.85rem;
}

/* Tier 1 cards: dominant visual weight */
.tier-1 .rec-card {
  padding: 0.85rem 1rem;
  border-left-width: 4px;
  background: linear-gradient(168deg, rgba(48,48,68,0.92) 0%, rgba(30,30,50,0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 4px 14px rgba(0,0,0,0.32),
    0 0 12px var(--glow-brass);
}

/* Subdue stats/overview/dashboard to recede */
.stat-card,
.overview-panel,
.quick-stat {
  padding: 0.7rem 0.75rem;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.02),
    0 1px 5px rgba(0,0,0,0.2);
  border-color: rgba(85,85,104,0.15);
}

.tier-2 .path-group-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
}

.tier-3 .rec-card,
.tier-backlog .rec-card {
  opacity: 0.96;
}

.tier3-show-all-wrap {
  text-align: center;
  margin-top: 0.65rem;
}
.tier3-show-all {
  cursor: pointer;
  color: var(--pencil);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(85,85,104,0.3);
  background: rgba(255,255,255,0.03);
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.tier3-show-all:hover {
  color: var(--brass);
  border-color: rgba(200,168,78,0.35);
}
.tier3-overflow {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.action-card {
  scroll-margin-top: 6rem;
}

.action-why-first {
  margin-top: 0.5rem;
  font-weight: 700;
  color: var(--ink);
}

.summary-focus-item a {
  color: inherit;
  text-decoration: none;
}

.summary-focus-item a:hover {
  text-decoration: underline;
}

.action-debug {
  margin-top: 0.65rem;
}

.action-debug-grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.25rem 0.75rem;
  font-size: 0.85rem;
  color: var(--pencil);
  padding-top: 0.5rem;
}
