:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#132238;background:#f4f7f9;--navy:#10253f;--green:#2bb673;--lime:#b8e24b;--card:#fff;--muted:#687386}*{box-sizing:border-box}body{margin:0}.shell{max-width:1200px;margin:auto;padding:0 16px 56px}header.hero{margin:0 -16px 20px;padding:22px 18px;background:linear-gradient(135deg,#10253f,#17496a);color:white;position:sticky;top:0;z-index:5;box-shadow:0 8px 24px #10253f22}.hero h1{font-size:clamp(22px,5vw,34px);margin:0}.hero p{margin:5px 0 0;color:#d9e7f2}.tabs{display:flex;gap:8px;overflow:auto;margin-top:14px}.tabs a{color:white;text-decoration:none;background:#ffffff18;padding:8px 11px;border-radius:999px;white-space:nowrap;font-size:13px}.card{background:var(--card);border-radius:18px;padding:18px;margin:14px 0;box-shadow:0 8px 28px #1a304610;border:1px solid #e7edf2}h2{margin:0 0 14px;font-size:20px}h3{margin:18px 0 9px}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}label{display:grid;gap:6px;font-size:13px;font-weight:700;color:#34465c}input,textarea,select,button{font:inherit}input,textarea,select{width:100%;border:1px solid #cdd8e1;border-radius:11px;padding:11px;background:white}textarea{min-height:110px;resize:vertical}button{border:0;border-radius:11px;padding:11px 14px;background:var(--navy);color:white;font-weight:800;cursor:pointer}.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.secondary{background:#e9f2f7;color:var(--navy)}.ghost{background:#eef2f5;color:#405064}.pill{font-weight:800;border-radius:999px;padding:7px 10px}.pill.ok{background:#daf7e7;color:#13643e}.pill.bad{background:#ffe1e1;color:#8b2424}#status{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.muted,small{color:var(--muted)}.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.stat-grid article{background:#f5f8fa;border-radius:12px;padding:12px}.stat-grid strong{display:block;font-size:24px;margin-top:5px}.matrix{overflow:auto;margin-top:14px}.matrix-grid{display:grid;gap:3px;min-width:max-content}.matrix-grid>*{padding:6px;text-align:center;border-radius:6px;background:#f3f6f8;font-size:12px}.matrix-grid .diag{background:#e2e7eb}.rank{display:grid;grid-template-columns:38px 1fr auto;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #edf0f2}.rank:last-child{border:0}.rank small{display:block}.rank>strong{font-size:24px}.place{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:#eef5fa;font-weight:900}.fixture{border:1px solid #e5ebef;border-radius:14px;padding:12px;margin:10px 0}.fixture header,.scoreline{display:flex;justify-content:space-between;align-items:center;gap:8px}.teams{display:grid;grid-template-columns:1fr auto 1fr;gap:8px;align-items:center;text-align:center;padding:14px 0}.teams span{font-weight:800}.scoreline input{max-width:70px;text-align:center;font-size:20px;font-weight:900}.scoreline button{padding:9px 12px}.notice{padding:12px;border-radius:12px;background:#fff7dd;color:#634b00;margin-bottom:12px}@media(max-width:650px){.stat-grid{grid-template-columns:repeat(2,1fr)}.teams{font-size:14px}.scoreline{justify-content:flex-start;flex-wrap:wrap}.fixture header{font-size:13px}}

.avatar{width:38px;height:38px;flex:none;object-fit:cover;border-radius:50%;display:inline-grid;place-items:center;vertical-align:middle;border:2px solid #d6e7ed;background:#e8eff6;color:#284461;font-size:12px;font-weight:900}.avatar-large{width:84px;height:84px;font-size:26px;border-width:3px}.player-link{display:inline-flex;align-items:center;gap:8px;padding:4px 6px;background:none;color:var(--navy);text-align:left;font-weight:800;border-radius:9px;max-width:100%;min-width:0}.player-link:hover,.player-link:focus-visible{background:#eaf5f2;outline:2px solid #75c6a1}.player-link span:last-child{overflow-wrap:anywhere}.rank .player-link{font-size:16px}.team-pair{display:flex;flex-direction:column;gap:4px;min-width:0}.team-pair .player-link{font-size:13px}.teams{align-items:center}.photo-input-section{grid-column:1/-1;border-top:1px solid #edf0f2;padding-top:6px}.photo-input-section>p{font-size:13px}.photo-person{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid #edf0f2;flex-wrap:wrap}.photo-person>div{flex:1;min-width:100px}.photo-person small{display:block}.photo-person input[type=file]{position:absolute;width:1px;height:1px;opacity:0}.photo-upload{display:inline-block;background:#e9f2f7;padding:8px 10px;border-radius:9px;color:#10253f;cursor:pointer;font-size:12px}.photo-person button{font-size:12px;padding:8px}dialog{border:0;border-radius:18px;max-width:min(720px,95vw);width:100%;max-height:85vh;overflow:auto;padding:24px;box-shadow:0 20px 100px #071f3566}dialog::backdrop{background:#071f35aa}.dialog-actions{display:flex;justify-content:flex-end}.profile-head{display:flex;align-items:center;gap:18px;margin-bottom:18px}.profile-head h2{margin:0}.profile-head p{margin:5px 0;color:var(--muted)}.profile-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:8px}.profile-stats article{padding:12px;background:#f1f6f9;border-radius:12px}.profile-stats small{display:block}.profile-stats strong{font-size:23px}.profile-match{display:grid;grid-template-columns:1fr auto;gap:3px;padding:12px 0;border-bottom:1px solid #e8edf1}.profile-match small{grid-column:1/-1}.profile-match b{font-size:18px}

.players-section,.session-section,.advanced{grid-column:1/-1;margin-top:12px}.session-card{padding:16px;border:1px solid #c9d6e4;border-radius:12px;margin:12px 0;background:#f7fafc;color:#112f47}.session-top{display:flex;justify-content:space-between;align-items:center}.session-inputs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:12px 0}.session-inputs label,.person-details label{display:flex;flex-direction:column;gap:6px}.session-inputs input,.session-inputs select,.person-details input{width:100%;min-width:0}.session-duration{color:#526b7c}.person-details{flex:1;min-width:130px}.danger{color:#a33232!important}.advanced{padding:14px;border:1px solid #c9d6e4;border-radius:12px}.advanced summary{cursor:pointer;font-weight:700}.recommend-card{border:1px solid #c9d6e4;border-radius:12px;padding:15px;margin:12px 0;display:flex;gap:12px;align-items:center;justify-content:space-between}.recommend-card p{margin:8px 0}@media(max-width:700px){.session-inputs{grid-template-columns:repeat(2,minmax(0,1fr))}.recommend-card{flex-direction:column;align-items:stretch}.photo-person{flex-wrap:wrap}}

/* Explicit confirmation of setup actions */
.action-feedback{padding:13px 15px;margin:16px 0;border:1px solid #7a94ac;border-left:5px solid #3b82f6;border-radius:10px;background:#eaf3ff;color:#173a5e;font-weight:650;line-height:1.5}
.action-feedback.success{border-left-color:#14805e;background:#e5f7ee;color:#07553b}
.action-feedback.error{border-left-color:#c33336;background:#fff0f0;color:#842628}
.action-feedback.warning{border-left-color:#be7411;background:#fff6de;color:#754d0b}
#setup>.actions button.action-active{outline:3px solid #f5bb44;outline-offset:2px;box-shadow:0 0 0 4px rgba(245,187,68,.18)}
#recommendationSection,#fairness-section{scroll-margin-top:18px}

.setup-overview{margin:18px 0;padding:18px;background:#eef7f5;border:1px solid #b3d5c8;border-radius:15px}.overview-top{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap}.overview-top h3{margin:0}.overview-number{font-size:30px;font-weight:900;color:#0e6847;margin:10px 0}.overview-number span{font-size:15px;font-weight:600}.setup-overview ul{padding-left:20px;line-height:1.7;margin:8px 0}.setup-overview p{margin:8px 0 0}.recommend-summary{padding:20px;border-radius:16px;background:#eef7f5;border:2px solid #4bab8c}.recommend-summary h3{font-size:24px;margin:10px 0}.recommend-summary p{font-size:16px;line-height:1.6}.eyebrow{font-weight:900;color:#237658;font-size:12px;letter-spacing:.5px}.primary-pick{background:#0e6847;padding:15px 20px;margin-top:8px}#recommendationSection,#fairness-section{scroll-margin-top:160px}#setupOverview{scroll-margin-top:160px}

/* V5: saved results are unmistakable and cannot be inadvertently overwritten */
.fixture-saved{border:2px solid #60ad86;background:#f0faf4}.fixture-saved.just-saved{box-shadow:0 0 0 3px #9be5b7}.saved-chip{background:#d5f4e1;color:#17613b;font-weight:900;border-radius:16px;padding:5px 9px}.fixture input:disabled{background:#dfeee5;color:#16432d;opacity:1;cursor:not-allowed}.fixture .scoreline{justify-content:flex-start}.fixture .scoreline button{margin-left:4px}

.audit-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(135px,1fr));gap:10px;margin:16px 0}.audit-grid article{background:#eef4f7;border-radius:12px;padding:12px}.audit-grid small{display:block;color:#536779}.audit-grid strong{font-size:1.5rem}.audit-pass{border-left:5px solid #24935e}.audit-pending{border-left:5px solid #ce9436}.unsaved-chip{border-radius:50px;background:#fff3db;color:#80500a;padding:4px 9px;font-size:.75rem;font-weight:700}#verifyFinal:disabled{opacity:.5;cursor:not-allowed}

/* V6 - organiser and spectator views */
.participant-view .admin-only{display:none!important}.participant-view #scoreAudit,.participant-view #auth,.participant-view #setup,.participant-view #recommendationSection{display:none!important}.participant-view .fixture input{pointer-events:none}.participant-view .tabs a.admin-only{display:none!important}
.match-scoreboard{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0}.match-side{border:1px solid #e0e9ee;background:#f8fbfd;border-radius:14px;min-width:0;padding:14px;display:flex;align-items:center;flex-direction:column;justify-content:space-between;gap:16px}.match-side .team-pair{width:100%;align-items:center;min-height:100px}.match-side .team-pair .player-link{width:100%;justify-content:center}.match-side input{max-width:110px;text-align:center;font-weight:900;font-size:26px}.match-controls{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}.match-controls button{min-width:130px}.champion-banner{border-radius:22px;padding:22px 12px;background:linear-gradient(135deg,#10253f,#17496a);color:white;margin:18px 0;text-align:center}.champion-title{color:#f5d27c;letter-spacing:1px;font-size:17px;font-weight:900}.podium{display:grid;grid-template-columns:1fr 1.15fr 1fr;gap:10px;align-items:end;margin-top:20px}.podium-place{display:flex;align-items:center;gap:7px;flex-direction:column;padding:18px 6px;border-radius:14px;background:#ffffff18;min-width:0}.podium-1{background:linear-gradient(160deg,#f8e7ad,#e1b94c);color:#392b08;padding:24px 6px}.podium-medal{font-size:32px}.podium-place b{overflow-wrap:anywhere}.podium-place span{font-size:11px;font-weight:800}.podium-place strong{font-size:20px}@media(max-width:600px){.match-side{padding:8px}.match-scoreboard{gap:7px}.podium-place{padding:10px 3px}.podium-1{padding:16px 3px}.podium-place b{font-size:12px}.podium-place .avatar-large{width:62px;height:62px}.podium-title{font-size:13px}}

.recovery-panel{margin:18px 0;padding:18px;border:1px solid #d7b15e;border-radius:13px;background:#fff8e9;color:#29394b}.recovery-panel[hidden]{display:none}.recovery-panel h3{margin:0 0 8px}.recovery-panel p{margin:0 0 12px}.recovery-panel .danger{background:#9d3434;color:white}

/* V8 mobile-first courtside refinement */
html{scroll-behavior:smooth;scroll-padding-top:112px}#setup,#recommendationSection,#fairness-section,#standings,#matches{scroll-margin-top:112px}
.launch-panel{margin-top:22px;padding:20px;border-radius:16px;background:#edf8f3;border:2px solid #258563}.launch-panel h3{margin:0 0 8px;color:#11563e}.launch-panel p{line-height:1.55}.launch-panel button{display:block;width:100%;min-height:52px;font-size:17px;background:#096949}.launch-panel button:disabled{opacity:.5;cursor:not-allowed}.launch-panel[hidden]{display:none!important}
.tabs a{min-height:44px;display:inline-flex;align-items:center;justify-content:center}.match-side input{min-height:52px}.match-controls button{min-height:48px}.player-link{min-height:44px}.actions button{min-height:44px}
@media(max-width:650px){.shell{padding:0 10px 44px}.hero{margin:0 -10px 14px!important;padding:10px 12px 9px!important}.hero h1{font-size:19px}.hero p{font-size:11px;margin:2px 0}.tabs{gap:6px;margin-top:8px;scrollbar-width:none}.tabs a{font-size:12px;padding:7px 12px;min-height:44px}.card{padding:13px;margin:10px 0;border-radius:13px}.stat-grid{gap:6px}.stat-grid article{padding:9px}.stat-grid strong{font-size:20px}.rank{grid-template-columns:30px minmax(0,1fr) auto;gap:7px}.rank>strong{font-size:19px}.rank .player-link{font-size:14px}.rank .avatar{width:32px;height:32px}.match-side{padding:9px 5px;gap:9px}.match-side .team-pair{min-height:96px}.match-side .player-link{padding:4px 1px;font-size:12px;line-height:1.15}.match-side .avatar{width:30px;height:30px}.match-side input{width:95%;max-width:112px;font-size:25px;min-height:56px}.match-controls button{flex:1;max-width:320px}.session-inputs{grid-template-columns:repeat(2,minmax(0,1fr))}.photo-person{gap:7px}.photo-person .person-details{flex-basis:calc(100% - 60px)}.recommend-summary{padding:14px}.recommend-summary h3{font-size:20px}.recommend-summary p{font-size:14px}.launch-panel{padding:15px}dialog{padding:14px;max-width:96vw;max-height:90dvh}.profile-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-head{gap:10px}.profile-head .avatar-large{width:64px;height:64px}.action-feedback{font-size:14px}button,input,select{touch-action:manipulation}}
@media(max-width:380px){.match-scoreboard{gap:5px}.match-side .player-link{font-size:11px}.match-side .avatar{width:26px;height:26px}.rank>strong{font-size:17px}.podium-place b{font-size:11px}}

#shareDialog{width:min(94vw,560px);border:1px solid #c4d1de;border-radius:20px;padding:24px;max-height:90vh}#shareDialog::backdrop{background:rgba(12,30,54,.65)}#shareMessage{width:100%;min-height:210px;font:inherit;resize:vertical;padding:14px;border-radius:12px;border:1px solid #bdc9d5}.lifecycle-actions{border:1px solid #d7c3a0;background:#fffaf1;border-radius:14px;padding:16px;margin:20px 0}.lifecycle-actions button{margin:4px 8px 4px 0}
/* V10 score entry and completion */
.reset-labelled{display:inline-flex!important;align-items:center;gap:8px;background:#922e34!important;color:#fff!important;font-size:15px!important;font-weight:800!important;opacity:1!important;visibility:visible!important;min-width:172px;justify-content:center}.reset-labelled span{font-size:21px}.lifecycle-actions{margin:24px 0 12px}.champion-banner{scroll-margin-top:130px}#podium{scroll-margin-top:130px}.match-side input:focus{outline:3px solid #2a9d72;outline-offset:2px}

/* V12 final champion reveal: genuine podium hierarchy with phone-safe composition */
.championship-celebration{position:relative;overflow:hidden;padding:24px 14px 28px;background:radial-gradient(ellipse at 50% 0%,#285d7b 0%,#10243e 70%);box-shadow:0 13px 32px #0b2b4733}
.celebration-sparkles{font-size:clamp(17px,3.5vw,29px);letter-spacing:.3em;opacity:.93;margin:0 0 12px}
.championship-celebration .champion-title{font-size:clamp(13px,2.5vw,18px);line-height:1.5}
.podium-stacked{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start;max-width:590px;margin:24px auto 0}
.podium-stacked .podium-place{min-width:0;min-height:175px;border:1px solid #ffffff3b;box-shadow:0 8px 20px #0003;padding:15px 8px;gap:7px}
.podium-stacked .podium-1{grid-column:1/-1;grid-row:1;justify-self:center;width:min(100%,330px);background:linear-gradient(145deg,#fff6cf,#f0c65d 65%,#d4a536);border:2px solid #ffe49c;color:#352809;padding:24px 12px 26px;box-shadow:0 0 32px #fcd76350}
.podium-stacked .podium-2{grid-column:1;grid-row:2;background:linear-gradient(145deg,#eef3f9,#b6c6d8);color:#233951}
.podium-stacked .podium-3{grid-column:2;grid-row:2;background:linear-gradient(145deg,#f4d9b8,#b98054);color:#3a2119;margin-top:19px}
.podium-stacked .podium-medal{font-size:clamp(35px,7vw,56px);line-height:1.1}
.podium-stacked .podium-1 .avatar-large{width:104px;height:104px;border:4px solid #fff5d3}
.podium-stacked .podium-1 b{font-size:clamp(21px,4vw,29px);line-height:1.2}
.podium-stacked .podium-place span{font-size:12px;letter-spacing:.06em}
.podium-stacked .podium-place strong{font-size:clamp(18px,3vw,24px)}
.winner-confetti{font-size:18px;letter-spacing:.15em}
.verified-final-note{font-size:12px;opacity:.92;margin:20px 0 0}
@media(max-width:480px){.championship-celebration{padding:20px 10px}.podium-stacked{gap:8px}.podium-stacked .podium-place{padding:14px 5px}.podium-stacked .podium-1{padding:20px 10px}.podium-stacked .podium-1 .avatar-large{width:92px;height:92px}.podium-stacked .podium-place b{font-size:14px}.podium-stacked .podium-1 b{font-size:22px}.celebration-sparkles{letter-spacing:.12em}}
@media(prefers-reduced-motion:no-preference){.championship-celebration .podium-1{animation:champion-arrive .7s ease-out both}@keyframes champion-arrive{from{transform:translateY(14px);opacity:.35}to{transform:translateY(0);opacity:1}}}

.championship-verified-date{font-size:13px;opacity:.95;text-align:center;margin:8px 0 18px;letter-spacing:.015em}
.champion-title{overflow-wrap:anywhere;text-wrap:balance}

/* Only the authenticated administrator may see the management panel. */
#auth[hidden] { display:none!important; }

/* Version 21 — accessible, mobile-first tournament management */
.dashboard-heading h2{margin:0 0 4px}.dashboard-heading p{margin:0 0 14px}.dashboard-filters{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}.dashboard-filter{background:#eef3f8;color:#18344a;border:1px solid #d2e0ed;border-radius:999px;padding:9px 13px;font-size:14px;cursor:pointer}.dashboard-filter.is-current{background:#153e5b;color:white;border-color:#153e5b}.tournament-dashboard{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr));gap:12px;margin:12px 0}.tournament-tile{background:#fff;border:1px solid #d8e5ec;border-radius:14px;padding:16px;box-shadow:0 2px 6px rgba(15,43,62,.06)}.tournament-tile.is-selected{border:2px solid #268566}.tournament-tile-top{display:flex;justify-content:space-between;align-items:center;gap:10px;color:#35556a;font-size:14px;font-weight:700}.tournament-tile h3{margin:12px 0 5px;font-size:19px;overflow-wrap:anywhere}.tournament-tile p{font-size:13px;color:#4f6473;margin:0 0 15px}.tournament-pill{font-size:12px;border-radius:18px;padding:5px 9px;white-space:nowrap}.tournament-pill.draft{background:#e5efff;color:#164989}.tournament-pill.active{background:#d7f6e3;color:#0d6940}.tournament-pill.archived{background:#eeeeef;color:#555}.tournament-tile-actions{display:flex;flex-wrap:wrap;gap:8px}.tournament-tile-actions button{min-height:40px}.empty-tournaments{padding:20px;text-align:center;border:1px dashed #ccd8e0;border-radius:12px}@media(max-width:600px){.dashboard-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-filter{width:100%}.tournament-dashboard{grid-template-columns:1fr}.tournament-tile{padding:14px}}

/* Consistent participant-friendly sharing, on tournament, leaderboard and matches. */
.section-sharing{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}.section-sharing h2{margin-bottom:0}.section-sharing .share-control{white-space:nowrap;min-height:42px}.share-control[hidden]{display:none!important} .participant-view .share-control{display:inline-flex} 

/* V25 — concise administrator identity and immediately accessible logout */
.admin-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:8px}.admin-heading h2{margin:0}.admin-heading #logout{min-height:44px;white-space:nowrap;font-weight:700}.admin-signed-in{font-size:14px;color:#375668;line-height:1.5;margin:3px 0 16px;overflow-wrap:anywhere}#authStatus:empty{display:none}#loginActions{margin:10px 0 0}

.auth-switch{display:flex;align-items:center;gap:10px}.auth-switch button{min-height:44px;font-weight:700;white-space:nowrap}.auth-switch #login{background:#eaf2f7;color:#102e45;border:1px solid #c7dbe9}

/* Compact persistent administrator access control in the header. */
.hero{position:relative;padding-right:64px}.header-auth{position:absolute;right:14px;top:12px}.header-auth-btn{min-height:32px!important;min-width:32px!important;padding:4px 6px!important;border-radius:8px!important;background:rgba(255,255,255,.1)!important;color:white!important;border:1px solid rgba(255,255,255,.28)!important;font-size:15px!important;opacity:.72;cursor:pointer}.header-auth-btn:hover,.header-auth-btn:focus-visible{opacity:1;background:rgba(255,255,255,.2)!important}.header-auth-btn[hidden]{display:none!important}

/* Keep the public landing directory separate from direct shared tournament links. */
.public-view #publicDirectory{display:none!important}
.public-open{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;border-radius:9px;padding:11px 15px;color:#fff!important;background:#13684b;font-weight:700}

/* V29: a signed-out public homepage shows only the hero and tournament directory until a tournament is selected. */
body.participant-view:not(.has-tournament) #fairness-section,
body.participant-view:not(.has-tournament) #standings,
body.participant-view:not(.has-tournament) #matches,
body.participant-view:not(.has-tournament) main > section.card:has(> .section-sharing > #status){display:none!important;}

/* V32 spectator navigation and screen order */
.tournament-navigation{display:flex;flex-wrap:wrap;gap:14px;justify-content:space-between;align-items:end;margin-bottom:22px;padding-bottom:18px;border-bottom:1px solid #e4e9ee}
.tournament-navigation .home-link{font-weight:700;color:#155a78;text-decoration:none}
.tournament-navigation label{font-size:13px;font-weight:700;display:grid;gap:5px;min-width:min(100%,290px)}
.tournament-navigation select{width:100%;min-height:42px;border:1px solid #cbd5de;border-radius:8px;padding:8px}
#fairnessDetails>summary{cursor:pointer;font-size:1.2rem;font-weight:750;padding:8px 0}
#fairnessDetails[open]>summary{margin-bottom:12px}
body.participant-view:not(.has-tournament) #tournamentNavigation{display:none!important}
body.participant-view:not(.has-tournament) .tabs a[href='#standings'],body.participant-view:not(.has-tournament) .tabs a[href='#matches'],body.participant-view:not(.has-tournament) .tabs a[href='#fairness-section']{display:none!important}
/* Home and public discovery remain available even when no tournament is open. */
body.participant-view.has-tournament #fairness-section{margin-bottom:22px}
body.participant-view #launchPanel{display:none!important}

/* V33 public card navigation */
.public-card-link{display:block;text-decoration:none;color:inherit;cursor:pointer;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.public-card-link:hover,.public-card-link:focus-visible{transform:translateY(-4px);box-shadow:0 12px 28px rgba(15,43,62,.15);border-color:#20835c;outline-offset:3px}
.public-card-action{display:inline-block;font-weight:800;color:#116d50;margin-top:4px}
#morePublicTournaments{margin-right:8px}
#morePublicTournaments[hidden]{display:none!important}

/* V34 public rules, scoring transparency and shared-podium accessibility */
.scoring-disclosure{margin-top:20px;padding:16px;border:1px solid #dae4eb;border-radius:12px;background:#f7fafb;font-size:.92rem;color:#34495a}
.scoring-disclosure h3{font-size:1.02rem;margin:0 0 9px}.scoring-disclosure p{margin:6px 0}.scoring-disclosure a{font-weight:700}
.ranking-explanation{border:1px solid #d1dbe5;border-radius:8px;padding:10px 14px;background:#fff;color:#243c50;font-weight:600}
#howItWorks h3{margin:25px 0 6px}#howItWorks p{line-height:1.6}

#howItWorks:not(:target){display:none!important}
.podium.podium-stacked:has(.podium-place:nth-child(2).podium-1){display:flex;flex-wrap:wrap;justify-content:center;gap:16px}
.podium.podium-stacked:has(.podium-place:nth-child(2).podium-1) .podium-place{flex:1 1 190px;max-width:290px;grid-area:auto;margin:0}

.player-directory-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px;margin:16px 0}.player-directory-card{display:flex;align-items:center;gap:12px;text-align:left;padding:14px;background:#f6f9fb;color:#183149;border:1px solid #e2eaf0;border-radius:14px;cursor:pointer;transition:transform .15s,box-shadow .15s}.player-directory-card:hover{transform:translateY(-2px);box-shadow:0 8px 20px #19314b18}.player-directory-card small{display:block;color:#607083}.player-career{padding-top:12px;border-top:1px solid #dde5ea}#playerManager{border-top:1px solid #dde5ea;padding-top:16px;margin-top:20px}#playerManager label{display:block;margin:12px 0}

/* V36 player-directory and career profile refinements */
#playerDirectoryList{grid-template-columns:repeat(4,minmax(0,1fr))}.player-directory-card small{display:none}.player-directory-card{min-width:0}.player-directory-card span{min-width:0;overflow-wrap:anywhere}.player-career .profile-head h3{margin:0}.player-career .profile-head p{margin:3px 0 0}@media(max-width:780px){#playerDirectoryList{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:390px){#playerDirectoryList{grid-template-columns:1fr 1fr}.player-directory-card{padding:8px;gap:6px}}

/* V38: preserve V36 shell, header and match display. Desktop public cards have three columns. */
@media(min-width:940px){#publicDirectoryCards{grid-template-columns:repeat(3,minmax(0,1fr));}}
.tournament-pill.cancelled{background:#ffe9e9;color:#a02b31}
#playerCareer[hidden],#playerDirectoryList[hidden]{display:none!important}
#backToPlayers{margin-bottom:16px}

/* V39: mutually exclusive application screens. Navigation is not page-long scrolling. */
body.screen-home main > section, body.screen-players main > section,
body.screen-admin main > section, body.screen-setup main > section,
body.screen-results main > section, body.screen-rules main > section{display:none!important}
body.screen-home #publicDirectory{display:block!important}
body.screen-players #playersDirectory{display:block!important}
body.screen-admin #auth{display:block!important}
body.screen-setup #setup,body.screen-setup #recommendationSection{display:block!important}
body.screen-results #standings,body.screen-results #matches,body.screen-results #fairness-section{display:block!important}
body.screen-rules #howItWorks{display:block!important}
/* Keep saved match scores and leaderboard ahead of the optional fairness report. */
body.screen-results main{display:flex;flex-direction:column}
body.screen-results #standings{order:1}
body.screen-results #matches{order:2}
body.screen-results #fairness-section{order:3}
body.screen-results #fairnessDetails:not([open]){margin-bottom:0}
/* The public side never gets administrator screens or score-entry controls. */
body.participant-view.screen-setup #setup,body.participant-view.screen-admin #auth{display:none!important}
body.public-view.screen-results #standings{display:block!important}
.tabs a.is-current{background:rgba(255,255,255,.27);box-shadow:inset 0 -2px #b8e24b}

body:not(.has-tournament) .tabs a[href="#standings"],body:not(.has-tournament) .tabs a[href="#matches"],body:not(.has-tournament) .tabs a[href="#fairness-section"]{display:none!important}

/* V40: mutually exclusive panels inside a selected tournament. */
body.screen-results #standings,body.screen-results #matches,body.screen-results #fairness-section{display:none!important}
body.screen-results.result-leaderboard #standings{display:block!important}
body.screen-results.result-matches #matches{display:block!important}
body.screen-results.result-fairness #fairness-section{display:block!important}
body.public-view.screen-results:not(.result-leaderboard) #standings{display:none!important}
.podium-group-avatars{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:10px;margin:8px 0}
.podium-group-names{display:flex;flex-direction:column;align-items:center;gap:3px}
.podium-group-names b{display:block}
.podium-joint{min-width:195px}
body.screen-results.result-fairness #fairnessDetails{display:block}

/* Podium must handle missing medal places after ties, without empty grid cells. */
.podium-stacked:has(.podium-place.podium-3):not(:has(.podium-place.podium-2)){grid-template-columns:1fr;max-width:590px}
.podium-stacked:has(.podium-place.podium-3):not(:has(.podium-place.podium-2)) .podium-3{grid-column:1;grid-row:2;justify-self:center;width:min(100%,330px)}
.podium-stacked:has(.podium-place.podium-2):not(:has(.podium-place.podium-3)) .podium-2{grid-column:1/-1;justify-self:center;width:min(100%,330px)}

/* V42: navigation is visibly separated, and admin management is contextual. */
.admin-tabs{border-top:1px solid rgba(255,255,255,.26);padding-top:10px;margin-top:10px;align-items:center}
.admin-tabs-label{font-size:11px;font-weight:850;letter-spacing:.09em;color:#c7ebdc;white-space:nowrap;margin-right:6px}
.admin-tabs a{background:#206154;color:#fff;border:1px solid #54a99a}
body.screen-results #resultsContext{display:block!important}
body.screen-manage-players main > section{display:none!important}
body.screen-manage-players #managePlayers{display:block!important}
body:not(.screen-manage-players) #managePlayers{display:none!important}
#resultsContext h2{margin-bottom:12px}
#resultsContext select{max-width:570px}
@media(min-width:900px){.tournament-dashboard{grid-template-columns:repeat(3,minmax(0,1fr))}}

body.screen-results #resultsContext{order:0}
body.screen-results #resultsContext[hidden]{display:none!important}

/* V43 guided workflow, preserving V42's global layout */
#tournamentWizard .wizard-head{display:flex;justify-content:space-between;align-items:center;gap:1rem}#tournamentWizard .wizard-slots{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px}#tournamentWizard [hidden]{display:none!important}#tournamentWizard label{display:block;margin-bottom:10px}#tournamentWizard .actions{margin-top:14px}

body.screen-setup.wizard-open #tournamentWizard{display:block!important}body.screen-setup.wizard-open #setup,body.screen-setup.wizard-open #recommendationSection{display:none!important}body.participant-view #tournamentWizard{display:none!important}

/* V45: full tile is a large keyboard-accessible target; score choices remain compact. */
.tournament-tile[data-card-tournament]{cursor:pointer}.tournament-tile[data-card-tournament]:hover{transform:translateY(-2px);box-shadow:0 8px 20px rgba(0,0,0,.12)}.tournament-tile[data-card-tournament]:focus-visible{outline:3px solid #4caa96;outline-offset:2px}
.scoring-choices{display:grid;gap:10px;margin:12px 0}.scoring-option{display:flex;gap:12px;align-items:flex-start;padding:12px;border:1px solid #c8d6da;border-radius:10px;cursor:pointer}.scoring-option:has(input:checked){border-color:#1f8066;background:#edf8f3}.scoring-option:has(input:disabled){opacity:.55;cursor:not-allowed}.scoring-option input{flex:none;margin-top:5px}.scoring-option span{display:grid;gap:4px}.scoring-option small{line-height:1.5}

/* V46: custom player chooser avoids browser datalist reinitialisation/flicker. */
.wizard-player-slot{position:relative;min-width:0}.wizard-player-slot>label{display:block;font-weight:700}.wizard-player-slot>input{width:100%;box-sizing:border-box}.wizard-player-options{position:absolute;top:100%;left:0;right:0;z-index:20;max-height:230px;overflow:auto;background:#fff;border:1px solid #b8ced8;border-radius:10px;box-shadow:0 10px 20px #11243c33;padding:4px}.wizard-player-options[hidden]{display:none!important}.wizard-player-choice{display:block;width:100%;border:0;border-radius:6px;background:#fff;color:#20384b;text-align:left;padding:12px 10px;min-height:42px;cursor:pointer}.wizard-player-choice:hover,.wizard-player-choice:focus-visible{background:#e6f3ee;outline:2px solid #399d7a;outline-offset:-2px}
/* V46: clear scoring hierarchy and selection control aligned on the right. */
#tournamentWizard .scoring-option{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:18px;padding:17px 15px;min-height:76px}#tournamentWizard .scoring-option-copy{display:flex;flex-direction:column;flex:1;min-width:0;gap:7px}#tournamentWizard .scoring-option-title{display:flex;align-items:baseline;gap:7px;flex-wrap:wrap;line-height:1.4}#tournamentWizard .scoring-option-title strong{font-size:calc(1em + 2pt);font-weight:900;letter-spacing:.02em}#tournamentWizard .scoring-option-title>span{font-size:inherit;font-weight:700}#tournamentWizard .scoring-option-detail{font-size:14px;line-height:1.55;color:#34516a}#tournamentWizard .scoring-option input[type=radio]{flex:none;order:2;align-self:center;margin:0;width:18px;height:18px}
/* Never expose legacy tournament setup alongside launched match scoring. */
body.screen-results #setup,body.screen-results #recommendationSection,body.screen-results #tournamentWizard{display:none!important}

/* V47: lifecycle controls belong above the selected tournament's panels. */
body.screen-results #resultsContext #tournamentActions{display:block;margin-top:14px}
body.screen-results #resultsContext #tournamentActions[hidden]{display:none!important}
body.screen-results #resultsContext #tournamentActions .danger{min-height:44px}
body.participant-view #resultsContext #tournamentActions{display:none!important}

/* V48: launched tournaments have one results workspace, never legacy setup. */
body.launched-results-only #setup,body.launched-results-only #recommendationSection,body.launched-results-only #tournamentWizard{display:none!important}
body.launched-results-only.result-leaderboard #standings{display:block!important}

/* V49: cancellation is a primary high-contrast action, matching end tournament. */
#cancelTournament.danger{background:#164b89!important;color:#fff!important;border:1px solid #164b89!important;text-shadow:none!important}
#cancelTournament.danger:hover,#cancelTournament.danger:focus-visible{background:#103865!important;color:#fff!important}
/* V49: four visible setup stages instead of an ambiguous 1%-or-complete bar. */
.wizard-step-meter{display:flex;gap:6px;min-width:136px;align-items:center}
.wizard-meter-step{height:7px;min-width:25px;flex:1;border-radius:6px;background:#cad5df;border:1px solid #a8bbcb}
.wizard-meter-step.is-complete{background:#2f956b;border-color:#2f956b}
.wizard-meter-step.is-current{background:#1c6fc0;border-color:#1c6fc0}
#tournamentWizard .wizard-head{flex-wrap:wrap}

/* V51: wizard is the only setup surface while active; never show the legacy form. */
body.screen-setup.wizard-open main > #setup,body.screen-setup.wizard-open main > #recommendationSection{display:none!important}
body.screen-setup.wizard-open main > #tournamentWizard{display:block!important}

/* V52: live administrator workspace. Keep public and completed views tab-specific. */
body.screen-results.active-admin-workspace #standings,
body.screen-results.active-admin-workspace #matches{display:block!important}
body.screen-results.active-admin-workspace #standings{order:1}
body.screen-results.active-admin-workspace #matches{order:2}
body.screen-results.active-admin-workspace #fairness-section{display:none!important}
body.screen-results.active-admin-workspace #fixtures .fixture{scroll-margin-top:120px}

/* V53: completion gate after the last fixture, not above the scores. */
.completion-footer{margin-top:1.25rem;padding:1.1rem;border:1px solid var(--border,#c6d5e3);border-radius:12px;text-align:center}
.completion-footer button{width:100%;max-width:460px}
.completion-footer button:disabled{opacity:.48;cursor:not-allowed}
.scoring-confirm{display:flex;align-items:center;gap:.65rem;margin:.7rem 0;font-weight:650}
.scoring-confirm input{width:1.2rem;height:1.2rem;flex:none}

/* V54: restrained mobile-first polish, no modifications to scoring or ranking. */
:root{--action-blue:#164b89;--action-blue-hover:#103865;--saved-green:#176b46;--champion-gold:#d4a437}
button:not(.secondary):not(.ghost):not(.danger):not(.wizard-player-choice):not(.dashboard-filter):not(.player-link){background-color:var(--action-blue);color:#fff}
button:not(.secondary):not(.ghost):not(.danger):not(.wizard-player-choice):not(.dashboard-filter):not(.player-link):hover{background-color:var(--action-blue-hover)}
.tabs a.is-current,.tabs a[aria-current="page"]{background:#e7f2ff;color:#123b72;box-shadow:inset 0 -3px 0 #62a6ed;font-weight:850}
.tournament-tile,.tabs a,.fixture .match-side{transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease,transform .16s ease}
.fixture-saved .match-side.winning-team{background:#eaf7ee;border:1px solid #a2d6b5;border-radius:12px}
.fixture-saved .match-side.winning-team::before{content:'✓ WINNERS';display:block;color:#155e3b;font-size:11px;font-weight:850;letter-spacing:.045em;text-align:center}
.fixture-saved .match-side:not(.winning-team){border:1px solid transparent;border-radius:12px}
.podium-place.podium-1 .podium-group-avatars .avatar-large{border-color:#ebcb6a;box-shadow:0 0 0 4px rgba(212,164,55,.2),0 0 18px rgba(212,164,55,.46)}
@media(prefers-reduced-motion:no-preference){
 .podium-place.podium-1 .podium-group-avatars .avatar-large{animation:v54-champion-halo 3.8s ease-in-out infinite}
 .fixture-saved.just-saved .winning-team{animation:v54-saved .55s ease-out}
 @keyframes v54-champion-halo{0%,100%{box-shadow:0 0 0 4px rgba(212,164,55,.14),0 0 10px rgba(212,164,55,.32)}50%{box-shadow:0 0 0 7px rgba(212,164,55,.25),0 0 25px rgba(212,164,55,.65)}}
 @keyframes v54-saved{from{background:#d0f2d8}to{background:#eaf7ee}}
}
@media(max-width:650px){
 .hero .tabs.public-tabs{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;overflow:visible;width:100%}
 .hero .tabs.public-tabs a{white-space:normal;min-width:0;text-align:center;padding:8px 4px;line-height:1.25;min-height:48px;font-size:clamp(10px,2.7vw,12px)}
 .hero .tabs.admin-tabs{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;overflow:visible;width:100%}
 .hero .tabs.admin-tabs .admin-tabs-label{grid-column:1/-1;margin:0 0 2px}
 .hero .tabs.admin-tabs a{white-space:normal;min-width:0;text-align:center;padding:9px 4px;line-height:1.25;min-height:48px;font-size:clamp(10px,2.7vw,12px)}
 .hero .tabs.admin-tabs[hidden]{display:none!important}
 .fixture-saved .match-side.winning-team::before{font-size:10px}
}
@media(prefers-reduced-motion:reduce){.tournament-tile,.tabs a,.fixture .match-side{transition:none!important}.podium-place.podium-1 .avatar-large{animation:none!important}}
/* Authentication takes precedence over responsive grid layout. */
body.participant-view .hero .tabs.admin-tabs{display:none!important}

/* V55: navigable player identities, preserving original card appearance */
.podium-career-link{border:0;background:transparent;padding:3px;cursor:pointer;border-radius:50%;display:inline-flex;align-items:center;justify-content:center}
.podium-career-link:hover,.podium-career-link:focus-visible{outline:2px solid #2563eb;outline-offset:3px;transform:translateY(-1px)}
.player-link[data-career-id]{cursor:pointer}
@media(prefers-reduced-motion:reduce){.podium-career-link:hover{transform:none}}

/* V56: courtside reading scale and direct career profile (mobile-only). */
body.career-direct #playersDirectory > :not(#playerCareer){display:none!important}
body.career-direct #playersDirectory{padding-top:12px}
body.career-direct #playerCareer{padding-top:0}
.inline-fixtures{margin:18px 0 22px;border:1px solid #bcd5e7;border-radius:14px;background:#f7fbff;overflow:hidden}
.inline-fixtures>summary{padding:16px 18px;cursor:pointer;background:#165487;color:#fff;font-weight:800;font-size:17px;display:flex;align-items:center;justify-content:space-between;list-style:none;min-height:54px}
.inline-fixtures>summary::-webkit-details-marker{display:none}
.inline-fixtures[open]>summary span{transform:rotate(180deg)}
#inlineTournamentMatches{padding:10px;display:grid;gap:10px;max-height:65vh;overflow:auto}
.inline-match-card{border:1px solid #d7e4ed;background:#fff;border-radius:11px;padding:12px}
.inline-match-meta{font-size:14px;font-weight:800;color:#476376;margin-bottom:8px}
.inline-match-teams{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.inline-match-team{border:1px solid #e0e8ee;border-radius:10px;padding:10px 8px;display:flex;flex-direction:column;gap:8px;justify-content:space-between;min-width:0}
.inline-match-team span{font-size:15px;font-weight:750;overflow-wrap:anywhere}
.inline-match-team strong{font-size:23px}
.inline-match-team.inline-winning{background:#e8f6ec;border-color:#a2d6b5;color:#155e3b}
/* The existing podium halo was applied to a cropped image; animate a visible outer ring instead. */
.podium-place.podium-1 .podium-career-link{position:relative;isolation:isolate}
.podium-place.podium-1 .podium-career-link::after{content:'';position:absolute;inset:-7px;border-radius:50%;border:3px solid rgba(255,224,102,.9);pointer-events:none;box-shadow:0 0 16px 6px rgba(255,197,41,.55)}
@media(prefers-reduced-motion:no-preference){
 .podium-place.podium-1 .podium-career-link::after{animation:v56-champion-ring 2.9s ease-in-out infinite}
 @keyframes v56-champion-ring{0%,100%{transform:scale(.96);opacity:.65;box-shadow:0 0 10px 2px rgba(255,195,41,.25)}50%{transform:scale(1.15);opacity:1;box-shadow:0 0 22px 10px rgba(255,195,41,.78)}}
}
@media(prefers-reduced-motion:reduce){.podium-place.podium-1 .podium-career-link::after{animation:none!important}}
@media(max-width:650px){
 .hero h1{font-size:clamp(25px,6vw,29px)!important;line-height:1.16!important;letter-spacing:-.02em}
 .hero p{font-size:16px!important;line-height:1.35!important;margin:8px 0 10px!important}
 .hero .tabs.public-tabs a,.hero .tabs.admin-tabs a{font-size:clamp(15px,4.15vw,18px)!important;line-height:1.2!important;min-height:62px!important;padding:8px 3px!important;font-weight:800}
 .hero .tabs.public-tabs,.hero .tabs.admin-tabs{gap:5px!important}
 .dashboard-heading h2{font-size:25px}
 .tournament-tile h3{font-size:22px}
 .tournament-tile p,.dashboard-heading p{font-size:16px;line-height:1.45}
 .dashboard-filter{font-size:16px;min-height:45px}
 .rank .player-link{font-size:17px!important}
 .match-side .player-link{font-size:clamp(15px,4vw,18px)!important;line-height:1.2!important}
 .match-side .avatar{width:35px!important;height:35px!important}
 .fixture-saved .match-side.winning-team::before{font-size:12px}
 .inline-fixtures>summary{font-size:18px}
 .player-career .profile-head{display:flex;gap:15px;align-items:center;margin:14px 0}
 .player-career .profile-head .avatar-large{width:clamp(145px,39vw,185px)!important;height:clamp(145px,39vw,185px)!important;flex-shrink:0}
 .player-career .profile-head h3{font-size:26px;line-height:1.1}
 .player-career .profile-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
 .player-career .profile-stats article{padding:9px 11px;min-height:67px}
 .player-career .profile-stats small{font-size:12px;line-height:1.15}
 .player-career .profile-stats strong{font-size:clamp(23px,6vw,30px);line-height:1.12}
 .player-career #backToPlayers{min-height:48px;font-size:16px}
 /* Keep legacy select nodes for old links, but display one title and one return link. */
 #resultsContext label[for="resultsTournamentSwitch"],#tournamentNavigation label[for="publicTournamentSwitch"]{display:none!important}
 #tournamentNavigation{margin-bottom:10px;padding-bottom:10px}
}
@media(min-width:651px){#resultsContext label[for="resultsTournamentSwitch"],#tournamentNavigation label[for="publicTournamentSwitch"]{display:none!important}}

/* V57 mobile navigation: the profile is the hero, not a panel under sticky menus. */
body.career-view header.hero{position:relative!important;top:auto!important}
body.career-view #playersDirectory{scroll-margin-top:0!important}
body.career-view #playerCareer{scroll-margin-top:8px!important}
body.career-view .player-career{padding-top:0}
body.career-view .player-career .profile-head{justify-content:flex-start}
.tournament-adjacent{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:8px;align-items:center;margin:0 0 12px}
.tournament-adjacent[hidden]{display:none!important}
.tournament-adjacent button{min-height:45px;padding:8px 10px;background:#eaf2f8;color:#163c55;font-size:15px;border:1px solid #d0e0eb}
.tournament-adjacent button:disabled{opacity:.35;cursor:default}
.tournament-adjacent .adjacent-count{font-size:13px;color:#496478;font-weight:800;text-align:center}
@media(max-width:650px){.tournament-adjacent button{font-size:16px;min-height:48px}.tournament-adjacent .adjacent-count{font-size:12px}.player-career .profile-head{margin-top:7px}}

/* V58: repeat tournament browsing controls after scoring rules. */
.tournament-adjacent-bottom{margin:20px 0 2px;padding-top:14px;border-top:1px solid #d8e6ed}
