:root{color-scheme:dark;font-family:Arial,Helvetica,sans-serif;background:#10131b;color:#fff}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;touch-action:manipulation;border:1px solid #4b5261;border-radius:8px;background:#252b37;color:#fff;padding:8px 12px;min-height:38px;font-size:14px}button:disabled{opacity:.38;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #55c5ff;outline-offset:2px}.primary{background:#d7193f;color:#fff;border-color:#ef4463}.app{height:100vh;height:100dvh;display:flex;flex-direction:column;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);min-height:320px}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 14px;min-height:54px;flex-shrink:0;background:#10131b}.brand{font-size:16px;font-weight:800;white-space:nowrap;color:#fff}.brand b,.screen-brand b{color:#9aec58}.toolbar nav{display:flex;gap:6px}.board{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) clamp(120px,16vw,270px) minmax(0,1fr);grid-template-rows:minmax(0,1fr)}.team{position:relative;overflow:hidden;isolation:isolate;container-type:size;background:var(--team-bg,#d7193f);color:var(--team-fg,#fff);min-width:0;min-height:0}.team.visual-left{grid-column:1;grid-row:1}.team.visual-right{grid-column:3;grid-row:1}.crest-background{position:absolute;z-index:-1;pointer-events:none;object-fit:contain;width:135%;height:140%;left:-64%;top:-20%;transform:rotate(-9deg);mix-blend-mode:multiply;opacity:.48}.team.visual-right .crest-background{left:24%;transform:rotate(9deg)}.team-content{height:100%;width:82%;margin-left:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:9px 8px}.team.visual-right .team-content{margin-left:0;margin-right:auto}.team h1{font-size:clamp(16px,min(4.7cqw,8cqh),48px);line-height:1.1;text-align:center;font-weight:800;margin:0;overflow-wrap:anywhere;width:100%;max-height:24cqh;overflow:hidden}.score{color:inherit;background:transparent;border:0;padding:0;min-height:0;line-height:.96;font-weight:900;font-variant-numeric:tabular-nums;letter-spacing:-.055em;font-size:min(59cqw,58cqh);width:100%;text-align:center;flex-shrink:1;user-select:none;-webkit-user-select:none}.score.three-digits{font-size:min(43cqw,58cqh)}.score:disabled{opacity:1}.minus{color:inherit;background:transparent;border:1px solid currentColor;width:46px;min-height:32px;padding:0;line-height:1;font-size:27px}.serve{font-size:12px;letter-spacing:1.5px;color:inherit;background:transparent;border:0;padding:4px 7px;min-height:24px}.serve:not(.active){opacity:.45}.match-center{grid-column:2;grid-row:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;background:#10131b;padding:12px 6px;min-width:0;min-height:0}.timer{font-variant-numeric:tabular-nums;letter-spacing:1px;font-size:clamp(18px,2.1vw,40px);background:none;border:0;padding:3px;min-height:28px;color:#fff}.timer:disabled{opacity:1}.timer.running{color:#9aec58}.sets{display:flex;align-items:center;gap:10px;font-size:clamp(38px,5.2vw,100px);font-weight:800;line-height:1;font-variant-numeric:tabular-nums}.divider{font-size:.5em;font-weight:400;color:#a2aabc}.set-label{font-size:clamp(14px,1.4vw,27px);letter-spacing:1.2px}.history{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;max-height:24%;overflow:auto;font-size:clamp(12px,1vw,20px);color:#c3cbd8;flex-shrink:1}.set-chip{white-space:nowrap;line-height:1.5}.set-chip b{color:#fff;padding-left:4px}.set-chip.current{border-bottom:2px solid #9aec58}.set-navigation{display:flex;flex-direction:column;gap:5px;margin-top:4px}.set-navigation button{font-size:13px;background:none;border-color:#424956;padding:6px 8px;min-height:34px}.footer{display:flex;align-items:center;justify-content:space-between;min-height:42px;padding:4px 13px;background:#10131b;gap:10px;flex-shrink:0}.screen-brand{font-weight:700;font-size:13px;letter-spacing:1px}.footer-controls{display:flex;align-items:center;gap:6px}.footer-controls>span{font-size:12px;color:#a4afc0}.footer button{min-height:32px;font-size:13px;padding:5px 10px}.clean .toolbar,.clean .footer-controls,.clean .minus,.clean .set-navigation{display:none}.clean .score{font-size:min(63cqw,77cqh)}.clean .score.three-digits{font-size:min(44cqw,77cqh)}.clean .serve:not(.active){visibility:hidden}.clean .serve{font-size:clamp(12px,1.4vw,26px)}.clean .team h1{font-size:clamp(19px,min(5cqw,8cqh),55px)}.clean .footer{justify-content:center;min-height:34px}.clean .screen-brand{font-size:clamp(12px,1vw,21px)}.clean .score{pointer-events:none}.clean .team-content{gap:6px}.clean .history{max-height:40%}#exitClean{position:fixed;right:12px;top:12px;z-index:5;background:#222b3eef}#toast{position:fixed;bottom:40px;left:50%;transform:translateX(-50%);z-index:20;max-width:90%;background:#fff;color:#162035;border-radius:8px;padding:12px 18px;font-size:14px;opacity:0;pointer-events:none}#toast.show{opacity:1}[hidden]{display:none!important}
/* The same scoreboard rotates with the device; the centre stays between the teams. */
@media(orientation:portrait){.app{min-height:550px}.toolbar{flex-direction:column;gap:6px;padding:8px}.brand{font-size:14px}.toolbar nav{width:100%;justify-content:center;flex-wrap:wrap;gap:4px}.toolbar button{font-size:12px;padding:7px 9px;min-height:34px}.board{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 138px minmax(0,1fr)}.team.visual-left{grid-column:1;grid-row:1}.team.visual-right{grid-column:1;grid-row:3}.match-center{grid-column:1;grid-row:2;padding:6px;gap:4px}.team-content{width:75%;padding:7px}.team h1{font-size:clamp(17px,min(5cqw,10cqh),30px)}.score{font-size:min(61cqw,59cqh)}.sets{font-size:34px;gap:12px}.timer{font-size:18px;min-height:21px;padding:0}.set-label{font-size:12px}.history{max-height:27px;gap:9px;font-size:12px}.set-navigation{flex-direction:row;gap:16px;margin:0}.set-navigation button{font-size:12px;min-height:25px;padding:3px 7px}.footer{min-height:35px;padding:3px 8px}.screen-brand{font-size:10px}.footer-controls>span{display:none}.footer button{font-size:11px;min-height:29px;padding:4px 7px}.serve{font-size:11px;min-height:20px}.minus{width:42px;min-height:29px;font-size:24px}.clean .board{grid-template-rows:minmax(0,1fr) 108px minmax(0,1fr)}.clean .history{max-height:32px}.clean .score{font-size:min(67cqw,77cqh)}.clean .score.three-digits{font-size:min(43cqw,77cqh)}.clean .team h1{font-size:clamp(18px,5cqw,34px)}.clean .footer{min-height:26px}}
@media(max-height:500px) and (orientation:landscape){.toolbar{min-height:45px;padding:5px 8px;gap:5px}.brand{font-size:12px}.toolbar button{font-size:12px;padding:6px 8px;min-height:32px}.toolbar nav{gap:4px}.footer{min-height:34px;padding:2px 8px}.footer-controls>span{display:none}.match-center{gap:5px;padding:7px 4px}.timer{font-size:17px;min-height:22px}.sets{font-size:38px}.set-label{font-size:12px}.history{font-size:11px;gap:4px}.set-navigation{gap:4px}.set-navigation button{font-size:12px;min-height:29px;padding:4px 7px}.team h1{font-size:17px}.serve{font-size:10px;min-height:18px;padding:2px}.minus{min-height:28px;font-size:24px}.team-content{padding:7px 4px}.clean .team h1{font-size:20px}.clean .score{font-size:min(63cqw,76cqh)}.clean .footer{min-height:25px}}
dialog{width:min(640px,94vw);max-height:92vh;max-height:92dvh;border:1px solid #626b7c;border-radius:16px;background:#151b27;color:#fff;padding:22px;box-shadow:0 20px 90px #0009}dialog::backdrop{background:#040813d9}dialog header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}dialog h2{font-size:23px;margin:0}dialog header button{font-size:25px;padding:2px 11px}dialog p,dialog li{font-size:15px;line-height:1.5;color:#cbd3df}dialog li{margin-bottom:12px}label{display:flex;flex-direction:column;gap:7px;margin:12px 0;font-size:15px}input,select{width:100%;min-width:0;padding:11px;border:1px solid #596477;border-radius:8px;background:#242d3d;color:#fff;font-size:16px}input[type=color]{width:100%;height:48px;padding:4px}.check{flex-direction:row;align-items:center;justify-content:flex-start;gap:12px}.check input{width:22px;height:22px;accent-color:#d7193f;flex-shrink:0}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:15px}.wide{width:100%;margin-top:12px}.hint{font-size:13px!important;color:#b4bfce!important}.error{color:#ffb5b5;font-size:14px}.team-list{max-height:230px;overflow:auto;border-top:1px solid #485163;border-bottom:1px solid #485163}.team-row{display:flex;align-items:center;gap:9px;padding:8px 0;border-bottom:1px solid #394250;font-size:14px}.team-row img{width:32px;height:32px;object-fit:contain;background:#fff;border-radius:5px}.team-row span{flex:1;min-width:0;overflow-wrap:anywhere}.team-row button{font-size:12px;padding:6px 8px;min-height:34px}.connection-status{padding:13px;background:#28364b;color:#b7f58d;border-radius:8px;font-size:15px}@media(max-width:420px){.form-grid{grid-template-columns:1fr;gap:0}dialog{padding:16px}.team-row{gap:5px}.team-row button{font-size:11px;padding:5px}}
.clean .serve:disabled{opacity:1}.clean .score{font-size:min(64cqw,77cqh)}.clean .score.three-digits{font-size:min(44cqw,77cqh)}
@media(orientation:portrait) and (max-height:650px){.board{grid-template-rows:minmax(0,1fr) 120px minmax(0,1fr)}.team-content{padding:4px;gap:0}.team h1{font-size:14px}.score{font-size:min(61cqw,51cqh)}.minus{min-height:24px;height:24px;font-size:20px}.serve{font-size:10px;min-height:17px;padding:2px}.match-center{gap:2px;padding:3px}.sets{font-size:30px}.history{max-height:20px}.set-navigation button{min-height:23px}.clean .score{font-size:min(67cqw,73cqh)}}

/* Centred team typography: both sides use the full team area, independently of the crest. */
.team-content,.team.visual-right .team-content{width:100%;margin:0;padding:10px 12px;gap:4px}
.team h1,.clean .team h1{font-size:clamp(19px,min(6.5cqw,10cqh),66px);line-height:1.05;width:100%;text-align:center;max-height:23cqh}
.score{font-family:Arial,Helvetica,sans-serif;font-size:min(90cqw,60cqh);line-height:.91;letter-spacing:0;transform:scale(.78,1.08);transform-origin:center;flex-shrink:0}
.score.three-digits{font-size:min(62cqw,60cqh)}
.clean .score{font-size:min(95cqw,80cqh);line-height:.9;transform:scale(.78,1.08)}
.clean .score.three-digits{font-size:min(62cqw,80cqh)}
.crest-background{width:116%;height:116%;left:-32%;top:-8%;transform:rotate(-5deg);opacity:.55}
.team.visual-right .crest-background{left:16%;transform:rotate(5deg)}
@media(max-height:500px) and (orientation:landscape){.team-content,.team.visual-right .team-content{padding:6px 8px;gap:2px}.team h1{font-size:clamp(18px,min(6.5cqw,9cqh),26px)}.clean .team h1{font-size:clamp(22px,min(6.5cqw,10cqh),34px)}}
@media(orientation:portrait){.team-content,.team.visual-right .team-content{padding:7px 10px;gap:2px}.team h1{font-size:clamp(18px,min(6.6cqw,10cqh),34px)}.score{font-size:min(90cqw,58cqh)}.score.three-digits{font-size:min(62cqw,58cqh)}.clean .score{font-size:min(95cqw,77cqh)}.clean .score.three-digits{font-size:min(62cqw,77cqh)}}
@media(orientation:portrait) and (max-height:650px){.team-content,.team.visual-right .team-content{padding:4px 8px;gap:0}.team h1{font-size:clamp(15px,10cqh,19px)}.score{font-size:min(90cqw,49cqh)}.score.three-digits{font-size:min(62cqw,49cqh)}.clean .score{font-size:min(95cqw,72cqh)}}
.score,.clean .score{transform:none}.score-number{display:block;width:100%;transform:scale(.78,1.08);transform-origin:center;pointer-events:none}
.score{position:relative;height:.91em}.score-number{position:absolute;left:50%;top:50%;display:block;width:max-content;white-space:nowrap;transform:translate(-50%,-50%) scale(.78,1.08);line-height:.91;}

/* Offline heavy condensed names and a readable crest on dark shirt colours. */
@font-face{font-family:RDK Condensed;src:url('assets/fonts/BarlowCondensed-Black.ttf') format('truetype');font-weight:900;font-style:normal;font-display:swap}
.team h1,.clean .team h1{font-family:RDK Condensed,Arial,sans-serif;font-weight:900;font-size:clamp(20px,min(8cqw,12cqh),86px);line-height:.98;max-height:26cqh;text-shadow:0 1px 2px #0003}
.team.dark-crest .crest-background{mix-blend-mode:screen;filter:grayscale(1) invert(1);opacity:.62}
.match-center{justify-content:flex-start;padding-top:clamp(8px,4vh,48px);gap:6px}
.history,.clean .history{flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;align-items:stretch;max-height:none;min-height:0;width:90%;gap:3px;overflow:auto}
.set-chip{display:flex;justify-content:space-between;gap:8px;border-bottom:1px solid #ffffff20;font-variant-numeric:tabular-nums}
.set-chip b{padding-left:0}
.set-navigation{flex-shrink:0}
.summary{flex:1;min-height:0;overflow:auto;padding:16px clamp(16px,8vw,180px);text-align:center;background:radial-gradient(ellipse at top,#4b1422,#10131b 65%)}
.summary h2{margin:0 0 12px;font-size:clamp(16px,2vw,36px);letter-spacing:3px}
.summary-teams{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:20px}
.summary-teams>div{min-width:0}
.summary-teams img{width:clamp(64px,12vh,170px);height:clamp(64px,12vh,170px);object-fit:contain;background:#fff;border-radius:12px;padding:8px}
.summary h3{font-family:RDK Condensed,Arial,sans-serif;font-weight:900;font-size:clamp(22px,3vw,55px);line-height:1;margin:8px 0;overflow-wrap:anywhere}
.summaryTotal,#summaryTotal{font-size:clamp(44px,8vw,140px);white-space:nowrap}
.summary-table{max-width:850px;margin:12px auto}
.summary table{border-collapse:collapse;width:100%;font-size:clamp(17px,2.3vw,40px);font-variant-numeric:tabular-nums}
.summary th,.summary td{padding:6px 12px;border-bottom:1px solid #ffffff25}
.summary thead{font-size:.65em;color:#bdc5d2}
.summary tbody th{font-size:.65em;color:#bdc5d2;text-align:left}
.summary td{width:35%;font-weight:700}
.summary .won{color:#9aec58}
.summary-actions{display:flex;justify-content:center;gap:8px}
.clean .summary-actions{display:none}
#summaryTime{color:#bdc5d2;font-variant-numeric:tabular-nums}
@media(orientation:portrait){
 .board{grid-template-rows:minmax(0,1fr) calc(119px + var(--history-rows,0)*19px) minmax(0,1fr)}
 .clean .board{grid-template-rows:minmax(0,1fr) calc(91px + var(--history-rows,0)*19px) minmax(0,1fr)}
 .match-center{padding:4px 6px;gap:2px}
 .history,.clean .history{width:142px;gap:1px;font-size:12px}
 .set-chip{line-height:17px}
 .team h1,.clean .team h1{font-size:clamp(18px,min(8cqw,13cqh),42px)}
 .summary{padding:18px 12px}
 .summary-teams{gap:10px}
 .summary h3{font-size:26px}
 .summary th,.summary td{padding:10px}
 .footer{flex-wrap:wrap;justify-content:center;gap:3px}
 .footer-controls{gap:4px}
 .footer button{font-size:10px;padding:4px}
}
@media(max-height:500px) and (orientation:landscape){
 .match-center{padding-top:5px;gap:3px}
 .history{font-size:11px;gap:1px}
 .set-chip{line-height:16px}
 .set-navigation button{min-height:24px;padding:2px 5px}
 .summary{padding-top:8px;padding-bottom:8px}
 .summary h2{margin-bottom:4px}
 .summary-teams img{height:54px;width:54px}
 .summary h3{font-size:24px;margin:3px 0}
 .summary-table{margin:5px auto}
 .summary th,.summary td{padding:3px 10px}
 #summaryTime{margin:6px}
}

/* Each team reaches the midline. Controls float over both shirt colours. */
.board{position:relative;--center-width:clamp(120px,16vw,270px);grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.team.visual-left{grid-column:1;grid-row:1}
.team.visual-right{grid-column:2;grid-row:1}
.team-content,.team.visual-right .team-content{container-type:size;width:calc(100% - var(--center-width)/2);height:100%;margin:0}
.team.visual-right .team-content{margin-left:auto}
.match-center{position:absolute;z-index:2;left:50%;top:0;bottom:0;transform:translateX(-50%);width:var(--center-width);grid-column:auto;grid-row:auto;background:transparent}
.match-center .timer,.set-label,.history,.set-navigation{background:#10131be8;border-radius:6px;padding:3px 6px;color:#fff}
.sets{width:100%;justify-content:center;gap:0}
.sets>span:not(.divider){width:50%;text-align:center}
#setsLeft{color:var(--ink0)}#setsRight{color:var(--ink1)}
.sets .divider{position:absolute;color:#fff;text-shadow:0 1px 3px #000}
.history,.clean .history{width:94%}
.crest-background{width:120%;height:116%;left:-20%}
.team.visual-right .crest-background{left:0}
.summary-teams{max-width:950px;margin:0 auto;gap:clamp(10px,2vw,28px)}
.summary-table{width:max-content;max-width:100%;margin:18px auto}
.summary table{width:auto;min-width:min(360px,85vw)}
.summary td{width:auto;min-width:90px}
.summary th,.summary td{padding:6px 20px}
@media(orientation:portrait){
 .board,.clean .board{--center-height:calc(119px + var(--history-rows,0)*19px);grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) minmax(0,1fr)}
 .clean .board{--center-height:calc(91px + var(--history-rows,0)*19px)}
 .team.visual-left{grid-column:1;grid-row:1}
 .team.visual-right{grid-column:1;grid-row:2}
 .team-content,.team.visual-right .team-content{width:100%;height:calc(100% - var(--center-height)/2);margin:0}
 .team.visual-right .team-content{margin-top:calc(var(--center-height)/2)}
 .match-center{left:0;top:50%;bottom:auto;transform:translateY(-50%);width:100%;height:var(--center-height)}
 .match-center .sets{width:140px}
 .sets{background:linear-gradient(90deg,var(--side0) 50%,var(--side1) 50%);border-radius:6px}
 .history,.clean .history{width:154px}
 .match-center .timer,.set-label{padding:0 6px}
 .set-navigation{padding:0 4px}
 .summary-teams{gap:8px}
 .summary th,.summary td{padding:7px 12px}
}
@media(max-height:500px) and (orientation:landscape){
 .match-center .timer,.set-label{padding:0 4px}
 .summary th,.summary td{padding:3px 14px}
}

.app-version{font-size:.7em;font-weight:600;letter-spacing:0;color:#cbd3df;white-space:nowrap}.summary-teams{align-items:start}.summary-teams>strong{align-self:center}

/* TV/full-screen brand overlays the board; it no longer reserves a bottom strip. */
.clean .app{position:relative}
.clean .footer{position:absolute;z-index:3;left:50%;bottom:env(safe-area-inset-bottom,0px);transform:translateX(-50%);width:max-content;max-width:95%;min-height:0;padding:4px 10px;background:#fff;border-radius:4px 4px 0 0;pointer-events:none}
.clean .screen-brand{color:#10131b;white-space:nowrap;line-height:1.2}
.clean .screen-brand b{color:#218739}
.clean .screen-brand .app-version{color:#394150}
.clean .summary{padding-bottom:40px}

/* Full-screen operation on the handset; the external display stays read-only. */
.clean.full-controls .score{pointer-events:auto;font-size:min(95cqw,61cqh)}
.clean.full-controls .score.three-digits{font-size:min(62cqw,61cqh)}
.clean.full-controls .minus{display:block;flex-shrink:0}
.clean.full-controls .set-navigation{display:flex}
.clean.full-controls .summary-actions{display:flex}
.clean.full-controls .serve{font-size:12px;min-height:20px}
.clean.full-controls .team-content{gap:3px}
#exitClean{font-size:12px;min-height:32px;padding:6px 10px}
@media(orientation:portrait){.clean.full-controls .board{--center-height:calc(119px + var(--history-rows,0)*19px)}.clean.full-controls .score{font-size:min(95cqw,58cqh)}}

/* Stable score columns and compact two-lane point histories. */
.set-chip{display:grid;grid-template-columns:1fr auto;align-items:center;text-align:left}
.history-score{display:grid;grid-template-columns:3ch 1ch 3ch;text-align:center;gap:0;font-variant-numeric:tabular-nums}
.summary-table{width:min(100%,1100px);overflow-x:auto}
.summary table{width:100%;min-width:0;table-layout:fixed}
.summary th:first-child{width:66px;white-space:nowrap}
.summary th:nth-child(2),.summary th:nth-child(3){width:72px}
.summary th,.summary td{padding:7px 8px;min-width:0;vertical-align:middle}
.summary .sequence-cell{text-align:left;padding-left:18px}
.summary .sequence-heading{text-align:left;padding-left:18px;font-size:12px;letter-spacing:.3px}
.point-sequence{display:flex;flex-wrap:wrap;align-items:center;align-content:center;gap:4px 1px;min-height:34px}
.point-column{display:grid;grid-template-rows:16px 16px;flex:0 0 auto;min-width:16px}
.point-chip{display:block;min-width:16px;height:16px;padding:0 2px;border-radius:2px;line-height:16px;text-align:center;font:700 12px/16px Arial,sans-serif;box-shadow:inset 0 0 0 1px #8886}
.point-top{grid-row:1}.point-bottom{grid-row:2}
.sequence-note{font:400 11px/1.3 Arial,sans-serif;color:#aeb7c6;width:100%}
@media(max-width:600px){
 .summary th:first-child{width:47px}
 .summary th:nth-child(2),.summary th:nth-child(3){width:40px}
 .summary th,.summary td{padding:7px 3px}
 .summary .sequence-cell,.summary .sequence-heading{padding-left:8px}
 .summary .sequence-heading{font-size:9px}
 .point-column{min-width:14px;grid-template-rows:15px 15px}
 .point-chip{min-width:14px;height:15px;font-size:11px;line-height:15px}
}

.summary th:first-child{width:90px}.summary tbody th{font-size:clamp(11px,1.2vw,23px)}
@media(max-width:600px){.summary th:first-child{width:47px}}


.toolbar nav{flex-wrap:wrap;justify-content:flex-end}
.summary-actions{flex-wrap:wrap}
.archive-list{margin-top:16px;display:grid;gap:10px}
.archive-row{padding:12px;border:1px solid #485163;border-radius:10px;background:#1c2433;text-align:left}
.archive-row strong{display:block;overflow-wrap:anywhere}
.archive-row small{display:block;color:#b4bfce;margin:6px 0 10px}
.archive-actions{display:flex;gap:6px;flex-wrap:wrap}
.archive-actions button{font-size:12px}
#archiveDetailDialog{width:min(1200px,96vw);padding:16px}
#archiveDetailTitle{font-size:20px;overflow-wrap:anywhere}
#archiveDetail{padding:10px;overflow:visible}
#archiveDetail .summary-teams img{width:80px;height:80px}
#archiveDetail .summary-teams h3{font-size:clamp(20px,3vw,36px)}
#archiveDetail .summaryTotal{font-size:clamp(38px,6vw,80px)}

/* Approved compact summary. */

.summary{padding:18px 20px 36px}
.summary-table{width:100%;max-width:1100px;margin:14px auto}
.summary th:first-child{width:52px}
.summary th:nth-child(2),.summary th:nth-child(3){width:36px}
.summary th,.summary td{padding:12px 2px}
.summary tbody th{font-size:13px}
.summary table{font-size:24px}
.summary thead{font-size:12px}
.summary .sequence-cell,.summary .sequence-heading{padding-left:14px}
.summary .sequence-heading{font-size:11px}
.point-sequence{container-type:inline-size;display:grid;grid-template-columns:repeat(var(--points),minmax(0,1fr));gap:0 1px;min-height:36px;max-width:calc(var(--points)*18px)}
.point-column{min-width:0;display:grid;grid-template-rows:18px 18px}
.point-chip{min-width:0;width:100%;height:18px;padding:0;font-size:min(12px,calc(100cqw / var(--points) * .64));line-height:18px;border-radius:2px}
.summary-teams{max-width:850px}
.summary h2{font-size:24px}
.summary h3{font-size:32px}
.summary-teams img{width:76px;height:76px}
#summaryTotal{font-size:80px}
#summaryTime{font-size:12px}

.point-sequence{row-gap:2px}
.sequence-note{grid-column:1 / -1}
.external-display #summary{overflow:hidden}
.external-display #summaryContent{transform-origin:top center}
.summary img[src$="volei-muro-transparente.png"]{background:transparent;padding:0}
.team .crest-background[src$="volei-muro-transparente.png"],.team.dark-crest .crest-background[src$="volei-muro-transparente.png"]{mix-blend-mode:normal;filter:none}
@media(max-width:600px){
 .summary{padding:14px 10px 36px}
 .summary th:first-child{width:43px}
 .summary th:nth-child(2),.summary th:nth-child(3){width:28px}
 .summary .sequence-cell,.summary .sequence-heading{padding-left:6px}
 .summary .sequence-heading{font-size:8px}
 .summary thead{font-size:10px}
 .summary table{font-size:20px}
 .summary tbody th{font-size:10px}
 .summary h3{font-size:25px}
 #summaryTotal{font-size:48px}
 .point-sequence{column-gap:0}
}

/* Fit summaries while keeping mobile actions at their normal touch size. */
.app{min-height:0}
#summary{overflow:hidden;position:relative}
#summaryContent{transform-origin:top center}
#summary>.summary-actions{position:absolute;bottom:8px;left:10px;right:10px;margin:0;gap:6px;justify-content:center}
.clean:not(.external-display) #summary>.summary-actions{bottom:32px}
.clean:not(.external-display) #summary{padding-bottom:40px}
#archiveDetailDialog{height:92dvh;overflow:hidden;display:flex;flex-direction:column}
#archiveDetailDialog:not([open]){display:none}
#archiveDetailDialog>header,#shareArchive{flex-shrink:0}
#archiveFit{flex:1;min-height:0;overflow:hidden}
#archiveDetail{transform-origin:top center}
.team .crest-background,.team.visual-right .crest-background{transform:none}
.score{font-size:min(95cqw,65cqh)}
.clean .score{font-size:min(95cqw,84cqh)}
.full-controls .score{font-size:min(95cqw,65cqh)}
.score.three-digits,.clean .score.three-digits{font-size:min(62cqw,65cqh)}
.sets{font-size:clamp(44px,6.3vw,120px);gap:8px}
@media(orientation:portrait){.score,.full-controls .score{font-size:min(95cqw,61cqh)}.clean:not(.full-controls) .score{font-size:min(95cqw,80cqh)}.sets{font-size:40px}.score.three-digits,.clean .score.three-digits{font-size:min(62cqw,58cqh)}}
@media(max-height:650px) and (orientation:portrait){.score,.full-controls .score{font-size:min(95cqw,52cqh)}.sets{font-size:35px}}
@media(max-height:500px) and (orientation:landscape){.sets{font-size:46px}}


/* Name and points form the centered block; controls have an independent anchor. */
.team-content,.clean .team-content,.team.visual-right .team-content{position:relative;display:block}
.score-main{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:4px 8px}
.team h1,.clean .team h1{font-size:clamp(24px,min(10cqw,15cqh),110px);max-height:30cqh;flex-shrink:0}
.team-controls{position:absolute;bottom:4px;left:8px;right:8px;display:flex;align-items:center;justify-content:space-between;gap:8px}
.team-controls .minus,.team-controls .serve{flex-shrink:0}
.sets{font-family:'RDK Condensed',Arial,sans-serif;font-weight:900;font-size:clamp(56px,8vw,150px);line-height:.92}
.history-score{font-weight:900;font-size:1.15em}
.history-score span{font-weight:900}
.set-label{font-size:clamp(17px,1.7vw,32px);font-weight:800}
@media(orientation:portrait){
 .team h1,.clean .team h1{font-size:clamp(23px,min(10cqw,16cqh),54px)}
 .sets{font-size:50px}
 .match-center .sets{width:154px}
 .set-label{font-size:14px}
 .board,.clean.full-controls .board{--center-height:calc(135px + var(--history-rows,0)*20px)}
 .clean:not(.full-controls) .board{--center-height:calc(105px + var(--history-rows,0)*20px)}
 .team-controls{bottom:2px;left:12px;right:12px}
}
@media(max-height:650px) and (orientation:portrait){.sets{font-size:43px}.team h1,.clean .team h1{font-size:clamp(20px,min(10cqw,16cqh),48px)}}
@media(max-height:500px) and (orientation:landscape){.sets{font-size:56px}.set-label{font-size:14px}.team-controls{bottom:2px}}

/* Serve marker above the centered name; corrections centered below the points. */
.team-heading{position:relative;width:100%;flex-shrink:0;text-align:center}
.team-heading h1{margin:0}
.team-heading .serve,.clean .team-heading .serve,.clean.full-controls .team-heading .serve{position:absolute;left:50%;bottom:100%;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;gap:6px;width:max-content;max-width:100%;padding:0 4px 3px;min-height:0;font-size:clamp(13px,1.3vw,23px);font-weight:800;letter-spacing:1px;line-height:1}
.serve-ball{display:block;width:clamp(26px,4cqh,48px);height:clamp(26px,4cqh,48px);object-fit:contain;filter:drop-shadow(0 1px 2px #0008)}
.serve:not(.active) .serve-ball{filter:grayscale(1);opacity:.6}
.team-controls{justify-content:center}
.score,.clean.full-controls .score{font-size:min(105cqw,72cqh)}
.clean:not(.full-controls) .score{font-size:min(105cqw,84cqh)}
.score-number{transform:translate(-50%,-50%) scale(.70,1.08)}
.score.three-digits,.clean .score.three-digits,.clean.full-controls .score.three-digits{font-size:min(68cqw,72cqh)}
@media(orientation:portrait){
 .score,.clean.full-controls .score{font-size:min(105cqw,68cqh)}
 .clean:not(.full-controls) .score{font-size:min(105cqw,80cqh)}
 .score.three-digits,.clean .score.three-digits,.clean.full-controls .score.three-digits{font-size:min(68cqw,64cqh)}
 .team-heading .serve,.clean .team-heading .serve{font-size:13px;gap:5px;padding-bottom:2px}
}
@media(max-height:650px) and (orientation:portrait){
 .score,.clean.full-controls .score{font-size:min(105cqw,58cqh)}
 .team-heading .serve,.clean .team-heading .serve{font-size:11px;gap:4px;padding-bottom:0}
 .serve-ball{width:21px;height:21px}
}

/* Approved unbranded ball, outlined for white backgrounds. */
.serve-ball{width:clamp(32px,5.8cqh,64px);height:clamp(32px,5.8cqh,64px)}
.team-heading .serve,.clean .team-heading .serve,.clean.full-controls .team-heading .serve{padding:0 3px 10px;gap:0}
@media(max-height:650px) and (orientation:portrait){.serve-ball{width:27px;height:27px}}
@media(orientation:portrait),(max-height:500px) and (orientation:landscape){
 .team-heading .serve,.clean .team-heading .serve,.clean.full-controls .team-heading .serve{padding-bottom:6px}
}
@media(max-height:650px) and (orientation:portrait){
 .serve-ball{width:19px;height:19px}
 .team-heading .serve,.clean .team-heading .serve,.clean.full-controls .team-heading .serve{padding-bottom:2px}
}
@media(orientation:portrait){.external-display .team-heading .serve{padding-bottom:2px}}
@media(max-height:650px) and (orientation:portrait){.external-display .serve-ball{width:15px;height:15px}}
@media(max-height:500px) and (orientation:landscape){
 .external-display .serve-ball{width:clamp(22px,6vh,27px);height:clamp(22px,6vh,27px)}
 .external-display .team-heading .serve{padding-bottom:2px}
}
@media(max-height:375px) and (orientation:landscape){
 .serve-ball{width:24px;height:24px}
 .team-heading .serve,.clean .team-heading .serve,.clean.full-controls .team-heading .serve{padding-bottom:2px}
}

/* The three complete-crest layouts are measured against the score and team panel. */
body:not([data-crest-layout="expanded"]) .team .crest-background{object-fit:contain;object-position:center;transform:none}
@media(orientation:landscape){
 .team-content,.team.visual-right .team-content{width:calc(100% - var(--center-width)/2 + clamp(4px,1vw,14px))}
}

/* Reference photo: broad Arial points, stronger headings, and a ball above them. */
.score,.clean.full-controls .score{font-family:Arial,Helvetica,sans-serif;font-weight:900;font-size:min(105cqw,78cqh)}
.clean:not(.full-controls) .score{font-size:min(105cqw,84cqh)}
.team h1,.clean .team h1{font-size:clamp(24px,min(11cqw,16.5cqh),120px)}
.team-heading{transform:translateY(-.7cqh)}
.serve-ball{width:clamp(32px,5.8cqh,64px);height:clamp(32px,5.8cqh,64px)}
@media(orientation:portrait){
 .score,.clean.full-controls .score{font-size:min(105cqw,71cqh)}
 .clean:not(.full-controls) .score{font-size:min(105cqw,80cqh)}
 .team h1,.clean .team h1{font-size:clamp(23px,min(11cqw,17cqh),60px)}
 .serve-ball{width:32px;height:32px}
}
@media(max-height:650px) and (orientation:portrait){
 .score,.clean.full-controls .score{font-size:min(105cqw,60cqh)}
 .team h1,.clean .team h1{font-size:clamp(20px,min(11cqw,16cqh),48px)}
 .serve-ball{width:19px;height:19px}
 .external-display .serve-ball{width:15px;height:15px}
 .team-heading{transform:none}
 .score-main{padding-top:14px}
}
@media(max-height:500px) and (orientation:landscape){
 .score,.clean.full-controls .score{font-size:min(105cqw,74cqh)}
 .serve-ball{width:clamp(24px,6cqh,30px);height:clamp(24px,6cqh,30px)}
 .team-heading .serve,.clean .team-heading .serve,.clean.full-controls .team-heading .serve{padding-bottom:4px}
}
.score.three-digits,.clean .score.three-digits,.clean.full-controls .score.three-digits{font-size:min(68cqw,64cqh)}



@media(min-height:376px) and (max-height:500px) and (orientation:landscape){.serve-ball{width:32px;height:32px}}

/* Search keeps each side's choice until an explicit result is selected. */
.team-picker{min-width:0}
.team-picker label{margin:10px 0}
.team-search-results{max-height:180px;overflow-y:auto;border:1px solid #596477;border-radius:8px;background:#101722;overscroll-behavior:contain}
.team-search-result{display:flex;align-items:center;gap:9px;width:100%;text-align:left;border:0;border-bottom:1px solid #394250;border-radius:0;min-height:46px;background:transparent;padding:7px 10px}
.team-search-result:last-child{border-bottom:0}
.team-search-result:hover,.team-search-result:focus-visible{background:#30415a}
.team-search-result img{width:30px;height:30px;object-fit:contain;background:white;border-radius:4px;flex-shrink:0}
.team-search-result span{overflow-wrap:anywhere}
.team-search-status{font-size:12px;line-height:1.4;color:#cbd3df;margin:4px 0}
.team-search-status:empty{display:none}
@media(max-width:420px){.team-search-results{max-height:150px}}
