body {
    background-color: #0d0d0d;
    color: #e0e0e0;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    overflow-x: hidden;
}

.header {
    text-align: center;
    margin: 20px 0;
    width: 100%;
    max-width: 800px;
}

.back-to-home {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.back-button, .leaderboard-link {
    background-color: rgba(106, 13, 173, 0.7);
    color: #e0e0e0;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    display: inline-block;
}

.back-button:hover, .leaderboard-link:hover {
    background-color: rgba(138, 43, 226, 0.7);
}

.leaderboard-link {
    background-color: rgba(0, 128, 0, 0.7);
}

.leaderboard-link:hover {
    background-color: rgba(0, 255, 0, 0.7);
}

.earn-tokens {
    color: #e0e0e0;
    font-size: 18px;
    margin: 10px 0;
}

#gameCanvas {
    width: 100%;
    max-width: 800px;
    height: auto;
    border: 2px solid #e0e0e0;
    background-color: #000;
    margin-top: 10px;
}

.high-score-gift-card {
    display: none;
    margin-top: 10px;
    text-align: center;
    width: 100%;
    max-width: 800px;
}

#giftCardLink {
    background-color: rgba(0, 128, 0, 0.7);
    color: #e0e0e0;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    display: inline-block;
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
}

#giftCardLink:hover {
    background-color: rgba(0, 255, 0, 0.7);
}

.keyboard-controls {
    display: block;
    margin-top: 10px;
    color: #e0e0e0;
    text-align: center;
}

.keyboard-controls p {
    margin: 5px 0;
}

.name-entry {
    display: none;
    margin-top: 20px;
    text-align: center;
    width: 100%;
    max-width: 800px;
}

#nameInput {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #e0e0e0;
    padding: 5px;
    font-family: 'Courier New', Courier, monospace;
    width: 200px;
}

#submitNameBtn {
    background-color: rgba(106, 13, 173, 0.7);
    color: #e0e0e0;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    margin-left: 5px;
}

#submitNameBtn:hover {
    background-color: rgba(138, 43, 226, 0.7);
}

.touch-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    position: fixed;
    bottom: 20px;
    width: 100%;
    max-width: 800px;
    gap: 15px;
    z-index: 10;
}

#hyperspaceBtn {
    background-color: rgba(106, 13, 173, 0.7);
    color: #e0e0e0;
    border: none;
    padding: 22.5px 40px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    width: 220px;
    user-select: none; /* Prevent text highlighting */
}

#hyperspaceBtn:hover {
    background-color: rgba(138, 43, 226, 0.7);
}

.touch-controls-bottom {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

#leftBtn, #rightBtn {
    background-color: rgba(0, 128, 0, 0.7);
    color: #e0e0e0;
    border: none;
    padding: 25px 45px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    width: 150px;
    user-select: none; /* Prevent text highlighting */
}

#leftBtn:hover, #rightBtn:hover {
    background-color: rgba(0, 255, 0, 0.7);
}

#shootBtn {
    background-color: rgba(255, 0, 0, 0.7);
    color: #e0e0e0;
    border: none;
    width: 100px;
    height: 100px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none; /* Prevent text highlighting */
}

#shootBtn:hover {
    background-color: rgba(255, 85, 85, 0.7);
}

#thrustBtn {
    background-color: rgba(255, 165, 0, 0.7);
    color: #e0e0e0;
    border: none;
    width: 100px;
    height: 100px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%; /* Changed to circle */
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none; /* Prevent text highlighting */
}

#thrustBtn:hover {
    background-color: rgba(255, 204, 0, 0.7);
}

.prize-link-container {
    display: none;
    margin-top: 20px;
    text-align: center;
    width: 100%;
    max-width: 800px;
}

#prizeLink {
    color: #00ff00;
    text-decoration: none;
    font-size: 18px;
}

#prizeLink:hover {
    text-decoration: underline;
}

main {
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

h1 {
    color: #e0e0e0;
    font-size: 24px;
    text-align: center;
    margin: 10px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: #1a1a1a;
}

th, td {
    border: 1px solid #e0e0e0;
    padding: 10px;
    text-align: left;
    color: #e0e0e0;
    font-size: 16px;
}

th {
    background-color: rgba(106, 13, 173, 0.7);
}

tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

tr:hover {
    background-color: rgba(138, 43, 226, 0.2);
}

@media (max-width: 1024px) {
    .keyboard-controls {
        display: none;
    }

    .touch-controls {
        display: flex;
    }

    .name-entry {
        margin-top: 20px;
    }

    .prize-link-container {
        margin-top: 20px;
    }

    .high-score-gift-card {
        margin-top: 20px;
    }

    @media (max-width: 500px) {
        #leftBtn, #rightBtn {
            padding: 20px 35px;
            width: 120px;
            font-size: 16px;
        }

        #shootBtn, #thrustBtn {
            width: 80px;
            height: 80px;
            font-size: 16px;
        }

        #hyperspaceBtn {
            padding: 18px 30px;
            width: 180px;
            font-size: 16px;
        }

        .touch-controls-bottom {
            gap: 15px;
        }

        .touch-controls {
            bottom: 10px;
        }

        #giftCardLink {
            padding: 8px 15px;
            font-size: 16px;
        }
    }
}