/* 5.2 — quiet surfaces, selective depth and the established 5.1 spacing. */
/* The main context gets one soft shadow. Repeated content stays visually flat. */
html:root:root[data-theme="dark"] :is(.board.overall, .athlete-summary, .directory-tools) {
  background: linear-gradient(145deg, #22212d, #1b1c26 80%);
  border-color: #cfc0ed29;
  box-shadow: 0 12px 28px -20px #0009;
}
html:root:root[data-theme="dark"] .athlete-summary {
  border-color: #c3a4f039;
}
html:root:root[data-theme="dark"] :is(.board:not(.overall), .complex, .catalogue-complex,
  .swlp-board, .pi-panel, .analytics-filters, .a31-disclosure, .game-card:not(.is-hottest)) {
  background: #1b1c26;
  border-color: #cfc0ed20;
  box-shadow: none;
}
html:root:root[data-theme="dark"] #analyticsRoot :is(.analytics-panel, .a31-priorities, .a31-squad-panel, .a31-stats article) {
  background: #1b1c26; border-color: #cfc0ed20; box-shadow: none;
}
html:root:root[data-theme="dark"] #analyticsRoot .a31-priorities {
  border-color: #c3a4f039;
  box-shadow: 0 12px 28px -20px #0009;
}
html:root:root[data-theme="dark"] #analyticsRoot .a31-disclosure-content > .analytics-panel {
  background: transparent; border: 0; box-shadow: none;
}
/* The original header padding and margins stay in charge; no raised plates. */
html:root:root[data-theme="dark"] :is(.complex-head, .catalogue-complex-head, .swlp-board-head) {
  border-bottom-color: #cfc0ed18;
}
html:root:root[data-theme="dark"] :is(.directory-card, .rank-row:not(.medal), .gymnast, .swlp-row, .challenge-row):not(.challenge-winner) {
  background: #ffffff03;
  border-color: #cfc0ed20;
  box-shadow: none;
}
html:root:root[data-theme="dark"] .swlp-row.swlp-selected {
  background: #bd9bff0b; border-color: #c5a4ff70;
}
html:root:root[data-theme="dark"] .pb-card { box-shadow: none; }
@media (hover:hover) {
  html:root:root[data-theme="dark"] :is(.directory-card, .rank-row:not(.medal), .game-card:not(.is-hottest)):hover {
    border-color: #bd9bff60;
    box-shadow: none;
  }
}

/* Due dates do not recolour skill cards, ticks or the days text. */
html:root:root[data-theme="dark"] :is(.renewal-date, .directory-quick-days, .due-badge) { color: var(--muted); }
html:root:root[data-theme="dark"] :is(.skill-renewal button, .directory-quick-renew) {
  color: #d2c7e1; border-color: #bca2db50; background: #b89bdd10;
  box-shadow: inset 0 1px #ead7ff0c;
}
html:root:root[data-theme="dark"] :is(.skill-renewal button, .directory-quick-renew)[data-renewal-urgency="due"] {
  color: #ffc58c; border-color: #f9a95688; background: #e58b2820;
}
html:root:root[data-theme="dark"] :is(.skill-renewal button, .directory-quick-renew)[data-renewal-urgency="final"] {
  color: #ffb6b6; border-color: #ff747c99; background: #ec536224;
}
html:root:root[data-theme="dark"] [data-renewal-urgency]:disabled { opacity: .75; }

/* Streak classes intentionally do not use the legacy full-card fire styling. */
html:root .is-on-streak :is(.score > b, .directory-points > b, #athletePoints,
  .gymnast-score, .swlp-row-score > strong, .challenge-points b, .a31-standing-value) {
  color: #ffc08f;
  text-shadow: 0 0 7px #ff702d55, 0 0 17px #ff441d33;
  animation: v52-score-embers 5.8s ease-in-out infinite;
}
html:root .is-on-streak:nth-child(2n) :is(.score > b, .directory-points > b, .swlp-row-score > strong, .challenge-points b, .a31-standing-value) { animation-delay: -2.4s; }
html:root .streak-label {
  display: inline; color: #f5af87; font-family: var(--font-body, "Plus Jakarta Sans", sans-serif);
  font-size: inherit; font-weight: 650; letter-spacing: .01em; line-height: inherit;
  text-transform: none; white-space: nowrap; text-shadow: none; animation: none;
}
html:root #athletePointCaption .streak-label { font-size: 9px; }
@keyframes v52-score-embers {
  0%,100% { color: #ffc08f; text-shadow: 0 0 6px #ff702d50, 0 0 14px #ff441d22; }
  43% { color: #ffd0a8; text-shadow: 0 0 9px #ff702d85, 0 0 19px #ff441d44; }
  74% { color: #ffbb91; text-shadow: 0 0 7px #ff702d60, 0 0 15px #ff441d2b; }
}
html:root body.no-motion .is-on-streak :is(.score > b, .directory-points > b, #athletePoints, .gymnast-score, .swlp-row-score > strong, .challenge-points b, .a31-standing-value),
html:root [data-placement-motion="off"] .is-on-streak :is(.swlp-row-score > strong) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  html:root .is-on-streak :is(.score > b, .directory-points > b, #athletePoints, .gymnast-score, .swlp-row-score > strong, .challenge-points b, .a31-standing-value) { animation: none; }
}
