:root{color-scheme:dark;--bg:#101916;--panel:#1c2722;--line:#344139;--text:#f4f6ec;--muted:#a1b1a3;--lime:#d4f872;--mint:#a4dfd1;--ink:#172018}*{box-sizing:border-box}html{min-height:100%;background:var(--bg)}body{margin:0;color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;background:radial-gradient(ellipse at 50% -15%,#304733 0,transparent 50%),var(--bg);min-height:100vh}button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.43;cursor:not-allowed}[hidden]{display:none!important}.app-shell{max-width:620px;margin:auto;padding:0 20px calc(28px + env(safe-area-inset-bottom))}.topbar{height:82px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #ffffff17}.brand{display:flex;align-items:center;gap:10px;color:inherit;text-decoration:none;font-weight:750;font-size:17px;letter-spacing:.04em}.brand small{display:block;color:#90a091;font-size:8px;letter-spacing:.19em;margin-top:3px}.brand-mark{display:grid;place-items:center;width:38px;height:38px;border-radius:13px;background:var(--lime);color:#1c2a19;font-size:25px}.top-status{display:flex;align-items:center;gap:7px;color:#b0c0ac;font-size:12px;white-space:nowrap}.top-status i,.presence-pill i{width:7px;height:7px;border-radius:50%;background:#8ca18c}.top-status[data-status=online] i,.presence-pill i{background:#c9f16e;box-shadow:0 0 10px #c9f16e80}.top-status[data-status=offline] i{background:#ed947b}.intro{padding:50px 2px 31px}.eyebrow,.step{color:#b5cf9b;font-size:10px;font-weight:750;letter-spacing:.17em}.eyebrow{display:flex;align-items:center;gap:8px}.eyebrow span{width:19px;height:2px;background:var(--lime)}.intro h1{font-size:clamp(39px,9vw,57px);line-height:1.18;letter-spacing:-.06em;margin:18px 0;color:#f3f6ed}.intro h1 em{color:var(--lime);font-style:normal}.intro p{line-height:1.7;color:var(--muted);font-size:14px;margin:0}.panel{background:#1c2922;border:1px solid #405246;border-radius:22px;padding:21px}.section-title,.join-panel,.match-heading{display:flex;justify-content:space-between;align-items:flex-start}.section-title h2{font-size:21px;margin:8px 0 23px;letter-spacing:.02em}.shuttle{font-size:26px;color:#b4d589}.team-inputs,.selection-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.setup label{display:block;min-width:0}.setup label>span{display:block;color:#b8c9b8;font-size:12px;margin:0 0 8px}.setup input,.setup select,.modal input{width:100%;border:1px solid #415047;border-radius:10px;background:#152019;color:#f5f7ee;padding:0 12px;height:46px;outline:none}.setup input:focus,.setup select:focus,.modal input:focus{border-color:var(--lime)}.setup select{appearance:auto;font-size:13px}.selection-grid{margin-top:17px}.mode-row{margin-top:17px}.dot{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:4px}.dot.a{background:var(--lime)}.dot.b{background:var(--mint)}.rule-note{font-size:11px;color:#a9baa8;line-height:1.6;margin:13px 0}.primary,.secondary{border:0;border-radius:11px;min-height:50px;font-weight:750}.primary{background:var(--lime);color:#1b2918}.primary span,.secondary span{float:right}.primary.full{width:100%;text-align:left;padding:0 17px}.join-panel{padding:25px 2px;gap:12px;border-bottom:1px solid #ffffff18}.join-panel h3{font-size:16px;margin:8px 0}.join-panel p{font-size:12px;color:var(--muted);margin:0;line-height:1.5}.secondary{padding:0 14px;background:#2a3930;color:#edf5e6;white-space:nowrap;font-size:12px}.secondary span{margin-left:11px}.lobby-foot{display:flex;gap:16px;flex-wrap:wrap;padding:19px 0;color:#849888;font-size:10px}.match-heading{margin-top:31px;align-items:center}.match-heading h1{font-size:25px;margin:8px 0 6px;letter-spacing:-.02em}.match-heading p{color:var(--muted);font-size:12px;margin:0}.icon-button{background:#28362e;color:#dce8d9;border:1px solid #3d4d40;border-radius:12px;width:44px;height:44px;letter-spacing:2px}.presence-row{margin:26px 0 12px;display:flex;align-items:center;justify-content:space-between;gap:10px}.presence-pill{display:flex;align-items:center;gap:7px;padding:7px 10px;border-radius:50px;background:#253a2b;color:#c6e5bc;font-size:11px}.text-button{background:none;border:0;color:#cde9a9;font-size:11px;padding:8px 0}.connection-banner{margin-top:18px;background:#553a30;color:#ffe2d4;padding:12px;border-radius:10px;font-size:12px;line-height:1.5}.scoreboard{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.team-card{min-width:0;border-radius:19px;padding:16px 14px 13px;overflow:hidden;position:relative;display:flex;flex-direction:column}.team-a{background:#d6f77b;color:#263719}.team-b{background:#a8dfd3;color:#18372f}.team-card:after{content:"";pointer-events:none;position:absolute;width:150px;height:150px;border:1px solid #1a3d2017;border-radius:50%;right:-72px;top:-53px;box-shadow:0 0 0 24px #1a3d2008,0 0 0 48px #1a3d2006}.card-top,.card-bottom{display:flex;align-items:center;justify-content:space-between;gap:4px;min-height:16px}.team-tag{font-size:9px;letter-spacing:.16em;font-weight:800;opacity:.65}.serve{font-size:10px;font-weight:700;white-space:nowrap}.team-card h2{font-size:clamp(15px,4vw,19px);margin:18px 0 0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.big-score{text-align:center;font-size:clamp(76px,22vw,130px);line-height:1.26;font-weight:800;letter-spacing:-.065em;font-variant-numeric:tabular-nums;margin-right:.055em}.card-bottom{font-size:10px;font-weight:700;opacity:.72;margin-bottom:14px}.score-feedback{font-size:12px;font-weight:900;opacity:0}.add-score{border:1px solid #1e392b23;background:#ffffff70;color:inherit;border-radius:10px;width:100%;min-height:51px;font-weight:800;font-size:14px;position:relative;z-index:1}.add-score:active{transform:scale(.98)}.add-score span{font-size:21px;vertical-align:-1px}.team-card.scored .big-score{animation:pop .33s cubic-bezier(.2,.9,.3,1.3)}.team-card.scored .score-feedback{animation:flash 1s ease-out}.team-card.scored{animation:glow .5s ease}@keyframes pop{40%{transform:scale(1.13)}}@keyframes flash{0%,65%{opacity:1;transform:translateY(-3px)}100%{opacity:0;transform:translateY(-12px)}}@keyframes glow{50%{filter:brightness(1.13)}}.controls{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:13px}.controls button{height:49px;border:1px solid #405047;background:#223028;color:#dce8d7;border-radius:10px;font-size:12px;font-weight:700}.controls button span{font-size:17px;vertical-align:-1px;margin-right:2px}.match-footer{margin-top:18px;display:flex;justify-content:space-between;align-items:center;gap:10px}.match-footer strong,.match-footer small{display:block}.match-footer strong{font-size:12px;color:#dce9d6}.match-footer small{font-size:10px;color:#849a86;margin-top:5px;line-height:1.4}.sound-button{border:0;background:#304032;color:#d6e8ca;border-radius:9px;padding:10px 11px;font-size:11px;white-space:nowrap}.match-result{margin-top:12px;background:#263c2a;border:1px solid #76955c;padding:14px;border-radius:12px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}.match-result strong{font-size:14px}.match-result span{font-size:11px;color:#b8ccb2;flex:1}.match-result button{min-height:38px;padding:0 12px;font-size:12px}.pending-label{position:fixed;top:10px;left:50%;transform:translateX(-50%);background:#e5f8bb;color:#24351a;border-radius:30px;padding:9px 15px;font-size:12px;z-index:7;white-space:nowrap}.modal-layer{position:fixed;inset:0;z-index:10;display:flex;align-items:flex-end;justify-content:center}.modal-backdrop{position:absolute;inset:0;background:#030805bc}.modal{position:relative;background:#223028;border:1px solid #465a49;width:min(100%,560px);border-radius:23px 23px 0 0;padding:24px 22px calc(24px + env(safe-area-inset-bottom));max-height:90vh;overflow:auto;box-shadow:0 -15px 80px #0004}.modal-handle{position:absolute;top:9px;left:calc(50% - 18px);width:36px;height:4px;border-radius:10px;background:#697c6b}.modal-close{position:absolute;top:15px;right:17px;border:0;background:#34473a;color:#eef5e9;border-radius:50%;width:33px;height:33px;font-size:21px}.modal h2{font-size:21px;margin:5px 35px 9px 0}.modal p{font-size:13px;line-height:1.65;color:#b3c5b3}.modal .primary,.modal .secondary{padding:0 16px}.modal-actions{display:flex;gap:9px;margin-top:20px}.modal-actions button{flex:1}.modal input{margin:10px 0}.qr{background:white;padding:12px;width:min(230px,75%);border-radius:12px;margin:20px auto}.qr svg{display:block;width:100%;height:auto}.code{font-size:11px;color:#d8e7d2;overflow-wrap:anywhere;background:#18231c;border-radius:8px;padding:10px;user-select:all}.menu-button{display:block;text-align:left;width:100%;background:#304035;color:#eff8eb;border:0;border-radius:11px;padding:15px;margin:8px 0;font-size:14px}.menu-button small{display:block;color:#b5c8b5;margin-top:5px;line-height:1.5}.menu-button.danger{color:#ffc6b7}.key-log{min-height:48px;background:#17231c;border-radius:9px;padding:12px;font-size:12px;color:#c8eaa8}.toast{position:fixed;bottom:calc(20px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:20;background:#e8f6d8;color:#20351e;padding:11px 17px;border-radius:30px;box-shadow:0 6px 25px #0007;font-size:12px;white-space:nowrap;max-width:90vw;overflow:hidden;text-overflow:ellipsis}@media(min-width:600px){.modal-layer{align-items:center}.modal{border-radius:23px}.intro{padding-top:58px}.scoreboard{gap:14px}.team-card{padding:20px}.add-score{min-height:58px}}@media(max-width:370px){.app-shell{padding-left:14px;padding-right:14px}.topbar{height:68px}.intro{padding-top:35px}.team-card{padding:13px 10px}.big-score{font-size:clamp(66px,21vw,90px)}.team-card h2{margin-top:12px}.controls button{font-size:11px}.match-heading{margin-top:22px}.presence-row{margin-top:17px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;scroll-behavior:auto!important}}
/* Teams keep the same colors on both devices, even when their screen order changes. */
.team-a{background:linear-gradient(145deg,#1973df,#1054b3);color:#fff}
.team-b{background:linear-gradient(145deg,#e37737,#bd4b22);color:#fff}
.dot.a{background:#418ef0}.dot.b{background:#ef8b4d}
.team-card:after{border-color:#ffffff20;box-shadow:0 0 0 24px #ffffff08,0 0 0 48px #ffffff06}
.add-score{background:#ffffff24;border-color:#ffffff50;color:white}
.team-tag,.card-bottom{opacity:.85}
.ring-quick,.landscape-actions{display:none}

/* This is a phone-first scoreboard: supporting labels and controls must remain legible. */
.brand small{font-size:12px}.top-status{font-size:16px}
.eyebrow,.step{font-size:15px;letter-spacing:.08em}
.intro p,.join-panel p{font-size:16px}
.setup label>span,.setup select,.rule-note{font-size:16px}
.setup input,.setup select,.modal input{min-height:48px}
.secondary{font-size:16px}.lobby-foot{font-size:16px}
.match-heading p,.presence-pill,.text-button{font-size:16px}
.team-tag,.card-bottom{font-size:16px}.serve{font-size:16px}
.team-card h2{font-size:clamp(18px,5vw,22px)}
.add-score{font-size:16px;min-height:50px}
.controls button{font-size:16px;min-height:50px}
.match-footer strong,.match-footer small,.sound-button{font-size:16px}
.connection-banner,.pending-label,.toast{font-size:16px}.toast{pointer-events:none}
.modal p,.modal input,.menu-button,.menu-button small,.code,.key-log{font-size:16px}
.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.settings-form label{display:block;color:#cddbcc;font-size:16px;margin:8px 0}.settings-form input,.settings-form select{width:100%;height:48px;margin:5px 0 0;padding:0 10px;background:#152019;border:1px solid #526353;border-radius:9px;color:#f5f7ee;font-size:16px}
@media(max-width:600px){.brand small,.team-tag{display:none}.card-top{min-height:22px;justify-content:flex-end}}

@media (orientation:portrait) and (max-height:700px){
  .topbar{height:56px}
  .match-heading{margin-top:12px}
  .match-heading .eyebrow{display:none}
  .match-heading h1{font-size:21px;margin:0 0 3px}
  .presence-row{margin:10px 0 9px}
  .team-card h2{margin-top:10px}
  .big-score{line-height:1.1}
  .card-bottom{margin-bottom:8px}
  .controls,.match-footer{margin-top:9px}
}

@media (orientation:landscape) and (max-height:600px){
  body:has(.match:not([hidden])){background:#0c1115;overflow:hidden}
  .app-shell:has(.match:not([hidden])){max-width:none;height:100dvh;padding:max(6px,env(safe-area-inset-top)) max(7px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left))}
  .app-shell:has(.match:not([hidden])) .topbar{display:none}
  .match:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) clamp(93px,15vw,150px) minmax(0,1fr);gap:clamp(5px,1vw,14px);height:100%;min-height:0;position:relative}
  .match-heading,.presence-row,.controls,.match-footer,.match-result{display:none!important}
  .scoreboard{display:contents}
  .team-card{grid-column:var(--land-col);grid-row:1;min-height:0;height:100%;padding:clamp(10px,2.5vh,20px);border-radius:clamp(13px,3vh,24px)}
  .team-card h2{position:relative;z-index:1;font-size:clamp(18px,6vh,31px);margin:0;padding-right:50px;line-height:1.1}
  .card-top{position:absolute;top:clamp(45px,12vh,65px);left:clamp(10px,2.5vh,20px);z-index:1}
  .team-tag{display:none}.serve{font-size:16px}
  .ring-quick{display:block;position:absolute;top:clamp(9px,2.5vh,18px);right:clamp(9px,2.5vh,18px);z-index:2;background:#ffffff18;border:1px solid #ffffff8a;color:#fff;border-radius:9px;padding:5px 9px;min-width:48px;min-height:39px;font-size:15px}
  .big-score{display:grid;place-items:center;flex:1;min-height:0;margin:0;font-size:clamp(65px,40vh,210px);line-height:.9;letter-spacing:-.07em}
  .card-bottom{margin:0 0 4px;min-height:18px;font-size:16px}
  .add-score{flex:none;min-height:44px;height:clamp(44px,13vh,52px);font-size:16px}
  .landscape-actions{display:grid;grid-column:2;grid-row:1;grid-template-rows:clamp(32px,9vh,38px) repeat(6,minmax(0,1fr)) 37px;gap:clamp(3px,1vh,6px);min-height:0}
  .landscape-actions>button{min-height:0;background:#222b31;border:1px solid #465058;color:#e3eaec;border-radius:9px;font-size:clamp(16px,4.8vh,20px);font-weight:700}
  .landscape-actions>button:active{background:#3a4950}
  .landscape-actions>button:disabled{color:#839097;opacity:.45}
  .landscape-status{display:grid;grid-template-columns:1fr 1fr;gap:3px}
  .landscape-status button{background:#29383a;border:1px solid #405052;color:#d7e8e2;border-radius:7px;font-size:16px;padding:0 1px}
  .landscape-info{color:#b8c9c2;font-size:16px;text-align:center;line-height:1.1;overflow:hidden}
  .landscape-info span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .connection-banner{position:absolute;z-index:4;top:0;left:15%;right:15%;margin:0;padding:7px;text-align:center}
  .modal-layer{align-items:center}.modal{border-radius:20px;max-height:94dvh;width:min(550px,85vw)}
  .share-body{display:grid;grid-template-columns:minmax(110px,34vh) 1fr;gap:16px;align-items:center}
  .modal .qr{width:100%;max-width:155px;margin:8px auto}.modal p{margin:6px 0}.modal-actions{margin-top:10px}
}
