* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background: #000;
    cursor: none;
}

body.active {
    cursor: default;
}

#clock {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: block;
}

/* Settings button */

#settings-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s, background 0.3s, border-color 0.3s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.active #settings-btn {
    opacity: 0.7;
}

#settings-btn:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
}

#settings-btn svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* Settings hint tooltip */

#settings-hint {
    position: fixed;
    top: 20px;
    left: 68px;
    background: rgba(18, 18, 20, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 14px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.4s, transform 0.4s;
    z-index: 10;
}

#settings-hint.visible {
    opacity: 1;
    transform: translateX(0);
}

#settings-hint::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: rgba(18, 18, 20, 0.88);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Overlay */

#overlay {
    position: fixed;
    inset: 0;
    z-index: 15;
    display: none;
}

#overlay.visible {
    display: block;
}

/* Settings panel */

#panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: rgba(18, 18, 20, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 20;
    overflow-y: auto;
    padding: 28px 20px;
    color: #ddd;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}

#panel::-webkit-scrollbar {
    width: 4px;
}

#panel::-webkit-scrollbar-track {
    background: transparent;
}

#panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
}

#panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

#panel.open {
    transform: translateX(0);
}

/* Panel header with close button */

#panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

#panel h2 {
    font-family: 'Jost', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    margin: 0;
}

#panel-close {
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    border-radius: 4px;
    color: #555;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

#panel-close:hover {
    color: #aaa;
}

#panel section {
    margin-bottom: 18px;
}

#panel section > label:first-child {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Tabs */

.tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-bar .tab {
    flex: 1;
    padding: 8px 4px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    font-family: inherit;
}

.tab-bar .tab:hover {
    color: #aaa;
}

.tab-bar .tab.active {
    color: #fff;
    border-bottom-color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

#appearance-tabs {
    margin-bottom: 18px;
}

/* Auto mode toggle */

#panel .auto-section {
    margin-bottom: 14px;
}

#panel .auto-section > label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #888;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}

/* Custom toggle switch */

.toggle-switch {
    position: relative;
    width: 34px;
    height: 20px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-switch .slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: background 0.25s;
    cursor: pointer;
}

.toggle-switch .slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #666;
    transition: transform 0.25s, background 0.25s;
}

.toggle-switch input:checked + .slider {
    background: rgba(0, 212, 232, 0.3);
}

.toggle-switch input:checked + .slider::after {
    transform: translateX(14px);
    background: #00d4e8;
}

/* Color circles */

#theme-grid,
#lume-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
}

.color-swatch:hover {
    transform: scale(1.12);
}

.color-swatch.selected {
    border-color: #fff;
}

.lume-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
}

.lume-swatch:hover {
    transform: scale(1.15);
}

.lume-swatch.selected {
    border-color: #fff;
}

/* Button groups */

.btn-group {
    display: flex;
    gap: 4px;
}

.btn-group button {
    flex: 1;
    padding: 6px 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-group button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.btn-group button.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Range slider */

input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    outline: none;
    margin-top: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
}

#glow-value {
    float: right;
    font-size: 11px;
    color: #999;
    text-transform: none;
    letter-spacing: 0;
}

/* Select */

#city-select {
    width: 100%;
    padding: 7px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #ddd;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

#city-select option {
    background: #1a1a1e;
}

/* Toggles */

#panel .toggle-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

#panel .toggle-group > label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #bbb;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
}


/* GitHub link */

#github-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #777;
    text-decoration: none;
    font-size: 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    transition: color 0.2s;
}

#github-link:hover {
    color: #bbb;
}

#github-link svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Mobile */

@media (max-width: 480px) {
    #panel {
        width: 100%;
    }
}

@media (hover: none) {
    body {
        cursor: default !important;
    }

    #settings-btn {
        opacity: 0.5 !important;
    }
}