@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

:root {
    --neon-cyan: #00aaff;
    --neon-pink: #ff0055;
    --bg-dark: #050505;
    --glass-bg: rgba(20, 20, 20, 0.8);
}

body {
    font-family: 'Orbitron', sans-serif;
    color: white;
    user-select: none;
    touch-action: none; /* Prevent browser gestures like pull-to-refresh or scrolling */
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas when no UI is active */
}

.ui-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 40px 60px;
    border: 2px solid var(--neon-cyan);
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 0 20px var(--neon-cyan), inset 0 0 20px rgba(0, 170, 255, 0.2);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    align-items: center;
    z-index: 10;
}

.splash-logo {
    width: 200px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px var(--neon-cyan));
    animation: logo-pulse 3s infinite alternate;
}

.hidden {
    display: none !important;
}

/* Typography */
.neon-title {
    font-size: 4rem;
    margin: 0;
    color: #fff;
    text-shadow: 
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px var(--neon-cyan),
        0 0 40px var(--neon-cyan),
        0 0 80px var(--neon-cyan);
    letter-spacing: 5px;
}

.neon-text {
    font-size: 3rem;
    color: #fff;
    text-shadow: 0 0 10px var(--neon-cyan);
}

/* Buttons */
.neon-btn {
    background: transparent;
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 15px 40px;
    font-size: 1.5rem;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px var(--neon-cyan);
    border-radius: 5px;
}

.neon-btn:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 30px var(--neon-cyan);
}

.difficulty-select {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

/* Scoreboard Split */
#score-left, #score-right {
    position: absolute;
    top: 20px;
    font-size: 48px;
    font-weight: bold;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 30px;
    border: 2px solid;
    border-radius: 10px;
}

#score-left {
    left: 40px;
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px var(--neon-cyan), inset 0 0 10px var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

#score-right {
    right: 40px;
    color: var(--neon-pink);
    border-color: var(--neon-pink);
    box-shadow: 0 0 15px var(--neon-pink), inset 0 0 10px var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink);
}

.score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-box.player { color: var(--neon-cyan); }
.score-box.cpu { color: var(--neon-pink); }

.label {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

/* Countdown */
#countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10rem;
    color: #fff;
    text-shadow: 0 0 20px var(--neon-cyan);
    z-index: 8;
}

.controls-info {
    margin-top: 20px;
    font-size: 0.9rem;
    opacity: 0.7;
}



.neon-icon-btn {
    background: transparent;
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px var(--neon-cyan);
    position: absolute; /* Changed from static */
    top: auto; /* Remove top */
    bottom: 20px; /* Move to bottom */
    right: 20px;
    z-index: 100;
    pointer-events: auto; /* Enable clicking */
}

#view-btn {
    right: 80px; /* Offset for second button */
}

.neon-icon-btn:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 20px var(--neon-cyan);
}

.neon-icon-btn.muted {
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: 0 0 10px var(--neon-pink);
}

.neon-icon-btn.muted:hover {
    background: var(--neon-pink);
    color: #000;
    box-shadow: 0 0 20px var(--neon-pink);
}



/* Modal */


/* Neon IAD Logo */
/* Neon IAD Logo */
#neon-logo {
    position: absolute;
    top: 150px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    pointer-events: none;
    z-index: 100;
    
    /* Rectangular 3D Shape */
    border: 4px solid #00ffff;
    border-radius: 15px; /* Rounded corners */
    padding: 15px 30px; /* Reduced padding */
    background: rgba(0, 20, 40, 0.6);
    box-shadow: 
        0 0 10px #00ffff, 
        inset 0 0 20px #00ffff,
        0 0 50px rgba(0, 255, 255, 0.5);
    transform-style: preserve-3d;
    perspective: 500px;
    /* Buzzing Animation */
    /* Buzzing Animation Removed */
    /* animation: logo-buzz 0.1s infinite; */
    transform: translateX(-50%) scale(0.75); /* Resize to 75% */
}

/* 3D Effect Pseudo-elements */
#neon-logo::before {
    content: '';
    position: absolute;
    top: -10px; left: -10px; right: -10px; bottom: -10px;
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 20px; /* Rounded corners for outer border */
    z-index: -1;
    transform: translateZ(-20px);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
}

#neon-logo h1 {
    margin: 0;
    font-size: 80px; /* Keep base size, scaled by parent transform */
    font-weight: 900;
    color: #fff;
    text-shadow: 
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px #00ffff,
        0 0 40px #00ffff,
        0 0 80px #00ffff,
        0 0 120px #00ffff;
    letter-spacing: 10px;
    animation: neon-flicker 3s infinite alternate;
}

#neon-logo h4 {
    margin: 10px 0 0 0;
    font-size: 24px; /* Bigger */
    font-weight: 500;
    color: #ff00ff;
    text-shadow: 
        0 0 5px #ff00ff,
        0 0 10px #ff00ff,
        0 0 20px #ff00ff;
    letter-spacing: 5px;
    text-transform: uppercase;
}

/* @keyframes logo-buzz removed */

@keyframes neon-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        opacity: 1;
        text-shadow: 
            0 0 5px #fff,
            0 0 10px #fff,
            0 0 20px #00ffff,
            0 0 40px #00ffff,
            0 0 80px #00ffff,
            0 0 120px #00ffff;
    }
    20%, 24%, 55% {
        opacity: 0.8;
        text-shadow: none;
    }
}

/* Boot Splash */
#boot-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200; /* Topmost */
    transition: opacity 1s ease-out;
}

#boot-splash.fade-out {
    opacity: 0;
}

.boot-logo {
    width: 60%;
    max-width: 600px;
    height: auto;
    filter: drop-shadow(0 0 20px var(--neon-cyan));
    animation: logo-pulse 2s infinite alternate;
}

/* Electric Spark Particles */
.electric-spark {
    position: absolute;
    width: 2px;
    height: 6px;
    background: #00ffff;
    box-shadow: 0 0 5px #00ffff;
    pointer-events: none;
    z-index: 99;
    border-radius: 2px;
    opacity: 0;
}

/* Mobile Layout Fixes */
@media (max-width: 768px) {
    /* Reposition In-Game Logo on small screens */
    #neon-logo {
        display: block !important;
        top: 40px; /* Position between scoreboards */
        transform: translateX(-50%) scale(0.3); /* Smaller scale */
        width: 100%; /* Ensure container doesn't overflow */
    }
    
    #iad-logo-img {
        width: 200px; /* Smaller image */
    }

    /* Resize Splash Logo */
    .splash-logo {
        width: 150px;
        margin-bottom: 10px;
    }

    /* Resize Title */
    .neon-title {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }

    /* Resize Difficulty Buttons */
    .difficulty-select {
        flex-direction: column; /* Stack buttons */
        gap: 10px;
    }

    .neon-btn {
        padding: 10px 30px;
        font-size: 1.2rem;
    }
    
    /* Adjust Scoreboard */
    #score-left, #score-right {
        top: 10px;
        padding: 5px 15px;
        font-size: 32px;
    }
    
    #score-left { left: 10px; }
    #score-right { right: 10px; }
}
