.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* Players that withdrew from the tournament. */
tr.withdrawn td {
    color: var(--mud-palette-text-secondary);
    font-style: italic;
}

/* Side drawers (player, new tournament, settings): half the screen, full width on small screens. */
@media (max-width: 959.98px) {
    .side-drawer {
        --mud-drawer-width-right: 100vw !important;
        width: 100vw !important;
    }
}

/* Standings: centered instead of the full width, easier to read. */
.standings-centered {
    max-width: 56rem;
    margin: 0 auto;
}

/* Matches: one card per game. */
.game-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
    gap: 16px;
}

.game-card {
    padding: 12px 16px 16px;
    border-top: 4px solid var(--mud-palette-lines-default);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .game-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--mud-elevation-6);
    }

    .game-card.game-card-playing {
        border-top-color: var(--mud-palette-primary);
    }

.game-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.game-card-board {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-primary);
}

.game-card-live {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mud-palette-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .game-card-live::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--mud-palette-primary);
        animation: game-live-pulse 1.6s ease-in-out infinite;
    }

@keyframes game-live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

.game-card-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
}

.game-card-center {
    text-align: center;
    min-width: 4.5rem;
}

.game-card-vs {
    font-size: 2.2rem;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0.04em;
    color: var(--mud-palette-primary);
}

.game-card-score {
    font-size: 1.4rem;
    font-weight: 800;
    white-space: nowrap;
}

.game-card-bye {
    font-size: 1rem;
    font-weight: 700;
    color: var(--mud-palette-info);
}

.game-card-actions {
    display: flex;
    justify-content: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.game-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
    transition: opacity 0.2s ease;
}

    .game-side.loser {
        opacity: 0.5;
    }

    .game-side.winner .mud-avatar {
        box-shadow: 0 0 0 3px var(--mud-palette-success);
    }

.game-side-empty {
    color: var(--mud-palette-text-disabled);
    font-style: italic;
}

.game-side-avatar {
    position: relative;
}

.mud-avatar.game-card-avatar {
    width: 84px;
    height: 84px;
    font-size: 2rem;
}

.game-side-trophy {
    position: absolute;
    right: -6px;
    bottom: -4px;
    color: #f5b800;
    background: var(--mud-palette-surface);
    border-radius: 50%;
    padding: 2px;
}

.game-side-name {
    margin-top: 8px;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

/* Color badge at the top of each player: white or black pieces. */
.game-side-color {
    margin-bottom: 10px;
    padding: 2px 14px;
    border-radius: 999px;
    border: 2px solid #333;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

    .game-side-color.white {
        background: #fff;
        color: #222;
    }

    .game-side-color.black {
        background: #222;
        color: #fff;
    }

    .game-card.game-card-waiting {
        border-top-style: dashed;
        background: var(--mud-palette-background-gray);
    }

.game-card-queued {
    color: var(--mud-palette-warning);
}

/* Result entered: the card fades out of "Bezig" and pops up in "Gespeeld". */
.game-card.game-card-leaving {
    animation: game-card-leave 0.35s ease-in forwards;
    pointer-events: none;
}

@keyframes game-card-leave {
    to {
        opacity: 0;
        transform: scale(0.85) translateY(16px);
    }
}

.game-card.game-card-entering {
    animation: game-card-enter 0.9s ease-out;
}

@keyframes game-card-enter {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }
    40% {
        opacity: 1;
        transform: scale(1.04);
        box-shadow: 0 0 0 4px var(--mud-palette-success);
    }
    100% {
        transform: scale(1);
        box-shadow: var(--mud-elevation-2);
    }
}

/* AI-written tournament report: readable line length; an old report is dimmed while a new one is written. */
.report {
    max-width: 48em;
    margin: 0 auto;
}

.report-outdated {
    opacity: 0.5;
}

/* The prompt of a report, shown as preformatted text. */
.prompt-text {
    white-space: pre-wrap;
    font-size: 0.85rem;
    background: var(--mud-palette-background-gray);
    border-radius: 4px;
    padding: 12px;
    max-height: 40vh;
    overflow: auto;
    margin: 4px 0 0 0;
}

/* Player statistics in the player drawer: a row of totals, and results colored from the player's view. */
.player-stats-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(6.5em, 1fr));
    gap: 8px;
}

.player-stats-tile {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    padding: 8px 12px;
    text-align: center;
}

.player-stats-value {
    font-size: 1.5rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.player-stats-label {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
}

.outcome-win {
    color: var(--mud-palette-success);
    font-weight: 500;
}

.outcome-loss {
    color: var(--mud-palette-error);
}

.outcome-draw {
    color: var(--mud-palette-text-secondary);
}

/* Webcam dialog: a square view (the photo is a square crop of the center), mirrored like a mirror. */
.webcam {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    margin: 0 auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.webcam-view {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.webcam-mirrored {
    transform: scaleX(-1);
}

.webcam-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Rating chart in the player drawer: one series, thin line, recessive grid, hover tooltip. */
.rating-chart {
    position: relative;
}

.rating-chart svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.rating-chart-grid {
    stroke: var(--mud-palette-lines-default);
    stroke-width: 1;
}

.rating-chart-axis {
    fill: var(--mud-palette-text-secondary);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.rating-chart-line {
    fill: none;
    stroke: var(--mud-palette-primary);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* Markers get a ring in the surface color, so they stand apart from the line. */
.rating-chart-marker {
    fill: var(--mud-palette-primary);
    stroke: var(--mud-palette-surface);
    stroke-width: 2;
}

.rating-chart-crosshair {
    stroke: var(--mud-palette-text-secondary);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.rating-chart-hit {
    fill: transparent;
}

.rating-chart-tooltip {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    min-width: 10em;
    max-width: 22em;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    box-shadow: var(--mud-elevation-4);
    font-size: 0.8rem;
}

.rating-chart-tooltip-value {
    font-size: 1.1rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* "(verwijderd)" after the name of a player deleted from the player list. */
.player-deleted {
    color: var(--mud-palette-text-secondary);
    font-style: italic;
    font-weight: normal;
}

/* Login page: the form in the middle of the screen. */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--mud-palette-background-gray);
}

/* Buttons that show a name (e.g. the logged-in user) keep its capitals. */
.text-none {
    text-transform: none !important;
}

/* Writing styles of the AI report (settings): one row per style, the description clipped to three lines. */
.writing-style {
    padding: 10px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

    .writing-style:last-child {
        border-bottom: none;
    }

.writing-style-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* The row of round tabs inside the Matches tab. */
.round-tabs .mud-tabs-tabbar {
    background: var(--mud-palette-background-gray);
}

/* The system prompt in the AI settings: monospace, like the prompt viewer. */
.prompt-field textarea {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.85rem;
}

/* Clubs: keep long descriptions readable in the table. */
.club-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
}

/* Rating list: the trend line of the latest ratings. */
.rating-sparkline {
    display: block;
    overflow: visible;
}

/* Rating page, "meer info": the calculation explained. */
.rating-formula {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    background: var(--mud-palette-background-gray);
}

.rating-info-list {
    padding-left: 1.25em;
    margin: 0;
}

.rating-info-list li {
    margin-bottom: 4px;
}

.rating-info .value {
    text-align: right;
    white-space: nowrap;
}

.rating-calc-player {
    flex: 1 1 12em;
    min-width: 0;
}

.expected-score-table {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11em, 1fr));
    column-gap: 24px;
    row-gap: 2px;
    font-size: 0.875rem;
}

.expected-score-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* Player drawer, rating tab: the games of a tournament with their changes. */
.rating-games-table .value {
    text-align: right;
    white-space: nowrap;
}

.rating-games-table tfoot td {
    font-weight: 500;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.rating-game-not-counted td {
    color: var(--mud-palette-text-secondary);
}

.rating-tournament-total {
    white-space: nowrap;
}
