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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #fff;
    overflow-x: hidden;
    overflow: hidden;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: glow 3s infinite alternate;
    width: 95%;
    max-width: 650px;
    margin: 20px 10px;
}

@keyframes glow {
    0% {
        box-shadow: 0 0 25px rgba(0, 245, 212, 0.3);
    }
    100% {
        box-shadow: 0 0 35px rgba(0, 187, 249, 0.5);
    }
}

h1 {
    font-size: clamp(24px, 6vw, 32px);
    font-weight: 700;
    letter-spacing: 3px;
    color: #00f5d4;
    text-shadow: 0 0 10px rgba(0, 245, 212, 0.5);
    margin-bottom: 5px;
    text-align: center;
}

.score-container {
    font-size: clamp(20px, 5vw, 28px);
    font-weight: 700;
    color: #00f5d4;
    text-shadow: 0 0 10px rgba(0, 245, 212, 0.5);
}

canvas {
    background-color: rgba(255, 255, 255, 0.05);
    border: 3px solid #00f5d4;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 245, 212, 0.3);
    max-width: 100%;
    height: auto;
    display: block;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

button {
    padding: 12px 30px;
    font-size: clamp(16px, 4vw, 18px);
    font-weight: 600;
    background: linear-gradient(90deg, #00f5d4, #00bbf9);
    color: #1a1a2e;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px rgba(0, 245, 212, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 20px rgba(0, 245, 212, 0.4);
}

button:active {
    transform: translateY(1px);
}

.instructions {
    text-align: center;
    margin-top: 15px;
    color: #bed8d4;
    max-width: 280px;
    font-size: clamp(0.8rem, 3vw, 0.9rem);
    margin-bottom: 10px;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 5px;
}

.instructions p {
    margin: 8px 0;
}

/* Game over message styling */
.game-over-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 46, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.game-over-content {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #00f5d4;
    box-shadow: 0 0 25px rgba(0, 245, 212, 0.5);
    animation: pulse 1.5s infinite alternate;
}

.game-over-content h2 {
    color: #00f5d4;
    font-size: 28px;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(0, 245, 212, 0.5);
}

.game-over-content p {
    color: white;
    font-size: 20px;
    margin-bottom: 20px;
}

.game-over-content button {
    margin-top: 10px;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 25px rgba(0, 245, 212, 0.3);
    }
    100% {
        box-shadow: 0 0 35px rgba(0, 187, 249, 0.7);
    }
}

/* Custom scrollbar for instructions */
.instructions::-webkit-scrollbar {
    width: 4px;
}

.instructions::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.instructions::-webkit-scrollbar-thumb {
    background: rgba(0, 245, 212, 0.5);
    border-radius: 10px;
}

.instructions::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 245, 212, 0.7);
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .game-container {
        padding: 15px;
        gap: 15px;
        margin: 15px 10px 30px 10px;
    }
    
    button {
        padding: 10px 25px;
    }
    
    .game-over-content {
        padding: 20px;
        width: 80%;
    }
    
    .game-over-content h2 {
        font-size: 24px;
    }
    
    .game-over-content p {
        font-size: 18px;
    }
    
    .instructions {
        font-size: clamp(0.75rem, 2.8vw, 0.85rem);
        line-height: 1.4;
        max-height: 120px;
    }
    
    .instructions p {
        margin: 6px 0;
    }
}

/* Hide/show elements based on device */
@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none;
    }
}