:root{color-scheme:dark;--bg:#11141c;--panel:#1a1f2b;--line:#30384b;--ink:#f0f3fa;--muted:#a2aec3;--red:#f2737a;--blue:#7ea7ff;--green:#88d9b7}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.65 Inter,system-ui,"Microsoft Yahei",sans-serif}button,input,textarea{font:inherit}a{color:#bbd2ff;text-decoration:none}a:hover{text-decoration:underline}button,a.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;background:#dce8ff;color:#18253e;padding:11px 18px;border-radius:9px;font-weight:650;cursor:pointer;min-height:44px;text-decoration:none;transition:background .15s,transform .15s}button:hover:not(:disabled),a.button:hover{filter:brightness(1.08);transform:translateY(-1px)}button:disabled{opacity:.4;cursor:not-allowed}.secondary,a.secondary{background:#242c3d;border-color:#3b455b;color:#dbe3f4}.ghost{background:transparent;color:var(--muted);border-color:var(--line)}.danger{background:#f2737a;color:#30151c}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid #91b4ff;outline-offset:3px}main{max-width:1280px;margin:auto;padding:0 32px}.site-header{display:flex;align-items:center;gap:22px;padding:25px 0;border-bottom:1px solid var(--line);margin-bottom:36px}.brand{display:flex;align-items:center;gap:12px;color:var(--ink);font-weight:750;font-size:20px}.brand small{font-size:11px;letter-spacing:3px;color:var(--muted);margin-left:8px}.brand-icon{display:grid;place-items:center;width:38px;height:38px;background:linear-gradient(135deg,#ed7785,#738fed);border-radius:11px;font-size:23px;color:#11141c}.header-note{color:var(--muted);border-left:1px solid var(--line);padding-left:22px;font-size:13px}.connection{margin-left:auto;font-size:12px;color:var(--green)}.connection::before{content:"";display:inline-block;width:6px;height:6px;background:currentColor;border-radius:50%;margin-right:7px}.connection.offline{color:#ffb67a}h1,h2,h3,p{margin-top:0}h1{font-size:34px;line-height:1.3;letter-spacing:-1px;margin-bottom:12px}h2{font-size:21px;margin-bottom:12px}h3{font-size:16px}p{color:var(--muted)}.eyebrow{display:block;letter-spacing:2px;font-size:11px;font-weight:650;color:#a9b8d8;margin-bottom:12px}.title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:26px}.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.panel{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:26px;margin-bottom:22px}.narrow{max-width:480px;margin:60px auto}.hero{max-width:800px;padding:65px 0}.hero h1{font-size:60px}.hero p{max-width:580px;font-size:18px}.red-text{color:var(--red)}.blue-text{color:var(--blue)}.muted{color:var(--muted)}.small{font-size:12px}.grid{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:22px}.grid>*,.title-row>*{min-width:0}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:22px}.stat{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:18px 20px}.stat span{color:var(--muted);font-size:12px;display:block}.stat strong{font-size:30px;font-variant-numeric:tabular-nums;display:block}.stat small{font-size:13px;color:var(--muted);font-weight:400}.round-special{color:#f5cf88}label{display:block;color:#c5cee1;font-size:13px;margin:15px 0 5px}input,textarea{display:block;width:100%;padding:12px 13px;border-radius:8px;background:#111722;border:1px solid #404c64;color:var(--ink);min-height:46px}textarea{resize:vertical;min-height:170px;line-height:1.7;font-size:13px}input::placeholder,textarea::placeholder{color:#7e8ba4}form .actions{margin-top:18px}.form-row{display:flex;gap:12px}.form-row>*{flex:1;min-width:0}.form-row .round-input{flex:0 0 110px}.badge{display:inline-block;font-size:11px;border:1px solid #44506a;background:#252f44;color:#c8d6f0;border-radius:6px;padding:3px 8px;white-space:nowrap}.badge.green{border-color:#365e51;color:var(--green);background:#203a32}.badge.orange{color:#f5cf88;border-color:#5e5033;background:#373022}.scroll{overflow-x:auto}table{width:100%;border-collapse:collapse;white-space:nowrap}th{text-align:left;color:#96a5be;font-size:11px;letter-spacing:1px;font-weight:500;padding:12px 14px;border-bottom:1px solid var(--line)}td{padding:15px 14px;border-bottom:1px solid #2a3242;font-size:13px}tbody tr:last-child td{border:0}.rank{color:#aab7ce;font-weight:650;font-variant-numeric:tabular-nums}.rank.top{color:#e8c985}.score-cell{font-size:21px;font-weight:700;font-variant-numeric:tabular-nums}.negative{color:#f3969b}.positive{color:#a9c8ff}.name-cell strong{font-size:14px;font-weight:600}.name-cell small{display:block;color:var(--muted);font-size:11px}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:12px}.section-heading h2{margin:0}.section-heading input{max-width:230px;font-size:12px;padding:9px 12px;min-height:38px}.progress{height:6px;background:#303a50;border-radius:9px;margin:15px 0 8px;overflow:hidden}.progress span{height:100%;background:linear-gradient(90deg,var(--red),var(--blue));display:block}.empty{text-align:center;padding:38px 10px;color:var(--muted)}.round-control{border-top:3px solid #849fed}.round-control p{font-size:13px}.round-control button{width:100%}.waiting-list{max-height:140px;overflow:auto;font-size:12px;color:#b6c1d4;line-height:2}.rules{font-size:12px;color:#a9b4ca;line-height:1.9}.rules b{color:#d5deef}details{margin-top:12px}summary{cursor:pointer;color:#c2cde2;font-size:13px;padding:8px 0}.history-content{max-height:340px;overflow:auto}.search-row{display:flex;gap:10px}.search-row input{flex:1;min-width:0}.search-row button{flex-shrink:0}.game-list{display:grid;gap:12px}.game-card{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px;border:1px solid var(--line);background:#1c2331;border-radius:11px;color:var(--ink)}.game-card:hover{border-color:#788db5;text-decoration:none}.game-card h3{margin:0 0 7px}.game-card p{margin:0;font-size:12px}.game-card .arrow{font-size:25px;color:#91a9d1}.player-shell{max-width:540px;margin:0 auto}.player-score{text-align:center;padding:30px 15px}.player-score .score{font-size:76px;font-weight:750;line-height:1.2;letter-spacing:-3px}.player-score p{margin:8px 0 0}.player-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.player-heading h2{margin:0}.round-banner{padding:13px 16px;border-radius:9px;background:#252f43;border:1px solid #3b4c69;margin-bottom:18px;display:flex;justify-content:space-between;gap:12px}.choices{display:grid;grid-template-columns:1fr 1fr;gap:15px;margin:18px 0}.choices button{min-height:145px;flex-direction:column;font-size:32px;letter-spacing:8px}.choices button small{font-size:10px;letter-spacing:3px;opacity:.8}.choice-red{background:#c94753;color:white;border-color:#f47882}.choice-blue{background:#3968cb;color:white;border-color:#7b9eeb}.submitted{padding:22px;text-align:center;background:#23372f;border:1px solid #3f6957;border-radius:10px}.submitted h3{color:var(--green);margin-bottom:7px}.submitted p{margin:0;font-size:13px}.own-choice{font-weight:650;color:#e1e7f3}.result-item{display:flex;gap:14px;padding:12px 0;border-bottom:1px solid var(--line);align-items:center}.result-item:last-child{border:0}.result-round{color:var(--muted);width:50px;font-size:13px}.result-item .result-points{margin-left:auto;font-size:20px;font-weight:700}#notice{background:#46341f;border:1px solid #9b7747;color:#ffe0b0;padding:12px 16px;border-radius:9px;margin-bottom:20px;font-size:14px;position:sticky;top:8px;z-index:20}#notice[hidden]{display:none}.ambient{position:fixed;inset:0;pointer-events:none;z-index:-1;background:radial-gradient(ellipse at 0 0,#51203028,transparent 45%),radial-gradient(ellipse at 100% 0,#1d3b6526,transparent 40%)}footer{font-size:11px;text-align:center;color:#6d7b94;padding:28px 0 38px}dialog{width:calc(100% - 32px);max-width:420px;border:1px solid #596983;background:#202839;border-radius:17px;padding:30px;color:var(--ink);box-shadow:0 30px 80px #0008}dialog::backdrop{background:#070b12c9}dialog img{max-width:100%;height:auto;display:block;margin:20px auto;background:white;border-radius:8px}dialog .actions{justify-content:flex-end}.dialog-close{position:absolute;top:10px;right:10px;padding:4px 12px;font-size:23px}.projection-exit{display:none}.projector .site-header,.projector footer,.projector .controls,.projector .sidebar,.projector .detail-history{display:none!important}.projector main{max-width:1800px;padding:30px 45px}.projector .grid{grid-template-columns:1fr}.projector .title-row h1{font-size:42px}.projector .projection-exit{display:inline-flex}.projector table td{font-size:22px;padding:15px 20px}.projector .name-cell strong{font-size:24px}.projector .name-cell small{font-size:15px}.projector .score-cell{font-size:34px}.projector .stats .stat strong{font-size:42px}.projector .panel{padding:22px}.projector .host-only{display:none!important}@media(max-width:950px){.grid{grid-template-columns:1fr}.stats{grid-template-columns:repeat(2,1fr)}.sidebar{display:grid;grid-template-columns:1fr 1fr;gap:18px}.sidebar .panel{margin:0}.sidebar .rules-panel{grid-column:1/-1}.title-row{flex-wrap:wrap}}@media(max-width:600px){main{padding:0 17px}.site-header{padding:20px 0;margin-bottom:26px;gap:10px}.brand{font-size:18px}.brand small{display:none}.header-note{font-size:11px;padding-left:12px}.connection{font-size:10px}.hero{padding:45px 0}.hero h1{font-size:44px}h1{font-size:27px}.panel{padding:20px;border-radius:12px}.narrow{margin:30px auto}.sidebar{display:block}.sidebar .panel{margin-bottom:18px}.stats{gap:10px}.stat{padding:14px 16px}.stat strong{font-size:25px}.section-heading{align-items:flex-start;flex-direction:column}.section-heading input{max-width:none}.title-row{gap:12px}.actions{gap:8px}button,a.button{padding:10px 14px;font-size:13px}.choices button{font-size:32px}.player-score .score{font-size:66px}td,th{padding:12px 10px}.form-row{flex-wrap:wrap}.form-row .round-input{flex:1}dialog{padding:24px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}

.pair-results-pending{padding:25px 15px;text-align:center;color:var(--muted);border:1px dashed #46516a;border-radius:10px}.pair-result{border:1px solid var(--line);border-radius:12px;background:#141b28;padding:16px;margin-top:12px}.pair-label{font-size:12px;color:var(--muted);margin-bottom:13px}.pair-versus{display:grid;grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr);gap:12px;align-items:center}.pair-side{display:grid;grid-template-columns:minmax(0,1fr) 42px;gap:10px;align-items:center}.pair-person{min-width:0}.pair-person strong{display:block;font-size:15px;overflow-wrap:anywhere}.pair-person small{display:block;color:var(--muted);font-size:11px}.pair-choice{display:grid;place-items:center;width:42px;height:42px;border-radius:9px;font-weight:750;font-size:22px}.pair-choice.is-red{background:#642f39;color:#ffb0b5;border:1px solid #b35b64}.pair-choice.is-blue{background:#263f72;color:#b4cfff;border:1px solid #567fc8}.pair-points{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding-top:8px}.pair-points span{font-size:11px;color:var(--muted)}.pair-points strong{font-size:25px;line-height:1.2}.pair-divider{text-align:center;color:#7483a0;font-size:22px}.projector .pair-person strong{font-size:26px}.projector .pair-person small{font-size:16px}.projector .pair-choice{width:62px;height:62px;font-size:32px}.projector .pair-side{grid-template-columns:minmax(0,1fr) 62px;gap:16px}.projector .pair-points strong{font-size:38px}.projector .pair-points span,.projector .pair-label{font-size:16px}.projector .pair-result{padding:20px}.projector .pair-versus{gap:25px}.projector .pair-results-panel{border-top:3px solid #849fed}@media(max-width:600px){.pair-result{padding:12px}.pair-versus{gap:7px;grid-template-columns:minmax(0,1fr) 10px minmax(0,1fr)}.pair-side{grid-template-columns:minmax(0,1fr);gap:8px}.pair-choice{width:38px;height:38px;font-size:20px}.pair-person strong{font-size:13px}.pair-person small{font-size:10px}.pair-points{grid-column:1;gap:4px}.pair-points strong{font-size:22px}.pair-divider{font-size:16px}}

.player-reveal{margin-top:18px;padding:18px;background:#141b28;border:1px solid var(--line);border-radius:10px}.player-reveal-colors{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}.player-reveal-side{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:12px 5px}.player-reveal-side span{font-size:12px;color:var(--muted);overflow-wrap:anywhere}.player-reveal-side strong{font-size:34px}.player-reveal-points{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--line);padding-top:12px;margin-top:8px}.player-reveal-points span{font-size:13px;color:var(--muted)}.player-reveal-points strong{font-size:28px}.history-colors{display:flex;flex-direction:column;gap:2px;font-size:13px}

[hidden]{display:none!important}#roster-error-dialog{max-width:760px}#roster-error-dialog h2{color:#ffc4c4}.roster-errors-list{max-height:45vh;overflow:auto;overflow-wrap:anywhere}.roster-errors-list ol{padding-left:24px;margin:0}.roster-errors-list li{padding:10px 0;border-bottom:1px solid var(--line);font-size:13px}.roster-errors-list li strong{display:block;color:#ffc4c4;margin-bottom:3px}.roster-errors-list li span{color:#d8dfed}.roster-error-panel{border:1px solid #a35c64;background:#38252b;border-radius:10px;padding:14px;margin-bottom:16px}.roster-error-panel h3{color:#ffc4c4;margin-bottom:8px}.roster-error-panel p{color:#e9c3c7;font-size:12px}.roster-error-panel .roster-errors-list{max-height:200px}.roster-error-panel .actions{gap:8px}input[type=file]{font-size:12px}#roster-error-dialog .actions{justify-content:flex-end;margin-top:18px}

.display-toolbar{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin:0 0 20px}.display-toolbar label{display:flex;align-items:center;gap:10px;margin:0;font-size:14px}.display-toolbar select{background:#202839;color:var(--ink);border:1px solid var(--line);border-radius:8px;padding:10px;font:inherit}.display-toolbar input{max-width:240px}.projection-only{display:none!important}.display-pagination{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-top:16px;flex-wrap:wrap}.display-pagination span{margin-right:auto;color:var(--muted);font-size:13px}.display-pagination button{padding:8px 14px;min-height:36px}.pair-table-scroll{max-height:620px;overflow:auto}.pair-table th{position:sticky;top:0;background:#1a202d;z-index:1}.pair-table td{padding:11px 12px}.round-points{font-size:20px;font-weight:700}.color-tag{display:inline-block;padding:4px 10px;border-radius:6px;font-weight:700}.color-tag.is-red{background:#642f39;color:#ffb0b5}.color-tag.is-blue{background:#263f72;color:#b4cfff}.pair-card-grid{display:grid;gap:14px;grid-template-columns:repeat(2,minmax(0,1fr))}.pair-card-grid .pair-result{margin:0}.projector .projection-only{display:inline-flex!important}.projector .ranking-panel{display:none}.projector.show-ranking .ranking-panel{display:block}.projector.show-ranking .pair-results-panel{display:none}.projector .pair-person strong{font-size:clamp(18px,1.5vw,25px)}.projector .pair-person small{font-size:13px}.projector .pair-result{padding:15px}.projector .pair-choice{width:44px;height:44px;font-size:26px}.projector .pair-side{grid-template-columns:minmax(0,1fr) 44px;gap:10px}.projector .pair-versus{gap:12px}.projector .pair-points strong{font-size:29px}.projector .pair-points span,.projector .pair-label{font-size:13px}.projector .pair-label{margin-bottom:9px}.projector .stats{margin-bottom:18px}.projector .stat{padding:12px 20px}.projector .stats .stat strong{font-size:30px}.projector main{padding:18px 32px}.projector .title-row{margin-bottom:16px}.projector .title-row h1{font-size:32px}.projector .display-toolbar{margin-bottom:14px}.projector .display-toolbar button{padding:9px 14px}.view-tabs [aria-pressed="true"]{background:#e0e8ff;color:#152039}.projector #ranking-pagination{display:block!important}.projector .ranking-panel table td{font-size:19px;padding:9px 16px}.projector .ranking-panel .name-cell strong{font-size:21px}.projector .ranking-panel .score-cell{font-size:26px}@media(min-width:1700px){.projector .pair-card-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:800px){.pair-card-grid{grid-template-columns:1fr}.display-toolbar{gap:10px}.display-toolbar input{max-width:100%}}

.projector .title-row .eyebrow,.projector #host-subtitle{display:none}.projector .title-row h1{font-size:26px;margin:0}.projector .title-row{margin-bottom:10px;align-items:center}.projector .stat{display:flex;align-items:center;justify-content:space-between;padding:8px 14px;gap:12px}.projector .stat>span{font-size:12px}.projector .stats .stat strong{font-size:25px}.projector .stats{gap:12px;margin-bottom:12px}.projector .panel{padding:14px}.projector .pair-results-panel h2{font-size:21px}.projector .pair-results-panel .section-heading{margin-bottom:6px}.projector #pair-results-subtitle{margin:6px 0 12px;font-size:12px}.projector .pair-result{padding:12px}.projector .pair-label{margin-bottom:7px}.projector .pair-points{padding-top:5px}.projector .pair-points strong{font-size:25px}.projector .pair-versus{gap:6px;grid-template-columns:minmax(0,1fr) 10px minmax(0,1fr)}.projector .pair-person strong{font-size:19px}.projector .pair-person small{font-size:11px}.projector .display-pagination{margin-top:12px}.projector .display-toolbar{gap:10px}.projector .display-toolbar select{padding:8px}.projector main{padding:12px 24px}.projector .pair-card-grid{gap:10px}.projector .ranking-panel .name-cell small{font-size:12px}.projector .ranking-panel table td{padding:6px 12px}.projector .ranking-panel>p{font-size:12px;margin:10px 0 0}@media(min-width:1100px){.projector .pair-card-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

.view-tabs button{background:#202839;color:var(--ink);border-color:var(--line)}.view-tabs button[aria-pressed="true"]{background:#e0e8ff;color:#152039}

/* Projection owns the viewport; the host console keeps its normal scrolling layout. */
body.projector{height:100dvh;overflow:hidden}
.projector main{height:100dvh;max-width:none;padding:clamp(10px,1.4vh,20px) clamp(14px,1.5vw,32px);display:flex;flex-direction:column;box-sizing:border-box}
.projector #notice{flex:none;margin:0 0 8px}
.projector #app{display:flex;flex-direction:column;flex:1;min-height:0}
.projector #app>.title-row,.projector #host-stats,.projector .display-toolbar{flex:none}
.projector #app>.title-row{margin:0 0 8px;gap:12px;flex-wrap:nowrap}
.projector #app>.title-row h1{font-size:clamp(20px,2.1vw,34px);line-height:1.2}
.projector .title-row .actions button{min-height:34px;padding:7px 14px;font-size:13px}
.projector .stat{padding:8px 14px;min-height:46px}
.projector .stats .stat strong{font-size:clamp(22px,2.2vw,34px);line-height:1.2}
.projector .display-toolbar{margin:0 0 10px;gap:10px}
.projector .display-toolbar select,.projector .display-toolbar button{padding:7px 12px;min-height:34px;font-size:14px}
.projector .grid{display:flex;flex:1;min-height:0;margin:0;gap:0}
.projector .grid>section{display:flex;flex:1;flex-direction:column;min-height:0;min-width:0}
.projector .pair-results-panel,.projector.show-ranking .ranking-panel{display:flex;flex:1;flex-direction:column;min-height:0;margin:0;padding:clamp(12px,1.4vh,22px);overflow:hidden}
.projector.show-ranking .pair-results-panel,.projector .ranking-panel{display:none}
.projector .pair-results-panel>.section-heading,.projector .ranking-panel>.section-heading,.projector #pair-results-subtitle,.projector #award-banner,.projector #pair-pagination,.projector #ranking-pagination{flex:none}
.projector .pair-results-panel h2,.projector .ranking-panel h2{font-size:clamp(19px,1.65vw,30px);line-height:1.25}
.projector #pair-results-subtitle{margin:5px 0 10px;font-size:clamp(11px,1vw,16px);line-height:1.4}
.projector #pair-results{flex:1;min-height:0;min-width:0}
.projector .pair-card-grid{height:100%;display:grid;grid-template-columns:repeat(var(--pair-columns,3),minmax(0,1fr));grid-template-rows:repeat(var(--pair-rows,2),minmax(0,1fr));gap:12px}
.projector .pair-result{height:100%;min-height:0;box-sizing:border-box;padding:var(--card-padding,12px);display:flex;flex-direction:column;overflow:hidden}
.projector .pair-label{font-size:var(--pair-label,14px);line-height:1.2;margin-bottom:8px;flex:none}
.projector .pair-versus{flex:1;min-height:0;grid-template-columns:minmax(0,1fr) 12px minmax(0,1fr);gap:8px;align-items:stretch}
.projector .pair-side{grid-template-columns:minmax(0,1fr) var(--pair-choice,44px);align-content:center;row-gap:clamp(5px,1vh,16px);column-gap:8px;min-width:0}
.projector .pair-person strong{font-size:var(--pair-name,20px);line-height:1.25}
.projector .pair-person small{font-size:var(--pair-phone,12px);line-height:1.3;margin-top:4px}
.projector .pair-choice{width:var(--pair-choice,44px);height:var(--pair-choice,44px);font-size:calc(var(--pair-choice,44px)*.6);border-radius:12px}
.projector .pair-points{padding-top:clamp(4px,1vh,14px);gap:5px}
.projector .pair-points span{font-size:var(--pair-label,14px)}
.projector .pair-points strong{font-size:var(--pair-points,30px);line-height:1.1}
.projector .pair-divider{display:flex;align-items:center;justify-content:center;font-size:24px}
.projector .pair-results-pending{height:100%;box-sizing:border-box;display:grid;place-items:center;font-size:clamp(18px,2vw,32px)}
.projector .display-pagination{margin:12px 0 0;min-height:34px;gap:10px;flex-wrap:nowrap}
.projector .display-pagination span{font-size:clamp(12px,1vw,17px)}
.projector .display-pagination button{font-size:clamp(12px,1vw,17px);padding:7px 14px;min-height:34px}
.projector #scoreboard{flex:1;min-height:0;overflow:hidden}
.projector #scoreboard table{height:100%;table-layout:fixed}
.projector .ranking-panel th{font-size:clamp(12px,1vw,17px);padding:6px 12px;line-height:1.2}
.projector .ranking-panel table td{font-size:clamp(14px,1.3vw,24px);padding:4px 12px;line-height:1.2}
.projector .ranking-panel .name-cell strong{font-size:clamp(15px,1.5vw,27px);line-height:1.2}
.projector .ranking-panel .name-cell small{font-size:clamp(10px,.8vw,14px);line-height:1.2}
.projector .ranking-panel .score-cell{font-size:clamp(20px,2vw,34px)}
.projector .ranking-panel>p{flex:none;font-size:11px;line-height:1.3;margin:8px 0 0}
.projector #award-banner .round-banner{margin:5px 0 10px;padding:8px 12px;font-size:clamp(12px,1.1vw,18px);line-height:1.3}
@media(max-height:650px){.projector .stats{margin-bottom:8px}.projector .stat{min-height:36px;padding:5px 12px}.projector .display-toolbar{margin-bottom:8px}.projector .pair-label{margin-bottom:5px}.projector .display-pagination{margin-top:8px}.projector .ranking-panel>p{display:none}}
.projector .pair-versus{grid-template-rows:minmax(0,1fr)}.projector .pair-side{min-height:0;grid-template-rows:minmax(0,1fr) auto;row-gap:clamp(4px,.8vh,12px)}.projector .pair-person small{margin-top:2px}.projector .pair-label{margin-bottom:4px}

.pair-link{display:inline-flex;align-items:center;justify-content:center;min-height:28px;padding:4px 8px;background:transparent;border:1px solid #506180;border-radius:6px;color:#bfd1ff;font:inherit;line-height:1.2;cursor:pointer}.pair-link:hover{background:#2d3d59}.pair-link:focus-visible{outline:3px solid #a9c8ff;outline-offset:2px}.pair-label .pair-link{padding:0;border:0;min-height:0;font:inherit;line-height:inherit}.pair-table tr[data-action]{cursor:pointer}.pair-table tr[data-action]:hover{background:#27334a}.pair-result[data-action]{cursor:pointer}.pair-result[data-action]:hover{border-color:#849fed}
/* The live workspace uses the same two card colors on the host and player screens. */
:root {
  --bg: #10131c;
  --panel: #191f2e;
  --line: #384257;
  --ink: #f3f5fb;
  --muted: #acb9cf;
  --red: #ff929a;
  --blue: #9bbaff;
  --green: #8ce2b8;
  --amber: #ffcd86;
  --control: #121725;
  --primary: #dee7ff;
  --primary-ink: #101b34;
}

body {
  isolation: isolate;
  font: 15px/1.55 system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
}

.ambient {
  background:
    radial-gradient(ellipse at 12% 0%, #5026394d, transparent 44%),
    radial-gradient(ellipse at 87% 0%, #243d774d, transparent 45%),
    var(--bg);
}

main {
  max-width: 1352px;
  padding-bottom: 48px;
}

.site-header {
  position: relative;
  padding: 18px 0;
  margin-bottom: 28px;
}

.brand {
  gap: 12px;
  line-height: 1;
}

.brand small {
  color: #bcc7db;
  letter-spacing: .16em;
}

.brand-icon {
  position: relative;
  width: 37px;
  height: 37px;
  isolation: isolate;
  background: #253248;
  border: 1px solid #4b5572;
  border-radius: 9px;
}

.brand-icon::before,
.brand-icon::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 17px;
  border: 1px solid #ffffff70;
  border-radius: 3px;
}

.brand-icon::before {
  background: #df5d69;
  transform: translate(-4px, 1px) rotate(-17deg);
}

.brand-icon::after {
  background: #6e92f0;
  transform: translate(4px, -1px) rotate(14deg);
}

.connection {
  padding: 5px 9px;
  border: 1px solid #4b7a665e;
  border-radius: 999px;
  background: #233930;
  white-space: nowrap;
}

.connection.offline {
  border-color: #826440;
  background: #392c22;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 21px;
  letter-spacing: -.02em;
}

h3 {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.title-row {
  align-items: center;
  margin-bottom: 21px;
}

.title-row p,
.section-heading p {
  margin-bottom: 0;
}

.eyebrow {
  color: #a7b8de;
  letter-spacing: .11em;
}

.panel {
  padding: clamp(18px, 2.1vw, 28px);
  border-radius: 15px;
  box-shadow: 0 8px 26px #05071322;
}

button,
a.button {
  background: var(--primary);
  color: var(--primary-ink);
  border-radius: 9px;
}

button:disabled {
  opacity: 1;
  background: #2b3345;
  border-color: #414b62;
  color: #a3afc5;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #afc5ff;
  outline-offset: 3px;
}

.secondary,
a.secondary {
  background: #28334a;
  border-color: #4b5874;
  color: #eaf0ff;
}

.ghost,
a.button.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

input,
textarea,
select {
  background: var(--control);
  border: 1px solid #515e7a;
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: #8b9ab7;
}

select {
  min-height: 42px;
  border-radius: 8px;
  padding: 7px 11px;
  font: inherit;
}

input[type="file"] {
  white-space: normal;
  max-width: 100%;
  font-size: 13px;
  padding: 7px;
}

input::file-selector-button {
  border: 1px solid #4d5d7a;
  background: #2b374f;
  color: #eaf0ff;
  border-radius: 6px;
  padding: 7px 9px;
  margin-right: 7px;
  font: inherit;
  cursor: pointer;
}

.host-home-heading,
.host-title {
  align-items: center;
}

.host-home-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.create-stage,
.entry-card,
.player-hero,
.host-login {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.create-stage,
.entry-card {
  border-color: #596b91;
  background:
    linear-gradient(115deg, #202942 10%, #232947 55%, #252c4c 78%, #32263c);
}

.create-stage {
  min-height: 210px;
  padding: clamp(22px, 3.2vw, 42px);
}

.create-stage .event-motif,
.entry-card .event-motif,
.host-login .event-motif {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 auto;
  width: 34%;
  overflow: hidden;
  opacity: .77;
  pointer-events: none;
  background-image:
    linear-gradient(135deg, transparent 75%, #a7baff3b 75.4%, transparent 76.1%),
    repeating-linear-gradient(120deg, transparent 0 19px, #8e9fe044 20px, transparent 21px 40px);
  mask-image: linear-gradient(90deg, transparent, black 27%);
}

.event-motif::before,
.event-motif::after {
  content: "";
  position: absolute;
  top: 52%;
  left: 53%;
  width: clamp(45px, 7.8vw, 112px);
  aspect-ratio: 5 / 7;
  border-radius: 12%;
  border: 1px solid #e7eeff7a;
  box-shadow: 0 16px 40px #0b0d2466, inset 0 0 0 7px #0003;
}

.event-motif::before {
  transform: translate(-78%, -52%) rotate(-20deg);
  background:
    radial-gradient(circle at 50% 50%, #ffc1bb 0 12%, transparent 13%),
    repeating-linear-gradient(128deg, transparent 0 11px, #ffb3b834 12px, transparent 13px 24px),
    #a63750;
}

.event-motif::after {
  transform: translate(-22%, -48%) rotate(17deg);
  background:
    linear-gradient(32deg, transparent 42%, #abc2ffb5 43% 46%, transparent 47% 52%, #abc2ffb5 53% 55%, transparent 56%),
    repeating-linear-gradient(43deg, transparent 0 11px, #b3c6ff33 12px, transparent 13px 24px),
    #375eb5;
}

.create-stage .create-stage-form {
  width: 66%;
}

.create-stage-form .form-row {
  align-items: flex-end;
}

.create-stage-form button[type="submit"] {
  min-height: 48px;
  padding: 10px 22px;
  box-shadow: 0 5px 18px #10192d70;
}

.create-stage h2 {
  margin-bottom: 5px;
  font-size: clamp(24px, 3vw, 32px);
}

.create-stage p {
  max-width: min(100%, 38em);
}

.game-list-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.game-list-layout > * {
  min-width: 0;
}

.game-list {
  margin-top: 12px;
}

.game-card {
  background: #20293b;
  border-color: #41516d;
}

.game-card h3 {
  overflow-wrap: anywhere;
}

.game-card .arrow {
  color: #adc2f4;
}

.empty {
  padding-block: 26px;
}

.host-flow {
  display: grid;
  grid-template-columns: minmax(0, 1.33fr) repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
  padding: 0;
  margin: 0 0 22px;
  list-style: none;
}

.flow-step {
  min-width: 0;
  min-height: 100%;
  padding: clamp(15px, 1.8vw, 23px);
  border: 1px solid #444e64;
  border-radius: 14px;
  background: #171e2e;
  scroll-margin: 20px;
}

.flow-step.flow-current {
  border-color: #92aef3;
  background: #202d47;
  box-shadow: inset 0 3px #8da8f2;
}

.flow-step.flow-complete {
  border-color: #4d736b;
  background: #182831;
}

.flow-step.flow-locked {
  background: #171c29;
}

.flow-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 11px;
  color: #bac8e1;
  font-size: 13px;
  font-weight: 650;
}

.flow-kicker h3 {
  margin: 0;
}

.host-flow > .flow-step {
  margin-bottom: 0;
}

.step-number,
.flow-kicker strong,
.flow-kicker .flow-number {
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  min-height: 27px;
  padding-inline: 4px;
  border-radius: 7px;
  color: #e7eeff;
  background: #3a4d76;
  font-variant-numeric: tabular-nums;
}

.flow-complete .step-number {
  color: #b3f1d3;
  background: #315243;
}

.flow-body h2 {
  margin-bottom: 7px;
}

.flow-body p,
.flow-step > p {
  margin-bottom: 11px;
}

.flow-body form .actions {
  margin-top: 10px;
}

.flow-body summary {
  color: #c5d6ff;
}

.flow-step .panel {
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.flow-step .round-control h2 {
  margin-bottom: 8px;
}

.attendance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 238px), 1fr));
  gap: 10px;
}

.attendance-grid,
.attendance-pair > ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.attendance-pair {
  min-width: 0;
  padding: 10px;
  background: #141b29;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.attendance-pair h3,
.attendance-pair-label {
  margin: 0 0 8px;
  padding-inline: 2px;
  color: #c4d1ea;
  font-size: 13px;
}

.attendance-person {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #41495d;
  border-radius: 6px;
  background: #262e3e;
  color: #c5cedf;
}

.attendance-person + .attendance-person {
  margin-top: 5px;
}

.attendance-person.is-present {
  border-color: #477967;
  background: #213a32;
  color: #b2f1d0;
}

.attendance-person.is-absent {
  border-color: #42495a;
  background: #252c39;
  color: #b8c1d3;
}

.attendance-person span:first-child,
.attendance-person strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.attendance-person small,
.attendance-person span:last-child {
  flex: none;
  color: inherit;
  font-size: 11px;
  white-space: nowrap;
}

.host-live {
  display: grid;
  grid-template-columns: minmax(240px, .9fr) minmax(0, 2fr);
  gap: 16px;
  align-items: start;
}

.host-live > * {
  min-width: 0;
}

.live-results {
  min-width: 0;
}

.round-control {
  border-top: 3px solid #8da8f2;
}

.stats {
  gap: 10px;
}

.stat {
  background: #1a2233;
}

.stat strong {
  line-height: 1.25;
  margin-top: 4px;
}

.game-rules {
  position: relative;
  padding: clamp(15px, 2vw, 25px);
  margin: 0 0 22px;
  border: 1px solid #4a5876;
  border-radius: 14px;
  background: #1b2436;
}

.host-rules,
#entry-rules,
#player-rules {
  scroll-margin: 20px;
}

.rules-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 15px;
  margin-bottom: 14px;
}

.rules-intro h2,
.rules-intro p {
  margin: 0;
}

.rules-intro h2 {
  text-wrap: balance;
}

.rules-intro p,
.rules-notes {
  color: var(--muted);
  font-size: 13px;
}

.rules-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rule-match {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 9px 10px;
  justify-content: space-between;
  gap: 6px 11px;
  border: 1px solid #46526e;
  border-radius: 8px;
  background: #131b2a;
}

.rule-chip {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 27px;
  padding: 1px 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.rule-chip.is-red {
  background: #68303c;
  color: #ffd2d3;
  border-color: #b9747b;
}

.rule-chip.is-blue {
  background: #263f75;
  color: #cfdbff;
  border-color: #6584bd;
}

.rule-score {
  color: #edf3ff;
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.rules-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
  margin: 14px 0 0;
  padding-inline-start: 1.2em;
}

.rules-notes p {
  margin: 0;
}

.rules-notes strong,
.rules-notes b {
  color: #dce7ff;
}

.round-timer {
  padding: 13px 15px;
  margin-block: 12px;
  border: 1px solid #53678e;
  border-radius: 10px;
  color: #dbe6ff;
  background: #192741;
}

.round-timer.is-discussion {
  border-color: #796b98;
  color: #f0e4ff;
  background: #2a253c;
}

.round-timer.is-urgent,
.round-timer.is-ended {
  border-color: #94683f;
  color: #ffe0b3;
  background: #3a2b23;
}

.timer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
}

.timer-time {
  font-size: clamp(23px, 3.8vw, 36px);
  font-weight: 730;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.timer-progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 6px;
  margin-block: 8px;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  color: #8eafff;
  background: #405176;
}

.timer-progress::-webkit-progress-bar {
  background: #405176;
}

.timer-progress::-webkit-progress-value {
  background: currentColor;
}

.timer-progress::-moz-progress-bar {
  background: currentColor;
}

.is-urgent .timer-progress,
.is-ended .timer-progress {
  color: #ffc181;
}

.timer-message {
  margin: 0;
  color: inherit;
  font-size: 13px;
}

.player-shell {
  max-width: 610px;
}

.player-shell .game-rules,
.player-shell .panel {
  margin-bottom: 14px;
}

.player-entry-map {
  margin: 14px 0;
  padding-inline-start: 1.4em;
  color: #c2d1ee;
}

.player-entry-map li + li {
  margin-top: 5px;
}

.rejoin-note {
  margin-top: 12px;
  padding: 10px 13px;
  border-left: 3px solid #86a3e3;
  background: #202d45;
  color: #d6e1f8;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.player-hero {
  background: linear-gradient(120deg, #2c2133, #1b2840 68%);
  border-color: #4c5670;
}

.player-overview {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.player-hero .player-heading {
  margin-bottom: 0;
}

.player-score {
  background:
    repeating-linear-gradient(127deg, #8da5e307 0 1px, transparent 1px 16px),
    #192236;
}

.player-score .score {
  font-variant-numeric: tabular-nums;
}

.choices button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 120px;
  border-radius: 13px;
}

.choices button::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 6px;
  background: repeating-linear-gradient(131deg, #fff2 0 1px, transparent 1px 16px);
  border: 1px solid #fff6;
  border-radius: 9px;
  opacity: .7;
}

.choice-red {
  background: #a82e49;
  color: white;
  border-color: #f78d97;
}

.choice-blue {
  background: #2d57b3;
  color: white;
  border-color: #9cbcff;
}

#qr-dialog,
#confirm-dialog {
  background: #1a2438;
}

#qr-dialog h2 {
  margin-right: 35px;
  overflow-wrap: anywhere;
}

#qr-dialog img {
  width: min(100%, 300px);
  height: auto;
}

.review-duration {
  color: #d8e5ff;
  font-variant-numeric: tabular-nums;
}

.review-unscored {
  color: #ffd798;
}

/* Keep projection independent of the host-only step and control wrappers. */
.projector .host-flow,
.projector .attendance-grid,
.projector .host-live > .sidebar {
  display: none !important;
}

.projector .host-live,
.projector .host-live > .live-results {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  align-items: stretch;
  gap: 0;
}

.projector .game-rules {
  display: none;
}

@media (max-width: 960px) {
  .host-flow {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .host-live {
    grid-template-columns: 1fr;
  }

  .host-live > .sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 690px) {
  .create-stage .create-stage-form {
    width: 100%;
  }

  .create-stage .event-motif,
  .entry-card .event-motif {
    width: 42%;
    height: 105px;
    opacity: .45;
  }

  .game-list-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .rules-notes {
    grid-template-columns: 1fr;
  }

  .rule-match {
    justify-content: flex-start;
    padding: 7px;
  }
}

@media (max-width: 400px) {
  .site-header {
    gap: 8px;
    margin-bottom: 20px;
  }

  .header-note {
    padding-left: 8px;
    letter-spacing: -.04em;
  }

  .connection {
    padding: 3px 6px;
  }

  .brand-icon {
    width: 29px;
    height: 29px;
  }

  .brand {
    gap: 6px;
  }

  .rules-matrix {
    gap: 5px;
  }

  .rule-match {
    padding: 6px;
    gap: 4px;
  }

  .rule-score {
    font-size: 12px;
  }
}

@media (max-width: 350px) {
  .rules-matrix {
    grid-template-columns: 1fr;
  }

  .rule-match,
  .player-shell .rule-match,
  .player-entry-map .rule-match {
    justify-content: space-between;
    padding-inline: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  button:hover:not(:disabled),
  a.button:hover {
    transform: none;
  }
}


.create-stage-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, 120px);
  align-items: end;
  gap: 10px;
}

.create-stage-fields > * {
  min-width: 0;
}

.create-stage-fields label {
  margin-top: 0;
}

.create-stage-fields .actions {
  margin: 0;
}

.flow-status {
  color: var(--muted);
  font-size: 12px;
}

.flow-current .flow-status {
  color: #c5d8ff;
}

.flow-complete .flow-status {
  color: var(--green);
}

.attendance-panel summary {
  margin: -6px 0 8px;
}

.attendance-summary {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 13px;
  margin-inline-start: 8px;
  color: var(--muted);
}

.attendance-summary .badge {
  font-size: 12px;
}

.start-pair-preview {
  padding: 9px 10px;
  margin-block: 12px;
  border-left: 3px solid #d6aa6b;
  border-radius: 0 8px 8px 0;
  color: #ffe0b8;
  background: #382f2a;
  font-size: 13px;
}

.host-rules .game-rules,
.game-rules-panel .game-rules {
  margin: 0;
}

.host-rules,
.game-rules-panel {
  background: #1b2436;
}

.host-rules .game-rules,
.game-rules-panel .game-rules {
  padding: 0;
  background: transparent;
  border: 0;
}

.rules-notes li {
  padding-inline-start: 2px;
}

.rules-notes strong {
  display: inline-block;
  margin-inline-end: .4em;
}

.player-entry-map {
  max-width: 610px;
  margin: 0 auto;
  padding: 0;
  color: var(--ink);
}

.entry-card {
  background:
    linear-gradient(115deg, #25243a, #232d4b 74%, #362b47);
}

.entry-card::after {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto auto;
  width: 43%;
  height: 160px;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 75%, #bba7ff37 75.4%, transparent 76.1%),
    repeating-linear-gradient(120deg, transparent 0 19px, #979de625 20px, transparent 21px 40px);
  mask-image: radial-gradient(ellipse at 95% 0%, #000, transparent 76%);
}

.entry-card #join-form button[type="submit"] {
  width: 100%;
  margin-top: 12px;
  min-height: 48px;
}

.form-error {
  margin: 6px 0 0;
  color: #ffadb2;
  font-size: 13px;
}

.player-overview {
  display: block;
}

.player-overview .player-heading {
  margin-bottom: 16px;
  gap: 10px;
}

.player-overview .player-heading > div {
  min-width: 0;
}

.player-overview .player-heading > a {
  flex-shrink: 0;
}

.player-overview .player-heading h1 {
  margin-bottom: 4px;
}

.player-overview .eyebrow {
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.player-overview .player-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  text-align: left;
  padding: 12px 13px;
  border: 1px solid #505f7f;
  border-radius: 9px;
}

.player-overview .player-score > div + div {
  border-left: 1px solid #525f7b;
  padding-left: 13px;
}

.player-overview .player-score .small {
  display: block;
  color: #bfcee9;
}

.player-overview .player-score .score {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.025em;
}

.player-overview .player-score strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.player-active .round-banner {
  margin-bottom: 12px;
}

.player-active .empty {
  padding-block: 16px;
}

.player-active .empty p {
  margin-bottom: 0;
}

.result-round {
  width: auto;
  min-width: 45px;
  flex-shrink: 0;
}

@media (max-width: 680px) {
  .create-stage-fields {
    grid-template-columns: minmax(0, 1fr) minmax(74px, 96px);
  }

}

@media (max-width: 400px) {
  .rule-match > :first-child {
    white-space: nowrap;
  }

  .player-shell .game-rules,
  .player-entry-map .game-rules {
    padding: 12px;
  }

  .player-shell .rule-match,
  .player-entry-map .rule-match {
    padding: 5px;
  }

  .player-shell .rule-chip,
  .player-entry-map .rule-chip {
    min-width: 18px;
    padding-inline: 3px;
  }
}


/* The projection tab keeps the entry code beside the live results. */
.projection-workspace {
  display: contents;
}

.projection-entry,
.projection-fullscreen {
  display: none;
}

.projector {
  --projection-rail: clamp(216px, 21vw, 320px);
  --projection-gap: clamp(12px, 1.4vw, 24px);
  --projection-gutter: clamp(14px, 1.5vw, 32px);
}

.projector .projection-fullscreen,
.projector .title-row .projection-exit {
  display: inline-flex;
}

.projector #app > .title-row {
  align-items: center;
  justify-content: space-between;
}

.projector .title-row .actions {
  flex-shrink: 0;
}

.projector .title-row h1 {
  overflow-wrap: anywhere;
}

.projector .projection-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--projection-rail);
  align-items: stretch;
  gap: var(--projection-gap);
  min-width: 0;
  min-height: 0;
  flex: 1;
}

.projector .projection-entry {
  display: flex;
  flex-direction: column;
  align-self: start;
  grid-column: 2;
  min-width: 0;
  min-height: 0;
  padding: clamp(14px, 1.7vw, 24px);
  border: 1px solid #50628b;
  border-radius: 16px;
  background: linear-gradient(155deg, #242d49, #182235);
  color: #eef3ff;
}

.projection-entry-inner {
  display: grid;
  gap: 14px;
}

.projection-qr-media {
  display: grid;
  place-items: center;
  min-width: 0;
}

#projection-qr {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  padding: 4px;
  border-radius: 9px;
  background: #fff;
  image-rendering: pixelated;
}

#projection-qr-status {
  margin: 0;
  text-align: center;
  color: #e6edfd;
}

#projection-qr-status:empty {
  display: none;
}

.projection-qr-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.projection-qr-copy h2,
.projection-qr-copy strong {
  display: block;
  margin: 0 0 5px;
  font-size: clamp(18px, 1.65vw, 25px);
  line-height: 1.2;
}

.projection-qr-copy p {
  margin: 0 0 7px;
  color: #d1ddf3;
  line-height: 1.45;
}

.projection-qr-copy p:last-child {
  margin-bottom: 0;
}

.projector.projection-lobby .projection-workspace {
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  overflow: auto;
}

.projector.projection-lobby .projection-entry {
  grid-column: 1;
  align-self: center;
  padding: clamp(18px, 3vw, 44px);
  max-width: min(100%, 1050px);
  width: 100%;
  margin: auto;
  border-radius: 22px;
}

.projector.projection-lobby .projection-entry-inner {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: center;
  gap: clamp(20px, 4vw, 54px);
}

.projector.projection-lobby #projection-qr {
  max-width: clamp(175px, 69vh, 470px);
  border-radius: 14px;
}

.projector.projection-lobby .projection-qr-copy h2,
.projector.projection-lobby .projection-qr-copy strong {
  font-size: clamp(24px, 3vw, 48px);
}

.projector.projection-lobby .projection-qr-copy p {
  font-size: clamp(14px, 1.5vw, 22px);
  margin-top: 12px;
}

#qr-dialog {
  max-width: 475px;
  max-height: calc(100dvh - 24px);
  overflow: auto;
}

#qr-dialog img {
  width: min(100%, 260px, 42dvh);
  margin-top: 12px;
  margin-bottom: 14px;
  image-rendering: pixelated;
}

#qr-dialog .qr-actions {
  justify-content: flex-start;
  gap: 8px;
  margin-block: 16px 10px;
}

#qr-dialog .qr-actions > * {
  flex: 1 1 auto;
  white-space: nowrap;
}

#qr-instructions p {
  margin: 6px 0 0;
  color: #d1ddf3;
  line-height: 1.55;
}

@media (max-width: 760px) {
  body.projector {
    height: auto;
    overflow: visible;
  }

  .projector main {
    height: auto;
    min-height: 100dvh;
  }

  .projector #app > .title-row {
    flex-wrap: wrap;
    margin-bottom: 12px;
  }

  .projector .title-row .actions {
    flex-shrink: 1;
  }

  .projector .projection-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(430px, auto);
  }

  .projector .projection-entry {
    grid-column: 1;
    grid-row: 1;
  }

  .projector:not(.projection-lobby) .projection-entry {
    position: sticky;
    top: 8px;
    z-index: 2;
  }

  .projector:not(.projection-lobby) .projection-entry-inner {
    grid-template-columns: minmax(0, 1fr) minmax(84px, min(30vw, 152px));
    align-items: center;
  }

  .projector .projection-workspace .host-live {
    grid-column: 1;
    grid-row: 2;
    min-height: 430px;
  }

  .projector.projection-lobby .projection-workspace {
    grid-template-rows: minmax(0, 1fr);
    overflow: visible;
  }
}

@media (max-width: 490px) {
  .projector.projection-lobby .projection-entry-inner {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .projector.projection-lobby #projection-qr {
    width: min(100%, 280px);
  }

  #qr-dialog {
    padding: 16px;
  }
}

/* Normal host console. The projector uses its own presentation layout. */
body:not(.projector) .host-title .projection-exit,
#host-connection {
  display: none;
}

.projector .host-session-layout,
.projector .host-session-content {
  display: contents;
}

.host-console {
  --host-gutter: clamp(12px, 1.25vw, 24px);
  --host-gap: clamp(12px, 1vw, 18px);
  --host-surface: #1a2332;
  --host-raised: #202d40;
  --host-stroke: #3d4c64;
  background: #101722;
}

.host-console main {
  max-width: none;
  padding: 0 var(--host-gutter);
}

.host-console .site-header,
.host-console .ambient {
  display: none;
}

.host-console .host-title {
  align-items: center;
  gap: 8px var(--host-gap);
  margin: 0 calc(-1 * var(--host-gutter)) var(--host-gap);
  padding: 10px var(--host-gutter);
  border-bottom: 1px solid var(--host-stroke);
  background:
    linear-gradient(100deg, #8f425326, transparent 26%, transparent 68%, #436bad24),
    #171f2e;
}

.host-console .host-top-context,
.host-console .host-top-identity,
.host-console .host-top-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
}

.host-console .host-back {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding-inline-end: 12px;
  border-inline-end: 1px solid #46536c;
  font-size: 13px;
  white-space: nowrap;
}

.host-console .host-title h1 {
  margin: 0;
  font-size: clamp(25px, 2vw, 33px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.host-console #host-subtitle {
  margin: 0;
  color: #b3c1d7;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.host-console .host-phase-chip {
  border-color: #52698e;
  background: #273a57;
  color: #d5e4ff;
}

.host-console .host-phase-chip[data-phase="OPEN"] {
  border-color: #437c70;
  background: #20423d;
  color: #adf2d4;
}

.host-console .host-phase-chip[data-phase="REVEALED"] {
  border-color: #756142;
  background: #443825;
  color: #ffe0ac;
}

.host-console .host-title .actions {
  gap: 6px 10px;
}

.host-console .host-title .actions :is(button, a.button) {
  min-height: 36px;
  padding: 6px 11px;
  background: #202c40;
  border-color: #475775;
  color: #e7edff;
  font-size: 13px;
  white-space: nowrap;
}

.host-console #host-connection {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 30px;
  margin: 0;
}

.host-console #notice {
  position: fixed;
  inset: auto var(--host-gutter) 12px auto;
  width: max-content;
  max-width: calc(100% - 2 * var(--host-gutter));
  margin: 0;
  max-height: 40dvh;
  overflow: auto;
}

.host-console .host-session-layout {
  display: grid;
  grid-template-columns: clamp(245px, 18vw, 308px) minmax(0, 1fr);
  align-items: start;
  gap: var(--host-gap);
}

.host-console :is(.host-prep, .host-session-content) {
  min-width: 0;
}

.host-console .host-prep > .section-heading {
  min-height: 32px;
  margin: 0 0 9px;
  padding: 0 2px;
}

.host-console #workflow-summary {
  color: #b8c9e3;
  line-height: 1.4;
}

.host-console :is(.host-prep, .live-results) .section-heading {
  align-items: baseline;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.host-console .host-prep .section-heading h2,
.host-console .live-results h2 {
  font-size: 18px;
}

.host-console .host-flow {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  margin: 0;
}

.host-console .live-results > .panel,
.host-console .host-flow > .flow-step {
  min-height: 0;
  padding: 14px 15px;
  border-color: var(--host-stroke);
  border-radius: 12px;
  background: var(--host-surface);
}

.host-console .live-results > .panel {
  margin: 0;
}

.host-console .host-flow > .flow-current {
  border-color: #577394;
  background: var(--host-raised);
  box-shadow: inset 2px 0 #8eaaf4;
}

.host-console .flow-kicker {
  gap: 6px 8px;
  margin-bottom: 8px;
}

.host-console .flow-kicker h3 {
  color: #eff4ff;
  font-size: 15px;
}

.host-console .flow-body p {
  margin-block: 0 8px;
}

.host-console .flow-body :is(button, a.button) {
  min-height: 38px;
  padding: 6px 10px;
  font-size: 13px;
}

.host-console .flow-body button[type="submit"],
.host-console :is(#round-button, #live-round-button):not(:disabled) {
  background: #adc3ff;
  border-color: #c4d4ff;
  color: #132344;
}

.roster-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 7px;
}

.roster-file-field {
  flex: 1 1 100%;
  min-width: 0;
}

.roster-file-field label,
.roster-mode-row label {
  margin: 0 0 3px;
}

.roster-file-field input[type="file"] {
  width: 100%;
  min-height: 39px;
  padding: 5px;
}

.roster-file-field input::file-selector-button {
  min-height: 27px;
  margin-inline-end: 6px;
}

.roster-upload-row > :is(button, .roster-template-link) {
  flex: 1 1 auto;
}

.roster-help {
  margin-top: 6px;
  color: #b6c4df;
}

.roster-mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-block: 6px;
}

.roster-mode-row p {
  flex-basis: 100%;
}

.roster-mode-row select {
  min-height: 35px;
  padding: 5px 9px;
  font-size: 13px;
}

.host-console .host-config {
  margin-top: 5px;
}

.host-console .host-config summary {
  padding: 4px 0;
}

#host-entry-card {
  min-width: 0;
  scroll-margin: 16px;
}

#host-entry-title {
  outline-offset: 4px;
}

.host-entry-heading p {
  color: #b8c7e0;
}

.host-entry-media {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  margin-block: 9px;
}

#host-entry-qr-status {
  max-width: 24em;
  color: #c1cde4;
  font-size: 13px;
  text-align: center;
}

.host-console .flow-body .host-entry-image-button {
  display: block;
  width: min(100%, 164px);
  padding: 5px;
  border: 1px solid #fff;
  border-radius: 8px;
  background: #fff;
}

.host-console .host-entry-image-button:hover:not(:disabled) {
  filter: none;
  transform: none;
  box-shadow: 0 0 0 2px #8faef7;
}

.host-entry-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  image-rendering: pixelated;
}

.host-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.host-entry-actions > :is(button, a.button) {
  flex: 1 1 auto;
}

.host-console #host-entry-feedback {
  margin: 6px 0 0;
  color: #c1d6ff;
}

.host-console #host-round-controls {
  border-top: 0;
}

.host-console #round-control-title {
  margin: 0 0 5px;
  font-size: 16px;
  line-height: 1.4;
}

.host-console #host-round-controls .round-timer {
  margin-block: 8px 0;
  padding: 9px;
}

.host-console #host-round-controls .timer-time {
  font-size: clamp(25px, 3vw, 34px);
}

.host-console :is(#round-button, #live-round-button) {
  width: 100%;
}

.host-console #pair-results {
  container: host-board / inline-size;
  max-height: max(230px, calc(100dvh - 220px));
  padding-inline-end: 3px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}

.host-console #pair-results:focus-visible {
  outline: 2px solid #91b4ff;
  outline-offset: 2px;
}

.host-console .arena-overview {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  border: 1px solid #354861;
  border-radius: 9px;
  background: #141e2d;
}

.host-console .arena-metric {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 12px;
}

.host-console .arena-metric + .arena-metric {
  border-inline-start: 1px solid #354861;
}

.host-console .arena-metric h3 {
  margin: 0;
  color: #c0cde0;
  font-size: 12px;
  font-weight: 650;
}

.host-console .arena-metric p {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1px 7px;
  margin: 1px 0 0;
  color: #b3c3da;
  font-size: 12px;
  line-height: 1.3;
}

.host-console .arena-metric strong {
  color: #f2f6ff;
  font-size: 18px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.host-console #response-count[data-complete="true"] {
  color: #9ee4c7;
}

.host-console #response-count[data-complete="false"] {
  color: #ffdfaa;
}

.host-console .arena-toolbar,
.host-console .arena-score-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.host-console .arena-toolbar {
  gap: 8px 14px;
  min-width: 0;
  margin-inline-start: auto;
}

.host-console .arena-score-actions {
  gap: 6px;
}

.host-console .arena-score-actions .button {
  min-height: 36px;
  padding: 5px 10px;
  border-color: #4a5e7e;
  font-size: 13px;
}

.host-console #show-scores-button {
  background: #29436a;
  border-color: #5477af;
}

.host-console .host-live {
  display: block;
}

.host-console .stats {
  margin-bottom: var(--host-gap);
}

.host-console .stat {
  padding: 10px 12px;
  border-color: var(--host-stroke);
  background: var(--host-surface);
}

.host-console .stat strong {
  font-size: clamp(20px, 2vw, 28px);
}

.host-console .pair-results-panel {
  padding: clamp(13px, 1.25vw, 20px);
  background: #152031;
}

.host-console .section-heading.arena-heading {
  align-items: center;
  gap: 10px clamp(12px, 1.4vw, 24px);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #34435b;
}

.host-console .arena-heading-copy {
  min-width: 0;
}

.host-console .arena-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 9px;
}

.host-console .arena-heading-copy h2 {
  margin: 0;
  color: #f1f5ff;
  font-size: 20px;
  letter-spacing: .01em;
}

.host-console .arena-round {
  padding: 2px 7px;
  border: 1px solid #46628c;
  border-radius: 5px;
  background: #243653;
  color: #dce8ff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.host-console #pair-results-subtitle {
  margin: 3px 0 0;
  color: #b5c6e0;
  line-height: 1.4;
}

.host-console .arena-heading .display-toolbar {
  min-width: 0;
  gap: 6px;
  margin: 0;
}

.host-console .arena-heading :is(select, input) {
  min-height: 36px;
  padding: 5px 8px;
  background: #131d2d;
  border-color: #435575;
  font-size: 13px;
}

.host-console .arena-heading #pair-filter {
  width: 142px;
  max-width: 100%;
}

.host-console .match-board-waiting {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 148px;
  padding: 20px;
  text-align: center;
  border: 1px solid #32435b;
  border-radius: 10px;
  background:
    linear-gradient(122deg, #7c3a4824, transparent 33%, transparent 67%, #5272ac26),
    #101a2a;
}

.host-console .match-board-waiting::before {
  content: "";
  width: 28px;
  height: 39px;
  margin: 0 22px 13px 0;
  border: 1px solid #aa6d7c;
  border-radius: 5px;
  background: #773a4a;
  box-shadow: 22px 2px 0 -1px #3b5785, 22px 2px 0 #6c89bc;
  transform: rotate(-10deg);
}

.host-console .match-board-waiting > strong {
  color: #edf3ff;
  font-size: 16px;
}

.host-console .match-board-waiting > p {
  margin: 5px 0 0;
  color: #b3c4e1;
  font-size: 13px;
}

.host-console .match-board-grid {
  display: grid;
  grid-template-columns: minmax(0, min(100%, 280px));
  align-items: start;
  gap: 10px;
}

@container host-board (min-width: 320px) {
  .host-console .match-board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container host-board (min-width: 550px) {
  .host-console .match-board-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@container host-board (min-width: 740px) {
  .host-console .match-board-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@container host-board (min-width: 980px) {
  .host-console .match-board-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

:is(.host-console, .projector) .match-group {
  display: grid;
  grid-template-rows: max-content 1fr;
  min-width: 0;
  padding: 7px;
  border: 1px solid #41536e;
  border-radius: 9px;
  background: #1b293c;
}

:is(.host-console, .projector) .match-group[data-state="partial"] {
  border-color: #826746;
}

:is(.host-console, .projector) .match-group[data-state="complete"] {
  border-color: #417364;
  background: #192e34;
}

:is(.host-console, .projector) .match-group-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-height: 28px;
  margin: 0 0 8px;
}

:is(.host-console, .projector) .match-group-id {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: #edf4ff;
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

:is(.host-console, .projector) .match-group-status {
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid #516582;
  border-radius: 6px;
  background: #23334a;
  color: #d3e0f7;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

:is(.host-console, .projector) .match-group[data-state="partial"] .match-group-status,
:is(.host-console, .projector) .match-group[data-state="incomplete"] .match-group-status {
  border-color: #846744;
  background: #3c3025;
  color: #ffe0b3;
}

:is(.host-console, .projector) .match-group[data-state="complete"] .match-group-status {
  border-color: #477e70;
  background: #20453b;
  color: #c0ffe8;
}

.host-console .match-group {
  aspect-ratio: 1;
}

.host-console .match-group-review {
  padding: 3px 7px;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

:is(.host-console, .projector) .match-group-players {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

:is(.host-console, .projector) .match-player {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 58px;
  padding: 8px 5px;
  border: 1px solid #3d4f6b;
  border-radius: 6px;
  background: #131f30;
  text-align: center;
}

.host-console .match-player[data-side="red"] {
  border-color: #874e64;
  background: #582c42;
}

.host-console .match-player[data-side="blue"] {
  border-color: #5375ae;
  background: #294575;
}

:is(.host-console, .projector) .match-player-name {
  max-width: 100%;
  color: #f0f4ff;
  font-size: clamp(17px, 2cqi, 20px);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.host-console .match-player-credential {
  max-width: 100%;
  color: #f0eff7;
  font-size: clamp(14px, 1.5cqi, 15px);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.host-console .match-player-credential code {
  font-size: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

:is(.host-console, .projector) .match-player-detail {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3px 6px;
  color: #e3eafa;
  font-size: clamp(14px, 1.6cqi, 16px);
  line-height: 1.4;
}

:is(.host-console, .projector) .match-answer-status {
  padding: 2px 7px;
  border: 1px solid #aabbd344;
  border-radius: 6px;
  background: #10182740;
}

:is(.host-console, .projector) [data-answered="true"] .match-answer-status {
  border-color: #83d6b460;
  color: #c2f3dd;
  background: #12352c80;
}

.projector #pair-results {
  overflow: auto;
}

.projector .match-board-grid {
  display: grid;
  min-height: 100%;
  grid-template-columns: repeat(var(--pair-columns, 3), minmax(0, 1fr));
  grid-template-rows: repeat(var(--pair-rows, 2), minmax(min-content, 1fr));
  gap: 12px;
}

.projector .match-group {
  padding: var(--card-padding, 12px);
}

.projector .match-group-id,
.projector .match-group-status,
.projector .match-player-detail {
  font-size: var(--pair-label, 14px);
}

.projector .match-player-name {
  font-size: var(--pair-name, 20px);
}

.projector .match-board-waiting {
  display: grid;
  min-height: 100%;
  place-content: center;
  text-align: center;
}

#host-rules-dialog {
  box-sizing: border-box;
  width: calc(100% - 24px);
  max-width: 690px;
  max-height: calc(100dvh - 24px);
  padding: clamp(15px, 3vw, 26px);
  overflow: auto;
  border-color: #596e92;
  background: #1b2435;
}

.host-rules-dialog-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.host-rules-dialog-header h2 {
  margin: 0;
}

#host-rules-dialog .game-rules {
  margin-bottom: 0;
  padding-inline: 0;
  border: 0;
  background: transparent;
}

@media (max-width: 1089px) {
  .host-console .host-session-layout {
    grid-template-columns: minmax(218px, 250px) minmax(0, 1fr);
  }

  .host-console #pair-results {
    max-height: 56dvh;
  }
}

@media (max-width: 820px) {
  .host-console .arena-toolbar {
    margin-inline-start: 0;
  }

  .host-console .host-session-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .host-console #pair-results {
    max-height: none;
    padding-inline-end: 0;
    overflow: visible;
    scrollbar-gutter: auto;
  }
}

@media (max-width: 565px) {
  .host-console .host-title {
    align-items: flex-start;
  }

  .host-console .host-top-context {
    gap: 4px 8px;
  }

  .host-console .host-top-meta {
    flex-basis: 100%;
  }
}
