:root {
    --primary-color: #e0e0e0;
    --secondary-color: #121212;
    --accent-color: #ff79c6;
    /* Pink/Purple accent */
    --accent-secondary: #8be9fd;
    /* Cyan accent */
    --bg-overlay: rgba(20, 20, 20, 0.6);
    --font-title: 'Dancing Script', cursive;
    --font-ui: 'Space Mono', monospace;
    /* Retro tech feel */
    --transition-speed: 0.3s;
    --border-radius: 12px;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: var(--font-ui);
    color: var(--primary-color);
    background-color: var(--secondary-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* CRT/Grain Effect Overlay */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px);
    pointer-events: none;
    z-index: 999;
    opacity: 0.3;
}

/* Video Background */
#video-container {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -2;
}

#bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

/* WebGL Canvas */
#gl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}

/* Main Layout */
.main-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Align to bottom */
    padding-bottom: 5vh;
    z-index: 1;
}

.player-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-left: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--border-radius);
    padding: 30px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* Subtle glow inside the card */
.player-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.title-container {
    position: absolute;
    top: 10vh;
    left: 0;
    width: 100%;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

.title-container h1 {
    font-family: var(--font-title);
    font-size: 4rem;
    margin-bottom: 0.5rem;
    color: #fff;
    text-shadow: 0 0 15px var(--accent-color);
    /* Neon glow */
}

.title-container p {
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Controls */
h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 20px;
    color: var(--accent-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    display: inline-block;
}

.controls-group {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

button {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    font-size: 1rem;
    font-family: var(--font-ui);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

/* Sliders */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    max-width: 250px;
    background: transparent;
    margin: 10px;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

input[type=range]::-webkit-slider-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--accent-secondary);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -6px;
    box-shadow: 0 0 10px var(--accent-secondary);
    transition: transform 0.2s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Login Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: #1a1a1a;
    color: var(--primary-color);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--accent-color);
    width: 90%;
    max-width: 400px;
    border-radius: var(--border-radius);
    box-shadow: 0 0 30px rgba(255, 121, 198, 0.2);
    position: relative;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #666;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--accent-color);
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--accent-secondary);
    text-transform: uppercase;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-family: var(--font-ui);
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-secondary);
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.cancel-btn {
    background-color: transparent;
    border-color: #ff5555;
    color: #ff5555;
}

.cancel-btn:hover {
    background-color: #ff5555;
    color: white;
    box-shadow: 0 0 15px #ff5555;
}

/* Responsive */
@media (max-width: 600px) {
    .title-container {
        top: 5vh;
    }

    .title-container h1 {
        font-size: 3rem;
    }

    .player-box {
        padding: 20px;
        width: 95%;
    }

    button {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
}