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

body,
html {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    background-size: 400% 400%;
    animation: gradientBG 20s ease infinite;
    font-family: 'Exo 2', 'Arial', sans-serif;
    height: 100%;
    width: 100%;
}

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

canvas {
    display: block;
    background-color: rgba(0, 0, 0, 0.4);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.6);
    animation: fadeIn 1s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes glow {
    0% {
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.9));
    }
    100% {
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Styling for buttons that might be used in the game */
button {
    background: linear-gradient(to bottom, #4a90e2, #2171c7);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

button:hover {
    background: linear-gradient(to bottom, #63a4ff, #337bd5);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Styling for potential popups or notifications */
.popup {
    position: absolute;
    background: linear-gradient(135deg, rgba(26, 42, 60, 0.9), rgba(0, 0, 0, 0.95));
    color: white;
    padding: 20px;
    border-radius: 10px;
    z-index: 100;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    animation: fadeIn 0.3s ease-in-out;
}

/* Game end screen enhancements */
.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.5s ease-in-out;
}

.game-over-message {
    color: white;
    font-size: 3rem;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    animation: pulse 2s infinite;
}

/* Add subtle text glow effect for all text elements */
* {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

/* Restart button styling */
#restartBtn {
    position: fixed;
    top: 30px;
    right: 20px;
    z-index: 100;
    padding: 10px 20px;
    font-size: 16px;
    background: linear-gradient(to bottom, #4a5568, #2d3748);
    border: 2px solid #718096;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
}

#restartBtn:hover {
    background: linear-gradient(to bottom, #5a6578, #3d4758);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.5);
}

#restartBtn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Level Panel styling */
#levelPanel {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.level-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.record-time {
    color: #ffd700;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    min-width: 45px;
}

.level-btn {
    width: 50px;
    height: 50px;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(to bottom, #c0392b, #962d22);
    border: 3px solid #e74c3c;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.level-btn:hover {
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    transform: translateX(5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

.level-btn:active {
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.level-btn.active {
    background: linear-gradient(to bottom, #e74c3c, #ff6b5b);
    border-color: #fff;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.7), 0 4px 8px rgba(0, 0, 0, 0.4);
}