html {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="light"] {
    --bg: #f4f4f8;
    --card: #ffffff;
    --card-hover: #f8f8fc;
    --accent: #6d4fe0;
    --accent-glow: rgba(109, 79, 224, 0.12);
    --text: #1a1a24;
    --text-dim: #6b6b80;
    --border: #e4e4ec;
}

html[data-theme="light"] .stars {
    opacity: 0.4;
}

html[data-theme="light"] .friend-avatar {
    background: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .login-card {
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.08);
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.theme-toggle:hover {
    border-color: var(--accent);
    background: var(--card-hover);
    transform: scale(1.05);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .theme-toggle {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}