/* SiteTheme.cs owns the palette. Custom components consume these semantic aliases.
   Keep layout-specific rules with their components; share visual roles here. */
:root {
    color-scheme: light;
    --cc-ink: var(--mud-palette-text-primary);
    --cc-muted: var(--mud-palette-text-secondary);
    --cc-green: var(--mud-palette-primary);
    --cc-green-dark: var(--mud-palette-appbar-background);
    --cc-red: var(--mud-palette-secondary);
    --cc-line: var(--mud-palette-lines-default);
    --cc-page: var(--mud-palette-background);
    --cc-surface: var(--mud-palette-surface);
    --cc-surface-muted: var(--mud-palette-background-gray);
    --cc-primary-contrast: var(--mud-palette-primary-text);
    --cc-success: var(--mud-palette-success);
    --cc-info: var(--mud-palette-info);
    --cc-warning: var(--mud-palette-warning);
    --cc-danger: var(--mud-palette-error);
    --cc-accent-soft: color-mix(in srgb, var(--cc-green) 10%, var(--cc-surface));
    --cc-success-soft: color-mix(in srgb, var(--cc-success) 10%, var(--cc-surface));
    --cc-info-soft: color-mix(in srgb, var(--cc-info) 10%, var(--cc-surface));
    --cc-warning-soft: color-mix(in srgb, var(--cc-warning) 10%, var(--cc-surface));
    --cc-danger-soft: color-mix(in srgb, var(--cc-danger) 10%, var(--cc-surface));
    --cc-accent-line: color-mix(in srgb, var(--cc-green) 45%, var(--cc-line));
    --cc-hover: var(--mud-palette-action-default-hover);
    --cc-panel-radius: 6px;
    --cc-purple: #6c4e82;
    --cc-purple-soft: color-mix(in srgb, var(--cc-purple) 10%, var(--cc-surface));
    --cc-podium-gold: #946600;
    --cc-podium-silver: #606d7d;
    --cc-podium-bronze: #985a32;
    /* Fixed brand/image treatments intentionally retain their contrast in either mode. */
    --cc-on-brand: #ffffff;
    --cc-brand-coral: #ff6d62;
    --cc-brand-gold: #f6c65b;
    --cc-artwork-background: #101027;
    --cc-community-art: #6c4e82;
    --cc-organizer-art: #276178;
    --cc-error-banner: #9c2721;
    --cc-nav-muted: color-mix(in srgb, var(--mud-palette-drawer-text) 80%, var(--mud-palette-drawer-background));
    --cc-nav-chip: color-mix(in srgb, var(--mud-palette-drawer-text) 18%, var(--mud-palette-drawer-background));
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --cc-purple: #cfafe7;
    --cc-podium-gold: #f0ce7a;
    --cc-podium-silver: #c0cddd;
    --cc-podium-bronze: #e5ae87;
}

/* A single surface treatment shared by public discovery, account and admin cards. */
.event-card, .search-surface, .home-community-card, .catalog-card, .public-server-card,
.admin-link-card, .admin-toolbar, .admin-table, .form-section, .review-record,
.server-card, .choice-card, .choice-row, .organizer-game-card, .managed-organizer-card,
.organizer-news-empty, .news-management-item, .interest-list-empty,
.recommendation-generator, .merge-search-pane, .merge-group-panel, .merge-review,
.analytics-metric-card, .game-directory-card {
    border: 1px solid var(--cc-line);
    background: var(--cc-surface);
}

.theme-toggle {
    display: inline-grid; place-items: center; flex: 0 0 44px;
    width: 44px; height: 44px; margin-inline: .25rem;
    border: 0; border-radius: 50%; background: transparent;
    color: inherit; cursor: pointer;
}
.theme-toggle:hover { background: rgba(255, 255, 255, .12); }
.theme-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.theme-toggle span { display: inline-flex; }
.theme-toggle .theme-icon-light, :root[data-theme="dark"] .theme-toggle .theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-icon-light { display: inline-flex; }
