:root {
    --bg-color: #1a100c; /* Deep wood brown fallback */
    --glass-bg: rgba(10, 5, 0, 0.7); /* Smoked dark glass with a hint of warm brown */
    --glass-border: rgba(255, 215, 0, 0.15); /* Subtle gold border */
    --text-main: #fdfbf7; /* Off-white for high readability */
    --text-muted: #c2b2a9; /* Warm muted text */
    --accent-1: #d4af37; /* Metallic Gold */
    --accent-2: #e5c158; /* Lighter Gold */
    --accent-3: #8b4513; /* Saddle Brown */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 40px 0; /* Add padding to prevent sticking to edges when scrolling */
    position: relative;
}

/* Hide the old orbs */
.background-orbs {
    display: none;
}

/* Luxurious Smoked Glass Container */
.glass-container {
    width: 90%;
    max-width: 1000px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255,255,255,0.1);
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-weight: 600;
    font-size: 2.5rem;
    letter-spacing: -1px;
    margin-bottom: 5px;
    background: linear-gradient(90deg, #fdfbf7, #d4af37);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.subtitle {
    color: var(--accent-1);
    font-size: 1.1rem;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--accent-2);
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-1);
    border-radius: 50%;
}

.pulse {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    animation: pulsing 2s infinite;
}

@keyframes pulsing {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(212, 175, 55, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

/* Grid Dashboard */
.grid-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.glass-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 20px;
    padding: 25px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.interactive:hover {
    transform: translateY(-5px);
    background: rgba(20, 10, 0, 0.6);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 15px 30px rgba(0,0,0,0.8), 0 0 15px rgba(212, 175, 55, 0.2);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.glass-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}

.glass-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.glass-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(0,0,0,0.5));
    color: var(--accent-1);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.interactive:hover .glass-btn {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.2), rgba(0,0,0,0.8));
    color: #fff;
    border-color: var(--accent-1);
}

.span-2 {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .span-2 { grid-column: span 1; }
}

/* AI Panel Specifics */
.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ai-header h3 {
    color: var(--accent-2);
}

.ai-stats {
    display: flex;
    gap: 20px;
}

.stat-box {
    flex: 1;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border: 1px solid rgba(255,215,0,0.1);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
}

.text-gradient {
    color: var(--accent-1);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.text-green { 
    color: #4ade80; 
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

/* Luxurious Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.8);
    border: 1px solid rgba(255,215,0,0.2);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 2px;
    bottom: 2px;
    background: linear-gradient(135deg, #fdfbf7, #d4af37);
    transition: .4s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.8);
}

input:checked + .slider {
    background-color: rgba(212, 175, 55, 0.3);
    border-color: var(--accent-1);
}

input:checked + .slider:before {
    transform: translateX(22px);
    background: linear-gradient(135deg, #fff, #ffdf00);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}


/* Adaptive AI Core v1.4.0 */
.ai-description {
    margin: 4px 0 0 !important;
    font-size: 0.78rem !important;
}

.ai-stats {
    flex-wrap: wrap;
}

.ai-stats .stat-box {
    min-width: 180px;
}

.text-muted {
    color: #9ca3af;
}

.text-warn {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.25);
}

.worker-pair-row {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.pair-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    background: rgba(0, 0, 0, 0.55);
    color: var(--text-main);
    outline: none;
    text-transform: uppercase;
}

.pair-input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.pair-button {
    width: auto;
    min-width: 140px;
}

.ai-note {
    margin: 12px 0 0 !important;
    font-size: 0.76rem !important;
    line-height: 1.5;
}

@media (max-width: 700px) {
    .worker-pair-row {
        flex-direction: column;
    }

    .pair-button {
        width: 100%;
    }
}

/* Karaoke Maker + Admin stack (v1.6.5) */
.home-side-stack {
    display: grid;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    min-width: 0;
}
.home-side-stack > .glass-card {
    min-height: 0;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.home-side-stack .card-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}
.home-side-stack .glass-card h3 {
    margin-bottom: 5px;
}
.home-side-stack .glass-card p {
    margin-bottom: 12px;
    line-height: 1.35;
}
.karaoke-maker-home-card {
    border-color: rgba(229, 193, 88, 0.28);
    background:
        radial-gradient(circle at 85% 15%, rgba(212,175,55,.11), transparent 42%),
        rgba(0,0,0,.45);
}
.karaoke-maker-home-card h3 {
    color: var(--accent-2);
}
@media (max-width: 768px) {
    .home-side-stack {
        grid-template-rows: auto;
    }
}
