:root {
  color-scheme: dark;
  background: #070911;
  color: #f0f2fb;
  --ink: #f0f2fb;
  --muted: #adb5cc;
  --border: #2a3047;
  --purple: #ffc1c3;
  --accent: #331b29;
  --focus: #ff767e;
  --surface: #101321;
  --control: #0b0e1a;
  --raised: #171a2a;
}

:focus-visible { outline: 2px solid var(--focus); }
a { color: var(--purple); text-underline-offset: .2em; }

.hero {
  position: relative;
  isolation: isolate;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse at 66% 0%, #2b1424 0%, #111320 58%, #0a0c16 100%);
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background-image: linear-gradient(#ff727314 1px, transparent 1px),
    linear-gradient(90deg, #ff727314 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, #000, #0000);
}

.mast { padding-block: 14px; border-color: var(--border); }

.home {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--ink);
  font-weight: 700;
}

.home img { flex: none; }
.home:hover { color: var(--purple); }
.release { color: var(--muted); border-color: var(--border); }
a.release:hover { color: var(--ink); border-color: var(--focus); background: var(--accent); }

.changelog-intro { padding-block: clamp(1.4rem, 4vw, 2.5rem); }
.changelog { max-width: 54rem; }
.changelog-release p { margin-top: .4rem; }
.changelog-release > p, .change-entry .record-id { color: var(--muted); }
.change-list { padding: 0; margin: 1rem 0 2.5rem; list-style: none; }
.change-entry {
  padding: 1rem clamp(.9rem, 3vw, 1.35rem);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow-wrap: anywhere;
}
.change-entry + .change-entry { border-top: 0; }
.change-entry:first-child { border-radius: 12px 12px 0 0; }
.change-entry:last-child { border-radius: 0 0 12px 12px; }
.change-entry .record-id { margin: .2rem 0 0; }
.change-entry summary { margin-top: .65rem; cursor: pointer; color: var(--purple); }
.change-entry details section { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.change-entry details h5 { margin: .7rem 0 .2rem; font-size: .9rem; }
.change-entry details ul { padding-inline-start: 1.25rem; }
.change-entry details li + li { margin-top: .5rem; }

h1 {
  color: #fff3f1;
  font: italic 900 clamp(1.7rem, 5.5vw, 3.35rem) / 1.08 "Arial Black", system-ui, sans-serif;
  letter-spacing: -.04em;
  text-shadow: 2px 2px #8e2538;
  text-wrap: balance;
}

.hero p { color: var(--muted); max-width: 70ch; }
.hero-panel[open] { padding-bottom: clamp(1.4rem, 3vw, 2rem); }
.hero-panel[open] > .panel-summary { padding-top: clamp(1.25rem, 3vw, 2rem); }
.hero-panel > .panel-summary::after { color: var(--focus); }

.filter-panel, .results, .detail, .art-dialog { background: var(--surface); }
.detail-heading, .section-header { background: var(--raised); color: var(--ink); }
.filter-panel > .panel-summary { color: var(--ink); }
.toolbar label { font-size: .875rem; }

input, select {
  min-height: 44px;
  background: var(--control);
  border-color: var(--border);
  color: var(--ink);
}

input::placeholder { color: var(--muted); opacity: .85; }
.media-filter input { min-height: 0; accent-color: var(--focus); }

.result-head h2, .detail h2, .site-footer h2, .art-dialog-header h2 {
  font-family: system-ui, sans-serif;
  font-weight: 750;
  letter-spacing: -.025em;
}

.character { background: var(--surface); border-color: var(--border); }
.character:hover { background: var(--raised); }
.character[aria-current="true"] { box-shadow: inset 3px 0 var(--focus); }
.position { background: var(--raised); color: var(--muted); }

.pages button, .clear, .art-dialog-header button {
  min-height: 40px;
  border-color: var(--border);
  background: var(--control);
  color: var(--ink);
}

.pages button:hover:not(:disabled), .clear:hover, .art-dialog-header button:hover {
  border-color: var(--focus);
  background: var(--accent);
}

.character-portrait, .character-full-body, #art-dialog-image { background: #1c2030; }
.art-dialog::backdrop { background: #050610d8; }
.media-pill { background: #242137; border-color: #403955; color: #e3dbf4; }
.names-section .section-header { background: #222741; color: #e1e7ff; }
.age-section-adult .section-header { background: #183327; color: #c3eed2; }
.age-section-transition .section-header { background: #382b17; color: #ffe4a2; }
.age-section-minor .section-header { background: #402131; color: #ffd1dc; }
.age-section-unresolved .section-header { background: #262a39; color: #e0e3ed; }
.badge { background: #292d41; color: #e0e3f2; }
.badge.verified { background: #183327; color: #c3eed2; }
.badge.partial, .badge.age-flag, .badge.evidence-flag { background: #382b17; color: #ffe4a2; }
.badge.provisional { background: #332641; color: #ead9f7; }

.age-basis-sources a, .age-policy a, .site-footer a, .art-dialog a,
.flashback-evidence summary, .art-gap a, .review a { color: var(--purple); }

@media (max-width: 360px) {
  .mast { gap: .5rem; }
  .home { gap: .5rem; }
  .home img { width: 32px; height: 32px; }
}
