/*
 * Premium shell for every non-home front page.
 *
 * Homepage already owns this visual language through home-premium.css. These
 * rules carry the same midnight glass, mist, and restrained gold accents to
 * functional pages without changing their markup or interactions.
 */

body.site-app:not(.home-premium-page) {
    --premium-bg: #101a33;
    --premium-surface: #172642;
    --premium-surface-low: #203253;
    --premium-text: #fef7ff;
    --premium-muted: #c4cede;
    --premium-accent: #ff9d45;
    --premium-accent-deep: #e87924;
    --premium-violet: #8c80f6;
    --premium-gold: #f6d88b;
    --premium-border: rgba(255, 255, 255, 0.11);
    --premium-border-strong: rgba(255, 255, 255, 0.19);
    --premium-shadow: 0 20px 50px -15px rgba(4, 11, 27, 0.46);

    --relaxed-bg: var(--premium-bg);
    --relaxed-surface: rgba(20, 34, 60, 0.9);
    --relaxed-surface-soft: rgba(31, 47, 79, 0.92);
    --relaxed-text: var(--premium-text);
    --relaxed-muted: var(--premium-muted);
    --relaxed-primary: var(--premium-accent);
    --relaxed-primary-dark: #ffb36f;
    --relaxed-accent: #8fdad1;
    --relaxed-border: var(--premium-border);
    --relaxed-shadow: var(--premium-shadow);

    --front-readable-surface: rgba(20, 34, 60, 0.9);
    --front-readable-surface-soft: rgba(31, 47, 79, 0.94);
    --front-readable-text: var(--premium-text);
    --front-readable-muted: var(--premium-muted);
    --front-readable-warning: var(--premium-gold);
    --front-readable-action: #bdc7ff;
    --front-readable-border: var(--premium-border-strong);
    --front-readable-shadow: var(--premium-shadow);

    color: var(--premium-text);
    background:
        radial-gradient(circle at 8% 7%, rgba(111, 129, 190, 0.31) 0, transparent 32rem),
        radial-gradient(circle at 94% 17%, rgba(255, 178, 111, 0.14) 0, transparent 30rem),
        radial-gradient(circle at 48% 76%, rgba(58, 119, 164, 0.27) 0, transparent 36rem),
        var(--premium-bg) !important;
    background-color: var(--premium-bg) !important;
}

body.site-app:not(.home-premium-page)::before {
    background:
        radial-gradient(42% 36% at 16% 24%, rgba(85, 108, 183, 0.34) 0%, rgba(85, 108, 183, 0) 75%),
        radial-gradient(40% 35% at 84% 18%, rgba(80, 157, 197, 0.2) 0%, rgba(80, 157, 197, 0) 74%),
        radial-gradient(36% 34% at 50% 86%, rgba(255, 157, 69, 0.13) 0%, rgba(255, 157, 69, 0) 73%);
    opacity: 0.58;
}

body.site-app:not(.home-premium-page)::after {
    opacity: 0.22;
}

body.site-app:not(.home-premium-page) .relaxed-navbar {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: rgba(16, 27, 50, 0.9);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

body.site-app:not(.home-premium-page) .relaxed-navbar :is(
    .brand-title,
    .navbar-brand,
    .nav-link
) {
    color: rgba(254, 247, 255, 0.9);
}

body.site-app:not(.home-premium-page) .relaxed-navbar .nav-link:hover,
body.site-app:not(.home-premium-page) .relaxed-navbar .nav-link:focus,
body.site-app:not(.home-premium-page) .relaxed-navbar .nav-link.show {
    color: #ffffff;
    background: rgba(140, 128, 246, 0.19);
}

body.site-app:not(.home-premium-page) .relaxed-navbar .dropdown-menu {
    color: var(--premium-text);
    border-color: var(--premium-border-strong);
    background: rgba(9, 20, 38, 0.97);
    box-shadow: var(--premium-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

body.site-app:not(.home-premium-page) .relaxed-navbar .dropdown-item {
    color: rgba(254, 247, 255, 0.84);
}

body.site-app:not(.home-premium-page) .relaxed-navbar .dropdown-item:hover,
body.site-app:not(.home-premium-page) .relaxed-navbar .dropdown-item:focus {
    color: #ffffff;
    background: rgba(140, 128, 246, 0.19);
}

/* Existing light functional cards become the same navy glass used on home. */
body.site-app:not(.home-premium-page) :is(
    .hero-panel,
    .quote-card,
    .rule-card,
    .photo-highlight,
    .photo-category-list,
    .guild-calendar-card,
    .guild-feature-card,
    .ig-feed-card,
    .home-announcement-card,
    .mainland-news-card,
    .official-news-card,
    .relaxed-video-card,
    .video-category-wrapper,
    .home-filter-bar,
    .bounty-card,
    .bounty-item,
    .lottery-hero,
    .lottery-event-card,
    .lottery-history-card,
    .history-intro-card,
    .history-card,
    .modal-content,
    .offcanvas,
    .list-group-item,
    .card:not(.bg-dark):not([class*="text-bg-"]),
    .feedback-card,
    .relationship-card,
    .relationship-hero,
    .relationship-radial-card,
    .relationship-radial-wrap,
    .relationship-radial-center,
    .relationship-radial-node,
    .dragon-tiger-hero,
    .dragon-tiger-role-hero,
    .dragon-tiger-role-card,
    .dragon-tiger-card,
    .dragon-tiger-registration-timeline,
    .dragon-tiger-registration-timeline-row,
    .gameplay-hero,
    .gameplay-card,
    .gameplay-detail-card,
    .gameplay-nav-card,
    .gameplay-related-item,
    .guild-members-hero,
    .guild-members-search,
    .guild-member-card,
    .member-show-info,
    .officer-intro-hero,
    .officer-intro-card,
    .officer-intro-role-check,
    .officer-intro-participant,
    .officer-intro-club-filter,
    .officer-intro-demand-participant,
    .officer-intro-club-pane,
    .officer-intro-selected-teammate,
    .support-panel,
    .mbti-compat-hero,
    .mbti-map-toggle-card,
    .mbti-compat-shell,
    .mbti-compat-hint,
    .mbti-compat-detail-card,
    .mbti-compat-ranking-card,
    .tournament-overview-panel,
    .entry-image-editor-left,
    .entry-image-editor-right,
    .entry-image-editor-choice,
    .entry-image-editor-hint,
    .entry-image-editor-panel,
    .member-media-card,
    .member-upload-file-item,
    .member-notification-hero,
    .member-notification-card,
    .member-notification-item,
    .member-showcase-card,
    .member-record-hero,
    .member-record-card,
    .member-record-stat,
    .member-task-item,
    .member-reward-hero,
    .member-reward-card,
    .member-reward-item,
    .game-portal-card,
    .lottery-result-box,
    .bg-white,
    .bg-light,
    .bg-light-subtle
) {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: linear-gradient(145deg, rgba(31, 48, 82, 0.9), rgba(12, 25, 51, 0.92)) !important;
    box-shadow: var(--premium-shadow) !important;
    backdrop-filter: blur(16px) saturate(1.08);
    -webkit-backdrop-filter: blur(16px) saturate(1.08);
}

body.site-app:not(.home-premium-page) .main-shell :is(
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    .section-title,
    .card-title,
    .rule-title,
    .modal-title,
    .offcanvas-title
) {
    color: var(--premium-text) !important;
}

body.site-app:not(.home-premium-page) .main-shell :is(
    .text-muted,
    .text-secondary,
    .section-subtitle,
    .card-text,
    .form-text,
    .page-lead,
    .member-notification-meta,
    .relationship-radial-empty,
    .officer-intro-section-meta,
    .officer-intro-editor-org,
    .game-portal-card small,
    .gameplay-nav-label,
    .message-time
) {
    color: var(--premium-muted) !important;
    opacity: 1 !important;
}

body.site-app:not(.home-premium-page) :is(
    .form-control,
    .form-select,
    textarea,
    select
) {
    color: var(--premium-text) !important;
    border-color: rgba(188, 204, 255, 0.38) !important;
    background-color: rgba(7, 18, 39, 0.64) !important;
}

body.site-app:not(.home-premium-page) :is(
    .form-control,
    .form-select,
    textarea,
    select
)::placeholder {
    color: rgba(207, 218, 239, 0.72) !important;
}

body.site-app:not(.home-premium-page) :is(
    .form-control,
    .form-select,
    textarea,
    select
):focus {
    color: var(--premium-text) !important;
    border-color: rgba(167, 158, 255, 0.92) !important;
    background-color: rgba(7, 18, 39, 0.84) !important;
    box-shadow: 0 0 0 0.22rem rgba(140, 128, 246, 0.24) !important;
}

body.site-app:not(.home-premium-page) :is(
    .form-control:disabled,
    .form-select:disabled,
    textarea:disabled,
    select:disabled
) {
    color: rgba(207, 218, 239, 0.62) !important;
    background-color: rgba(42, 56, 84, 0.72) !important;
}

body.site-app:not(.home-premium-page) :is(
    .btn-outline-primary,
    .page-link
) {
    color: var(--front-readable-action) !important;
    border-color: rgba(189, 199, 255, 0.7) !important;
    background: rgba(140, 128, 246, 0.08);
}

body.site-app:not(.home-premium-page) :is(
    .btn-outline-primary,
    .page-link
):hover,
body.site-app:not(.home-premium-page) :is(
    .btn-outline-primary,
    .page-link
):focus-visible {
    color: #ffffff !important;
    border-color: rgba(189, 199, 255, 0.95) !important;
    background: rgba(140, 128, 246, 0.28);
}

body.site-app:not(.home-premium-page) .text-warning {
    color: var(--premium-gold) !important;
}

body.site-app:not(.home-premium-page) :is(
    .table,
    .table > :not(caption) > * > *
) {
    --bs-table-color: var(--premium-text);
    --bs-table-bg: transparent;
    --bs-table-striped-color: var(--premium-text);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.045);
    --bs-table-hover-color: #ffffff;
    --bs-table-hover-bg: rgba(140, 128, 246, 0.14);
    color: var(--premium-text) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Pagination, tabs, dropdowns, and every overlay share the same glass layer. */
body.site-app:not(.home-premium-page) .pagination {
    --bs-pagination-color: #c8d1ff;
    --bs-pagination-bg: rgba(14, 28, 55, 0.88);
    --bs-pagination-border-color: rgba(189, 199, 255, 0.24);
    --bs-pagination-hover-color: #ffffff;
    --bs-pagination-hover-bg: rgba(140, 128, 246, 0.26);
    --bs-pagination-hover-border-color: rgba(189, 199, 255, 0.72);
    --bs-pagination-focus-color: #ffffff;
    --bs-pagination-focus-bg: rgba(140, 128, 246, 0.3);
    --bs-pagination-focus-box-shadow: 0 0 0 0.22rem rgba(140, 128, 246, 0.24);
    --bs-pagination-active-color: #ffffff;
    --bs-pagination-active-bg: #7167d9;
    --bs-pagination-active-border-color: #a89ff8;
    --bs-pagination-disabled-color: rgba(196, 206, 222, 0.56);
    --bs-pagination-disabled-bg: rgba(14, 28, 55, 0.52);
    --bs-pagination-disabled-border-color: rgba(189, 199, 255, 0.14);
}

body.site-app:not(.home-premium-page) :is(
    .nav-tabs,
    .nav-pills
) {
    --bs-nav-tabs-border-color: rgba(189, 199, 255, 0.22);
    --bs-nav-tabs-link-hover-border-color: rgba(189, 199, 255, 0.34);
    --bs-nav-tabs-link-active-color: #ffffff;
    --bs-nav-tabs-link-active-bg: rgba(113, 103, 217, 0.46);
    --bs-nav-tabs-link-active-border-color: rgba(189, 199, 255, 0.66);
    --bs-nav-pills-link-active-color: #ffffff;
    --bs-nav-pills-link-active-bg: #7167d9;
}

body.site-app:not(.home-premium-page) :is(
    .nav-tabs .nav-link,
    .nav-pills .nav-link
) {
    color: var(--premium-muted);
}

body.site-app:not(.home-premium-page) :is(
    .nav-tabs .nav-link:hover,
    .nav-tabs .nav-link:focus,
    .nav-pills .nav-link:hover,
    .nav-pills .nav-link:focus
) {
    color: #ffffff;
    background: rgba(140, 128, 246, 0.16);
}

body.site-app:not(.home-premium-page) :is(
    .modal-content,
    .offcanvas,
    .popover,
    .toast,
    .dropdown-menu,
    .accordion-item,
    .front-support-assistant-msg.bot,
    .front-support-assistant-msg.user,
    .swal2-popup
) {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: linear-gradient(145deg, rgba(30, 47, 81, 0.98), rgba(9, 20, 40, 0.99)) !important;
    box-shadow: var(--premium-shadow) !important;
}

body.site-app:not(.home-premium-page) :is(
    .modal-header,
    .modal-footer,
    .offcanvas-header,
    .toast-header,
    .accordion-button
) {
    color: var(--premium-text) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    background: rgba(255, 255, 255, 0.035) !important;
}

body.site-app:not(.home-premium-page) :is(
    .accordion-button:not(.collapsed),
    .accordion-button:focus
) {
    color: #ffffff !important;
    background: rgba(140, 128, 246, 0.22) !important;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08), 0 0 0 0.2rem rgba(140, 128, 246, 0.16) !important;
}

body.site-app:not(.home-premium-page) :is(
    .modal-content,
    .offcanvas,
    .popover,
    .toast,
    .dropdown-menu,
    .swal2-popup
) :is(
    .text-muted,
    .text-secondary,
    .small
) {
    color: var(--premium-muted) !important;
}

body.site-app:not(.home-premium-page) :is(
    .btn-close,
    .popover-header .btn-close,
    .toast-header .btn-close
) {
    filter: invert(1) grayscale(1) brightness(1.75);
}

body.site-app:not(.home-premium-page) :is(
    .modal-backdrop,
    .offcanvas-backdrop
) {
    background-color: #050c1d;
}

body.site-app:not(.home-premium-page) .front-support-assistant-msg.user {
    background: linear-gradient(135deg, rgba(113, 103, 217, 0.88), rgba(85, 76, 181, 0.9)) !important;
}

body.site-app:not(.home-premium-page) .front-support-assistant-body {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: rgba(6, 16, 34, 0.72) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.site-app:not(.home-premium-page) .alert {
    color: var(--premium-text) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    background: rgba(255, 255, 255, 0.07) !important;
}

body.site-app:not(.home-premium-page) .alert-warning {
    color: #fff0c7 !important;
    border-color: rgba(246, 216, 139, 0.44) !important;
    background: rgba(246, 216, 139, 0.14) !important;
}

body.site-app:not(.home-premium-page) .alert-danger {
    color: #ffd6dd !important;
    border-color: rgba(255, 133, 154, 0.42) !important;
    background: rgba(185, 48, 77, 0.2) !important;
}

/* Page-specific modules ship their own later light rules; keep their inner
 * panels inside the shared midnight-glass system as well. */
body.site-app:not(.home-premium-page) :is(
    .mbti-compat-toolbar,
    .mbti-compat-radial-wrap,
    .mbti-compat-tooltip,
    .mbti-member-preview,
    .mbti-member-persona,
    .mbti-detail-pane,
    .mbti-compat-detail-empty,
    .mbti-vga-loader
) {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: linear-gradient(145deg, rgba(31, 48, 82, 0.94), rgba(10, 23, 48, 0.96)) !important;
    box-shadow: var(--premium-shadow) !important;
}

body.site-app:not(.home-premium-page) :is(
    .mbti-compat-toolbar,
    .mbti-compat-radial-wrap,
    .mbti-compat-tooltip,
    .mbti-member-preview,
    .mbti-member-persona,
    .mbti-detail-pane,
    .mbti-compat-detail-empty
) :is(
    .mbti-member-preview-name,
    .mbti-member-preview-meta,
    .mbti-member-preview-summary,
    .mbti-member-persona-title,
    .mbti-member-persona-body,
    .mbti-compat-dimension-list
) {
    color: var(--premium-muted) !important;
}

body.site-app:not(.home-premium-page) :is(
    .mbti-persona-tab,
    .mbti-detail-tab,
    .mbti-member-preview-type,
    .mbti-member-preview-link
) {
    color: #f5dcaa !important;
    border-color: rgba(246, 216, 139, 0.42) !important;
    background: rgba(246, 216, 139, 0.12) !important;
}

body.site-app:not(.home-premium-page) :is(
    .mbti-persona-tab.is-active,
    .mbti-detail-tab.is-active
) {
    color: #ffffff !important;
    border-color: rgba(189, 199, 255, 0.74) !important;
    background: #7167d9 !important;
}

body.site-app:not(.home-premium-page) :is(
    .mbti-compat-table-row:hover,
    .mbti-compat-table-row.is-active
) {
    background: rgba(140, 128, 246, 0.16) !important;
}

body.site-app:not(.home-premium-page) :is(
    .dragon-tiger-leave-panel,
    .dragon-tiger-empty,
    .dragon-tiger-registration-timeline,
    .dragon-tiger-registration-timeline-row,
    .dragon-tiger-session-pill,
    .dragon-tiger-roster-tabs .nav-link,
    .dragon-tiger-roster-subtabs .nav-link,
    .dragon-tiger-profession-group,
    .dragon-tiger-profession-group-title,
    .dragon-tiger-profession-stats-chip,
    .dragon-tiger-member-item,
    .dragon-tiger-profession
) {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: linear-gradient(145deg, rgba(32, 50, 84, 0.9), rgba(11, 24, 50, 0.92)) !important;
    box-shadow: none !important;
}

body.site-app:not(.home-premium-page) :is(
    .dragon-tiger-session-pill,
    .dragon-tiger-roster-tabs .nav-link,
    .dragon-tiger-roster-subtabs .nav-link
):is(:hover, :focus, .is-active, .active) {
    color: #ffffff !important;
    border-color: rgba(189, 199, 255, 0.74) !important;
    background: rgba(113, 103, 217, 0.52) !important;
}

body.site-app:not(.home-premium-page) :is(
    .dragon-tiger-session-pill-meta,
    .dragon-tiger-registration-timeline-meta,
    .dragon-tiger-profession-stats-label,
    .dragon-tiger-list-title
) {
    color: var(--premium-muted) !important;
}

body.site-app:not(.home-premium-page) :is(
    .dragon-tiger-registration-timeline-title strong,
    .dragon-tiger-registration-timeline-note,
    .dragon-tiger-profession-group-title,
    .dragon-tiger-profession-stats-chip
) {
    color: var(--premium-gold) !important;
}

body.site-app:not(.home-premium-page) .dragon-tiger-member-name {
    color: var(--premium-text) !important;
}

body.site-app:not(.home-premium-page) .dragon-tiger-registration-timeline-name {
    color: var(--premium-text) !important;
}

/* Dragon Tiger role setup keeps its three status tiles and role guidance in
 * the same dark glass system instead of reverting to paper-white inserts. */
body.site-app:not(.home-premium-page) :is(
    .dragon-tiger-role-meta-item,
    .dragon-tiger-role-description
) {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: linear-gradient(145deg, rgba(37, 57, 93, 0.92), rgba(13, 28, 57, 0.94)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

body.site-app:not(.home-premium-page) :is(
    .dragon-tiger-role-meta-label,
    .dragon-tiger-role-description-body,
    .dragon-tiger-role-description-empty
) {
    color: var(--premium-muted) !important;
}

body.site-app:not(.home-premium-page) .dragon-tiger-role-meta-value {
    color: var(--premium-text) !important;
}

body.site-app:not(.home-premium-page) .dragon-tiger-role-description-title {
    color: var(--premium-gold) !important;
}

/* The MBTI profile and questionnaire are functional pages too: retain their
 * result hierarchy while replacing every paper-colour insert with navy glass. */
body.site-app:not(.home-premium-page) .mbti-test-section :is(
    .mbti-hero-card,
    .mbti-tabs,
    .mbti-map-optin-card,
    .mbti-progress-card,
    .mbti-question-card,
    .mbti-result-card,
    .mbti-dimension-row,
    .mbti-ai-box,
    .mbti-note,
    .mbti-option-label
) {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: linear-gradient(145deg, rgba(32, 50, 84, 0.92), rgba(10, 24, 51, 0.94)) !important;
    box-shadow: var(--premium-shadow) !important;
}

body.site-app:not(.home-premium-page) .mbti-test-section .mbti-tabs .nav-link {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: rgba(8, 21, 46, 0.72) !important;
}

body.site-app:not(.home-premium-page) .mbti-test-section .mbti-tabs .nav-link:is(:hover, :focus-visible) {
    color: #ffffff !important;
    border-color: rgba(189, 199, 255, 0.74) !important;
    background: rgba(113, 103, 217, 0.3) !important;
}

body.site-app:not(.home-premium-page) .mbti-test-section .mbti-tabs .nav-link.active {
    color: #ffffff !important;
    border-color: rgba(255, 194, 119, 0.9) !important;
    background: linear-gradient(135deg, #ef8a3d 0%, #d97427 100%) !important;
}

body.site-app:not(.home-premium-page) .mbti-test-section :is(
    .mbti-progress-text,
    .mbti-question-title,
    .mbti-option-label
) {
    color: var(--premium-text) !important;
}

body.site-app:not(.home-premium-page) .mbti-test-section :is(
    .mbti-note,
    .mbti-map-optin-card,
    .mbti-dimension-row,
    .mbti-ai-box
) {
    color: var(--premium-muted) !important;
}

body.site-app:not(.home-premium-page) .mbti-test-section :is(
    .mbti-question-index,
    .mbti-dimension-chip
) {
    color: var(--premium-gold) !important;
    border-color: rgba(246, 216, 139, 0.44) !important;
    background: rgba(246, 216, 139, 0.12) !important;
}

body.site-app:not(.home-premium-page) .mbti-test-section .mbti-split-bar {
    border-color: var(--premium-border-strong) !important;
    background: rgba(5, 15, 33, 0.72) !important;
}

/* Relationship graph nodes use the shared dark glass too, including empty
 * states and member entries that otherwise retain white paper backgrounds. */
body.site-app:not(.home-premium-page) :is(
    .relationship-radial-empty,
    .relationship-radial-person
) {
    color: var(--premium-muted) !important;
    border-color: var(--premium-border-strong) !important;
    background: rgba(9, 23, 49, 0.76) !important;
}

body.site-app:not(.home-premium-page) :is(
    .relationship-radial-center-name,
    .relationship-radial-node-title,
    .relationship-radial-person-name
) {
    color: var(--premium-text) !important;
}

body.site-app:not(.home-premium-page) :is(
    .relationship-radial-center-role,
    .relationship-radial-person-meta
) {
    color: var(--premium-muted) !important;
}

body.site-app:not(.home-premium-page) :is(
    .relationship-radial-center-badge,
    .relationship-radial-node-count
) {
    color: #f6efff !important;
    border-color: rgba(207, 183, 255, 0.6) !important;
    background: rgba(132, 103, 202, 0.48) !important;
}

body.site-app:not(.home-premium-page) .relationship-radial-lines line {
    stroke: rgba(220, 203, 255, 0.9) !important;
}

/* Member media keeps the actual photo/video assets unchanged while its IG
 * metadata cards, upload helpers, and tabs follow the premium shell. */
body.site-app:not(.home-premium-page) :is(
    .ig-media-card,
    .member-upload-visibility
) {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: linear-gradient(145deg, rgba(31, 48, 82, 0.92), rgba(10, 24, 51, 0.94)) !important;
    box-shadow: var(--premium-shadow) !important;
}

body.site-app:not(.home-premium-page) :is(
    .member-helper,
    .member-upload-file-name
) {
    color: var(--premium-muted) !important;
}

body.site-app:not(.home-premium-page) .member-main-tabs .nav-link {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: rgba(8, 21, 46, 0.72) !important;
}

body.site-app:not(.home-premium-page) .member-main-tabs .nav-link.active {
    color: #ffffff !important;
    border-color: rgba(255, 194, 119, 0.9) !important;
    background: linear-gradient(135deg, #8c80f6 0%, #5f58bd 100%) !important;
}

/* Personal profile is a modal workflow, so its nested form panels need their
 * own override rather than inheriting the former paper-colour edit palette. */
body.site-app:not(.home-premium-page) :is(
    .profile-edit-header,
    .profile-form-section,
    .profile-modal-preview
) {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: linear-gradient(145deg, rgba(31, 48, 82, 0.94), rgba(10, 24, 51, 0.96)) !important;
}

body.site-app:not(.home-premium-page) :is(
    .profile-edit-modal .modal-title,
    .profile-section-heading h6,
    .profile-preview-title
) {
    color: var(--premium-text) !important;
}

body.site-app:not(.home-premium-page) .profile-section-kicker {
    color: var(--premium-gold) !important;
}

body.site-app:not(.home-premium-page) :is(
    .profile-preview-subtitle,
    .profile-modal-preview .form-label,
    .profile-preview-status,
    .profile-toggle-row
) {
    color: var(--premium-muted) !important;
}

body.site-app:not(.home-premium-page) .profile-section-note {
    color: #2d1d09 !important;
    background: var(--premium-gold) !important;
}

body.site-app:not(.home-premium-page) .profile-identity-chip {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: rgba(8, 21, 46, 0.74) !important;
}

body.site-app:not(.home-premium-page) .profile-identity-chip:is(:hover, :has(.profile-identity-input:checked)) {
    color: #ffffff !important;
    border-color: rgba(255, 194, 119, 0.86) !important;
    background: rgba(140, 128, 246, 0.32) !important;
    box-shadow: inset 0 0 0 1px rgba(189, 199, 255, 0.2) !important;
}

/* Reward redemption has several nested functional surfaces that used to stay
 * white after the outer reward card was converted to the shared shell. */
body.site-app:not(.home-premium-page) :is(
    .member-feature-tabs,
    .qualification-list,
    .member-action-block,
    .member-tournament-form,
    .member-tournament-note,
    .member-redeem-summary,
    .task-point-exchange-card
) {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: linear-gradient(145deg, rgba(31, 48, 82, 0.92), rgba(10, 24, 51, 0.94)) !important;
}

body.site-app:not(.home-premium-page) .member-feature-tabs .nav-link {
    color: var(--premium-text) !important;
    background: rgba(8, 21, 46, 0.72) !important;
}

body.site-app:not(.home-premium-page) .member-feature-tabs .nav-link:is(:hover, :focus-visible, .active) {
    color: #ffffff !important;
    background: rgba(140, 128, 246, 0.42) !important;
    box-shadow: inset 0 0 0 1px rgba(189, 199, 255, 0.5) !important;
}

body.site-app:not(.home-premium-page) :is(
    .member-action-hint,
    .member-tournament-note
) {
    color: var(--premium-muted) !important;
}

body.site-app:not(.home-premium-page) :is(
    .member-action-title,
    .member-redeem-summary-row strong
) {
    color: var(--premium-gold) !important;
}

body.site-app:not(.home-premium-page) .task-point-exchange-pill {
    color: #2d1d09 !important;
    background: var(--premium-gold) !important;
}

/* The gallery landing header previously remained a light banner above the
 * already-dark contest cards; keep its tabs and upload action in one shell. */
body.site-app:not(.home-premium-page) .photo-dream-hero {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: linear-gradient(145deg, rgba(31, 48, 82, 0.92), rgba(10, 24, 51, 0.94)) !important;
    box-shadow: var(--premium-shadow) !important;
}

body.site-app:not(.home-premium-page) .photo-page-title {
    color: var(--premium-text) !important;
}

body.site-app:not(.home-premium-page) .photo-tab-nav .nav-link {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: rgba(8, 21, 46, 0.72) !important;
}

body.site-app:not(.home-premium-page) .photo-tab-nav .nav-link:is(:hover, :focus-visible, .active) {
    color: #ffffff !important;
    border-color: rgba(189, 199, 255, 0.82) !important;
    background: linear-gradient(135deg, #8c80f6 0%, #6d78d8 100%) !important;
    box-shadow: 0 8px 20px rgba(89, 83, 181, 0.3) !important;
}

/* Standalone announcements also use the shared shell in list, calendar, and
 * detail modes instead of carrying their previous paper-colour background. */
body.site-app:not(.home-premium-page) .announcement-shell {
    --ann-surface: rgba(20, 34, 60, 0.9);
    --ann-border: var(--premium-border-strong);
    --ann-bg-soft: rgba(31, 47, 79, 0.94);
    --ann-title: var(--premium-text);
    --ann-muted: var(--premium-muted);
    background:
        radial-gradient(circle at 10% 8%, rgba(111, 129, 190, 0.24), transparent 32rem),
        radial-gradient(circle at 92% 18%, rgba(255, 157, 69, 0.1), transparent 28rem),
        transparent !important;
}

body.site-app:not(.home-premium-page) :is(
    .announcement-head,
    .announcement-filter,
    .announcement-card,
    .announcement-empty,
    .announcement-calendar-wrap,
    .calendar-result,
    .announcement-detail,
    .calendar-item,
    .event-date-block,
    .highlight-box
) {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: linear-gradient(145deg, rgba(31, 48, 82, 0.9), rgba(12, 25, 51, 0.92)) !important;
    box-shadow: var(--premium-shadow) !important;
}

body.site-app:not(.home-premium-page) :is(
    .announcement-title,
    .announcement-card-title a,
    .calendar-month,
    .calendar-day-number,
    .calendar-result-title,
    .announcement-detail .detail-header h1,
    .detail-content,
    .calendar-item
) {
    color: var(--premium-text) !important;
}

body.site-app:not(.home-premium-page) :is(
    .announcement-subtitle,
    .announcement-meta,
    .announcement-excerpt,
    .detail-meta,
    .calendar-empty
) {
    color: var(--premium-muted) !important;
}

body.site-app:not(.home-premium-page) :is(
    .mode-toggle,
    .mode-btn,
    .announcement-calendar th,
    .announcement-calendar td,
    .announcement-calendar td.is-out-month,
    .announcement-calendar td.has-item,
    .calendar-day-count
) {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: rgba(12, 26, 52, 0.62) !important;
}

body.site-app:not(.home-premium-page) .mode-btn.is-active {
    color: #ffffff !important;
    background: #7167d9 !important;
}

body.site-app:not(.home-premium-page) .calendar-item-time,
body.site-app:not(.home-premium-page) .calendar-day-count {
    color: var(--premium-gold) !important;
}

/* Tournament introductions are administrator-authored HTML. Normalise every
 * generated text surface so a pasted paper-colour block cannot hide its copy. */
body.site-app:not(.home-premium-page) .tournament-intro-content {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: linear-gradient(145deg, rgba(31, 48, 82, 0.68), rgba(9, 21, 45, 0.72)) !important;
    border-radius: 0.82rem;
    padding: clamp(0.9rem, 2vw, 1.35rem);
}

body.site-app:not(.home-premium-page) .tournament-intro-content :not(img):not(video):not(iframe):not(svg):not(path) {
    color: inherit !important;
    border-color: rgba(255, 255, 255, 0.17) !important;
    background-color: transparent !important;
    background-image: none !important;
}

body.site-app:not(.home-premium-page) .tournament-intro-content :is(
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    strong,
    b
) {
    color: #ffffff !important;
}

body.site-app:not(.home-premium-page) .tournament-intro-content :is(
    table,
    th,
    td
) {
    color: var(--premium-text) !important;
    border-color: rgba(255, 255, 255, 0.17) !important;
    background: rgba(7, 18, 39, 0.42) !important;
}

body.site-app:not(.home-premium-page) :is(
    .tournament-overview-item,
    .tournament-photo-preview-caption,
    .entry-vote-stats,
    .entry-title-text,
    .entry-author-text,
    .entry-intro-text
) {
    color: var(--premium-muted) !important;
}

body.site-app:not(.home-premium-page) .tournament-overview-tabs .nav-link {
    color: var(--premium-muted) !important;
    border-color: var(--premium-border-strong) !important;
    background: rgba(12, 26, 52, 0.62) !important;
}

body.site-app:not(.home-premium-page) .tournament-overview-tabs .nav-link:is(:hover, :focus, .active) {
    color: #ffffff !important;
    border-color: rgba(189, 199, 255, 0.74) !important;
    background: #7167d9 !important;
}

/* Keep full tournament covers visible while replacing the old white letterbox
 * with the same midnight presentation surface used by the cards. */
body.site-app:not(.home-premium-page) :is(
    .tournament-card-cover,
    .tournament-card-cover-placeholder
) {
    color: var(--premium-muted) !important;
    border-color: var(--premium-border-strong) !important;
    background: linear-gradient(145deg, rgba(31, 48, 82, 0.9), rgba(9, 21, 45, 0.94)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 26px rgba(4, 11, 27, 0.3) !important;
}

/* Gameplay cards and articles define their own warm-grey copy after the shared
 * stylesheet; keep the guide index and rendered guide body equally readable. */
body.site-app:not(.home-premium-page) .gameplay-excerpt {
    color: var(--premium-muted) !important;
}

body.site-app:not(.home-premium-page) :is(
    .gameplay-category-badge,
    .gameplay-profession-chip
) {
    color: #f5dcaa !important;
    border-color: rgba(246, 216, 139, 0.4) !important;
    background: rgba(246, 216, 139, 0.11) !important;
}

body.site-app:not(.home-premium-page) .gameplay-detail-content {
    color: var(--premium-text) !important;
}

body.site-app:not(.home-premium-page) .gameplay-detail-content :not(img):not(video):not(iframe):not(svg):not(path) {
    color: inherit !important;
    border-color: rgba(255, 255, 255, 0.17) !important;
    background-color: transparent !important;
    background-image: none !important;
}

body.site-app:not(.home-premium-page) .gameplay-detail-content :is(
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    strong,
    b
) {
    color: #ffffff !important;
}

body.site-app:not(.home-premium-page) .gameplay-detail-content :is(
    table,
    th,
    td
) {
    color: var(--premium-text) !important;
    border-color: rgba(255, 255, 255, 0.17) !important;
    background: rgba(7, 18, 39, 0.42) !important;
}

body.site-app:not(.home-premium-page) .gameplay-nav-link {
    color: var(--premium-text) !important;
}

/* Member Command Center is a standalone modal layout with its own light
 * sections. Carry the shared overlay treatment through every nested surface. */
body.site-app:not(.home-premium-page) .front-member-menu-modal .modal-content {
    background: linear-gradient(145deg, rgba(30, 47, 81, 0.98), rgba(9, 20, 40, 0.99)) !important;
}

body.site-app:not(.home-premium-page) .front-member-menu-modal :is(
    .front-member-menu-modal-header,
    .front-member-menu-modal-body,
    .navbar-menu-search-wrap,
    .front-member-menu-group-card,
    .front-impersonation-card,
    .navbar-menu-item
) {
    color: var(--premium-text) !important;
    border-color: var(--premium-border-strong) !important;
    background: linear-gradient(145deg, rgba(31, 48, 82, 0.9), rgba(11, 24, 50, 0.92)) !important;
    box-shadow: var(--premium-shadow) !important;
}

body.site-app:not(.home-premium-page) .front-member-menu-modal :is(
    .navbar-menu-item:hover,
    .navbar-menu-item:focus
) {
    color: #ffffff !important;
    background: rgba(113, 103, 217, 0.36) !important;
    transform: translateY(-1px);
}

body.site-app:not(.home-premium-page) .front-member-menu-modal :is(
    .front-member-menu-kicker,
    .navbar-menu-section-title,
    .front-impersonation-title
) {
    color: var(--premium-gold) !important;
}

body.site-app:not(.home-premium-page) .front-member-menu-modal :is(
    .front-member-menu-subtitle,
    .front-impersonation-meta,
    .navbar-menu-meta
) {
    color: var(--premium-muted) !important;
}

body.site-app:not(.home-premium-page) .front-member-menu-modal .navbar-menu-label {
    color: var(--premium-text) !important;
}

body.site-app:not(.home-premium-page) .front-member-menu-modal-body {
    scrollbar-color: rgba(189, 199, 255, 0.62) rgba(7, 18, 39, 0.58);
}

body.site-app:not(.home-premium-page) .front-member-menu-modal-body::-webkit-scrollbar-track {
    background: rgba(7, 18, 39, 0.58) !important;
}

body.site-app:not(.home-premium-page) .front-member-menu-modal-body::-webkit-scrollbar-thumb {
    background: rgba(189, 199, 255, 0.58) !important;
}

@media (max-width: 991.98px) {
    body.site-app:not(.home-premium-page) .relaxed-navbar .navbar-collapse {
        color: var(--premium-text) !important;
        border-color: var(--premium-border-strong) !important;
        background: rgba(9, 20, 38, 0.98) !important;
        box-shadow: var(--premium-shadow);
    }

    body.site-app:not(.home-premium-page) .relaxed-navbar .navbar-collapse .nav-link,
    body.site-app:not(.home-premium-page) .relaxed-navbar .navbar-collapse .dropdown-item {
        color: rgba(254, 247, 255, 0.9) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.site-app:not(.home-premium-page) :is(
        .hero-panel,
        .rule-card,
        .card:not(.bg-dark):not([class*="text-bg-"])
    ) {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}
