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

body {
    font-family: 'Press Start 2P', cursive;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
}

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

.game-container {
    width: 800px;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    border: 2px solid #00ffff;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    text-shadow: 0 0 10px #00ffff;
    color: #00ffff;
}

.score-container {
    display: flex;
    justify-content: space-around;
    font-size: 1.2em;
    margin-bottom: 15px;
    text-shadow: 0 0 5px #00ffff;
}

.game-area {
    position: relative;
    margin: 0 auto;
    width: 600px;
    height: 400px;
}

#gameCanvas {
    background-color: #000;
    border-radius: 5px;
    box-shadow: 0 0 20px #00ffff;
    border: 2px solid #00ffff;
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

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

button {
    background-color: #00ffff;
    color: #000;
    border: none;
    padding: 12px 18px;
    border-radius: 5px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

button:hover {
    background-color: #ff00ff;
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.7);
}

.special-button {
    background-color: #ff00ff;
    color: #fff;
}

.special-button:hover {
    background-color: #00ffff;
    color: #000;
}

.instructions {
    margin-top: 25px;
    font-size: 0.8em;
    line-height: 1.8;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #00ffff;
}

.instructions h3 {
    margin-bottom: 10px;
    color: #00ffff;
}

.instructions ul {
    list-style-position: inside;
    padding-left: 10px;
}

.instructions li {
    margin-bottom: 5px;
}

.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    display: none;
    border: 2px solid #ff00ff;
}

.game-over h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
}

.game-over p {
    margin-bottom: 20px;
    font-size: 1.2em;
}

.modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10;
    border-radius: 5px;
}

.modal-content {
    background-color: #0f2027;
    width: 90%;
    max-height: 90%;
    margin: 5% auto;
    padding: 20px;
    border-radius: 5px;
    overflow-y: auto;
    border: 2px solid #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #00ffff;
    font-size: 1.5em;
    text-shadow: 0 0 5px #00ffff;
}

#challengeQuestion {
    background-color: #000;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    font-size: 1.1em;
    line-height: 1.6;
    color: #fff;
    border: 1px solid #00ffff;
}

#challengeQuestion pre {
    background-color: #111;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 10px 0;
    border-left: 3px solid #00ffff;
}

#challengeQuestion label {
    display: block;
    margin: 10px 0;
    padding: 8px;
    background-color: #111;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#challengeQuestion label:hover {
    background-color: #222;
}

#challengeQuestion input[type="radio"] {
    margin-right: 10px;
}

#codeAnswer {
    width: 100%;
    height: 150px;
    background-color: #000;
    color: #fff;
    font-family: 'Courier New', monospace;
    padding: 15px;
    border: 1px solid #00ffff;
    border-radius: 5px;
    margin-bottom: 20px;
    resize: vertical;
    font-size: 1.1em;
}

.button-group {
    display: flex;
    justify-content: space-between;
}

@media (max-width: 820px) {
    .game-container {
        width: 95%;
        padding: 15px;
    }
    
    .game-area, #gameCanvas {
        width: 100%;
        height: auto;
    }
    
    .score-container {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .control-group {
        justify-content: center;
    }
    
    button {
        font-size: 0.8em;
        padding: 10px 15px;
    }
}
