@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

:root {
    --ball-color: #3b82f6;
    --target-color: #22c55e;
}

/* Unified Background Protocol */
body {
    background: #020617; /* Deepest blue base */
    background-image: 
        radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 100%),
        repeating-linear-gradient(0deg, rgba(0,0,0,0.15) 0px, rgba(0,0,0,0.15) 1px, transparent 1px, transparent 2px);
    background-size: 100% 100%, 100% 3px;
    touch-action: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

/* Neural Energy Orbs - Shared across all pages */
.neural-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.25;
    animation: orb-drift 20s infinite alternate ease-in-out;
}

.orb-blue {
    top: -10%;
    left: -10%;
    width: 45vw;
    height: 45vw;
    background: #3b82f6;
}

.orb-purple {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: #8b5cf6;
    animation-delay: -5s;
}

@keyframes orb-drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.1); }
}

.font-inter { font-family: 'Inter', sans-serif; }

.p-safe {
    padding-top: env(safe-area-inset-top, 10px);
    padding-bottom: env(safe-area-inset-bottom, 10px);
}

.brand-glow {
    text-shadow: 0 0 20px currentColor;
}

/* Color Swatches */
.color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}
.color-swatch.active {
    border-color: #fff;
    transform: scale(1.2) rotate(45deg);
    box-shadow: 0 0 10px white;
}

/* Buttons */
.btn-locked {
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.btn-ready {
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    pointer-events: auto;
}

/* Floating Animation */
.floating-score {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    animation: floatUp 0.8s ease-out forwards;
    text-align: center;
    transform: translate(-50%, -50%);
}

@keyframes floatUp {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -150%) scale(1.5); }
}

/* Toggles */
.toggle-active .toggle-bar {
    width: 100% !important;
}

/* System Failure - One shot impact */
.system-failure {
    background: #1a0505 !important;
    animation: crash-sequence 0.4s ease-out;
    animation-iteration-count: 1;
}

@keyframes crash-sequence {
    0% { background: #020617; transform: translateX(0); }
    10% { background: #ef4444; transform: translateX(-10px); }
    20% { background: #020617; transform: translateX(10px); }
    30% { background: #ef4444; transform: translateX(-5px); }
    40% { background: #020617; transform: translateX(5px); }
    100% { background: #1a0505; transform: translateX(0); }
}

.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(59, 130, 246, 0.2); border-radius: 10px; }


/* Add to your CSS */
.hud-border {
    clip-path: polygon(10% 0, 90% 0, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0 90%, 0 10%);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.scanline {
    background: linear-gradient(to bottom, rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%);
    background-size: 100% 4px;
    pointer-events: none;
}

@keyframes glitch-shake {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.animate-glitch {
    animation: glitch-shake 0.3s cubic-bezier(.25,.46,.45,.94) both infinite;
}


#game-over-overlay {
    /* Change from solid red to a deep, blurred glass look */
    background: rgba(2, 6, 23, 0.9) !important; 
    backdrop-filter: blur(20px) !important;
    border: 2px solid rgba(239, 68, 68, 0.2) !important;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), inset 0 0 60px rgba(239, 68, 68, 0.05) !important;
}

.reboot-glow {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.4);
    border: none;
}

.stat-divider {
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.1), transparent);
}



/* Glitch effect for the header */
.animate-glitch {
    text-shadow: 2px 0 #ff00c1, -2px 0 #00fff9;
    animation: glitch-anim 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip-path: inset(20% 0 30% 0); transform: skew(0.2deg); }
    20% { clip-path: inset(60% 0 10% 0); transform: skew(-0.2deg); }
    40% { clip-path: inset(10% 0 80% 0); transform: skew(0.4deg); }
    60% { clip-path: inset(45% 0 25% 0); transform: skew(-0.4deg); }
    80% { clip-path: inset(85% 0 5% 0); transform: skew(0.1deg); }
    100% { clip-path: inset(0 0 0 0); transform: skew(0); }
}

/* Background scanlines */
.scanline {
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 0, 0, 0.3) 50%
    );
    background-size: 100% 4px;
}

/* Ensure the score in Game Over glows like the main score */
#final-score-val {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}


/* Music/SFX Toggle Off State */
.setting-disabled {
    opacity: 0.3; /* Dims the text significantly */
    text-shadow: none !important; /* Removes the glow */
    transition: all 0.3s ease;
}

/* Optional: Add a slight hover effect so users know they can still click it */
.setting-disabled:hover {
    opacity: 0.5;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
}

.toggle-label {
    font-family: 'Orbitron', sans-serif; /* Matching your game font */
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #94a3b8;
}

.toggle-switch {
    width: 34px;
    height: 18px;
    background: #1e293b; /* Dark track */
    border-radius: 20px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.toggle-handle {
    width: 12px;
    height: 12px;
    background: #475569; /* Grey handle when off */
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 3px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* --- ON STATE (NEON BLUE) --- */
.toggle-status-on span {
    color: #ffffff !important;
    text-shadow: 0 0 10px #3b82f6 !important;
}

.toggle-status-on .toggle-bar {
    width: 100% !important;
    background: #3b82f6 !important;
    box-shadow: 0 0 12px #3b82f6;
}

/* --- OFF STATE (NEON RED) --- */
.toggle-status-off span {
    color: #ff4444 !important; /* Pure Neon Red */
    text-shadow: 0 0 10px #ff4444 !important;
    opacity: 1 !important; /* Keep opacity high so they can see the button */
}

.toggle-status-off .toggle-bar {
    width: 100% !important; /* Bar stays full width but changes color */
    background: #ff4444 !important;
    box-shadow: 0 0 12px #ff4444;
}

/* Hover effect to show interactivity */
.group:hover {
    transform: translateY(-1px);
    filter: brightness(1.2);
}



ins.adsbygoogle {
    background: transparent !important;
    border-radius: 1rem;
    overflow: hidden;
}