*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}:root{--bg:#eef2f6;--card:#fff;--ink:#17202a;--muted:#667380;--line:#d6dde4;--dark:#202a35;--accent:#e4a600;--ball:#1e9e5a;--strike:#e0a100;--out:#e72835;--blue:#1877f2}html,body,#root{min-height:100%;margin:0;font-family:Arial,Noto Sans TC,PingFang TC,sans-serif}body{background:var(--bg);color:var(--ink)}html.is-overlay,html.is-overlay body,html.is-overlay #root{background:0 0!important}h1,h2{margin:0}button,.btn{font:inherit;background:var(--dark);color:#fff;cursor:pointer;touch-action:manipulation;border:0;border-radius:12px;justify-content:center;align-items:center;gap:6px;min-height:48px;padding:10px 16px;font-size:17px;font-weight:800;text-decoration:none;transition:transform 60ms,opacity .15s;display:inline-flex}button:active:not(:disabled),.btn:active{transform:scale(.96)}button:disabled{opacity:.35;cursor:default}.ghost{color:var(--ink);background:#e7ecf1}.primary{background:var(--blue);color:#fff}.grow{flex:1}.icon{min-width:48px;color:var(--ink);background:#e7ecf1;padding:0 10px}.icon.danger{color:var(--out)}input,textarea{font:inherit;border:1px solid var(--line);width:100%;color:var(--ink);background:#fff;border-radius:10px;padding:12px;font-size:18px}input:focus,textarea:focus{outline:2px solid var(--blue);border-color:#0000}label{font-weight:700;display:block}label input{margin-top:6px}code{background:#f1f3f5;border-radius:8px;margin:10px 0;padding:12px;font-size:14px;display:block;overflow:auto}.muted{color:var(--muted)}.small{margin:8px 0 0;font-size:13px}.row{flex-wrap:wrap;gap:8px;margin-top:10px;display:flex}.row button,.row .btn{white-space:nowrap;padding:10px 8px}.control{max-width:720px;margin:auto;padding:0 12px 90px}.control section{background:var(--card);border-radius:16px;margin:12px 0;padding:14px;box-shadow:0 2px 10px #0000000d}.control h2{font-size:18px}.topbar{z-index:5;background:var(--bg);justify-content:space-between;align-items:center;gap:10px;padding:10px 2px;display:flex;position:sticky;top:0}.topbar h1{font-size:20px}.topbar small{color:var(--muted);align-items:center;gap:6px;margin-top:2px;font-size:13px;display:flex}.conn{background:var(--out);border-radius:50%;width:9px;height:9px}.conn.on{background:var(--ball)}.undo{background:var(--accent);color:#111;white-space:nowrap}.scores{grid-template-columns:1fr 1fr;gap:10px;display:grid}.control section.scores{padding:10px}.team{border:2px solid #0000;border-radius:12px;min-width:0;padding:8px}.team.batting{border-color:var(--accent);background:#fff8e1}.team-head{justify-content:space-between;align-items:center;min-height:22px;display:flex}.tag{color:var(--muted);font-size:13px;font-weight:700}.badge{background:var(--accent);color:#111;border-radius:99px;padding:2px 8px;font-size:12px;font-weight:800}.team-name{border:0;border-bottom:1px dashed var(--line);text-align:center;background:0 0;border-radius:0;padding:6px 2px;font-size:16px;font-weight:700}.stepper{justify-content:space-between;align-items:center;margin-top:8px;display:flex}.stepper b{text-align:center;font-variant-numeric:tabular-nums;min-width:56px;font-size:44px;line-height:1}.stepper button{width:48px;padding:0;font-size:24px}.stepper button:first-child{color:var(--ink);background:#e7ecf1}.inning{align-items:center;gap:8px;display:flex}.inning-label{color:var(--ink);background:0 0;flex:1;font-size:20px;font-weight:700}.inning-label b{margin-right:4px;font-size:30px}.counts{gap:8px;display:grid}.count{align-items:center;gap:12px;display:flex}.count-label{text-align:center;width:28px;font-size:24px;font-weight:900}.count-dots{flex:1;gap:12px;display:flex}.cdot{background:#e1e6eb;border:3px solid #cfd6dd;border-radius:50%;width:44px;height:44px;min-height:0;padding:0}.b .cdot.on{background:var(--ball);border-color:var(--ball)}.s .cdot.on{background:var(--strike);border-color:var(--strike)}.o .cdot.on{background:var(--out);border-color:var(--out)}.pitch{grid-template-columns:repeat(3,1fr);gap:8px;margin-top:10px;display:grid}.pitch button{white-space:nowrap;min-height:60px;padding:8px 4px;font-size:18px}.pitch .b{background:var(--ball)}.pitch .s{background:var(--strike);color:#111}.pitch .f{background:#8a6d00}.pitch .o{background:var(--out)}.pitch .hit{background:var(--blue)}.field-wrap{justify-content:space-around;align-items:center;gap:12px;display:flex}.field{flex:none;width:200px;height:150px;position:relative}.base{width:64px;height:64px;min-height:0;color:var(--ink);background:#e1e6eb;border:3px solid #cfd6dd;border-radius:8px;padding:0;position:absolute;transform:rotate(45deg)}.base span{font-size:14px;transform:rotate(-45deg)}.base.on{background:var(--accent);color:#111;border-color:#b98700}.base:active:not(:disabled){transform:rotate(45deg)scale(.94)}.b2{top:4px;left:68px}.b3{top:64px;left:8px}.b1{top:64px;right:8px}.plate{background:#fff;border:2px solid #cfd6dd;width:24px;height:24px;position:absolute;bottom:0;left:88px;transform:rotate(45deg)}.section-head{justify-content:space-between;align-items:center;display:flex}.batter{text-align:center;align-items:center;gap:10px;margin:12px 0;display:flex}.batter>div{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.batter small{color:var(--muted);font-size:13px}.batter b{text-overflow:ellipsis;white-space:nowrap;font-size:26px;overflow:hidden}em{color:var(--blue);margin-right:6px;font-style:normal}.lineup{flex-wrap:wrap;gap:6px;margin:0;padding:0;list-style:none;display:flex}.lineup button{min-height:40px;color:var(--ink);background:#f1f3f5;border:2px solid #0000;padding:6px 12px;font-size:15px;font-weight:700}.lineup button span{color:var(--muted);margin-right:2px;font-size:12px}.lineup button.on{border-color:var(--accent);background:#fff8e1}.toast{left:50%;top:calc(76px + env(safe-area-inset-top));color:#fff;z-index:20;text-align:center;pointer-events:none;background:#17202aee;border-radius:12px;max-width:calc(100% - 32px);padding:12px 18px;font-weight:700;position:fixed;transform:translate(-50%);box-shadow:0 4px 16px #0003}.toast.err{background:var(--out)}.modal{z-index:10;background:#0008;justify-content:center;align-items:flex-end;display:flex;position:fixed;inset:0}.panel{width:100%;max-width:560px;max-height:92vh;padding:18px 16px calc(18px + env(safe-area-inset-bottom));background:#fff;border-radius:18px 18px 0 0;overflow:auto}.panel h2{margin-bottom:10px;font-size:20px}.panel p{margin:0 0 12px}.actions{background:#fff;gap:8px;margin-top:16px;padding-top:8px;display:flex;position:sticky;bottom:0}.actions button{flex:1}.roster{gap:8px;margin:0;padding:0;list-style:none;display:grid}.roster li{align-items:center;gap:6px;display:flex}.roster .order{text-align:center;width:22px;color:var(--muted);flex:none;font-weight:800}.roster input{min-width:0;padding:10px;font-size:17px}.roster .num{text-align:center;flex:none;width:64px}.roster .name{flex:1}.roster .icon{min-width:40px;min-height:44px;padding:0}@media (width>=600px){.modal{align-items:center}.panel{border-radius:18px}}@media (width<=380px){.roster .icon{min-width:34px}.cdot{width:38px;height:38px}.field{width:170px;height:130px;transform:scale(.85)}}.overlay{background:0 0;width:100vw;height:100vh;position:relative;overflow:hidden}.board{color:#fff;background:#080b0fe8;border:2px solid #333;width:560px;font-size:22px;position:absolute;bottom:4vh;right:3vw}.meta{border-bottom:1px solid #555;padding:10px 14px}.meta b{float:right}.teams>div{border-bottom:1px solid #555;justify-content:space-between;align-items:center;padding:12px 16px;display:flex}.teams strong{color:#111;background:#f5f5f5;margin:-12px -16px -12px 10px;padding:4px 18px;font-size:34px}.teams .home{background:#1877f2}.status{justify-content:space-around;align-items:center;height:105px;display:flex}.diamond{width:90px;height:70px;position:relative}.diamond i{background:#555;width:27px;height:27px;position:absolute;transform:rotate(45deg)}.diamond i:first-child{top:0;left:31px}.diamond i:nth-child(2){top:28px;left:5px}.diamond i:nth-child(3){top:28px;right:5px}.diamond i.on{background:#e5a900}.inn{font-size:30px}.bso{line-height:30px}.dot{background:#555;border-radius:50%;width:18px;height:18px;margin-left:7px;display:inline-block}.dot.on{background:#e72835}@media (width<=700px){.board{transform-origin:100% 100%;width:520px;transform:scale(.8)}}.tabs{background:#e7ecf1;border-radius:12px;grid-template-columns:1fr 1fr;gap:6px;margin-top:10px;padding:4px;display:grid}.tabs button{min-height:42px;color:var(--muted);background:0 0;min-width:0;padding:6px 8px;font-size:15px}.tab-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.tabs button.on{color:var(--ink);background:#fff;box-shadow:0 1px 4px #0002}.tabs .badge{flex:none}
