body {
    font-family: 'Press Start 2P', cursive;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: #39ff14;
}

.game-container {
    text-align: center;
    width: 100%;
    max-width: 600px;
    padding: 20px;
    box-sizing: border-box;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(57, 255, 20, 0.5);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.difficulty-buttons {
    display: flex;
    gap: 10px;
}

.difficulty-button, .leaderboard-button {
    background-color: rgba(57, 255, 20, 0.1);
    border: 2px solid #39ff14;
    color: #39ff14;
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-button:hover, .leaderboard-button:hover {
    background-color: rgba(57, 255, 20, 0.3);
}

.difficulty-button.active {
    background-color: #39ff14;
    color: #1a1a2e;
}

.leaderboard-button {
    font-size: 1.2rem;
    padding: 5px 10px;
}

.question {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(57, 255, 20, 0.1);
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    margin-bottom: 1rem;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #39ff14;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.3);
}

.score {
    font-size: 1rem;
    margin-top: 1rem;
}

.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 46, 0.9);
    border: 2px solid #39ff14;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.3);
    width: 80%;
    max-width: 300px;
}

.popup h2 {
    margin-top: 0;
    font-size: 1.2rem;
}

input, .game-button {
    display: block;
    width: 100%;
    margin: 1rem 0;
    padding: 0.5rem;
    font-size: 0.8rem;
    border: none;
    border-radius: 5px;
    font-family: 'Press Start 2P', cursive;
}

input {
    background: rgba(57, 255, 20, 0.2);
    color: #39ff14;
}

.game-button {
    background-color: #39ff14;
    color: #1a1a2e;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.game-button:hover {
    background-color: #32d912;
}

.game-button:active {
    transform: scale(0.98);
}

.touch-controls {
    display: none;
    margin-top: 1.5rem;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.control-button {
    background-color: rgba(57, 255, 20, 0.1);
    border: 2px solid #39ff14;
    color: #39ff14;
    font-size: 1.5rem;
    padding: 0;
    margin: 5px;
    border-radius: 12px;
    cursor: pointer;
    width: 90px;
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

.control-button:active {
    background-color: rgba(57, 255, 20, 0.3);
    transform: scale(0.95);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.5);
}

.horizontal-controls {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: 10px 0;
    gap: 20px; /* Add this line to add a gap between left and right buttons */
}

#upButton, #downButton {
    margin-left: auto;
    margin-right: auto;
}

#downButton {
    transform: rotate(180deg);
}

footer {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(57, 255, 20, 0.7);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

@media (pointer: coarse) {
    .touch-controls {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 600px) {
    .game-container {
        padding: 10px;
    }

    h1 {
        font-size: 1.2rem;
    }
    
    .question {
        font-size: 0.8rem;
    }
    
    .score {
        font-size: 0.8rem;
    }

    .control-button {
        font-size: 1.2rem;
        width: 70px;
        height: 50px;
    }

    .touch-controls {
        max-width: 170px;
    }

    .difficulty-button, .leaderboard-button {
        font-size: 0.6rem;
        padding: 3px 6px;
    }

    footer {
        display: none;
    }
}

.control-button:hover {
    background-color: rgba(57, 255, 20, 0.2);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.5);
}