/* ===================== Football Teams app styles ===================== */
/* (players table styles appended near the bottom) */
:root {
    --bg: #0f172a;
    --panel: #1e293b;
    --panel-2: #273449;
    --line: #334155;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: #22c55e;
    --accent-d: #16a34a;
    --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    color-scheme: dark;
}

h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* layout */
.page { min-height: 100vh; }
.topbar {
    display: flex; align-items: center; gap: .5rem 1rem; flex-wrap: wrap;
    padding: .65rem 1rem;
    background: var(--panel); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.1rem;
    display: inline-flex; align-items: center; gap: .5rem; }
.brand-logo { height: 1.7rem; width: 1.7rem; }
.login-logo { width: 84px; height: 84px; display: block; margin: 0 auto .5rem; }
.topbar nav { display: flex; gap: .25rem .35rem; flex: 1; flex-wrap: wrap; }
.navlink {
    color: var(--muted); text-decoration: none; padding: .4rem .7rem;
    border-radius: .5rem; font-weight: 500; white-space: nowrap;
}
.navlink:hover { background: var(--panel-2); color: var(--text); }
.navlink.active { background: var(--panel-2); color: var(--text); }
.logout-form { margin: 0; }

/* On narrow screens, keep brand + sign-out on the top row and let the nav links
   wrap onto their own full-width row below. */
@media (max-width: 640px) {
    .topbar { gap: .5rem .5rem; }
    .logout-form { order: 2; margin-left: auto; }
    .topbar nav { order: 3; flex-basis: 100%; }
}

main { padding: 1.25rem; max-width: 1100px; margin: 0 auto; }

/* cards */
.card {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: .75rem; padding: 1rem 1.25rem; margin-bottom: 1rem;
}

/* forms & buttons */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field > span { font-size: .8rem; color: var(--muted); }
select,
input:not([type=checkbox]):not([type=radio]) {
    background: var(--panel-2); color: var(--text);
    border: 1px solid var(--line); border-radius: .5rem;
    padding: .5rem .6rem; font-size: 1rem; min-width: 12rem;
    font-family: inherit; line-height: 1.3;
    color-scheme: dark;            /* dark native date/time pickers + caret */
    transition: border-color .12s, box-shadow .12s;
    appearance: none; -webkit-appearance: none;
}
select { appearance: auto; -webkit-appearance: auto; }   /* keep the dropdown arrow */
select:focus,
input:not([type=checkbox]):not([type=radio]):focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34,197,94,.18);
}
input::placeholder { color: var(--muted); }
input[type=checkbox] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }
.who-row { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }

.btn {
    border: 1px solid var(--line); border-radius: .5rem;
    padding: .55rem .9rem; font-size: .95rem; font-weight: 600;
    cursor: pointer; background: var(--panel-2); color: var(--text);
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent-d); color: #06210f; }
.btn.out { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.ghost { background: transparent; }

.tag { padding: .35rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.tag.in { background: rgba(34,197,94,.15); color: var(--accent); }
.count { display: inline-block; min-width: 1.4rem; text-align: center;
    background: rgba(148,163,184,.2); border-radius: 999px; padding: 0 .45rem;
    font-size: .8rem; margin-left: .35rem; }

/* available chips */
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { background: var(--panel-2); border: 1px solid var(--line);
    border-radius: 999px; padding: .35rem .8rem; font-size: .9rem; }

/* team boards (read-only + builder share .board) */
.boards, .builder {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.board {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: .75rem; padding: .75rem; min-height: 120px;
    transition: outline-color .12s, background .12s;
    outline: 2px solid transparent;
}
.board > header {
    font-weight: 700; padding: .35rem .5rem; border-radius: .5rem;
    margin-bottom: .5rem; border-left: 5px solid var(--team, var(--line));
    background: var(--panel-2);
}
.board ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.board.bench > header { border-left-color: var(--muted); }
.board.drop-hint { outline-color: var(--accent); background: rgba(34,197,94,.06); }

/* draggable player cards (builder) */
.player-card {
    display: flex; align-items: center; gap: .5rem;
    background: var(--panel-2); border: 1px solid var(--line);
    border-radius: .5rem; padding: .4rem .5rem; cursor: grab;
}
.player-card:active { cursor: grabbing; }
.player-card .grip { color: var(--muted); cursor: grab; }
.player-card .name { flex: 1; }
.player-card .move { min-width: auto; padding: .25rem .4rem; font-size: .8rem; }
.player-card .rating {
    flex: none; min-width: 1.4rem; text-align: center; font-size: .78rem; font-weight: 700;
    color: var(--accent); background: rgba(34,197,94,.12);
    border-radius: .4rem; padding: .1rem .3rem;
}
.board > header .team-rating { float: right; font-weight: 600; font-size: .8rem; color: var(--muted); }

/* read-only board list items */
.board > ul > li:not(.player-card) {
    background: var(--panel-2); border: 1px solid var(--line);
    border-radius: .5rem; padding: .4rem .6rem;
}

/* controls row */
.controls { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; align-items: center; }
.control { display: flex; align-items: center; gap: .5rem; }
.control-label { color: var(--muted); }

/* login */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 1rem; padding: 2rem; width: 100%; max-width: 360px;
}
.login-card h1 { margin-bottom: .25rem; }
.login-card .btn { width: 100%; margin-top: 1rem; }
.login-card .field { margin-top: 1rem; }
.login-card select, .login-card input { width: 100%; }
.login-card form { margin: 0; }
.login-divider {
    display: flex; align-items: center; gap: .75rem;
    margin: 1.5rem 0 .25rem; color: var(--muted);
    font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
}
.login-divider::before, .login-divider::after {
    content: ""; flex: 1; height: 1px; background: var(--line);
}
.error { color: var(--danger); margin: .5rem 0 0; }

/* players management table */
table.players { width: 100%; border-collapse: collapse; }
table.players th, table.players td {
    text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
table.players th { color: var(--muted); font-size: .8rem; font-weight: 600; }
table.players tr.inactive td { opacity: .55; }
table.players input { min-width: 0; width: 100%; }
.inline-edit { display: flex; gap: .4rem; }
/* Keep this a normal table-cell (no display:flex on a <td>, or its bottom border
   won't line up with the other cells in the row). Lay buttons out inline instead. */
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn { vertical-align: middle; }
.row-actions .btn + .btn { margin-left: .4rem; }
.tag.off { background: rgba(148,163,184,.2); color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .9rem; }
.check input { width: auto; min-width: auto; }

/* game banner (availability page) */
.game-banner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-end; }
.game-picker select { min-width: 16rem; }
.game-meta { display: flex; flex-wrap: wrap; gap: .15rem 1.5rem; align-items: baseline; }
.game-when { font-size: 1.15rem; font-weight: 700; }
.game-venue { font-size: 1rem; }
.game-line a { color: var(--accent); }

/* section header with a side link */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head a { white-space: nowrap; }

/* game create/edit form */
.game-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.game-form .venue { flex: 1; min-width: 14rem; }
.game-form .venue input { width: 100%; }
.form-actions { display: flex; gap: .5rem; align-items: flex-end; }

/* sign-up order (availability page) */
.signups { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.signup {
    display: flex; align-items: center; gap: .6rem;
    background: var(--panel-2); border: 1px solid var(--line);
    border-radius: .5rem; padding: .4rem .6rem;
}
.signup.reserve { opacity: .65; border-style: dashed; }
.signup-divider {
    margin: .5rem 0 .15rem; font-size: .72rem; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted);
}
/* position badge (sign-up order), used on signups + builder cards */
.pos {
    flex: none; min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
    font-size: .8rem; font-weight: 700; color: var(--muted);
}
.player-card.reserve { opacity: .7; border-style: dashed; }
.signup .who { flex: 1; }
.btn-remove {
    flex: none; border: 1px solid var(--line); background: transparent;
    color: var(--muted); border-radius: .4rem; cursor: pointer;
    width: 1.6rem; height: 1.6rem; line-height: 1; font-size: .8rem;
}
.btn-remove:hover { border-color: var(--danger); color: var(--danger); }

/* results / history */
.result-card .section-head { align-items: flex-start; }
.scoreline { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .6rem; }
.score {
    display: inline-flex; align-items: center; gap: .45rem;
    background: var(--panel-2); border: 1px solid var(--line);
    border-radius: .6rem; padding: .4rem .7rem;
}
.score.win { border-color: var(--accent); background: rgba(34,197,94,.1); }
.score .goals { font-weight: 700; font-size: 1.1rem; }
.score .trophy { font-size: .9rem; }
.team-dot { width: .8rem; height: .8rem; border-radius: 50%; background: var(--team, var(--muted)); display: inline-block; }
.team-name { font-weight: 600; }

.result-edit { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; margin-top: .6rem; }
.score-input { display: flex; align-items: center; gap: .45rem; }
.score-input input { width: 5rem; min-width: 0; }

/* tournaments: standings table */
table.standings th:not(:first-child), table.standings td:not(:first-child) {
    text-align: center; width: 2.6rem;
}
table.standings tr.leader { background: rgba(34,197,94,.1); }
table.standings .team-name { font-weight: 600; }

/* tournaments: add-player dropdown on team cards */
.add-player { width: 100%; margin-top: .5rem; font-size: .85rem; padding: .35rem .4rem; }

/* tournaments: matches */
.match-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.match {
    /* fixed centre column => score inputs line up across every row, label or not */
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    gap: .35rem .6rem;
    background: var(--panel-2); border: 1px solid var(--line);
    border-radius: .5rem; padding: .45rem .65rem;
}
.match .side { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.match .home { justify-self: end; text-align: right; }
.match .away { justify-self: start; flex-wrap: wrap; }
.match .scoreline { display: inline-flex; align-items: center; gap: .4rem; justify-content: center; }
.match .sep { color: var(--muted); }
.match .score { font-weight: 700; font-size: 1.05rem; min-width: 3.6rem; text-align: center; }
.score-box { width: 3.2rem; min-width: 0; text-align: center; padding: .3rem; }

/* goal slots under a match (one goal per line, per team) */
.goals-row { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1.5rem;
    border-top: 1px solid var(--line); padding-top: .5rem; margin-top: .15rem; }
.team-goals { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.team-goals.end { align-items: flex-end; text-align: right; }
.team-goals.end .lbl, .team-goals.end .goal-line { justify-content: flex-end; }
.team-goals .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; }
.goal-line { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; font-size: .85rem; }
.goal-line .goal-ico { flex: none; }
.goal-line select { min-width: auto; font-size: .8rem; padding: .25rem .35rem; }
.goal-line .check { font-size: .78rem; }

.add-match { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.add-match select { min-width: auto; }
.add-match input:not([type=checkbox]):not([type=number]) { min-width: 9rem; }

/* tournaments: scorers leaderboard */
table.scorers-table th:not(:first-child), table.scorers-table td:not(:first-child) {
    text-align: center; width: 4rem;
}

/* team setup */
.team-setup { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.team-row { display: flex; align-items: center; gap: .6rem; }
.team-name-input { flex: 1; max-width: 16rem; }
.team-row input[type=color] { width: 2.6rem; height: 2.2rem; min-width: 0; padding: .15rem; cursor: pointer; }

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;
}