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

body {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    color: #ffffff;
    font-family: 'Arial', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

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

.container {
    width: 100%;
    max-width: 800px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.1),
        inset 0 0 30px rgba(0, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.03) 50%,
        transparent 100%
    );
    animation: shine 10s linear infinite;
    pointer-events: none;
}

@keyframes shine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

h1 {
    font-size: 3rem;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 3px;
    background: linear-gradient(90deg, #00ffff, #ff00ff);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.game-container {
    margin: 20px auto;
    position: relative;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 255, 0.1);
}

#gameCanvas {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.2),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    margin: 0 auto;
    display: block;
    border: 1px solid rgba(0, 255, 255, 0.1);
}

.controls {
    margin: 20px auto;
    max-width: 200px;
    display: none;
}

.control-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 5px 0;
}

.control-button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(145deg, #1e1e1e, #2a2a2a);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 10px rgba(0, 255, 255, 0.2),
        inset 0 0 5px rgba(0, 255, 255, 0.1);
}

.control-button:active {
    transform: scale(0.95);
    box-shadow: 
        0 0 15px rgba(0, 255, 255, 0.4),
        inset 0 0 10px rgba(0, 255, 255, 0.2);
}

.game-controls {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.menu-button {
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: bold;
    background: linear-gradient(145deg, #1e1e1e, #2a2a2a);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 
        0 0 15px rgba(0, 255, 0, 0.3),
        inset 0 0 5px rgba(0, 255, 0, 0.1);
}

.menu-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 
        0 0 20px rgba(0, 255, 0, 0.5),
        inset 0 0 10px rgba(0, 255, 0, 0.2);
}

.menu-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.instructions {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.05);
}

.instructions h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.instructions p {
    margin: 10px 0;
    color: #fff;
    font-size: 1.1rem;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.level-up {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 3rem;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
}

.level-up.show {
    animation: levelUpAnim 1.5s ease-out forwards;
}

@keyframes levelUpAnim {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

.level {
    padding: 5px 15px;
    background: linear-gradient(145deg, #1e1e1e, #2a2a2a);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    transition: all 0.3s ease;
}

.level.pulse {
    animation: levelPulse 0.5s ease-out;
}

@keyframes levelPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    }
}

.rainbow-effect {
    animation: rainbowBorder 2s linear infinite;
}

@keyframes rainbowBorder {
    0% { border-color: #ff0000; }
    17% { border-color: #ff00ff; }
    33% { border-color: #0000ff; }
    50% { border-color: #00ffff; }
    67% { border-color: #00ff00; }
    83% { border-color: #ffff00; }
    100% { border-color: #ff0000; }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .controls {
        display: block;
    }

    .game-stats {
        font-size: 1rem;
    }

    .instructions {
        font-size: 0.9rem;
    }
}
