/* Silicon Tycoon - HUD Theme Panel */

/* ── HUD icon buttons (home + theme brush) ──────────────────────── */
.hud-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.hud-icon-btn:hover {
    background: rgba(0, 206, 209, 0.12);
    border-color: var(--teal-dark, #1a4a4a);
}

.hud-icon-btn.active {
    background: rgba(0, 206, 209, 0.18);
    border-color: var(--teal-primary, #00CED1);
}

body.theme-vanilla .hud-icon-btn:hover {
    background: rgba(74, 144, 226, 0.1);
    border-color: var(--border, #DDD);
}

body[data-theme="retro"] .hud-icon-btn:hover {
    background: rgba(230, 126, 34, 0.15);
    border-color: #E67E22;
}

body[data-theme="apple2"] .hud-icon-btn:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00FF00;
}

/* ── Theme sub-panel ────────────────────────────────────────────── */
#theme-panel {
    position: fixed;
    top: 36px;
    right: 0;
    z-index: 9998;
    display: flex;
    flex-direction: row;
    gap: 0;
    background: rgba(8, 18, 18, 0.97);
    border: 1px solid var(--teal-dark, #1a4a4a);
    border-top: none;
    border-radius: 0 0 0 6px;
    overflow: hidden;
    backdrop-filter: blur(6px);

    /* Slide-in animation */
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

/* On mobile, stretch full-width so all buttons are visible */
@media (max-width: 520px) {
    #theme-panel {
        left: 0;
        right: 0;
        border-radius: 0;
    }

    .theme-panel-btn {
        flex: 1;
        min-width: 0;
        padding: 8px 4px;
    }
}

#theme-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Each theme option button */
.theme-panel-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-right: 1px solid var(--teal-dark, #1a4a4a);
    color: var(--cream, #F5F5DC);
    cursor: pointer;
    font-family: var(--font-body, sans-serif);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background 0.12s;
    position: relative;
    min-width: 64px;
}

.theme-panel-btn:last-child {
    border-right: none;
}

.theme-panel-btn:hover:not(.theme-locked) {
    background: rgba(0, 206, 209, 0.12);
}

.theme-panel-btn.active {
    background: rgba(0, 206, 209, 0.15);
    color: var(--teal-light, #20B2AA);
}

.theme-panel-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.theme-panel-label {
    line-height: 1;
}

.theme-panel-check {
    position: absolute;
    top: 4px;
    right: 5px;
    font-size: 0.6rem;
    color: var(--teal-primary, #00CED1);
    font-weight: 700;
}

.theme-panel-btn.theme-locked {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Theme overrides */
body.theme-vanilla #theme-panel {
    background: rgba(245, 245, 245, 0.97);
    border-color: var(--border, #DDD);
    color: var(--text-dark, #333);
}

body.theme-vanilla .theme-panel-btn {
    color: var(--text-dark, #333);
    border-right-color: var(--border, #DDD);
}

body.theme-vanilla .theme-panel-btn:hover:not(.theme-locked) {
    background: rgba(74, 144, 226, 0.08);
}

body.theme-vanilla .theme-panel-btn.active {
    background: rgba(74, 144, 226, 0.12);
    color: var(--primary, #4A90E2);
}

body.theme-vanilla .theme-panel-check {
    color: var(--primary, #4A90E2);
}

body[data-theme="retro"] #theme-panel {
    background: rgba(20, 10, 5, 0.97);
    border-color: #E67E22;
}

body[data-theme="retro"] .theme-panel-btn {
    border-right-color: #4A2010;
}

body[data-theme="retro"] .theme-panel-btn:hover:not(.theme-locked) {
    background: rgba(230, 126, 34, 0.12);
}

body[data-theme="retro"] .theme-panel-btn.active {
    background: rgba(230, 126, 34, 0.18);
    color: #D4A76A;
}

body[data-theme="retro"] .theme-panel-check {
    color: #D4A76A;
}

body[data-theme="apple2"] #theme-panel {
    background: #000;
    border-color: #00FF00;
    border-radius: 0;
    font-family: 'Courier New', monospace;
}

body[data-theme="apple2"] .theme-panel-btn {
    border-right-color: #003300;
    color: #00FF00;
    font-family: 'Courier New', monospace;
}

body[data-theme="apple2"] .theme-panel-btn:hover:not(.theme-locked) {
    background: rgba(0, 255, 0, 0.1);
}

body[data-theme="apple2"] .theme-panel-btn.active {
    background: rgba(0, 255, 0, 0.15);
}

body[data-theme="apple2"] .theme-panel-check {
    color: #00FF00;
}
