/* Project Dynasty — Almanac · Season I room (2026-10-13).
   Visual-first season retrospective on the neutral base. Scoped to .pd-sr;
   league color stays an accent, surfaces and type stay on the site tokens. */

.pd-sr {
  --sr-surface: var(--pd-surface-base, #ffffff);
  --sr-raised: var(--pd-surface-interactive, #f4f4f5);
  --sr-ink: var(--pd-text-primary, #18181b);
  --sr-muted: var(--pd-text-secondary, #52525b);
  --sr-line: var(--pd-border, #e4e4e7);
  --sr-gold: #a97b1f;
  --sr-gold-soft: rgba(169, 123, 31, 0.14);
  --sr-up: #1f7a4d;
  --sr-down: #b03030;
  display: grid;
  gap: clamp(1.25rem, 2.4vw, 2.25rem);
  align-content: start;
  min-width: 0;
}

html[data-theme="dark"] .pd-sr {
  --sr-surface: var(--pd-surface-base, #101014);
  --sr-raised: var(--pd-surface-interactive, #17171c);
  --sr-ink: var(--pd-text-primary, #f4f4f5);
  --sr-muted: var(--pd-text-secondary, #a1a1aa);
  --sr-line: var(--pd-border, #2a2a30);
  --sr-gold: #d9b25e;
  --sr-gold-soft: rgba(217, 178, 94, 0.16);
  --sr-up: #5fd39a;
  --sr-down: #f28b8b;
}

.pd-sr a { color: inherit; text-decoration: none; }
.pd-sr :is(a, button, summary):focus-visible { outline: 2px solid var(--pd-focus, #2563eb); outline-offset: 3px; }
.pd-sr p { margin: 0; }

.pd-sr-eyebrow {
  display: inline-block;
  color: var(--sr-muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---- Hero ---------------------------------------------------------------- */

.pd-sr-hero {
  position: relative;
  display: grid;
  gap: 1.5rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(120% 140% at 18% 0%, rgba(217, 178, 94, 0.18), transparent 55%),
    radial-gradient(120% 140% at 85% 100%, rgba(120, 32, 40, 0.28), transparent 60%),
    linear-gradient(150deg, #101014 0%, #17171c 55%, #201a1c 100%);
  color: #f4f4f5;
  overflow: hidden;
}

.pd-sr-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 38px 38px;
  pointer-events: none;
}

.pd-sr-hero > * { position: relative; z-index: 1; }

.pd-sr-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pd-sr-hero .pd-sr-eyebrow { color: rgba(244, 244, 245, 0.7); }

.pd-sr-stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.pd-sr-stamp::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--sr-gold);
  box-shadow: 0 0 0 4px rgba(217, 178, 94, 0.22);
}

.pd-sr-hero-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(0.75rem, 3vw, 2.5rem);
}

.pd-sr-hero-team {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  text-align: center;
}

.pd-sr-hero-team.is-champ .pd-sr-mark { box-shadow: 0 0 0 3px var(--sr-gold), 0 18px 44px rgba(0, 0, 0, 0.45); }

.pd-sr-hero-team strong { font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 900; letter-spacing: -0.02em; }
.pd-sr-hero-team small { color: rgba(244, 244, 245, 0.68); font-size: 0.78rem; font-weight: 700; }

.pd-sr-hero-points {
  font-family: var(--pd-font-display, inherit);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 900;
  line-height: 1;
  color: #fff;
}

.pd-sr-hero-team.is-champ .pd-sr-hero-points { color: var(--sr-gold); }

.pd-sr-hero-mid { display: grid; justify-items: center; gap: 0.2rem; color: rgba(244, 244, 245, 0.55); }
.pd-sr-hero-mid b { font-size: 1.4rem; font-weight: 400; }
.pd-sr-hero-label { font-size: 0.68rem; font-weight: 850; letter-spacing: 0.22em; text-transform: uppercase; }
.pd-sr-hero-mid small { font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; }

.pd-sr-hero-line { max-width: 62ch; color: rgba(244, 244, 245, 0.82); font-size: clamp(0.95rem, 2vw, 1.1rem); line-height: 1.6; }

.pd-sr-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.pd-sr-hero-stats > div {
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.pd-sr-hero-stats dt { color: rgba(244, 244, 245, 0.6); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.pd-sr-hero-stats dd { margin: 0; font-size: 1.4rem; font-weight: 900; }

.pd-sr-mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--pd-sr-team, #3a3f46) 22%, var(--sr-surface));
  border: 1px solid color-mix(in srgb, var(--pd-sr-team, #3a3f46) 45%, var(--sr-line));
}

.pd-sr-mark img { width: 40px; height: 40px; object-fit: contain; }
.pd-sr-mark b {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--sr-ink);
  background: var(--sr-surface);
  border-radius: 5px;
  padding: 0 3px;
  opacity: 0.85;
}

.pd-sr-hero .pd-sr-mark b { color: #f4f4f5; background: #1a1a20; }
.pd-sr-hero .pd-sr-mark { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.16); }

/* ---- Chapter navigation -------------------------------------------------- */

.pd-sr-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  min-width: 0;
  margin: 0 calc(-1 * clamp(0.75rem, 2vw, 1.5rem));
  padding: 0.6rem clamp(0.75rem, 2vw, 1.5rem);
  background: color-mix(in srgb, var(--sr-surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--sr-line);
}

.pd-sr-nav-inner {
  display: flex;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.pd-sr-nav-inner::-webkit-scrollbar { display: none; }

.pd-sr-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--sr-line);
  border-radius: 999px;
  background: var(--sr-raised);
  color: var(--sr-ink);
  font-size: 0.8rem;
  font-weight: 750;
  white-space: nowrap;
}

.pd-sr-nav a small { color: var(--sr-muted); font-size: 0.66rem; font-weight: 900; letter-spacing: 0.08em; }
.pd-sr-nav a:hover { border-color: var(--sr-gold); color: var(--sr-gold); }

/* ---- Chapters ------------------------------------------------------------ */

.pd-sr-chapter {
  display: grid;
  gap: 1rem;
  scroll-margin-top: 84px;
}

.pd-sr-chapter-head { display: grid; gap: 0.35rem; }

.pd-sr-chapter-head h2 {
  margin: 0;
  font-family: var(--pd-font-display, inherit);
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--sr-ink);
}

.pd-sr-prose {
  display: grid;
  gap: 1rem;
  max-width: 78ch;
  color: var(--sr-ink);
  font-size: clamp(0.98rem, 1.6vw, 1.06rem);
  line-height: 1.75;
}

.pd-sr-prose strong { color: var(--sr-ink); font-weight: 800; }
.pd-sr-prose p { color: var(--sr-ink); }

.pd-sr-sub {
  margin: 1.6rem 0 0.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sr-line);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.pd-sr-subsub { margin: 0.6rem 0 0; font-size: 0.95rem; font-weight: 850; }

.pd-sr-list { display: grid; gap: 0.55rem; margin: 0; padding-left: 1.2rem; }
.pd-sr-list li { line-height: 1.6; }
.pd-sr-list code { font-size: 0.82em; background: var(--sr-raised); border: 1px solid var(--sr-line); border-radius: 6px; padding: 0.1rem 0.35rem; overflow-wrap: anywhere; }

/* ---- Team grid ----------------------------------------------------------- */

.pd-sr-grid-wrap {
  display: grid;
  gap: 1rem;
  scroll-margin-top: 84px;
  padding-top: 0.5rem;
  border-top: 2px solid var(--sr-ink);
}

.pd-sr-grid-wrap .pd-sr-chapter-head { padding-top: 0.75rem; }

.pd-sr-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.pd-sr-filters button {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--sr-line);
  border-radius: 999px;
  background: var(--sr-raised);
  color: var(--sr-muted);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.pd-sr-filters button.is-active { background: var(--sr-ink); border-color: var(--sr-ink); color: var(--sr-surface); }

.pd-sr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 0.85rem;
}

.pd-sr-team {
  border: 1px solid var(--sr-line);
  border-radius: 16px;
  background: var(--sr-surface);
  overflow: hidden;
}

.pd-sr-team.is-owner { border-left: 3px solid var(--sr-gold); }
.pd-sr-team[hidden] { display: none; }

.pd-sr-team > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
}

.pd-sr-team > summary::-webkit-details-marker { display: none; }
.pd-sr-team > summary:hover { background: var(--sr-raised); }
.pd-sr-team[open] > summary { border-bottom: 1px solid var(--sr-line); }

.pd-sr-team-id { display: grid; gap: 0.1rem; min-width: 0; }
.pd-sr-team-id strong { font-size: 1rem; font-weight: 850; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-sr-team-id small { color: var(--sr-muted); font-size: 0.74rem; font-weight: 650; }

.pd-sr-team-line { display: grid; justify-items: end; gap: 0.25rem; }
.pd-sr-record { font-size: 1rem; font-weight: 900; letter-spacing: 0.01em; }

.pd-sr-delta { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.pd-sr-delta.is-up { color: var(--sr-up); }
.pd-sr-delta.is-down { color: var(--sr-down); }
.pd-sr-delta.is-flat { color: var(--sr-muted); }

.pd-sr-team-diff {
  display: grid;
  place-items: center;
  min-width: 3.2rem;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  background: var(--sr-raised);
  font-size: 0.85rem;
  font-weight: 900;
}

.pd-sr-team-body { display: grid; gap: 1rem; padding: 1rem; }
.pd-sr-team-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.pd-sr-owner, .pd-sr-cpu {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pd-sr-owner { background: var(--sr-gold-soft); color: var(--sr-gold); }
.pd-sr-cpu { background: var(--sr-raised); color: var(--sr-muted); }
.pd-sr-trend { flex: 1 1 240px; color: var(--sr-muted); font-size: 0.78rem; line-height: 1.5; }

.pd-sr-games { display: grid; gap: 0.35rem; }

.pd-sr-field { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.6rem; font-size: 0.85rem; }
.pd-sr-field span { color: var(--sr-muted); font-weight: 800; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 0.15rem; }

.pd-sr-verdict { display: grid; gap: 0.65rem; }

.pd-sr-mirror {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--sr-line);
  border-radius: 12px;
  background: var(--sr-raised);
}

.pd-sr-mirror.is-mirror { border-color: color-mix(in srgb, var(--sr-gold) 45%, var(--sr-line)); background: var(--sr-gold-soft); }
.pd-sr-mirror h4 { margin: 0 0 0.3rem; font-size: 0.7rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sr-muted); }
.pd-sr-mirror.is-mirror h4 { color: var(--sr-gold); }
.pd-sr-mirror p { font-size: 0.88rem; line-height: 1.65; }

.pd-sr-production { display: grid; gap: 0.5rem; }
.pd-sr-production h4 { margin: 0; font-size: 0.7rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sr-muted); }
.pd-sr-top { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.pd-sr-top li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.1rem 0.6rem; font-size: 0.83rem; }
.pd-sr-top li b { font-weight: 800; }
.pd-sr-top li span { color: var(--sr-muted); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; }
.pd-sr-top li em { grid-column: 1 / -1; color: var(--sr-muted); font-size: 0.76rem; font-style: normal; }

.pd-sr-mvp { display: grid; gap: 0.1rem; padding: 0.65rem 0.75rem; border: 1px dashed var(--sr-line); border-radius: 12px; font-size: 0.83rem; }
.pd-sr-mvp span { color: var(--sr-muted); font-size: 0.66rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.pd-sr-mvp b { font-weight: 850; }
.pd-sr-mvp em { color: var(--sr-muted); font-style: normal; font-size: 0.76rem; }

/* ---- Honors -------------------------------------------------------------- */

.pd-sr-honors { display: grid; gap: 1rem; scroll-margin-top: 84px; }

.pd-sr-honor-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 0.7rem;
}

.pd-sr-honor {
  display: grid;
  justify-items: start;
  gap: 0.4rem;
  padding: 0.9rem;
  border: 1px solid var(--sr-line);
  border-radius: 14px;
  background: var(--sr-surface);
}

.pd-sr-honor-key { color: var(--sr-gold); font-size: 0.66rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.pd-sr-honor strong { font-size: 0.95rem; font-weight: 850; line-height: 1.25; }
.pd-sr-honor em { color: var(--sr-muted); font-size: 0.75rem; font-style: normal; line-height: 1.5; }
.pd-sr-honor-note { color: var(--sr-muted); font-size: 0.78rem; line-height: 1.6; }

/* ---- Economy ------------------------------------------------------------- */

.pd-sr-economy { display: grid; gap: 1rem; scroll-margin-top: 84px; }

.pd-sr-economy-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0;
}

.pd-sr-economy-stats > div { display: grid; gap: 0.1rem; padding: 0.75rem 0.85rem; border: 1px solid var(--sr-line); border-radius: 12px; background: var(--sr-raised); }
.pd-sr-economy-stats dt { color: var(--sr-muted); font-size: 0.64rem; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.pd-sr-economy-stats dd { margin: 0; font-size: 1.35rem; font-weight: 900; }

.pd-sr-economy-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1rem; }
.pd-sr-lanes, .pd-sr-owners { padding: 1rem; border: 1px solid var(--sr-line); border-radius: 16px; background: var(--sr-surface); }
.pd-sr-lanes h3, .pd-sr-owners h3 { margin: 0 0 0.75rem; font-size: 0.78rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sr-muted); }

.pd-sr-lanes ul { display: grid; gap: 0.55rem; margin: 0; padding: 0; list-style: none; }
.pd-sr-lanes li { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 2.2rem; align-items: center; gap: 0.6rem; font-size: 0.8rem; }
.pd-sr-lane-label { font-weight: 750; }
.pd-sr-lane-track { height: 0.55rem; border-radius: 999px; background: var(--sr-raised); border: 1px solid var(--sr-line); overflow: hidden; }
.pd-sr-lane-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--sr-gold), color-mix(in srgb, var(--sr-gold) 55%, #e0512c)); }
.pd-sr-lanes li b { text-align: right; font-weight: 900; }
.pd-sr-lane-note { margin-top: 0.75rem; color: var(--sr-muted); font-size: 0.74rem; }

.pd-sr-owners table { width: 100%; border-collapse: collapse; }
.pd-sr-owners td { padding: 0.42rem 0.35rem; border-bottom: 1px solid var(--sr-line); font-size: 0.83rem; vertical-align: middle; }
.pd-sr-owners td:first-child { display: grid; }
.pd-sr-owners td:first-child small { color: var(--sr-muted); font-size: 0.7rem; }
.pd-sr-owners td:last-child { text-align: right; font-weight: 850; white-space: nowrap; }
.pd-sr-owner-bar { display: block; height: 0.5rem; border-radius: 999px; background: var(--sr-raised); border: 1px solid var(--sr-line); overflow: hidden; min-width: 4rem; }
.pd-sr-owner-bar i { display: block; height: 100%; background: var(--sr-gold); }

/* ---- States -------------------------------------------------------------- */

.pd-sr-loading, .pd-sr-fail {
  display: grid;
  place-items: center;
  gap: 0.75rem;
  padding: 4rem 1.5rem;
  border: 1px solid var(--sr-line);
  border-radius: 20px;
  background: var(--sr-surface);
  text-align: center;
}

.pd-sr-fail h2 { margin: 0; font-size: 1.3rem; }
.pd-sr-fail p { color: var(--sr-muted); max-width: 48ch; }

/* ---- Responsive ---------------------------------------------------------- */

@media (max-width: 900px) {
  .pd-sr-economy-grid { grid-template-columns: minmax(0, 1fr); }
  .pd-sr-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-sr-economy-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .pd-sr-hero-score { grid-template-columns: 1fr; justify-items: stretch; text-align: center; }
  .pd-sr-hero-mid b { display: none; }
  .pd-sr-hero-team { padding: 0.5rem 0; }
  .pd-sr-team > summary { grid-template-columns: auto minmax(0, 1fr) auto; }
  .pd-sr-team-diff { display: none; }
  .pd-sr-field { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .pd-sr-lanes li { grid-template-columns: 6rem minmax(0, 1fr) 2rem; }
  .pd-sr-prose { font-size: 0.96rem; }
}
