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

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(120, 219, 226, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 15px 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.game-title {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(45deg, #00f5ff, #ff00ff, #00ff00);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(0, 245, 255, 0.5);
}

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

.score-container {
    display: flex;
    gap: 30px;
    align-items: center;
}

.score, .high-score {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.score {
    color: #00f5ff;
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

.high-score {
    color: #ffff00;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
}

.game-area {
    flex: 1;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

canvas {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #2a2a2a 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: block;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

.game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    animation: fadeIn 0.5s ease-out;
}

.game-over-overlay.show {
    display: flex;
}

.fullscreen-prompt {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    border-radius: 20px;
    z-index: 2;
}

.fullscreen-prompt.show {
    display: flex;
}

.fullscreen-prompt-content {
    text-align: center;
    max-width: 360px;
    margin: 0 16px;
    padding: 24px 20px;
    background: rgba(10, 10, 20, 0.86);
    border: 1px solid rgba(0, 245, 255, 0.35);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.fullscreen-prompt-content h2 {
    font-size: 1.5rem;
    color: #00f5ff;
    margin-bottom: 10px;
}

.fullscreen-prompt-content p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 18px;
    line-height: 1.35;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.game-over-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease-out 0.2s both;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-over-content h2 {
    font-size: 3rem;
    font-weight: 900;
    color: #ff4757;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
}

.final-score {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #00f5ff;
    font-weight: 700;
}

.restart-btn {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 15px 30px;
    background: linear-gradient(45deg, #00f5ff, #ff00ff);
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(0, 245, 255, 0.3);
}

.restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 245, 255, 0.4);
    background: linear-gradient(45deg, #ff00ff, #00f5ff);
}

.restart-btn:active {
    transform: translateY(-1px);
}

.restart-btn:focus-visible,
.game-btn:focus-visible,
.control-btn:focus-visible {
    outline: 3px solid #00f5ff;
    outline-offset: 3px;
}

.controls {
    margin-top: 20px;
    text-align: center;
}

.control-info {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 10px 20px;
    backdrop-filter: blur(5px);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    display: inline-block;
    margin-bottom: 20px;
}

.game-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.game-btn {
    font-family: 'Orbitron', monospace;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 245, 255, 0.5);
    border-radius: 10px;
    color: #00f5ff;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

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

.fullscreen-prompt-btn,
.fullscreen-primary {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    color: #041418;
    background: linear-gradient(45deg, #00f5ff, #5bffb2);
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.35);
}

.fullscreen-primary.attention {
    animation: pulseAttention 1.2s ease-in-out infinite;
}

@keyframes pulseAttention {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 12px rgba(0, 245, 255, 0.35);
    }
    50% {
        transform: scale(1.04);
        box-shadow: 0 0 26px rgba(0, 245, 255, 0.7);
    }
}

.mobile-only {
    display: none;
}

.mobile-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.control-row {
    display: flex;
    gap: 10px;
}

.control-btn {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 245, 255, 0.5);
    border-radius: 15px;
    color: #00f5ff;
    font-size: 24px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.control-btn:active {
    background: rgba(0, 245, 255, 0.3);
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.5);
}

@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .score-container {
        gap: 20px;
    }
    
    .game-over-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .game-over-content h2 {
        font-size: 2.5rem;
    }
    
    .mobile-controls {
        display: flex;
    }
    
    .control-info span {
        display: none;
    }
    
    .control-info::after {
        content: 'Tap direction to start • use Fullscreen for easier play';
    }
    
    .mobile-only {
        display: inline-block;
    }

    .fullscreen-primary {
        min-width: 180px;
        font-size: 1rem;
    }

    .game-container.mobile-immersive {
        max-width: none;
        padding: 6px;
    }

    .game-container.mobile-immersive .game-header,
    .game-container.mobile-immersive .control-info,
    .game-container.mobile-immersive .mobile-controls {
        display: none;
    }

    .game-container.mobile-immersive .controls {
        margin-top: 6px;
    }

    .game-container.mobile-immersive .game-buttons {
        margin-bottom: 6px;
    }
}