:root{--green:#185641;--deep:#123d30;--lime:#dcebb2;--bg:#f5f6f2;--line:#e0e5dc;--muted:#758074;--ink:#25392e;--white:#fff;--amber:#a87520;--red:#a83b3b}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:system-ui,-apple-system,"Microsoft Yahei",sans-serif;font-size:14px}button,input,select,textarea{font:inherit}button,a{ -webkit-tap-highlight-color:transparent}button{cursor:pointer;border:1px solid var(--line);border-radius:7px;background:white;padding:9px 14px;color:var(--ink);transition:.15s}button:hover{border-color:#8ea795;background:#f0f5ed}button:disabled{opacity:.45;cursor:not-allowed}button.primary{background:var(--green);color:white;border-color:var(--green)}button.primary:hover{background:var(--deep)}button.danger{color:var(--red);border-color:#ecc7c7}button.quiet{background:transparent;border:none}button.small{padding:6px 10px;font-size:12px}input,select,textarea{border:1px solid #d9dfd5;background:white;border-radius:6px;padding:10px 12px;color:var(--ink);max-width:100%;outline:none}input:focus,textarea:focus,select:focus{border-color:var(--green);box-shadow:0 0 0 3px #18564112}input[type=number]{width:76px}textarea{resize:vertical;line-height:1.8;width:100%}label{display:block;margin:0 0 7px;font-size:13px;font-weight:600}.sidebar{position:fixed;inset:0 auto 0 0;width:218px;background:var(--deep);color:#e4eee7;z-index:5;padding:32px 20px;display:flex;flex-direction:column}.brand{display:flex;gap:12px;align-items:center;text-decoration:none;color:white;font-weight:700;font-size:21px;letter-spacing:2px}.brand small{display:block;font-size:11px;letter-spacing:3px;font-weight:400;margin-top:6px;color:#afc5b8}.ball{width:42px;height:42px;background:#e9efcf;color:var(--deep);border-radius:50%;display:grid;place-items:center;font-size:24px;border:8px solid #e9efcf;box-shadow:inset 0 0 0 1px #143d30;letter-spacing:0}.navlabel{font-size:10px;letter-spacing:2px;color:#8da89a;margin:55px 14px 17px}nav button{display:flex;gap:13px;align-items:center;border:0;background:transparent;color:#c7d8cd;width:100%;text-align:left;padding:13px 16px;margin-bottom:6px;font-size:14px}nav button:hover{background:#ffffff0a;color:white}nav button.active{background:#e4edc7;color:#193b2a;font-weight:650}nav .icon{font-size:18px;width:20px;display:inline-block;text-align:center}.sidebottom{margin-top:auto;padding:25px 12px 0;font-size:12px;color:#c4d3c9}.statusdot{display:inline-block;width:6px;height:6px;background:#b8d791;border-radius:50%;margin-right:5px}.sidebottom small{display:block;color:#8fa99a;line-height:1.8;margin-top:9px;font-size:11px}.sidebtn{color:#c8d9cd;background:none;border:1px solid #496859;margin-top:18px;font-size:11px;padding:8px;width:100%}.shell{margin-left:218px}header{height:75px;border-bottom:1px solid var(--line);background:#ffffffa8;padding:0 37px;display:flex;justify-content:space-between;align-items:center;font-size:12px}.crumb{color:#8b9489}.slash{margin:0 15px;color:#b7c0b2}.headerRight{display:flex;align-items:center;gap:20px}.headerRight #saveStatus{color:#71816d;font-size:11px}main{padding:33px 37px;min-height:calc(100vh - 130px);max-width:1900px;margin:auto}h1,h2,h3,p{margin-top:0}h1{font-size:29px;letter-spacing:-.6px;margin-bottom:8px;font-weight:680}h2{font-size:18px;margin-bottom:0}h3{font-size:15px;margin-bottom:14px}.muted{color:var(--muted);font-size:12px;line-height:1.8}.pagehead{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:27px}.pagehead p{margin:0;color:var(--muted);font-size:13px}.actions{display:flex;gap:9px;flex-wrap:wrap;align-items:center}.hero{background:var(--deep);color:white;border-radius:12px;padding:27px 30px;margin-bottom:23px;display:flex;justify-content:space-between;align-items:center;gap:24px;position:relative;overflow:hidden}.hero:after{content:"";position:absolute;width:190px;height:190px;right:40px;top:-90px;border:1px solid #dcebb224;border-radius:50%;pointer-events:none}.hero h2{font-size:24px;margin:8px 0 11px}.hero p{color:#c0d1c5;margin:0;font-size:12px;line-height:1.7}.hero .eyebrow{color:var(--lime);font-size:11px;letter-spacing:2px}.hero button{z-index:1;background:var(--lime);border:0;color:var(--deep);white-space:nowrap}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:15px;margin:0 0 27px}.stat{background:white;border:1px solid var(--line);border-radius:10px;padding:20px 22px}.stat label{color:#7b8779;font-size:12px;font-weight:400;margin-bottom:13px}.stat strong{font-size:30px;font-weight:600;line-height:1.1;font-variant-numeric:tabular-nums}.stat small{font-size:11px;margin-left:8px;color:#84907e}.panel{background:white;border:1px solid var(--line);border-radius:10px;padding:23px;margin-bottom:22px}.panelhead{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:20px}.panelhead h2 span{font-size:11px;color:#83907b;font-weight:400;margin-left:10px}.columns{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(280px,1fr);gap:22px}.tablegrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}.court{border:1px solid var(--line);border-radius:9px;padding:16px;min-height:175px;background:#fff;display:flex;flex-direction:column}.court.live{background:#f8fbf5;border-color:#afc8ac}.court.off{background:#f7f7f4}.courttop{display:flex;justify-content:space-between;gap:5px;align-items:center;margin-bottom:13px}.courttop strong{font-size:14px}.badge{font-size:10px;padding:4px 7px;border-radius:4px;background:#edf1e8;color:#76836f;white-space:nowrap;display:inline-block}.badge.live{background:#e4efd8;color:var(--green)}.badge.gold{background:#f9edcf;color:#8e671f}.court .pair{display:flex;justify-content:space-between;align-items:center;padding:5px 0;gap:8px}.court .pair b{font-size:18px;font-variant-numeric:tabular-nums}.court .pair span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.court .meta{font-size:10px;color:var(--muted);margin-top:7px}.court button{margin-top:12px;width:100%;padding:7px;font-size:12px}.emptycourt{color:#a0a99a;font-size:12px;text-align:center;flex:1;display:grid;place-items:center;min-height:60px}.queueitem{display:flex;gap:13px;padding:15px 0;border-bottom:1px solid #edf0e9;align-items:center}.queueitem:last-child{border:0}.num{font-size:12px;color:#9ba58f;font-variant-numeric:tabular-nums;min-width:22px}.queueitem b{font-size:12px;font-weight:550}.queueitem small{display:block;color:var(--muted);margin-top:6px;font-size:10px}.queueitem button{margin-left:auto}.empty{padding:32px 10px;text-align:center;color:#8b9684;line-height:1.9;font-size:12px}.hint{background:#f4f6ee;border:1px solid #e4e9d9;color:#69745e;padding:13px 16px;border-radius:7px;font-size:12px;line-height:1.8;margin:16px 0}.hint.warn{background:#fcf6e9;border-color:#eadabb;color:#8b702e}.formgrid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.formgrid input{width:100%}.field{margin-bottom:18px}.steps{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}.step{font-size:11px;padding:8px 13px;background:#e9ede3;border-radius:20px;color:#86917b}.step.current{background:var(--green);color:white}.step.done{color:var(--green);background:#e0ead6}.datatable{width:100%;border-collapse:collapse;font-size:12px;white-space:nowrap}.datatable th{text-align:left;color:#89937f;font-weight:500;padding:12px 13px;background:#f5f7f0;border-bottom:1px solid var(--line)}.datatable td{padding:13px;border-bottom:1px solid #edf0e8}.datatable tr:last-child td{border-bottom:0}.datatable .total{font-weight:700;color:var(--green);font-size:15px}.tablewrap{overflow:auto}.grade{font-size:10px;display:inline-block;background:#f0f2e9;color:#65725a;border-radius:4px;padding:2px 5px;margin-left:5px}.tabs{display:flex;gap:6px;margin-bottom:18px}.tabs button{border:0;background:#e9ede3;color:#748369}.tabs button.active{background:var(--green);color:white}.bracketwrap{overflow:auto;padding:10px 10px 24px;max-width:100%}.bracket{display:flex;gap:32px;width:max-content;min-width:100%;align-items:stretch}.round{width:226px;flex:none;display:flex;flex-direction:column}.round h3{font-size:12px;color:#65765c;padding-bottom:13px;border-bottom:2px solid #dfe6d8;margin-bottom:15px}.roundbody{display:flex;flex-direction:column;justify-content:space-around;gap:16px;flex:1}.match{position:relative;width:226px;border:1px solid #dce3d4;border-radius:7px;background:white;padding:10px 12px;text-align:left;min-height:97px}.match.playing{border-color:#8eaf7a;box-shadow:0 0 0 1px #b8cba455}.match.done{background:#fafbf7}.match:after{content:"";position:absolute;left:100%;width:32px;top:50%;height:1px;background:#cbd6c1}.round:last-child .match:after{display:none}.match .matchmeta{display:flex;justify-content:space-between;color:#95a08c;font-size:10px;margin-bottom:6px}.match .pair{display:flex;justify-content:space-between;align-items:center;padding:4px 0;gap:7px;font-size:12px}.match .winner{font-weight:700;color:var(--green)}.match .name{max-width:172px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.match .score{font-size:15px;font-variant-numeric:tabular-nums}.qualgroup{display:grid;grid-template-columns:190px 226px 226px 190px;gap:26px;align-items:center;padding:20px 0;border-bottom:1px dashed #dbe3d1;min-width:910px}.qualgroup .match:after{display:none}.qualgroup .qmatches{display:grid;gap:12px}.qualhead{display:grid;grid-template-columns:190px 226px 226px 190px;gap:26px;min-width:910px;color:#718166;font-size:12px}.qresult{padding:15px;border-radius:8px;background:#f2f6eb;border:1px solid #e1e9d5;font-size:12px;line-height:2}.qresult strong{display:block;color:var(--green)}.championbox{display:flex;flex-direction:column;justify-content:center;padding:25px;min-width:180px;text-align:center;color:var(--green);background:#f1f5e8;border:1px solid #d8e3c8;border-radius:9px;align-self:center;line-height:2.2}.championbox b{font-size:22px}.championbox span{font-size:12px}.log{padding:11px 0;border-bottom:1px solid #edf0e8;font-size:12px}.log time{color:#9aa28f;margin-right:14px;font-size:10px}footer{padding:20px 37px;border-top:1px solid var(--line);font-size:10px;color:#8d9883;display:flex;justify-content:space-between;gap:20px}dialog{padding:0;border:1px solid var(--line);border-radius:13px;width:min(620px,calc(100% - 30px));max-height:90vh;color:var(--ink);box-shadow:0 20px 80px #102f3029}dialog::backdrop{background:#0d281d70;backdrop-filter:blur(3px)}.modalhead{padding:24px 26px 18px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}.modalhead h2{font-size:19px}.modalbody{padding:23px 26px}.modalfoot{display:flex;justify-content:flex-end;gap:10px;padding:18px 26px;border-top:1px solid var(--line);background:#f8faf4}.scoreboard{display:grid;grid-template-columns:1fr 32px 1fr;gap:15px;text-align:center;align-items:center;margin:20px 0}.scoreboard input{font-size:32px;width:100%;text-align:center;padding:13px;font-weight:600;background:#f8faf4}.scoreboard b{display:block;margin:0 0 12px}.scoreboard span{font-size:23px;color:#a3ad99}.check{display:flex;gap:10px;align-items:flex-start;font-size:12px;line-height:1.7;font-weight:400;margin:15px 0}.check input{margin-top:4px}.rule{font-size:13px;line-height:1.9;margin-bottom:20px}.rule h3{margin-bottom:6px}#toast{position:fixed;bottom:27px;left:50%;transform:translateX(-50%);padding:13px 22px;color:white;background:#183e30;border-radius:8px;box-shadow:0 4px 20px #0002;z-index:50;max-width:90vw;display:none;font-size:13px}.screenbanner{background:#eff4e4;border:1px solid #d5e1c6;padding:12px 15px;border-radius:8px;color:#657653;font-size:12px;margin-bottom:18px}.reportintro{line-height:2;color:#5f7156;font-size:13px}.mobiletitle{display:none}.report-block{page-break-inside:avoid}.is-screen .sidebar,.is-screen header,.is-screen footer{display:none}.is-screen .shell{margin:0}.is-screen main{max-width:none}.is-screen .tablegrid{grid-template-columns:repeat(4,1fr)}.is-screen .court{min-height:230px}.is-screen .court .pair{font-size:23px}.is-screen .court .pair b{font-size:28px}.is-screen .court .meta{font-size:14px}
@media(min-width:1600px){.tablegrid{grid-template-columns:repeat(4,1fr)}}@media(max-width:1200px){.tablegrid{grid-template-columns:repeat(2,1fr)}.columns{grid-template-columns:1.4fr 1fr}main{padding:27px 25px}.sidebar{width:190px;padding:30px 16px}.shell{margin-left:190px}header{padding:0 25px}.stats{gap:10px}.stat{padding:17px}.hero{padding:23px}.hero h2{font-size:21px}}@media(max-width:900px){.columns{grid-template-columns:1fr}.sidebar{width:72px;padding:25px 10px}.brand>span:last-child,.navlabel,.sidebottom,nav .navtext{display:none}.brand{justify-content:center}.ball{width:37px;height:37px}.shell{margin-left:72px}nav{margin-top:40px}nav button{padding:14px;justify-content:center}.stats{grid-template-columns:repeat(4,1fr)}.stat strong{font-size:24px}.pagehead{align-items:flex-start}.pagehead h1{font-size:24px}}@media(max-width:600px){.sidebar{position:sticky;top:0;width:100%;height:61px;padding:8px 13px;flex-direction:row;align-items:center;justify-content:space-between}.brand{display:none}nav{display:flex;margin:0;width:100%;justify-content:space-around}nav button{margin:0;width:auto;padding:8px 12px}nav .icon{font-size:18px}.shell{margin:0}header{height:54px;padding:0 17px}.headerRight{gap:4px}#saveStatus{display:none}main{padding:23px 17px}.pagehead{flex-direction:column;gap:15px}.stats{grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:18px}.stat{padding:17px}.hero{padding:21px;display:block}.hero button{margin-top:16px}.hero h2{font-size:20px}.tablegrid{gap:10px}.court{padding:12px}.panel{padding:18px}.formgrid{grid-template-columns:1fr}.panelhead{align-items:flex-start}.panelhead h2{font-size:16px}.headerRight button{font-size:11px}.scoreboard{gap:8px}.modalbody{padding:20px}.modalfoot{padding:17px}footer{padding:20px 17px}footer span{display:none}.is-screen .tablegrid{grid-template-columns:repeat(2,1fr)}.is-screen .court .pair{font-size:16px}}@media print{body{background:white;font-size:11px}.sidebar,header,footer,.no-print,button,.tabs{display:none!important}.shell{margin:0}main{padding:0;max-width:none}.panel{border:0;padding:10px 0;break-inside:avoid}.bracketwrap{overflow:visible;zoom:.65}.pagehead{margin:0}.qualgroup,.qualhead{min-width:0}.datatable{font-size:10px}.datatable td,.datatable th{padding:7px}.hero{color:#123d30;background:#f0f4e9}.hero p{color:#123d30}.tablewrap{overflow:visible}@page{size:A3 landscape;margin:12mm}}

.bracket{position:relative}.bracket-lines{position:absolute;inset:0;pointer-events:none;z-index:0;overflow:visible}.round,.championbox{position:relative;z-index:1}.match:after{display:none}

.archivegrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.archivecard{margin:0}.archivecard h2{margin-bottom:12px}.archivewinner{padding:17px 0 23px;font-size:18px;color:var(--green);font-weight:600}.headerRight{gap:12px}@media(max-width:700px){.archivegrid{grid-template-columns:1fr}#newEventBtn{padding:7px;font-size:11px}.headerRight{gap:3px}}

.match .name{white-space:normal;overflow-wrap:anywhere;line-height:1.5}.match .score{flex-shrink:0}.roster-actions{margin-bottom:18px}.import-preview{max-height:280px;overflow:auto}.draw-entries{display:flex;gap:8px;flex-wrap:wrap;margin-top:15px}.draw-entries span{padding:7px 10px;background:#eef4e7;border-radius:6px;font-size:12px}.import-errors{color:#a4382b;line-height:1.8}.panelhead .actions{flex-wrap:wrap}

#cloudBar{position:static;background:#eaf4ef;color:#173e32;padding:10px 16px;display:flex;gap:8px;align-items:center;flex-wrap:wrap;border-bottom:1px solid #aac8b9}#cloudBar button{font-size:12px;padding:5px 9px}#cloudStatus{font-size:13px;font-weight:bold;margin-right:auto}#cloudBar [hidden]{display:none!important}

/* 第六版：球台暂缓与恢复操作 */
.court .actions{margin-top:12px;gap:6px}.court .actions button{margin-top:0;width:auto;flex:1;min-width:76px}.queueitem>div{min-width:0;flex:1}.queueitem button{flex-shrink:0}

/* 第八版：按实际晋级路径分组，来源对阵与后续场次共用行轨道。 */
.bracket-grouped .roundbody{display:grid;grid-template-rows:repeat(var(--bracket-rows),var(--bracket-row-height,150px));gap:16px;flex:none;justify-content:normal}
.bracket-grouped .bracket-slot{display:flex;align-items:center;min-width:0}
.bracket-grouped .match{width:100%;flex:none;margin:0}

/* 第九版：状态栏随内容滚动，协会原图保持完整比例。 */
.brand-logo{display:block;width:48px;height:48px;flex:0 0 48px;object-fit:contain;background:#fff;border-radius:8px}
@media(max-width:900px){.brand-logo{width:37px;height:37px;flex-basis:37px}}
.is-screen #cloudBar{display:none}
@media print{#cloudBar{display:none!important}}

/* 第十版：轻量台球主题。仅改变外观，保留全部交互和赛事结构。 */
:root{--green:#17624b;--deep:#103e31;--lime:#e1edc9;--bg:#f6f7f3;--line:#e3e8e1;--muted:#738278;--ink:#223b30;--amber:#926a2e;--red:#ad4138}
body{background:var(--bg);font-size:14px;-webkit-font-smoothing:antialiased}
button{border-radius:10px;min-height:38px;transition:background .18s,border-color .18s,box-shadow .18s;box-shadow:0 1px 2px #193c2904}
button:hover{background:#f0f5ee;border-color:#a9c3b1;box-shadow:0 3px 10px #173d2910}
button.primary{background:var(--deep);border-color:var(--deep)}
button.primary:hover{background:#1e6149;border-color:#1e6149}
button.quiet{box-shadow:none}button.small{min-height:32px}
button:focus-visible,a:focus-visible{outline:3px solid #8fbca0;outline-offset:3px}
input,select,textarea{border-radius:10px;border-color:#dfe6dd;background:#fff}
input:focus,textarea:focus,select:focus{border-color:#5b9474;box-shadow:0 0 0 3px #25754e0d}
textarea{line-height:1.9;padding:15px 17px}
label{font-size:12px;color:#4f6658;line-height:1.6}
.sidebar{width:232px;background:#fcfdf9;color:var(--ink);border-right:1px solid var(--line);padding:30px 20px 22px;overflow-y:auto;overflow-x:hidden}
.brand{color:var(--deep);font-size:20px;letter-spacing:1px;gap:12px;flex-shrink:0}
.brand small{color:#77897c;font-size:10px;letter-spacing:3px;margin-top:5px}
.brand-logo{width:46px;height:46px;flex-basis:46px;border-radius:12px;border:1px solid #e4e9df;padding:3px;box-shadow:0 3px 10px #193b2a08}
.navlabel{margin:42px 14px 16px;color:#8a998d;letter-spacing:2px;font-size:10px}
nav button{color:#657b6b;gap:12px;margin-bottom:7px;border-radius:11px;padding:13px 15px;box-shadow:none;font-size:13px}
nav button:hover{color:var(--deep);background:#edf3e9;box-shadow:none}
nav button.active{color:#f8fcf4;background:var(--deep);font-weight:600;box-shadow:0 5px 13px #16472f16}
nav .icon{font-size:19px;font-weight:400}
.sidebottom{padding:26px 10px 0;color:#5e7866;font-size:11px}
.sidebottom small{color:#8b9a8e;font-size:10px;line-height:1.9}
.sidebtn{border-color:#d9e3d4;color:#476c55;background:#f6f9f0;border-radius:9px;padding:9px}
.statusdot{background:#6fa17a;box-shadow:0 0 0 3px #72a28012}
.shell{margin-left:232px;min-width:0}
#cloudBar{position:static;margin:18px 36px 0;padding:9px 13px;background:#fff;border:1px solid var(--line);border-radius:11px;gap:8px;color:#526d5a;box-shadow:0 2px 7px #173d2903}
#cloudStatus{font-weight:500;font-size:11px;line-height:1.8;overflow-wrap:anywhere}
#cloudStatus:before{content:'';display:inline-block;width:6px;height:6px;background:#739c70;border-radius:50%;margin-right:8px;vertical-align:1px}
#cloudBar button{min-height:28px;font-size:10px;padding:4px 8px;border-radius:7px;background:#f8faf5}
header{height:64px;background:transparent;border-bottom:0;padding:0 36px;font-size:11px;gap:16px}
.headerRight{gap:12px;flex-wrap:wrap;justify-content:flex-end}
.headerRight #saveStatus{font-size:10px;color:#8a998b}
.crumb{color:#95a192}.slash{color:#c1cbbc;margin:0 12px}
main{padding:23px 36px 36px;max-width:1740px;min-height:calc(100vh - 160px)}
h1{font-size:29px;letter-spacing:-1px;font-weight:650;line-height:1.35;margin-bottom:9px}
h2{font-size:17px;font-weight:650;letter-spacing:-.3px}
.pagehead{margin-bottom:26px;gap:20px}.pagehead p{color:#82917f;font-size:12px;line-height:1.8}
.hero{isolation:isolate;display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:flex-start;gap:10px;min-height:238px;padding:28px 30px;border-radius:18px;background:#103e31;border:1px solid #194d3a;box-shadow:0 12px 30px #123c2a0d;margin-bottom:24px}
.hero:before{content:'';position:absolute;inset:0;z-index:-2;background-image:linear-gradient(90deg,#103e31 0%,#103e31ee 34%,#103e3155 60%,#103e3110 100%),url('assets/billiards-hero.png');background-position:center,right center;background-size:cover,auto 100%;background-repeat:no-repeat;pointer-events:none}
.hero:after{content:'';position:absolute;inset:-30%;width:auto;height:auto;top:-30%;right:-30%;border:0;border-radius:0;z-index:-1;background:radial-gradient(ellipse at 70% 50%,#cceba410 0%,transparent 50%);transform:translate3d(-6%,0,0);animation:felt-light 16s ease-in-out infinite alternate;pointer-events:none}
.hero>div:first-child{flex:0 0 100%;min-width:0;position:relative}
.hero h2{max-width:66%;font-size:27px;line-height:1.4;margin:8px 0 10px;letter-spacing:-.7px;color:#fff;font-weight:600}
.hero .eyebrow{font-size:10px;letter-spacing:2px;color:#d1e2b8}
.hero p{max-width:63%;line-height:1.85;color:#c2d4c8;font-size:11px;margin:0 0 13px}
.hero button{position:relative;z-index:1;border-radius:9px;font-size:11px;padding:9px 13px;min-height:36px;background:#e5efcf;color:#173c2d;border:1px solid #e5efcf;white-space:normal}
.hero button:hover{background:#f5f9ec;box-shadow:0 4px 14px #001b1725}
.hero button.primary{background:#fff;color:#173c2d;border-color:white}
@keyframes felt-light{to{transform:translate3d(6%,3%,0);opacity:.6}}
.stats{gap:14px;margin-bottom:27px}.stat{background:#fff;border:1px solid var(--line);border-radius:14px;padding:20px 22px;box-shadow:0 2px 6px #173d2903;position:relative;overflow:hidden}
.stat:after{content:'';position:absolute;right:18px;top:20px;width:7px;height:7px;border-radius:50%;background:#dfe9d9;box-shadow:0 0 0 5px #f6f9f1;pointer-events:none}
.stat label{color:#84937f;font-size:11px;margin-bottom:13px;font-weight:400}
.stat strong{font-size:32px;letter-spacing:-1px;font-weight:550;color:#173f30}.stat small{color:#a0aa98;font-size:10px}
.panel{border:1px solid var(--line);border-radius:15px;padding:24px;box-shadow:0 3px 10px #193e2a03;background:#fff;margin-bottom:22px}
.panelhead{margin-bottom:19px}.panelhead h2 span{font-size:10px;margin-left:9px;color:#90a087}
.columns{gap:24px;grid-template-columns:minmax(0,1.8fr) minmax(282px,1fr)}
.tablegrid{gap:13px;grid-template-columns:repeat(3,minmax(0,1fr))}
.court{border:1px solid #e5eae1;border-radius:13px;padding:16px;min-height:190px;background:#fff;box-shadow:0 2px 5px #173d2903;transition:border-color .2s,box-shadow .2s}
.court:hover{border-color:#c4d5bd;box-shadow:0 5px 17px #173d290b}
.court.live{background:linear-gradient(145deg,#fff 0%,#f1f7ed 100%);border-color:#b7ceb0;box-shadow:inset 0 1px 0 white,0 3px 10px #1f57240a}
.court.off{background:#f0f2ed;border-color:#e1e5dd;box-shadow:none}
.courttop{margin-bottom:15px}.courttop strong{font-size:13px;color:#526c57;font-weight:600}
.badge{font-size:9px;border-radius:6px;padding:4px 7px;color:#7f9176;background:#f0f4eb;line-height:1.5}
.badge.live{color:#2c6a46;background:#e3efd9}.badge.gold{background:#f5eedc;color:#947132}
.court .pair{padding:6px 0;gap:9px}.court .pair span{font-size:13px;color:#2f4b37}.court .pair b{font-size:22px;color:#1b4f35;font-weight:550}
.court .meta{font-size:10px;color:#98a18d;margin-top:10px;line-height:1.6}
.court .actions{gap:5px;margin-top:auto;padding-top:15px}.court .actions button{font-size:10px;min-width:66px;padding:7px 6px;min-height:33px}
.emptycourt{color:#a8b09e;font-size:11px}.queueitem{padding:15px 0;border-color:#f0f2eb;gap:11px;flex-wrap:wrap}.queueitem>div{flex:1;min-width:120px}
.queueitem .num{color:#b0b9a6;font-size:11px}.queueitem b{font-size:12px;color:#3c5742}.queueitem small{font-size:10px;color:#99a58f;line-height:1.6}
.queueitem button{font-size:10px}.empty{font-size:11px;line-height:1.9;color:#98a38d;padding:32px 10px}
.hint{border-color:#e5ecdd;background:#f6f8f1;color:#7a8970;font-size:11px;line-height:1.9;border-radius:10px;padding:13px 15px}
.hint.warn{background:#fcf7ec;border-color:#ecdfc8;color:#907540}
.steps{gap:7px;margin:20px 0 24px}.step{border:1px solid #e6ecde;border-radius:8px;background:#f2f5ec;color:#95a18b;padding:7px 11px;font-size:10px}
.step.current{border-color:#d9e6cd;background:#e5efda;color:#2d5b3a;font-weight:600}.step.done{background:#f4f8ef;border-color:#e5eddc;color:#66875c}
.tabs{gap:6px;background:#edf2e7;border:1px solid #e4eadb;padding:4px;border-radius:11px;width:max-content;max-width:100%;margin-bottom:20px}
.tabs button{font-size:12px;border-radius:7px;background:transparent;color:#819373;min-height:32px;padding:7px 13px;box-shadow:none}
.tabs button.active{background:#fff;color:#2d5e3a;box-shadow:0 2px 5px #263e1a0c}
.datatable{font-size:12px}.datatable th{padding:13px 14px;color:#84977b;background:#f7f9f2;border-color:#e4eadc;font-size:11px}.datatable td{padding:14px;border-color:#eef2e8}.datatable tbody tr:hover{background:#fafcf6}
.grade{background:#f0f5e9;border-radius:5px;color:#79916c}.datatable .total{font-size:15px;font-weight:600}
.match{border:1px solid #dfe8d6;border-radius:11px;background:#fff;padding:13px;box-shadow:0 2px 5px #29401804;transition:background .15s,border-color .15s;min-height:108px}
.match:hover{background:#f9fcf4;border-color:#a6c197;box-shadow:0 3px 10px #29401808}.match.playing{border-color:#89ad77;box-shadow:inset 3px 0 0 #78a364,0 2px 7px #29401808}
.match.done{background:#f8fbf3}.match .matchmeta{font-size:9px;color:#9da990;margin-bottom:9px;gap:8px}.match .pair{font-size:12px;padding:5px 0}.match .score{font-size:17px;color:#5a7750}
.round h3{font-size:11px;color:#789069;font-weight:500;border-bottom:1px solid #dde7d2;padding-bottom:13px}.bracket-lines path{stroke:#c0d0b0;stroke-width:1.2}
.qresult{border-radius:11px;border-color:#e4ebda;background:#f7faf1;color:#859575;font-size:11px}.qualhead{color:#8b9e7a;font-size:11px}
.championbox{border-radius:15px;border:1px solid #dce8cf;background:radial-gradient(ellipse at 50% 0%,#eef6df,transparent 70%),#f7faf1;box-shadow:inset 0 1px 0 #fff;color:#557644;min-width:182px}
.championbox b{font-weight:550}.championbox span{font-size:11px}.qualgroup{border-color:#e6eddd}
.log{font-size:11px;line-height:1.8;border-color:#eff3e9}.log time{font-size:9px;color:#a3b098}
.archivegrid{gap:20px}.archivewinner{color:#527640;font-size:17px}.draw-entries span{font-size:11px;border-radius:7px;background:#f0f5e8;color:#6f895c}
footer{padding:22px 36px;border-top:1px solid #e6ecdd;color:#a0ac93;font-size:10px}
dialog{border-radius:17px;border:1px solid #e2ead8;box-shadow:0 28px 100px #18351030;background:white}
dialog::backdrop{background:#122c2070;backdrop-filter:blur(5px)}
.modalhead{padding:24px 26px 20px;border-color:#e8efdf}.modalhead h2{font-size:18px;letter-spacing:-.3px}.modalbody{padding:24px 26px}.modalfoot{border-color:#e8efdf;background:#f8fbf3;padding:17px 26px;flex-wrap:wrap}.modalfoot button{font-size:12px}
.scoreboard input{border-radius:12px;background:#f4f8ee;font-size:36px;font-weight:550;color:#366029}.scoreboard b{font-size:13px;line-height:1.8}.scoreboard span{color:#b2bda3}
.check{font-size:11px;color:#80916e}.rule{font-size:12px;line-height:2}.rule h3{font-size:14px}.screenbanner{border-radius:10px;background:#f3f8e9;border-color:#e0e9d1;font-size:11px}
#toast{border-radius:12px;font-size:12px;line-height:1.7;background:#1e4d35;box-shadow:0 8px 32px #14301f22;max-width:min(680px,90vw)}
@media(min-width:1600px){.tablegrid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1200px){.sidebar{width:202px;padding:28px 16px 20px}.shell{margin-left:202px}.brand{font-size:18px;gap:10px}.brand-logo{width:42px;height:42px;flex-basis:42px}main{padding:20px 26px 30px}#cloudBar{margin:16px 26px 0}header{padding:0 26px}.tablegrid{grid-template-columns:repeat(2,minmax(0,1fr))}.columns{gap:20px;grid-template-columns:minmax(0,1.4fr) minmax(270px,1fr)}.hero{padding:25px;min-height:230px}.hero h2{font-size:25px}.stat{padding:18px}.stat strong{font-size:29px}.panel{padding:21px}}
@media(max-width:900px){.sidebar{width:76px;padding:26px 10px}.shell{margin-left:76px}.brand{justify-content:center}.brand-logo{width:38px;height:38px;flex-basis:38px}.columns{grid-template-columns:1fr}.tablegrid{grid-template-columns:repeat(3,minmax(0,1fr))}nav{margin-top:38px}nav button{justify-content:center;padding:13px;min-height:46px}nav .icon{font-size:20px}.hero h2{max-width:70%;font-size:24px}.hero p{max-width:65%}.stats{gap:11px}.stat strong{font-size:28px}}
@media(max-width:600px){.sidebar{position:relative;inset:auto;top:auto;width:100%;height:auto;min-height:66px;padding:8px 10px;border-right:0;border-bottom:1px solid #e2eada;overflow:visible}.shell{margin-left:0}.brand{display:none}nav{margin:0;display:flex;gap:2px;justify-content:space-between;align-items:center;width:100%}nav button{display:flex;flex-direction:column;gap:4px;align-items:center;justify-content:center;padding:7px 3px;margin:0;flex:1;min-width:0;border-radius:10px;min-height:52px}nav .navtext{display:block;font-size:9px;white-space:nowrap}nav .icon{font-size:17px}nav button.active{box-shadow:none}#cloudBar{margin:12px 16px 0;padding:8px 10px;gap:6px}#cloudStatus{flex:1 0 100%;font-size:10px}#cloudBar button{font-size:10px;min-height:28px}header{padding:8px 16px;height:auto;min-height:58px;gap:8px;flex-wrap:wrap}.headerRight{gap:5px}.headerRight button{font-size:10px}main{padding:20px 16px 28px}.pagehead{gap:13px;margin-bottom:20px}.pagehead h1{font-size:25px}.pagehead p{font-size:11px}.pagehead .actions{gap:6px}.pagehead button{font-size:11px}.hero{min-height:255px;padding:23px 20px;border-radius:15px;gap:7px}.hero:before{background-image:linear-gradient(90deg,#103e31 0%,#103e31e8 50%,#103e3140 100%),url('assets/billiards-hero.png');background-size:cover,auto 100%;background-position:center,right center}.hero h2{max-width:90%;font-size:23px}.hero p{max-width:90%;font-size:11px}.hero button{font-size:10px;padding:8px 11px}.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:23px}.stat{padding:17px 18px;border-radius:12px}.stat strong{font-size:29px}.stat:after{right:16px;top:19px}.tablegrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.court{padding:13px;min-height:187px}.court .pair span{font-size:12px}.court .pair b{font-size:20px}.court .actions button{font-size:10px;min-width:58px}.courttop{gap:4px}.courttop strong{font-size:12px}.badge{font-size:8px;padding:4px 5px}.panel{padding:18px;border-radius:13px}.panelhead{gap:10px}.panelhead h2{font-size:16px}.panelhead h2 span{display:block;margin:5px 0 0;font-size:10px}.formgrid{grid-template-columns:1fr;gap:14px}.steps{gap:6px;margin:18px 0 20px}.step{font-size:9px;padding:7px 9px}.modalhead{padding:20px}.modalbody{padding:20px}.modalfoot{padding:15px 20px;gap:7px}.modalfoot button{font-size:11px}.scoreboard{gap:8px}.scoreboard input{font-size:30px}footer{padding:20px 16px;font-size:9px}}
@media(max-width:360px){.tablegrid{grid-template-columns:1fr}.hero h2{font-size:21px}.stat strong{font-size:26px}}
.is-screen .hero{min-height:210px}.is-screen .tablegrid{grid-template-columns:repeat(4,minmax(0,1fr))}.is-screen .court{min-height:240px}.is-screen .court .pair span{font-size:21px}.is-screen .court .pair b{font-size:30px}
@media(max-width:700px){.is-screen .tablegrid{grid-template-columns:repeat(2,minmax(0,1fr))}.is-screen .court .pair span{font-size:16px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media print{body{background:white;color:#223b30}.shell{margin:0}main{max-width:none;padding:0}.sidebar,header,footer,#cloudBar{display:none!important}.hero{background:#eff4e5!important;color:#173d2b;box-shadow:none;min-height:0}.hero:before,.hero:after,.stat:after{display:none!important}.hero h2,.hero p{color:#173d2b;max-width:none}.panel,.stat,.court,.match,.championbox{box-shadow:none}.panel{padding:10px 0;border:0}.bracketwrap{overflow:visible}.match{border-color:#b9c9aa}.pagehead h1{font-size:24px}.datatable td,.datatable th{padding:7px}.bracket-grouped .roundbody{gap:16px}}
/* 现场使用优先：小标签保持可读，比分保持高对比。 */
#cloudStatus{font-size:12px;color:#526d5a}.hint{font-size:12px}.badge{font-size:10px}.match .matchmeta{font-size:10px;color:#839477}.court .meta{color:#7c8d70}.court .actions button{font-size:11px}.queueitem small{color:#7d8e70}.step{font-size:11px}.log{font-size:12px}.stat label{color:#6e8267}.empty{font-size:12px;color:#7f9072}
@media(max-width:600px){#cloudStatus{font-size:11px}.badge{font-size:9px}.step{font-size:10px}.court .actions button{font-size:10px}.hero h2{max-width:100%}.hero p{max-width:100%}}
/* 第12版：观赛优先、权限分层与紧凑赛事信息。 */
:root{--line:#cbd6cb;--muted:#526454}
[hidden],[data-admin-only][hidden],body:not(.is-admin) #newEventBtn{display:none!important}
header{position:static!important;height:auto;min-height:62px;display:flex;flex-wrap:wrap;gap:8px 16px;padding:12px 30px;border-bottom:1px solid #ccd8cc}
header>div:not(#cloudBar):first-of-type{display:none}
header>#cloudBar+div{display:none}
header .headerRight{margin-left:auto;flex-wrap:wrap}
header #cloudBar{margin:0;padding:0;border:0;background:none;box-shadow:none;display:flex;flex-wrap:wrap;gap:8px;flex:1 1 360px;position:static}
#cloudBar button{min-height:32px}#cloudStatus{color:#354e3e;font-size:12px}#saveStatus{display:none}
main{padding-top:20px}.pagehead{margin-bottom:16px}.pagehead p{color:#526454}
.event-active .hero,.event-active.is-screen .hero{min-height:0;padding:16px 22px;margin-bottom:12px;align-items:center;gap:8px 14px}
.event-active .hero>div:first-child{flex:1 1 280px}.event-active .hero h2{max-width:100%;font-size:22px;margin:4px 0}.event-active .hero p{display:none}.event-active .hero:after{animation:none}
.event-active .hero:before{opacity:.45}.event-active .hero .eyebrow{font-size:11px;color:#e1ecd8}
.event-active #app>.steps{display:none}.event-active .stats{gap:10px;margin-bottom:20px}.event-active .stat{padding:12px 16px;display:flex;flex-wrap:wrap;align-items:baseline;gap:8px}.event-active .stat label{flex-basis:100%;margin:0}.event-active .stat strong{font-size:26px}.event-active .stat:after{display:none}
.muted,.pagehead p,.stat label,.stat small,.panelhead h2 span,.court .meta,.queueitem small,.queueitem .num,.empty,.emptycourt,.log time,.match .matchmeta,.datatable th,.grade,.qualhead,.qresult,.round h3,.hint,.check{color:#526454}
.hint{background:#f1f5ef;border-color:#cbd7c8}.hint.warn{color:#73521a}.badge{color:#35533c}.tabs button{color:#4f6548}.step{color:#526454}.step.done{color:#43663b}
.court{border-color:#c7d4c6}.court.live{border:2px solid #27724b;background:#f3faf4;box-shadow:inset 0 4px 0 #27724b}
.badge.live{background:#17643b;color:#fff;font-weight:600}.match.playing{border:2px solid #27724b;background:#eff9f0;box-shadow:inset 4px 0 0 #27724b}.match.playing .matchmeta{color:#185536;font-weight:600}
.match{min-height:116px}.match .matchmeta{font-size:11px;flex-wrap:wrap;line-height:1.5}.match .pair{font-size:13px}.match .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.match .score{color:#204f31}.bracket-lines path{stroke:#859d7b;stroke-width:1.5}
body:not(.is-admin) .sidebottom{font-size:0}body:not(.is-admin) .sidebottom small{font-size:11px}body:not(.is-admin) .sidebottom .sidebtn{font-size:11px}
@media(max-width:600px){header{padding:10px 16px;gap:8px}header #cloudBar{flex-basis:100%;gap:6px}#cloudBar #cloudStatus{flex:1 1 100%;font-size:11px}header .headerRight{margin-left:0}.event-active .hero{padding:14px 16px}.event-active .hero h2{font-size:20px}.event-active .hero>div:first-child{flex-basis:100%}.event-active .stat{padding:10px 12px}.event-active .stat strong{font-size:24px}.court .actions button{font-size:11px;min-height:36px}.pagehead h1{font-size:23px}}
/* 第13版：提前正赛与可编辑分级。 */
.early-main-badge{display:inline-flex;align-items:center;align-self:center;padding:9px 12px;border-radius:8px;background:#e5efcf;color:#173c2d;font-size:12px;font-weight:600}
.level-pending{color:#794e10;background:#fff0cf;border:1px solid #dec38c}
[data-edit-level],[data-edit-gender]{color:#17613b;text-decoration:underline;text-underline-offset:3px;white-space:nowrap}
#playerLevel{min-width:170px}.hero [data-action="earlymain"]{border:2px solid #d6e9b5;box-shadow:0 2px 10px #001b1725}
@media(max-width:600px){.early-main-badge{font-size:11px;padding:8px 10px}}

/* Tail slots share the completed match and qualification result styles. */
.qualgroup-tail{position:relative;padding-bottom:48px}
.tail-card{cursor:default}
.tail-card .pair{min-height:28px}
.qualgroup-tail .qresult{min-height:54px}
.tail-caption{position:absolute;bottom:14px;left:0;font-size:12px;color:#718166}

/* Administrator sign-in: isolated layout for desktop and small screens. */
dialog.admin-login{width:min(440px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 32px);margin:auto;padding:0;border:1px solid var(--line);border-radius:18px;overflow:auto;background:#fff;box-shadow:0 24px 80px #102f3033}
.admin-login-form{margin:0;padding:0;min-width:0}
.admin-login-heading{display:flex;gap:14px;align-items:flex-start;padding:28px 28px 0}
.admin-login-mark{display:flex;align-items:center;justify-content:center;flex:none;width:44px;height:44px;border-radius:13px;background:#edf4ec;color:var(--green);font-size:27px}
.admin-login-heading h2{font-size:22px;line-height:1.35;margin:0 0 8px;color:var(--deep)}
.admin-login-heading p{font-size:13px;line-height:1.65;margin:0;color:var(--muted)}
.admin-login-fields{padding:24px 28px 8px}
.admin-login-fields label{display:block;margin:0 0 9px;font-size:13px;font-weight:600}
.admin-login-fields input{display:block;width:100%;min-width:0;height:48px;font-size:16px;border-radius:9px;background:#fafbf9}
.admin-login-fields input:focus{outline:2px solid #b9d5c4;outline-offset:2px;border-color:var(--green)}
.admin-login-fields input[aria-invalid="true"]{border-color:var(--red)}
.admin-login .loginError{min-height:20px;margin:10px 0 0;font-size:12px;line-height:1.65;color:var(--red);overflow-wrap:anywhere}
.admin-login-actions{display:flex;justify-content:flex-end;gap:10px;padding:18px 28px 24px}
.admin-login-actions button{min-width:92px;min-height:44px;border-radius:9px}
@media(max-width:480px){.admin-login-heading{padding:24px 20px 0;gap:12px}.admin-login-heading h2{font-size:20px}.admin-login-fields{padding:22px 20px 4px}.admin-login-actions{padding:16px 20px 22px}.admin-login-actions button{flex:1}}

.player-label{display:inline-flex;align-items:center;gap:6px;max-width:100%;min-width:0;vertical-align:middle}.player-label-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.player-grade{display:inline-block;flex:none;font-size:11px;font-weight:600;line-height:1.5;padding:1px 5px;border-radius:4px;background:#e8f0e8;color:#285b43;white-space:nowrap}.player-grade.level-pending{background:#fff2d9;color:#89631f}.court-player{min-width:0}.court .pair>b,.match .score{flex-shrink:0}.match .name{min-width:0}.is-screen .player-grade{font-size:13px}.championbox .player-label{justify-content:center}.championbox .player-grade{font-size:11px}

.image-report-capture{position:absolute;left:-30000px;top:0;box-sizing:border-box;width:max-content;min-width:1200px;padding:36px;background:#fff;color:#25392e;font-size:14px;z-index:-1}.image-report-capture .bracketwrap,.image-report-capture .tablewrap{overflow:visible;max-width:none;padding:12px 0}.image-report-capture .bracket{min-width:0}.image-report-capture .no-print{display:none!important}.image-report-capture .match{display:block!important}.image-report-capture .match .name,.image-report-capture .player-label-name{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}.image-report-heading{margin-bottom:28px;border-bottom:2px solid #185641;padding-bottom:20px}.image-report-heading h1{font-size:26px;margin:8px 0}.image-report-heading h2{font-size:20px;margin:12px 0}.image-report-heading p,.image-report-footer{font-size:13px;color:#65765c;line-height:1.8}.image-report-footer{margin-top:24px}.image-report-capture .datatable{width:100%;min-width:1128px}.image-report-download{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px 0;border-bottom:1px solid var(--line)}.image-report-download a{color:var(--green);font-weight:600}.image-report-download span{font-size:12px;color:var(--muted)}

body:not(.is-admin) [data-action="images"],body:not(.is-admin) [data-action="xlsx"],body:not(.is-admin) [data-action="csv"],body:not(.is-admin) [data-action="backup"],body:not(.is-admin) [data-action="allarchives"],body:not(.is-admin) [data-archive-images],body:not(.is-admin) [data-archive-xlsx],body:not(.is-admin) [data-archive-csv],body:not(.is-admin) [data-archive-backup],body:not(.is-admin) #backupSide{display:none!important}

dialog:has(.event-guide){width:min(1060px,calc(100vw - 28px));max-height:90dvh}.event-guide{font-size:16px;line-height:1.9;color:#102b25}.event-guide section{margin:0 0 24px}.event-guide h3{display:table;margin:0 0 14px;border-bottom:1px solid #00a86b;padding:0 12px 4px 0;color:#00a86b;font-size:22px;line-height:1.4}.event-guide h3>span{display:inline-block;background:#00a86b;color:#fff;padding:0 12px;margin-right:12px;font-weight:400}.guide-box{background:#d3efdd;padding:16px 20px}.guide-box p{margin:0}.guide-box strong{color:#00a86b;font-weight:700}.guide-box ol,.guide-box ul{margin:0;padding-left:1.65em}.guide-table{overflow-x:auto;margin:12px auto;max-width:100%}.guide-table table{width:100%;min-width:570px;border-collapse:collapse;background:white;text-align:center;font-size:15px}.guide-table th,.guide-table td{padding:10px 8px;border:1px solid #55645b;white-space:nowrap}.guide-table th{font-weight:600}@media(max-width:600px){dialog:has(.event-guide) .modalbody{padding:16px}.event-guide{font-size:14px}.event-guide h3{font-size:19px}.guide-box{padding:12px 14px}}

.new-event-tables{margin-top:20px;padding-top:16px;border-top:1px solid var(--line)}.new-event-tables h3{margin:0 0 14px}.new-event-tables .muted{line-height:1.6}dialog:has(.new-event-tables){max-height:calc(100dvh - 32px);overflow:auto}

.match-bye{cursor:default;text-align:left}

/* 第19版：统一组件、可读性与克制的交互反馈。 */
:root{--green:#18634b;--deep:#123e32;--lime:#deeadc;--bg:#f7f8fa;--line:#e3e7e8;--muted:#626e73;--ink:#202b30;--amber:#89601c;--red:#b13d36;--ui-ease:cubic-bezier(.23,1,.32,1);--ui-shadow:0 0 0 1px #172d2110,0 2px 4px #172d2105}
html{scrollbar-gutter:stable}body{background:var(--bg);color:var(--ink);font-size:14px;line-height:1.5}
button,input,select,textarea{touch-action:manipulation}button{font-size:13px;line-height:1.4;min-height:38px;border-radius:8px;background:#fff;border-color:#dce2e0;box-shadow:0 1px 2px #142b1b08;transition:transform 140ms var(--ui-ease)}
button:hover{background:#fff;border-color:#dce2e0;box-shadow:0 1px 2px #142b1b08}
button.primary,button.primary:hover{background:var(--green);border-color:var(--green);color:#fff;box-shadow:inset 0 1px 0 #ffffff15,0 1px 2px #122d2117}
button.quiet,button.quiet:hover{background:transparent;border-color:transparent;box-shadow:none;color:#59665f}
button.danger,button.danger:hover{color:var(--red);border-color:#ead2d0;background:#fff}
button.small{min-height:34px;font-size:12px;padding:6px 11px}button:disabled{opacity:.45;transform:none;box-shadow:none}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #6da991;outline-offset:3px}
input,select,textarea{border:1px solid #dce2e0;border-radius:8px;background:#fff;color:var(--ink);font-size:14px;box-shadow:0 1px 2px #162a1c04}
input:focus,textarea:focus,select:focus{border-color:#5e927d;box-shadow:0 0 0 3px #18634b0d}input[type=checkbox]{accent-color:var(--green)}
label{font-size:13px;color:#46564e}.field{min-width:0}h1{font-size:28px;font-weight:650;letter-spacing:-.7px;line-height:1.35}h2{font-size:17px;letter-spacing:-.3px}h3{font-size:15px}
.muted,.pagehead p,.stat label,.stat small,.panelhead h2 span,.court .meta,.queueitem small,.queueitem .num,.empty,.emptycourt,.log time,.match .matchmeta,.datatable th,.qualhead,.qresult,.round h3,.hint,.check{color:var(--muted)}
.sidebar{width:224px;padding:28px 16px 20px;background:#fff;border-right:1px solid var(--line);gap:0}
.brand{justify-content:flex-start;gap:10px;padding:0 6px;color:#203e30;font-size:20px;letter-spacing:.5px}.brand-logo{width:42px;height:42px;flex-basis:42px;border:0;border-radius:8px;padding:0;box-shadow:none}.brand small{font-size:11px;letter-spacing:2px;color:#68756d}
.navlabel{font-size:11px;letter-spacing:1px;margin:40px 12px 14px;color:#758079}
nav{margin-top:0}nav button{min-height:44px;padding:11px 13px;font-size:14px;gap:12px;border:0;border-radius:8px;background:transparent;color:#606d66;box-shadow:none;margin-bottom:5px;justify-content:flex-start}
nav button:hover{background:transparent;box-shadow:none;color:#606d66}nav button.active,nav button.active:hover{background:#eaf2ec;color:#1d5b40;box-shadow:inset 0 0 0 1px #1d5b4006;font-weight:600}
nav .icon{display:flex;align-items:center;justify-content:center;width:20px;height:20px;flex:none}nav .icon svg{width:20px;height:20px;stroke-width:1.7}
.sidebottom{padding:22px 10px 0;color:#627168}.sidebottom small{font-size:11px;color:#66766d}.sidebtn{font-size:12px;border-color:#e0e6e1;background:#f8faf8;color:#53665a}.statusdot{background:#4d8868;box-shadow:none}
.shell{margin-left:224px}header{padding:16px 32px;min-height:74px;background:#fff;border-bottom:1px solid var(--line);gap:12px 20px}
header #cloudBar{flex:1 1 450px;gap:8px 10px;min-width:0}#cloudStatus{font-size:12px;color:#52645b;font-weight:400;flex:1 1 180px;line-height:1.6}#cloudStatus:before{background:#8b9690;box-shadow:none}
#cloudBar[data-state="saved"] #cloudStatus:before{background:#3b8965}#cloudBar[data-state="saving"] #cloudStatus:before{background:#b5802a}#cloudBar[data-state="error"] #cloudStatus{color:#a33730}#cloudBar[data-state="error"] #cloudStatus:before{background:#b13d36}
#cloudBar button{font-size:12px;padding:6px 10px;min-height:34px;border-radius:7px;background:#fff}#cloudLogin{color:#245e44}#cloudRetry,#cloudReconnect{color:#a33730;border-color:#e2b8b4}
header .headerRight{gap:8px;margin-left:auto}.headerRight button{font-size:12px;min-height:34px}
main{padding:30px 32px 44px;max-width:1740px}.pagehead{align-items:flex-start;flex-wrap:wrap;gap:16px;margin-bottom:24px}.pagehead>div:first-child{flex:1 1 300px;min-width:0}.pagehead h1{overflow-wrap:anywhere;margin-bottom:7px}.pagehead p{font-size:13px;line-height:1.8}.pagehead .actions{gap:8px}.actions{gap:8px}
.hero,.event-active .hero,.event-active.is-screen .hero{background:#123e32;border:0;border-radius:14px;padding:26px 28px;min-height:164px;gap:14px;align-items:center;margin-bottom:20px;box-shadow:0 2px 6px #1635250a}
.hero:before{background-image:linear-gradient(90deg,#123e32 0%,#123e32f5 44%,#123e3280 100%),url('assets/billiards-hero.png');background-size:cover,auto 160%;background-position:center,right center;opacity:.9}
.hero:after{display:none;animation:none}.hero>div:first-child,.event-active .hero>div:first-child{flex:1 1 360px;min-width:0}.hero h2,.event-active .hero h2{max-width:100%;font-size:26px;margin:8px 0;letter-spacing:-.6px;overflow-wrap:anywhere;color:#fff}.hero .eyebrow,.event-active .hero .eyebrow{font-size:12px;letter-spacing:1px;color:#d2e6d5}.hero p,.event-active .hero p{display:block;font-size:13px;line-height:1.7;color:#c7d9cd;max-width:600px;margin:0}
.hero button,.hero button.primary{min-height:40px;padding:10px 16px;font-size:13px;background:#f4f7eb;color:#244a34;border:1px solid #f4f7eb;border-radius:8px;box-shadow:0 1px 3px #001b1710}.hero [data-action="earlymain"]{border:1px solid #f4f7eb;box-shadow:none}.early-main-badge{background:#f4f7eb;color:#244a34}
.stats,.event-active .stats{gap:14px;margin-bottom:28px;grid-template-columns:repeat(4,minmax(0,1fr))}.stat,.event-active .stat{display:block;border:0;border-radius:11px;background:#fff;padding:18px 22px;box-shadow:var(--ui-shadow)}.stat:after{display:none}.stat label,.event-active .stat label{font-size:12px;line-height:1.5;font-weight:400;margin:0 0 12px}.stat strong,.event-active .stat strong{font-size:32px;font-weight:600;line-height:1.1;letter-spacing:-1px;color:#243d31}.stat small{font-size:12px;margin-left:8px}
.panel{border:0;border-radius:12px;background:#fff;padding:24px;box-shadow:var(--ui-shadow);margin-bottom:22px}.panelhead{gap:12px;margin-bottom:18px;flex-wrap:wrap}.panelhead h2 span{font-size:12px;margin-left:8px}.columns{grid-template-columns:minmax(0,2fr) minmax(280px,1fr);gap:24px}.columns>section,.columns>aside{min-width:0}.tablegrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.court,.court:hover{min-height:200px;border:1px solid #e2e7e4;border-radius:11px;background:#fff;padding:17px;box-shadow:0 1px 2px #172d2104;transition:none}.court.live,.court.live:hover{border:1px solid #a1c6b2;background:#fff;box-shadow:inset 0 3px 0 #398467,0 1px 2px #172d2105}.court.off{background:#f0f2f2;border-color:#e1e5e3;box-shadow:none}
.courttop{margin-bottom:17px;gap:8px;flex-wrap:wrap}.courttop strong{font-size:14px;color:#364f40}.badge{font-size:11px;line-height:1.5;border-radius:5px;padding:3px 7px;background:#f0f3f1;color:#586a60}.badge.live{background:#e7f2eb;color:#1c6948;font-weight:600}.badge.gold{background:#f7eedb;color:#816018}
.court .pair{padding:6px 0;gap:10px}.court .pair span{font-size:14px;color:#233c2e}.court .pair b{font-size:24px;color:#204f37;line-height:1.3;min-width:28px;text-align:center;font-weight:600;font-variant-numeric:tabular-nums}.court .meta{font-size:12px;line-height:1.6;margin-top:12px}.court .actions{padding-top:16px;gap:6px;margin-top:auto}.court .actions button{min-height:36px;font-size:12px;min-width:66px;padding:6px 8px}.court .actions button[data-match]{background:#edf4ef;border-color:#dce9df;color:#276344}.emptycourt{font-size:13px;min-height:65px}.court>button.quiet{font-size:12px;min-height:36px}
.queueitem{padding:15px 0;gap:10px;border-color:#edf0ed}.queueitem>div{min-width:0}.queueitem .num{font-size:12px;font-variant-numeric:tabular-nums}.queueitem b{font-size:13px;line-height:1.6;color:#32483a;overflow-wrap:anywhere}.queueitem small{font-size:12px;line-height:1.7}.queueitem button{font-size:12px}.log{font-size:12px;line-height:1.8;padding:12px 0;border-color:#edf0ed;overflow-wrap:anywhere}.log time{font-size:11px;font-variant-numeric:tabular-nums}
.hint{font-size:13px;line-height:1.8;background:#f4f7f5;border:1px solid #e5ebe6;border-radius:8px;padding:14px 16px}.hint.warn{background:#fff8eb;border-color:#ecdab6;color:#795817}.empty{font-size:13px;line-height:1.9;padding:30px 10px}.screenbanner{font-size:12px;background:#eef4ef;border:1px solid #dae6dd;border-radius:8px}.check,.rule{font-size:13px;line-height:1.85}
.tabs{gap:4px;padding:4px;background:#edf0ee;border:1px solid #e4e8e5;border-radius:9px}.tabs button{font-size:13px;min-height:36px;padding:7px 16px;color:#596c60}.tabs button.active{color:#245d3f;background:#fff;box-shadow:0 1px 3px #193e2a14}
.steps{gap:8px;margin:18px 0 24px}.step{font-size:12px;padding:8px 12px;border-radius:7px;background:#f0f3f1;border-color:#e3e9e4}.step.current{background:#e8f2eb;border-color:#bfd5c6;color:#255e3c}
.datatable{font-size:13px}.datatable th{font-size:12px;font-weight:500;background:#f7f9f8;border-color:#e8ece9;padding:13px 14px}.datatable td{padding:14px;border-color:#edf0ee;font-variant-numeric:tabular-nums}.datatable tbody tr:hover{background:transparent}.datatable .total{font-size:16px}.grade,.player-grade{background:#edf3ee;color:#2d6545;border:1px solid #dce9df}.player-grade{font-size:11px!important;padding:1px 5px}.level-pending,.player-grade.level-pending{color:#7b5517;background:#fff2d8;border-color:#e5cfaa}
.match,.match:hover{border:1px solid #dce4df;border-radius:9px;min-height:122px;padding:14px;background:#fff;box-shadow:0 1px 2px #183c2005;transition:none}.match.done{background:#f7faf8}.match.playing{border:1px solid #88b29a;background:#eff7f1;box-shadow:inset 3px 0 0 #38825b}.match .matchmeta{font-size:11px;line-height:1.6;gap:8px;margin-bottom:10px}.match .pair{font-size:13px;padding:5px 0}.match .name{white-space:normal;overflow-wrap:anywhere;line-height:1.6}.match .player-label-name{white-space:normal;overflow-wrap:anywhere}.match .score{font-size:18px;color:#245438;font-variant-numeric:tabular-nums;min-width:16px}.round h3{font-size:13px;font-weight:600;color:#4e6958;border-color:#dce5df;padding-bottom:14px}.bracket-lines path{stroke:#92ab9b;stroke-width:1.4}.qresult{border-radius:9px;border-color:#dce5df;background:#f5f8f6;font-size:12px;color:#4e6958}.qualhead{font-size:12px}.championbox{background:#f2f7f1;border:1px solid #d6e4d4;border-radius:12px;box-shadow:none;color:#37633e}.tail-caption{color:#647365}
.archivegrid{gap:20px}.archivecard h2{font-size:20px;line-height:1.5;overflow-wrap:anywhere}.archivewinner{color:#2d6644;font-size:18px}.archivecard .actions{gap:8px}.formgrid{gap:20px}.formgrid input,.formgrid select{max-width:100%;min-width:0}
dialog,dialog.admin-login{border:1px solid #e2e7e3;border-radius:16px;background:#fff;box-shadow:0 24px 80px #122b2726,0 0 0 1px #122b2705;max-height:calc(100dvh - 32px);overscroll-behavior:contain}
dialog::backdrop{background:#14221c66;backdrop-filter:none}.modalhead{padding:22px 24px;border-color:#e9edea;gap:12px}.modalhead h2{font-size:19px;line-height:1.5;overflow-wrap:anywhere}.modalhead [data-close]{flex:none;width:36px;height:36px;padding:6px}.modalbody{padding:24px}.modalfoot{padding:18px 24px;background:#fafbf9;border-color:#e9edea;gap:8px}.modalfoot button{font-size:13px;min-height:40px}.scoreboard input{background:#f6f8f5;border-radius:10px;font-size:36px;color:#24523a;font-variant-numeric:tabular-nums}.scoreboard b{font-size:14px}.scoreboard span{color:#6c7e6e}
.admin-login-heading h2{font-size:22px}.admin-login-heading p{color:#627068}.admin-login-mark{background:#eef4ef;color:#2b6746}.admin-login-fields input{background:#fafcf9;border-radius:8px}.admin-login-actions button{border-radius:8px}
#toast{font-size:13px;padding:13px 18px;line-height:1.7;border:1px solid #ffffff20;border-radius:10px;background:#213e30;box-shadow:0 4px 20px #142b2326;bottom:max(24px,env(safe-area-inset-bottom));max-width:min(640px,calc(100vw - 32px));pointer-events:none}
footer{font-size:11px;padding:20px 32px;color:#68776e;border-color:var(--line)}
.skip-link{position:fixed;top:8px;left:8px;transform:translateY(-160%);z-index:100;padding:10px 16px;border-radius:8px;background:#fff;color:#245d3f}.skip-link:focus{transform:none}
@media(hover:hover) and (pointer:fine){button:not(:disabled):hover{background:#f5f8f5;border-color:#c4d1c8;box-shadow:0 1px 3px #142b1b0a}button.primary:not(:disabled):hover{background:#124e3a;border-color:#124e3a}button.quiet:not(:disabled):hover{background:#eef3ef;border-color:transparent;box-shadow:none}nav button:not(:disabled):hover{background:#f1f5f2;border-color:transparent;box-shadow:none}nav button.active:not(:disabled):hover{background:#e3eee6}.hero button:not(:disabled):hover{background:#fff;border-color:#fff}.match:not(:disabled):hover{border-color:#94b49f;box-shadow:0 2px 6px #1738210a}.datatable tbody tr:hover{background:#fafcf9}}
@media(prefers-reduced-motion:no-preference){html:not([data-input="keyboard"]) button:not(:disabled):not(.match):active{transform:scale(.97)}html:not([data-input="keyboard"]) dialog[open]{opacity:1;transform:translateY(0) scale(1);transition:opacity 180ms var(--ui-ease),transform 180ms var(--ui-ease)}html:not([data-input="keyboard"]) #toast{opacity:1;transition:opacity 160ms var(--ui-ease)}@starting-style{html:not([data-input="keyboard"]) dialog[open]{opacity:0;transform:translateY(6px) scale(.98)}html:not([data-input="keyboard"]) #toast{opacity:0}}}
html[data-input="keyboard"] button{transition:none}
@media(min-width:1600px){.tablegrid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1200px){.sidebar{width:204px;padding:24px 14px}.shell{margin-left:204px}main{padding:26px 24px 36px}header{padding:14px 24px}.columns{grid-template-columns:minmax(0,1.5fr) minmax(270px,1fr);gap:20px}.tablegrid{grid-template-columns:repeat(2,minmax(0,1fr))}.stat,.event-active .stat{padding:18px}.hero,.event-active .hero{padding:24px}.panel{padding:20px}}
@media(max-width:1000px){.columns{grid-template-columns:1fr}.tablegrid{grid-template-columns:repeat(3,minmax(0,1fr))}.columns>aside{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.pagehead .actions{justify-content:flex-start}.hero h2,.event-active .hero h2{font-size:24px}}
@media(max-width:900px){.sidebar{width:72px;padding:22px 10px}.shell{margin-left:72px}.brand{justify-content:center;padding:0}.brand>span,.navlabel,.sidebottom{display:none}nav{margin-top:28px}nav button{justify-content:center;padding:12px;min-height:44px}nav .navtext{display:none}.stats,.event-active .stats{gap:12px}.stat strong,.event-active .stat strong{font-size:29px}}
@media(max-width:700px){.columns>aside{display:block}.tablegrid{grid-template-columns:repeat(2,minmax(0,1fr))}.stats,.event-active .stats{grid-template-columns:repeat(2,minmax(0,1fr))}.formgrid{grid-template-columns:1fr}.archivegrid{grid-template-columns:1fr}.panelhead h2 span{font-size:12px}.is-screen .tablegrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){html{scrollbar-gutter:auto}.sidebar{position:relative;inset:auto;width:100%;padding:10px 12px;border-right:0;border-bottom:1px solid var(--line);min-height:0;overflow:visible}.brand{display:flex;justify-content:flex-start;padding:4px 4px 12px;font-size:18px}.brand>span{display:block}.brand small{font-size:10px;letter-spacing:2px;margin-top:3px}.brand-logo{width:34px;height:34px;flex-basis:34px}nav{margin:0;display:flex;overflow-x:auto;justify-content:flex-start;gap:4px;padding:2px 0 4px;scrollbar-width:thin}nav button{flex:1 0 64px;min-width:64px;min-height:56px;flex-direction:column;padding:7px 4px;gap:5px;margin:0;border-radius:8px}nav .navtext{display:block;font-size:11px;white-space:nowrap}nav .icon{width:18px;height:18px}nav .icon svg{width:18px;height:18px}.shell{margin-left:0}header{padding:12px 16px;gap:10px;background:#fff}header #cloudBar{flex-basis:100%;gap:8px}#cloudBar #cloudStatus{flex:1 1 100%;font-size:12px}#cloudBar button{min-height:36px;font-size:12px}header .headerRight{margin-left:0;gap:8px}.headerRight button{font-size:12px;min-height:36px}main{padding:22px 16px 30px}.pagehead{gap:14px;margin-bottom:20px}.pagehead>div:first-child{flex-basis:100%}.pagehead h1{font-size:25px}.pagehead p{font-size:12px}.pagehead button{font-size:12px;min-height:38px}.hero,.event-active .hero,.event-active.is-screen .hero{min-height:0;padding:21px 20px;gap:18px;border-radius:12px}.hero h2,.event-active .hero h2{font-size:23px;max-width:100%}.hero p,.event-active .hero p{font-size:12px;max-width:100%}.hero .eyebrow,.event-active .hero .eyebrow{font-size:11px}.hero>div:first-child,.event-active .hero>div:first-child{flex-basis:100%}.hero button{font-size:13px;min-height:40px}.stats,.event-active .stats{gap:12px;margin-bottom:24px}.stat,.event-active .stat{padding:16px;border-radius:10px}.stat label{font-size:12px}.stat small{font-size:11px}.tablegrid{gap:12px}.court{padding:14px;min-height:200px}.courttop strong{font-size:13px}.badge{font-size:11px}.court .pair span{font-size:13px}.court .pair b{font-size:22px}.court .actions button{font-size:12px;min-height:38px}.panel{padding:20px;border-radius:11px}.panelhead h2{font-size:17px}.panelhead h2 span{display:inline;margin-left:6px}.modalhead{padding:20px}.modalbody{padding:20px}.modalfoot{padding:16px 20px}.modalfoot button{font-size:13px;min-height:44px}input,textarea,select{font-size:16px}.check{font-size:13px}input[type=checkbox]{width:18px;height:18px;flex:none}.tabs button{font-size:13px;min-height:40px}footer{font-size:11px;padding:20px 16px}.scoreboard b{font-size:13px}}
@media(max-width:390px){.tablegrid{grid-template-columns:1fr}.court{min-height:190px}.pagehead .actions{width:100%}.pagehead .actions button{flex:1 1 auto}.stats .stat strong{font-size:28px}.admin-login-actions{gap:8px}}
.is-screen .shell{margin:0}.is-screen main{max-width:none}.is-screen .court .pair b{font-size:30px}.is-screen .court .pair span{font-size:20px}.is-screen .court .player-grade{font-size:13px!important}
.image-report-capture .match,.image-report-capture .match:hover{transition:none;transform:none}.image-report-capture .player-label-name{white-space:normal}
@media print{.skip-link{display:none}.shell{margin:0}main{padding:0;max-width:none}body{background:#fff}.panel,.court,.stat,.match{box-shadow:none}.panel{padding:10px 0}.hero:before,.hero:after{display:none}.hero,.event-active .hero{background:#f1f5ed!important}.hero h2,.hero .eyebrow,.hero p,.event-active .hero h2,.event-active .hero .eyebrow,.event-active .hero p{color:#23452f}.match{break-inside:avoid}.bracket-grouped button.match{display:block!important}.datatable td,.datatable th{padding:7px}*{transition:none!important;animation:none!important}}
[data-table-rename]{overflow-wrap:anywhere;min-width:0}
.is-admin [data-table-rename]{cursor:text}
[data-table-rename] input{width:100%;min-width:0;font:inherit;padding:3px 5px}
.number-options{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}
.number-options label{position:relative;flex:1;min-width:44px;margin:0;cursor:pointer}
.number-options input[type=radio]{position:absolute;opacity:0;width:1px;height:1px}
.number-options span{display:block;text-align:center;padding:12px 8px;border:1px solid #cad8d2;border-radius:10px;background:#fff;color:#315849;font-size:24px;font-weight:700}
.number-options input:checked+span{background:#17664e;color:#fff;border-color:#17664e}
.number-options input:focus-visible+span{outline:3px solid #91c8b4;outline-offset:2px}
.activity-scroll{max-height:360px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.activity-scroll>button{display:block;width:100%;margin:8px 0;text-align:left}
.clean-types .number-options{gap:6px;justify-content:flex-start}
.clean-types .number-options label{flex:0 0 40px;min-width:40px}
.clean-types .number-options span{font-size:16px;padding:6px 8px;border-radius:7px}
.clean-types>section>label{font-size:13px;margin:10px 0 6px}
.clean-types h3{font-size:15px;margin-bottom:12px}
.clean-badge{font-size:10px;color:#24634c;white-space:normal}
