.game-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 20px auto;
}

#gameGrid {
    border: 2px solid var(--bs-secondary);
    border-radius: 8px;
    background-color: var(--bs-dark);
}

.timer-container {
    text-align: center;
    margin-bottom: 15px;
}

.timer {
    font-size: 32px;
    font-weight: bold;
    color: var(--bs-info);
    background-color: var(--bs-dark);
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-block;
}

.current-word {
    font-size: 24px;
    font-weight: bold;
    color: var(--bs-info);
    min-height: 36px;
}

.word-list {
    max-height: 300px;
    overflow-y: auto;
}

.word-list .list-group-item {
    animation: fadeIn 0.3s ease-in;
}

.word-feedback {
    position: absolute;
    font-size: 18px;
    font-weight: bold;
    pointer-events: none;
    z-index: 100;
    padding: 3px 6px;
    border-radius: 3px;
    background-color: var(--bs-dark);
    border: 1px solid var(--bs-secondary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%);
}

.word-feedback.valid {
    color: var(--bs-success);
}

.word-feedback.invalid {
    color: var(--bs-danger);
}

.word-feedback.duplicate {
    color: var(--bs-warning);
}

.player-score {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: var(--bs-dark);
    border-radius: 4px;
    border: 1px solid var(--bs-secondary);
}

.leaderboard {
    max-width: 100%;
    margin: 0 auto;
}

.leaderboard .table {
    margin-bottom: 0;
    background-color: var(--bs-dark);
}

.leaderboard th,
.leaderboard td {
    padding: 0.5rem;
    text-align: center;
}

.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-content {
    background-color: var(--bs-dark);
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    text-align: center;
}

.instructions-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--bs-dark-rgb), 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.instructions-content {
    background-color: var(--bs-dark);
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    border: 2px solid var(--bs-secondary);
}

.instructions-content h2 {
    color: var(--bs-info);
    margin-bottom: 1.5rem;
}

.instructions-list {
    list-style: none;
    padding: 0;
}

.instructions-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
}

.instructions-list li::before {
    content: "•";
    color: var(--bs-info);
    font-weight: bold;
    margin-right: 0.5rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.2s cubic-bezier(0.36, 0, 0.66, 1) both;
}


body {
    overflow: hidden;
    height: 100vh;
}

.instructions-content {
    max-height: 80vh;
    overflow-y: auto;
}

.leaderboards {
    margin-top: 1rem;
    border-radius: 0.375rem;
}

.leaderboards table {
    margin-bottom: 0;
    width: 100%;
    table-layout: fixed;
}

.leaderboards th {
    position: sticky;
    top: 0;
    background-color: var(--bs-dark);
    z-index: 1;
    padding: 0.75rem 1rem !important;
}

.table-responsive {
    max-height: 350px;
    border: 1px solid var(--bs-dark);
    border-radius: 0.375rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bs-gray-600) var(--bs-dark);
    padding: 0 0.5rem;
}

.table-responsive::-webkit-scrollbar {
    width: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: var(--bs-dark);
    border-radius: 0.375rem;
}

.table-responsive::-webkit-scrollbar-thumb {
    background-color: var(--bs-gray-600);
    border-radius: 0.375rem;
    border: 2px solid var(--bs-dark);
}

.table td {
    padding: 0.4rem 0.5rem !important;
    vertical-align: middle;
    font-size: 0.95rem;
}