:root {
  --dashboard-bg: #f4f5f7;
  --dashboard-card: #fff;
  --dashboard-text: #202124;
  --dashboard-muted: #6b7280;
  --dashboard-line: #e1e4e8;
  --dashboard-blue: #1a73e8;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--dashboard-bg); color: var(--dashboard-text); font-family: Arial, Helvetica, sans-serif; }
.tournament-dashboard { max-width: 1280px; min-height: 100vh; margin: 0 auto; padding: 0 18px 36px; }
.dashboard-nav { display: flex; gap: 22px; align-items: center; min-height: 54px; border-bottom: 1px solid var(--dashboard-line); }
.dashboard-nav a { color: #4b5563; font-size: .9rem; text-decoration: none; }
.dashboard-nav a.active, .dashboard-nav a:hover { color: var(--dashboard-blue); }
.dashboard-nav .nav-auth { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.dashboard-nav .nav-auth[data-auth-state="loading"] { visibility: hidden; }
.dashboard-nav .nav-auth[data-auth-state="logged-out"] [data-auth-logout],
.dashboard-nav .nav-auth[data-auth-state="logged-out"] [data-auth-name],
.dashboard-nav .nav-auth[data-auth-state="logged-in"] [data-auth-login] { display: none !important; }
.dashboard-nav .auth-btn { width: auto; border-radius: 999px; border: 1px solid #6eaef8; background: #0d5cab; color: #fff; font-size: 13px; font-weight: 700; padding: 8px 14px; cursor: pointer; }
.dashboard-nav .auth-icon-btn { min-width: 30px; padding: 5px 8px; }
.dashboard-nav .auth-user { max-width: 180px; overflow: hidden; color: #4b5563; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 22px 0 10px; }
.dashboard-header-actions { display: grid; justify-items: end; gap: 8px; }
.bpl6-complete-button { border: 1px solid #b91c1c; border-radius: 5px; padding: 7px 10px; background: #fff; color: #991b1b; font-size: .76rem; font-weight: 700; cursor: pointer; }
.bpl6-complete-button:hover { background: #fff1f2; }
.bpl6-complete-button:disabled { cursor: default; opacity: .7; }
.dashboard-brand { display: flex; align-items: center; gap: 14px; }
.dashboard-brand-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 10px; background: #e3e7eb; font-size: 27px; }
.dashboard-header h1 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.35rem); font-weight: 500; letter-spacing: -.03em; }
.dashboard-header p { display: none; margin: 0; }
.dashboard-header .dashboard-status { display: block; }
.dashboard-status { min-height: 18px; text-align: right; }
.tournament-at-a-glance { display: grid; gap: 4px; margin: 0 0 12px; padding: 9px 14px; border: 1px solid var(--dashboard-line); background: var(--dashboard-card); }
.tournament-at-a-glance p { display: flex; flex-wrap: wrap; gap: 3px 8px; margin: 0; color: #4b5563; font-size: .84rem; line-height: 1.35; }
.tournament-at-a-glance strong { color: #202124; font-weight: 700; }
.tournament-at-a-glance .dashboard-team { gap: 4px; font-size: .84rem; vertical-align: middle; }
.tournament-at-a-glance .dashboard-team-logo, .tournament-at-a-glance .dashboard-team-logo-placeholder { width: 16px; height: 16px; }
.fact-separator { color: #9ca3af; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(300px, .85fr); gap: 28px; }
.dashboard-main, .dashboard-sidebar { min-width: 0; }
.season-picker { display: flex; flex-direction: column; gap: 4px; padding: 14px 26px; margin-bottom: 18px; background: #eef0f4; }
.season-picker span { color: var(--dashboard-muted); font-size: .78rem; }
.season-picker select { width: fit-content; min-width: 170px; border: 0; background: transparent; color: var(--dashboard-text); font-size: 1rem; font-weight: 700; outline: none; }
.dashboard-section-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid #cfd3d8; }
.dashboard-section-tab { padding: 14px 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #6b7280; font-size: .9rem; cursor: pointer; }
.dashboard-section-tab.active { border-bottom-color: #202124; color: #202124; font-weight: 700; }
.dashboard-panel { padding-top: 20px; }
.dashboard-group { margin-bottom: 28px; }
.dashboard-group h2, .dashboard-round h2 { margin: 0 0 12px; font-size: 1rem; font-weight: 700; }
.dashboard-table-wrap { overflow-x: auto; }
.dashboard-table { width: 100%; min-width: 650px; border-collapse: collapse; background: var(--dashboard-card); }
.dashboard-table th, .dashboard-table td { padding: 10px 8px; border-bottom: 1px solid var(--dashboard-line); color: #4b5563; font-size: .82rem; text-align: center; white-space: nowrap; }
.dashboard-table th { color: #6b7280; font-size: .72rem; font-weight: 500; text-transform: uppercase; }
.dashboard-table td:first-child { color: #374151; }
.dashboard-table .team-column { width: 40%; text-align: left; }
.dashboard-matches { margin-top: 24px; }
.dashboard-matches h3 { margin: 0 0 10px; font-size: .95rem; font-weight: 700; }
.dashboard-matches-table-wrap { overflow-x: auto; }
.dashboard-matches-table { width: 100%; min-width: 620px; border-collapse: collapse; background: var(--dashboard-card); }
.dashboard-matches-table th, .dashboard-matches-table td { padding: 9px 8px; border-bottom: 1px solid var(--dashboard-line); color: #4b5563; font-size: .8rem; text-align: center; white-space: nowrap; }
.dashboard-matches-table th { color: #6b7280; font-size: .7rem; font-weight: 500; text-transform: uppercase; }
.dashboard-matches-table .team-column { width: 30%; text-align: left; }
.dashboard-matches-table tr.match-status-ongoing { background: #e1e4e8; }
.dashboard-matches-table td.is-winner .dashboard-team, .dashboard-match-team.is-winner .dashboard-team { color: #111827; font-weight: 800; }
.dashboard-matches-table td.is-loser .dashboard-team, .dashboard-match-team.is-loser .dashboard-team { color: #9ca3af; opacity: .72; }
.dashboard-matches-table .dashboard-team { font-size: .82rem; }
.dashboard-matches-table .dashboard-team-logo, .dashboard-matches-table .dashboard-team-logo-placeholder { width: 22px; height: 22px; }
.bpl6-status-select { min-width: 92px; padding: 5px 7px; border: 1px solid #d1d5db; border-radius: 5px; background: #fff; color: #374151; font-size: .76rem; }
.bpl6-status-select:disabled { border-color: transparent; appearance: none; background: transparent; color: #4b5563; cursor: default; }
.dashboard-match-score { color: #202124 !important; font-weight: 700; }
.dashboard-match-score span { padding: 0 3px; color: #9ca3af; font-weight: 400; }
.dashboard-matches-unavailable { margin: 10px 0 0; }
.ddc-group-grid, .ddc-pitch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ddc-group-grid { align-items: start; }
.ddc-group-grid .dashboard-group { min-width: 0; margin-bottom: 24px; }
.ddc-group-grid .dashboard-table { min-width: 0; }
.ddc-group-grid .dashboard-table th, .ddc-group-grid .dashboard-table td { padding: 9px 5px; font-size: .75rem; }
.ddc-group-grid .dashboard-table th { font-size: .65rem; }
.ddc-group-grid .dashboard-table .team-column { width: 44%; }
.ddc-group-grid .dashboard-team { gap: 5px; font-size: .76rem; }
.ddc-group-grid .dashboard-team-logo, .ddc-group-grid .dashboard-team-logo-placeholder { width: 22px; height: 22px; }
.ddc-schedule { margin-top: 4px; }
.ddc-schedule > h2 { margin: 0 0 12px; font-size: 1rem; }
.ddc-pitch { min-width: 0; }
.ddc-pitch h3 { margin: 0 0 8px; font-size: .9rem; }
.ddc-pitch .dashboard-matches-table { min-width: 0; }
.ddc-pitch .dashboard-matches-table th, .ddc-pitch .dashboard-matches-table td { padding: 8px 5px; font-size: .7rem; }
.ddc-pitch .dashboard-matches-table th { font-size: .62rem; }
.ddc-pitch .dashboard-matches-table .team-column { width: 31%; }
.ddc-pitch .dashboard-team { gap: 4px; font-size: .7rem; }
.ddc-pitch .dashboard-team-logo, .ddc-pitch .dashboard-team-logo-placeholder { width: 20px; height: 20px; }
.dashboard-team { display: inline-flex; align-items: center; gap: 8px; color: #2f3337; font-size: .9rem; }
.dashboard-entity-link { color: inherit; text-decoration: none; }
.dashboard-entity-link:hover { color: var(--dashboard-blue); text-decoration: underline; }
.dashboard-team-logo { width: 25px; height: 25px; object-fit: contain; border-radius: 50%; }
.dashboard-team-logo-placeholder { width: 25px; height: 25px; border-radius: 50%; background: #edf0f2; }
.dashboard-bracket { display: flex; align-items: stretch; gap: 14px; overflow-x: auto; padding: 4px 2px 16px; }
.dashboard-round { position: relative; flex: 1 0 190px; min-width: 190px; }
.dashboard-round-matches { display: flex; min-height: 360px; flex-direction: column; justify-content: space-around; gap: 18px; }
.dashboard-round--semi-finals .dashboard-round-matches { padding: 54px 0; }
.dashboard-round--final .dashboard-round-matches { padding: 126px 0; }
.dashboard-round--third-place .dashboard-round-matches { padding-top: 260px; }
.dashboard-match { margin-bottom: 18px; padding: 12px 13px; border-radius: 15px; background: #eef0f4; }
.dashboard-match.match-status-ongoing { background: #dfe3e8; }
.dashboard-match-meta { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 9px; color: #70757a; font-size: .68rem; }
.dashboard-match-team { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; }
.dashboard-match-team strong { font-size: 1.05rem; }
.dashboard-match-team .dashboard-team { min-width: 0; }
.dashboard-match-team .dashboard-team span:last-child { overflow: hidden; text-overflow: ellipsis; }
.dashboard-penalties { margin-top: 7px; color: #6b7280; font-size: .7rem; }
.dashboard-sidebar { border-left: 1px solid #d1d5db; padding-left: 22px; }
.leaders-card { background: var(--dashboard-card); padding: 14px 12px 12px; }
.leaders-heading { display: flex; align-items: center; justify-content: space-between; }
.leaders-heading h2 { margin: 0; font-size: 1.1rem; font-weight: 500; }
.leader-tabs { display: flex; gap: 4px; margin-top: 20px; overflow-x: auto; border-bottom: 1px solid #d1d5db; }
.leader-tab { padding: 0 10px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #6b7280; font-size: .78rem; white-space: nowrap; cursor: pointer; }
.leader-tab.active { border-bottom-color: var(--dashboard-blue); color: #202124; }
.leader-columns { display: flex; justify-content: space-between; padding: 14px 8px 9px 18px; color: #6b7280; font-size: .75rem; }
.leader-row { display: grid; grid-template-columns: 24px 46px minmax(0, 1fr) 28px; align-items: center; gap: 8px; padding: 10px 8px; border-top: 1px solid #eef0f2; }
.leader-row--cards { grid-template-columns: 24px 46px minmax(0, 1fr) auto; }
.leader-rank, .leader-goals { color: #333; font-size: .85rem; }
.leader-avatar { width: 42px; height: 42px; overflow: hidden; border-radius: 50%; background: #e5e7eb; }
.leader-avatar img { width: 100%; height: 100%; object-fit: cover; }
.leader-team-avatar { display: grid; place-items: center; width: 42px; height: 42px; }
.leader-team-avatar .dashboard-team-logo { width: 38px; height: 38px; }
.leader-row--team .leader-name span { display: block; margin-top: 3px; color: #6b7280; font-size: .7rem; }
.team-selector { display: block; padding: 14px 12px 10px; }
.team-selector span { display: block; margin-bottom: 5px; color: #6b7280; font-size: .72rem; }
.team-selector select { width: 100%; padding: 8px 9px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; color: #202124; font-size: .82rem; }
.selected-team-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 10px; border-top: 1px solid #eef0f2; }
.selected-team-heading > span { color: #6b7280; font-size: .72rem; white-space: nowrap; }
.team-roster { border-top: 1px solid #eef0f2; }
.team-player-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #eef0f2; }
.leader-name { min-width: 0; }
.leader-name strong { display: block; overflow: hidden; color: #374151; font-size: .85rem; text-overflow: ellipsis; white-space: nowrap; }
.leader-name .captain-marker { color: inherit; font: inherit; }
.leader-name .dashboard-team { gap: 4px; margin-top: 3px; color: #6b7280; font-size: .75rem; }
.leader-name .dashboard-team-logo, .leader-name .dashboard-team-logo-placeholder { width: 16px; height: 16px; }
.leader-goals { text-align: right; }
.leader-card-count { display: flex; gap: 7px; color: #374151; font-size: .78rem; white-space: nowrap; }
.dashboard-help-card { margin-top: 28px; padding-top: 24px; border-top: 1px solid #d1d5db; }
.dashboard-help-card h2 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 500; }
.dashboard-help-card p, .dashboard-empty { color: var(--dashboard-muted); font-size: .88rem; line-height: 1.5; }
.leaders-card .dashboard-empty { margin: 14px 8px 4px; }
.archive-notes { margin-top: 30px; padding-top: 24px; border-top: 1px solid #d1d5db; }
.archive-notes h2 { margin: 0 0 16px; font-size: 1.2rem; font-weight: 600; }
.archive-note-group { margin: 0 0 18px; }
.archive-note-group h3 { margin: 0 0 8px; color: #374151; font-size: .95rem; font-weight: 700; }
.archive-note-group p { max-width: 860px; margin: 0 0 8px; color: #4b5563; font-size: .9rem; line-height: 1.55; }
.archive-note-group ul { display: grid; gap: 7px; max-width: 900px; margin: 0; padding-left: 18px; color: #4b5563; font-size: .9rem; line-height: 1.5; }
.archive-note-group li::marker { color: #9ca3af; }
.archive-note-group strong { color: #202124; }
.hidden { display: none !important; }

.bpl6-group-table { margin-bottom: 26px; }
.bpl6-team { color: #2f3337; }
.bpl6-score-button { min-width: 58px; padding: 3px 5px; border: 0; background: transparent; color: #202124; font-size: .88rem; font-weight: 700; cursor: pointer; }
.bpl6-score-button:hover { color: var(--dashboard-blue); }
.dashboard-match-team .bpl6-score-button { margin-left: auto; }
.bpl6-knockout-team-score { min-width: 34px; margin-left: auto; padding: 2px 0; border: 0; background: transparent; color: #202124; font-size: 1rem; font-weight: 700; cursor: pointer; }
.bpl6-knockout-team-score:hover { color: var(--dashboard-blue); }
.bpl6-schedule { display: grid; gap: 6px; margin-top: 26px; }
.bpl6-schedule h2, .bpl6-bracket h2 { margin: 0 0 10px; font-size: 1rem; }
.bpl6-match-row { display: grid; grid-template-columns: 70px 34px minmax(0, 1fr) 65px; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border: 1px solid var(--dashboard-line); background: var(--dashboard-card); color: var(--dashboard-text); text-align: left; cursor: pointer; }
.bpl6-match-row:hover { border-color: #9bbcf0; background: #f8fbff; }
.bpl6-match-time { color: #374151; font-size: .8rem; font-weight: 700; }
.bpl6-match-time small { display: block; margin-top: 3px; color: var(--dashboard-muted); font-size: .65rem; font-weight: 400; }
.bpl6-match-group { color: var(--dashboard-blue); font-size: .76rem; font-weight: 700; }
.bpl6-match-teams { display: grid; grid-template-columns: minmax(100px, 1fr) 28px 24px 28px minmax(100px, 1fr); align-items: center; gap: 6px; text-align: center; }
.bpl6-match-teams .bpl6-team:first-child { text-align: right; }
.bpl6-match-teams .bpl6-team:last-child { text-align: left; }
.bpl6-match-teams b { font-size: .95rem; }
.bpl6-match-teams em { color: var(--dashboard-muted); font-size: .72rem; font-style: normal; }
.bpl6-match-status { color: var(--dashboard-muted); font-size: .72rem; text-align: right; }
.bpl6-match-status::first-letter { color: #b91c1c; }
.bpl6-login-gate { margin-top: 18px; padding: 18px; border: 1px dashed #b8c0ca; background: #fff; color: var(--dashboard-muted); text-align: center; }
.leader-show-more { display: block; margin: 14px auto 4px; padding: 7px 12px; border: 1px solid var(--dashboard-line); border-radius: 4px; background: #fff; color: var(--dashboard-blue); cursor: pointer; font-size: .78rem; font-weight: 700; }
.leader-show-more:hover { background: #f1f5f9; }
.bpl6-bracket { margin-top: 28px; }
.bpl6-bracket-item { display: inline-grid; gap: 5px; min-width: 180px; margin: 0 8px 10px 0; padding: 10px; border: 1px solid var(--dashboard-line); background: #fff; font-size: .8rem; }
.bpl6-bracket-item strong { color: var(--dashboard-blue); }
.bpl6-modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(15, 23, 42, .58); }
.bpl6-modal-content { display: flex; width: min(720px, 100%); max-height: 90vh; flex-direction: column; overflow: hidden; padding: 18px; background: #fff; border-radius: 8px; }
.bpl6-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bpl6-modal-header h2 { margin: 0; font-size: 1.1rem; }
.bpl6-modal-close { width: 30px; height: 30px; border: 0; background: #e9edf2; color: #374151; font-size: 1.2rem; cursor: pointer; }
.bpl6-modal-subtitle { margin: 8px 0 16px; color: #4b5563; font-size: .88rem; font-weight: 700; }
.bpl6-score-fields { display: grid; grid-template-columns: 1fr 28px 1fr; align-items: end; gap: 10px; }
.bpl6-score-fields label { display: grid; gap: 5px; color: #4b5563; font-size: .76rem; font-weight: 700; }
.bpl6-score-fields input { width: 100%; padding: 9px; border: 1px solid #cbd5e1; font-size: 1rem; text-align: center; }
.bpl6-score-fields input.input-error { border-color: #dc2626; background: #fff1f2; box-shadow: 0 0 0 2px rgba(220, 38, 38, .18); }
.bpl6-score-fields input.input-error:focus { outline: 2px solid rgba(220, 38, 38, .32); outline-offset: 1px; }
.bpl6-modal-vs { padding-bottom: 10px; color: var(--dashboard-muted); text-align: center; }
.bpl6-penalties, .bpl6-scorers { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--dashboard-line); }
.bpl6-scorers { min-height: 0; flex: 1 1 auto; overflow: auto; }
.bpl6-penalties h3, .bpl6-scorers h3 { margin: 0 0 10px; font-size: .9rem; }
.bpl6-scorer-grid { display: grid; gap: 7px; }
.bpl6-scorer-head, .bpl6-scorer-grid label { display: grid; grid-template-columns: minmax(0, 1fr) repeat(4, 62px); align-items: center; gap: 8px; }
.bpl6-scorer-head { padding: 0 8px 6px; color: var(--dashboard-muted); font-size: .7rem; font-weight: 700; text-align: center; text-transform: uppercase; }
.bpl6-scorer-head span:first-child { text-align: left; }
.bpl6-scorer-grid label { padding: 6px 0; border-bottom: 1px solid #eef0f2; font-size: .78rem; }
.bpl6-player-label { display: flex; min-width: 0; align-items: center; gap: 8px; }
.bpl6-player-photo { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: #e5e7eb; object-fit: cover; }
.bpl6-player-photo-placeholder { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: #e5e7eb; }
.bpl6-player-label > span { min-width: 0; }
.bpl6-player-label > span:first-of-type { line-height: 1.25; }
.bpl6-scorer-grid small { display: block; margin-top: 2px; color: var(--dashboard-muted); }
.bpl6-scorer-grid input[type="number"] { width: 62px; padding: 5px; text-align: center; }
.bpl6-modal-error { flex: 1; min-height: 18px; margin: 0 12px 0 0; color: #b91c1c; font-size: .8rem; font-weight: 700; line-height: 1.3; }
.bpl6-modal-actions { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 10px -18px -18px; padding: 12px 18px 18px; border-top: 1px solid var(--dashboard-line); background: #fff; }
.bpl6-modal-actions button { border: 0; border-radius: 4px; padding: 9px 18px; background: var(--dashboard-blue); color: #fff; font-weight: 700; cursor: pointer; }
.bpl6-modal-actions .bpl6-modal-clear { margin-right: auto; background: #fff; color: #b91c1c; border: 1px solid #fca5a5; }
.bpl6-modal-actions .bpl6-modal-clear:hover { background: #fef2f2; }
.bpl6-modal-actions button:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 700px) {
  .bpl6-match-row { grid-template-columns: 54px 24px minmax(0, 1fr) 42px; padding: 9px 6px; }
  .bpl6-match-teams { grid-template-columns: minmax(70px, 1fr) 22px 18px 22px minmax(70px, 1fr); gap: 3px; font-size: .76rem; }
  .bpl6-match-status { font-size: .65rem; }
}

@media (max-width: 760px) {
  .tournament-dashboard { padding: 0 12px 26px; }
  .dashboard-nav { gap: 12px; overflow-x: auto; white-space: nowrap; }
  .dashboard-nav .nav-auth { margin-left: 8px; }
  .dashboard-header { align-items: start; flex-direction: column; }
  .dashboard-status { text-align: left; }
  .tournament-at-a-glance { padding: 12px 14px; }
  .tournament-at-a-glance p { gap: 5px 8px; }
  .dashboard-layout { grid-template-columns: 1fr; gap: 24px; }
  .dashboard-sidebar { border-top: 1px solid #d1d5db; border-left: 0; padding: 22px 0 0; }
  .dashboard-bracket { margin-right: -12px; }
  .dashboard-round-matches { min-height: 320px; }
  .ddc-group-grid, .ddc-pitch-grid { grid-template-columns: 1fr; gap: 14px; }
  .ddc-group-grid .dashboard-table, .ddc-pitch .dashboard-matches-table { min-width: 560px; }
}
