body {
    font-family: 'Courier New', monospace;
    background-color: var(--bs-dark);
    color: var(--bs-warning);
    touch-action: none;
    overflow-x: hidden;
}

.subtle-link {
    color: var(--bs-warning);
    opacity: 0.7;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.subtle-link:hover {
    opacity: 1;
    color: var(--bs-warning);
}

.back-nav {
    border-bottom: 1px solid var(--bs-warning);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.back-nav .btn-outline-warning {
    border-width: 2px;
    font-weight: bold;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: bold;
    letter-spacing: 0.5rem;
    color: var(--bs-warning);
    margin-bottom: 1rem;
}

#gameCanvas {
    background-color: #402211;
    border: 2px solid var(--bs-warning);
    width: 100%;
    height: auto;
    touch-action: none;
    display: block;
    margin: 0 auto;
    max-width: 800px;
}

.score-container {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: bold;
    color: var(--bs-warning);
    margin-bottom: 1rem;
}

.streak-info {
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: var(--bs-warning-text);
}

kbd {
    background-color: var(--bs-warning);
    color: var(--bs-dark);
    padding: 0.2rem 0.4rem;
    font-size: clamp(0.8rem, 2vw, 1rem);
}

.leaderboard {
    max-width: 800px;
    margin: 0 auto;
    margin-bottom: 2rem; /* Added margin-bottom */
}

.table-responsive {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--bs-warning);
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.2);
}

.table {
    margin-bottom: 0;
    border-color: var(--bs-warning);
    font-size: clamp(0.8rem, 2vw, 1rem);
}

.table thead {
    position: sticky;
    top: 0;
    background-color: var(--bs-dark);
    z-index: 1;
}

.table thead th {
    color: var(--bs-warning);
    border-bottom: 2px solid var(--bs-warning);
    white-space: nowrap;
    padding: 1rem;
    background-color: var(--bs-dark);
}

.table tbody td {
    color: var(--bs-light);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 183, 0, 0.2);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }

    h1 {
        letter-spacing: 0.25rem;
    }

    #playerName {
        width: 100%;
        max-width: 300px;
    }

    .btn {
        margin: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }

    .table-responsive {
        max-height: 250px;
        margin: 0 -0.5rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.5rem;
    }

    .leaderboard {
        margin-bottom: 1rem;
    }
}

/* Update mobile touch handling */
@media (hover: none) and (pointer: coarse) {
    body {
        position: fixed;
        width: 100%;
        height: 100%;
        touch-action: none;
    }

    .container {
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #gameCanvas {
        touch-action: none;
        user-select: none;
        -webkit-user-select: none;
    }
}

/* Hide keyboard controls on touch devices */
@media (hover: none) and (pointer: coarse) {
    .keyboard-controls {
        display: none;
    }
}

/* Show touch controls only on touch devices */
.touch-controls {
    display: none;
}

@media (hover: none) and (pointer: coarse) {
    .touch-controls {
        display: block;
    }
}

/* Add these styles to the existing CSS file */
.modal-content {
    border: 2px solid var(--bs-warning);
    box-shadow: 0 0 20px rgba(255, 183, 0, 0.2);
}

.modal-header, .modal-footer {
    border-color: var(--bs-warning);
}

#playerNameInput {
    background-color: rgba(0, 0, 0, 0.2);
    border: 2px solid var(--bs-warning);
    color: var(--bs-warning);
    text-align: center;
    font-size: 1.2rem;
    padding: 0.5rem;
}

#playerNameInput:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 183, 0, 0.25);
}

#submitScoreBtn {
    font-weight: bold;
    min-width: 120px;
}

.streak-info {
    font-size: 1.2rem;
    color: var(--bs-warning);
}