body {
    background: linear-gradient(180deg, #120021, #1e90ff, #ff00ff, #1e90ff, #120021);
    background-size: 500%;
    color: #e0e0e0;
    font-family: 'VT323', monospace;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 20px;
    position: relative;
    overflow: hidden;
    animation: skyShift 30s ease infinite;
}

@keyframes skyShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="2" fill="white" opacity="0.2"/></svg>') repeat;
    animation: rainFall 60s linear infinite;
    pointer-events: none;
}

@keyframes rainFall {
    0% { background-position: 0 0; }
    100% { background-position: 0 500px; }
}

#game-container {
    width: 600px;
    text-align: center;
    position: relative;
    z-index: 1;
}

#game-title {
    font-family: 'VT323', monospace;
    color: #00ffcc;
    font-size: 2.5em;
    text-shadow: 0 0 5px #ff00ff;
    margin-bottom: 20px;
    animation: glitchColor 3s infinite;
}

@keyframes glitchColor {
    0%, 10% { color: #00ffcc; text-shadow: 0 0 5px #ff00ff; }
    2% { color: #ff00ff; text-shadow: 0 0 5px #00ffcc; transform: translate(-1px, 1px); }
    4% { color: #00ffcc; text-shadow: 0 0 7px #ff00ff; transform: translate(1px, -1px); }
    6%, 100% { color: #00ffcc; text-shadow: 0 0 5px #ff00ff; transform: translate(0); }
}

#play-button, #how-to-play-button, #tts-button, #restart-button {
    background-color: #800080;
    color: #fff;
    border: 2px solid #00ffcc;
    padding: 8px 20px;
    margin: 10px 5px;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 1.2em;
    transition: border-color 0.3s;
}

#play-button:hover, #how-to-play-button:hover, #tts-button:hover, #restart-button:hover {
    background-color: #00ffcc;
    border-color: #00ff00;
    box-shadow: 0 0 5px #ff00ff;
    animation: staticDistort 1s infinite;
}

@keyframes staticDistort {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-1px, 1px); }
    40% { transform: translate(1px, -1px); }
}

#lives {
    font-size: 1.5em;
    margin: 10px 0;
    color: #ff00ff;
    text-shadow: 0 0 5px #00ffcc;
}

#lives-value {
    font-size: 1em;
}

#score {
    font-size: 1.5em;
    margin: 10px 0;
    color: #00f7ff;
    text-shadow: 0 0 5px #ff00ff;
    animation: flicker 3s infinite;
}

@keyframes flicker {
    0%, 100% { color: #00f7ff; }
    50% { color: #00b7eb; }
}

#game-canvas {
    border: 2px solid #00ffcc;
    background-color: #120021;
    width: 600px;
    height: 400px;
    position: relative;
}

#game-canvas::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.03) 1px,
        transparent 1px,
        transparent 5px
    );
    pointer-events: none;
}

#game-over {
    font-size: 2em;
    color: #ffff00;
    margin: 20px 0;
    text-shadow: 0 0 5px #ff4500;
    animation: flashWin 1.5s infinite, glitchText 0.5s infinite;
}

@keyframes flashWin {
    0%, 100% { color: #ffff00; }
    50% { color: #ff4500; }
}

@keyframes glitchText {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 1px); }
    40% { transform: translate(2px, -1px); }
}

#manual-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#manual-content {
    background: #120021;
    border: 2px solid #00ffcc;
    padding: 20px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    color: #e0e0e0;
    font-family: 'VT323', monospace;
    font-size: 1.2em;
    text-align: left;
    box-shadow: 0 0 10px #ff00ff;
}

#manual-content h2, #manual-content h3 {
    color: #00ffcc;
    text-shadow: 0 0 5px #ff00ff;
}

#manual-content p, #manual-content ul {
    margin: 10px 0;
}

#manual-content ul li {
    margin: 5px 0;
}

#manual-content button {
    background-color: #800080;
    color: #fff;
    border: 2px solid #00ffcc;
    padding: 8px 20px;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 1.2em;
    display: block;
    margin: 20px auto 0;
}

#manual-content button:hover {
    background-color: #00ffcc;
    border-color: #00ff00;
    box-shadow: 0 0 5px #ff00ff;
    animation: staticDistort 1s infinite;
}

@media (max-width: 600px) {
    #game-container {
        width: 100%;
        padding: 0 10px;
    }
    #game-canvas {
        width: 100%;
        height: calc((100vw - 20px) * 2 / 3);
    }
    #game-title {
        font-size: 2em;
    }
    #play-button, #how-to-play-button, #tts-button, #restart-button {
        font-size: 1em;
        padding: 6px 15px;
    }
    #manual-content {
        max-width: 90%;
        font-size: 1em;
        padding: 15px;
    }
}