h1:focus {
    outline: none;
}

* {
    box-sizing: border-box;
}

html,
body {
    background: #020a19;
    font-family: var(--mud-typography-default-family, "Inter", Arial, sans-serif);
    margin: 0;
    min-height: 100%;
    overflow-x: hidden;
    width: 100%;
}

:root {
    --app-system-bottom-space: max(22px, env(safe-area-inset-bottom));
    --app-bottom-nav-height: calc(62px + var(--app-system-bottom-space));
    --app-shell-bottom-padding: calc(var(--app-bottom-nav-height) + 18px);
}

#app {
    min-height: 100vh;
    min-height: 100dvh;
}

/* This layout has no top app bar; pages provide their own safe-area spacing. */
.mud-main-content.app-main-content {
    padding-top: 0;
    min-width: 0;
}

.loading-screen {
    align-items: flex-start;
    background:
        linear-gradient(180deg, rgba(2, 10, 25, .18) 0%, rgba(2, 10, 25, .36) 36%, rgba(2, 10, 25, .92) 100%),
        url("stadium-night.jpg") center center / cover no-repeat,
        #020a19;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    padding: max(32px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(46px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
}

.loading-content {
    max-width: 320px;
    width: 100%;
}

.loading-title {
    color: #ffffff;
    font-family: var(--mud-typography-default-family, "Inter", Arial, sans-serif);
    font-size: clamp(2rem, 10vw, 2.7rem);
    font-weight: var(--mud-typography-h6-weight, 600);
    letter-spacing: 0;
    line-height: 1.1;
    margin: 0;
    text-shadow: 0 8px 30px rgba(0, 0, 0, .48);
}

.loading-bar {
    background: rgba(255, 255, 255, .18);
    border-radius: 999px;
    height: 5px;
    margin-top: 24px;
    overflow: hidden;
    width: min(230px, 64vw);
}

.loading-bar span {
    animation: loading-run 1.25s ease-in-out infinite;
    background: linear-gradient(90deg, #13c4ff, #ffc857);
    border-radius: inherit;
    display: block;
    height: 100%;
    width: 46%;
}

@keyframes loading-run {
    0% {
        transform: translateX(-105%);
    }

    100% {
        transform: translateX(225%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .loading-bar span {
        animation: none;
    }
}

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

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

#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."
    }

.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;
}

.status-bar-safe-area {
    display: none;
}

.team-autocomplete .team-option,
.predictions-autocomplete-popover .team-option {
    align-items: center;
    display: flex;
    gap: 8px;
    line-height: 1;
    min-height: 32px;
    min-width: 0;
    width: 100%;
}

.team-autocomplete .team-option-flag,
.team-autocomplete .team-option-fallback,
.predictions-autocomplete-popover .team-option-flag,
.predictions-autocomplete-popover .team-option-fallback {
    align-items: center;
    background: rgba(255, 255, 255, .08);
    border-radius: 999px;
    box-sizing: border-box;
    display: inline-flex;
    flex: 0 0 22px;
    height: 22px;
    justify-content: center;
    max-height: 22px;
    max-width: 22px;
    min-height: 22px;
    min-width: 22px;
    object-fit: contain;
    overflow: hidden;
    width: 22px;
}

.team-autocomplete .team-option-flag,
.predictions-autocomplete-popover .team-option-flag {
    padding: 2px;
}

.team-autocomplete .team-option-fallback,
.predictions-autocomplete-popover .team-option-fallback {
    font-size: 12px;
    line-height: 1;
}

.team-autocomplete .team-option-label,
.predictions-autocomplete-popover .team-option-label {
    flex: 1 1 auto;
    line-height: 18px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.predictions-autocomplete-popover .mud-list {
    max-height: 280px;
    padding: 4px;
}

/* Autocomplete popovers render outside the page's scoped CSS tree. */
.predictions-autocomplete-popover .player-option-photo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 50%;
    flex-shrink: 0;
}

.predictions-autocomplete-popover .mud-list-item {
    min-height: 36px;
}

.predictions-autocomplete-popover .mud-list-item .mud-list-item-text {
    margin: 0;
}

.admin-page {
    align-items: stretch;
    background:
        radial-gradient(circle at 1px 1px, rgba(148, 163, 184, .24) 1px, transparent 0),
        #151719;
    background-size: 18px 18px;
    color: #ffffff;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
}

.admin-shell {
    background: #070e1b;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: none;
    max-height: none;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-y: auto;
    padding: max(18px, env(safe-area-inset-top)) 14px var(--app-shell-bottom-padding);
    position: relative;
    width: 100%;
}

.admin-page .eyebrow {
    color: #8fe6ff;
    font-family: var(--mud-typography-default-family, "Inter", Arial, sans-serif);
    font-size: 11px;
    font-weight: var(--mud-typography-subtitle2-weight, 500);
    letter-spacing: 0;
    text-transform: uppercase;
}

.admin-title {
    color: #ffffff;
    font-family: var(--mud-typography-default-family, "Inter", Arial, sans-serif);
    font-size: 30px;
    font-weight: var(--mud-typography-h6-weight, 600);
    letter-spacing: 0;
    line-height: 1.05;
}

.admin-page .icon-button {
    background: #13c4ff;
    border-radius: 8px;
    color: #03111c;
    height: 44px;
    min-width: 44px;
    padding: 0;
}

.overview-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 4px 0 0;
}

.metric-card {
    background: #121d31;
    border: 1px solid rgba(143, 230, 255, .14);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    min-height: 108px;
    padding: 14px;
}

.metric-card .mud-icon-root {
    color: #8fe6ff;
}

.metric-card.warn .mud-icon-root {
    color: #ffc857;
}

.metric-value {
    color: #ffffff;
    font-family: var(--mud-typography-default-family, "Inter", Arial, sans-serif);
    font-size: 30px;
    font-weight: var(--mud-typography-subtitle2-weight, 500);
    letter-spacing: 0;
    line-height: 1;
}

.metric-label {
    color: #aab4c5;
    font-size: 13px;
    font-weight: var(--mud-typography-subtitle2-weight, 500);
}

.admin-tabs {
    background: #10192b;
    border: 1px solid rgba(170, 180, 197, .16);
    border-radius: 8px;
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 5px;
}

.admin-tab {
    border-radius: 8px;
    color: #aab4c5;
    font-family: var(--mud-typography-default-family, "Inter", Arial, sans-serif);
    font-size: 13px;
    font-weight: var(--mud-typography-button-weight, 700);
    min-width: 0;
    padding: 10px 6px;
    text-transform: none;
}

.admin-tab.active {
    background: #13c4ff;
    color: #03111c;
}

.admin-section,
.data-list,
.expand-item {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.data-list.nested {
    margin-top: 14px;
}

.nested-item {
    gap: 0;
}

.data-row {
    background: #121d31;
    border: 1px solid rgba(170, 180, 197, .14);
    border-radius: 8px;
    color: #ffffff;
    min-width: 0;
    padding: 12px;
    text-align: left;
    text-transform: none;
}

.data-row.active {
    border-color: rgba(143, 230, 255, .7);
}

.data-row .mud-button-label {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-width: 0;
    width: 100%;
}

.row-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.row-title {
    color: #ffffff;
    font-family: var(--mud-typography-default-family, "Inter", Arial, sans-serif);
    font-size: 14px;
    font-weight: var(--mud-typography-h6-weight, 600);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-subtitle,
.row-meta {
    color: #aab4c5;
    font-size: 12px;
    font-weight: var(--mud-typography-h6-weight, 600);
    line-height: 1.25;
}

.row-meta {
    max-width: 104px;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coverage-pill {
    border-radius: 999px;
    flex: 0 0 auto;
    font-family: var(--mud-typography-default-family, "Inter", Arial, sans-serif);
    font-size: 12px;
    font-weight: var(--mud-typography-subtitle2-weight, 500);
    padding: 6px 9px;
}

.coverage-pill.complete {
    background: rgba(76, 175, 80, .14);
    color: #9cf2a0;
}

.coverage-pill.missing {
    background: rgba(255, 200, 87, .14);
    color: #ffc857;
}

.inline-panel,
.admin-page .empty-state {
    background: #10192b;
    border: 1px solid rgba(170, 180, 197, .16);
    border-radius: 8px;
    padding: 14px;
}

.inline-panel {
    border-color: rgba(143, 230, 255, .24);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: -9px;
}

.detail-title,
.admin-page .empty-title {
    color: #ffffff;
    font-family: var(--mud-typography-default-family, "Inter", Arial, sans-serif);
    font-size: 15px;
    font-weight: var(--mud-typography-h6-weight, 600);
    letter-spacing: 0;
}

.detail-header {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.detail-header > .mud-stack:first-child {
    min-width: 0;
}

.compact-chip {
    align-self: start;
    border-radius: 999px;
    flex: 0 0 auto;
    font-family: var(--mud-typography-default-family, "Inter", Arial, sans-serif);
    font-size: 11px;
    font-weight: var(--mud-typography-subtitle2-weight, 500);
    height: 30px;
    justify-self: end;
    margin: 0;
    max-width: 110px;
    min-width: 0;
    padding: 0 10px;
}

.compact-chip .mud-chip-content {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-copy,
.admin-page .empty-copy {
    color: #aab4c5;
    font-size: 13px;
    font-weight: var(--mud-typography-body1-weight, 400);
}

.admin-page .empty-state {
    display: grid;
    gap: 6px;
    justify-items: start;
}

.admin-page .empty-state .mud-icon-root {
    color: #8fe6ff;
}

.member-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.member-row {
    align-items: center;
    background: #121d31;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-width: 0;
    padding: 10px;
}

.member-row > span:first-child {
    display: grid;
    min-width: 0;
}

.member-name {
    color: #ffffff;
    font-size: 14px;
    font-weight: var(--mud-typography-subtitle2-weight, 500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-role {
    color: #8fe6ff;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: var(--mud-typography-subtitle2-weight, 500);
}

.missing-panel {
    background: #0b1424;
    border: 1px solid rgba(170, 180, 197, .14);
    border-radius: 8px;
    margin-top: 0;
    padding: 12px;
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
    .admin-page {
        padding: 28px;
    }

    .admin-shell {
        border: 1px solid rgba(71, 108, 153, .65);
        border-radius: 8px;
        box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
        max-width: 430px;
        max-height: calc(100vh - 56px);
        min-height: calc(100vh - 56px);
    }
}

@supports (-webkit-touch-callout: none) {
    .status-bar-safe-area {
        display: none;
    }

    .flex-column, .navbar-brand {
        padding-left: env(safe-area-inset-left);
    }
}

/* Keep semantic emphasis aligned with the shared MudBlazor heading weight. */
strong, b {
    font-weight: var(--mud-typography-h6-weight, 600);
}
