/* Global box sizing and league design tokens. */
* {
    box-sizing: border-box;
}

:root {
    --color-navy: #071a44;
    --color-navy-dark: #041027;
    --color-navy-soft: #132b57;
    --color-gold: #f4c542;
    --color-orange: #f97316;
    --color-surface: #0b1220;
    --color-surface-raised: #101b31;
    --color-page: #050814;
    --color-border: rgba(184, 195, 217, 0.18);
    --color-text: #f8fafc;
    --color-muted: #a9b6cf;
}

/* Application shell and dark branded background. */
body {
    margin: 0;
    min-width: 320px;
    font-family: Arial, sans-serif;
    background:
        radial-gradient(circle at 12% 8%, rgba(244, 197, 66, 0.12), transparent 24rem),
        radial-gradient(circle at 70% 18%, rgba(7, 26, 68, 0.46), transparent 30rem),
        linear-gradient(135deg, #050814, #071020 58%, #030712),
        var(--color-page);
    color: var(--color-text);
}

button,
input,
select {
    min-height: 44px;
}

.brand-logo {
    width: 120px;
    height: auto;
    display: block;
    margin-bottom: 16px;
    border-radius: 8px;
    transition: width 180ms ease;
}

.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-width: 0;
    min-height: 100vh;
    transition: grid-template-columns 180ms ease;
}

body.sidebar-collapsed .layout {
    grid-template-columns: 96px 1fr;
}

.sidebar {
    border-right: 1px solid rgba(244, 197, 66, 0.2);
    background: rgba(3, 7, 18, 0.92);
    color: var(--color-text);
    padding: 24px;
}

.sidebar-backdrop {
    display: none;
}

.sidebar-toggle {
    display: inline-grid;
    gap: 4px;
    width: 40px;
    height: 40px;
    place-content: center;
    border: 1px solid rgba(244, 197, 66, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    margin-bottom: 20px;
}

.sidebar-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--color-gold);
}

.sidebar-toggle:hover {
    background: rgba(244, 197, 66, 0.14);
}

body.sidebar-collapsed .brand-logo {
    width: 56px;
}

.brand {
    margin-bottom: 32px;
}

.eyebrow {
    margin: 0 0 6px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
}

body.sidebar-collapsed .eyebrow,
body.sidebar-collapsed .brand h1 {
    display: none;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: 28px;
}

.navigation {
    display: grid;
    gap: 8px;
}

.session-controls {
    display: grid;
    gap: 8px;
    margin-top: 28px;
}

.session-user {
    color: var(--color-gold);
    font-size: 13px;
    font-weight: 700;
}

.logout-button {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 10px 12px;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
}

.nav-link {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 10px 12px;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    border-color: rgba(244, 197, 66, 0.28);
    background: rgba(244, 197, 66, 0.09);
    color: var(--color-text);
}

.nav-short {
    display: none;
}

body.sidebar-collapsed .nav-link {
    display: grid;
    min-height: 44px;
    place-items: center;
    padding: 10px;
    text-align: center;
    font-weight: 700;
}

body.sidebar-collapsed .nav-text {
    display: none;
}

body.sidebar-collapsed .nav-short {
    display: inline;
    color: var(--color-gold);
}

/* Shared page content and operational forms. */
.content {
    width: min(1120px, calc(100% - 32px));
    min-width: 0;
    max-width: 100%;
    margin: 0 auto;
    padding: 32px 0;
}

.section-header {
    margin-bottom: 16px;
}

.section-header p {
    color: var(--color-muted);
}

.form-panel {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(16, 27, 49, 0.86);
    padding: 16px;
    margin-bottom: 24px;
}

.team-form,
.game-form,
.standings-form,
.player-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    align-items: end;
}

.manual-game-division-filters {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.manual-team-picker {
    grid-column: span 2;
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 12px;
}

.team-form label,
.game-form label,
.standings-form label,
.player-form label {
    display: grid;
    gap: 6px;
    color: var(--color-text);
    font-size: 14px;
}

.team-form input,
.team-form select,
.game-form input,
.game-form select,
.standings-form input,
.standings-form select,
.player-form input,
.player-form select {
    width: 100%;
    border: 1px solid rgba(184, 195, 217, 0.35);
    border-radius: 6px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
    font: inherit;
}

select option {
    background: var(--color-surface);
    color: var(--color-text);
}

.team-form input::placeholder,
.game-form input::placeholder,
.standings-form input::placeholder,
.player-form input::placeholder {
    color: rgba(248, 250, 252, 0.5);
}

.team-form button,
.game-form button,
.standings-form button,
.player-form button {
    border: 0;
    border-radius: 6px;
    padding: 11px 14px;
    background: var(--color-gold);
    color: var(--color-navy-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.team-form button:hover,
.game-form button:hover,
.standings-form button:hover,
.player-form button:hover {
    background: #ffd95a;
}

.form-message {
    min-height: 20px;
    margin: 12px 0 0;
    color: var(--color-muted);
}

.readonly-control {
    display: flex;
    align-items: center;
    min-height: 44px;
    width: 100%;
    border: 1px solid rgba(184, 195, 217, 0.35);
    border-radius: 6px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-muted);
    font: inherit;
}

.form-hint {
    margin: 12px 0 0;
    color: var(--color-muted);
}

.youth-division-rule p {
    margin-bottom: 0;
    color: var(--color-muted);
    line-height: 1.5;
}

.audit-filters {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr);
    gap: 12px;
}

.audit-filters label {
    display: grid;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
}

.audit-filters input,
.audit-filters select {
    width: 100%;
    border: 1px solid rgba(184, 195, 217, 0.35);
    border-radius: 6px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
    font: inherit;
}

.duplicate-audit-results,
.duplicate-team-list {
    display: grid;
    gap: 12px;
}

.duplicate-team-group {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(16, 27, 49, 0.86);
    overflow: hidden;
}

.duplicate-team-group > header,
.duplicate-team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
}

.duplicate-team-group > header {
    border-bottom: 1px solid var(--color-border);
}

.duplicate-team-group h3,
.duplicate-team-row p {
    margin: 4px 0 0;
}

.duplicate-team-row + .duplicate-team-row {
    border-top: 1px solid var(--color-border);
}

.duplicate-team-row p,
.duplicate-team-group > header > span {
    color: var(--color-muted);
}

.duplicate-team-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Authentication and statistics-specific operational surfaces. */
.auth-page {
    display: grid;
    min-height: calc(100vh - 64px);
    place-items: center;
}

.auth-panel {
    width: min(440px, 100%);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(16, 27, 49, 0.92);
    padding: 28px;
}

.auth-panel > p:not(.eyebrow) {
    color: var(--color-muted);
}

.auth-form,
.filter-form,
.stats-import-form {
    display: grid;
    gap: 12px;
}

.auth-form label,
.filter-form label,
.stats-import-form label {
    display: grid;
    gap: 6px;
}

.auth-form input,
.filter-form select,
.stats-import-form input {
    width: 100%;
    border: 1px solid rgba(184, 195, 217, 0.35);
    border-radius: 6px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
    font: inherit;
}

.auth-form button,
.filter-form button,
.stats-import-form button {
    border: 0;
    border-radius: 6px;
    padding: 11px 14px;
    background: var(--color-gold);
    color: var(--color-navy-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.optional-label {
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 400;
}

.auth-form small {
    color: var(--color-muted);
    font-weight: 400;
}

.player-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-photo {
    width: 88px;
    height: 88px;
    border: 2px solid var(--color-gold);
    border-radius: 50%;
    object-fit: cover;
    background: var(--color-surface-raised);
}

.filter-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) minmax(180px, 1fr);
    align-items: end;
}

.stats-import-form {
    min-width: 280px;
}

.import-status {
    min-height: 18px;
    color: var(--color-muted);
    font-size: 13px;
}

.leaderboards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.leaderboard-panel {
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(16, 27, 49, 0.86);
}

.leaderboard-panel h3 {
    margin: 0;
    padding: 16px;
    background: var(--color-navy);
    color: var(--color-gold);
}

.leaderboard-statistic {
    margin: -4px 0 14px;
    color: var(--color-muted);
    font-size: 14px;
}

.secondary-action {
    display: inline-block;
    margin-top: 14px;
    color: var(--color-gold);
    font-weight: 700;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}

.leaderboard-table th {
    color: var(--color-muted);
    font-size: 12px;
    text-transform: uppercase;
}

.leaderboard-table td span {
    display: block;
    margin-top: 3px;
    color: var(--color-muted);
    font-size: 13px;
}

.leaderboard-player {
    display: flex;
    align-items: center;
    gap: 10px;
}

.leaderboard-team {
    margin-left: 58px;
    overflow-wrap: anywhere;
}

.team-roster-link {
    color: inherit;
    font-weight: inherit;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.team-roster-link:hover,
.team-roster-link:focus-visible {
    color: var(--color-gold);
    text-decoration: underline;
}

.leaderboard-player small {
    display: block;
    margin-top: 2px;
    color: var(--color-muted);
}

.leaderboard-photo,
.roster-player-photo {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(244, 197, 66, 0.45);
    border-radius: 50%;
    object-fit: cover;
    background: var(--color-surface-raised);
}

.profile-placeholder {
    display: inline-grid !important;
    place-items: center;
    background: var(--color-navy-soft);
    color: var(--color-gold) !important;
    font-weight: 700;
}

.leaderboard-table tr:last-child td {
    border-bottom: 0;
}

.rank-cell,
.stat-value {
    width: 64px;
    color: var(--color-gold);
    font-weight: 700;
}

/* Reusable resource cards and roster/game collections. */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 20px;
}

.team-card,
.empty-state,
.game-card {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(16, 27, 49, 0.86);
    padding: 16px;
}

.team-card {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 16px;
    width: 100%;
}

.team-card-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex: 1;
    border: 0;
    padding: 0;
    background: transparent;
    text-align: left;
    font: inherit;
    color: var(--color-text) !important;
    text-decoration: none;
    cursor: pointer;
}

.team-logo {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: white;
    object-fit: contain;
}

.team-logo-small {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
}

.team-logo-placeholder {
    display: grid;
    place-items: center;
    background: var(--color-navy);
    color: var(--color-gold);
    font-size: 22px;
    font-weight: 700;
}

.game-matchup,
.standings-team {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.matchup-versus {
    color: var(--color-muted);
    font-size: 14px;
    font-weight: 400;
}

.team-card:hover {
    border-color: rgba(244, 197, 66, 0.54);
}

.team-delete-button {
    align-self: center;
    border: 1px solid rgba(255, 123, 102, 0.5);
    border-radius: 6px;
    padding: 8px 12px;
    background: rgba(143, 39, 39, 0.22);
    color: #ffb4a8;
    font: inherit;
    cursor: pointer;
}

.team-card h3 {
    margin-bottom: 6px;
}

.team-card p,
.empty-state p,
.game-card p {
    margin-bottom: 0;
    color: var(--color-muted);
}

.team-status {
    border: 1px solid rgba(244, 197, 66, 0.34);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(244, 197, 66, 0.12);
    color: var(--color-gold);
    font-size: 13px;
    white-space: nowrap;
}

.team-manage-link {
    align-self: center;
    border: 1px solid rgba(244, 197, 66, 0.45);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--color-gold);
    font-weight: 700;
    text-decoration: none;
}

body.role-league_admin .team-manage-link.admin-only {
    display: inline-flex !important;
}

.team-management-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.team-management-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.team-management-grid .form-panel {
    margin-bottom: 0;
}

.management-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
}

.team-representative-management {
    grid-column: 1 / -1;
}

.assigned-representatives {
    display: grid;
    gap: 8px;
    margin: 14px 0 18px;
}

.assigned-representative {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
}

.assigned-representative button {
    border: 1px solid rgba(255, 123, 102, 0.5);
    border-radius: 6px;
    padding: 7px 10px;
    background: rgba(143, 39, 39, 0.22);
    color: #ffb4a8;
    font: inherit;
    cursor: pointer;
}

.empty-inline-state,
.danger-zone p {
    color: var(--color-muted);
}

.danger-zone .team-delete-button {
    margin-top: 12px;
}

/* Shared form language: every operational panel uses the Teams controls. */
.form-panel form {
    gap: 16px;
    align-items: end;
}

.form-panel form label:not(.role-choice) {
    display: grid;
    gap: 8px;
    color: var(--color-text);
    font-weight: 600;
}

.form-panel input:not([type="checkbox"]),
.form-panel select,
.form-panel textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(184, 195, 217, 0.35);
    border-radius: 6px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
    font: inherit;
}

.form-panel input::placeholder,
.form-panel textarea::placeholder {
    color: rgba(248, 250, 252, 0.5);
}

.form-panel button[type="submit"],
.form-panel button[data-primary-action] {
    min-height: 48px;
    border: 0;
    border-radius: 6px;
    padding: 11px 14px;
    background: var(--color-gold);
    color: var(--color-navy-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.team-status-active {
    border-color: rgba(74, 222, 128, 0.45);
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
}

.team-status-inactive {
    border-color: rgba(169, 182, 207, 0.35);
    background: rgba(169, 182, 207, 0.1);
    color: var(--color-muted);
}

.hidden {
    display: none !important;
}

/* Operational controls stay hidden until the session role is resolved. */
.admin-only,
.team-manager-only,
.team-scope-manager-only {
    display: none !important;
}

body.role-league_admin .admin-only,
body.role-league_admin .team-manager-only,
body.role-team_representative .team-manager-only {
    display: block !important;
}

body.role-league_admin form.admin-only,
body.role-league_admin form.team-manager-only,
body.role-team_representative form.team-manager-only {
    display: grid !important;
}

body.can-manage-team .team-scope-manager-only {
    display: block !important;
}

body.can-manage-team form.team-scope-manager-only {
    display: grid !important;
}

/* Visibility state must win over role display rules on interactive panels. */
body.role-league_admin .admin-only.hidden,
body.role-league_admin .team-manager-only.hidden,
body.role-team_representative .team-manager-only.hidden,
body.can-manage-team .team-scope-manager-only.hidden,
body.role-league_admin form.admin-only.hidden,
body.role-league_admin form.team-manager-only.hidden,
body.role-team_representative form.team-manager-only.hidden,
body.can-manage-team form.team-scope-manager-only.hidden {
    display: none !important;
}

/* This action is inline rather than a panel, so it needs its own display mode. */
body.role-league_admin .team-delete-button.admin-only {
    display: inline-flex !important;
}

.roster-panel {
    margin-top: 32px;
}

.roster-list,
.games-list {
    display: grid;
    gap: 12px;
}

.roster-list {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
}

.roster-player {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(16, 27, 49, 0.86);
    padding: 14px 16px;
}

.roster-player-photo {
    width: 64px;
    height: 64px;
}

.roster-player-identity {
    min-width: 0;
    flex: 1;
}

.roster-player .jersey-number {
    margin-left: auto;
}

.roster-player-actions,
.form-actions {
    align-items: center;
    gap: 8px;
}

.secondary-button {
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text);
}

.danger-button {
    border: 1px solid rgba(220, 85, 85, 0.55);
    background: rgba(160, 35, 35, 0.16);
    color: #ffb3b3;
}

.secondary-button,
.danger-button {
    border-radius: 6px;
    padding: 9px 12px;
    font: inherit;
    cursor: pointer;
}

body.can-manage-team .roster-player-actions.team-scope-manager-only {
    display: flex !important;
}

.roster-edit-form {
    flex-basis: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.roster-edit-form label,
.roster-edit-form input,
.roster-photo-form label,
.roster-photo-form input {
    min-width: 0;
    width: 100%;
}

.roster-edit-form label {
    display: grid;
    gap: 6px;
    color: var(--color-text);
    font-size: 14px;
}

.roster-edit-form input {
    border: 1px solid rgba(184, 195, 217, 0.35);
    border-radius: 6px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
    font: inherit;
}

.roster-edit-form input[readonly] {
    color: var(--color-muted);
    background: rgba(255, 255, 255, 0.035);
}

.roster-edit-form .form-actions,
.roster-edit-message {
    grid-column: 1 / -1;
}

.roster-edit-form .form-actions {
    display: flex;
}

.roster-edit-form button[type="submit"] {
    border: 1px solid rgba(244, 197, 66, 0.45);
    border-radius: 6px;
    padding: 9px 14px;
    background: var(--color-gold);
    color: var(--color-navy-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 820px) {
    .roster-edit-form {
        grid-template-columns: 1fr;
    }

    .roster-edit-form .form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

.roster-photo-form {
    flex: 1 0 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--color-border);
    padding-top: 12px;
}

.roster-photo-form input {
    width: 100%;
    color: var(--color-muted);
    overflow: hidden;
    border: 1px solid rgba(184, 195, 217, 0.35);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    font: inherit;
    font-size: 13px;
}

input[type="file"]::file-selector-button {
    min-height: 42px;
    margin-right: 10px;
    border: 0;
    border-right: 1px solid rgba(184, 195, 217, 0.25);
    padding: 9px 12px;
    background: rgba(244, 197, 66, 0.12);
    color: var(--color-gold);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
    background: rgba(244, 197, 66, 0.2);
}

.roster-photo-form button {
    border: 1px solid rgba(244, 197, 66, 0.45);
    border-radius: 6px;
    padding: 8px 12px;
    background: rgba(244, 197, 66, 0.14);
    color: var(--color-gold);
    font: inherit;
    cursor: pointer;
}

.roster-photo-message {
    grid-column: 1 / -1;
    color: var(--color-muted);
    font-size: 13px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--color-gold);
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.link-button {
    border: 0;
    padding: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.jersey-number {
    display: inline-grid;
    place-items: center;
    min-width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--color-gold);
    color: var(--color-navy-dark);
    font-weight: 700;
}

.roster-player h3 {
    margin-bottom: 4px;
}

.roster-player p {
    margin-bottom: 0;
    color: var(--color-muted);
}

.game-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
}

.game-time-group {
    display: grid;
    gap: 12px;
}

.game-time-group + .game-time-group {
    margin-top: 12px;
}

.game-time-heading {
    display: flex;
    align-items: baseline;
    gap: 10px;
    border-bottom: 1px solid var(--color-border);
    padding: 6px 2px 10px;
}

.game-time-heading h3 {
    margin: 0;
    font-size: 16px;
}

.game-time-heading time {
    color: var(--color-gold);
    font-size: 22px;
    font-weight: 700;
}

.game-time-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.game-card-header,
.game-card-footer,
.game-team-row {
    display: flex;
    align-items: center;
}

.game-card-header {
    justify-content: space-between;
    gap: 12px;
}

.game-field {
    color: var(--color-muted);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.game-teams {
    display: grid;
    gap: 6px;
}

.game-team-row {
    min-width: 0;
    gap: 10px;
    border-radius: 6px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.game-team-side {
    width: 54px;
    flex: 0 0 54px;
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.game-team-logo {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 6px;
}

.game-team-logo-placeholder {
    display: grid;
    place-items: center;
    border: 1px solid var(--color-border);
    background: var(--color-navy);
    color: var(--color-gold);
    font-weight: 700;
}

.game-team-name {
    min-width: 0;
    flex: 1;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.game-team-score {
    min-width: 32px;
    color: var(--color-text);
    font-size: 20px;
    font-weight: 700;
    text-align: right;
}

.game-card-footer {
    justify-content: space-between;
    gap: 12px;
    color: var(--color-muted);
    font-size: 14px;
}

.game-details-link {
    flex: 0 0 auto;
    white-space: nowrap;
}

.score-form {
    display: grid;
    grid-template-columns: auto auto;
    align-items: end;
    gap: 10px;
}

.score-fields {
    display: grid;
    grid-template-columns: 64px 14px 64px;
    align-items: end;
    gap: 6px;
}

.score-fields label {
    display: grid;
    gap: 4px;
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.score-fields input {
    width: 64px;
    min-height: 44px;
    border: 1px solid rgba(184, 195, 217, 0.35);
    border-radius: 6px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.score-separator {
    padding-bottom: 12px;
    color: var(--color-muted);
    font-weight: 700;
    text-align: center;
}

.score-form button {
    min-height: 44px;
    border: 0;
    border-radius: 6px;
    padding: 9px 14px;
    background: var(--color-gold);
    color: var(--color-navy-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.game-admin-panel {
    border-top: 1px solid var(--color-border);
    padding-top: 12px;
}

.game-admin-panel summary {
    width: fit-content;
    color: var(--color-gold);
    font-weight: 700;
    cursor: pointer;
}

.game-admin-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
}

.game-admin-controls .secondary-button,
.game-admin-controls .danger-button {
    min-height: 40px;
    white-space: nowrap;
}

.game-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 1px solid rgba(244, 197, 66, 0.45);
    border-radius: 999px;
    padding: 7px 12px;
    color: var(--color-gold);
    font-weight: 700;
}

.game-status-postponed {
    border-color: rgba(232, 153, 73, 0.55);
    background: rgba(167, 84, 32, 0.16);
    color: #ffd2a1;
}

.game-status-scheduled {
    border-color: rgba(169, 182, 207, 0.3);
    background: rgba(169, 182, 207, 0.08);
    color: var(--color-muted);
}

.game-status-completed {
    border-color: rgba(74, 222, 128, 0.4);
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

.week-admin-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 20px;
    margin-top: 12px;
    border: 1px solid rgba(220, 85, 85, 0.32);
    border-radius: 8px;
    padding: 14px 16px;
    background: rgba(160, 35, 35, 0.08);
}

body.role-league_admin .week-admin-actions.admin-only {
    display: grid !important;
}

.week-admin-actions h3,
.week-admin-actions p {
    margin: 0;
}

.week-admin-actions p {
    margin-top: 3px;
    color: var(--color-muted);
}

.week-admin-actions .form-message {
    grid-column: 1 / -1;
}

.week-admin-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.week-admin-buttons {
    display: flex;
    gap: 8px;
}

@media (max-width: 900px) {
    .game-time-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .score-form {
        align-items: end;
    }
}

@media (max-width: 560px) {
    .game-time-heading time {
        font-size: 20px;
    }

    .game-card-header {
        align-items: flex-start;
    }

    .game-team-row {
        gap: 8px;
        padding-inline: 6px;
    }

    .game-team-side {
        width: 46px;
        flex-basis: 46px;
    }

    .game-team-logo {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .game-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .score-form {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .score-fields {
        grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr);
    }

    .score-fields input {
        width: 100%;
    }

    .score-form button {
        width: 100%;
    }

    .game-admin-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .game-admin-controls .score-form {
        grid-column: 1 / -1;
    }

    .game-admin-controls .secondary-button,
    .game-admin-controls .danger-button {
        width: 100%;
    }

    .week-admin-actions {
        grid-template-columns: 1fr;
    }

    .week-admin-actions .danger-button {
        width: 100%;
    }

    .week-admin-buttons {
        display: grid;
        grid-template-columns: 1fr;
    }

    .week-admin-buttons button {
        width: 100%;
    }
}

.team-division {
    margin-top: 24px;
}

.team-division h3 {
    margin-bottom: 12px;
    color: var(--color-gold);
}

.filters-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 260px));
    gap: 16px;
    align-items: end;
    margin: 24px 0 16px;
}

.filters-panel label {
    display: grid;
    gap: 8px;
    color: var(--color-text);
    font-weight: 600;
}

.filters-panel select,
.filters-panel input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
    font: inherit;
}

.games-filters {
    grid-template-columns: repeat(3, minmax(180px, 260px));
}

.games-team-search {
    grid-column: span 2;
}

.results-count {
    margin: 0 0 12px;
    color: var(--color-muted);
}

/* Dense standings table with horizontal overflow on narrow screens. */
.standings-table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.roster-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.roster-team-logo {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
}

.player-profile-link {
    color: inherit;
    text-decoration: none;
}

.player-profile-link:hover h3,
.player-profile-link:hover strong {
    color: var(--color-gold);
    text-decoration: underline;
}

.standings-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(16, 27, 49, 0.86);
}

.standings-data-table th,
.standings-data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
    white-space: nowrap;
}

.standings-data-table th {
    background: var(--color-navy);
    color: white;
    font-size: 13px;
    font-weight: 700;
}

.standings-data-table th:first-child,
.standings-data-table td:first-child {
    text-align: left;
}

.standings-data-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.04);
}

.standings-data-table tbody tr:hover {
    background: rgba(244, 197, 66, 0.12);
}

.standings-data-table tbody tr:last-child td {
    border-bottom: 0;
}

.standings-data-table td:first-child {
    font-weight: 700;
    color: var(--color-gold);
}

.standings-data-table td:last-child {
    font-weight: 700;
}

.dashboard-page { display: grid; gap: 28px; }

.dashboard-join-form {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) minmax(120px, 1fr) minmax(180px, 1fr);
    gap: 16px;
    align-items: end;
}

.dashboard-join-form label,
.auth-form label { display: grid; gap: 8px; font-weight: 600; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.stat-item {
    min-height: 96px;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(16, 27, 49, 0.86);
    display: grid;
    gap: 8px;
}

.stat-item span { color: var(--color-muted); }
.stat-item strong { color: var(--color-gold); font-size: 26px; }
.dashboard-teams { display: grid; gap: 12px; }

.users-table-wrapper,
.table-scroll { overflow-x: auto; }
.users-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--color-border);
    background: rgba(16, 27, 49, 0.86);
}
.users-table th,
.users-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}
.users-table th { background: var(--color-navy); }
.users-table select { min-width: 190px; }
.admin-users-filters {
    grid-template-columns: minmax(240px, 440px) auto;
    align-items: end;
}
.admin-users-filters .results-count { margin: 0 0 14px; }
.table-empty-state { color: var(--color-muted); text-align: center !important; }
.save-role-button,
.save-aka-button {
    min-height: 42px;
    border: 0;
    border-radius: 6px;
    padding: 0 18px;
    background: var(--color-gold);
    color: var(--color-navy-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.save-role-button:hover,
.save-aka-button:hover {
    background: #ffd95a;
}

.save-role-button:disabled,
.save-aka-button:disabled {
    cursor: wait;
    opacity: 0.65;
}
.user-actions {
    display: grid;
    gap: 8px;
    min-width: 190px;
}

.user-actions > button {
    width: 100%;
    min-height: 42px;
    border-radius: 6px;
    padding: 0 18px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.reset-password-button {
    border: 1px solid rgba(244, 197, 66, 0.65);
    background: rgba(244, 197, 66, 0.08);
    color: var(--color-gold);
}

.reset-password-button:hover,
.reset-password-button:focus-visible {
    border-color: var(--color-gold);
    background: rgba(244, 197, 66, 0.16);
}

.reset-password-button:focus-visible {
    outline: 2px solid rgba(244, 197, 66, 0.28);
    outline-offset: 2px;
}

.reset-password-button:disabled {
    cursor: wait;
    opacity: 0.65;
}
.official-aka-editor {
    display: grid;
    grid-template-columns: minmax(150px, 1fr);
    gap: 8px;
    min-width: 180px;
}
.official-aka-editor input {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(184, 195, 217, 0.35);
    border-radius: 6px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
    font: inherit;
}

.official-aka-editor input::placeholder {
    color: rgba(248, 250, 252, 0.5);
}

.official-aka-editor input:focus-visible {
    border-color: var(--color-gold);
    outline: 2px solid rgba(244, 197, 66, 0.24);
    outline-offset: 1px;
}

.save-aka-button { white-space: nowrap; }
.not-applicable { color: var(--color-muted); }
.delete-user-button {
    border: 1px solid rgba(255, 123, 102, 0.5);
    background: rgba(143, 39, 39, 0.22);
    color: #ffb4a8;
}

.delete-user-button:hover,
.delete-user-button:focus-visible {
    border-color: rgba(255, 180, 168, 0.85);
    background: rgba(143, 39, 39, 0.34);
}
.role-choices { display: grid; gap: 8px; min-width: 180px; }
.role-choice { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.role-choice input { width: 18px; min-height: 18px; margin: 0; }

.staff-account-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}
.staff-account-form label { display: grid; gap: 8px; font-weight: 600; }
.staff-account-form fieldset { display: grid; gap: 8px; margin: 0; }
.staff-account-form button { min-height: 48px; }
@media (max-width: 900px) {
    .staff-account-form { grid-template-columns: 1fr; }
}
.assigned-referees { display: flex; flex-wrap: wrap; gap: 8px; color: var(--color-muted); }
.assigned-referee { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--color-border); border-radius: 6px; padding: 6px 10px; }
.assigned-referee button { min-height: 28px; padding: 0 8px; }

.schedule-review { margin-top: 20px; }

.schedule-import-table td,
.schedule-import-table th {
    white-space: nowrap;
}

.schedule-row-warning td {
    color: var(--color-muted);
    background: rgba(245, 196, 66, 0.07);
}

.referee-roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.referee-roster-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 16px;
    background: var(--color-surface-raised);
}

.referee-profile-link {
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
}

.referee-profile-link:hover .referee-roster-card,
.referee-profile-link:focus-visible .referee-roster-card {
    border-color: rgba(244, 197, 66, 0.55);
    background: rgba(19, 43, 87, 0.72);
}

.referee-profile-link:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 3px;
}

.referee-roster-card img,
.referee-photo-placeholder {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-gold);
}

.referee-photo-placeholder {
    display: grid;
    place-items: center;
    background: var(--color-navy);
    color: var(--color-gold);
    font-weight: 800;
}

.referee-roster-card h3,
.referee-roster-card p { margin: 0; }
.referee-roster-card p { margin-top: 4px; color: var(--color-muted); }
.referee-profile-action {
    display: inline-block;
    margin-top: 8px;
    color: var(--color-gold);
    font-size: 0.875rem;
    font-weight: 700;
}

.referee-profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
}

.referee-profile-header .eyebrow { margin-bottom: 4px; }
.referee-profile-header h2 { margin-bottom: 6px; }

.referee-position-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.referee-position-item {
    min-height: 112px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 18px;
    background: rgba(16, 27, 49, 0.86);
    display: grid;
    align-content: center;
    gap: 4px;
}

.referee-position-item span,
.referee-position-item small { color: var(--color-muted); }
.referee-position-item strong { color: var(--color-gold); font-size: 26px; }

.game-crew { margin-top: 14px; }
.game-crew > strong { color: var(--color-gold); font-size: 0.9rem; }
.game-crew ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}
.game-crew li {
    display: grid;
    gap: 2px;
    border-left: 2px solid var(--color-gold);
    padding-left: 8px;
}
.game-crew li span { color: var(--color-muted); font-size: 0.8rem; }
.game-crew li b { font-size: 0.95rem; }
.schedule-referees { display: grid; gap: 10px; min-width: 240px; }
.schedule-official-slot { display: grid; gap: 4px; font-size: 0.875rem; }
.schedule-official-slot select { width: 100%; }

.game-detail-score {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    text-align: center;
}

.game-detail-score strong { color: var(--gold); font-size: 2rem; }
.game-detail-page { display: grid; gap: 28px; }
.game-detail-page > section > h3 { margin: 0 0 16px; }
.game-detail-page .standings-table { width: 100%; }
.secondary-link, .back-link { color: var(--color-gold); font-weight: 700; }
.schedule-review pre {
    max-height: 240px;
    overflow: auto;
    white-space: pre-wrap;
    color: var(--color-muted);
}

/* Collapse the desktop shell into a single-column mobile layout. */
@media (max-width: 820px) {
    body {
        background: var(--color-page);
    }

    .layout,
    body.sidebar-collapsed .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        z-index: 30;
        inset: 0 auto 0 0;
        width: min(300px, calc(100vw - 48px));
        overflow-y: auto;
        border-right: 1px solid rgba(244, 197, 66, 0.25);
        padding: 20px;
        box-shadow: 18px 0 44px rgba(0, 0, 0, 0.42);
        transform: translateX(0);
        transition: transform 180ms ease;
    }

    body.sidebar-collapsed .sidebar {
        inset: 0 0 auto;
        width: 100%;
        height: 76px;
        min-height: 0;
        display: grid;
        grid-template-columns: 44px 56px 1fr;
        align-items: center;
        gap: 12px;
        overflow: hidden;
        border-right: 0;
        border-bottom: 1px solid var(--color-border);
        padding: 10px 16px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
    }

    body.sidebar-collapsed .sidebar-toggle {
        margin: 0;
    }

    body.sidebar-collapsed .brand {
        margin: 0;
    }

    body.sidebar-collapsed .brand-logo {
        width: 56px;
        height: 56px;
        margin: 0;
        object-fit: contain;
    }

    body.sidebar-collapsed .eyebrow,
    body.sidebar-collapsed .brand h1 {
        display: none;
    }

    .navigation {
        grid-template-columns: 1fr;
    }

    body.sidebar-collapsed .nav-link,
    body.sidebar-collapsed .navigation,
    body.sidebar-collapsed .session-controls {
        display: none;
    }

    .sidebar-backdrop {
        position: fixed;
        z-index: 20;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        border: 0;
        background: rgba(0, 0, 0, 0.62);
        cursor: default;
    }

    body:not(.sidebar-collapsed) .sidebar-backdrop {
        display: block;
    }

    body:not(.sidebar-collapsed) {
        overflow: hidden;
    }

    .content {
        width: 100%;
        min-width: 0;
        padding: 92px 16px 32px;
    }

    .content > section,
    .content > section > section,
    .form-panel,
    .filters-panel,
    .teams-grid,
    .games-list,
    .leaderboards {
        min-width: 0;
        max-width: 100%;
    }

    .section-header h2 {
        font-size: 24px;
    }

    .form-panel {
        padding: 16px;
    }

    .team-form,
    .game-form,
    .standings-form,
    .player-form,
    .filter-form,
    .filters-panel,
    .games-filters,
    .dashboard-join-form,
    .staff-account-form {
        grid-template-columns: 1fr;
    }

    .manual-game-division-filters,
    .manual-team-picker {
        grid-column: auto;
        grid-template-columns: 1fr;
    }

    .team-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .game-card {
        align-items: stretch;
        flex-direction: column;
    }

    .games-team-search {
        grid-column: auto;
    }

    .teams-grid,
    .leaderboards,
    .roster-list {
        grid-template-columns: 1fr;
    }

    .filters-panel {
        margin-top: 16px;
    }

    .team-card-main {
        width: 100%;
    }

    .team-delete-button {
        width: 100%;
        justify-content: center;
    }

    .game-card strong {
        white-space: normal;
    }

    .game-detail-score {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .player-profile-header {
        align-items: flex-start;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .standings-data-table,
    .users-table,
    .leaderboard-table {
        min-width: 620px;
    }

    .standings-table,
    .users-table-wrapper,
    .table-scroll,
    .leaderboard-panel {
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }

    .standings-data-table th:first-child,
    .standings-data-table td:first-child,
    .users-table th:first-child,
    .users-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
        background: var(--color-surface-raised);
    }

    .standings-data-table th:first-child,
    .users-table th:first-child {
        background: var(--color-navy);
    }

    .stats-import-form {
        min-width: 0;
        width: 100%;
    }

    .assigned-referee {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 430px) {
    .content {
        padding-inline: 12px;
    }

    .form-panel,
    .team-card,
    .game-card,
    .roster-player {
        padding: 14px;
    }

    .auth-panel {
        padding: 20px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .profile-photo {
        width: 72px;
        height: 72px;
    }

    .roster-player {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .roster-player .jersey-number {
        margin-left: 0;
    }
}

/* Team ownership surfaces share the same compact, operational visual language. */
.team-staff {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.team-staff > div {
    border-left: 3px solid var(--color-gold);
    padding: 8px 12px;
}

.team-staff span,
.team-staff strong {
    display: block;
}

.team-staff span,
.muted-text {
    color: var(--color-muted);
}

.representative-teams {
    display: grid;
    gap: 20px;
}

.representative-team-panel {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
}

.representative-team-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.representative-team-header .secondary-link {
    white-space: nowrap;
}

.representative-team-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: auto;
}

.representative-player-list {
    display: none;
}

.role-dashboard-page {
    display: grid;
    gap: 24px;
}

.role-dashboard-page > .section-header,
.role-dashboard-page > .form-panel,
.role-dashboard-page > .form-message {
    margin-bottom: 0;
}

.dashboard-summary-grid {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.dashboard-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-quick-links a {
    border: 1px solid rgba(244, 197, 66, 0.36);
    border-radius: 6px;
    padding: 10px 14px;
    color: var(--color-gold);
    font-weight: 700;
    text-decoration: none;
}

.dashboard-quick-links a:hover {
    background: rgba(244, 197, 66, 0.1);
}

.dashboard-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.dashboard-section-heading h3,
.dashboard-section-heading p {
    margin-bottom: 0;
}

.dashboard-section-heading p {
    margin-top: 6px;
    color: var(--color-muted);
}

.dashboard-section-heading > strong {
    color: var(--color-gold);
    font-size: 24px;
}

.referee-dashboard-games,
.referee-game-section {
    display: grid;
    gap: 16px;
}

.referee-game-section + .referee-game-section {
    margin-top: 8px;
}

.referee-game-copy {
    min-width: 0;
}

.referee-game-copy h4 {
    margin: 8px 0 6px;
    font-size: 18px;
}

.referee-game-result {
    display: grid;
    justify-items: end;
    gap: 10px;
    text-align: right;
}

.game-state {
    display: inline-flex;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
}

.game-state-pending {
    border-color: rgba(244, 197, 66, 0.42);
    color: var(--color-gold);
}

.game-state-complete {
    border-color: rgba(85, 214, 164, 0.38);
    color: #8ce0be;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    border-top: 1px solid var(--color-border);
    padding: 18px 0 4px;
    color: var(--color-muted);
    font-size: 14px;
}

.site-footer a {
    color: var(--color-gold);
}

.privacy-page {
    width: min(860px, 100%);
    margin: 0 auto;
}

.privacy-page > section {
    border-bottom: 1px solid var(--color-border);
    padding: 22px 0;
}

.privacy-page > section:last-child {
    border-bottom: 0;
}

.privacy-page h3 {
    margin-bottom: 10px;
    color: var(--color-gold);
}

.privacy-page p,
.privacy-page li {
    color: var(--color-muted);
    line-height: 1.65;
}

.privacy-page li + li {
    margin-top: 8px;
}

.privacy-consent {
    grid-template-columns: 20px minmax(0, 1fr) !important;
    align-items: start;
}

.auth-form .privacy-consent input {
    width: 18px;
    min-height: 18px;
    margin: 2px 0 0;
}

.privacy-consent a {
    color: var(--color-gold);
}

@media (max-width: 700px) {
    .audit-filters {
        grid-template-columns: 1fr;
    }

    .duplicate-team-group > header,
    .duplicate-team-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .duplicate-team-actions {
        width: 100%;
    }

    .duplicate-team-actions .secondary-link {
        flex: 1;
        text-align: center;
    }

    .team-staff {
        grid-template-columns: 1fr;
    }

    .representative-team-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .representative-team-header > div:not(.representative-team-actions) {
        min-width: 0;
        flex: 1;
    }

    .representative-team-header h3,
    .representative-team-header p {
        overflow-wrap: anywhere;
    }

    .representative-team-actions {
        display: grid;
        grid-template-columns: 1fr;
        margin-left: 0;
        width: 100%;
    }

    .representative-team-actions .secondary-link {
        display: block;
        border: 1px solid var(--color-border);
        border-radius: 6px;
        padding: 10px 12px;
        text-align: center;
        white-space: normal;
    }

    .dashboard-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .representative-team-panel {
        padding: 16px;
    }

    .representative-team-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .representative-team-metrics .stat-item,
    .dashboard-summary-grid .stat-item {
        min-height: 82px;
        padding: 14px;
    }

    .representative-player-table {
        display: none;
    }

    .representative-player-list {
        display: grid;
        gap: 10px;
    }

    .representative-player-card {
        border: 1px solid var(--color-border);
        border-radius: 8px;
        padding: 14px;
        background: rgba(7, 26, 68, 0.3);
    }

    .representative-player-card header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--color-border);
    }

    .representative-player-card header a {
        min-width: 0;
        color: var(--color-text);
        font-weight: 700;
        overflow-wrap: anywhere;
    }

    .representative-player-card header strong {
        color: var(--color-gold);
        white-space: nowrap;
    }

    .representative-player-card dl {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px 8px;
        margin: 12px 0 0;
    }

    .representative-player-card dl div {
        min-width: 0;
    }

    .representative-player-card dt {
        color: var(--color-muted);
        font-size: 0.75rem;
        font-weight: 700;
    }

    .representative-player-card dd {
        margin: 4px 0 0;
        color: var(--color-text);
        font-weight: 700;
    }

    .referee-game-result {
        width: 100%;
        justify-items: start;
        text-align: left;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .team-management-grid,
    .management-form {
        grid-template-columns: 1fr;
    }

    .team-representative-management {
        grid-column: 1;
    }

    .roster-photo-form {
        grid-template-columns: 1fr;
    }

    .roster-photo-message {
        grid-column: 1;
    }
}

#profile-form {
    grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px);
}

#profile-form > * {
    min-width: 0;
}

#join-team-form {
    grid-template-columns: repeat(2, minmax(150px, 0.8fr)) minmax(240px, 1.5fr) minmax(110px, 0.6fr) minmax(180px, 0.8fr);
}

#join-team-form > * {
    min-width: 0;
}

@media (max-width: 820px) {
    .dashboard-page {
        gap: 20px;
    }

    .dashboard-page > .form-panel {
        margin-bottom: 0;
    }

    #profile-form {
        grid-template-columns: minmax(0, 1fr);
    }

    #join-team-form {
        grid-template-columns: minmax(0, 1fr);
    }

    #profile-form button,
    #join-team-form button {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .role-dashboard-page .dashboard-summary-grid,
    .role-dashboard-page .representative-team-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .role-dashboard-page .dashboard-summary-grid .stat-item:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .dashboard-quick-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-quick-links a {
        width: 100%;
        padding-inline: 10px;
        text-align: center;
    }

    .dashboard-section-heading {
        align-items: flex-start;
    }

    .dashboard-page .section-header {
        margin-bottom: 4px;
    }

    .dashboard-page .player-profile-header {
        gap: 14px;
    }

    .dashboard-page .player-profile-header > div {
        min-width: 0;
    }

    .dashboard-page .player-profile-header p {
        margin-bottom: 0;
    }
}
