﻿body {
    font-family: 'Inter', sans-serif;
}
/* Custom styles for the player selection buttons */
.player-btn {
    border: 2px solid transparent;
    transition: all 0.2s ease-in-out;
}
.player-btn.selected {
    background-color: #fca5a5; /* Red-300 */
    color: #1f2937; /* Gray-800 */
    border-color: #ef4444; /* Red-500 */
    transform: scale(1.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
/* Hide the number input arrows/spinners for all browsers */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
}
.message-box {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    background-color: #ef4444;
    color: white;
    font-weight: bold;
    border-radius: 9999px; /* rounded-full */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    display: none;
    animation: fadeInOut 4s forwards;
}
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    10% { opacity: 1; transform: translateX(-50%) translateY(0); }
    90% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
}
.modal {
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
}
/* New flashing animation for the winner's score */
@keyframes flash-winner {
    0%, 100% { box-shadow: 0 0 0px 0px rgba(239, 68, 68, 0.7); }
    50% { box-shadow: 0 0 10px 5px rgba(239, 68, 68, 0.7); }
}
.winner-score-flash {
    animation: flash-winner 2s ease-in-out infinite;
}

#score-table-body input {
    min-height: 40px;
    font-size: 1rem;
}

#game-buttons button {
    min-height: 48px;
}

@media (max-width: 640px) {
    body {
        padding: 0.5rem 0.35rem 3.75rem;
    }

    #setup-screen,
    #game-screen {
        padding: 0.75rem;
        border-radius: 0.75rem;
    }

    #setup-screen h1,
    #game-screen h1 {
        font-size: 1.65rem;
        line-height: 1.1;
        margin-bottom: 0.45rem;
    }

    #round-title {
        font-size: 1.15rem;
        margin-bottom: 0.65rem;
    }

    #player-buttons-container {
        grid-template-columns: 1fr;
    }

    #round-table-container {
        overflow-x: visible;
        -webkit-overflow-scrolling: touch;
    }

    #round-table-container table {
        min-width: 0;
        width: 100%;
        table-layout: fixed;
    }

    #round-table-container th:nth-child(1),
    #round-table-container td:nth-child(1) { width: 18%; }
    #round-table-container th:nth-child(2),
    #round-table-container td:nth-child(2) { width: 15%; }
    #round-table-container th:nth-child(3),
    #round-table-container td:nth-child(3) { width: 15%; }
    #round-table-container th:nth-child(4),
    #round-table-container td:nth-child(4) { width: 15%; }
    #round-table-container th:nth-child(5),
    #round-table-container td:nth-child(5) { width: 16%; }
    #round-table-container th:nth-child(6),
    #round-table-container td:nth-child(6) { width: 16%; }

    #round-table-container th,
    #round-table-container td {
        padding: 0.25rem 0.08rem;
        vertical-align: middle;
    }

    #round-table-container th {
        font-size: 0;
        letter-spacing: 0;
        line-height: 1;
    }

    #round-table-container th:nth-child(1)::after { content: "Player"; }
    #round-table-container th:nth-child(2)::after { content: "Bid"; }
    #round-table-container th:nth-child(3)::after { content: "Won"; }
    #round-table-container th:nth-child(4)::after { content: "Bon"; }
    #round-table-container th:nth-child(5)::after { content: "Rnd"; }
    #round-table-container th:nth-child(6)::after { content: "Total"; }

    #round-table-container th::after {
        color: #9ca3af;
        font-size: 0.58rem;
        font-weight: 700;
        text-transform: uppercase;
    }

    #round-table-container th:first-child,
    #score-table-body td:first-child {
        left: 0;
        position: sticky;
        z-index: 5;
    }

    #round-table-container th:first-child {
        background-color: #111827;
    }

    #score-table-body td:first-child {
        background-color: #111827;
        font-size: 0.72rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #score-table-body input {
        min-height: 31px;
        width: 2.55rem;
        font-size: 0.85rem;
        padding: 0.15rem;
        border-radius: 0.25rem;
    }

    #score-table-body span {
        min-width: 2.75rem;
        padding: 0.2rem 0.25rem;
        font-size: 0.82rem;
    }

    #game-buttons {
        gap: 0.45rem;
        margin-top: 0.65rem;
        position: sticky;
        bottom: 0.35rem;
        z-index: 20;
    }

    #game-buttons button {
        width: 100%;
        min-height: 42px;
        font-size: 0.95rem;
        padding: 0.55rem 0.65rem;
    }

    #summary-table-container table {
        font-size: 0.8rem;
    }

    #summary-table-container th,
    #summary-table-container td {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .message-box {
        bottom: 0.75rem;
        max-width: calc(100vw - 1rem);
        padding: 0.85rem 1rem;
        text-align: center;
        width: max-content;
    }
}
