/* Public reading layer. Preserve the authored card/media art and semantic
 * team colours; organizer tools deliberately do not receive this body marker. */
body[data-public-presentation] {
  --palette-reading: var(--surface);
}

/* Small labels need the same predictable ground as the headline. These
 * tokens are scoped to the body so both palette choices remain independent. */
:root[data-theme=light] body[data-public-presentation],
:root[data-theme=auto] body[data-public-presentation] {
  --muted: #4b5d70;
  --line: #bccbd8;
  --gold: #806022;
  --blue: #215f95;
  --red: #a93b51;
  --presentation-shadow: 0 3px 14px #23374a12;
}
:root[data-palette=crimson][data-theme=light] body[data-public-presentation],
:root[data-palette=crimson][data-theme=auto] body[data-public-presentation] {
  --muted: #594447;
  --line: #b9a17f;
  --gold: var(--palette-gold);
  --palette-placeholder: #65504e;
  --presentation-shadow: 0 3px 14px #54272715;
}
:root[data-theme=dark] body[data-public-presentation] {
  --muted: #c2bdc7;
  --line: #5d5662;
  --gold: #d7b875;
  --presentation-shadow: 0 4px 18px #00000036;
}
:root[data-palette=crimson][data-theme=dark] body[data-public-presentation] {
  --muted: #d5c4c8;
  --line: #78604c;
  --gold: var(--palette-gold);
}
@media (prefers-color-scheme:dark) {
  :root[data-theme=auto] body[data-public-presentation] {
    --muted: #c2bdc7;
    --line: #5d5662;
    --gold: #d7b875;
    --blue: #7bcaff;
    --red: #ff8c9c;
    --presentation-shadow: 0 4px 18px #00000036;
  }
  :root[data-palette=crimson][data-theme=auto] body[data-public-presentation] {
    --muted: #d5c4c8;
    --line: #78604c;
  --gold: var(--palette-gold);
  }
}

/* Keep the setting visible between content areas without letting the castle
 * compete with small labels. Night scenery retains its current treatment. */
:root[data-palette=crimson][data-theme=light] body[data-public-presentation] .site-scenery,
:root[data-palette=crimson][data-theme=auto] body[data-public-presentation] .site-scenery {
  opacity: .52;
}
:root[data-palette=crimson][data-theme=light] body[data-public-presentation] .embed-scenery,
:root[data-palette=crimson][data-theme=auto] body[data-public-presentation] .embed-scenery {
  opacity: .6;
}
@media (prefers-color-scheme:dark) {
  :root[data-palette=crimson][data-theme=auto] body[data-public-presentation] :is(.site-scenery,.embed-scenery) {
    opacity: 1;
  }
}

/* Opaque reading surfaces, including the compact iframe. Do not select
 * artwork, player cards, live covers, or any Swiss graph geometry here. */
:root[data-palette][data-theme] body[data-public-presentation] :is(.embed-section,.embed-table-scroll,.dossier-abilities,.profile-event-summary,.profile-hero-picks,.profile-rating-entry) {
  background-color: var(--surface);
  border-color: var(--line);
  box-shadow: var(--presentation-shadow);
}
:root[data-palette][data-theme] body[data-public-presentation] :is(.embed-catalog>.panel,.embed-builder>.panel,.live-view-tools,.live-view-card) {
  border-color: var(--line);
  box-shadow: var(--presentation-shadow);
}
/* Keep status and role borders distinct from the card's neutral frame. */
:root[data-palette][data-theme] body[data-public-presentation] .live-view-card.is-live {
  border-color: color-mix(in srgb,var(--win) 65%,var(--line));
}
:root[data-palette][data-theme] body[data-public-presentation] .live-view-group[data-live-group=main] .live-view-card {
  border-top-color: var(--palette-gold,var(--gold));
}
:root[data-palette][data-theme] body[data-public-presentation] .live-view-group[data-live-group=guest] .live-view-card {
  border-top-color: #8093d0;
}

/* These navigation/metadata rows previously sat directly on the scene. */
:root[data-palette][data-theme] body[data-public-presentation] .embed-catalog>.page-heading {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--presentation-shadow);
}
:root[data-palette][data-theme] body[data-public-presentation] .profile-history-tabs {
  padding-inline: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
:root[data-palette][data-theme] body[data-public-presentation] .br-report-tools {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
:root[data-palette][data-theme] body[data-public-presentation] :is(.br-game-heading>div,.live-filter-count:not(:empty)) {
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
}
body[data-public-presentation] :is(.br-player-stats dd,.br-chart-value,.br-performance-score strong) {
  font-weight: 650;
}
body[data-public-presentation] .br-kda i { opacity: 1; }
body[data-public-presentation] .br-player-stats dt,
body[data-public-presentation] .br-performance-score small { font-size: 11px; }

/* Preview mode has its own light-on-cover status colours; only adjust the
 * overview, where the state sits on a light/dark reading surface. */
:root[data-theme=light] body[data-public-presentation] .live-center:not([data-live-mode=preview]) .live-view-name .live-state[data-live-state=live] {
  color: #176c50;
}
:root[data-theme=light] body[data-public-presentation] .live-center:not([data-live-mode=preview]) .live-view-name .live-state[data-live-state=loop] {
  color: #806022;
}
:root[data-theme=light] body[data-public-presentation] .live-center:not([data-live-mode=preview]) .live-view-name .live-state:is([data-live-state=unknown],[data-live-state=offline]) {
  color: var(--muted);
}
@media (max-width:600px) {
  :root[data-palette][data-theme] body[data-public-presentation] .embed-catalog>.page-heading { padding: 12px; }
  :root[data-palette][data-theme] body[data-public-presentation] .br-report-tools { flex-wrap: wrap; }
}
@media (forced-colors:active) {
  :root[data-palette][data-theme] body[data-public-presentation] { --muted: CanvasText; --line: CanvasText; }
  :root[data-palette][data-theme] body[data-public-presentation] :is(.embed-section,.embed-table-scroll,.dossier-abilities,.profile-event-summary,.profile-hero-picks,.profile-rating-entry,.embed-catalog>.page-heading,.profile-history-tabs,.br-report-tools,.br-game-heading>div,.live-filter-count:not(:empty)) {
    background: Canvas;
    color: CanvasText;
    box-shadow: none;
  }
}
