/* Wave Mode - Retro Arcade Theme */

* { 
    box-sizing: border-box; 
}

html, body { 
    height: 100%; 
    margin: 0;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #0a0a0a;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 0, 150, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 0, 0.05) 0%, transparent 50%);
    color: #00ffff;
    position: relative;
}

/* Animated scanline effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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: 1000;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.wrap { 
    max-width: 1000px; 
    margin: 0 auto; 
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Retro Topbar */
.topbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 24px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ffff;
    border-radius: 0;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.5),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    position: relative;
}

.topbar::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ff00ff, #00ffff);
    background-size: 400% 400%;
    animation: borderGlow 3s ease infinite;
    z-index: -1;
    filter: blur(8px);
}

@keyframes borderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.topbar h1 { 
    margin: 0;
    font-size: 32px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: #00ffff;
    text-shadow: 
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 30px #00ffff;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { 
        text-shadow: 
            0 0 10px #00ffff,
            0 0 20px #00ffff,
            0 0 30px #00ffff;
    }
    50% { 
        text-shadow: 
            0 0 15px #00ffff,
            0 0 30px #00ffff,
            0 0 45px #00ffff,
            0 0 60px rgba(0, 255, 255, 0.5);
    }
}

.home {
    color: #00ffff;
    text-decoration: none;
    border: 2px solid #00ffff;
    padding: 10px 16px;
    border-radius: 0;
    transition: all 0.3s ease;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.9);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.home:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
    transform: translateY(-2px);
}

/* Menu */
.menu {
    display: block;
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #00ffff;
    border-radius: 0;
    padding: 40px;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.6),
        inset 0 0 30px rgba(0, 255, 255, 0.1);
}

.menu-content {
    text-align: center;
}

.menu-content h2 {
    color: #00ffff;
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 30px 0 20px 0;
    text-shadow: 
        0 0 10px #00ffff,
        0 0 20px #00ffff;
}

.menu-content h2:first-child {
    margin-top: 0;
}

.difficulty-buttons,
.speed-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.difficulty-btn,
.speed-btn {
    padding: 16px 32px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ffff;
    border-radius: 0;
    color: #00ffff;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.difficulty-btn:hover,
.speed-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.6);
    transform: translateY(-2px);
}

.difficulty-btn.active,
.speed-btn.active {
    background: rgba(0, 255, 255, 0.3);
    border-color: #ff00ff;
    color: #ff00ff;
    box-shadow: 
        0 0 25px rgba(255, 0, 255, 0.6),
        inset 0 0 15px rgba(255, 0, 255, 0.2);
    text-shadow: 
        0 0 10px #ff00ff,
        0 0 20px #ff00ff;
}

.instructions {
    margin-top: 40px;
    padding: 24px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 0;
    text-align: left;
}

.instructions h3 {
    color: #00ffff;
    font-size: 20px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 16px 0;
    text-shadow: 0 0 10px #00ffff;
}

.instructions p {
    color: #bcdcff;
    font-size: 16px;
    line-height: 1.8;
    margin: 12px 0;
}

.instructions strong {
    color: #ff00ff;
    text-shadow: 0 0 8px #ff00ff;
}

.start-btn {
    margin-top: 30px;
    padding: 20px 60px;
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #00ffff;
    border-radius: 0;
    color: #00ffff;
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.5),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.start-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #ff00ff;
    color: #ff00ff;
    box-shadow: 
        0 0 30px rgba(255, 0, 255, 0.7),
        inset 0 0 30px rgba(255, 0, 255, 0.2);
    transform: translateY(-2px) scale(1.05);
    text-shadow: 
        0 0 10px #ff00ff,
        0 0 20px #ff00ff;
}

.start-btn:active {
    transform: translateY(0) scale(1);
}

/* Game Container */
.game-container {
    display: none;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ffff;
    border-radius: 0;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.stats div {
    font-size: 18px;
    font-weight: 700;
    color: #00ffff;
    text-shadow: 0 0 8px #00ffff;
}

.stats span {
    color: #ff00ff;
    text-shadow: 0 0 8px #ff00ff;
    font-size: 20px;
}

/* Canvas */
canvas { 
    background: rgba(0, 0, 0, 0.95);
    border: 3px solid #00ffff;
    border-radius: 0;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.5),
        inset 0 0 30px rgba(0, 255, 255, 0.1);
    display: block;
    margin: 0 auto;
    cursor: pointer;
}

.canvas-wrapper {
    position: relative;
    display: inline-block;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: rgba(0, 0, 0, 0.95);
    border: 4px solid #00ffff;
    color: #00ffff;
    font-size: 32px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, border-color 0.3s ease;
    z-index: 100;
    box-shadow: 
        0 0 40px rgba(0, 255, 255, 0.8),
        inset 0 0 40px rgba(0, 255, 255, 0.2);
}

.overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
}

.overlay-content {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
    text-shadow: 
        0 0 15px currentColor,
        0 0 30px currentColor,
        0 0 45px currentColor;
    animation: overlayPulse 2s ease-in-out infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.overlay-content h2 {
    margin: 0;
    font-size: 48px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 6px;
}

.overlay-content p {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #bcdcff;
}

/* Paused state */
.overlay.visible.paused {
    border-color: #ff00ff;
    box-shadow: 
        0 0 40px rgba(255, 0, 255, 0.8),
        inset 0 0 40px rgba(255, 0, 255, 0.2);
}

.overlay.visible.paused .overlay-content {
    color: #ff00ff;
    text-shadow: 
        0 0 15px #ff00ff,
        0 0 30px #ff00ff,
        0 0 45px #ff00ff;
}

/* Gameover state */
.overlay.visible.gameover {
    border-color: #ffff00;
    box-shadow: 
        0 0 40px rgba(255, 255, 0, 0.8),
        inset 0 0 40px rgba(255, 255, 0, 0.2);
}

.overlay.visible.gameover .overlay-content {
    color: #ffff00;
    text-shadow: 
        0 0 15px #ffff00,
        0 0 30px #ffff00,
        0 0 45px #ffff00;
}

@keyframes overlayPulse {
    0%, 100% { 
        transform: scale(1);
    }
    50% { 
        transform: scale(1.02);
    }
}

.controls-hint {
    margin-top: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 0;
    text-align: center;
}

.controls-hint p {
    margin: 0;
    color: #bcdcff;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 768px) {
    .wrap {
        padding: 12px;
    }
    
    .topbar h1 {
        font-size: 24px;
        letter-spacing: 2px;
    }
    
    .menu {
        padding: 24px;
    }
    
    .menu-content h2 {
        font-size: 20px;
    }
    
    .difficulty-btn,
    .speed-btn {
        padding: 12px 24px;
        font-size: 16px;
    }
    
    .difficulty-buttons,
    .speed-buttons {
        gap: 12px;
    }
    
    canvas {
        width: 100%;
        height: auto;
    }
    
    .stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .overlay-content h2 {
        font-size: 32px;
    }
    
    .overlay-content p {
        font-size: 14px;
    }
}

