:root{font-family:"Segoe UI",system-ui,sans-serif;color:#192922;background:#f3f5ef;font-synthesis:none;--forest:#142b25;--ink:#192922;--muted:#526459;--line:#dbe3d8;--lime:#d9f66e;--green:#286547}
*{box-sizing:border-box}
body{margin:0;min-height:100vh}
button,input,select,textarea{font:inherit}
a{color:inherit;text-decoration:none}
button{cursor:pointer}
button:disabled{cursor:not-allowed}
:focus-visible{outline:3px solid #699635;outline-offset:3px}
.masthead{background:var(--forest);color:#f8fcef;border-bottom:3px solid #bfd66f}
.bar{max-width:1460px;margin:auto;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:24px;min-height:75px;padding:9px clamp(14px,3vw,38px)}
.brand{display:flex;align-items:center;gap:8px;font-weight:840;font-size:27px;line-height:1;letter-spacing:-1.4px;width:max-content}
.brand small{display:block;font-size:8px;letter-spacing:1px;margin-top:6px;color:#c5d5c6;font-weight:720}
.club-badge{display:block;width:49px;height:49px;object-fit:contain;flex:none}
nav{justify-self:center;display:flex;gap:4px;align-items:center}
nav:empty{display:none}
.nav-item{display:flex;align-items:center;justify-content:center;gap:7px;border:0;border-radius:8px;padding:9px 11px;min-height:39px;background:transparent;color:#d3e1d8;font-size:13px;font-weight:700}
.nav-item:hover,.nav-item[aria-current="page"]{background:#30483b;color:#efffc5}
.icon{width:17px;height:17px;flex:none;vertical-align:middle}
.actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
#top-actions{justify-content:flex-end}
.btn{min-height:36px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:7px 11px;border:1px solid #d4ded2;border-radius:8px;background:#fff;color:var(--ink);font-weight:720;font-size:13px;white-space:nowrap}
.btn:hover{background:#edf3e8}
.btn-primary{background:var(--lime);border-color:#bcd861;color:#203014}
.btn-primary:hover{background:#c9ec53}
.btn-dark{background:var(--forest);border-color:var(--forest);color:white}
.btn-dark:hover{background:#26493b}
.btn-soft{background:#e9f1e5;border-color:#e9f1e5;color:#21573a}
.btn:disabled{background:#f0f3ed;border-color:#dce5d9;color:#617065}
main{max-width:1460px;margin:auto;padding:21px clamp(14px,3vw,38px) 34px}
h1,h2,h3,p{margin:0}
h1{font-size:clamp(24px,4vw,35px);line-height:1.08;letter-spacing:-.055em;font-weight:850;overflow-wrap:anywhere}
h2{font-size:19px;letter-spacing:-.035em;font-weight:800}
h3{font-size:15px;font-weight:780;overflow-wrap:anywhere}
.session-bar{display:flex;justify-content:space-between;align-items:center;gap:13px 25px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding-bottom:16px;margin-bottom:17px}
.session-info{display:flex;align-items:center;gap:8px 11px;flex-wrap:wrap;min-width:0}
.session-info h1{order:-1}
.session-info p,.session-totals{color:var(--muted);font-size:12px}
.session-totals{display:flex;gap:6px 13px;flex-wrap:wrap}
.session-totals span{white-space:nowrap}
.session-totals strong{font-variant-numeric:tabular-nums;color:var(--ink)}
.board-title{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:11px;min-height:36px}
.board-title h2 span{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;padding-left:4px}
.format-tag{font-size:12px;color:var(--muted);font-weight:700}
.panel{background:#fff;border:1px solid var(--line);border-radius:13px;overflow:hidden;min-width:0}
.panel + .panel{margin-top:15px}
.panel-head{padding:14px 15px;display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;border-bottom:1px solid #edf0e9}
.panel-head p{font-size:12px;color:var(--muted);margin-top:4px}
.courts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr));gap:12px}
.court,.stage{display:flex;flex-direction:column;min-width:0;background:#fff;border:1px solid var(--line);border-radius:13px;overflow:hidden}
.court.open{background:#f8faf6;border-style:dashed;border-color:#bdcbbc}
.court-top,.court-bottom,.row,.queue-player{display:flex;align-items:center;justify-content:space-between;gap:8px}
.court-top{padding:10px 12px}
.court.in-play .court-top{background:#e9f1e7}
.court-name{display:flex;align-items:center;gap:8px;min-width:0}
.court-icon{width:28px;height:28px;display:grid;place-items:center;color:#2a6248;background:#fff;border-radius:7px;flex:none}
.court-icon .icon{width:16px;height:16px}
.tag{display:inline-flex;flex:none;align-items:center;font-size:10px;font-weight:760;border-radius:25px;padding:4px 8px;color:#4b584e;background:#eef1ea;white-space:nowrap}
.tag.playing{color:#226044;background:#daebda}
.tag.waiting{color:#354c16;background:#e9f2d3}
.teams{display:grid;grid-template-columns:minmax(0,1fr) 23px minmax(0,1fr);align-items:stretch;margin:0 10px}
.team{min-width:0;background:#e9f2e8;border-top:2px solid #81a886;border-radius:6px;padding:9px;font-size:13px}
.team:last-child{background:#f7f0df;border-color:#c2a774}
.team small{display:block;font-size:10px;color:#3f5547;font-weight:800;letter-spacing:.7px;text-transform:uppercase;margin-bottom:5px}
.team .player{width:100%;margin:3px 0;text-align:left}
.vs{font-size:9px;font-weight:800;color:var(--muted);align-self:center;justify-self:center}
.court-empty{color:var(--muted);font-size:13px;min-height:72px;display:grid;place-items:center;padding:10px;text-align:center}
.court.spectator.open .court-empty,.court.spectator.open .court-bottom{display:none}
.court-bottom{color:var(--muted);font-size:12px;margin-top:auto;padding:10px 12px;flex-wrap:wrap}
.court-bottom .icon{width:13px;height:13px}
.court-bottom .btn,.stage-actions .btn{min-height:34px;font-size:12px}
.matchmaking{margin-top:23px}
.rotation-grid{display:grid;grid-template-columns:minmax(225px,1fr) minmax(0,2.25fr);gap:12px;align-items:start}
.stage-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:12px}
.stage .court-top,.queue-panel .panel-head{background:#223e32;color:#f4f9ed}
.stage-actions{padding:10px 12px;margin-top:auto}
.stage .teams{margin-top:9px;margin-bottom:2px}
.stage-empty{background:#f8faf6;border:1px dashed #bdcbbc;border-radius:13px;color:var(--muted);padding:22px;font-size:13px}
.call-banner{padding:11px 14px;margin-top:14px;border-radius:9px;background:#eaf2d7;color:#344b20;display:flex;align-items:center;gap:7px 12px;flex-wrap:wrap;font-size:13px}
.call-banner span{margin-left:auto}
.queue{padding:0 11px}
.queue-player,.row{min-height:48px;border-bottom:1px solid #edf0e9;padding:7px 3px;font-size:13px}
.queue-player:last-child,.row:last-child{border-bottom:0}
.queue-person{display:flex;align-items:center;gap:7px;min-width:0}
.queue-person small{display:block;margin-top:2px;color:var(--muted);font-size:11px}
.player{display:flex;align-items:center;gap:7px;min-width:0}
.player strong{overflow-wrap:anywhere}
.player-link{border:0;background:transparent;color:inherit;font:inherit;padding:2px;text-align:left;border-radius:5px}
.player-link:hover{background:#dbe7d394}
.rank{font-size:11px;min-width:18px;color:#4c6955;text-align:center;font-variant-numeric:tabular-nums;font-weight:780}
.avatar{width:26px;height:26px;display:grid;place-items:center;border-radius:50%;background:#dcebd9;color:#2c563c;font-weight:780;font-size:10px;flex:none}
.team:last-child .avatar{background:#efdfbe;color:#6c4f21}
.empty{padding:19px 14px;color:var(--muted);font-size:13px;line-height:1.5}
.subhead{display:flex;justify-content:space-between;align-items:end;gap:10px;margin:3px 0 20px}
.subhead h1{margin-bottom:6px;font-size:44px}
.subhead p{font-size:14px;color:var(--muted)}
.list{padding:3px 17px 8px}
.row{flex-wrap:wrap;min-height:54px}
.row .btn{min-height:32px;padding:5px 9px;font-size:12px}
.table-wrap{overflow-x:auto}
table{border-collapse:collapse;width:100%;text-align:left;font-size:13px}
th,td{padding:12px 17px;border-bottom:1px solid #edf0e9}
th{font-size:11px;color:#516256;white-space:nowrap}
tr:last-child td{border-bottom:0}
.result{display:grid;gap:4px;padding:12px 0;border-bottom:1px solid #edf0e9;font-size:13px}
.result:last-child{border:0}
.result small{color:var(--muted)}
footer{font-size:9px;letter-spacing:1.65px;color:#58685c;font-weight:750;text-align:center;padding:19px}
footer span{margin:0 3px}
dialog{width:min(430px,calc(100vw - 26px));max-height:90dvh;border:1px solid var(--line);border-radius:17px;padding:23px;background:#fcfff9;color:var(--ink);box-shadow:0 24px 90px #0e24194d}
dialog::backdrop{background:#101d16a0}
.modal-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:15px}
.close{width:32px;height:32px;padding:0}
dialog form{display:grid;gap:13px}
dialog p{color:var(--muted);font-size:14px;line-height:1.5;overflow-wrap:anywhere}
label,legend{font-size:13px;font-weight:700}
.field{display:grid;gap:6px}
input:not([type=radio]),select{min-height:41px;width:100%;padding:8px 9px;border:1px solid #cbd6ca;border-radius:8px;color:#182b20;background:#fff;font-size:16px}
fieldset{display:grid;gap:9px;border:1px solid var(--line);border-radius:8px;padding:10px}
fieldset label{display:flex;align-items:center;gap:7px;overflow-wrap:anywhere}
.score-fields{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.form-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:6px}
.form-error{color:#a32c21;min-height:1em;font-size:13px}
.toast{position:fixed;right:18px;bottom:18px;max-width:min(390px,calc(100vw - 36px));background:var(--forest);color:#fff;border:1px solid #5c7564;border-radius:10px;padding:12px 16px;box-shadow:0 6px 23px #17271c3a;font-size:14px;z-index:2}
.warning{padding:11px 13px;margin-bottom:14px;border-radius:8px;background:#fff0da;color:#684512;font-size:13px}
.result{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:7px}
.result small{display:block;margin-top:3px}
.roster-tools{padding:12px 15px}
.roster-tools input{max-width:340px}
.panel-head select{width:auto;max-width:230px;font-size:13px;min-height:36px}
.field small{color:var(--muted);font-weight:550;overflow-wrap:anywhere}
textarea{width:100%;resize:vertical;padding:9px;border:1px solid #cbd6ca;border-radius:8px;color:var(--ink);background:#fff;font-size:16px}
.check-label{display:flex;align-items:center;gap:7px;line-height:1.35}
.import-preview{display:grid;gap:8px;max-height:45dvh;overflow:auto}
.profile-stats{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.profile-stats p{background:#edf3e7;padding:10px;border-radius:8px}
.share-content,.check-in-content form{display:grid;gap:12px}
#share-qr{justify-self:center;border:1px solid var(--line);border-radius:9px}
.check-in-panel{max-width:510px}
.check-in-content{padding:18px}
summary{cursor:pointer;color:var(--green);font-weight:700;font-size:13px}
details fieldset{margin:8px 0 0}
@media(max-width:780px){
  .bar{grid-template-columns:1fr auto;gap:5px 12px}
  nav{order:3;grid-column:1/-1;justify-self:stretch;justify-content:space-between;border-top:1px solid #3c564a;padding-top:4px}
  .nav-item{flex:1}
  .rotation-grid{grid-template-columns:minmax(0,1fr)}
  .stage-grid{grid-row:1}
}
@media(max-width:480px){
  .bar{padding-top:6px}
  .brand{font-size:24px;gap:5px}
  .club-badge{width:39px;height:39px}
  .brand small{font-size:7px;letter-spacing:.6px}
  .nav-item{font-size:12px}
  #top-actions .btn{font-size:11px;padding:6px 7px;min-height:32px}
  #top-actions .icon{display:none}
  main{padding-top:14px}
  .session-bar{padding-bottom:10px;margin-bottom:10px}
  .stats{gap:8px}
  .subhead h1{font-size:32px}
}
@media(prefers-reduced-motion:no-preference){.btn,.nav-item{transition:background .15s}}
[data-theme="dark"]{color-scheme:dark;background:#111e19;color:#e9f0e9;--ink:#e9f0e9;--muted:#bac9bf;--line:#40574b}
[data-theme="dark"] :is(.panel,.court,.stage,dialog){background:#203129}
[data-theme="dark"] :is(.court.open,.stage-empty,.court.in-play .court-top){background:#263a30}
[data-theme="dark"] :is(.panel-head,.queue-player,.row,td,th,.result){border-color:#40574b}
[data-theme="dark"] .team,[data-theme="dark"] .profile-stats p{background:#31483b}
[data-theme="dark"] .team:last-child{background:#4b402d}
[data-theme="dark"] :is(.team small,.rank,th,summary){color:#d2e4d6}
[data-theme="dark"] dialog p{color:var(--muted)}
[data-theme="dark"] .btn:not(.btn-primary){color:#192922}
