:root{font-family:system-ui,-apple-system,sans-serif;color:#18243a;background:#eef2f7;font-size:16px}*{box-sizing:border-box}body{margin:0}header{background:#101c31;color:white;padding:20px 28px;display:flex;align-items:center;justify-content:space-between;gap:12px}header strong{font-size:24px;letter-spacing:2px}.brand{background:#cf263d;border-radius:5px;padding:9px;margin-right:10px}.sub{display:block;margin:10px 0 0 60px;font-size:12px;letter-spacing:2px;color:#b8c6dc}#offline{font-size:14px}main{max-width:1440px;margin:auto;padding:24px}button,select,input,textarea{font:inherit}button,.import{cursor:pointer;border:1px solid #cad3e1;border-radius:8px;min-height:48px;background:white;color:#18243a;padding:10px 16px;font-weight:600}button:hover{border-color:#cf263d}button.active{background:#cf263d;border-color:#cf263d;color:white}button:focus-visible,select:focus-visible{outline:3px solid #258ae5;outline-offset:2px}select,textarea{width:100%;min-height:48px;border:1px solid #cad3e1;background:white;border-radius:8px;padding:10px;color:#18243a}label{display:block;font-size:14px;font-weight:600}label select,label textarea{margin-top:7px}h1{font-size:24px;margin:0}h2{font-size:18px;margin:12px 0}.setup{display:grid;grid-template-columns:1fr auto 1fr auto;gap:18px;align-items:end}.versus{padding-bottom:16px;font-weight:800;color:#8693a5}nav{display:flex;gap:8px;margin:24px 0 16px}.controls{display:grid;grid-template-columns:1fr 1fr 1.3fr;gap:20px;background:white;padding:20px;border:1px solid #d9e1eb;border-radius:12px;margin-bottom:24px}.rotations,.seg{display:flex;gap:5px;margin-top:9px}.rotations button{flex:1;padding:10px 7px}.seg button{flex:1}.section-title{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 18px}.section-title select{width:auto}.court-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr);gap:22px}.field-card{background:white;border-radius:12px;padding:16px;border:1px solid #d8e0ec}.field-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;font-weight:700}.court{height:490px;background:linear-gradient(#187487 0 var(--net),#c9e9ef var(--net) 100%);position:relative;border:3px solid white;outline:1px solid #a9bbc8;overflow:hidden}.court:after{content:"RETE";position:absolute;top:var(--net);left:0;right:0;transform:translateY(-50%);height:4px;background:white;text-align:center;font-size:11px;font-weight:800;color:#10263b;line-height:4px;pointer-events:none}.player{position:absolute;transform:translate(-50%,-50%);width:30%;text-align:center;z-index:1;font-size:14px;color:#12243b}.player.us{color:white}.player b{display:block;font-size:16px;line-height:1.15}.player small{font-size:12px}.player .number{display:inline-flex;background:#cf263d;color:white;border-radius:50%;width:27px;height:27px;justify-content:center;align-items:center;font-size:14px;margin-bottom:4px}.court .player.them .number{background:#23384f}.tag{font-size:12px;font-weight:700;letter-spacing:.5px;color:#65748a}.muted{font-size:14px;color:#5b6b80;line-height:1.5}aside{background:white;border-radius:12px;padding:20px}aside label{margin-top:14px}textarea{min-height:95px;resize:vertical}.matchup{border-bottom:1px solid #e3e8ef;padding:12px 0;font-size:16px}.matchup small{display:block;color:#708198;margin-bottom:5px}#grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}#grid .court{height:360px}#grid .player b{font-size:14px}#grid .player{font-size:12px}.rule-input{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;background:white;padding:20px;border-radius:12px}.rule{display:flex;justify-content:space-between;align-items:center;gap:12px;background:white;margin:10px 0;padding:16px;border-left:4px solid #cf263d;border-radius:8px}table{width:100%;border-collapse:collapse;background:white;margin-top:16px}td,th{text-align:left;padding:13px;border-bottom:1px solid #dfe5ed;font-size:14px}.exact{color:#17634c;font-weight:700}#rosters,#formationFields{display:grid;grid-template-columns:1fr 1fr;gap:24px}.roster-block{background:white;border-radius:12px;padding:20px}.roster-row{padding:11px 0;border-bottom:1px solid #e3e8ef}.roster-row span{float:right;font-size:14px;color:#63758c}dialog{max-width:1000px;width:95%;border:0;border-radius:16px;padding:24px}dialog::backdrop{background:#101c31aa}#formationFields label{margin:12px 0}#formationError{color:#bc1c32}footer{margin-top:28px;border-top:1px solid #d3dce8;padding:20px 0;display:flex;flex-wrap:wrap;align-items:center;gap:12px;font-size:14px;color:#64758b}footer details{flex-basis:100%;line-height:1.6}.import{position:relative;display:inline-flex;align-items:center;overflow:hidden}.import input[type=file]{display:block;position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.import:focus-within{outline:3px solid #258ae5;outline-offset:2px}#message{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#101c31;color:white;padding:12px 20px;border-radius:10px;display:none;z-index:9}[hidden]{display:none!important}@media(max-width:900px){main{padding:16px}.controls{grid-template-columns:1fr 1fr}.controls>div:last-child{grid-column:1/-1}.court-layout{grid-template-columns:1fr}#grid{grid-template-columns:repeat(2,minmax(0,1fr))}.setup{grid-template-columns:1fr 1fr}.versus{display:none}.setup>button{grid-column:1/-1}.rule-input{grid-template-columns:1fr 1fr}}@media(max-width:560px){header{padding:16px}header strong{font-size:19px}.sub{margin-left:0}#offline{max-width:110px}.setup,.controls,#rosters,#formationFields,.rule-input{grid-template-columns:1fr}.controls>div:last-child{grid-column:auto}nav button{flex:1;padding:8px}.court{height:390px}#grid{grid-template-columns:1fr}.section-title{flex-wrap:wrap}.results-wrap{overflow:auto}}@media print{header,.setup,nav,.controls,footer,aside,#print{display:none!important}main{padding:0}#all{display:block!important}#court,#fit,#roster{display:none!important}#grid{grid-template-columns:repeat(2,1fr)}.field-card{break-inside:avoid}.court{-webkit-print-color-adjust:exact;print-color-adjust:exact;height:310px!important}.player b{font-size:12px!important}}

.phase-starts{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-bottom:20px}.phase-starts section{background:white;border:1px solid #d5dfec;border-top:4px solid #cf263d;border-radius:10px;padding:20px}.phase-starts label{margin:12px 0}.setup{margin:20px 0 28px}.recommendation{background:#101c31;color:white;border-radius:12px;padding:24px;margin:24px 0}.lock{display:flex;align-items:center;gap:10px;margin:20px 0}.lock input{width:22px;height:22px}.matrix-table{min-width:960px}.matrix-table th:first-child{position:sticky;left:0;background:#f2f5fa;z-index:1;width:190px}.matrix-table td{min-width:110px;text-align:center;font-size:20px}.matrix-table td details div{font-size:14px;line-height:1.5;padding:8px}.heat-1{background:#e6f0ff}.heat-2{background:#c9defa}.heat-3{background:#9cbff0}.matrix-table summary{cursor:pointer}.results-wrap{overflow:auto}nav{flex-wrap:wrap}#court .controls{display:block}@media(max-width:600px){.phase-starts{grid-template-columns:1fr}nav button{flex-basis:45%}}

.six-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.full-field .court{height:440px;background:linear-gradient(#d4eaf0 0 50%,#187487 50% 100%)}.full-field .player{width:31%;font-size:14px}.full-field .player b{font-size:14px;line-height:1.15;overflow-wrap:anywhere}.full-field .player.server{background:#ffd97b;color:#172b43;border-radius:10px;padding:5px 2px;outline:2px solid #f2ba38}.full-field .player.server .number{background:#182c44}.full-field .team-label{text-align:center;font-size:12px;font-weight:700;padding:8px 0;color:#405971;min-height:35px}.full-field .ours{color:#187487}.server-caption{border-top:1px solid #d8e1eb;padding-top:10px;font-size:14px;line-height:1.5;min-height:54px}.ball-mark{color:#ca8b03}.plans-panel{margin-top:24px;background:white;border-radius:10px;padding:18px}.plans-panel summary{cursor:pointer;font-weight:600}.plans-panel label{margin:12px 0}@media(max-width:1100px){.six-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.six-fields{grid-template-columns:1fr}.full-field .court{height:440px}}

.apply-incastro{margin-top:24px;padding:24px;border:2px solid #cf263d;border-radius:12px;background:white}.apply-incastro button{background:#cf263d;color:white;width:100%;min-height:56px}button:disabled{opacity:.45;cursor:not-allowed}

#grid .full-field .court{height:500px}

.opponent-reference{background:#e0eaf8;border-radius:10px;padding:16px;font-weight:600}

.starts-matrix{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px 20px}.start-heading{font-size:16px;font-weight:700;padding:8px 12px;background:#101c31;color:white;border-radius:8px}.starts-matrix section h2{margin-top:0}.starts-matrix section{padding:16px}@media(max-width:600px){.starts-matrix{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}.starts-matrix section{padding:12px}.starts-matrix section h2{font-size:16px}.start-heading{font-size:14px}}

#grid .excel-field .court{height:500px;background:linear-gradient(#187487 0 var(--net),#c9e9ef var(--net) 100%)}#grid .excel-field .player{width:30%}#grid .excel-field .player b{font-size:14px}#grid .excel-field .player.server{outline:2px solid #e4b230;border-radius:8px}.excel-field .server-caption{margin-top:12px}

.service-strip{display:grid;grid-template-columns:repeat(3,1fr);min-height:95px;padding:8px 0;background:#edf1f6;border:1px solid #b5c7d7}.service-strip.us .service-player{grid-column:1}.service-strip.them .service-player{grid-column:3}.service-player{background:#ffe2a0;border:2px solid #e5b84e;border-radius:8px;text-align:center;padding:6px;font-size:14px}.service-player b,.service-player small{display:block}.service-player .number{display:inline-block;color:white;background:#172d46;border-radius:50%;padding:4px 7px;margin-bottom:4px}.service-player small{font-size:12px;margin-top:4px}#grid .excel-field .court{height:600px}

.header-settings{display:flex;align-items:center;gap:12px}.header-settings label{color:#d6e2f2}.header-settings select{width:110px;margin:0;min-height:42px}.sub{margin-left:0}html[data-theme="dark"]{color-scheme:dark;color:#e1e9f5;background:#101724}html[data-theme="dark"] button,html[data-theme="dark"] .import,html[data-theme="dark"] select,html[data-theme="dark"] input,html[data-theme="dark"] textarea{background:#202e43;color:#e1e9f5;border-color:#485b76}html[data-theme="dark"] button.active,html[data-theme="dark"] .apply-incastro button{background:#cf263d;color:white;border-color:#cf263d}html[data-theme="dark"] .controls,html[data-theme="dark"] .field-card,html[data-theme="dark"] aside,html[data-theme="dark"] .rule-input,html[data-theme="dark"] .rule,html[data-theme="dark"] table,html[data-theme="dark"] .roster-block,html[data-theme="dark"] dialog,html[data-theme="dark"] .phase-starts section,html[data-theme="dark"] .apply-incastro,html[data-theme="dark"] .plans-panel{background:#192538;border-color:#40516d}html[data-theme="dark"] .muted,html[data-theme="dark"] .tag,html[data-theme="dark"] .roster-row span,html[data-theme="dark"] .matchup small,html[data-theme="dark"] footer{color:#bdcadc}html[data-theme="dark"] td,html[data-theme="dark"] th,html[data-theme="dark"] .roster-row,html[data-theme="dark"] .server-caption,html[data-theme="dark"] footer{border-color:#40516d}html[data-theme="dark"] .matrix-table th:first-child{background:#23334b}html[data-theme="dark"] .heat-1{background:#253f61}html[data-theme="dark"] .heat-2{background:#315982}html[data-theme="dark"] .heat-3{background:#356f9d}html[data-theme="dark"] .exact{color:#8de4bb}html[data-theme="dark"] .opponent-reference{background:#243d5e}html[data-theme="dark"] .full-field .team-label{color:#c3d5e9}html[data-theme="dark"] .full-field .ours{color:#8ddde4}html[data-theme="dark"] .service-strip{background:#23334b;border-color:#52667e}html[data-theme="dark"] .service-player{color:#172b43}html[data-theme="dark"] #formationError,html[data-theme="dark"] #rosterError{color:#ff9fac}@media(max-width:600px){header{flex-wrap:wrap}.header-settings{width:100%;justify-content:space-between}.header-settings #offline{max-width:none}}

.solution-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.solution-card{background:white;border:2px solid #d3dce9;border-radius:12px;padding:20px}.solution-card.selected{border-color:#cf263d;box-shadow:0 0 0 2px #cf263d22}.solution-card h3{margin-top:0}.solution-card>button{width:100%;margin-top:16px}.solution-card td{font-size:14px}.solution-card table{min-width:380px}html[data-theme="dark"] .solution-card{background:#192538;border-color:#40516d}html[data-theme="dark"] .solution-card.selected{border-color:#ef6075}@media(max-width:900px){.solution-options{grid-template-columns:1fr}}

.excel-field .court{background:linear-gradient(#c9e9ef 0 50%,#187487 50% 100%)!important}.excel-field .team-label{font-size:12px;text-align:center;font-weight:700;padding:8px;color:#5a7088}html[data-theme="dark"] .excel-field .team-label{color:#c3d5e9}.excel-field .service-strip.us .service-player{grid-column:3}.excel-field .service-strip.them .service-player{grid-column:1}

.constraint-table select{min-width:145px;max-width:230px;width:100%}.constraint-table td{vertical-align:top}.constraint-table button{white-space:nowrap}

.team-choice{padding:12px;border-radius:12px;border:2px solid}.team-choice.us,.roster-block.us{border-color:#008e9b;background:#e3f6f7}.team-choice.them,.roster-block.them{border-color:#c77625;background:#fff0df}.team-identity{display:flex;gap:10px;align-items:center;margin-bottom:8px}.team-logo{width:52px;height:52px;object-fit:contain;background:white;border-radius:10px;vertical-align:middle;margin-right:10px}.player-photo{display:inline-flex;width:48px;height:56px;object-fit:cover;object-position:top;border-radius:9px;background:white;align-items:center;justify-content:center;color:#253c50}.initials{font-size:13px;font-weight:700}.full-field .player-photo{width:34px;height:40px;display:block;margin:0 auto 3px}.full-field .player.us{background:#087780d9;border-radius:8px;color:white}.full-field .player.them{background:#ffefdbed;border-radius:8px;color:#57300d}.roster-row{display:grid;grid-template-columns:48px 1fr auto;gap:12px;align-items:center}.roster-block h2{display:flex;align-items:center}html[data-theme="dark"] .team-choice.us,html[data-theme="dark"] .roster-block.us{background:#133b43}html[data-theme="dark"] .team-choice.them,html[data-theme="dark"] .roster-block.them{background:#443321}

.study-charts{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:16px}.study-bar{display:grid;grid-template-columns:30px 1fr 110px;gap:10px;align-items:center;margin:10px 0}.study-bar meter{width:100%;height:24px}nav{flex-wrap:wrap}

.phase-starts section.start-us{background:#e3f6f7;border:2px solid #008e9b}.phase-starts section.start-them{background:#fff0df;border:2px solid #c77625}html[data-theme="dark"] .phase-starts section.start-us{background:#133b43}html[data-theme="dark"] .phase-starts section.start-them{background:#443321}

.constraint-step{border:1px solid #b7cbd7;border-radius:12px;margin:14px 0;padding:16px}.constraint-step legend{font-weight:700;padding:0 8px}.check-options{display:flex;flex-wrap:wrap;gap:10px}.check-choice{display:flex;align-items:center;gap:8px;padding:12px;border:2px solid #c4cedc;border-radius:10px;cursor:pointer}.check-choice.checked{border-color:#078c9a;background:#dff6f5}.check-choice input{width:20px;height:20px;accent-color:#008e9b}.full-field .player{width:58px;background:transparent!important}.full-field .player-photo{width:44px;height:52px}.full-field .player .number{display:block;width:max-content;margin:2px auto;background:#163d48;color:white}.full-field .player.them .number{background:#914d12}html[data-theme="dark"] .check-choice.checked{background:#123c43}

.filter-actions{display:flex;gap:8px;margin-bottom:10px}.bar-track{height:26px;background:#e1e7ef;border-radius:6px;overflow:hidden}.bar-fill{height:100%;min-width:0;border-radius:6px}.most-used{padding:8px;background:#fff0d5;border:2px solid #e45c12;border-radius:8px;font-weight:800}.match-legend{display:flex;gap:14px;flex-wrap:wrap;margin:18px 0}.match-legend span{display:flex;gap:6px;align-items:center}.match-legend i{width:15px;height:15px;border-radius:4px}.match-row{color:#142438}html[data-theme="dark"] .most-used{background:#513018}html[data-theme="dark"] .bar-track{background:#2b4058}

.formation-role{padding:12px;margin:10px 0;border-left:6px solid var(--role-color);border-radius:8px;background:var(--role-bg)}.role-setter{--role-color:#8445b8;--role-bg:#f3eafd}.role-opposite{--role-color:#c9394b;--role-bg:#ffe8eb}.role-hitter{--role-color:#2475bd;--role-bg:#e6f2ff}.role-middle{--role-color:#d87818;--role-bg:#fff0df}.role-libero{--role-color:#238449;--role-bg:#e6f6e9}.role-other{--role-color:#69788b;--role-bg:#edf0f4}html[data-theme="dark"] .formation-role{background:#202e43;border-color:var(--role-color)}.formation-role span{font-weight:800}

[hidden]{display:none!important}#accessGate{margin:40px auto;max-width:650px;padding:24px;font-size:18px}#accessGate a,#accessGate button{margin:15px 10px 0 0;display:inline-block}#planLabel{font-size:12px}

.starts-editor{margin:20px 0 32px;padding:20px;border:1px solid var(--line,#b9c8db);border-radius:18px}.starts-editor-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px;margin-bottom:18px}.starts-editor input,.starts-editor select{width:100%;padding:12px;font:inherit}.starts-input-table select{min-width:110px}.starts-input-table input{min-width:140px}.starts-editor button{margin:4px}.starts-editor h2{margin:16px 0}

.starts-input-table tr.won{background:#d9f3e1;color:#153d24}.starts-input-table tr.lost{background:#ffe0e2;color:#5d1f27}
.full-field .player{width:29%;max-width:140px}.full-field .player b{display:block;font-size:11px;line-height:1.05;overflow-wrap:anywhere}.full-field .player-photo,.excel-field .player-photo{width:34px;height:40px;display:block;margin:0 auto 2px}.full-field .player .number{font-size:11px;padding:2px 5px}.service-player .player-photo{display:block;width:34px;height:40px;margin:0 auto 3px}.roster-row{grid-template-columns:48px 1fr}.roster-row:not(:has(.player-photo)){grid-template-columns:1fr}.header-settings{flex-wrap:wrap}#mediaStatus{font-size:11px;max-width:180px;color:#d6e2f2}.access-manager{position:fixed;inset:0;z-index:1000;background:var(--bg,#eef2f7);display:flex;flex-direction:column;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}.access-manager-bar{display:flex;align-items:center;justify-content:space-between;padding:12px 18px;background:#101c31;color:white;gap:10px}.access-manager iframe{flex:1;width:100%;border:0;background:white}#manageAccess{display:inline-block;padding:10px;background:#2563eb;color:white;border-radius:8px;text-decoration:none}#manageAccess[hidden]{display:none}
.excel-import-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:20px}.excel-import-actions a{padding:12px;border:1px solid #93a9c0;border-radius:8px;text-decoration:none;color:inherit}.excel-import-actions [hidden]{display:none}.starts-workspace{margin-top:28px;border:2px solid #158f75;border-radius:12px;padding:16px}.starts-workspace>summary{cursor:pointer;font-size:18px;font-weight:700}.starts-workspace[open]>summary{margin-bottom:18px}#openStartsInput{margin:0 0 16px}



nav{flex-wrap:wrap}.study-file-state{padding:14px 16px;margin:16px 0;border:2px solid #bd8c39;border-radius:10px;background:#fff7e3;color:#664510;font-weight:700;line-height:1.5}.study-file-state.loaded{background:#e3f5ed;border-color:#168760;color:#12593f}.study-file-state.local{background:#eaf3ff;border-color:#347bb8;color:#20517a}.study-file-state.loading{background:#eaf3ff;border-color:#347bb8;color:#20517a}.study-file-state.error{background:#ffebee;border-color:#c33d52;color:#8a2337}.starts-editor-meta input{min-height:48px;width:100%;padding:10px;border-radius:8px;border:1px solid #cad3e1}html[data-theme="dark"] .study-file-state{background:#3a2f1c;color:#ffe0a3;border-color:#ba914b}html[data-theme="dark"] .study-file-state.loaded{background:#153c30;color:#a3efd0;border-color:#339976}html[data-theme="dark"] .study-file-state.local,html[data-theme="dark"] .study-file-state.loading{background:#203650;color:#bbd9ff;border-color:#4a88c2}html[data-theme="dark"] .study-file-state.error{background:#452632;color:#ffbbc7;border-color:#cc6278}#loadProvidedStarts{margin:12px 0}

#versionArchive{max-height:90vh;overflow:auto}#versionLabel{display:block;min-height:48px;padding:12px;width:100%;margin:10px 0;border-radius:8px;border:1px solid #cad3e1}.version-actions{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}.version-row{padding:16px;border:1px solid #b9c7d8;border-radius:10px;margin:12px 0}.version-row p{font-size:14px}.version-row .version-actions{margin-bottom:0}html[data-theme="dark"] .version-row{border-color:#485b76}
/* Player anchors stay fixed; only the name moves around photos and shirt numbers. */
.court .player{width:38px!important;max-width:38px!important}.court .player b{position:absolute;display:block;width:100px;line-height:1.1;text-align:center;padding:2px;background:#ffffffee;color:#132d43;border-radius:3px;overflow-wrap:anywhere;z-index:3;pointer-events:none}.court .player .number{margin:2px auto;display:block}.court .player-photo{display:block;margin:0 auto!important}.court .player.us b{background:#075667ee;color:white}
#printRotations{position:fixed;left:-100000px;top:0;width:281mm;visibility:hidden;pointer-events:none}.rotation-print-page{width:281mm;height:194mm;overflow:hidden;color:#172b43;background:white}.rotation-print-page>h1{height:12mm;font-size:14px;margin:0;padding:0;display:flex;align-items:center}.rotation-print-grid{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(2,89mm);gap:4mm}.rotation-print-cell{position:relative;height:89mm;overflow:hidden}.rotation-print-inner{position:absolute;top:0;width:360px;transform-origin:top left}.rotation-print-inner .court{height:600px!important}.rotation-print-inner .field-card{width:360px;padding:12px;background:white!important}.rotation-print-inner .team-label{color:#172b43!important}.rotation-print-inner .service-strip{background:#edf1f6!important}.rotation-print-inner .field-head{font-size:14px}.rotation-print-inner .server-caption{font-size:12px}
@page{size:A4 landscape;margin:8mm}
@media print{html,body{margin:0!important;padding:0!important;background:white!important;color:#172b43!important}body>*{display:none!important}#printRotations{display:block!important;visibility:visible;position:static;width:281mm;pointer-events:auto}#printRotations .rotation-print-page{break-after:page;page-break-after:always;break-inside:avoid}#printRotations .rotation-print-page:last-child{break-after:auto;page-break-after:auto}#printRotations .court{height:600px!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}#printRotations .field-card{break-inside:avoid}#printRotations *{print-color-adjust:exact;-webkit-print-color-adjust:exact}}
.page-reset-bar{display:flex;justify-content:flex-end;margin:0 0 12px}.page-reset-bar button{background:transparent;border-color:#7890a9;min-height:42px}
/* 9 × 18 m, net at 9 m, attack lines 3 m from the net. */
#grid .excel-field .court,#printRotations .excel-field .court{width:100%;aspect-ratio:1/2;height:auto!important;max-width:360px;margin:0 auto;border:3px solid white;background-color:#d9ac70!important;background-image:linear-gradient(to bottom,transparent calc(33.333333% - 1px),white calc(33.333333% - 1px),white calc(33.333333% + 1px),transparent calc(33.333333% + 1px),transparent calc(66.666667% - 1px),white calc(66.666667% - 1px),white calc(66.666667% + 1px),transparent calc(66.666667% + 1px)),repeating-linear-gradient(0deg,#ffffff00 0px,#ffffff00 55px,#7c481b45 55px,#7c481b45 57px),repeating-linear-gradient(90deg,#f3cc9566 0px,#b87b3544 2px,#dfb98133 4px,#f0ce9b33 8px,#b27d3a22 12px,#eed0a033 15px),linear-gradient(90deg,#ddb17a,#e5c18e 42%,#d6a567 68%,#edcc9d)!important;box-shadow:0 0 0 2px #ae793e;overflow:hidden}
#grid .excel-field .court:after,#printRotations .excel-field .court:after{content:'RETE';top:50%;height:3px;background:#213a47;line-height:3px;color:#213a47;font-size:9px}
#grid .excel-field .player-photo,#printRotations .excel-field .player-photo{width:38px;height:45px;object-fit:cover;object-position:top;background:#fff;border:1px solid #fff}
#grid .excel-field .player.them b,#printRotations .excel-field .player.them b{background:#fff3e3f5;color:#582c0c}
#grid .excel-field .player .number,#printRotations .excel-field .player .number{width:25px;height:25px;line-height:25px;font-size:12px;padding:0;font-weight:800}
.rotation-print-inner .court{aspect-ratio:1/2;height:auto!important}.rotation-print-inner .field-card{width:360px}
@media print{.page-reset-bar{display:none!important}#printRotations .excel-field .court{height:auto!important;aspect-ratio:1/2}}
header{position:relative;padding-top:42px}.connection-badge{position:absolute;top:8px;right:12px;min-height:26px;padding:3px 9px;border:0;border-radius:20px;font-size:11px;line-height:20px;color:white!important;font-weight:700;letter-spacing:.2px}.connection-badge.online{background:#167846!important}.connection-badge.offline{background:#b72434!important}.connection-badge::before{content:'●';font-size:9px;margin-right:5px}
@media(max-width:600px){header{padding-top:42px}}
.app-brand{display:flex;flex-direction:column;align-items:center;gap:5px;flex-shrink:0}.app-brand img{width:64px;height:64px;border-radius:15px}.app-brand strong{font-size:17px;letter-spacing:1.5px;text-transform:lowercase}.connection-signature{position:absolute;top:8px;right:12px;display:flex;flex-direction:column;align-items:flex-end;gap:3px}.connection-signature .connection-badge{position:static}.connection-signature small{font-size:10px;line-height:14px;color:#d6e2f2}.support-email{flex-basis:100%;color:inherit;font-weight:600;overflow-wrap:anywhere}
#grid .excel-field .court:after,#printRotations .excel-field .court:after{content:'';height:12px;border-top:2px solid #f8fcff;border-bottom:1px solid #183747;background-color:#183747aa;background-image:repeating-linear-gradient(90deg,transparent 0 6px,#eef7ffcc 6px 7px),repeating-linear-gradient(0deg,transparent 0 3px,#eef7ffbb 3px 4px);box-shadow:0 2px 3px #1234;z-index:2;pointer-events:none}
.court .player{display:flex;flex-direction:column;align-items:center;gap:1px;background:transparent!important}.court .player b{position:static!important;left:auto!important;top:auto!important;width:100%!important;margin:0;padding:1px 2px;line-height:1.1;text-align:center;overflow-wrap:anywhere;order:3}.court .player .number{order:2;margin:1px auto!important;flex-shrink:0}.court .player-photo{order:1;flex-shrink:0}
/* One shared card size for all players, including opposing teams. */
.court .player{gap:3px}.court .player b{height:3.3em;min-height:3.3em;max-height:3.3em;line-height:1.05;padding:1px 2px;display:flex;align-items:flex-start;justify-content:center;overflow:hidden;border-radius:4px}
.court .player .number{position:absolute;top:0;left:calc(50% - var(--portrait-width,38px)/2);margin:0!important;z-index:4;border-radius:4px 0 5px 0;background:#075b6b!important;color:white!important;box-shadow:0 0 0 1px #fff;font-weight:800}
.court .player.them .number{background:#914d12!important}.court .player:not(:has(.player-photo))::before{content:'';display:block;width:var(--portrait-width,38px);height:var(--portrait-height,45px);border-radius:6px;background:linear-gradient(#dae4ed,#f5f8fb);border:1px solid white;order:1;flex-shrink:0}
.court .player-photo{border-radius:6px;object-fit:cover;object-position:top}
.service-player{position:relative;display:flex;flex-direction:column;align-items:center;gap:3px;margin:auto;max-width:88px}.service-player b{height:3.3em;min-height:3.3em;max-height:3.3em;line-height:1.05;width:100%;padding:1px 2px;overflow-wrap:anywhere;overflow:hidden;order:3}.service-player .player-photo{order:1;margin:0!important}.service-player .number{position:absolute;top:6px;left:calc(50% - var(--portrait-width,38px)/2);margin:0;z-index:4;border-radius:4px 0 5px 0;padding:0;background:#075b6b!important;color:white!important;box-shadow:0 0 0 1px #fff}.service-strip.them .service-player .number{background:#914d12!important}
.court .player:not(:has(.player-photo))::before{display:none!important}.court .player:not(:has(.player-photo)) .number,.service-player:not(:has(.player-photo)) .number{position:static;left:auto;top:auto;order:1;margin:0 auto!important}.court .player b:empty,.service-player b:empty{display:none!important}
#grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}#grid .excel-field .court{max-width:440px}#grid .court .player b{height:4.4em;min-height:4.4em;max-height:4.4em;background:#075667f5}#grid .court .player.them b{background:#fff5e6fa}#grid .service-player b{height:4.4em;min-height:4.4em;max-height:4.4em}
@media(max-width:680px){#grid{grid-template-columns:1fr}}
/* Three rotations per row, with the original tactical anchors. */
#grid{grid-template-columns:repeat(3,minmax(250px,1fr));gap:18px;overflow-x:auto;padding:2px}#grid .excel-field .court{max-width:360px}
.court .player,.service-player{gap:2px}.player-caption{display:flex;align-items:flex-start;justify-content:center;gap:3px;width:100%;min-height:2.2em;line-height:1.05;padding:1px 2px;border-radius:4px;background:#075667f5;color:white}.player.them .player-caption,.service-strip.them .player-caption{background:#fff5e6fa;color:#582c0c}
.court .player .player-caption .number,.service-player .player-caption .number{position:static!important;left:auto!important;top:auto!important;order:0;margin:0!important;flex-shrink:0;border-radius:3px;box-shadow:none}
.court .player .player-caption b,.service-player .player-caption b{position:static!important;display:block!important;order:0;flex:1;min-width:0;width:auto!important;height:auto!important;min-height:0!important;max-height:none!important;margin:0;padding:1px 0;background:transparent!important;color:inherit;overflow:visible;overflow-wrap:anywhere;text-align:center;line-height:1.05}
.player-caption b:empty{display:none!important}
.player-caption{min-height:1.35em}
/* Equal caption space keeps receiving portraits on the same horizontal line. */
.player-caption{height:2.2em;min-height:2.2em;max-height:2.2em}
