
.theme-selector-wrapper {
    position: relative;
}

.theme-toggle-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
}

.theme-toggle-button:hover {
    background-color: var(--hover-primary);
}

.theme-selector-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 240px;
    padding: 16px;
    background-color: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-primary);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.theme-selector-wrapper[aria-expanded="true"] .theme-selector-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-selector-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-align: center;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

.theme-option:hover {
    background-color: var(--hover-primary);
}

.theme-option input[type="radio"] {
    display: none;
}

.theme-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.dark-preview {
    background: linear-gradient(135deg, #0b1020 0%, #1a2140 100%);
}









.theme-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    flex-grow: 1;
    text-align: center;
}

.theme-hint {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-primary);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.theme-toggle-button { color: var(--text-primary); }
.theme-option[aria-selected="true"], .theme-option:focus-visible { outline: 2px solid var(--accent-primary); }



.theme-selector-dropdown { max-height: min(560px, 75vh); overflow-y: auto; width: min(280px, calc(100vw - 32px)); min-width: 0; }
html[data-theme] {
 --bg: var(--bg-primary);
 --bg-soft: var(--bg-secondary);
 --card: var(--bg-card);
 --card-strong: var(--bg-tertiary);
 --text: var(--text-primary);
 --muted: var(--text-secondary);
 --border: var(--border-primary);
 --primary: var(--accent-primary);
 --primary-strong: var(--accent-hover);
 --accent: var(--accent-secondary);
 --danger: var(--error);
 --shadow: var(--shadow-lg);
 color-scheme: dark;
}


.midnight-preview { background: linear-gradient(135deg, #111823 50%, #387bff 50%); }
.theme-name { text-align: start; }
.theme-name small { display: block; color: var(--text-secondary); font-size: 11px; font-weight: 400; margin-top: 3px; }

.mobile-theme-choices { padding:16px 0; border-block:1px solid var(--border-primary); }
.mobile-theme-buttons { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:10px; }
.mobile-theme-buttons button { min-height:44px; border:1px solid var(--border-primary); border-radius:9px; background:var(--bg-card); color:var(--text-primary); padding:10px 14px; cursor:pointer; font-weight:600; }
.mobile-theme-buttons button[aria-pressed="true"] { border-color:var(--accent-primary); background:var(--hover-primary); box-shadow:inset 0 0 0 1px var(--accent-primary); }
.mobile-theme-buttons button:focus-visible { outline:2px solid var(--accent-primary); outline-offset:3px; }

.ember-preview { background:linear-gradient(135deg,#181512 50%,#ff8b45 50%); }
.mobile-theme-buttons { grid-template-columns:repeat(3,minmax(0,1fr)); }
.theme-save-error { padding:12px; color:#ffb2a0; font-size:12px; }

.theme-save-error:not(:empty) { position:fixed;bottom:24px;inset-inline:24px;z-index:3000;padding:16px 20px;background:#34201a;border:1px solid #b77a54;border-radius:4px; }

.command-preview { background:linear-gradient(135deg,#111518 50%,#ff781f 50%); }
.horizon-preview { background:linear-gradient(135deg,#fff9f3 50%,#ed5709 50%); }
.gameverse-preview { background:linear-gradient(135deg,#18120b 50%,#ffb344 50%); }
.wg-theme-logo { display:block; width:156px; height:auto; object-fit:contain; }
.em-auth-mark .wg-theme-logo { width:220px; max-width:100%; }
.mobile-theme-buttons { grid-template-columns:repeat(2,minmax(0,1fr)); }
.theme-selector-dropdown[hidden] { display:none; }
.theme-selector-dropdown { overscroll-behavior:contain; }
@media(max-width:600px){ .wg-theme-logo { width:125px; } .theme-selector-dropdown { position:fixed;top:76px;inset-inline:16px;width:auto;max-height:calc(100dvh - 100px); } }

.obsidian-preview {background:linear-gradient(135deg,#121315 50%,#d9bc80 50%);}

.arctic-preview {background:linear-gradient(135deg,#dce6eb 50%,#006b72 50%);}

.neon-preview {background:linear-gradient(135deg,#090e1c 50%,#4cdeee 50%);}

.tactical-preview {background:linear-gradient(135deg,#151b18 50%,#dfbd63 50%);}

.crimson-preview {background:linear-gradient(135deg,#171216 50%,#ff647e 50%);}

.theme-selector-dropdown { max-height:min(620px,calc(100dvh - 110px));overflow-y:auto; }
