@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("./barlow-condensed-600.ttf") format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("./barlow-condensed-700.ttf") format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url("./barlow-condensed-800.ttf") format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 900; font-display: swap; src: url("./barlow-condensed-900.ttf") format("truetype"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap; src: url("./manrope-400.ttf") format("truetype"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 500; font-display: swap; src: url("./manrope-500.ttf") format("truetype"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap; src: url("./manrope-600.ttf") format("truetype"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap; src: url("./manrope-700.ttf") format("truetype"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 800; font-display: swap; src: url("./manrope-800.ttf") format("truetype"); }

:root {
  --black: #111111;
  --white: #ffffff;
  --paper: #f1f1ed;
  --line: #c9c9c2;
  --muted: #666660;
  --red: #e63b25;
  --red-dark: #b62614;
  --green: #14735c;
  --amber: #a96a00;
  --danger: #bd2727;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Manrope", Arial, sans-serif;
  font-family: var(--body);
  color: var(--black);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { color: inherit; border: 0; cursor: pointer; }
a { color: inherit; }
svg { width: 20px; height: 20px; stroke-width: 2; }
h1, h2, h3, h4, p { margin-top: 0; }
.hidden { display: none !important; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.league-header { position: sticky; top: 0; z-index: 90; display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 14px; color: var(--black); background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { display: block; width: 142px; height: 46px; object-fit: contain; object-position: left center; }
.brand-mark { display: grid; grid-template-columns: repeat(3, 4px); gap: 3px; height: 30px; transform: skew(-13deg); }
.brand-mark span { display: block; background: var(--red); }
.brand-mark span:nth-child(1) { height: 18px; margin-top: 12px; }
.brand-mark span:nth-child(2) { height: 24px; margin-top: 6px; }
.brand-mark span:nth-child(3) { height: 30px; }
.brand-copy { display: grid; line-height: .9; }
.brand-copy strong { font-family: var(--display); font-size: 1.2rem; text-transform: uppercase; }
.brand-copy small { margin-top: 4px; color: #a8a8a2; font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions .icon-control { color: var(--black); border-color: var(--line); }
.season-chip { display: none; color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.season-select { width: min(43vw, 188px); min-height: 38px; padding: 0 28px 0 10px; color: white; background-color: var(--black); border: 0; border-bottom: 3px solid var(--red); font-family: var(--display); font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.season-select option { color: var(--black); background: white; font-family: var(--body); text-transform: none; }
.icon-control { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; color: var(--white); background: transparent; border: 1px solid #444; }

.site-main { min-height: calc(100vh - 58px); }
.view { display: none; }
.view.active { display: block; }
.app-content { width: 100%; padding: 0 16px 108px; }

/* Login as a league credential, not a marketing page. */
.auth-stage { min-height: calc(100svh - 58px); background: var(--paper); }
.auth-identity { position: relative; height: 34svh; min-height: 235px; overflow: hidden; background: var(--black); }
.auth-photo { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(17,17,17,.2), rgba(17,17,17,.02)), url("./league-court.png") 65% center / cover no-repeat; filter: grayscale(1) contrast(1.08); }
.league-monogram { position: absolute; left: 15px; bottom: -13px; color: var(--white); font-family: var(--display); font-size: clamp(8rem, 43vw, 13rem); font-weight: 900; line-height: .7; letter-spacing: -.02em; opacity: .96; }
.auth-sheet { padding: 0 16px 34px; }
.auth-heading { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 14px; padding: 28px 0 16px; border-bottom: 4px solid var(--black); }
.auth-heading h1 { margin: 0; font-family: var(--display); font-size: 2.8rem; line-height: .9; text-transform: uppercase; }
.form-stack, .form-grid { display: grid; }
.auth-form-row { grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 68px; border-bottom: 1px solid var(--black); }
.auth-form-row > span { font-size: .8rem; font-weight: 800; text-transform: uppercase; }
.auth-form-row input { min-height: 67px; padding: 0; background: transparent; border: 0; font-size: 1rem; }
.auth-form-row input:focus { outline: 0; }
.auth-form-row:focus-within { box-shadow: inset 4px 0 0 var(--red); padding-left: 10px; }
.auth-form-row:focus-within > span { color: var(--red-dark); }
.auth-switch { justify-self: end; }
.auth-switch button { min-height: 36px; padding: 0 10px; }
.auth-sheet .primary { width: 100%; min-height: 52px; margin-top: 18px; }
.reset-link { margin-top: 15px; }
.public-ranking-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--black); font-size: .82rem; font-weight: 800; text-decoration: none; }
.public-ranking-link svg { width: 18px; }
.legal-check { display: flex; align-items: flex-start; gap: 10px; padding: 14px 0 0; font-size: .8rem; line-height: 1.5; text-transform: none; }
.legal-check input { width: 19px; min-width: 19px; min-height: 19px; margin: 1px 0 0; padding: 0; accent-color: var(--red); }
.legal-check a { color: var(--red-dark); font-weight: 800; }

/* Navigation */
.desktop-rail { height: 0; }
.tabs { position: fixed; z-index: 100; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-height: 72px; padding: 7px 7px max(7px, env(safe-area-inset-bottom)); background: rgba(17,17,17,.98); border-top: 1px solid #333; }
.tabs:has(.manager-only:not(.hidden)) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tabs button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: 0 2px; color: #93938d; background: transparent; font-size: .68rem; font-weight: 700; }
.tabs button svg { width: 21px; height: 21px; }
.tabs button.active { color: var(--white); }
.tabs button.active::before { content: ""; position: absolute; top: -7px; width: 28px; height: 3px; background: var(--red); }
.tabs .play-action { width: 52px; height: 52px; align-self: center; justify-self: center; margin-top: -26px; color: white; background: var(--red); box-shadow: 0 0 0 5px var(--black); }
.tabs .play-action.active::before { display: none; }
.tabs .play-action svg { width: 25px; height: 25px; }
.badge { position: absolute; top: 2px; right: 10px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; color: white; background: var(--red); border-radius: 10px; font-size: .65rem; }

/* Home */
.league-overview { margin: 0 -16px; color: white; background: var(--black); border-bottom: 6px solid var(--red); }
.overview-main { padding: 30px 18px 26px; text-align: center; }
.overview-main h1 { margin: 0 auto 28px; font-family: var(--display); font-size: clamp(3.4rem, 17vw, 6.5rem); font-weight: 900; line-height: .78; text-align: center; text-transform: uppercase; }
.season-line { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 11px 0; border-top: 1px solid #424242; border-bottom: 1px solid #424242; text-align: center; }
.season-line span { color: #96968f; font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.season-line strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.hero-cta { display: inline-flex; align-items: center; gap: 9px; min-height: 46px; margin-top: 20px; padding: 0 15px; color: white; background: var(--red); font-weight: 800; }
.hero-cta svg { width: 18px; }
.overview-image { height: 140px; background: url("./league-court.png") center 43% / cover no-repeat; filter: grayscale(1) contrast(1.08); }
.league-numbers { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #3c3c3c; }
.league-numbers div { padding: 14px 12px 16px; border-right: 1px solid #3c3c3c; text-align: center; }
.league-numbers div:last-child { border-right: 0; }
.league-numbers strong, .league-numbers span { display: block; }
.league-numbers strong { font-family: var(--display); font-size: 2rem; line-height: 1; }
.league-numbers span { margin-top: 3px; color: #a5a59e; font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.dashboard-grid { display: grid; }
.content-block { padding: 30px 0 35px; border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.editorial-head { margin-bottom: 13px; }
.editorial-head h2, .settings-section h2, .list-heading { margin: 0; font-family: var(--display); font-size: 1.85rem; text-transform: uppercase; }
.arrow-link { display: grid; place-items: center; width: 39px; height: 39px; padding: 0; background: transparent; border: 1px solid var(--black); }

/* Page surfaces */
.page-title { display: flex; align-items: flex-end; justify-content: space-between; min-height: 108px; padding: 28px 0 15px; border-bottom: 4px solid var(--black); }
.page-title h1 { margin: 0; font-family: var(--display); font-size: clamp(3.1rem, 15vw, 5.8rem); line-height: .8; text-transform: uppercase; }
.compact-title { margin-bottom: 20px; }
.row-title { gap: 12px; }
.primary, .secondary, .ghost, .danger, .text-button { min-height: 44px; padding: 0 15px; font-weight: 800; }
.primary { color: white; background: var(--red); }
.primary:hover { background: var(--red-dark); }
.secondary, .ghost { color: var(--black); background: transparent; border: 1px solid var(--line); }
.danger { color: var(--danger); background: #fae2df; border: 1px solid #e5b6af; }
.text-button { padding: 0; color: var(--red-dark); background: transparent; }
.small { min-height: 35px; padding: 0 10px; font-size: .78rem; }
.wide { width: 100%; grid-column: 1 / -1; }
.icon-text { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; padding: 0 11px; }
.icon-text span { display: none; }
.segmented { display: inline-flex; padding: 3px; background: #d8d8d2; }
.segmented button { min-height: 36px; padding: 0 12px; color: var(--muted); background: transparent; font-size: .78rem; font-weight: 800; }
.segmented button.active { color: white; background: var(--black); }
.mode-switch, .category-switch { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }

/* Prize standings and ranking controls */
.championship-block { padding: 28px 0 22px; }
.championship-leaders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 4px solid var(--black); border-left: 1px solid var(--line); }
.championship-card { min-width: 0; min-height: 105px; padding: 14px; color: var(--black); background: var(--white); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; }
.championship-card.overall { grid-column: 1 / -1; color: var(--white); background: var(--black); border-bottom-color: var(--black); }
.championship-card span, .championship-card strong, .championship-card small { display: block; }
.championship-card span { color: var(--muted); font-size: .67rem; font-weight: 800; text-transform: uppercase; }
.championship-card.overall span, .championship-card.overall small { color: #adada7; }
.championship-card strong { margin-top: 10px; overflow: hidden; font-family: var(--display); font-size: 1.45rem; line-height: 1; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.championship-card small { margin-top: 5px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.championship-card:not(:disabled):hover { box-shadow: inset 5px 0 0 var(--red); }
.championship-card:disabled { cursor: default; }
.ranking-controls { display: grid; gap: 15px; margin-bottom: 24px; padding: 17px 0 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ranking-control { display: grid; gap: 7px; min-width: 0; }
.control-label { color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.category-switch button { min-width: 0; padding: 0 7px; font-size: .72rem; }

/* Forms */
label { display: grid; gap: 7px; color: var(--black); font-size: .86rem; font-weight: 800; text-transform: uppercase; }
input, select, textarea { width: 100%; min-height: 50px; padding: 11px 13px; color: var(--black); background: white; border: 1px solid var(--line); border-radius: 0; text-transform: none; }
textarea { min-height: 110px; resize: vertical; }
input.invalid { border-color: var(--danger); background: #fff3f1; }
input[readonly] { color: var(--muted); background: #e5e5df; cursor: not-allowed; }
.field-note { color: var(--muted); font-size: .75rem; line-height: 1.45; text-transform: none; }

/* Ranking and result rows */
.table-labels { display: flex; justify-content: space-between; padding: 0 12px 8px 0; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.list { display: grid; }
.item { position: relative; padding: 15px 0; background: transparent; border-bottom: 1px solid var(--line); }
.item strong, .item span, .item small { display: block; }
.item span, .item small { color: var(--muted); font-size: .76rem; line-height: 1.45; }
.ranking-item { padding: 0; overflow: hidden; }
.ranking-button, .ranking-item > div { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; padding: 10px 0; color: inherit; background: transparent; text-align: left; }
.ranking-button > div:first-child, .ranking-item > div:first-child { min-width: 0; }
.ranking-button > div:last-child, .ranking-item > div:last-child { flex: 0 0 auto; text-align: right; }
.ranking-button strong, .ranking-item > div > strong { font-family: var(--display); font-size: 1.18rem; text-transform: uppercase; }
.ranking-button > div:last-child strong { font-size: 1.55rem; }
.ranking-button:hover { padding-left: 9px; background: white; }
.full-ranking .ranking-item:first-child { border-top: 5px solid var(--red); }
.full-ranking .ranking-item:first-child .ranking-button { min-height: 86px; }
.full-ranking .ranking-item:first-child .ranking-button > div:last-child strong { color: var(--red); font-size: 2rem; }
.team-head { margin-top: 42px; padding: 20px 0 8px; border-top: 4px solid var(--black); }

/* Match entry */
.match-entry { padding-bottom: 30px; }
.match-mode { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-bottom: 18px; }
.match-mode button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.match-mode svg { width: 17px; }
.date-field { margin-bottom: 18px; }
.match-teams { position: relative; display: grid; gap: 13px; }
.team-card { position: relative; display: grid; gap: 14px; padding: 19px 15px; color: white; background: var(--black); overflow: visible; }
.team-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--red); }
.team-two { color: var(--black); background: white; border: 1px solid var(--line); }
.team-two::before { background: var(--black); }
.team-card header { display: flex; align-items: baseline; gap: 9px; }
.team-card h2 { margin: 0; font-family: var(--display); font-size: 1.7rem; text-transform: uppercase; }
.team-number { color: var(--red); font-family: var(--display); font-weight: 900; }
.team-two .team-number { color: var(--muted); }
.team-card label { color: #b4b4ad; }
.team-two label { color: var(--muted); }
.score-field { position: absolute; top: 12px; right: 15px; width: 72px; }
.score-field span { text-align: right; font-size: .7rem; }
.score-field input { min-height: 58px; padding: 0; color: white; background: transparent; border: 0; font-family: var(--display); font-size: 3rem; font-weight: 900; text-align: right; }
.team-two .score-field input { color: var(--black); }
.versus { position: absolute; z-index: 5; left: 50%; top: 50%; display: grid; place-items: center; width: 38px; height: 38px; transform: translate(-50%, -50%); color: white; background: var(--red); border: 4px solid var(--paper); font-family: var(--display); font-weight: 900; }
.submit-result { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 55px; margin-top: 18px; padding: 0 18px; }
.player-picker { position: relative; }
.player-suggestions { position: absolute; z-index: 75; top: calc(100% + 4px); left: 0; right: 0; max-height: 235px; overflow-y: auto; padding: 4px; color: var(--black); background: white; border: 2px solid var(--black); box-shadow: 5px 5px 0 var(--red); }
.player-suggestions button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 42px; padding: 8px 9px; color: var(--black); background: white; text-align: left; }
.player-suggestions button:hover, .player-suggestions button:focus { background: #e9e9e4; }
.player-suggestions span, .suggestion-empty { color: var(--muted); font-size: .75rem; }
.suggestion-empty { padding: 10px; }

/* Spieltag planner */
.submit-tool-switch { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin: 0 0 22px; }
.planner-level-bar { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; margin-bottom: 18px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.planner-level-bar > span { font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.planner-level-switch { display: grid; grid-template-columns: 1fr 1fr; }
.planner-level-switch button { min-height: 42px; }
.planner-empty { display: grid; gap: 6px; padding: 30px 16px; background: white; border-left: 4px solid var(--red); }
.planner-empty strong { font-family: var(--display); font-size: 1.55rem; text-transform: uppercase; }
.planner-empty span { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.day-planner { padding-bottom: 30px; }
.planner-setup { display: grid; gap: 18px; }
.planner-options { display: grid; gap: 16px; padding: 17px; color: white; background: var(--black); }
.planner-options label { color: #b9b9b3; }
.planner-options input[type="date"] { color: white; background: #252525; border-color: #484848; color-scheme: dark; }
.planner-options fieldset { display: flex; gap: 9px; margin: 0; padding: 0; border: 0; }
.planner-options legend { margin-bottom: 9px; color: #b9b9b3; font-size: .86rem; font-weight: 800; text-transform: uppercase; }
.check-option { position: relative; display: block; flex: 1; color: white !important; }
.check-option input { position: absolute; width: 1px; height: 1px; min-height: 1px; opacity: 0; }
.check-option span { display: grid; place-items: center; min-height: 46px; padding: 0 12px; color: #b9b9b3; border: 1px solid #545454; }
.check-option input:checked + span { color: white; background: var(--red); border-color: var(--red); }
.planner-player-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding-top: 10px; border-bottom: 4px solid var(--black); }
.planner-player-head h2 { margin: 0 0 10px; font-family: var(--display); font-size: 2rem; text-transform: uppercase; }
.planner-player-head .text-button { font-size: .76rem; }
.planner-search { background: transparent; border: 0; border-bottom: 1px solid var(--black); }
.planner-player-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.planner-player-option { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 9px; min-height: 64px; padding: 10px; background: white; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-transform: none; cursor: pointer; }
.planner-player-option input { width: 20px; min-height: 20px; margin: 0; padding: 0; accent-color: var(--red); }
.planner-player-option strong, .planner-player-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planner-player-option strong { font-size: .84rem; }
.planner-player-option small { margin-top: 3px; color: var(--muted); font-size: .67rem; }
.planner-create { min-height: 54px; }
.planner-current-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 15px; border-bottom: 4px solid var(--black); }
.planner-current-head h2 { margin: 0; font-family: var(--display); font-size: 2.1rem; line-height: 1; text-transform: uppercase; }
.planner-current-head span { display: block; margin-top: 5px; color: var(--muted); font-size: .76rem; font-weight: 700; }
.planner-attendance { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 0 18px; border-bottom: 1px solid var(--line); }
.attendance-player { display: inline-flex; align-items: center; min-height: 34px; padding-left: 10px; color: white; background: var(--black); font-size: .75rem; font-weight: 800; }
.attendance-player button { align-self: stretch; width: 32px; margin-left: 5px; color: white; background: #303030; font-size: 1.1rem; }
.planner-round { padding: 25px 0 5px; }
.planner-round h3 { margin-bottom: 9px; font-family: var(--display); font-size: 1.45rem; text-transform: uppercase; }
.planner-round-games { display: grid; gap: 9px; }
.planner-game { position: relative; padding: 13px 13px 12px 17px; background: white; border-left: 4px solid var(--red); }
.planner-game.played { opacity: .62; border-left-color: var(--green); }
.planner-game-type { margin-bottom: 8px; color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.planner-versus-line { display: grid; grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr); align-items: center; gap: 6px; }
.planner-team-list { display: grid; gap: 7px; min-width: 0; }
.planner-team-list:last-child { text-align: right; }
.planner-team-player { display: grid; gap: 3px; min-width: 0; }
.planner-team-player strong { overflow-wrap: anywhere; font-family: var(--display); font-size: 1.05rem; line-height: 1.1; text-transform: uppercase; }
.planner-team-player button { justify-self: start; padding: 0; color: var(--red-dark); background: transparent; font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.planner-team-list:last-child .planner-team-player button { justify-self: end; }
.planner-versus-line span { color: var(--muted); font-size: .66rem; text-align: center; text-transform: uppercase; }
.planner-result-form { display: grid; grid-template-columns: 1fr 18px 1fr; align-items: end; gap: 6px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.planner-result-form label span { font-size: .65rem; }
.planner-result-form input { min-height: 44px; padding: 5px; font-family: var(--display); font-size: 1.65rem; font-weight: 800; text-align: center; }
.planner-result-form .result-divider { align-self: center; padding-top: 16px; font-family: var(--display); font-size: 1.4rem; font-weight: 900; text-align: center; }
.planner-result-form button { grid-column: 1 / -1; width: 100%; margin-top: 4px; }
.planner-result-saved { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line); }
.planner-result-saved strong { font-family: var(--display); font-size: 1.8rem; }
.planner-result-saved span { color: var(--green); font-size: .7rem; font-weight: 800; text-transform: uppercase; }

/* Matches, profile and admin */
.section-actions { display: flex; justify-content: flex-end; padding: 17px 0 5px; }
.match-scope-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.match-scope-switch:has(.manager-only:not(.hidden)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.matchday-list { display: grid; border-top: 4px solid var(--black); }
.matchday-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto 18px; align-items: center; gap: 10px; min-height: 76px; padding: 10px 0; color: var(--black); background: transparent; border-bottom: 1px solid var(--line); text-align: left; }
.matchday-date { font-family: var(--display); font-size: 1rem; font-weight: 800; }
.matchday-main { min-width: 0; }
.matchday-main strong, .matchday-main small { display: block; }
.matchday-main strong { font-size: .85rem; }
.matchday-main small { margin-top: 4px; color: var(--muted); font-size: .68rem; }
.matchday-row > svg { width: 17px; }
.item-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; min-height: 42px; color: white; background: var(--black); font-family: var(--display); font-size: 1.35rem; font-weight: 900; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.item-row .actions { justify-content: flex-end; margin-top: 0; }
.match-elo-change { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 14px; margin-top: 12px; padding: 9px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.match-elo-change span { color: var(--muted); font-size: .67rem; font-weight: 800; text-transform: uppercase; }
.match-elo-change strong { font-family: var(--display); font-size: .95rem; text-transform: uppercase; }
.pill, .role-label { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; color: var(--muted); background: #d9d9d3; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.pill.ok { color: var(--green); background: #dcebe6; }
.pill.pending { color: var(--amber); background: #f5e9cc; }
.pill.warn { color: var(--danger); background: #f5dbd7; }
.case-box { margin-top: 13px; padding: 13px; background: #f7e2df; border-left: 4px solid var(--danger); }
.account-line { display: grid; grid-template-columns: 54px 1fr 40px; align-items: center; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.account-line .icon-control { color: var(--black); border-color: var(--line); }
.account-line strong, .account-line small { display: block; }
.account-line small { margin-top: 3px; color: var(--muted); font-size: .76rem; }
.avatar { display: grid; place-items: center; width: 54px; height: 54px; color: white; background: var(--red); font-family: var(--display); font-size: 1.8rem; font-weight: 900; }
.profile-box { margin-top: 16px; }
.profile-stats-card { padding: 0; }
.profile-stats-modes { display: grid; gap: 20px; }
.profile-stats-modes h4 { margin: 0 0 9px; font-family: var(--display); font-size: 1.35rem; text-transform: uppercase; }
.compact-head { margin-bottom: 15px; }
.compact-head h3 { margin: 0; font-family: var(--display); font-size: 1.6rem; text-transform: uppercase; }
.compact-head > span { font-family: var(--display); font-size: 1.25rem; font-weight: 800; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.stat-grid div { min-height: 80px; padding: 12px; background: white; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat-grid strong { display: block; font-family: var(--display); font-size: 1.65rem; }
.stat-grid span { display: block; margin-top: 3px; color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.settings-section { margin-top: 34px; padding-top: 19px; border-top: 4px solid var(--black); }
.settings-section h2, .list-heading { margin-bottom: 14px; }
.settings-form, .admin-create { gap: 14px; padding: 17px; background: white; border: 1px solid var(--line); }
.list-heading { margin-top: 34px; }
.admin-create { margin: 20px 0 32px; }
.admin-group + .admin-group { margin-top: 32px; }
.archive-group { padding-top: 20px; border-top: 4px solid var(--black); }
.admin-season-section { margin: 24px 0 38px; padding-bottom: 30px; border-bottom: 4px solid var(--black); }
.season-admin-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.season-admin-row .actions { justify-content: flex-end; margin-top: 0; }

/* Dialogs and feedback */
dialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100svh - 28px); padding: 21px; color: var(--black); background: var(--paper); border: 0; border-top: 6px solid var(--red); }
dialog::backdrop { background: rgba(0,0,0,.7); }
dialog form { display: grid; gap: 14px; }
dialog h3 { margin: 0 0 8px; font-family: var(--display); font-size: 2rem; text-transform: uppercase; }
.dialog-score-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dialog-warning { margin: 0; padding: 11px 12px; background: #f5dbd7; border-left: 4px solid var(--danger); font-size: .78rem; line-height: 1.5; }
.detail-subtitle { color: var(--muted); font-size: .82rem; font-weight: 700; }
.detail-mode { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; margin: 4px 0 14px; }
.compact-match { padding: 10px 0; }
.detail-matchday-head { padding-bottom: 14px; border-bottom: 4px solid var(--black); }
.detail-matchday-head span { color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.detail-matchday-head h3 { margin-top: 6px; }
.matchday-round-list section { padding: 17px 0; border-bottom: 1px solid var(--line); }
.matchday-round-list h4 { margin: 0 0 9px; font-family: var(--display); font-size: 1.3rem; text-transform: uppercase; }
.matchday-game-line { display: grid; grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr); align-items: center; gap: 8px; padding: 8px 0; font-size: .76rem; }
.matchday-game-line strong { font-family: var(--display); font-size: 1.15rem; text-align: center; }
.matchday-game-line span:last-child { text-align: right; }

/* Public table */
.public-shell { min-height: 100vh; padding-bottom: 50px; }
.public-main { width: min(920px, 100%); margin: 0 auto; padding: 0 16px 50px; }
.public-hero { margin: 0 -16px 24px; padding: 34px 18px 28px; color: white; background: var(--black); border-bottom: 6px solid var(--red); }
.public-hero h1 { margin: 0; font-family: var(--display); font-size: clamp(3.6rem, 17vw, 7rem); line-height: .78; text-transform: uppercase; }
.public-toolbar { display: grid; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.public-toolbar .season-select { width: 100%; }
.public-status { min-height: 42px; padding: 12px 0; color: var(--muted); font-size: .78rem; }
.public-login { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 12px; color: white; background: var(--red); font-weight: 800; text-decoration: none; }
.toast { position: fixed; z-index: 130; left: 14px; right: 14px; bottom: 86px; padding: 14px 16px; color: white; background: var(--black); border-left: 5px solid var(--red); opacity: 0; transform: translateY(12px); transition: opacity .18s ease, transform .18s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }
.site-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 20px; padding: 27px 16px 102px; color: var(--muted); background: #e3e3dd; font-size: .76rem; }
.site-footer a { font-weight: 800; text-decoration: none; }

.legal-page { width: min(760px, 100%); margin: 0 auto; padding: 30px 18px 80px; }
.legal-page h1 { margin: 24px 0 14px; font-family: var(--display); font-size: clamp(3.5rem, 15vw, 6rem); line-height: .85; text-transform: uppercase; }
.legal-page h2 { margin-bottom: 8px; font-family: var(--display); font-size: 1.5rem; text-transform: uppercase; }
.legal-page section { padding: 20px 0; border-top: 1px solid var(--line); }
.legal-page p { color: var(--muted); line-height: 1.7; }
.back-link { font-weight: 800; text-decoration: none; }

/* League rules */
.rules-shell { background: var(--paper); }
.rules-page { width: min(920px, 100%); margin: 0 auto; padding: 0 16px 65px; }
.rules-title { margin: 0 -16px; padding: 35px 18px 28px; color: white; background: var(--black); border-bottom: 6px solid var(--red); }
.rules-title > span { color: #aaa9a3; font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.rules-title h1 { margin: 9px 0 0; font-family: var(--display); font-size: clamp(4.8rem, 24vw, 8rem); line-height: .75; text-transform: uppercase; }
.rules-index { display: flex; gap: 8px 17px; padding: 15px 0; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.rules-index::-webkit-scrollbar { display: none; }
.rules-index a { flex: 0 0 auto; color: var(--black); font-size: .72rem; font-weight: 800; text-decoration: none; text-transform: uppercase; }
.rules-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 24px 0 6px; border-top: 4px solid var(--black); border-left: 1px solid var(--line); }
.rules-summary div { min-width: 0; min-height: 94px; padding: 13px 10px; background: white; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rules-summary strong, .rules-summary span { display: block; }
.rules-summary strong { font-family: var(--display); font-size: 1.8rem; line-height: 1; }
.rules-summary span { margin-top: 7px; color: var(--muted); font-size: .64rem; font-weight: 800; line-height: 1.35; text-transform: uppercase; }
.rule-section { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 30px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 65px; }
.rule-number { padding-top: 4px; color: var(--red); font-family: var(--display); font-size: 1.25rem; font-weight: 900; }
.rule-section h2 { margin: 0 0 13px; font-family: var(--display); font-size: 2rem; line-height: .95; text-transform: uppercase; }
.rule-section p { margin: 0 0 14px; color: var(--muted); font-size: .88rem; line-height: 1.65; }
.rule-section ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rule-section li { position: relative; padding-left: 17px; font-size: .84rem; line-height: 1.6; }
.rule-section li::before { content: ""; position: absolute; left: 0; top: .65em; width: 6px; height: 2px; background: var(--red); }
.formula-block { display: grid; grid-template-columns: 70px minmax(0, 1fr); margin: 17px 0; border-top: 3px solid var(--black); }
.formula-block span, .formula-block strong { padding: 11px 8px; border-bottom: 1px solid var(--line); }
.formula-block span { color: var(--muted); font-size: .67rem; font-weight: 800; text-transform: uppercase; }
.formula-block strong { font-size: .78rem; }

@media (min-width: 720px) {
  .brand-logo { width: 174px; height: 50px; }
  .season-chip { display: inline; }
  .auth-stage { display: grid; grid-template-columns: minmax(320px, 43%) 1fr; min-height: calc(100svh - 58px); }
  .auth-identity { height: auto; min-height: 650px; }
  .auth-sheet { align-self: center; width: min(650px, 100%); padding: 45px 6vw; }
  .auth-heading { padding-top: 0; }
  .auth-heading h1 { font-size: 4rem; }
  .auth-form-row { grid-template-columns: 130px minmax(0, 1fr); min-height: 76px; }
  .auth-form-row input { min-height: 75px; font-size: 1.08rem; }
  .auth-sheet .primary { width: auto; justify-self: end; min-width: 180px; }
  .app-shell { display: grid; grid-template-columns: 92px minmax(0, 1fr); min-height: calc(100vh - 58px); }
  .desktop-rail { height: auto; background: var(--black); }
  .tabs { position: sticky; top: 58px; display: flex; flex-direction: column; grid-template-columns: none !important; min-height: calc(100vh - 58px); padding: 18px 8px; border: 0; }
  .tabs button { min-height: 63px; gap: 6px; font-size: .7rem; }
  .tabs button.active::before { top: 50%; left: -8px; width: 4px; height: 34px; transform: translateY(-50%); }
  .tabs .play-action { order: -1; width: 58px; height: 58px; margin: 0 auto 15px; }
  .app-content { min-width: 0; padding: 0 30px 65px; }
  .league-overview { display: grid; grid-template-columns: minmax(370px, 1.2fr) minmax(240px, .8fr); margin: 0 -30px; }
  .overview-main { padding: 44px 42px 38px; text-align: left; }
  .overview-main h1 { margin-left: 0; font-size: clamp(4.8rem, 8vw, 7.4rem); text-align: left; }
  .season-line { grid-template-columns: 70px 1fr; gap: 0; text-align: left; }
  .overview-image { grid-column: 2; grid-row: 1 / span 2; height: auto; min-height: 500px; background-position: 66% 43%; }
  .league-numbers div { text-align: left; }
  .league-numbers { grid-column: 1; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .content-block { padding-top: 42px; }
  .page-title { min-height: 145px; padding-top: 40px; }
  .mode-switch { width: 430px; }
  .match-scope-switch { width: auto; min-width: 350px; }
  .ranking-controls { grid-template-columns: 1fr 1fr; gap: 22px; }
  .ranking-controls .mode-switch { width: 100%; }
  .championship-leaders { grid-template-columns: 1.25fr 1fr 1fr; }
  .championship-card.overall { grid-column: auto; }
  .submit-tool-switch { width: 430px; }
  .match-teams { grid-template-columns: 1fr 1fr; gap: 18px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .profile-stats-modes { grid-template-columns: 1fr 1fr; }
  .planner-options { grid-template-columns: 1fr 1fr; align-items: end; }
  .planner-player-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .planner-round-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .icon-text span { display: inline; }
  .toast { left: auto; right: 24px; bottom: 24px; width: min(420px, calc(100vw - 48px)); }
  .site-footer { padding-bottom: 30px; }
  .public-toolbar { grid-template-columns: 240px minmax(0, 1fr); align-items: end; }
  .public-hero { margin-left: 0; margin-right: 0; padding-left: 30px; }
  .rules-page { padding-left: 0; padding-right: 0; }
  .rules-title { margin-left: 0; margin-right: 0; padding: 52px 34px 36px; }
  .rules-index { position: sticky; z-index: 20; top: 58px; padding-left: 14px; padding-right: 14px; background: var(--paper); }
  .rules-summary { margin-top: 34px; }
  .rules-summary div { min-height: 115px; padding: 18px; }
  .rules-summary strong { font-size: 2.3rem; }
  .rule-section { grid-template-columns: 70px minmax(0, 1fr); gap: 20px; padding: 42px 10px; }
  .rule-number { font-size: 1.55rem; }
  .rule-section h2 { font-size: 2.45rem; }
  .rule-section li, .rule-section p { font-size: .94rem; }
}

@media (min-width: 1120px) {
  .app-content { padding-left: 48px; padding-right: 48px; }
  .league-overview { margin-left: -48px; margin-right: -48px; }
  #ranking, #submit, #matches, #profile, #admin { width: min(1040px, 100%); margin: 0 auto; }
  .match-entry { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px 28px; }
  .match-entry .match-mode, .match-entry .date-field { grid-column: 1; }
  .match-entry .match-teams { grid-column: 2; grid-row: 1 / span 3; }
  .match-entry .submit-result { grid-column: 1; align-self: end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
