/* Compact RT Cup page, scoped to tournament components. */
#tournament-page{--tournament-line:rgba(218,166,72,.2);--tournament-gold:#f0cf7a;--tournament-muted:#9aafbf;color:#e3e9ef;padding-top:0}
#tournament-page [hidden]{display:none!important}
#tournament-page h2,#tournament-page h3,#tournament-page h4,#tournament-page p{margin:0;text-align:left}
#tournament-page button{font-family:inherit;cursor:pointer}
#tournament-page button:focus-visible,#tournament-page .tournament-board:focus-visible{outline:2px solid #e5bb59;outline-offset:3px}
.tournament-heading{display:grid;grid-template-columns:minmax(240px,1fr) auto auto;align-items:center;gap:16px;min-height:64px;margin-bottom:12px}
#tournament-page .tournament-heading p{margin-top:4px;font-size:12px;color:var(--tournament-muted)}
.tournament-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.tournament-cup{display:flex;align-items:center;gap:8px;padding:11px 12px;border:1px solid #a186494d;border-radius:8px;background:#0a1622aa;color:var(--tournament-gold);font-size:12px;font-weight:750;white-space:nowrap}
.tournament-cup small{color:#a5b4c1;font-size:10px;font-weight:500}
.tournament-controls [role=tablist]{display:flex;gap:7px}
.tournament-controls button{padding:11px 14px;color:#c4d0da;background:rgba(10,20,31,.92);border:1px solid #8da6ba30;border-radius:7px;font-size:12px;font-weight:650;white-space:nowrap}
.tournament-controls button[aria-selected=true]{border-color:#cfaa5077;color:#ffe0a0;background:linear-gradient(180deg,#b2872740,#5c471c55);box-shadow:inset 0 1px 0 #f4d47b20}
.tournament-controls button:hover{background-color:#ffffff0e;color:#ffe0a0}
#tournament-page .tournament-heading .tournament-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin:0;min-height:0}
#tournament-page .tournament-heading .tournament-toolbar button{white-space:nowrap;padding:7px 10px;border-radius:16px;font-size:10px;background:#0a1722bb}
#tournament-page .tournament-toolbar [data-refresh-tournament]>span{font-size:16px;vertical-align:-1px;margin-right:3px;color:#eac665}
.tournament-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:14px}
.tournament-stat{display:flex;align-items:center;gap:14px;min-height:60px;padding:7px 12px;border:1px solid #8ca6b333;border-radius:10px;background:linear-gradient(180deg,rgba(10,20,31,.92),rgba(6,14,22,.88));min-width:0}
.tournament-stat-icon{display:grid;place-items:center;flex:none;width:44px;height:42px;border:1px solid #b3c4ce08;border-radius:7px;background:#10233155;color:#f1c863;font-size:25px;line-height:1}
.tournament-stat>div{min-width:0}.tournament-stat small{display:block;color:var(--tournament-muted);font-size:10px;margin-bottom:4px}.tournament-stat strong{font-size:20px;color:#f3cc6e;font-weight:750;line-height:1}.tournament-stat>div>span{font-size:12px;color:#d3dee7;margin-left:4px}
.tournament-scroll-hint{display:none;color:var(--tournament-muted);font-size:10px;margin-bottom:8px!important}
.tournament-board{padding:12px 32px;border:1px solid #c59c405e;border-radius:12px;background:linear-gradient(180deg,#091722c4,#07121cd6);overflow-x:auto;overscroll-behavior-x:contain;scrollbar-color:#b394514d transparent}
.tournament-bracket{display:grid;grid-template-columns:1.15fr 1fr 1fr;gap:64px;min-width:1000px}
.tournament-round{position:relative;min-width:0}
#tournament-page .tournament-round h4{height:40px;color:var(--tournament-gold);font-family:var(--font-brand,"Cormorant Garamond",Georgia,serif);font-size:19px;line-height:21px;text-align:center;text-transform:uppercase;font-weight:700;letter-spacing:.3px}
.tournament-round h4 small{display:block;margin-top:2px;font-family:var(--font-ui,Manrope,system-ui,sans-serif);font-size:10px;line-height:14px;color:var(--tournament-muted);font-weight:400;text-transform:none;letter-spacing:0}
.tournament-round-matches{display:grid;grid-template-rows:repeat(8,45px)}
.tournament-match{position:relative;align-self:stretch;margin-bottom:8px;min-width:0;border:1px solid #8195a43d;border-radius:9px;background:linear-gradient(120deg,rgba(15,33,47,.96),rgba(7,20,30,.94))}
.tournament-round-0 .tournament-match{grid-row:span 2}.tournament-round-1 .tournament-match:first-child{grid-row:2/span 2}.tournament-round-1 .tournament-match:nth-child(2){grid-row:6/span 2}.tournament-round-2 .tournament-match{grid-row:4/span 2}
.tournament-match-heading{box-sizing:border-box;display:flex;align-items:center;justify-content:flex-start;gap:12px;height:20px;padding:1px 9px;border-bottom:1px solid #8aa3b31b;color:var(--tournament-muted);font-size:10px;line-height:16px;white-space:nowrap}
.tournament-match-heading .is-complete,.tournament-match-heading .is-ready{color:#e9bf62}
.tournament-team{display:flex;align-items:center;gap:9px;padding:2px 9px;min-height:30px;box-sizing:border-box}
.tournament-team:last-child{border-radius:0 0 8px 8px}.tournament-team+.tournament-team{border-top:1px solid #8aa3b322}
.tournament-emblem{display:grid;place-items:center;flex:none;width:25px;height:25px;border:1px solid #bca65a66;border-radius:7px;background:linear-gradient(135deg,#142c3c,#0a1d2b);font-size:17px;color:var(--tournament-gold)}
.tournament-team-info{min-width:0;flex:1}.tournament-team-info strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:14px;font-weight:700}.tournament-team-info small{display:block;margin-top:1px;font-size:9px;line-height:11px;color:var(--tournament-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tournament-score{font-size:16px;font-weight:750;color:#a9bdca;min-width:14px;text-align:right}.is-winner .tournament-score{color:#f1ce78}
.tournament-connector{position:absolute;left:100%;top:40px;width:64px;height:360px;overflow:visible;pointer-events:none}.tournament-connector path{stroke:#e3b94f;stroke-width:1.2;filter:drop-shadow(0 0 2px #d5a52a35)}
.tournament-champion{position:absolute;bottom:14px;left:0;right:0;min-height:110px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border:1px solid #bd934a99;border-radius:9px;padding:12px 24px;text-align:center;background:radial-gradient(ellipse at 50% 0,#ad843324,transparent 70%),linear-gradient(100deg,rgba(46,36,17,.93),rgba(16,28,39,.94))}
.tournament-laurel{position:absolute;left:22px;top:24px;width:24px;height:65px;color:#b49a4380;pointer-events:none}.tournament-laurel+ .tournament-laurel{left:auto;right:22px;transform:scaleX(-1)}
.tournament-champion>span{font-size:27px;line-height:1}.tournament-champion>small{color:#a9bdcc;font-size:11px}.tournament-champion>strong{color:#f2cc73;font-size:17px;line-height:1.25;z-index:1}
.tournament-section-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 0 12px}.tournament-section-heading>span{font-size:11px;color:var(--tournament-muted)}
#tournament-page h3{font-size:14px;font-weight:750;color:var(--tournament-gold)}
.tournament-rosters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.tournament-roster{padding:16px;min-width:0;border:1px solid var(--tournament-line);border-radius:10px;background:linear-gradient(180deg,rgba(10,20,31,.92),rgba(6,14,22,.88))}
#tournament-page .tournament-roster h4{display:flex;align-items:center;gap:9px;color:var(--tournament-gold);font-size:13px;margin-bottom:12px}.tournament-roster h4 span{font-size:20px}.tournament-roster ol{padding-left:22px;margin:0;color:#d4dfe7;font-size:12px}.tournament-roster li{padding:9px 0;border-bottom:1px solid #8aa3b31c;overflow-wrap:anywhere}.tournament-roster li:last-child{border:0}.tournament-roster li::marker{color:#8296a7}
.tournament-team-table-panel{margin-top:14px;padding:8px 10px 10px;border:1px solid #8ca6b333;border-radius:12px;background:linear-gradient(180deg,#091722e6,#07121cde)}
#tournament-page .tournament-team-table-panel>h3{font-family:var(--font-brand,"Cormorant Garamond",Georgia,serif);font-size:26px;line-height:30px;font-weight:700;margin:0 8px 5px}
.tournament-table-scroll{overflow-x:auto;border:1px solid #8aa3b322;border-radius:8px;scrollbar-color:#b394514d transparent}
#tournament-page .tournament-team-table{width:100%;min-width:740px;border-collapse:collapse;border-spacing:0;background:none;margin:0;font-size:12px;text-align:left}
#tournament-page .tournament-team-table th{height:27px;padding:3px 10px;color:#afc1cf;font-size:11px;font-weight:500;background:#14273688;text-transform:none;letter-spacing:0;border-bottom:1px solid #8aa3b32b}
#tournament-page .tournament-team-table td{height:28px;padding:1px 10px;border-bottom:1px solid #8aa3b31b;color:#c2d0dc;font-size:11px;white-space:nowrap;background:transparent}
#tournament-page .tournament-team-table tr:last-child td{border-bottom:0}#tournament-page .tournament-team-table tbody tr:hover{background:#ffffff06}
#tournament-page .tournament-team-table .tournament-seed{width:54px;text-align:center;font-size:12px;color:#e5cf95}
.tournament-table-team{display:flex;align-items:center;gap:8px}.tournament-table-team>button:first-child{display:flex;align-items:center;gap:12px;min-width:0;color:#edf2f5;font-size:12px;padding:0;border:0;background:none;box-shadow:none;text-align:left;transform:none}.tournament-table-team strong{font-weight:650}.tournament-table-team .tournament-emblem{width:23px;height:23px;font-size:16px}
#tournament-page .tournament-table-pencil{opacity:0;border:0;background:none;box-shadow:none;color:#bca364;padding:2px 4px;font-size:15px;line-height:1}.tournament-team-table tr:hover .tournament-table-pencil,#tournament-page .tournament-table-pencil:focus-visible{opacity:1}
#tournament-page .tournament-team-table .tournament-table-rating{font-size:13px;font-weight:700;text-align:center;color:#edf2f5}
#tournament-page [data-sort-teams]{display:flex;gap:8px;align-items:center;justify-content:center;width:100%;border:0;background:none;box-shadow:none;color:#efd071;font-size:11px;padding:0;transform:none}
.tournament-player-count{color:#afc1cf}.tournament-team-status{display:inline-flex;align-items:center;padding:2px 8px;border:1px solid #5cb47c44;border-radius:6px;background:#1a614033;color:#83d6a2;font-size:10px;font-weight:650;line-height:13px}.tournament-team-status.is-eliminated{color:#b6a9a8;background:#673f3b22;border-color:#a56d6d44}.tournament-team-status.is-waiting{color:#dfc06d;background:#916f2422;border-color:#c29b4544}.tournament-team-status.is-champion{color:#ffe0a0;background:#9f7d2433;border-color:#d7ad4f88}
@media(max-width:1180px){.tournament-heading{grid-template-columns:1fr auto}.tournament-controls{grid-column:1/-1;grid-row:2}.tournament-heading .tournament-toolbar{grid-column:2;grid-row:1}.tournament-rosters{grid-template-columns:repeat(2,minmax(0,1fr))}.tournament-board{padding-inline:18px}.tournament-summary{gap:10px}.tournament-stat{gap:8px}.tournament-stat>div>span{font-size:10px}}
@media(max-width:800px){.tournament-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.tournament-scroll-hint{display:block}.tournament-board{padding-inline:12px}.tournament-heading{gap:10px}.tournament-heading p{line-height:1.5}.tournament-stat>div>span{font-size:11px}.tournament-team-table-panel{padding:8px}.tournament-table-pencil{opacity:1!important}}
@media(max-width:480px){#tournament-page{box-sizing:border-box;padding-inline:12px}.tournament-heading{grid-template-columns:1fr}.tournament-heading .tournament-toolbar{grid-column:1;grid-row:3;justify-content:flex-end!important}.tournament-controls{gap:8px}.tournament-controls [role=tablist]{width:100%}.tournament-controls button{flex:1;padding:10px}.tournament-stat{padding:8px;min-height:65px}.tournament-stat-icon{width:30px;height:35px;font-size:20px}.tournament-stat strong{font-size:18px}.tournament-stat>div>span{display:block;margin:4px 0 0;font-size:10px}.tournament-rosters{grid-template-columns:1fr}}

/* Prototype controls and accessible dialogs. Server permissions remain authoritative. */
.tournament-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px;min-height:34px}
#tournament-admin{display:flex;align-items:center;gap:12px;color:#a5b7c5;font-size:11px}
#tournament-page .tournament-toolbar button,#tournament-page .tournament-match-heading button{border:1px solid #bc985a55;border-radius:6px;background:#152433;color:#ebce87;padding:7px 10px;font-size:11px;box-shadow:none}
#tournament-page .tournament-match-heading button{padding:2px 5px;font-size:9px;margin-left:auto}
#tournament-page .tournament-match-heading button:disabled{opacity:.45;cursor:default}
#tournament-page .tournament-team{width:100%;border:0;border-radius:0;background:transparent;color:#e3e9ef;text-align:left;box-shadow:none;font-family:inherit;line-height:normal;letter-spacing:0;text-transform:none;transform:none;transition:background-color .15s}
#tournament-page .tournament-team+.tournament-team{border-top:1px solid #8aa3b322}
#tournament-page .tournament-team.is-winner{background:linear-gradient(90deg,#c29b3215,transparent)}
#tournament-page .tournament-team:disabled{opacity:1;cursor:default;color:#8da1b1}
#tournament-page .tournament-team:not(:disabled):hover{background-color:#ffffff0c}
.tournament-average{font-size:11px;color:#a5b8c6;margin-bottom:8px}
.tournament-roster li{display:flex;flex-direction:column;gap:4px}.tournament-roster li small{color:#8fa4b4;font-size:10px}
#tournament-status{color:#e6c582;padding:12px 0;font-size:13px}
.tournament-dialog{position:fixed;inset:0;margin:auto;box-sizing:border-box;width:min(1000px,calc(100vw - 32px));max-height:90vh;padding:0;border:1px solid #b0904b80;border-radius:12px;background:#0d1926;color:#e3e9ef;box-shadow:0 24px 80px #000a;font-family:inherit;overflow:auto}
.tournament-dialog::backdrop{background:#030912b8}
.tournament-dialog.is-team-detail{width:min(560px,calc(100vw - 24px));height:fit-content;min-height:0}
#tournament-page .is-team-detail .tournament-dialog-heading{padding:14px 18px}
#tournament-page .is-team-detail .tournament-dialog-title h3{margin:0}
#tournament-page .is-team-detail .tournament-dialog-content{padding:14px 18px}
#tournament-page .is-team-detail .tournament-dialog-content>p{margin:0 0 10px}
#tournament-page .is-team-detail .tournament-detail-players{margin:0;padding-left:24px}
#tournament-page .is-team-detail .tournament-detail-players li{padding:10px 0}
#tournament-page .is-team-detail .tournament-detail-players li:last-child{border-bottom:0}
#tournament-page .is-team-detail .tournament-dialog-footer{padding:10px 18px}
#tournament-page .is-team-detail .tournament-form-error:empty{display:none}
.tournament-dialog-shell{margin:0;padding:0;background:none;border:0}
.tournament-dialog-heading{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;background:#0d1926;border-bottom:1px solid #c09b4730}
#tournament-page .tournament-dialog-heading h3{font-size:20px;color:#f0cf7a}
#tournament-page .tournament-dialog button{background:#172a3b;color:#e7cc87;border:1px solid #a6854c66;border-radius:6px;padding:9px 14px;font-size:13px;box-shadow:none;transform:none}
#tournament-page .tournament-dialog-heading button{font-size:24px;line-height:1;padding:4px 10px}
.tournament-dialog-content{padding:20px}
.tournament-dialog-content p{font-size:13px;line-height:1.6;color:#aabecd}
.tournament-editor-note{margin-bottom:16px!important}
.tournament-dialog-footer{position:sticky;bottom:0;display:flex;justify-content:flex-end;gap:10px;padding:14px 20px;background:#0d1926;border-top:1px solid #c09b4730}
#tournament-page #tournament-save{background:#b68d3033;color:#ffe1a1;border-color:#c2a052}
#tournament-page #tournament-save:disabled{opacity:.5;cursor:wait}
.tournament-edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.tournament-edit-grid fieldset,.tournament-winner-options{min-width:0;border:1px solid #9db5c13b;border-radius:8px;padding:14px}
.tournament-edit-grid legend,.tournament-winner-options legend{color:#e4c885;padding:0 6px;font-size:13px}
.tournament-edit-grid label{display:block;font-size:11px;color:#9db4c4;margin-bottom:10px}
.tournament-edit-grid input,.tournament-edit-grid select{box-sizing:border-box;display:block;width:100%;min-width:0;margin-top:5px;padding:9px;border:1px solid #8cabb24d;border-radius:5px;background:#07141f;color:#e5edf3;font-family:inherit;font-size:12px}
.tournament-edit-grid input:focus-visible,.tournament-edit-grid select:focus-visible{outline:2px solid #e5bb59;outline-offset:1px}
.tournament-confirm-reset{display:flex;align-items:flex-start;gap:8px;margin-top:18px;font-size:12px;color:#e8c68a;line-height:1.6}
.tournament-confirm-reset input,.tournament-winner-options input{accent-color:#d5ad59;flex:none;width:auto}
.tournament-form-error{padding:0 20px!important;color:#ff9898!important;font-size:12px}
.tournament-winner-options label{display:flex;align-items:center;gap:10px;margin:10px 0;font-size:14px}
.tournament-detail-players{padding-left:24px;margin:16px 0 0}
.tournament-detail-players li{padding:10px 0;border-bottom:1px solid #a6becc22;font-size:14px}.tournament-detail-players span{display:block;color:#9cb3c5;font-size:12px;margin-top:5px}
@media(max-width:650px){.tournament-edit-grid{grid-template-columns:1fr}.tournament-dialog-content{padding:14px}.tournament-dialog-heading{padding:14px}#tournament-admin{flex-direction:column;align-items:flex-start;gap:5px}.tournament-dialog{width:calc(100vw - 16px)}}

#tournament-page .tournament-roster h4 button{margin-left:auto;flex:none;border:1px solid #b99a4b55;border-radius:5px;background:#142837;color:#f0cf7a;padding:4px 8px;font-size:15px;line-height:1.1}

.tournament-dialog-title{display:flex;align-items:center;gap:10px;min-width:0}
#tournament-page .tournament-dialog-title h3{min-width:0;overflow-wrap:anywhere}
#tournament-page .tournament-dialog-heading .tournament-rename-icon{flex:none;display:grid;place-items:center;width:30px;height:30px;padding:0;border:0;border-radius:6px;background:transparent;box-shadow:none;color:#c9ac6a;font-size:20px;line-height:1}
#tournament-page .tournament-dialog-heading .tournament-rename-icon:hover{background:rgba(255,255,255,.055);color:#ffe0a0}

/* A little more room and readable type for the live tournament page. */
body[data-active-page="tournament"] .container{max-width:1560px!important;width:min(calc(100% - 48px),1560px)!important}
#tournament-page .tournament-team-info strong{font-size:13px;line-height:15px}
#tournament-page .tournament-team-info small{font-size:10px;line-height:12px}
#tournament-page .tournament-match-heading{font-size:11px}
#tournament-page .tournament-match-heading button{font-size:10px}
#tournament-page .tournament-team-table th{font-size:12px;height:31px;padding-inline:12px}
#tournament-page .tournament-team-table td{font-size:13px;height:33px;padding-inline:12px}
#tournament-page .tournament-table-team>button:first-child{font-size:13px}
#tournament-page .tournament-team-table .tournament-table-rating{font-size:14px}
#tournament-page .tournament-team-table .tournament-seed{font-size:13px}
#tournament-page [data-sort-teams]{font-size:12px}
#tournament-page .tournament-team-status{font-size:11px;line-height:15px}
#tournament-page .tournament-stat small{font-size:11px}
#tournament-page .tournament-stat>div>span{font-size:13px}
@media(max-width:1280px){body[data-active-page="tournament"] .container{width:calc(100% - 32px)!important}}
@media(max-width:480px){body[data-active-page="tournament"] .container{width:100%!important}#tournament-page .tournament-stat>div>span{font-size:11px}}

#tournament-page .tournament-round-matches{grid-template-rows:repeat(8,48px)}
#tournament-page .tournament-connector{height:384px}
#tournament-page .tournament-team{min-height:33px}

/* More separation between the two rosters in each match. */
#tournament-page .tournament-team{padding-block:7px;min-height:43px}
#tournament-page .tournament-round-matches{grid-template-rows:repeat(8,59px)}
#tournament-page .tournament-connector{height:472px}

.tournament-inline-editor{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0;max-width:100%}
#tournament-page .tournament-inline-editor input{min-width:120px;width:240px;max-width:100%;padding:5px 8px;border:1px solid #b99a4b88;border-radius:5px;background:#07141f;color:#f0cf7a;font-family:inherit;font-size:inherit;line-height:1.3}
#tournament-page .tournament-dialog-title .tournament-inline-editor input{font-size:20px;width:330px}
#tournament-page .tournament-inline-editor button{display:grid;place-items:center;flex:none;width:28px;height:28px;padding:0;border:1px solid #b99a4b55;border-radius:5px;background:#152a38;color:#edd089;font-size:17px;line-height:1;box-shadow:none;margin:0}
#tournament-page .tournament-inline-editor input:focus-visible{outline:2px solid #e5bb59;outline-offset:2px}
.tournament-inline-editor small{width:100%;color:#ffaaaa;font-size:11px;white-space:normal}
@media(max-width:480px){#tournament-page .tournament-dialog-title .tournament-inline-editor input{width:190px;font-size:17px}}

/* Consistent 20% type increase and generous roster separation. */
#tournament-page{--tournament-text-scale:1.2;--tournament-round-row:100px;--tournament-round-height:calc(var(--tournament-round-row) * 8)}
#tournament-page .tournament-heading p{font-size:calc(12px * var(--tournament-text-scale))}
#tournament-page .tournament-round h4{height:52px;font-size:calc(19px * var(--tournament-text-scale));line-height:26px}
#tournament-page .tournament-round h4 small{font-size:calc(10px * var(--tournament-text-scale));line-height:17px}
#tournament-page .tournament-round-matches{grid-template-rows:repeat(8,var(--tournament-round-row))}
#tournament-page .tournament-match{margin-bottom:20px}
#tournament-page .tournament-match-heading{height:26px;font-size:calc(11px * var(--tournament-text-scale));line-height:18px}
#tournament-page .tournament-match-heading button{font-size:calc(10px * var(--tournament-text-scale))}
#tournament-page .tournament-team{padding:16px 12px;min-height:80px;gap:12px}
#tournament-page .tournament-team-info strong{font-size:calc(13px * var(--tournament-text-scale));line-height:19px}
#tournament-page .tournament-team-info small{font-size:calc(10px * var(--tournament-text-scale));line-height:15px;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-top:3px}
#tournament-page .tournament-score{font-size:calc(16px * var(--tournament-text-scale))}
#tournament-page .tournament-connector{top:52px;height:var(--tournament-round-height)}
.tournament-connector path{vector-effect:non-scaling-stroke}
#tournament-page .tournament-emblem{width:42px;height:44px;background:none;border:0;border-radius:0}
.tournament-team-crest{display:block;width:100%;height:100%;object-fit:contain;flex:none}
#tournament-page .tournament-roster h4>span:first-child{display:block;width:36px;height:38px;flex:none}
.tournament-edit-grid legend .tournament-team-crest{display:inline-block;width:28px;height:30px;vertical-align:middle;margin-right:5px}
#tournament-page .tournament-team-table th{font-size:calc(12px * var(--tournament-text-scale));height:37px}
#tournament-page .tournament-team-table td{font-size:calc(13px * var(--tournament-text-scale));height:42px}
#tournament-page .tournament-table-team>button:first-child{font-size:calc(13px * var(--tournament-text-scale))}
#tournament-page .tournament-team-table .tournament-table-rating{font-size:calc(14px * var(--tournament-text-scale))}
#tournament-page .tournament-team-table .tournament-seed{font-size:calc(13px * var(--tournament-text-scale))}
#tournament-page [data-sort-teams]{font-size:calc(12px * var(--tournament-text-scale))}
#tournament-page .tournament-team-status{font-size:calc(11px * var(--tournament-text-scale));line-height:18px}
#tournament-page .tournament-team-table .tournament-emblem{width:30px;height:33px}
#tournament-page .tournament-team-table-panel>h3{font-size:calc(26px * var(--tournament-text-scale));line-height:36px}
#tournament-page .tournament-roster h4{font-size:calc(13px * var(--tournament-text-scale))}
#tournament-page .tournament-roster li{font-size:calc(12px * var(--tournament-text-scale))}
#tournament-page .tournament-roster li small{font-size:calc(10px * var(--tournament-text-scale))}
#tournament-page .tournament-average{font-size:calc(11px * var(--tournament-text-scale))}
#tournament-page .tournament-stat small{font-size:calc(11px * var(--tournament-text-scale))}
#tournament-page .tournament-stat strong{font-size:calc(20px * var(--tournament-text-scale))}
#tournament-page .tournament-stat>div>span{font-size:calc(13px * var(--tournament-text-scale))}
#tournament-page .tournament-dialog-heading h3{font-size:calc(20px * var(--tournament-text-scale))}
#tournament-page .tournament-detail-players li{font-size:calc(14px * var(--tournament-text-scale));padding-block:16px}
#tournament-page .tournament-detail-players span{font-size:calc(12px * var(--tournament-text-scale))}
#tournament-page .tournament-champion{min-height:160px;gap:9px}
#tournament-page .tournament-champion>strong{font-size:calc(17px * var(--tournament-text-scale))}
#tournament-page .tournament-champion>small{font-size:calc(11px * var(--tournament-text-scale))}
#tournament-page .tournament-champion>span{font-size:34px}
#tournament-page .tournament-laurel{height:85px;width:30px;top:40px}
@media(max-width:480px){#tournament-page .tournament-stat>div>span{font-size:12px}}

#tournament-page .tournament-controls button,#tournament-page .tournament-cup{font-size:calc(12px * var(--tournament-text-scale))}
#tournament-page .tournament-cup small{font-size:calc(10px * var(--tournament-text-scale))}
#tournament-page .tournament-heading .tournament-toolbar button{font-size:calc(10px * var(--tournament-text-scale))}
#tournament-page .tournament-dialog-content p{font-size:calc(13px * var(--tournament-text-scale))}
#tournament-page .tournament-edit-grid legend,#tournament-page .tournament-winner-options legend{font-size:calc(13px * var(--tournament-text-scale))}
#tournament-page .tournament-edit-grid label{font-size:calc(11px * var(--tournament-text-scale))}
#tournament-page .tournament-edit-grid input,#tournament-page .tournament-edit-grid select{font-size:calc(12px * var(--tournament-text-scale))}
#tournament-page .tournament-confirm-reset{font-size:calc(12px * var(--tournament-text-scale))}
#tournament-page .tournament-winner-options label{font-size:calc(14px * var(--tournament-text-scale))}

/* Compact roster interiors; the gap between match cards stays at 20px. */
#tournament-page .tournament-team{padding:11px 8px;min-height:64px;gap:8px}
.tournament-played{display:flex;align-items:center;gap:9px;padding:9px 12px;border:1px solid #b5994e44;border-radius:8px;background:#0a1722cc;white-space:nowrap}
.tournament-played small{font-size:11px;line-height:1.3;color:#9fb4c4;max-width:70px;white-space:normal}
.tournament-played strong{font-size:20px;line-height:1;color:#f1cf79;font-variant-numeric:tabular-nums}
.tournament-result-menu{position:fixed;z-index:10050;box-sizing:border-box;width:min(310px,calc(100vw - 16px));padding:8px;border:1px solid #b3914d88;border-radius:9px;background:#0d1b28;color:#dfe8ef;box-shadow:0 12px 32px #0008;font:13px Manrope,system-ui,sans-serif}
.tournament-result-menu>strong{display:block;padding:7px 8px 10px;color:#edcd83;font-size:13px}
.tournament-result-menu button{box-sizing:border-box;display:flex;align-items:center;gap:9px;width:100%;min-height:38px;padding:7px 8px;border:0;border-radius:5px;background:transparent;color:#e3eaf0;box-shadow:none;font:inherit;text-align:left;text-transform:none;cursor:pointer;transform:none}
.tournament-result-menu button:hover,.tournament-result-menu button[aria-pressed=true]{background:#ffffff0c;color:#ffe0a0}
.tournament-result-menu button:focus-visible{outline:2px solid #e5bb59;outline-offset:-2px}
.tournament-result-menu button:disabled{opacity:.45;cursor:default}
.tournament-result-menu button>span:nth-child(2){flex:1;min-width:0;overflow-wrap:anywhere}
.tournament-menu-crest{display:block;flex:none;width:28px;height:30px}
.tournament-result-menu .tournament-result-reset{margin-top:5px;border-top:1px solid #b2965030;border-radius:0;color:#b9c5cf;font-size:12px}
.tournament-result-menu>small{display:block;color:#9bb0c0;font-size:11px;line-height:1.5;padding:7px 8px 2px}
.tournament-result-menu [role=alert]{color:#ffa1a1;font-size:11px;line-height:1.4;padding-inline:8px}

/* Quiet winner treatment shares the palette of completed match history cards. */
.tournament-team-title{display:flex;align-items:center;gap:7px;min-width:0}
#tournament-page .tournament-team-title>strong{min-width:0;flex:0 1 auto}
#tournament-page .tournament-team.is-winner{background:radial-gradient(circle at 8% 24%,rgba(125,197,88,.14),transparent 34%),linear-gradient(90deg,rgba(48,90,43,.24),rgba(12,22,29,.64) 78%);box-shadow:inset 2px 0 0 rgba(128,202,91,.6),inset 0 0 0 1px rgba(128,202,91,.1)}
#tournament-page .tournament-team.is-winner:hover{background-color:rgba(125,197,88,.035)}
.tournament-winner-badge{flex:none;display:inline-flex;align-items:center;white-space:nowrap;padding:2px 6px;border:1px solid rgba(128,202,91,.28);border-radius:10px;background:rgba(48,90,43,.23);color:#89d66a;font-size:11px;line-height:14px;font-weight:650}
#tournament-page .tournament-team.is-winner .tournament-score,#tournament-page .tournament-match-heading .is-complete{color:#89d66a}

/* Split the match body evenly; nickname wrapping cannot change row heights. */
#tournament-page .tournament-match{display:grid;grid-template-rows:26px repeat(2,minmax(0,1fr))}
#tournament-page .tournament-match>.tournament-team{height:100%;min-height:0;align-self:stretch}
#tournament-page .tournament-team-title{min-height:20px}
#tournament-page .tournament-team-info small{min-height:30px}

/* Best-of-three score editor stays within the compact result menu. */
.tournament-score-input{display:flex;align-items:center;gap:8px;padding:8px;color:#e3eaf0;font-size:13px}
.tournament-score-input>span:nth-child(2){flex:1;min-width:0;overflow-wrap:anywhere}
.tournament-score-input input{box-sizing:border-box;width:49px;min-width:49px;padding:7px 4px;border:1px solid #b7994e66;border-radius:5px;background:#07141f;color:#f0cf7a;font-family:inherit;font-size:17px;text-align:center;accent-color:#d5ad59}
.tournament-score-input input:focus-visible{outline:2px solid #e5bb59;outline-offset:1px}
.tournament-score-presets{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;padding:6px 8px}
.tournament-result-menu .tournament-score-presets button{justify-content:center;min-height:29px;padding:4px;border:1px solid #9fb6c233;font-size:12px}
.tournament-score-actions{display:flex;gap:8px;padding:6px 8px;border-top:1px solid #b2965030}
.tournament-result-menu .tournament-score-actions button{justify-content:center;min-height:32px;font-size:12px}
.tournament-result-menu [data-score-save]{background:#b4903030;border:1px solid #b4903060;color:#f1d189}

/* Independent crest selection, shared by team details, roster cards and team table. */
#tournament-page .tournament-emblem-trigger{display:block;flex:none;width:38px;height:40px;margin:0;padding:1px;border:1px solid transparent;border-radius:6px;background:none;box-shadow:none;line-height:1;transform:none}
#tournament-page button.tournament-emblem-trigger:hover{border-color:#bca15c88;background:#ffffff08}
#tournament-page .tournament-team-table .tournament-emblem-trigger{width:30px;height:33px}
#tournament-page .tournament-table-team>.tournament-name-link{display:block;border:0;padding:0;background:none;box-shadow:none;color:#edf2f5;font-size:calc(13px * var(--tournament-text-scale));text-align:left;transform:none}
.tournament-emblem-menu{position:fixed;z-index:10060;box-sizing:border-box;width:min(350px,calc(100vw - 24px));padding:12px;border:1px solid #b3955588;border-radius:10px;background:#0d1b28;color:#e3edf4;box-shadow:0 12px 32px #0008;font:12px Manrope,system-ui,sans-serif}
.tournament-emblem-menu>strong{display:block;font-size:14px;color:#efd28a;margin-bottom:10px}
.tournament-emblem-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
#tournament-page .tournament-emblem-options button,.tournament-emblem-options button{display:flex;flex-direction:column;align-items:center;gap:5px;box-sizing:border-box;width:100%;min-height:86px;margin:0;padding:7px 3px;border:1px solid #9eb7c32b;border-radius:6px;background:#142533;color:#c8d7e2;box-shadow:none;font:11px Manrope,system-ui,sans-serif;line-height:1.3;text-transform:none;cursor:pointer;transform:none}
.tournament-emblem-options .tournament-team-crest{width:40px;height:43px}
#tournament-page .tournament-emblem-options button[aria-pressed=true],.tournament-emblem-options button[aria-pressed=true]{border-color:#e0b957;background:#a7872e25;color:#ffe1a0}
#tournament-page .tournament-emblem-options button:hover,.tournament-emblem-options button:hover{background-color:#ffffff0c}
.tournament-emblem-options button:focus-visible{outline:2px solid #e5bb59;outline-offset:1px}
.tournament-emblem-options button:disabled{opacity:.5;cursor:wait}
.tournament-emblem-menu>small{display:block;margin-top:10px;color:#99b0c0;font-size:11px;line-height:1.5}
.tournament-emblem-menu [role=alert]{color:#ffa1a1;font-size:11px;line-height:1.4;margin-top:5px}

#tournament-page .tournament-roster h4>.tournament-emblem-trigger,#tournament-page .tournament-dialog-heading .tournament-emblem-trigger{flex:none;margin:0;padding:1px;border:1px solid transparent;background:none;box-shadow:none;width:38px;height:40px}

/* Signups are separate from the bracket and team editor. */
.tournament-participants-panel{padding:20px;border:1px solid #8ca6b333;border-radius:12px;background:linear-gradient(180deg,#091722e8,#07121ce8)}
.tournament-participation-action,.tournament-participant-editor{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:16px 0;color:#aabecd;font-size:14px}
.tournament-participant-editor[hidden]{display:none}
#tournament-page .tournament-participants-panel button{padding:9px 14px;border:1px solid #b3925366;border-radius:7px;background:#b2872726;color:#f2d28b;font:inherit;font-size:14px}
#tournament-page .tournament-participants-panel button:disabled{opacity:.5;cursor:wait}
.tournament-participant-editor select{max-width:100%;min-width:220px;padding:9px 12px;background:#0d1c29;border:1px solid #8ca6b344;border-radius:6px;color:#e4eaf0;font:inherit}
.tournament-participation-action .is-registered,.tournament-you{color:#89d66a}
.tournament-you{font-size:12px;margin-left:8px}
.tournament-participant-empty{padding:24px 0;color:#aabecd;font-size:15px}
@media(max-width:650px){.tournament-controls [role=tablist]{flex-wrap:wrap}.tournament-participants-panel{padding:14px}.tournament-participant-editor select{min-width:0;width:100%}}

.tournament-draw-actions{display:flex;flex-direction:column;align-items:flex-start;gap:8px;flex-basis:100%;padding-top:8px}
.tournament-draw-actions small{color:#aabecd;font-size:13px;line-height:1.5}
.tournament-draw-confirm{display:flex;align-items:center;gap:8px;font-size:13px;color:#e7c681}
.tournament-draw-confirm input{accent-color:#d5ad59}
#tournament-page .tournament-empty-slot td{color:#718594;height:44px}
#tournament-page .tournament-participant-editor select:disabled{opacity:.6}

/* Align the title row with the leaderboard and team setup headers. */
body[data-active-page="tournament"] header{margin-bottom:0!important}
#tournament-page .tournament-title{display:flex;align-items:center;min-height:64px;padding:0;box-sizing:border-box}
#tournament-page .tournament-heading{margin-bottom:0}
#tournament-page .tournament-description{margin:0 0 var(--page-section-spacing,9.648px);color:var(--tournament-muted);font-size:14px;line-height:1.5}
#tournament-page #tournament-title::before,#tournament-page #tournament-title::after{content:none;display:none}
@media(max-width:1180px){#tournament-page .tournament-title{min-height:56px;padding:12px}}

#tournament-page .tournament-participants-panel [data-sort-participants]{display:inline-flex;align-items:center;gap:8px;margin:0;padding:6px 0;border:0;border-radius:3px;background:none;box-shadow:none;color:inherit;font:inherit;cursor:pointer;text-align:left}
#tournament-page .tournament-participants-panel [data-sort-participants]:hover,#tournament-page .tournament-participants-panel th[aria-sort="ascending"],#tournament-page .tournament-participants-panel th[aria-sort="descending"]{color:#efd071}
[data-sort-participants] span{font-size:10px;opacity:.8}
