:root {
  --page: #fff4dc;
  --surface: #fffaf0;
  --surface-strong: #ffffff;
  --ink: #2e190c;
  --muted: #765634;
  --line: #e1bd75;
  --accent: #d87614;
  --accent-strong: #4a210e;
  --accent-soft: #ffe7b2;
  --gold: #f7bd26;
  --green: #466f54;
  --shadow: 0 18px 45px rgba(74, 33, 14, 0.16);
  --radius: 8px;
}

:root[data-theme='backstage'] {
  --page: #f3eadc;
  --surface: #fff8ec;
  --surface-strong: #ffffff;
  --ink: #27180f;
  --muted: #624935;
  --line: #c99b5b;
  --accent: #b85f18;
  --accent-strong: #3b1c0d;
  --accent-soft: #f7d9a7;
  --gold: #e0a32a;
  --green: #436b55;
  --shadow: 0 18px 45px rgba(47, 29, 15, 0.14);
}

:root[data-theme='candy'] {
  --page: #fff8ed;
  --surface: #fffdf7;
  --surface-strong: #ffffff;
  --ink: #2b180e;
  --muted: #74593d;
  --line: #e6cda0;
  --accent: #c76114;
  --accent-strong: #3c1b0c;
  --accent-soft: #fff0cf;
  --gold: #ffd166;
  --green: #356f64;
  --shadow: 0 18px 45px rgba(74, 33, 14, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0)),
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--gold) 55%, #fff) 0, transparent 34rem),
    var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  min-width: max-content;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  color: var(--accent-strong);
  background:
    radial-gradient(circle at 45% 40%, #fff8e5 0 20%, transparent 21%),
    linear-gradient(135deg, var(--gold), var(--accent));
  border: 3px solid var(--accent-strong);
  border-radius: 50%;
  font-weight: 800;
}

.brand-logo {
  width: 4.6rem;
  height: 4.6rem;
  object-fit: contain;
  filter: drop-shadow(0 0.35rem 0.45rem rgba(46, 25, 12, 0.18));
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.main-nav {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  overflow-x: auto;
}

.main-nav a,
.tabs a,
.button,
.theme-toggle {
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.main-nav a {
  padding: 0.55rem 0.75rem;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.is-current,
.tabs a.is-current {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
}

.theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--accent-strong);
  background: var(--surface);
  border-color: var(--line);
  cursor: pointer;
  font-size: 1.1rem;
}

#main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 3rem;
}

.data-notice {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 700;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: stretch;
  min-height: 430px;
  padding: clamp(1.2rem, 5vw, 4rem) 0;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 11ch;
  margin-bottom: 1rem;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 0.92;
}

.hero-logo {
  width: min(100%, 27rem);
  height: auto;
  margin: -1.3rem 0 0.4rem -0.8rem;
  object-fit: contain;
  filter: drop-shadow(0 1rem 1.3rem rgba(74, 33, 14, 0.18));
}

.hero-copy p:not(.eyebrow) {
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  color: var(--accent-strong);
  background: var(--surface);
  border-color: var(--line);
  font-weight: 800;
}

.button.primary {
  color: #fff8e5;
  background: var(--accent);
  border-color: var(--accent);
}

.button:hover,
.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.tour-poster {
  position: relative;
  display: flex;
  min-height: 370px;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: 1.25rem;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(46, 25, 12, 0.04), rgba(46, 25, 12, 0.8)),
    linear-gradient(135deg, var(--accent-strong), #2e190c 54%, var(--gold));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tour-poster::before {
  position: absolute;
  inset: 1rem;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius);
}

.tour-poster::after {
  position: absolute;
  top: 12%;
  right: -18%;
  width: 78%;
  aspect-ratio: 1;
  content: "";
  background:
    radial-gradient(circle, transparent 0 66%, rgba(255, 255, 255, 0.2) 66.5% 71%, transparent 71.5%),
    repeating-conic-gradient(from -18deg, rgba(255, 255, 255, 0.24) 0 10deg, transparent 10deg 20deg);
  border-radius: 50%;
}

.tour-poster > * {
  position: relative;
  z-index: 1;
}

.poster-topline {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tour-poster strong {
  font-size: clamp(4rem, 10vw, 7rem);
  line-height: 0.86;
  text-transform: uppercase;
}

.poster-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.poster-stamps span {
  padding: 0.3rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 800;
}

.stat-grid,
.summary-strip,
.series-grid,
.detail-grid,
.split-content {
  display: grid;
  gap: 1rem;
}

.stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-grid article,
.summary-strip article,
.info-panel,
.selected-panel,
.series-grid article a {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(66, 45, 31, 0.07);
}

.stat-grid article,
.summary-strip article {
  padding: 1rem;
}

.stat-grid span,
.summary-strip span {
  display: block;
  color: var(--accent-strong);
  font-size: 2rem;
  font-weight: 900;
}

.stat-grid p,
.summary-strip p,
.compact-list small,
.timeline p,
.info-panel p,
.page-heading p {
  color: var(--muted);
}

.split-content,
.detail-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 2rem;
}

.section-heading,
.page-heading {
  margin: 2rem 0 1rem;
}

.page-heading h1,
.detail-hero h1 {
  max-width: none;
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.tabs a {
  padding: 0.55rem 0.85rem;
  background: var(--surface);
  border-color: var(--line);
  font-weight: 800;
}

.timeline {
  display: grid;
  gap: 0.75rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.timeline-item time {
  color: var(--accent-strong);
  font-weight: 900;
}

.timeline-item h3 {
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.compact-list {
  display: grid;
  gap: 0.65rem;
}

.compact-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
}

.compact-list b {
  grid-row: span 2;
  align-self: center;
  color: var(--green);
  font-size: 1.3rem;
}

.table-shell {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent-soft) 70%, #fff);
  font-size: 0.84rem;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 30%, #fff);
}

.visit-dot {
  display: inline-grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 900;
}

.presence img {
  image-rendering: pixelated;
  transform: scale(1.4);
  transform-origin: left center;
}

.is-faded {
  opacity: 0.62;
}

.summary-strip {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 1rem;
}

.detail-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.back-link {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.status-pill {
  padding: 0.4rem 0.65rem;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 14%, #fff);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 900;
}

.info-panel,
.selected-panel {
  padding: 1.1rem;
}

.info-panel h2,
.selected-panel h2 {
  margin-bottom: 0.8rem;
}

dl {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
}

dt {
  color: var(--muted);
  font-weight: 800;
}

dd {
  margin: 0;
}

.note {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.selected-panel {
  margin-bottom: 1rem;
}

.selected-panel span {
  color: var(--accent-strong);
  font-weight: 800;
}

.series-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.series-grid article a {
  display: grid;
  gap: 0.45rem;
  min-height: 9rem;
  padding: 1rem;
  text-decoration: none;
}

.series-grid span {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  font-weight: 900;
}

.series-grid small {
  color: var(--muted);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  justify-content: center;
  padding: 2rem 1rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 880px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .dashboard-hero,
  .split-content,
  .detail-grid,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-hero {
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  #main {
    width: min(100% - 1rem, 1180px);
  }

  .brand small {
    display: none;
  }

  h1 {
    font-size: 3rem;
  }

  .stat-grid,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .timeline-item,
  dl div {
    grid-template-columns: 1fr;
  }

  .tour-poster {
    min-height: 310px;
  }
}
