/* =========================================================
   MT2 Tournament System v0.14 — administrator-selected themes
   The administrator-selected theme is applied to public pages, LIVE and the admin panel.
   ========================================================= */

body[data-site-theme],
.theme-option-card {
    --theme-bg: #071612;
    --theme-bg-soft: #0c2b22;
    --theme-primary: #2d8067;
    --theme-primary-soft: rgba(45, 128, 103, 0.22);
    --theme-accent: #d6b35f;
    --theme-accent-light: #f0d98e;
    --theme-accent-soft: rgba(214, 179, 95, 0.2);
    --theme-text: #f0ead7;
    --theme-muted: #aab8ae;
    --theme-success: #72d6a8;
    --theme-danger: #d9776b;
    --theme-border: rgba(214, 179, 95, 0.38);
    --theme-panel: rgba(5, 22, 17, 0.78);
    --theme-panel-strong: rgba(5, 20, 16, 0.92);
    --theme-image-filter: saturate(.92) contrast(1.03);
    --theme-radius: 24px;
    --theme-button-text: #fff5d5;
}

body[data-site-theme="obsidian_crimson"] {
    --theme-radius: 14px;
    --theme-bg: #09090b; --theme-bg-soft: #241017; --theme-primary: #8f1830; --theme-primary-soft: rgba(143,24,48,.24);
    --theme-accent: #d7a84f; --theme-accent-light: #f0ca79; --theme-accent-soft: rgba(215,168,79,.2); --theme-text: #f0e6df;
    --theme-muted: #b2a4a3; --theme-success: #7bd59b; --theme-danger: #e63b52; --theme-border: rgba(215,168,79,.4);
    --theme-panel: rgba(18,8,11,.8); --theme-panel-strong: rgba(15,7,9,.94); --theme-image-filter: hue-rotate(315deg) saturate(.92) contrast(1.12);
}
body[data-site-theme="frost_sapphire"] {
    --theme-radius: 28px;
    --theme-bg: #07111f; --theme-bg-soft: #102b47; --theme-primary: #227fc2; --theme-primary-soft: rgba(34,127,194,.24);
    --theme-accent: #8dc9ed; --theme-accent-light: #d4f2ff; --theme-accent-soft: rgba(141,201,237,.2); --theme-text: #edf7fb;
    --theme-muted: #9db5c4; --theme-success: #69d7c7; --theme-danger: #e17888; --theme-border: rgba(141,201,237,.38);
    --theme-panel: rgba(5,18,32,.78); --theme-panel-strong: rgba(5,16,29,.94); --theme-image-filter: hue-rotate(150deg) saturate(.82) contrast(1.08);
}
body[data-site-theme="royal_amethyst"] {
    --theme-radius: 22px;
    --theme-bg: #120a1c; --theme-bg-soft: #29143b; --theme-primary: #7439a8; --theme-primary-soft: rgba(116,57,168,.25);
    --theme-accent: #d1a94e; --theme-accent-light: #efd483; --theme-accent-soft: rgba(209,169,78,.2); --theme-text: #f4ebf7;
    --theme-muted: #b5a7ba; --theme-success: #79d4aa; --theme-danger: #df6d88; --theme-border: rgba(209,169,78,.4);
    --theme-panel: rgba(20,8,30,.8); --theme-panel-strong: rgba(17,7,27,.94); --theme-image-filter: hue-rotate(245deg) saturate(.9) contrast(1.08);
}
body[data-site-theme="dragonfire"] {
    --theme-radius: 12px;
    --theme-bg: #160b08; --theme-bg-soft: #36140d; --theme-primary: #c23a1f; --theme-primary-soft: rgba(194,58,31,.25);
    --theme-accent: #e99332; --theme-accent-light: #ffc86a; --theme-accent-soft: rgba(233,147,50,.22); --theme-text: #f6e8da;
    --theme-muted: #b9a193; --theme-success: #8acb83; --theme-danger: #ef4d32; --theme-border: rgba(233,147,50,.42);
    --theme-panel: rgba(27,11,7,.8); --theme-panel-strong: rgba(24,9,6,.94); --theme-image-filter: hue-rotate(320deg) saturate(1.02) contrast(1.12);
}
body[data-site-theme="moon_silver"] {
    --theme-radius: 16px;
    --theme-bg: #0d1117; --theme-bg-soft: #202a35; --theme-primary: #5f748d; --theme-primary-soft: rgba(95,116,141,.24);
    --theme-accent: #aab7c5; --theme-accent-light: #edf3f8; --theme-accent-soft: rgba(170,183,197,.2); --theme-text: #eef1f4;
    --theme-muted: #9ea8b2; --theme-success: #83c7aa; --theme-danger: #cf7880; --theme-border: rgba(170,183,197,.34);
    --theme-panel: rgba(13,17,23,.8); --theme-panel-strong: rgba(11,15,20,.95); --theme-image-filter: grayscale(.45) saturate(.55) contrast(1.12);
}
body[data-site-theme="abyss_cyan"] {
    --theme-radius: 30px;
    --theme-bg: #020b12; --theme-bg-soft: #062b36; --theme-primary: #008eaa; --theme-primary-soft: rgba(0,142,170,.25);
    --theme-accent: #20c4da; --theme-accent-light: #82f1ff; --theme-accent-soft: rgba(32,196,218,.22); --theme-text: #e8f8fa;
    --theme-muted: #94b4ba; --theme-success: #50d6a0; --theme-danger: #de6679; --theme-border: rgba(32,196,218,.38);
    --theme-panel: rgba(2,15,22,.8); --theme-panel-strong: rgba(2,13,20,.95); --theme-image-filter: hue-rotate(135deg) saturate(1.03) contrast(1.1);
}
body[data-site-theme="jade_dynasty"] {
    --theme-radius: 20px;
    --theme-bg: #07130f; --theme-bg-soft: #173428; --theme-primary: #2c8b66; --theme-primary-soft: rgba(44,139,102,.24);
    --theme-accent: #d3ad55; --theme-accent-light: #f1d889; --theme-accent-soft: rgba(211,173,85,.2); --theme-text: #efeada;
    --theme-muted: #a4b4aa; --theme-success: #68d29f; --theme-danger: #d97570; --theme-border: rgba(211,173,85,.4);
    --theme-panel: rgba(5,22,16,.8); --theme-panel-strong: rgba(4,19,14,.94); --theme-image-filter: hue-rotate(5deg) saturate(.9) contrast(1.08);
}
body[data-site-theme="desert_sun"] {
    --theme-radius: 12px;
    --theme-bg: #171008; --theme-bg-soft: #382715; --theme-primary: #9a5f24; --theme-primary-soft: rgba(154,95,36,.24);
    --theme-accent: #d7aa52; --theme-accent-light: #f0ce82; --theme-accent-soft: rgba(215,170,82,.22); --theme-text: #f3e7d2;
    --theme-muted: #b7a995; --theme-success: #89c28a; --theme-danger: #d96f5c; --theme-border: rgba(215,170,82,.42);
    --theme-panel: rgba(24,15,7,.82); --theme-panel-strong: rgba(20,13,6,.95); --theme-image-filter: sepia(.3) hue-rotate(345deg) saturate(.85) contrast(1.08);
}
body[data-site-theme="blood_moon"] {
    --theme-radius: 18px;
    --theme-bg: #080b17; --theme-bg-soft: #25121d; --theme-primary: #a01f3d; --theme-primary-soft: rgba(160,31,61,.25);
    --theme-accent: #aeb5c8; --theme-accent-light: #e2e6f0; --theme-accent-soft: rgba(174,181,200,.2); --theme-text: #f1eaf0;
    --theme-muted: #aaa2ae; --theme-success: #75c99a; --theme-danger: #e14059; --theme-border: rgba(174,181,200,.35);
    --theme-panel: rgba(11,9,20,.82); --theme-panel-strong: rgba(9,8,18,.95); --theme-image-filter: hue-rotate(285deg) saturate(.8) contrast(1.13);
}
body[data-site-theme="arcane_violet"] {
    --theme-radius: 30px;
    --theme-bg: #100817; --theme-bg-soft: #32123e; --theme-primary: #9a35bd; --theme-primary-soft: rgba(154,53,189,.25);
    --theme-accent: #ce76e6; --theme-accent-light: #efb7ff; --theme-accent-soft: rgba(206,118,230,.22); --theme-text: #f7ebfa;
    --theme-muted: #bca7c1; --theme-success: #70d9aa; --theme-danger: #ea668d; --theme-border: rgba(206,118,230,.38);
    --theme-panel: rgba(18,7,25,.82); --theme-panel-strong: rgba(16,6,23,.95); --theme-image-filter: hue-rotate(245deg) saturate(1.08) contrast(1.08);
}
body[data-site-theme="royal_sapphire"] {
    --theme-radius: 18px;
    --theme-bg: #081226; --theme-bg-soft: #142e57; --theme-primary: #245fb3; --theme-primary-soft: rgba(36,95,179,.25);
    --theme-accent: #d8aa43; --theme-accent-light: #f1cf78; --theme-accent-soft: rgba(216,170,67,.2); --theme-text: #eef2fa;
    --theme-muted: #a1adbf; --theme-success: #6bcaa0; --theme-danger: #dd7181; --theme-border: rgba(216,170,67,.4);
    --theme-panel: rgba(7,16,34,.82); --theme-panel-strong: rgba(6,14,30,.95); --theme-image-filter: hue-rotate(155deg) saturate(.9) contrast(1.1);
}
body[data-site-theme="toxic_shadow"] {
    --theme-radius: 8px;
    --theme-bg: #071008; --theme-bg-soft: #1c3116; --theme-primary: #5f9e27; --theme-primary-soft: rgba(95,158,39,.25);
    --theme-accent: #a8cf55; --theme-accent-light: #d8f28c; --theme-accent-soft: rgba(168,207,85,.22); --theme-text: #edf2e7;
    --theme-muted: #a8b4a0; --theme-success: #8de35b; --theme-danger: #d56b5d; --theme-border: rgba(168,207,85,.38);
    --theme-panel: rgba(7,18,7,.82); --theme-panel-strong: rgba(6,16,6,.95); --theme-image-filter: hue-rotate(35deg) saturate(.95) contrast(1.12);
}
body[data-site-theme="steel_inferno"] {
    --theme-radius: 10px;
    --theme-bg: #101214; --theme-bg-soft: #2b2521; --theme-primary: #c44c21; --theme-primary-soft: rgba(196,76,33,.25);
    --theme-accent: #db8541; --theme-accent-light: #ffc27b; --theme-accent-soft: rgba(219,133,65,.22); --theme-text: #f0ece8;
    --theme-muted: #aaa7a3; --theme-success: #7fc492; --theme-danger: #e0553a; --theme-border: rgba(219,133,65,.4);
    --theme-panel: rgba(16,17,18,.84); --theme-panel-strong: rgba(14,15,16,.96); --theme-image-filter: grayscale(.18) sepia(.22) saturate(.88) contrast(1.13);
}
body[data-site-theme="ivory_onyx"] {
    --theme-radius: 6px;
    --theme-bg: #0b0b0c; --theme-bg-soft: #242321; --theme-primary: #8f8368; --theme-primary-soft: rgba(143,131,104,.23);
    --theme-accent: #d8caa8; --theme-accent-light: #f5ecd7; --theme-accent-soft: rgba(216,202,168,.2); --theme-text: #f2eee4;
    --theme-muted: #aaa79f; --theme-success: #82c69a; --theme-danger: #cf7770; --theme-border: rgba(216,202,168,.35);
    --theme-panel: rgba(12,12,13,.84); --theme-panel-strong: rgba(10,10,11,.96); --theme-image-filter: grayscale(.62) sepia(.16) saturate(.5) contrast(1.14);
}
body[data-site-theme="tournament_neon"] {
    --theme-radius: 26px;
    --theme-bg: #03101a; --theme-bg-soft: #07313b; --theme-primary: #00a7a0; --theme-primary-soft: rgba(0,167,160,.26);
    --theme-accent: #efbe26; --theme-accent-light: #ffe36d; --theme-accent-soft: rgba(239,190,38,.22); --theme-text: #eefafa;
    --theme-muted: #9cb7ba; --theme-success: #37dd8a; --theme-danger: #ee4f68; --theme-border: rgba(239,190,38,.43);
    --theme-panel: rgba(2,18,25,.82); --theme-panel-strong: rgba(2,15,22,.96); --theme-image-filter: hue-rotate(125deg) saturate(1.08) contrast(1.12);
}

body[data-site-theme] {
    --ink: var(--theme-bg);
    --deep: var(--theme-bg);
    --deep-soft: var(--theme-bg-soft);
    --jade: var(--theme-primary);
    --jade-light: var(--theme-primary);
    --turquoise: var(--theme-primary);
    --turquoise-soft: var(--theme-primary-soft);
    --gold: var(--theme-accent);
    --gold-light: var(--theme-accent-light);
    --gold-dark: var(--theme-primary);
    --parchment: var(--theme-text);
    --muted: var(--theme-muted);
    --success: var(--theme-success);
    --danger: var(--theme-danger);
    --panel: var(--theme-panel);
    --panel-light: var(--theme-primary-soft);
    --border: var(--theme-border);
    background:
        radial-gradient(circle at 74% 20%, var(--theme-primary-soft), transparent 30%),
        radial-gradient(circle at 18% 76%, var(--theme-accent-soft), transparent 28%),
        var(--theme-bg);
    color: var(--theme-text);
}

body[data-site-theme] .site-background {
    filter: var(--theme-image-filter);
}
body[data-site-theme] .site-background::after {
    background:
        radial-gradient(circle at 72% 28%, var(--theme-primary-soft), transparent 28%),
        radial-gradient(circle at 23% 57%, var(--theme-accent-soft), transparent 25%),
        linear-gradient(180deg, transparent 46%, var(--theme-bg));
}
body[data-site-theme] .ambient-one { background: var(--theme-primary); opacity: .22; }
body[data-site-theme] .ambient-two { background: var(--theme-accent); opacity: .18; }
body[data-site-theme] .particle { background: var(--theme-accent-light); box-shadow: 0 0 12px var(--theme-accent); }

body[data-site-theme] .site-header,
body[data-site-theme] .fantasy-panel,
body[data-site-theme] .public-participant-drawer,
body[data-site-theme] .public-live-arena,
body[data-site-theme] .live-overlay-header,
body[data-site-theme] .live-overlay-footer,
body[data-site-theme] .live-overlay-stage,
body[data-site-theme] .public-bracket-scroll,
body[data-site-theme] .public-match-card,
body[data-site-theme] .public-player-card,
body[data-site-theme] .public-tournament-card,
body[data-site-theme] .hall-player-card,
body[data-site-theme] .legend-card {
    border-color: var(--theme-border);
    background:
        linear-gradient(145deg, rgba(255,255,255,.045), transparent 42%),
        linear-gradient(325deg, var(--theme-primary-soft), transparent 52%),
        var(--theme-panel);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.055),
        0 22px 65px rgba(0,0,0,.36);
    border-radius: var(--theme-radius);
}

body[data-site-theme] .site-header,
body[data-site-theme] .public-participant-drawer,
body[data-site-theme] .live-overlay-header,
body[data-site-theme] .live-overlay-footer { border-radius: calc(var(--theme-radius) + 2px); }

body[data-site-theme] .brand-rune,
body[data-site-theme] .feature-icon,
body[data-site-theme] .fighter-sigil,
body[data-site-theme] .public-live-avatar,
body[data-site-theme] .live-overlay-avatar,
body[data-site-theme] .admin-stat-icon {
    border-color: var(--theme-border);
    color: var(--theme-accent-light);
    background: linear-gradient(145deg, var(--theme-accent-soft), var(--theme-primary-soft));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 24px var(--theme-accent-soft);
}

body[data-site-theme] .section-kicker,
body[data-site-theme] .main-navigation a:hover,
body[data-site-theme] .main-navigation a.is-active,
body[data-site-theme] .public-live-state a,
body[data-site-theme] .public-live-versus strong,
body[data-site-theme] .live-overlay-vs em,
body[data-site-theme] .status-chip {
    color: var(--theme-primary);
}

body[data-site-theme] .hero-copy h1 span,
body[data-site-theme] .section-heading h2,
body[data-site-theme] .arena-card h2,
body[data-site-theme] .auth-header h1,
body[data-site-theme] .public-bracket-round > header strong,
body[data-site-theme] .live-overlay-tournament h1,
body[data-site-theme] .stat-strip strong,
body[data-site-theme] .hall-stat-grid strong,
body[data-site-theme] .public-live-fighter > b,
body[data-site-theme] .live-overlay-scoreboard article > strong {
    color: var(--theme-accent-light);
    text-shadow: 0 0 22px var(--theme-accent-soft), 0 10px 34px rgba(0,0,0,.5);
}

body[data-site-theme] .fantasy-button {
    border-color: var(--theme-accent);
    color: var(--theme-button-text);
    background:
        linear-gradient(110deg, rgba(255,255,255,.14), transparent 30%),
        linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 72%, #000), var(--theme-accent));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 10px 28px rgba(0,0,0,.34), 0 0 20px var(--theme-accent-soft);
    border-radius: calc(var(--theme-radius) * .58);
}
body[data-site-theme] .fantasy-button:hover:not(:disabled) {
    box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 14px 34px rgba(0,0,0,.4), 0 0 28px var(--theme-accent-soft);
}

body[data-site-theme] .public-player-tile,
body[data-site-theme] .public-match-card > div,
body[data-site-theme] .victory-cinema-player-tile,
body[data-site-theme] .victory-cinema-match > div {
    border-color: color-mix(in srgb, var(--theme-primary) 48%, transparent);
    background:
        linear-gradient(135deg, rgba(255,255,255,.08), transparent 48%),
        color-mix(in srgb, var(--theme-primary) 16%, var(--theme-panel-strong));
    border-radius: 18px;
}
body[data-site-theme] .public-player-tile.is-winner,
body[data-site-theme] .public-match-card > div.is-winner,
body[data-site-theme] .victory-cinema-match > div.is-winner {
    color: #f2fff7;
    border-color: color-mix(in srgb, var(--theme-success) 75%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--theme-success) 22%, transparent), var(--theme-accent-soft)), var(--theme-panel-strong);
    box-shadow: 0 0 22px color-mix(in srgb, var(--theme-success) 25%, transparent);
}
body[data-site-theme] .public-match-card.status-live,
body[data-site-theme] .bracket-match-card.status-live {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 24px var(--theme-primary-soft);
}
body[data-site-theme] .public-match-card.is-advance-origin::after,
body[data-site-theme] .public-match-card.is-advance-target::after {
    background: linear-gradient(90deg, var(--theme-success), var(--theme-accent-light));
    box-shadow: 0 0 18px color-mix(in srgb, var(--theme-success) 60%, transparent);
}
body[data-site-theme] .public-match-card.is-loser-target::after {
    background: linear-gradient(90deg, var(--theme-accent-light), #e87a45);
}
body[data-site-theme] .victory-path-energy { stroke: var(--theme-success); filter: drop-shadow(0 0 10px var(--theme-success)); }
body[data-site-theme] .victory-path-energy.is-loser-path,
body[data-site-theme] .victory-path-base.is-loser-path { stroke: #e8894f; filter: drop-shadow(0 0 10px rgba(232,137,79,.65)); }
body[data-site-theme] .victory-cinema-token { border-color: var(--theme-success); background: linear-gradient(135deg, color-mix(in srgb, var(--theme-success) 26%, transparent), var(--theme-accent-soft)), var(--theme-panel-strong); }
body[data-site-theme] .victory-cinema-token.is-loser-token { border-color: #e8894f; background: linear-gradient(135deg, rgba(232,137,79,.24), var(--theme-accent-soft)), var(--theme-panel-strong); }
body[data-site-theme] .live-badge.is-live,
body[data-site-theme] .alert-success { border-color: color-mix(in srgb, var(--theme-success) 65%, transparent); color: var(--theme-success); background: color-mix(in srgb, var(--theme-success) 12%, transparent); }
body[data-site-theme] .alert-error { border-color: color-mix(in srgb, var(--theme-danger) 65%, transparent); color: var(--theme-danger); background: color-mix(in srgb, var(--theme-danger) 10%, transparent); }

/* Administrator theme library and live whole-panel preview. */
.theme-settings-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 20px;
}
.theme-settings-intro h2 { margin: 6px 0 10px; color: var(--gold-light); font-family: Georgia, serif; font-size: 1.8rem; font-weight: 500; }
.theme-settings-intro p { max-width: 760px; margin: 0; color: var(--muted); }
.theme-settings-form { padding: 26px; }
.theme-option-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.theme-option-card {
    position: relative;
    display: grid;
    overflow: hidden;
    min-height: 300px;
    grid-template-rows: 144px 1fr;
    border: 1px solid rgba(200,164,93,.2);
    border-radius: 22px;
    background: rgba(4,18,14,.72);
    cursor: pointer;
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.theme-option-card:hover { transform: translateY(-4px); border-color: rgba(200,164,93,.52); box-shadow: 0 18px 42px rgba(0,0,0,.25); }
.theme-option-card.is-active,
.theme-option-card:has(input:checked) { border-color: var(--gold-light); box-shadow: 0 0 0 2px rgba(200,164,93,.12), 0 20px 48px rgba(0,0,0,.3); }
.theme-option-card > input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option-preview { position: relative; overflow: hidden; background: radial-gradient(circle at 76% 25%, color-mix(in srgb, var(--preview-primary) 36%, transparent), transparent 34%), var(--preview-bg); }
.theme-preview-glow { position: absolute; width: 120px; height: 120px; top: -38px; right: -20px; border-radius: 50%; background: var(--preview-primary); filter: blur(35px); opacity: .34; }
.theme-preview-header { position: absolute; top: 14px; right: 14px; left: 14px; height: 22px; border: 1px solid color-mix(in srgb, var(--preview-accent) 55%, transparent); border-radius: 8px; background: rgba(255,255,255,.04); }
.theme-preview-panel { position: absolute; border: 1px solid color-mix(in srgb, var(--preview-primary) 50%, transparent); border-radius: 13px; background: linear-gradient(145deg, color-mix(in srgb, var(--preview-primary) 22%, transparent), rgba(255,255,255,.03)); box-shadow: 0 10px 24px rgba(0,0,0,.26); }
.theme-preview-panel-large { top: 49px; bottom: 16px; left: 14px; width: 57%; }
.theme-preview-panel-small { top: 49px; right: 14px; width: 29%; height: 47px; }
.theme-preview-button { position: absolute; right: 14px; bottom: 17px; width: 29%; height: 25px; border: 1px solid var(--preview-accent); border-radius: 8px; background: linear-gradient(135deg, var(--preview-primary), var(--preview-accent)); }
.theme-option-copy { display: grid; align-content: start; gap: 10px; padding: 17px; }
.theme-option-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.theme-option-topline strong { color: #eee6cc; font-family: Georgia, serif; font-size: 1rem; font-weight: 500; }
.theme-option-topline em { padding: 4px 6px; border: 1px solid rgba(86,210,189,.18); color: #8fa49a; font-size: .56rem; font-style: normal; letter-spacing: .06em; text-transform: uppercase; }
.theme-option-copy small { color: #87978e; font-size: .72rem; line-height: 1.5; }
.theme-swatches { display: flex; gap: 6px; margin-top: auto; }
.theme-swatches i { width: 26px; height: 7px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.theme-selected-mark { position: absolute; top: 12px; left: 12px; z-index: 2; display: none; padding: 5px 8px; border-radius: 999px; color: #fff6d0; background: rgba(6,18,14,.82); font-size: .6rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.theme-option-card.is-active .theme-selected-mark,
.theme-option-card:has(input:checked) .theme-selected-mark { display: inline-flex; }
.theme-save-bar { position: sticky; z-index: 10; bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding: 16px 18px; border: 1px solid rgba(200,164,93,.24); border-radius: 18px; background: rgba(3,15,12,.94); box-shadow: 0 16px 42px rgba(0,0,0,.34); backdrop-filter: blur(14px); }
.theme-save-bar strong, .theme-save-bar small { display: block; }
.theme-save-bar strong { color: #e8e0c7; }
.theme-save-bar small { margin-top: 3px; color: #7f9086; }

@media (max-width: 1280px) { .theme-option-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 920px) { .theme-option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .theme-settings-intro, .theme-save-bar { align-items: stretch; flex-direction: column; } }
@media (max-width: 560px) { .theme-option-grid { grid-template-columns: 1fr; } .theme-settings-form { padding: 18px; } }


/* =========================================================
   v0.15.0 — the chosen theme also controls the admin panel
   ========================================================= */
body[data-site-theme][data-admin-theme] {
    background:
        radial-gradient(circle at 82% 12%, var(--theme-primary-soft), transparent 30%),
        radial-gradient(circle at 22% 85%, var(--theme-accent-soft), transparent 28%),
        var(--theme-bg);
}

body[data-site-theme] .admin-background {
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--theme-bg) 96%, transparent), color-mix(in srgb, var(--theme-bg-soft) 82%, transparent)),
        url("../img/background/main-background.jpg") center / cover no-repeat;
    filter: var(--theme-image-filter);
}

body[data-site-theme] .admin-background::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 78% 18%, var(--theme-primary-soft), transparent 32%),
        radial-gradient(circle at 18% 78%, var(--theme-accent-soft), transparent 30%),
        linear-gradient(180deg, transparent 40%, var(--theme-bg));
}

body[data-site-theme] .admin-sidebar,
body[data-site-theme] .admin-panel,
body[data-site-theme] .admin-stat-card,
body[data-site-theme] .system-status,
body[data-site-theme] .next-package,
body[data-site-theme] .theme-save-bar,
body[data-site-theme] .live-preview-panel,
body[data-site-theme] .admin-live-console,
body[data-site-theme] .admin-hof-player-card,
body[data-site-theme] .tournament-editor-panel {
    border-color: var(--theme-border);
    border-radius: var(--theme-radius);
    background:
        linear-gradient(145deg, rgba(255,255,255,.05), transparent 38%),
        linear-gradient(325deg, var(--theme-primary-soft), transparent 58%),
        var(--theme-panel);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.06),
        0 22px 62px rgba(0,0,0,.34);
    backdrop-filter: blur(22px) saturate(135%);
    -webkit-backdrop-filter: blur(22px) saturate(135%);
}

body[data-site-theme] .admin-sidebar {
    border-radius: calc(var(--theme-radius) + 4px);
}

body[data-site-theme] .admin-brand,
body[data-site-theme] .admin-topbar,
body[data-site-theme] .admin-user-card,
body[data-site-theme] .admin-table-row,
body[data-site-theme] .tournament-participant-row {
    border-color: color-mix(in srgb, var(--theme-accent) 24%, transparent);
}

body[data-site-theme] .admin-navigation a,
body[data-site-theme] .admin-navigation button {
    border-radius: calc(var(--theme-radius) * .58);
    color: var(--theme-muted);
}

body[data-site-theme] .admin-navigation a:hover,
body[data-site-theme] .admin-navigation a.is-active {
    border-color: color-mix(in srgb, var(--theme-primary) 58%, transparent);
    color: var(--theme-accent-light);
    background:
        linear-gradient(90deg, var(--theme-primary-soft), var(--theme-accent-soft), transparent);
    box-shadow:
        inset 3px 0 0 var(--theme-primary),
        0 0 20px var(--theme-primary-soft);
}

body[data-site-theme] .admin-navigation a:hover span,
body[data-site-theme] .admin-navigation a.is-active span,
body[data-site-theme] .view-site-link,
body[data-site-theme] .module-badge,
body[data-site-theme] .status-chip,
body[data-site-theme] .admin-secondary-button {
    color: var(--theme-primary);
}

body[data-site-theme] .admin-nav-label,
body[data-site-theme] .admin-navigation em,
body[data-site-theme] .admin-user-card small,
body[data-site-theme] .admin-stat-card small,
body[data-site-theme] .system-status small,
body[data-site-theme] .next-package span,
body[data-site-theme] .admin-table-heading,
body[data-site-theme] .theme-option-copy small,
body[data-site-theme] .theme-save-bar small {
    color: var(--theme-muted);
}

body[data-site-theme] .admin-user-card strong,
body[data-site-theme] .admin-stat-card strong,
body[data-site-theme] .system-status strong,
body[data-site-theme] .next-package strong,
body[data-site-theme] .admin-table-row strong,
body[data-site-theme] .theme-option-topline strong,
body[data-site-theme] .theme-save-bar strong {
    color: var(--theme-text);
}

body[data-site-theme] .admin-stat-card:hover {
    border-color: color-mix(in srgb, var(--theme-primary) 62%, transparent);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 25px 58px rgba(0,0,0,.36),
        0 0 26px var(--theme-primary-soft);
}

body[data-site-theme] .admin-stat-icon,
body[data-site-theme] .user-avatar,
body[data-site-theme] .admin-menu-toggle {
    border-color: var(--theme-border);
    border-radius: calc(var(--theme-radius) * .55);
    color: var(--theme-accent-light);
    background: linear-gradient(145deg, var(--theme-accent-soft), var(--theme-primary-soft));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 22px var(--theme-accent-soft);
}

body[data-site-theme] .view-site-link,
body[data-site-theme] .module-badge,
body[data-site-theme] .status-chip,
body[data-site-theme] .admin-secondary-button {
    border-color: color-mix(in srgb, var(--theme-primary) 45%, transparent);
    background: var(--theme-primary-soft);
}

body[data-site-theme] .admin-table-row:not(.admin-table-heading):hover,
body[data-site-theme] .tournament-participant-row:hover {
    background: linear-gradient(90deg, var(--theme-primary-soft), var(--theme-accent-soft));
}

body[data-site-theme] .admin-logout {
    border-color: color-mix(in srgb, var(--theme-danger) 50%, transparent);
    color: color-mix(in srgb, var(--theme-danger) 75%, white);
    background: color-mix(in srgb, var(--theme-danger) 9%, transparent);
}

body[data-site-theme] .admin-logout:hover {
    border-color: var(--theme-danger);
    color: #fff;
    box-shadow: 0 0 20px color-mix(in srgb, var(--theme-danger) 22%, transparent);
}

body[data-site-theme] .field input,
body[data-site-theme] .field select,
body[data-site-theme] .field textarea,
body[data-site-theme] .admin-search-input,
body[data-site-theme] .live-setting-input {
    border-color: color-mix(in srgb, var(--theme-accent) 32%, transparent);
    border-radius: calc(var(--theme-radius) * .52);
    color: var(--theme-text);
    background: color-mix(in srgb, var(--theme-panel-strong) 92%, transparent);
}

body[data-site-theme] .field input:focus,
body[data-site-theme] .field select:focus,
body[data-site-theme] .field textarea:focus,
body[data-site-theme] .admin-search-input:focus,
body[data-site-theme] .live-setting-input:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px var(--theme-primary-soft), 0 0 18px var(--theme-primary-soft);
}

body[data-site-theme] .theme-option-card {
    border-color: color-mix(in srgb, var(--theme-accent) 22%, transparent);
    background: color-mix(in srgb, var(--theme-panel-strong) 92%, transparent);
}

body[data-site-theme] .theme-option-card:hover {
    border-color: color-mix(in srgb, var(--theme-primary) 62%, transparent);
    box-shadow: 0 18px 42px rgba(0,0,0,.28), 0 0 22px var(--theme-primary-soft);
}

body[data-site-theme] .theme-option-card.is-active,
body[data-site-theme] .theme-option-card:has(input:checked) {
    border-color: var(--theme-accent-light);
    box-shadow: 0 0 0 2px var(--theme-accent-soft), 0 20px 48px rgba(0,0,0,.32);
}

body[data-site-theme] .theme-selected-mark {
    color: var(--theme-button-text);
    background: color-mix(in srgb, var(--theme-primary) 58%, var(--theme-bg));
}


/* =========================================================
   v0.25.0 — premium epic themes
   ========================================================= */
body[data-site-theme="premium_dragon"] {
    --theme-radius: 18px;
    --theme-bg: #120604; --theme-bg-soft: #32100a; --theme-primary: #d5401d; --theme-primary-soft: rgba(213,64,29,.28);
    --theme-accent: #ff9f35; --theme-accent-light: #ffe09b; --theme-accent-soft: rgba(255,159,53,.24); --theme-text: #fff0df;
    --theme-muted: #c6a995; --theme-success: #ffcf65; --theme-danger: #ff513d; --theme-border: rgba(255,159,53,.46);
    --theme-panel: rgba(18,6,4,.84); --theme-panel-strong: rgba(14,5,3,.96); --premium-bg-image: url("../img/themes/premium_dragon.svg");
}
body[data-site-theme="premium_reaper"] {
    --theme-radius: 22px;
    --theme-bg: #07050d; --theme-bg-soft: #171029; --theme-primary: #6d39ff; --theme-primary-soft: rgba(109,57,255,.28);
    --theme-accent: #c88cff; --theme-accent-light: #efd4ff; --theme-accent-soft: rgba(200,140,255,.23); --theme-text: #f3eaff;
    --theme-muted: #b9a7c8; --theme-success: #72e6ca; --theme-danger: #ff5d8d; --theme-border: rgba(200,140,255,.44);
    --theme-panel: rgba(8,5,14,.86); --theme-panel-strong: rgba(6,4,12,.97); --premium-bg-image: url("../img/themes/premium_reaper.svg");
}
body[data-site-theme="premium_frost"] {
    --theme-radius: 28px;
    --theme-bg: #04101f; --theme-bg-soft: #0c2847; --theme-primary: #29baff; --theme-primary-soft: rgba(41,186,255,.28);
    --theme-accent: #d7f5ff; --theme-accent-light: #ffffff; --theme-accent-soft: rgba(215,245,255,.22); --theme-text: #edfaff;
    --theme-muted: #a5c3d4; --theme-success: #72f5db; --theme-danger: #ff7a93; --theme-border: rgba(174,235,255,.44);
    --theme-panel: rgba(4,16,31,.84); --theme-panel-strong: rgba(3,13,26,.97); --premium-bg-image: url("../img/themes/premium_frost.svg");
}
body[data-site-theme="premium_empire"] {
    --theme-radius: 14px;
    --theme-bg: #090703; --theme-bg-soft: #221a08; --theme-primary: #d1a546; --theme-primary-soft: rgba(209,165,70,.27);
    --theme-accent: #ffe28a; --theme-accent-light: #fff4bd; --theme-accent-soft: rgba(255,226,138,.25); --theme-text: #fff4d8;
    --theme-muted: #c3b28a; --theme-success: #b9e37f; --theme-danger: #e87954; --theme-border: rgba(255,226,138,.48);
    --theme-panel: rgba(10,8,3,.86); --theme-panel-strong: rgba(8,6,2,.97); --premium-bg-image: url("../img/themes/premium_empire.svg");
}
body[data-site-theme="premium_jade"] {
    --theme-radius: 24px;
    --theme-bg: #04120c; --theme-bg-soft: #0e2f20; --theme-primary: #19b777; --theme-primary-soft: rgba(25,183,119,.28);
    --theme-accent: #e6c86e; --theme-accent-light: #ffeaa3; --theme-accent-soft: rgba(230,200,110,.22); --theme-text: #eff9ed;
    --theme-muted: #a3bcae; --theme-success: #56eba4; --theme-danger: #e87565; --theme-border: rgba(230,200,110,.42);
    --theme-panel: rgba(4,18,12,.85); --theme-panel-strong: rgba(3,15,10,.97); --premium-bg-image: url("../img/themes/premium_jade.svg");
}
body[data-site-theme="premium_blood"] {
    --theme-radius: 12px;
    --theme-bg: #0b0405; --theme-bg-soft: #2b0a0e; --theme-primary: #bb182b; --theme-primary-soft: rgba(187,24,43,.28);
    --theme-accent: #ff6d32; --theme-accent-light: #ffc07e; --theme-accent-soft: rgba(255,109,50,.24); --theme-text: #fff0ea;
    --theme-muted: #c6a09a; --theme-success: #ffb34c; --theme-danger: #ff2e45; --theme-border: rgba(255,109,50,.44);
    --theme-panel: rgba(12,4,5,.86); --theme-panel-strong: rgba(9,3,4,.97); --premium-bg-image: url("../img/themes/premium_blood.svg");
}
body[data-site-theme="premium_celestial"] {
    --theme-radius: 26px;
    --theme-bg: #050b1d; --theme-bg-soft: #102758; --theme-primary: #2d78ff; --theme-primary-soft: rgba(45,120,255,.28);
    --theme-accent: #ffd66b; --theme-accent-light: #fff0b6; --theme-accent-soft: rgba(255,214,107,.24); --theme-text: #eef4ff;
    --theme-muted: #a9b5d0; --theme-success: #75e2c0; --theme-danger: #ff728c; --theme-border: rgba(255,214,107,.44);
    --theme-panel: rgba(5,11,29,.84); --theme-panel-strong: rgba(4,9,24,.97); --premium-bg-image: url("../img/themes/premium_celestial.svg");
}
body[data-site-theme="premium_void"] {
    --theme-radius: 30px;
    --theme-bg: #03060a; --theme-bg-soft: #071e24; --theme-primary: #00d6d2; --theme-primary-soft: rgba(0,214,210,.28);
    --theme-accent: #d6ff72; --theme-accent-light: #f0ffb7; --theme-accent-soft: rgba(214,255,114,.22); --theme-text: #eaffff;
    --theme-muted: #9fc1c0; --theme-success: #7dff9a; --theme-danger: #ff5d80; --theme-border: rgba(214,255,114,.42);
    --theme-panel: rgba(3,8,10,.86); --theme-panel-strong: rgba(2,6,8,.97); --premium-bg-image: url("../img/themes/premium_void.svg");
}

body[data-site-theme^="premium_"] {
    background:
        radial-gradient(circle at 72% 20%, var(--theme-primary-soft), transparent 28%),
        radial-gradient(circle at 18% 82%, var(--theme-accent-soft), transparent 26%),
        var(--theme-bg);
}

body[data-site-theme^="premium_"] .site-background,
body[data-site-theme^="premium_"] .admin-background {
    background:
        linear-gradient(90deg, rgba(0,0,0,.88), rgba(0,0,0,.36), rgba(0,0,0,.86)),
        linear-gradient(180deg, rgba(0,0,0,.18), var(--theme-bg)),
        var(--premium-bg-image) center / cover no-repeat;
    filter: saturate(1.08) contrast(1.08);
}

body[data-site-theme^="premium_"] .site-background::after,
body[data-site-theme^="premium_"] .admin-background::after {
    background:
        radial-gradient(circle at 72% 22%, var(--theme-accent-soft), transparent 24%),
        radial-gradient(circle at 18% 78%, var(--theme-primary-soft), transparent 27%),
        linear-gradient(180deg, transparent 48%, rgba(0,0,0,.78));
}

body[data-site-theme^="premium_"] .fantasy-panel,
body[data-site-theme^="premium_"] .glass-card,
body[data-site-theme^="premium_"] .public-player-card,
body[data-site-theme^="premium_"] .hall-player-card,
body[data-site-theme^="premium_"] .legend-card,
body[data-site-theme^="premium_"] .admin-panel {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 28px 82px rgba(0,0,0,.46),
        0 0 34px var(--theme-primary-soft);
    backdrop-filter: blur(18px);
}

body[data-site-theme^="premium_"] .section-kicker {
    letter-spacing: .22em;
    text-shadow: 0 0 14px var(--theme-primary-soft);
}

body[data-site-theme^="premium_"] .hero-copy h1,
body[data-site-theme^="premium_"] .players-hero h1,
body[data-site-theme^="premium_"] .hall-hero h1,
body[data-site-theme^="premium_"] .legend-hero h1,
body[data-site-theme^="premium_"] .public-page-hero h1 {
    text-shadow:
        0 0 24px var(--theme-primary-soft),
        0 0 44px var(--theme-accent-soft),
        0 12px 40px rgba(0,0,0,.7);
}
