/* Extracted styles from index.php */
/* Custom styling to match the dark, high-contrast look of the image */
body {
    background-color: #121212;
    color: #e0e0e0;
    padding-top: 20px;
    padding-bottom: 40px;
}

h1.main-title {
    text-align: center;
    font-weight: bold;
    margin-bottom: 20px;
}

.form-control,
.form-select {
    background-color: #2c2c2c;
    border: 1px solid #444;
    color: #fff;
}

.form-control:focus {
    background-color: #363636;
    color: #fff;
    border-color: #666;
    box-shadow: none;
}

.section-header {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.score-input {
    width: 68px;
    text-align: center;
    margin: auto;
    font-size: 1.2rem;
    font-weight: bold;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.total-display {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
}

/* Table styling to mimic the grid */
.score-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.score-table th,
.score-table td {
    border: 1px solid #555;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.score-table thead th {
    background-color: #1f1f1f;
    font-weight: bold;
}

.player-label {
    font-weight: bold;
    width: 48px;
    display: inline-block;
}

/* Styling the specific match center column */
.match-cell {
    font-size: 0.9rem;
    line-height: 1.2;
    color: #ccc;
    background-color: #1a1a1a;
}

.match-cell .vs {
    font-size: 0.8rem;
    margin: 2px 0;
}

.match-cell-winner {
    font-size: 1.3rem;
    font-weight: bold;
}

.row-winner-away .match-cell {
    box-shadow: inset -8px 0 0 0 rgba(3, 224, 3, 0.5);
}

.row-winner-home .match-cell {
    box-shadow: inset 8px 0 0 0 rgba(3, 224, 3, 0.5);
}

/* Flash highlight used after swaps */
.flash {
    animation: flash-bg 700ms ease-in-out;
}

@keyframes flash-bg {
    0% {
        background-color: #ffd54f;
        color: #000;
    }

    100% {
        background-color: transparent;
        color: inherit;
    }
}

/* Responsive / Mobile improvements */
@media (max-width: 992px) {
    .score-input {
        width: 100%;
        max-width: none;
        font-size: 1.2rem;
        padding: 8px;
    }

    .total-display {
        font-size: 1.1rem;
    }

    .match-cell {
        padding: 10px;
        text-align: center;
    }

    .match-cell .pos-code {
        display: inline-block;
        margin: 2px 6px;
        font-size: 0.95rem;
    }

    .player-label {
        width: 56px;
    }

    .input-group .form-control {
        font-size: 1rem;
        padding: 8px;
    }

    .btn {
        min-height: 44px;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 576px) {

    /* Stack action buttons for easier tapping */
    .col.text-center .btn {
        display: block;
        width: 100%;
        margin: 6px 0;
    }

    /* Make table rows more touch-friendly while preserving layout */
    .score-table th,
    .score-table td {
        padding: 10px 6px;
    }

    .score-table thead th {
        font-size: 0.85rem;
    }

    .match-cell {
        text-align: left;
    }

    .match-cell .pos-code {
        display: block;
        margin: 4px 0;
    }

    /* Increase player input tap targets */
    .player-input,
    #homeTeamName,
    #awayTeamName {
        padding: 10px;
        font-size: 1rem;
    }

    /* Make score inputs prominent and full width for small screens */
    .score-input {
        font-size: 1.4rem;
        padding: 10px;
    }
}