/* Shared preview palette, retained by the local PHP session across pages. */
:root {--cmd-art-light:#e9c58d;--cmd-button-light:#e7bd7b;--cmd-button-dark:#be854c;--cmd-art-hue:0deg;--cmd-art-saturation:1.45;}
/* Bright accents for dark surfaces, deeper ink for light surfaces.
   Button fills stay bright in both modes so dark labels retain contrast. */
:root[data-palette="copper"] {--cmd-brand:#ff986b;--cmd-highlight:#ffc09b;--cmd-deep:#a44724;--cmd-accent-rgb:255,152,107;--cmd-art-light:#ffc09b;--cmd-button-light:#ffc09b;--cmd-button-dark:#ff986b;--cmd-art-hue:-25deg;--cmd-art-saturation:2;}
:root[data-palette="ice"] {--cmd-brand:#62c4ff;--cmd-highlight:#b1e4ff;--cmd-deep:#17578c;--cmd-accent-rgb:98,196,255;--cmd-art-light:#b1e4ff;--cmd-button-light:#b1e4ff;--cmd-button-dark:#62c4ff;--cmd-art-hue:155deg;--cmd-art-saturation:2.1;}
:root[data-palette="emerald"] {--cmd-brand:#58dda7;--cmd-highlight:#a0f2cb;--cmd-deep:#17674b;--cmd-accent-rgb:88,221,167;--cmd-art-light:#a0f2cb;--cmd-button-light:#a0f2cb;--cmd-button-dark:#58dda7;--cmd-art-hue:95deg;--cmd-art-saturation:2;}
:root[data-palette="amethyst"] {--cmd-brand:#c19aff;--cmd-highlight:#e0caff;--cmd-deep:#61369a;--cmd-accent-rgb:193,154,255;--cmd-art-light:#e0caff;--cmd-button-light:#e0caff;--cmd-button-dark:#c19aff;--cmd-art-hue:220deg;--cmd-art-saturation:2;}
:root[data-theme="light"][data-palette="copper"] {--cmd-brand:#aa411b;--cmd-highlight:#8e3315;--cmd-deep:#67240d;--cmd-accent-rgb:170,65,27;}
:root[data-theme="light"][data-palette="ice"] {--cmd-brand:#08689f;--cmd-highlight:#075785;--cmd-deep:#063f62;--cmd-accent-rgb:8,104,159;}
:root[data-theme="light"][data-palette="emerald"] {--cmd-brand:#08744f;--cmd-highlight:#075d40;--cmd-deep:#04472f;--cmd-accent-rgb:8,116,79;}
:root[data-theme="light"][data-palette="amethyst"] {--cmd-brand:#713bb0;--cmd-highlight:#5f2999;--cmd-deep:#441a73;--cmd-accent-rgb:113,59,176;}
:root {--we-btn-bg:linear-gradient(135deg,var(--cmd-button-light),var(--cmd-button-dark));--we-btn-bg-hover:var(--cmd-art-light);}
html[data-palette] .we-hero {--we-accent:var(--cmd-art-light);}
html[data-palette] .we-hero-bg,
html[data-palette] .we-brand .we-brand-logo,
html[data-palette] .cmd-hero-logo,
html[data-palette] .sidebar-banner-join img,
html[data-palette] .cmd-start-guide .cmd-guide-banner-art,
html[data-palette] .cmd-news-thumb img {filter:grayscale(1) sepia(1) saturate(var(--cmd-art-saturation)) hue-rotate(var(--cmd-art-hue)) brightness(1.12);}
html[data-palette] .sidebar-banner-join:hover img,
html[data-palette] .cmd-start-guide:hover .cmd-guide-banner-art,
html[data-palette] .cmd-news-link:hover .cmd-news-thumb img {filter:grayscale(1) sepia(1) saturate(var(--cmd-art-saturation)) hue-rotate(var(--cmd-art-hue)) brightness(1.25);}
html[data-palette] .cmd-news-badge {background:color-mix(in srgb,var(--cmd-button-dark) 16%,#101113);}
html[data-palette] .we-hero .cmd-server-facts>div {border-color:rgba(var(--cmd-accent-rgb),.3)!important;}
html[data-palette] .we-hero .cmd-facts-medals>div {background:radial-gradient(circle at 50% 30%,rgba(var(--cmd-accent-rgb),.2),#101113dd 75%);box-shadow:inset 0 0 0 5px #141414,inset 0 0 0 6px rgba(var(--cmd-accent-rgb),.3),0 8px 22px #0005;}
html[data-palette] .we-hero .cmd-facts-console {border-color:rgba(var(--cmd-accent-rgb),.5);}
html[data-palette] .we-hero .cmd-facts-console dd {text-shadow:0 0 15px rgba(var(--cmd-accent-rgb),.2);}
html[data-palette] .we-hud-arcane-inner {border-color:rgba(var(--cmd-accent-rgb),.3);}
/* Footer surfaces and their text always use the same theme. */
html[data-theme] .we-footer {background:var(--we-bg-elevated)!important;color:var(--we-text-muted);border-color:var(--we-border);}
html[data-theme] .we-footer .we-footer-copy,
html[data-theme] .we-footer p,
html[data-theme] .we-footer .cmd-signature {color:var(--we-text-muted)!important;}
html[data-theme] .we-footer .footer-social-link.we-social-btn {background:rgba(var(--cmd-accent-rgb),.09)!important;color:var(--we-text)!important;border-color:var(--we-border);}
html[data-theme] .we-footer .footer-social-link svg {color:inherit!important;opacity:1;}
html[data-theme] .we-footer .footer-social-link:hover {background:rgba(var(--cmd-accent-rgb),.2)!important;color:var(--we-primary-light)!important;}
.cmd-palette-swatches a {display:flex;align-items:center;gap:7px;}
.cmd-palette-swatches i {display:block;width:16px;height:16px;flex-shrink:0;border-radius:50%;border:1px solid #ffffff65;background:var(--swatch);}
[data-swatch="gold"] {--swatch:#c59052;}[data-swatch="copper"] {--swatch:#ff986b;}[data-swatch="ice"] {--swatch:#62c4ff;}[data-swatch="emerald"] {--swatch:#58dda7;}[data-swatch="amethyst"] {--swatch:#c19aff;}
html[data-theme="light"] .we-footer .we-footer-links a,
html[data-theme="light"] .we-footer .footer-social-link.we-social-btn,
html[data-theme="light"] .we-footer .footer-social-link svg {color:var(--we-text-muted)!important;transition:background .2s,border-color .2s;}
html[data-theme="light"] .we-footer .we-footer-links a:hover {color:var(--cmd-highlight)!important;}
.cmd-preview-popover .cmd-preview-save {display:block;width:100%;margin-top:16px;padding:10px 8px;font-size:12px;font-weight:600;border:1px solid var(--cmd-button-dark);border-radius:7px;background:var(--cmd-button-light);color:#201810;}
.cmd-preview-save:disabled {opacity:.6;cursor:wait;}
#cmdPreviewSaveStatus {display:block;color:#f4eadb;font-size:11px;line-height:1.4;margin-top:8px;}

.cmd-preview-popover .cmd-preview-layout {grid-template-columns:1fr;}
/* Three footer compositions sharing theme, palette and existing destinations. */
.cmd-footer-design {position:relative;}
.cmd-footer-main {display:grid;gap:28px;align-items:center;padding:8px 0 28px;}
.cmd-footer-brand {display:flex;align-items:center;gap:14px;}
.cmd-footer-brand img {width:100px;height:84px;object-fit:contain;filter:grayscale(1) sepia(1) saturate(var(--cmd-art-saturation)) hue-rotate(var(--cmd-art-hue)) brightness(1.12);}
.cmd-footer-brand strong {display:block;font-family:var(--we-font-display);font-size:24px;color:var(--we-text);letter-spacing:-.03em;}
.cmd-footer-brand small {display:block;font-size:10px;letter-spacing:.16em;color:var(--we-primary-light);margin-top:6px;}
.cmd-footer-design h3 {margin:0 0 14px;font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--we-primary-light);}
.cmd-footer-legal {display:flex;gap:12px 24px;flex-wrap:wrap;}
.cmd-footer-legal a,.cmd-footer-explore a {font-size:12px;}
.cmd-footer-bottom {display:flex;justify-content:space-between;align-items:center;gap:24px;padding-top:22px;border-top:1px solid var(--we-border);}
.cmd-footer-bottom p {font-size:11px;line-height:1.7;margin:0;}
.cmd-footer-bottom .cmd-signature {white-space:nowrap;}
.cmd-footer-minimal .cmd-footer-main {grid-template-columns:1fr auto;}
.cmd-footer-minimal .cmd-footer-brand {border-left:3px solid var(--we-primary);padding-left:16px;}
.cmd-footer-minimal .cmd-footer-legal {grid-column:1/-1;grid-row:2;}
.cmd-footer-minimal .cmd-footer-community {grid-column:2;grid-row:1;}
.cmd-footer-emblem {padding-top:25px!important;}
.cmd-footer-emblem:before {content:'';position:absolute;top:0;left:20%;right:20%;height:1px;background:linear-gradient(90deg,transparent,var(--we-primary),transparent);}
.cmd-footer-emblem .cmd-footer-main {display:flex;flex-direction:column;gap:24px;background:radial-gradient(ellipse at 50% 15%,rgba(var(--cmd-accent-rgb),.08),transparent 65%);}
.cmd-footer-emblem .cmd-footer-brand {flex-direction:column;gap:4px;text-align:center;}
.cmd-footer-emblem .cmd-footer-brand img {width:120px;height:100px;}
.cmd-footer-emblem .cmd-footer-legal {justify-content:center;}
.cmd-footer-columns .cmd-footer-main {grid-template-columns:1.4fr 1fr 1.2fr auto;align-items:start;padding-top:12px;}
.cmd-footer-columns .cmd-footer-brand {align-items:flex-start;}
.cmd-footer-columns .cmd-footer-brand img {width:64px;height:54px;}
.cmd-footer-columns .cmd-footer-brand strong {font-size:20px;}
.cmd-footer-columns .cmd-footer-legal,.cmd-footer-explore {display:flex;flex-direction:column;gap:10px;}
.cmd-footer-columns h3 {margin-bottom:6px;}
@media(max-width:991px){.cmd-footer-columns .cmd-footer-main {grid-template-columns:1fr 1fr;}.cmd-footer-columns .we-footer-social {justify-content:flex-start;}}
@media(max-width:600px){
 .cmd-footer-main {gap:22px;}.cmd-footer-bottom {flex-direction:column;align-items:flex-start;gap:16px;}
 .cmd-footer-minimal .cmd-footer-main {display:flex;flex-direction:column;align-items:flex-start;}
 .cmd-footer-columns .cmd-footer-main {grid-template-columns:1fr 1fr;}.cmd-footer-columns .cmd-footer-brand,.cmd-footer-columns .cmd-footer-community {grid-column:1/-1;}
 .cmd-footer-emblem .cmd-footer-bottom {align-items:center;text-align:center;}
}
/* Community banners: restrained individual accents within the shared theme. */
html[data-palette] .cmd-sidebar-trio .sidebar-banner-join {border-color:#ad8060;box-shadow:0 0 18px #b56e3e15;}
html[data-palette] .cmd-sidebar-trio .sidebar-banner-join img {filter:grayscale(.8) sepia(.7) saturate(1.2) hue-rotate(-20deg) brightness(1.08);}
html[data-palette] .cmd-sidebar-trio .sidebar-banner-join:hover img {filter:grayscale(.7) sepia(.65) saturate(1.25) hue-rotate(-20deg) brightness(1.18);}
.cmd-sidebar-trio .sidebar-banner-join .cmd-join-copy {color:#f0d9ba;}
html[data-palette] .cmd-sidebar-trio .cmd-start-guide {border-color:#698e7c;box-shadow:0 0 18px #6fa68a15;}
html[data-palette] .cmd-sidebar-trio .cmd-start-guide .cmd-guide-banner-art {filter:grayscale(.12) sepia(.22) saturate(1.05) hue-rotate(38deg) brightness(1.08);}
html[data-palette] .cmd-sidebar-trio .cmd-start-guide:hover .cmd-guide-banner-art {filter:grayscale(0) sepia(.2) saturate(1.15) hue-rotate(38deg) brightness(1.16);}
.cmd-sidebar-trio .cmd-start-guide strong {color:#d5e9dc;}
.cmd-sidebar-trio .cmd-start-guide small {color:#9fcab0;}
.cmd-sidebar-trio .cmd-trio-discord {border-color:#7775b0;background:radial-gradient(ellipse at 15% 50%,#7772db25,transparent 70%),var(--we-bg-elevated);}
.cmd-sidebar-trio .cmd-trio-discord-icon {color:#a4a1ff;filter:drop-shadow(0 0 12px #8b83ff26);}
.cmd-sidebar-trio .cmd-trio-discord-action {color:#bcb9fb;}
.cmd-sidebar-trio .cmd-trio-discord:hover {border-color:#a4a1ff;box-shadow:0 0 20px #8b83ff22;}
html[data-theme="light"] .cmd-sidebar-trio .cmd-trio-discord-icon,
html[data-theme="light"] .cmd-sidebar-trio .cmd-trio-discord-action {color:#5751a5;}
/* The Discord banner stays dark like its two illustrated companions. */
html[data-theme="light"] .cmd-sidebar-trio .cmd-trio-discord {background:radial-gradient(ellipse at 15% 50%,#7772db25,transparent 70%),#191a1c;border-color:#7775b0;}
html[data-theme="light"] .cmd-sidebar-trio .cmd-trio-discord strong {color:#ede9e2;}
html[data-theme="light"] .cmd-sidebar-trio .cmd-trio-discord small {color:#b9b4c4;}
html[data-theme="light"] .cmd-sidebar-trio .cmd-trio-discord-icon {color:#a4a1ff;}
html[data-theme="light"] .cmd-sidebar-trio .cmd-trio-discord-action {color:#bcb9fb;}

/* Keep the preview shell translucent; controls need a stable contrast surface. */
.cmd-preview-popover a {background:rgba(12,15,19,.92);color:#f4f0ea;border-color:rgba(255,255,255,.3);}
.cmd-preview-popover a:hover {background:#292e35;color:var(--cmd-art-light);}
.cmd-preview-popover a[aria-current] {background:var(--cmd-button-light);color:#201810;border-color:var(--cmd-button-dark);}
.cmd-palette-swatches i {width:20px;height:20px;border:2px solid #ffffff90;box-shadow:0 0 0 1px #0006;}
.cmd-palette-swatches a[aria-current] i {border-color:#201810;}
html[data-palette] .atlas-hero-actions .atlas-primary {background:var(--cmd-button-light);border-color:var(--cmd-button-dark);color:#171411;}
/* Illustrated Discord companion: readable copy and a separate character area. */
html[data-theme] .cmd-sidebar-trio .cmd-trio-discord {position:relative;isolation:isolate;overflow:hidden;justify-content:flex-start;padding:18px 20px;background:#101016;border-color:#7775b0;}
.cmd-trio-discord .cmd-discord-banner-art {position:absolute;z-index:-1;right:0;top:0;width:57%;height:100%;object-fit:cover;object-position:32% 35%;filter:brightness(1.35) saturate(1.2);mask-image:linear-gradient(90deg,transparent,#000 24%);-webkit-mask-image:linear-gradient(90deg,transparent,#000 24%);transition:filter .25s;}
.cmd-trio-discord .cmd-discord-banner-copy {display:block;width:56%;position:relative;}
.cmd-trio-discord .cmd-trio-discord-icon {display:block;margin-bottom:7px;color:#b8b5ff;}
html[data-theme] .cmd-sidebar-trio .cmd-trio-discord strong {font-family:Georgia,serif;font-size:clamp(18px,1.55vw,26px);line-height:1.1;color:#e6dfff;margin:5px 0 9px;}
html[data-theme] .cmd-sidebar-trio .cmd-trio-discord small {font-size:8px;color:#d4cde7;}
html[data-theme] .cmd-sidebar-trio .cmd-trio-discord-action {font-size:10px;color:#c9c5ff;}
.cmd-trio-discord:hover .cmd-discord-banner-art {filter:brightness(1.5) saturate(1.25);}
@media(prefers-reduced-motion:reduce){.cmd-trio-discord .cmd-discord-banner-art{transition:none;}}
html[data-theme] .cmd-sidebar-trio .cmd-trio-discord strong {text-transform:uppercase;}

/* The footer uses a dark surface in both page themes. */
html[data-theme="light"] .we-footer {
    color-scheme:dark;
    --we-bg-elevated:#1a1b1b;
    --we-text:#ede9e2;
    --we-text-muted:#b4ada3;
    --we-text-dim:#a29a8f;
    --we-border:#36332e;
    --cmd-brand:var(--cmd-button-dark);
    --cmd-highlight:var(--cmd-art-light);
    --we-primary:var(--cmd-button-dark);
    --we-primary-light:var(--cmd-art-light);
    background:var(--we-bg-elevated)!important;
}

