/* Shared league theme; scoped overrides preserve existing management controls. */
body{background:#0c1015;color:#edf2f7;font-family:Manrope,Arial,sans-serif}
body a{color:#9acdf4;text-decoration:none}
body :focus-visible{outline:2px solid #92cfff;outline-offset:4px}
body [hidden]{display:none!important}
body .topbar{position:sticky;top:0;z-index:100;padding:16px max(16px,calc((100% - 1160px)/2));background:rgba(16,21,28,.96);border-bottom:1px solid #26303c;backdrop-filter:blur(14px)}
body .topbar-row{justify-content:flex-start;gap:14px}
body .topbar-brand{flex:0 0 auto}
body .league-wordmark{font-size:clamp(.8rem,.65rem + .7vw,1.1rem);font-weight:800;letter-spacing:.06em;color:#f0f5fa;line-height:1.7}
body .league-wordmark span{white-space:nowrap}
body .topbar-nav{margin-top:5px;gap:4px}
body .topbar-nav a{min-height:32px;display:inline-flex;align-items:center;padding:5px 10px;font-size:.75rem;border-radius:7px}
body main.home-page,body main.detail-page{display:flex;flex-direction:column;gap:24px;max-width:1200px;padding:24px 18px 40px}
body .card{border:1px solid #27313e;border-radius:18px;background:#141b24;padding:clamp(16px,2.5vw,28px);box-shadow:0 8px 24px #00000012}
body .section-kicker{font:700 .65rem Manrope,Arial,sans-serif;letter-spacing:.13em;color:#9daebe}
body .home-page .hero{margin:0;min-height:0;padding:20px 24px;border-radius:16px;border:1px solid #27313e;background:#111922;gap:18px;box-shadow:none;flex-wrap:wrap}
body .home-page .hero::after{width:160px;right:24%;opacity:.035}
body .home-page .hero-copy p{font-size:.85rem;color:#b7c4d3;line-height:1.65;max-width:420px}
body .home-page .live-pill{color:#ff9189;font:700 .65rem Manrope,Arial,sans-serif;letter-spacing:.1em}
body .home-page .hero-meta{display:flex;width:auto;gap:24px;flex-wrap:nowrap}
body .home-page .hero-stat{background:none;border:0;padding:0;min-width:65px}
body .home-page .hero-stat strong{font:800 1.7rem Manrope,Arial,sans-serif}
body .home-page .hero-stat span{font:500 .7rem Manrope,Arial,sans-serif;color:#9daebe;text-transform:none}
body .upcoming-home .section-action{display:block;font-size:.75rem;margin-bottom:16px}
body .upcoming-home .card-head{display:block}
body .upcoming-home .upcoming-title-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
body .upcoming-home .upcoming-title-row h3{font-size:clamp(1.1rem,.9rem + 1vw,1.65rem);white-space:normal;letter-spacing:-.04em}
body .upcoming-home .card-head small{font:500 .75rem Manrope,Arial,sans-serif}
body .upcoming-teams,body .team-directory{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:12px;margin-top:20px}
body .upcoming-teams{grid-template-columns:repeat(2,minmax(0,1fr))}
body .upcoming-team{padding:18px;background:#101720;border:1px solid #293646;border-radius:14px;gap:13px}
body .upcoming-team>b{white-space:normal;font-size:.9rem;padding-bottom:12px;border-bottom:1px solid #27313e}
body .upcoming-team-logo{width:44px;height:44px;flex-basis:44px}
body .upcoming-team span{font-size:.8rem;color:#d1dce8}
body .upcoming-player-photo,body .upcoming-player-fallback{width:32px;height:32px;flex-basis:32px}
body .section-heading{display:flex;flex-wrap:wrap;gap:14px;justify-content:space-between;align-items:center;margin-bottom:18px}
body .section-heading h2{font-size:clamp(1.15rem,1rem + .65vw,1.6rem);letter-spacing:-.035em;margin:6px 0 0}
body .section-heading a{font-size:.75rem}
body .section-description{color:#aebed0;font-size:.85rem;line-height:1.7;margin-bottom:18px}
body .league-tabs{display:flex;flex-wrap:nowrap;gap:6px;overflow-x:auto;padding:0 0 14px;margin-bottom:10px;scrollbar-width:none;scroll-snap-type:x proximity;touch-action:pan-x}
body .league-tabs::-webkit-scrollbar{display:none}
body .league-tabs button{scroll-snap-align:start}
body .league-tabs button{flex-shrink:0;border:1px solid transparent;background:#101720;border-radius:9px;padding:12px 14px;min-height:44px;color:#adbdcf;font:600 .78rem Manrope,Arial,sans-serif;cursor:pointer}
body .league-tabs button[aria-selected=true]{background:#213c50;color:#c7e8ff;border-color:#416d8b}
body .ranking-caption{display:flex;justify-content:space-between;padding:10px 0;color:#98aabd;font-size:.7rem}
body .ranking-row{display:grid;grid-template-columns:22px 44px minmax(0,1fr) auto;align-items:center;gap:8px;padding:4px 0;border-top:1px solid #263240}
body .rank-number{color:#8295aa;font-size:.75rem}
body .player-portrait{width:44px;height:44px;border-radius:50%;object-fit:cover;flex:0 0 44px}
body .initials{display:grid;place-items:center;background:#24374a;color:#acd5f4;font-size:.8rem;font-weight:700}
body .player-name{font-size:.85rem;font-weight:700}
body .player-name span{font-weight:500;color:#b5c6d7}
body .ranking-row>strong{font-size:1rem;color:#a7daff;font-variant-numeric:tabular-nums}
body .ranking-card [role=tabpanel]{max-height:none;overflow:visible}
body [role=tabpanel]{min-width:0}
body .upcoming-goalies:not(:has(.upcoming-goalie)){display:none}
body .leader-head,body .stat-head{background:#101720;padding:14px 12px;border-radius:10px;color:#9db0c5}
body .player-stat-row,body .leader-full,body .stat-player{border-color:#283545;padding-top:14px;padding-bottom:14px}
body .leader-row{border-color:#283545;padding-top:4px;padding-bottom:4px}
body .tournament-entry{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 14px;padding:18px 0;border-top:1px solid #27313e;align-items:center}
body .tournament-entry-compact{padding:8px 0}
body .tournament-entry-compact time{font-size:.68rem}
body .tournament-entry-compact strong{font-size:.85rem}
body .tournament-entry time{font-size:.73rem;color:#93a9bf;grid-column:1}
body .tournament-entry strong{font-size:.95rem;grid-column:1;color:#e5edf6}
body .tournament-entry .state-pill{grid-column:2;grid-row:1}
body .tournament-entry>span:last-child{grid-column:2;grid-row:2;text-align:right}
body .state-pill{font:600 .65rem Manrope,Arial,sans-serif;color:#a7d2c4;background:#1e3434;padding:6px 10px;border-radius:20px;white-space:nowrap}
body .team-tile{display:flex;flex-direction:column;align-items:center;text-align:center;padding:24px 16px;background:#101720;border:1px solid #2b3848;border-radius:14px;gap:10px}
body .team-tile:hover,body .tournament-entry:hover{background:#1c2b3a}
body .team-tile img{width:84px;height:84px;object-fit:contain}
body .team-tile strong{color:#e7eef7;font-size:1rem}
body .team-tile>span{font-size:.75rem;color:#9cadbf}
body .team-tile .team-tile-link{margin-top:10px;color:#9acdf4}
body .back-action{font-size:.8rem}
body .detail-header{display:flex;justify-content:flex-start;flex-wrap:wrap;gap:18px}
body .detail-header h1{font-weight:800;font-size:clamp(1.3rem,1rem + 1.4vw,2rem);letter-spacing:-.04em;margin-top:8px}
body .detail-logo{width:84px;height:84px;object-fit:contain}
body .table-scroll{overflow:auto}
body table{border-collapse:separate;border-spacing:0;width:100%;font-size:.8rem}
body table th{font:600 .68rem Manrope,Arial,sans-serif;color:#9db0c5;padding:14px 12px;background:#101720;white-space:nowrap}
body table td{padding:14px 12px;border-top:1px solid #283545;font-family:Manrope,Arial,sans-serif;color:#d1dce8}
body table tbody tr:hover td{background:#1a2735}
body .table-note{color:#92a4b7;font-size:.7rem;line-height:1.7;margin-top:12px}
body .match-result{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:10px;align-items:center;padding:20px 0;border-bottom:1px solid #263240}
body .match-side{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;font-size:.78rem}
body .match-side img{width:48px;height:48px;object-fit:contain}
body .match-score{text-align:center}
body .match-score strong{display:block;font-size:1.4rem;white-space:nowrap}
body .match-score small{display:block;color:#92a6bb;font-size:.65rem;margin-top:6px;max-width:95px}
body .roster-tile{background:#101720;border-radius:14px;padding:18px}
body .roster-tile h3{font-size:.9rem;margin-bottom:16px}
body .roster-person{display:flex;align-items:center;gap:10px;font-size:.8rem;padding:8px 0}
body .roster-person small{display:block;color:#93a8bf;margin-top:4px;font-size:.67rem}
body .team-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px}
body .team-metrics .card{display:flex;flex-direction:column;gap:10px;padding:20px}
body .team-metrics strong{font-size:1.8rem}
body .team-metrics span{font-size:.75rem;color:#a6b8cc}
/* Главная — без тяжёлых внешних контейнеров: карточками остаются только команды и записи. */
body .home-page>.upcoming-home.card,
body .home-page>.ranking-card.card,
body .home-page>.directory-card.card{background:transparent;border:0;box-shadow:none;border-radius:0;padding:0}
body .home-page>.upcoming-home,
body .home-page>.ranking-card,
body .home-page>.directory-card{position:relative;border-bottom:1px solid #27313e;padding:28px 0 30px}
body .home-page>.upcoming-home::before,
body .home-page>.ranking-card::before,
body .home-page>.directory-card::before{content:'';position:absolute;top:-1px;left:0;width:64px;height:2px;background:linear-gradient(90deg,#76bee9,#b4e1ff)}
body .home-page>.upcoming-home{position:relative;padding-top:4px}
body .home-page>.ranking-card::before{background:linear-gradient(90deg,#f2c86b,#ffe6a3)}
body .home-page>.directory-card::before{background:linear-gradient(90deg,#82d8b0,#c0f2d8)}
body .home-page>.directory-card:last-child{border-bottom:0;padding-bottom:0}
body .home-page>.directory-card:last-child::before{background:linear-gradient(90deg,#b58be5,#e1c7ff)}
body .home-page>.ranking-card .section-heading,
body .home-page>.directory-card .section-heading{padding-bottom:14px;border-bottom:1px solid #202a35}
/* Спокойное деление разделов: без цветных полос и отдельных внешних карточек. */
body main.home-page{gap:36px}
body .home-page>.upcoming-home,
body .home-page>.ranking-card,
body .home-page>.directory-card{border-bottom:1px solid #2b3541;padding:0 0 36px}
body .home-page>.upcoming-home::before,
body .home-page>.ranking-card::before,
body .home-page>.directory-card::before{display:none}
body .home-page>.directory-card:last-child{padding-bottom:0;border-bottom:0}
body .home-page>.ranking-card .section-heading,
body .home-page>.directory-card .section-heading{padding-bottom:18px;border-bottom:1px solid #2b3541;margin-bottom:20px}
body .home-page>.home-section-divider{display:flex;align-items:center;gap:12px;width:100%;margin:-14px 0}
body .home-section-divider::before,
body .home-section-divider::after{content:'';height:2px;flex:1;background:linear-gradient(90deg,transparent,#5da4d4 48%,#9fdbff,transparent);box-shadow:0 0 12px rgba(102,191,239,.34)}
body .home-section-divider span{display:grid;place-items:center;width:32px;height:32px;border:1px solid #74c8f6;border-radius:50%;background:#142535;color:#c4ebff;font-size:.9rem;box-shadow:0 0 16px rgba(102,191,239,.4)}
body .home-page>.upcoming-home .upcoming-goalies{background:transparent;border:0;border-radius:0;padding:14px 0 0}
@media(min-width:48rem){body .home-page .hero{flex-direction:row;align-items:center;justify-content:space-between}body .upcoming-teams{grid-template-columns:repeat(4,minmax(0,1fr))}body .tournament-entry{grid-template-columns:100px minmax(0,1fr) auto 20px}body .tournament-entry time,body .tournament-entry strong,body .tournament-entry .state-pill,body .tournament-entry>span:last-child{grid-column:auto;grid-row:auto}}

/* Theme switcher and light theme (light is the default). */
html:not([data-theme="dark"]){--bg:#f5f7fb;--panel:#fff;--panel2:#f3f7fb;--line:#d9e2ec;--text:#14212d;--muted:#617386}
body .theme-toggle{margin-left:auto;display:flex;align-items:center;justify-content:center;gap:6px;width:66px;min-height:34px;border:1px solid #cbd6e1;border-radius:999px;padding:5px;background:#fff;color:#273746;cursor:pointer}
body .theme-toggle-icon{font-size:.9rem}.theme-toggle-track{width:28px;height:16px;border-radius:999px;background:#c3d1dd;padding:2px;display:flex;align-items:center}.theme-toggle-track span{display:block;width:12px;height:12px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #0003;transition:transform .25s ease}
body.theme-light{--bg:#f5f7fb;--panel:#fff;--panel2:#f3f7fb;--line:#d9e2ec;--text:#14212d;--muted:#617386;background:#f5f7fb;color:#14212d}
body.theme-light .topbar{background:rgba(255,255,255,.94);border-color:#d9e2ec;box-shadow:0 2px 14px #4561a10d}
body.theme-light .league-wordmark,body.theme-light .topbar-nav a.active,body.theme-light h1,body.theme-light h2,body.theme-light h3,body.theme-light strong{color:#14212d}
body.theme-light .topbar-nav a{color:#5d7184}.theme-light .topbar-nav a.active{background:#e9f2f9}
body.theme-light .card,body.theme-light .page-intro,body.theme-light .public-tournament-card,body.theme-light .form-card,body.theme-light .list-card{background:#fff;border-color:#d9e2ec;box-shadow:0 8px 24px #4a60820d}
body.theme-light .home-page .hero{background:linear-gradient(135deg,#edf6fc,#f7fbff);border-color:#cfe0ec}.theme-light .home-page .hero-copy p,.theme-light .section-description,.theme-light .public-subtitle{color:#526b80}.theme-light .home-page .live-pill{color:#d95850}
body.theme-light .upcoming-team,body.theme-light .team-tile,body.theme-light .roster-tile,body.theme-light .leader-head,body.theme-light .stat-head,body.theme-light table th{background:#f7fafc;border-color:#d9e2ec;color:#526b80}
body.theme-light .upcoming-team>b,.theme-light .team-tile strong,.theme-light .tournament-entry strong{color:#172a3b}.theme-light .upcoming-team span,.theme-light .team-tile>span,.theme-light .tournament-entry time,.theme-light .player-name span{color:#617589}
body.theme-light .ranking-row,body.theme-light .tournament-entry,body.theme-light .match-result,body.theme-light table td,body.theme-light .home-page>.upcoming-home,body.theme-light .home-page>.ranking-card,body.theme-light .home-page>.directory-card{border-color:#d9e2ec}
body.theme-light .ranking-row>strong{color:#17689d}.theme-light .initials{background:#dbeaf6;color:#1d5f8d}.theme-light .state-pill{background:#e6f3ed;color:#217451}
body.theme-light .league-tabs button{background:#eef4f8;color:#536c81}.theme-light .league-tabs button[aria-selected=true]{background:#d7ebf8;color:#155c8a;border-color:#93c7e7}
body.theme-light table td{color:#30475a}.theme-light table tbody tr:hover td,.theme-light .team-tile:hover,.theme-light .tournament-entry:hover{background:#eef6fc}.theme-light .table-note{color:#65788a}
body.theme-light .form-card input,body.theme-light .form-card select,body.theme-light .match-row select,body.theme-light .match-row input,body.theme-light .goal-forms select,body.theme-light .quick-add input,body.theme-light .quick-row input,body.theme-light .quick-row select,body.theme-light .copy-roster-card textarea{background:#fff;color:#14212d;border-color:#cbd7e1}
body.theme-light .home-section-divider::before,body.theme-light .home-section-divider::after{background:linear-gradient(90deg,transparent,#7ab4db 48%,#479dd1,transparent)}
body.theme-light .home-section-divider span{background:#fff;border-color:#84bfe5;color:#2175aa}
body.theme-dark .theme-toggle{background:#17212d;color:#d2e3ef;border-color:#33495c}.theme-dark .theme-toggle-track{background:#528caf}.theme-dark .theme-toggle-track span{transform:translateX(12px)}
/* Do not animate every table cell or a box shadow: on long rosters that makes
   the browser stutter.  Only the large visible surfaces receive a short fade. */
body,body .topbar,body .card,body .home-page .hero,body .upcoming-team,body .team-tile,body .roster-tile,body .league-tabs button,body .theme-toggle{transition:background-color .16s ease-out,color .16s ease-out,border-color .16s ease-out}
@media (prefers-reduced-motion:reduce){body,body .topbar,body .card,body .home-page .hero,body .upcoming-team,body .team-tile,body .roster-tile,body .league-tabs button,body .theme-toggle,body .theme-toggle-track span{transition:none}}
/* Светлая тема применяется ещё до выполнения JavaScript, поэтому при переходе нет тёмного кадра. */
html:not([data-theme="dark"]) body{background:#f5f7fb;color:#14212d}
html:not([data-theme="dark"]) body .topbar{background:rgba(255,255,255,.94);border-color:#d9e2ec;box-shadow:0 2px 14px #4561a10d}
html:not([data-theme="dark"]) body .league-wordmark,html:not([data-theme="dark"]) body .topbar-nav a.active,html:not([data-theme="dark"]) body h1,html:not([data-theme="dark"]) body h2,html:not([data-theme="dark"]) body h3,html:not([data-theme="dark"]) body strong{color:#14212d}
html:not([data-theme="dark"]) body .topbar-nav a{color:#5d7184}html:not([data-theme="dark"]) body .topbar-nav a.active{background:#e9f2f9}
html:not([data-theme="dark"]) body .card,html:not([data-theme="dark"]) body .page-intro,html:not([data-theme="dark"]) body .public-tournament-card,html:not([data-theme="dark"]) body .form-card,html:not([data-theme="dark"]) body .list-card{background:#fff;border-color:#d9e2ec;box-shadow:0 8px 24px #4a60820d}
html:not([data-theme="dark"]) body .home-page .hero{background:linear-gradient(135deg,#edf6fc,#f7fbff);border-color:#cfe0ec}html:not([data-theme="dark"]) body .home-page .hero-copy p,html:not([data-theme="dark"]) body .section-description,html:not([data-theme="dark"]) body .public-subtitle{color:#526b80}html:not([data-theme="dark"]) body .home-page .live-pill{color:#d95850}
html:not([data-theme="dark"]) body .upcoming-team,html:not([data-theme="dark"]) body .team-tile,html:not([data-theme="dark"]) body .roster-tile,html:not([data-theme="dark"]) body .leader-head,html:not([data-theme="dark"]) body .stat-head,html:not([data-theme="dark"]) body table th{background:#f7fafc;border-color:#d9e2ec;color:#526b80}
html:not([data-theme="dark"]) body .upcoming-team>b,html:not([data-theme="dark"]) body .team-tile strong,html:not([data-theme="dark"]) body .tournament-entry strong{color:#172a3b}html:not([data-theme="dark"]) body .upcoming-team span,html:not([data-theme="dark"]) body .team-tile>span,html:not([data-theme="dark"]) body .tournament-entry time,html:not([data-theme="dark"]) body .player-name span{color:#617589}
html:not([data-theme="dark"]) body .ranking-row,html:not([data-theme="dark"]) body .tournament-entry,html:not([data-theme="dark"]) body .match-result,html:not([data-theme="dark"]) body table td,html:not([data-theme="dark"]) body .home-page>.upcoming-home,html:not([data-theme="dark"]) body .home-page>.ranking-card,html:not([data-theme="dark"]) body .home-page>.directory-card{border-color:#d9e2ec}
html:not([data-theme="dark"]) body .ranking-row>strong{color:#17689d}html:not([data-theme="dark"]) body .initials{background:#dbeaf6;color:#1d5f8d}html:not([data-theme="dark"]) body .state-pill{background:#e6f3ed;color:#217451}
html:not([data-theme="dark"]) body .league-tabs button{background:#eef4f8;color:#536c81}html:not([data-theme="dark"]) body .league-tabs button[aria-selected=true]{background:#d7ebf8;color:#155c8a;border-color:#93c7e7}
html:not([data-theme="dark"]) body table td{color:#30475a}html:not([data-theme="dark"]) body table tbody tr:hover td,html:not([data-theme="dark"]) body .team-tile:hover,html:not([data-theme="dark"]) body .tournament-entry:hover{background:#eef6fc}html:not([data-theme="dark"]) body .table-note{color:#65788a}
html:not([data-theme="dark"]) body .form-card input,html:not([data-theme="dark"]) body .form-card select,html:not([data-theme="dark"]) body .match-row select,html:not([data-theme="dark"]) body .match-row input,html:not([data-theme="dark"]) body .goal-forms select,html:not([data-theme="dark"]) body .quick-add input,html:not([data-theme="dark"]) body .quick-row input,html:not([data-theme="dark"]) body .quick-row select,html:not([data-theme="dark"]) body .copy-roster-card textarea{background:#fff;color:#14212d;border-color:#cbd7e1}
html:not([data-theme="dark"]) body .home-section-divider::before,html:not([data-theme="dark"]) body .home-section-divider::after{background:linear-gradient(90deg,transparent,#7ab4db 48%,#479dd1,transparent)}html:not([data-theme="dark"]) body .home-section-divider span{background:#fff;border-color:#84bfe5;color:#2175aa}
/* First-paint aliases for management pages.  These rules intentionally use the
   html theme marker so a navigation never briefly renders the old dark UI. */
html:not([data-theme="dark"]) body .page-intro{background:#fff;color:#14212d;border-color:#d9e2ec}
html:not([data-theme="dark"]) body .page-intro p,html:not([data-theme="dark"]) body .form-card label,html:not([data-theme="dark"]) body .match-row label,html:not([data-theme="dark"]) body .quick-add>p,html:not([data-theme="dark"]) body .quick-add label,html:not([data-theme="dark"]) body .quick-row label,html:not([data-theme="dark"]) body .goal-forms label{color:#617386}
html:not([data-theme="dark"]) body .record,html:not([data-theme="dark"]) body .empty,html:not([data-theme="dark"]) body .quick-add form,html:not([data-theme="dark"]) body .quick-row,html:not([data-theme="dark"]) body .tournament-tabs{border-color:#d9e2ec}
html:not([data-theme="dark"]) body .record small,html:not([data-theme="dark"]) body .empty{color:#617386}
html:not([data-theme="dark"]) body .record-status{background:#e6f3ed;color:#217451}
html:not([data-theme="dark"]) body .record-logo,html:not([data-theme="dark"]) body .tournament-thumb{background:#fff;border-color:#d9e2ec}
html:not([data-theme="dark"]) body .tournament-tabs a{color:#617386}
html:not([data-theme="dark"]) body .tournament-name{color:#14212d}
html:not([data-theme="dark"]) body .match-row select,html:not([data-theme="dark"]) body .match-row input,html:not([data-theme="dark"]) body .quick-add input,html:not([data-theme="dark"]) body .quick-row input,html:not([data-theme="dark"]) body .quick-row select,html:not([data-theme="dark"]) body .goal-forms select{color:#14212d}
/* Команда «Белые медведи» в тёмной теме окрашена почти в белый — на светлом
   фоне это делает её название нечитаемым, поэтому в светлой теме используем
   тёмный оттенок вместо белого. */
html:not([data-theme="dark"]) body .team-name[class*="белые"],html:not([data-theme="dark"]) body .team-stat-name[class*="белые"]{color:#526b80}
html:not([data-theme="dark"]) body .team-score-label[class*="белые"]{color:#526b80!important}
body.theme-light .team-name[class*="белые"],body.theme-light .team-stat-name[class*="белые"]{color:#526b80}
body.theme-light .team-score-label[class*="белые"]{color:#526b80!important}
