:root {
    color-scheme: light;
    --color-bg: #ffffff;
    --color-surface: #f4f5f6;
    --color-surface-hover: #e9ebed;
    --color-border: #dfe2e5;
    --color-text: #1b1f23;
    --color-text-muted: #596069;
    --color-primary: #2a6f45;
    --color-primary-text: #ffffff;
    --color-accent: #b45309;
    --nav-width: 260px;
    --header-height: 56px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --color-bg: #0f1115;
    --color-surface: #1a1d23;
    --color-surface-hover: #22262d;
    --color-border: #2b2f36;
    --color-text: #e6e8eb;
    --color-text-muted: #9aa1ab;
    --color-primary: #4caf7d;
    --color-primary-text: #0f1115;
    --color-accent: #f0a93e;
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] {
        color-scheme: dark;
        --color-bg: #0f1115;
        --color-surface: #1a1d23;
        --color-surface-hover: #22262d;
        --color-border: #2b2f36;
        --color-text: #e6e8eb;
        --color-text-muted: #9aa1ab;
        --color-primary: #4caf7d;
        --color-primary-text: #0f1115;
        --color-accent: #f0a93e;
    }
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a {
    color: var(--color-primary);
}

.add-to-calendar {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.8rem;
}

.add-to-calendar-icon {
    position: relative;
    display: inline-flex;
}

.add-to-calendar-plus {
    position: absolute;
    bottom: -3px;
    right: -5px;
    font-size: 0.65em;
    font-weight: 800;
    background: var(--color-primary);
    color: var(--color-primary-text);
    border-radius: 50%;
    width: 11px;
    height: 11px;
    line-height: 11px;
    text-align: center;
}

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;
}

/* Mobile-first basics */
body {
    font-size: 1rem;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.4rem;
    padding: 0.5rem 0.6rem;
}

button {
    background: var(--color-primary);
    color: var(--color-primary-text);
    border-color: var(--color-primary);
    cursor: pointer;
    font-weight: 600;
}

button:hover {
    filter: brightness(1.08);
}

.slider-toggle {
    position: relative;
    display: flex;
    width: 240px;
    max-width: 100%;
    margin-bottom: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.2rem;
}

.slider-toggle button {
    position: relative;
    z-index: 1;
    flex: 1;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    transition: color 0.2s ease-in-out;
}

.slider-toggle button.active {
    color: var(--color-primary-text);
}

.slider-toggle-thumb {
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: calc(50% - 0.2rem);
    height: calc(100% - 0.4rem);
    background: var(--color-primary);
    border-radius: 999px;
    transition: transform 0.2s ease-in-out;
}

.slider-toggle-thumb.right {
    transform: translateX(100%);
}

.needs-response-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    margin-bottom: 1rem;
}

.needs-response-filter.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-primary-text);
}

.month-heading {
    font-size: 1rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 1.25rem 0 0.5rem;
}

.month-heading:first-of-type {
    margin-top: 0;
}

.game-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.game-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.6rem;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.game-card-header-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.game-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-primary);
    text-decoration: none;
}

a.game-card-name:hover {
    text-decoration: underline;
}

.game-card-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.game-card-opponent {
    font-weight: 700;
    font-size: 1.05rem;
}

.game-card-location {
    font-size: 0.9rem;
    text-align: right;
}

.game-card-score-inline {
    font-weight: 700;
    margin-left: 0.35rem;
}

.game-card-score-inline.win {
    color: var(--color-primary);
}

.game-card-score-inline.loss {
    color: #c0392b;
}

.game-card-score-inline.tie {
    color: var(--color-text-muted);
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card-list a {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.card-list a:hover {
    background: var(--color-surface-hover);
}

.location-card {
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
}

.location-name {
    font-weight: 600;
}

.location-address {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0.15rem 0 0.5rem;
}

.location-links {
    display: flex;
    gap: 0.75rem;
}

.location-links a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.location-link-wrap {
    position: relative;
    display: inline-block;
}

.location-link-trigger {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.location-link-pin {
    text-decoration: none;
    display: inline-block;
}

.location-link-backdrop {
    position: fixed;
    inset: 0;
    z-index: 39;
    background: transparent;
}

.location-link-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.4rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    overflow: hidden;
}

.location-link-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
}

.location-link-icon {
    font-size: 1rem;
}

.location-link-menu a:hover {
    background: var(--color-surface-hover);
}

.searchable-select {
    position: relative;
}

.searchable-select input {
    width: 100%;
}

.searchable-select-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: transparent;
}

.searchable-select-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 71;
    display: flex;
    flex-direction: column;
    max-height: 200px;
    overflow-y: auto;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.4rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 0.25rem;
}

.searchable-select-menu button {
    background: transparent;
    border: none;
    color: var(--color-text);
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.searchable-select-menu button:hover {
    background: var(--color-surface-hover);
}

.searchable-select-menu button.active {
    font-weight: 700;
}

.searchable-select-empty {
    padding: 0.5rem 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.player-avatar-wrap {
    position: relative;
    display: inline-block;
}

.player-avatar {
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
}

.player-avatar-initials {
    background: var(--color-primary);
    color: var(--color-primary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.player-avatar-jersey-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.4;
    padding: 0 0.3em;
    white-space: nowrap;
}

.top-dog-card {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: var(--color-primary-text);
    border-radius: 0.6rem;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
}

.top-dog-card h2 {
    margin: 0 0 0.4rem;
    font-size: 0.9rem;
}

.top-dog-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
}

.top-dog-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    text-align: center;
}

.top-dog-rank {
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.85;
}

.top-dog-name {
    font-weight: 700;
    font-size: 0.85rem;
}

.top-dog-score {
    font-size: 0.75rem;
    opacity: 0.9;
}

.leaders-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 700px) {
    .leaders-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1100px) {
    .leaders-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.leader-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 1rem;
}

.leader-card h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.leader-list {
    max-height: 132px;
    overflow-y: auto;
}

.leader-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0;
}

.leader-rank {
    width: 1.25rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

.leader-name {
    flex: 1;
}

.leader-value {
    font-weight: 700;
    padding-right: 0.75rem;
}

.stats-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.stats-tabs a {
    padding: 0.5rem 0.9rem;
    text-decoration: none;
    color: var(--color-text-muted);
    font-weight: 600;
    border-bottom: 2px solid transparent;
}

.stats-tabs a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.stats-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 0.5rem;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--color-border);
}

.table thead th {
    cursor: pointer;
    user-select: none;
    color: var(--color-text-muted);
}

.pinned-col {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--color-bg);
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.08);
}

thead .pinned-col {
    z-index: 2;
    background: var(--color-bg);
}

@media (max-width: 700px) {
    .hide-mobile {
        display: none;
    }
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: var(--color-surface-hover);
}

.sub-table-cell {
    background: var(--color-surface);
    padding: 0.5rem 0.5rem 0.75rem 1.5rem !important;
}

.sub-table {
    width: auto;
}

.sub-table thead th {
    cursor: default;
    font-size: 0.85rem;
}

/* App shell / navigation */
.app-shell {
    min-height: 100vh;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 35;
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.app-header-title {
    font-weight: 700;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
    text-decoration: none;
}

.hamburger, .theme-toggle {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.4rem 0.6rem;
    border-radius: 0.4rem;
}

.hamburger {
    color: var(--color-primary);
    font-weight: 700;
    border: 1px solid var(--color-border);
}

.hamburger:hover {
    background: var(--color-surface-hover);
}

.app-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--nav-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    transform: translateX(-100%);
    transition: transform 0.2s ease-in-out;
    z-index: 30;
    overflow-y: auto;
}

.nav-open .app-sidebar {
    transform: translateX(0);
}

.app-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 25;
}

.nav-open .app-backdrop {
    display: block;
}

.app-content {
    padding: 1rem;
}

.app-footer {
    margin-top: 2rem;
    padding: 1rem 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-muted, #6b7280);
    border-top: 1px solid var(--color-border);
}

.app-footer a {
    color: inherit;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--color-border);
    color: inherit;
    text-decoration: none;
}

.team-picker {
    flex: 1;
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 0.4rem;
    background: var(--color-surface);
    color: var(--color-text);
    padding: 0.3rem 0.5rem;
}

.team-picker option {
    background: var(--color-bg);
    color: var(--color-text);
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--color-text);
    text-decoration: none;
}

.nav-links a:hover {
    background: var(--color-surface-hover);
}

.nav-links a.active {
    background: var(--color-primary);
    color: var(--color-primary-text);
}

.nav-icon {
    font-size: 1.1rem;
}

.nav-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 0.5rem;
    background: transparent;
    border: none;
    color: var(--color-text);
    text-align: left;
    font-size: 1rem;
}

.nav-action:hover {
    background: var(--color-surface-hover);
}

@media (min-width: 900px) {
    .app-shell {
        display: grid;
        grid-template-columns: var(--nav-width) 1fr;
        grid-template-rows: var(--header-height) auto 1fr;
        grid-template-areas: "header header" "banner banner" "sidebar content";
    }

    .app-header {
        grid-area: header;
    }

    .impersonation-banner {
        grid-area: banner;
    }

    .hamburger {
        display: none;
    }

    .app-sidebar {
        grid-area: sidebar;
        position: sticky;
        transform: none;
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
    }

    .app-backdrop {
        display: none !important;
    }

    .app-content {
        grid-area: content;
        padding: 1.5rem;
    }
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.avatar-edit-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.avatar-edit-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-primary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    border: 2px solid var(--color-bg);
}

.avatar-edit-input {
    display: none;
}

.profile-photo-note {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin: 0 0 0.25rem;
}

.profile-photo-error {
    color: #c0392b;
    font-size: 0.85rem;
    margin: 0.25rem 0;
}

.profile-teams {
    margin: 0;
    font-weight: 600;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 360px;
}

.profile-form label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.profile-form input {
    font-weight: 400;
}

.profile-notifications {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    max-width: 360px;
}

.profile-notifications h2 {
    font-size: 1.1rem;
    margin: 0 0 0.6rem;
}

.toggle-switch-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 2.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-switch-track {
    position: absolute;
    inset: 0;
    background: var(--color-border);
    border-radius: 999px;
    transition: background-color 0.2s ease-in-out;
    cursor: pointer;
}

.toggle-switch input:checked + .toggle-switch-track {
    background: var(--color-primary);
}

.toggle-switch input:disabled + .toggle-switch-track {
    cursor: default;
    opacity: 0.6;
}

.toggle-switch-thumb {
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 0.95rem;
    height: 0.95rem;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease-in-out;
}

.toggle-switch input:checked + .toggle-switch-track .toggle-switch-thumb {
    transform: translateX(1rem);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
}

.time-select-group {
    display: flex;
    gap: 0.4rem;
}

.time-select-group select {
    flex: 1;
}

.ampm-toggle {
    position: relative;
    display: flex;
    flex: 1;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.2rem;
}

.ampm-toggle button {
    position: relative;
    z-index: 1;
    flex: 1;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
    border-radius: 999px;
    transition: color 0.2s ease-in-out;
}

.ampm-toggle button.active {
    color: var(--color-primary-text);
}

.ampm-toggle-thumb {
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: calc(50% - 0.2rem);
    height: calc(100% - 0.4rem);
    background: var(--color-primary);
    border-radius: 999px;
    transition: transform 0.2s ease-in-out;
}

.ampm-toggle-thumb.right {
    transform: translateX(100%);
}

.link-button {
    background: transparent;
    border: none;
    color: var(--color-primary);
    text-decoration: underline;
    padding: 0;
    font-size: 0.85rem;
    text-align: left;
    align-self: flex-start;
}

.player-name-toggle {
    cursor: pointer;
    border-bottom: 1px dashed var(--color-text-muted);
}

.profile-saved {
    color: var(--color-primary);
    font-weight: 600;
    margin-left: 0.75rem;
}

.header-profile-wrap {
    position: relative;
}

.header-profile {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.user-switch-menu {
    right: 0;
    left: auto;
    min-width: 200px;
}

.user-switch-label {
    padding: 0.5rem 0.75rem 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
}

.user-switch-menu button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--color-text);
    text-align: left;
    font-size: 0.9rem;
}

.user-switch-menu button:hover {
    background: var(--color-surface-hover);
}

.user-switch-menu button.active {
    background: var(--color-primary);
    color: var(--color-primary-text);
}

.user-switch-menu button.active .user-switch-role {
    color: inherit;
}

.user-switch-role {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.user-switch-menu a {
    border-top: 1px solid var(--color-border);
    margin-top: 0.25rem;
}

.header-team-picker {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    padding: 0.3rem 0.4rem;
}

.header-season-picker {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 160px;
    font-size: 0.85rem;
    padding: 0.3rem 0.4rem;
}

/* Team/season pickers live in the header on desktop, where there's room, and
   move into the slide-out nav on mobile instead of cramming two <select>s
   into the header alongside the hamburger/notif bell/avatar - that's what
   was squeezing the team name down to nothing on narrow screens. */
.header-pickers {
    display: none;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.mobile-team-name {
    flex: 1;
    min-width: 0;
}

.sidebar-pickers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

@media (min-width: 900px) {
    .header-pickers {
        display: flex;
    }

    .mobile-team-name {
        display: none;
    }

    .sidebar-pickers {
        display: none;
    }
}

.availability-panel {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
}

.my-status-control {
    position: relative;
    margin-bottom: 0.5rem;
}

.my-status-control-pill {
    display: inline-flex;
    margin-bottom: 0;
    flex-shrink: 0;
}

.my-status-pill-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--color-surface);
    border: 1px solid var(--color-primary);
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
}

.status-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--color-text-muted);
    flex-shrink: 0;
}

.status-dot-available {
    background: #2a6f45;
}

.status-dot-maybe {
    background: #ca8a04;
}

.status-dot-notgoing {
    background: #c0392b;
}

.status-dot-none {
    background: var(--color-border);
}

.my-status-pill-caret {
    font-size: 0.65rem;
    opacity: 0.7;
}

.my-status-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    min-width: 9.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin-top: 0.25rem;
}

.my-status-menu button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.my-status-menu button:hover {
    background: var(--color-surface-hover);
}

.my-status-menu button.active {
    font-weight: 700;
}

.my-status-menu-right {
    left: auto;
    right: 0;
}

.availability-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.availability-toggle {
    flex: 1 1 auto;
    min-width: 0;
    background: transparent;
    color: var(--color-text-muted);
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0;
    text-align: left;
}

.availability-list {
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.availability-group h4 {
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
}

.availability-player {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0;
    font-size: 0.85rem;
}

.availability-player-actions {
    display: flex;
    gap: 0.15rem;
    margin-left: auto;
}

.availability-player-actions button {
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 0.3rem;
    padding: 0.1rem 0.3rem;
    font-size: 0.8rem;
}

.availability-player-actions button.active {
    background: var(--color-surface-hover);
    border-color: var(--color-primary);
}

.availability-locked-note {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-style: italic;
    margin: 0 0 0.5rem;
}

/* Messages */
.messages-shell {
    display: flex;
    gap: 1rem;
    height: calc(100vh - var(--header-height) - 6rem);
}

.conversation-list,
.conversation-thread {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.conversation-list {
    width: 100%;
    overflow-y: auto;
}

.conversation-thread {
    display: none;
    width: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.6rem;
    overflow: hidden;
}

.messages-shell.conversation-open .conversation-list {
    display: none;
}

.messages-shell.conversation-open .conversation-thread {
    display: flex;
}

@media (min-width: 900px) {
    .conversation-list {
        display: flex;
        width: 280px;
        flex-shrink: 0;
    }

    .conversation-thread {
        display: flex;
    }

    .messages-shell.conversation-open .conversation-list {
        display: flex;
    }
}

.conversation-list-actions {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.conversation-list-actions button {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.4rem;
}

.conversation-unread-filter {
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
}

.inline-form {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.inline-form input,
.inline-form select {
    flex: 1;
}

.conversation-group-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    margin: 0.75rem 0 0.25rem;
}

.conversation-group-label.collapsible {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    width: 100%;
    background: transparent;
    border: none;
    padding: 0.25rem 0;
    font: inherit;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
}

.collapse-chevron {
    display: inline-block;
    transition: transform 0.15s ease;
}

.collapse-chevron.collapsed {
    transform: rotate(-90deg);
}

.conversation-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--color-text);
    font-weight: 400;
    padding: 0.5rem;
    border-radius: 0.5rem;
    text-align: left;
}

.conversation-row-wrap {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.conversation-row-wrap .conversation-row {
    flex: 1;
    min-width: 0;
}

.conversation-row-delete {
    flex-shrink: 0;
}

.conversation-row:hover {
    background: var(--color-surface-hover);
}

.conversation-row.active {
    background: var(--color-primary);
    color: var(--color-primary-text);
}

.conversation-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-hover);
    border-radius: 50%;
    font-weight: 700;
}

.conversation-row-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
}

.conversation-preview {
    font-size: 0.8rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-unread-badge {
    flex-shrink: 0;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.3rem;
    border-radius: 0.6rem;
    background: #c0392b;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.conversation-row.active .conversation-unread-badge {
    background: var(--color-bg);
    color: #c0392b;
}

.header-presence {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.presence-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--color-surface);
    margin-left: -8px;
    overflow: hidden;
}

.presence-avatar:first-child {
    margin-left: 0;
}

.presence-overflow {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-hover);
    color: var(--color-text-muted);
    font-size: 0.65rem;
    font-weight: 700;
}

.header-notif-wrap {
    position: relative;
}

.header-notif-bell {
    position: relative;
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    padding: 0.2rem;
    cursor: pointer;
}

.header-notif-count {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 0.6rem;
    background: #c0392b;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-bg);
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 0.5rem;
}

.notif-settings-link {
    text-decoration: none;
    font-size: 0.9rem;
}

.notif-panel {
    right: 0;
    left: auto;
    min-width: 280px;
    max-width: 340px;
    max-height: 70vh;
    overflow-y: auto;
}

.notif-section-label {
    padding: 0.4rem 0.75rem 0.2rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
}

.notif-section-label:first-of-type {
    border-top: none;
}

.notif-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.5rem 0.75rem;
    color: var(--color-text);
    text-decoration: none;
}

.notif-item:hover {
    background: var(--color-surface-hover);
}

.notif-item-title {
    font-weight: 600;
}

.notif-item-sub {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.notif-empty {
    padding: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.photo-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.file-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.file-breadcrumb-item {
    background: none;
    border: none;
    padding: 0.1rem 0.2rem;
    color: var(--color-text-muted);
    font-weight: 400;
}

.file-breadcrumb-item.active {
    color: var(--color-text);
    font-weight: 600;
}

.file-breadcrumb-sep {
    color: var(--color-text-muted);
}

.file-list-table .file-list-row-folder {
    font-weight: 600;
}

.file-list-name-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-text);
    font-weight: inherit;
    text-align: left;
}

.file-list-added-by {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.photo-album-cards {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    margin-bottom: 0.75rem;
}

.photo-album-card-wrap {
    position: relative;
    flex-shrink: 0;
}

.photo-album-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    width: 90px;
    padding: 0.5rem;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 0.5rem;
    color: var(--color-text);
    font-weight: 400;
}

.photo-album-card.active {
    border-color: var(--color-primary);
}

.photo-album-card-cover {
    width: 56px;
    height: 56px;
    border-radius: 0.3rem;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--color-bg);
}

.photo-album-card-cover-all,
.photo-album-card-cover-empty {
    opacity: 0.6;
}

.photo-album-card-name {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.photo-album-card-count {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.photo-album-card-delete {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 1.4rem;
    height: 1.4rem;
    font-size: 0.7rem;
    border-radius: 50%;
}

.photo-uploader-chips {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    margin-bottom: 1rem;
}

.photo-uploader-chip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    padding: 0.3rem 0.6rem 0.3rem 0.3rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 1.2rem;
    color: var(--color-text);
    font-weight: 400;
    font-size: 0.85rem;
}

.photo-uploader-chip.active {
    background: var(--color-primary);
    color: var(--color-primary-text);
    border-color: var(--color-primary);
}

.photo-uploader-chip-new {
    font-weight: 600;
}

.photo-uploader-chip-new.active {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.photo-thumb {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0.4rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.photo-thumb-open {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-thumb .photo-thumb-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 1.6rem;
    height: 1.6rem;
    font-size: 0.8rem;
    line-height: 1;
    border-radius: 50%;
    border: none;
}

.photo-thumb-new-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border-radius: 0.2rem;
    background: #c0392b;
    color: #fff;
    pointer-events: none;
}

.photo-lightbox-counter {
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
}

.photo-lightbox-frame {
    position: relative;
}

.photo-lightbox-image {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 0.4rem;
    margin-bottom: 0.75rem;
}

.photo-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-lightbox-nav-prev {
    left: 0.5rem;
}

.photo-lightbox-nav-next {
    right: 0.5rem;
}

.photo-lightbox-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.non-playing-tag {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 0.05rem 0.4rem;
    margin-left: 0.4rem;
}

.thread-placeholder {
    margin: auto;
    color: var(--color-text-muted);
}

.thread-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.thread-back {
    background: transparent;
    border: none;
    color: var(--color-text);
    font-weight: 600;
    padding: 0;
}

@media (min-width: 900px) {
    .thread-back {
        display: none;
    }
}

.thread-title {
    font-weight: 700;
}

.thread-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.load-more-messages {
    align-self: center;
    background: var(--color-surface);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 0.25rem;
}

.thread-message {
    display: flex;
    gap: 0.5rem;
    max-width: 80%;
}

.thread-message.mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.thread-message-body {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.6rem;
    padding: 0.5rem 0.7rem;
}

.thread-message.mine .thread-message-body {
    background: var(--color-primary);
    color: var(--color-primary-text);
    border-color: var(--color-primary);
}

.thread-message-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.7rem;
    opacity: 0.8;
    margin-bottom: 0.15rem;
}

.thread-composer-wrap {
    position: relative;
    border-top: 1px solid var(--color-border);
}

.thread-composer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
}

.thread-composer input {
    flex: 1;
}

.emoji-toggle {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    padding: 0.2rem 0.4rem;
}

.emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 0.5rem;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.25rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
    max-height: 220px;
    max-width: 320px;
    overflow-y: auto;
}

.emoji-picker button {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    padding: 0.2rem;
}

.emoji-picker button:hover {
    background: var(--color-surface-hover);
    border-radius: 0.3rem;
}

.gif-picker {
    position: absolute;
    bottom: 100%;
    left: 0.5rem;
    width: 320px;
    max-height: 320px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.gif-picker-search {
    display: flex;
    gap: 0.4rem;
}

.gif-picker-search input {
    flex: 1;
}

.gif-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
    overflow-y: auto;
}

.gif-picker-item {
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 0.3rem;
    overflow: hidden;
    line-height: 0;
}

.gif-picker-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.thread-message-deleted {
    font-style: italic;
    color: var(--color-text-muted);
}

.thread-message-image {
    max-width: 220px;
    max-height: 220px;
    border-radius: 0.5rem;
    display: block;
}

.thread-message-edit {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.thread-message-edit input {
    flex: 1;
}

.thread-message-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.thread-message-actions button {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-decoration: underline;
}

.thread-message.mine .thread-message-actions button {
    color: rgba(255, 255, 255, 0.85);
}

.thread-message-actions button.confirm-delete {
    color: #c0392b;
    font-weight: 700;
}

.existing-player-prompt {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.existing-player-prompt p {
    margin: 0;
}

.roster-row-actions {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 0.4rem;
    color: inherit;
}

.icon-btn-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c0392b;
    border: 2px solid var(--color-bg);
}

.icon-btn.confirm-delete {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

.icon-btn-label {
    display: none;
}

@media (max-width: 700px) {
    .icon-btn {
        width: auto;
        padding: 0.3rem 0.5rem;
        gap: 0.3rem;
    }

    .icon-btn-label {
        display: inline;
        font-size: 0.75rem;
    }
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 60;
}

.modal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.6rem;
    padding: 1rem;
    z-index: 61;
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-dialog-wide {
    max-width: 900px;
}

.game-stats-table-wrap {
    overflow-x: auto;
}

.game-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.game-stats-table th,
.game-stats-table td {
    padding: 0.25rem 0.35rem;
    text-align: center;
    white-space: nowrap;
}

.game-stats-table th:first-child,
.game-stats-table td:first-child {
    text-align: left;
}

.game-stats-table input[type="number"] {
    width: 3rem;
    text-align: center;
}

.game-stats-player {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.game-card-header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.game-stats-pick-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.game-stats-pick-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 55vh;
    overflow-y: auto;
}

.game-stats-pick-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.6rem;
    background: var(--color-surface, #fff);
    color: var(--color-text, #1a1a1a);
    border: 1px solid var(--color-border);
    border-radius: 0.4rem;
    font-weight: 400;
}

.game-stats-pick-row:hover {
    filter: none;
    border-color: var(--color-primary);
}

.game-stats-pick-name {
    flex: 1;
}

.game-stats-pick-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
}

.game-stats-pick-status.entered {
    background: var(--color-success-bg, #d9f2e3);
    color: var(--color-success, #1a7a42);
}

.game-stats-pick-status.not-entered {
    background: var(--color-warning-bg, #fdeccb);
    color: var(--color-warning, #8a5a00);
}

.game-stats-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.game-stats-entry-position {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.game-stats-entry-player {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.25rem;
}

.game-stats-entry-player-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.game-stats-entry-computed {
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.game-stats-entry-form label {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.game-stats-entry-form input[type="number"] {
    width: 5rem;
    text-align: center;
}

.game-stats-grid-row {
    cursor: pointer;
}

.game-stats-grid-row.not-entered {
    opacity: 0.55;
    font-style: italic;
}

.game-stats-grid-summary-row {
    font-weight: 700;
    border-top: 2px solid var(--color-border);
}

.stats-summary-row {
    font-weight: 700;
    border-top: 2px solid var(--color-border);
}

.stats-summary-row:first-of-type {
    border-top: 2px solid var(--color-border);
}

.stats-summary-row + .stats-summary-row {
    border-top: 1px solid var(--color-border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: var(--color-text-muted);
    padding: 0.2rem 0.4rem;
}

.login-page {
    max-width: 360px;
    margin: 3rem auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-page h1 {
    text-align: center;
    margin-bottom: 0;
}

.login-page form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.header-profile-arrow {
    font-size: 0.6rem;
    margin-left: 0.3rem;
    color: var(--color-text-muted);
}

.impersonation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: var(--color-primary-text);
    font-size: 0.9rem;
}

.impersonation-banner button {
    background: transparent;
    border: 1px solid currentColor;
    color: inherit;
    padding: 0.25rem 0.6rem;
    border-radius: 0.4rem;
    font-size: 0.85rem;
}

.impersonate-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    text-align: left;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}

.impersonate-row:hover {
    background: var(--color-surface-hover);
}

.impersonate-row-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.impersonate-row-name {
    font-weight: 600;
}

.dashboard-hint {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-top: -0.25rem;
    margin-bottom: 1.25rem;
}

.dashboard-section {
    margin-bottom: 1.5rem;
}

.dashboard-section h2 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.dashboard-section-link {
    color: inherit;
    text-decoration: none;
}

.dashboard-section-link:hover {
    text-decoration: underline;
}

.stat-tiles {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.6rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    min-width: 70px;
}

.stat-tile-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.stat-tile-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}