﻿html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.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."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.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;
}

/* Pyramid responsive sizing */
:root {
    --pyramid-card-width: 132px;
    --pyramid-card-margin-x: 2px;
    --pyramid-avatar-size: 36px;
    --pyramid-name-size: 0.78rem;
    --pyramid-stats-size: 0.62rem;
}

#pyramid .pyramid-rank-row {
    --cards-in-row: 1;
    flex-wrap: nowrap !important;
    justify-content: center;
}

#pyramid .pyramid-rank-label {
    display: block;
    text-align: center;
    font-weight: 600;
    margin-bottom: 4px;
}

#pyramid .pyramid-card {
    width: var(--pyramid-card-width) !important;
    min-width: var(--pyramid-card-width) !important;
    max-width: var(--pyramid-card-width) !important;
    max-height: 130px;
    margin: 4px var(--pyramid-card-margin-x) !important;
    padding: 3px !important;
}

#pyramid .pyramid-card .mud-card-content {
    padding: 4px !important;
}

#pyramid .pyramid-player-name {
    width: 100%;
    text-align: center;
    font-size: var(--pyramid-name-size) !important;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#pyramid .pyramid-player-stats {
    font-size: var(--pyramid-stats-size) !important;
    white-space: nowrap;
}

#pyramid .mud-avatar-size-large,
#pyramid .mud-avatar-size-medium {
    width: var(--pyramid-avatar-size) !important;
    height: var(--pyramid-avatar-size) !important;
}

.application-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 500;
}

/* Global MudDialog light theme */
.mud-overlay-dialog {
    backdrop-filter: blur(1px);
}

.mud-dialog {
    background-color: var(--mud-palette-surface, #ffffff) !important;
    color: var(--mud-palette-text-primary, #1f2937) !important;
    border: 1px solid var(--mud-palette-lines-default, #dbe4f0);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.24) !important;
}

.mud-dialog .mud-dialog-title,
.mud-dialog .mud-dialog-content,
.mud-dialog .mud-dialog-actions,
.mud-dialog .mud-typography,
.mud-dialog label,
.mud-dialog .mud-input,
.mud-dialog .mud-input-slot,
.mud-dialog .mud-input-label,
.mud-dialog .mud-select,

.mud-dialog .mud-icon-root {
    color: var(--mud-palette-text-primary, #111827) !important;
}

.mud-dialog .mud-input-control .mud-input-slot,
.mud-dialog .mud-input-outlined,
.mud-dialog .mud-input-filled {
    background-color: var(--mud-palette-background, #f8fafc) !important;
}

/* Small */
@media (max-width: 600px) {
    :root {
        --pyramid-card-width: 56px;
        --pyramid-card-margin-x: 1px;
        --pyramid-avatar-size: 20px;
        --pyramid-name-size: 0.50rem;
        --pyramid-stats-size: 0.45rem;
    }

    #pyramid .pyramid-rank-row {
        gap: 2px;
    }

    #pyramid .pyramid-rank-row .pyramid-card {
        width: calc((100vw - 36px) / var(--cards-in-row)) !important;
        min-width: calc((100vw - 36px) / var(--cards-in-row)) !important;
        max-width: calc((100vw - 36px) / var(--cards-in-row)) !important;
        margin: 1px !important;
        padding: 1px !important;
    }

    #pyramid .pyramid-rank-row .pyramid-card .mud-card-content {
        padding: 2px !important;
    }

    #pyramid .pyramid-rank-row .mud-avatar {
        width: 18px !important;
        height: 18px !important;
    }

    #pyramid .pyramid-rank-row .pyramid-player-name {
        font-size: 0.45rem !important;
        line-height: 1.05 !important;
    }

    #pyramid .pyramid-player-stats {
        display: none;
    }

    .pyramid-footer-actions {
        max-width: 100vw;
    }

    .pyramid-footer-action {
        min-width: 48px;
        font-size: 0.8rem;
    }

    .application-title {
        color: white;
        font-size: 1rem;
        font-weight: 500;
    }

    .pyramid-title {
        font-size: 1rem !important;
    }
}

/* Medium */
@media (min-width: 600px) and (max-width: 960px) {
    :root {
        --pyramid-card-width: 74px;
        --pyramid-avatar-size: 24px;
        --pyramid-name-size: 0.58rem;
        --pyramid-stats-size: 0.50rem;
    }

    #pyramid .pyramid-rank-row {
        gap: 2px;
    }

    #pyramid .pyramid-rank-row .pyramid-card {
        width: calc((100vw - 48px) / var(--cards-in-row)) !important;
        min-width: calc((100vw - 48px) / var(--cards-in-row)) !important;
        max-width: calc((100vw - 48px) / var(--cards-in-row)) !important;
        margin: 1px !important;
        padding: 2px !important;
    }

    #pyramid .pyramid-rank-row .pyramid-card .mud-card-content {
        padding: 3px !important;
    }

    #pyramid .pyramid-rank-row .mud-avatar {
        width: 20px !important;
        height: 20px !important;
    }

    #pyramid .pyramid-rank-row .pyramid-player-name {
        font-size: 0.52rem !important;
        line-height: 1.08 !important;
    }

    .application-title {
        color: white;
        font-size: 1rem;
        font-weight: 500;
    }
}

/* Large */
@media (min-width: 960px) and (max-width: 1280px) {
    :root {
        --pyramid-card-width: 96px;
        --pyramid-avatar-size: 28px;
        --pyramid-name-size: 0.66rem;
        --pyramid-stats-size: 0.54rem;
    }
}

/* ExtraLarge */
@media (min-width: 1280px) {
    :root {
        --pyramid-card-width: 122px;
        --pyramid-avatar-size: 34px;
        --pyramid-name-size: 0.75rem;
        --pyramid-stats-size: 0.60rem;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes dropFade {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

@keyframes tapablePulse {
    0% {
        box-shadow: 0 0 8px var(--mud-palette-primary, #1976d2);
    }

    100% {
        box-shadow: 0 0 18px color-mix(in srgb, var(--mud-palette-primary, #42a5f5) 75%, white);
    }
}

/* Match info dialog shared style */
.matchinfo-dialog .mud-dialog {
    border-radius: 14px;
    overflow: hidden;
}

.matchinfo-dialog__content {
    padding-top: 8px;
}

/* MudBlazor dark theme accessibility pass (buttons, inputs, chips, tables) */
.mud-theme-dark .mud-button {
    font-weight: 600;
}

.mud-theme-dark .mud-button-filled {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--mud-palette-text-primary, #ffffff) 8%, transparent) inset;
}

.mud-theme-dark .mud-button-filled.mud-button-filled-primary,
.mud-theme-dark .mud-button-filled.mud-button-filled-secondary,
.mud-theme-dark .mud-button-filled.mud-button-filled-tertiary {
    color: var(--mud-palette-text-primary, #ffffff) !important;
}

.mud-theme-dark .mud-button-text,
.mud-theme-dark .mud-button-outlined {
    color: var(--mud-palette-text-primary, #f8fafc);
}

.mud-theme-dark .mud-button:focus-visible,
.mud-theme-dark .mud-icon-button:focus-visible,
.mud-theme-dark .mud-input-control:focus-within,
.mud-theme-dark .mud-chip:focus-visible,
.mud-theme-dark .mud-table-container:focus-within {
    outline: 2px solid var(--mud-palette-primary, #93c5fd);
    outline-offset: 2px;
}

.mud-theme-dark .mud-input-label,
.mud-theme-dark .mud-input-slot,
.mud-theme-dark .mud-select-input {
    color: #f8fafc !important;
}

.mud-theme-dark .mud-input-helper-text,
.mud-theme-dark .mud-input-error {
    color: #fecaca !important;
}

.mud-theme-dark .mud-input-outlined-border,
.mud-theme-dark .mud-input-filled:before {
    border-color: #94a3b8 !important;
}

.mud-theme-dark .mud-input-control.mud-input-focused .mud-input-outlined-border,
.mud-theme-dark .mud-input-control.mud-input-focused .mud-input-filled:before {
    border-color: var(--mud-palette-primary, #93c5fd) !important;
}

.mud-theme-dark .mud-chip {
    color: #f8fafc;
    border-color: #64748b !important;
}

.mud-theme-dark .mud-chip.mud-chip-color-default {
    background-color: #1f2937;
}

.mud-theme-dark .mud-table {
    color: #f8fafc;
}

.mud-theme-dark .mud-table-head .mud-table-cell {
    color: var(--mud-palette-text-primary, #ffffff);
    font-weight: 700;
    background-color: var(--mud-palette-surface, #1e293b);
}

.mud-theme-dark .mud-table-body .mud-table-cell {
    border-bottom: 1px solid var(--mud-palette-lines-default, #334155);
}

.mud-theme-dark .mud-table-row:hover {
    background-color: color-mix(in srgb, var(--mud-palette-primary, #93c5fd) 12%, transparent);
}

/* MudBlazor dark theme accessibility pass (dialogs, menus, lists) */
.mud-theme-dark .mud-dialog {
    background-color: var(--mud-palette-surface, #111827) !important;
    color: var(--mud-palette-text-primary, #f8fafc) !important;
    border: 1px solid var(--mud-palette-lines-default, #334155) !important;
    box-shadow: 0 16px 40px color-mix(in srgb, var(--mud-palette-background, #020617) 70%, transparent) !important;
}

.mud-theme-dark .mud-dialog-title,
.mud-theme-dark .mud-dialog-content,
.mud-theme-dark .mud-dialog-actions,
.mud-theme-dark .mud-dialog .mud-typography,
.mud-theme-dark .mud-dialog label,
.mud-theme-dark .mud-dialog .mud-icon-root {
    color: var(--mud-palette-text-primary, #f8fafc) !important;
}

.mud-theme-dark .mud-dialog .mud-button-text,
.mud-theme-dark .mud-dialog .mud-button-outlined {
    color: var(--mud-palette-text-secondary, #e2e8f0) !important;
}

.mud-theme-dark .mud-dialog .mud-button-filled {
    color: var(--mud-palette-text-primary, #ffffff) !important;
}

.mud-theme-dark .mud-dialog .mud-input-control .mud-input-slot,
.mud-theme-dark .mud-dialog .mud-input-outlined,
.mud-theme-dark .mud-dialog .mud-input-filled {
    background-color: var(--mud-palette-background, #0f172a) !important;
}

.mud-theme-dark .mud-popover .mud-paper,
.mud-theme-dark .mud-menu,
.mud-theme-dark .mud-menu-list {
    background-color: var(--mud-palette-surface, #111827) !important;
    color: var(--mud-palette-text-primary, #f8fafc) !important;
    border: 1px solid var(--mud-palette-lines-default, #334155);
}

.mud-theme-dark .mud-menu-item,
.mud-theme-dark .mud-list-item,
.mud-theme-dark .mud-list-item-text {
    color: var(--mud-palette-text-primary, #f8fafc) !important;
}

.mud-theme-dark .mud-menu-item:hover,
.mud-theme-dark .mud-list-item:hover {
    background-color: color-mix(in srgb, var(--mud-palette-primary, #93c5fd) 16%, transparent) !important;
}

.mud-theme-dark .mud-menu-item.mud-menu-item-dense,
.mud-theme-dark .mud-list-item.mud-list-item-gutters {
    min-height: 40px;
}

.mud-theme-dark .mud-list-subheader,
.mud-theme-dark .mud-list-item-secondary {
    color: var(--mud-palette-text-secondary, #cbd5e1) !important;
}

.mud-theme-dark .mud-list-item.mud-selected-item,
.mud-theme-dark .mud-menu-item.mud-selected-item {
    background-color: color-mix(in srgb, var(--mud-palette-primary, #60a5fa) 28%, transparent) !important;
    color: var(--mud-palette-text-primary, #ffffff) !important;
}

.mud-theme-dark .mud-popover .mud-divider,
.mud-theme-dark .mud-menu .mud-divider,
.mud-theme-dark .mud-list .mud-divider {
    border-color: var(--mud-palette-lines-default, #334155) !important;
}

.matchinfo-dialog__title {
    font-weight: 700;
    margin-bottom: 4px;
}

.matchinfo-dialog__message {
    opacity: 0.9;
    margin-bottom: 10px;
}

.matchinfo-dialog__section {
    margin-top: 8px;
}

.matchinfo-dialog__actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Shared style for Confirm* dialogs */
.confirm-dialog .mud-dialog {
    border-radius: 14px;
    overflow: hidden;
}

.confirm-dialog__content {
    padding-top: 8px;
}

.confirm-dialog__title {
    font-weight: 700;
    margin-bottom: 4px;
}

.confirm-dialog__message {
    opacity: 0.9;
    margin-bottom: 10px;
}

.confirm-dialog__section {
    margin-top: 8px;
}

.confirm-dialog__actions {
    padding: 12px 24px 18px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid color-mix(in srgb, var(--mud-palette-lines-default, #334155) 70%, transparent);
}

.confirm-dialog__hint {
    display: block;
    margin-top: 8px;
    opacity: 0.8;
}

/* Match result dialog (global to avoid CSS isolation issues with MudDialog portal rendering) */
.matchresult-dialog .mud-dialog {
    border-radius: 14px;
    overflow: hidden;
    background-color: var(--mud-palette-surface, #ffffff) !important;
    color: var(--mud-palette-text-primary, #111827) !important;
}

.matchresult-dialog .mud-card {
    background-color: var(--mud-palette-surface, #ffffff) !important;
    color: var(--mud-palette-text-primary, #111827) !important;
    box-shadow: none !important;
}

.matchresult-dialog .mud-card-header,
.matchresult-dialog .mud-card-content,
.matchresult-dialog .mud-card-actions,
.matchresult-dialog .mud-typography,
.matchresult-dialog label,
.matchresult-dialog .mud-input,
.matchresult-dialog .mud-input-slot,
.matchresult-dialog .mud-input-label,
.matchresult-dialog .mud-select,
.matchresult-dialog .mud-icon-root {
    color: var(--mud-palette-text-primary, #111827) !important;
}

.matchresult-dialog .mud-picker,
.matchresult-dialog .mud-picker-calendar,
.matchresult-dialog .mud-picker-content,
.matchresult-dialog .mud-picker-date-container,
.matchresult-dialog .mud-picker-toolbar {
    background-color: var(--mud-palette-surface, #ffffff) !important;
    color: var(--mud-palette-text-primary, #111827) !important;
}

.matchresult-dialog .mud-picker-calendar .mud-button-root,
.matchresult-dialog .mud-picker-calendar .mud-typography {
    color: var(--mud-palette-text-primary, #111827) !important;
}

.matchresult-dialog__content {
    padding-top: 4px;
}

.matchresult-dialog__card--large {
    max-width: 1280px;
}

.matchresult-dialog__subtitle {
    margin-bottom: 2px;
}

.matchresult-dialog__message {
    opacity: 0.9;
}

.matchresult-dialog__fullwidth {
    width: 100%;
}

.matchresult-dialog label {
    font-size: 1.3rem !important;
}

.matchresult-dialog {
    padding: 3px !important;
}

.matchresult-dialog .mud-dialog-content {
    padding-left: 5px !important;
    padding-right: 5px !important;
    margin-left: 3px !important;
    margin-right: 3px !important;
}

.matchresult-dialog__actions {
    padding-top: 6px;
}

.matchresult-dialog__action-btn {
    width: 100%;
}

.matchresult-dialog__scores-paper {
    background-color: var(--mud-palette-surface, #ffffff) !important;
}

.matchresult-dialog__scores-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.matchresult-dialog__scores-table,
.matchresult-dialog__scores-table table,
.matchresult-dialog__scores-table thead,
.matchresult-dialog__scores-table tbody,
.matchresult-dialog__scores-table tr,
.matchresult-dialog__scores-table th,
.matchresult-dialog__scores-table td {
    background-color: var(--mud-palette-surface, #ffffff) !important;
    color: var(--mud-palette-text-primary, #111827) !important;
    border-color: var(--mud-palette-lines-default, #d1d5db) !important;
}

.matchresult-dialog__scores-table {
    width: 100%;
    min-width: 680px;
}

.matchresult-dialog__scores-table table {
    width: 100%;
    table-layout: fixed;
    font-size: clamp(0.62rem, 1.15vw, 0.84rem);
}

.matchresult-dialog__scores-table th,
.matchresult-dialog__scores-table td {
    padding: 3px 4px !important;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.matchresult-dialog__scores-table th:first-child,
.matchresult-dialog__scores-table td:first-child {
    text-align: left;
    width: 22%;
}

.matchresult-dialog__scores-table th:last-child,
.matchresult-dialog__scores-table td:last-child {
    width: 10%;
    font-weight: 700;
}

.matchresult-dialog__score-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    width: 18px;
    padding: 0 8px;
    border-radius: 999px;
    background-color: transparent;
    color: var(--mud-palette-text-primary, #111827);
    font-weight: 600;
}

.matchresult-dialog__score-value--winner {
    background-color: var(--mud-palette-success, #22c55e) !important;
    color: var(--mud-palette-success-text, #ffffff) !important;
}

.matchresult-dialog__score-value--loser {
    background-color: var(--mud-palette-action-disabled-background, #d1d5db) !important;
    color: var(--mud-palette-text-primary, #111827) !important;
}

.matchresult-dialog__scores-table .matchresult-dialog__section-title {
    text-align: center;
    font-weight: 800;
    font-size: 1.2rem;
}

.matchresult-dialog__point-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #22c55e;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
}

.matchresult-dialog__point-circle--empty {
    display: inline-flex;
    width: 18px;
    height: 18px;
}

.matchresult-dialog .mud-avatar.mud-avatar-medium {
    width: 100px !important;
    height: 100px !important;
    font-size: 1.25rem;
}


