:root {
    --color-bg: #050505;
    --color-accent: #ffffff; 
    --color-text: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    margin: 0;
    overflow: hidden;
    background-color: var(--color-bg);
    font-family: 'Inter', sans-serif;
    color: var(--color-text);
}

/* --- LOGIN SCREEN STYLES (NEW) --- */
#login-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #000000;
    z-index: 20000; /* Highest priority: Covers everything */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1.5s ease;
}

#login-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.glass-login-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 20px;
    width: 320px;
    text-align: center;
    transform-style: preserve-3d;
    perspective: 1000px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.glass-login-card h2 {
    margin: 0;
    font-size: 1.2rem;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

.input-group {
    position: relative;
    width: 100%;
}

#pass-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px;
    color: #fff;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 10px;
    outline: none;
    font-family: 'Courier New', Courier, monospace;
    transition: border-color 0.3s;
    box-sizing: border-box; 
}

#pass-input:focus {
    border-bottom: 1px solid #fff;
}

#login-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 12px;
    font-size: 0.9rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
}

#login-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

#login-msg {
    min-height: 20px;
    color: #ff4444;
    font-size: 0.8rem;
    letter-spacing: 1px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake-anim {
    animation: shake 0.4s ease-in-out;
}

/* TERMINAL / INTRO OVERLAY (Layer 2) */
#intro-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #000000;
    z-index: 10000; /* High priority, but below login screen */
    transition: opacity 2.5s ease, background-color 2.5s ease;
    display: block; /* Visible by default (blocked by login) */
}

#intro-overlay.overlay-hidden {
    opacity: 0;
    pointer-events: none;
}

/* TEXT STYLES */
#terminal-text {
    position: absolute;
    top: 20px;       
    left: 20px;      
    font-family: 'Courier New', Courier, monospace;
    color: #ffffff;
    font-weight: normal; 
    font-size: 0.85rem;  
    line-height: 1.4rem; 
    white-space: pre-wrap;
    opacity: 0.8;        
}

#terminal-text::after {
    content: '█';
    display: inline-block;
    margin-left: 5px;
    color: #ffffff;
    animation: blink 1s step-end infinite;
    vertical-align: middle;
    font-size: 0.85rem;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* UI & CANVAS */
#canvas-container {
    position: absolute;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 1;
    background: radial-gradient(circle at center, #11111f 0%, #000000 100%);
}

#webcam { position: absolute; opacity: 0; pointer-events: none; }

#ui-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2; pointer-events: none;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}

#loading {
    font-size: 0.8rem; letter-spacing: 5px; color: #fff; opacity: 0.6;
    animation: pulse 1.5s infinite ease-in-out;
}

/* --- INSTRUCTIONS CONTAINER & SLIDE LOGIC --- */
#instructions-container {
    position: absolute; 
    bottom: 30px; 
    left: 50%; 
    transform: translateX(-50%) translateY(150%);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 20;
}

#instructions-container.visible {
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* FLOATING ARROW HEAD */
#floating-arrow {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; 
}

#floating-arrow.visible {
    opacity: 1;
}

#floating-arrow:hover {
    color: rgba(255, 255, 255, 1);
    transform: translateX(-50%) scale(1.1);
}

#floating-arrow svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

/* PANEL TOGGLE ARROW */
#panel-toggle {
    width: 40px;
    height: 40px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: auto;
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: all 0.3s ease;
    transform: rotate(180deg);
    margin-bottom: 10px;
}

#panel-toggle:hover {
    color: rgba(255, 255, 255, 1);
    transform: rotate(180deg) scale(1.1);
}

#panel-toggle svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

/* GESTURE PANEL */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 15px 20px;
    overflow: hidden;
    position: relative;
    width: auto;
    min-width: 400px;
    pointer-events: auto;
}

#panel-content {
    opacity: 1;
}

h3 {
    margin: 0 0 15px 0;
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

/* GESTURE GRID */
.gesture-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    text-align: center;
}

.gesture-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    padding: 5px;
    min-width: 60px;
}

.gesture-item span {
    font-weight: 600;
    color: #fff;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.gesture-item small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
}

.gesture-footer {
    margin-top: 15px;
    font-size: 0.65rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
}

/* FULLSCREEN BUTTON */
#fullscreen-btn {
    position: absolute;
    bottom: 30px; 
    right: 30px;  
    width: 40px; height: 40px;
    background: transparent; 
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 10001; 
    transition: opacity 0.3s ease;
    color: rgba(255, 255, 255, 0.5); 
    pointer-events: auto;
}

#fullscreen-btn:hover { 
    color: rgba(255, 255, 255, 1); 
    background: transparent; 
}

#fullscreen-btn svg { width: 28px; height: 28px; }

@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* --- DYNAMIC DESCRIPTION TEXTS --- */
#saturn-text, #infinity-text, #sun-text, #moon-text, #heart-text {
    position: absolute;
    top: 45%; 
    left: 65%;
    font-family: 'Courier New', Courier, monospace;
    color: #ffffff;
    font-size: 1.5rem;
    white-space: pre; 
    z-index: 10;
    pointer-events: none;
    line-height: 1.5; 
}

/* Specific Glow Colors */
#saturn-text { text-shadow: 0 0 10px rgba(255, 170, 0, 0.5); }
#infinity-text { text-shadow: 0 0 10px rgba(0, 255, 255, 0.5); }
#sun-text { text-shadow: 0 0 15px rgba(255, 200, 0, 0.8); }
#moon-text { text-shadow: 0 0 10px rgba(200, 240, 255, 0.6); }
#heart-text { text-shadow: 0 0 10px rgba(255, 0, 0, 0.5); }

/* Blinking Cursor for all */
#saturn-text.active::after,
#infinity-text.active::after,
#sun-text.active::after,
#moon-text.active::after,
#heart-text.active::after {
    content: '█';
    display: inline-block;
    margin-left: 5px;
    color: #ffffff;
    animation: blink 1s step-end infinite;
    vertical-align: middle;
}