/* Layout: the same evening sports hall as Smash, now seen from behind your own baseline. Canvas is the hero, menus sit on the court. */
:root{
  --hall:#161d28;      /* page around the court */
  --panel:#202a38;     /* overlays and buttons */
  --chalk:#f2eee3;     /* line white, main text */
  --mute:#93a0b4;      /* secondary text */
  --amber:#ffb12b;     /* scoreboard LEDs, the one accent */
  --line:#ffffff24;
  --display:"Big Shoulders Display","Arial Narrow",Impact,sans-serif;
  --body:"Archivo",system-ui,-apple-system,"Segoe UI",sans-serif;
  color-scheme:dark;
}
html,body{background:var(--hall);color:var(--chalk)}
body{font-family:var(--body);font-size:15px;line-height:1.5;padding-block:20px 36px;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.wrap{max-width:1120px;margin:0 auto;display:flex;flex-direction:column;gap:14px}
header{display:flex;align-items:flex-end;justify-content:space-between;gap:12px 20px;flex-wrap:wrap}
.brand{display:flex;flex-direction:column;gap:4px;min-width:0}
h1{font-family:var(--display);font-weight:800;font-size:clamp(2.4rem,6vw,3.6rem);line-height:.85;margin:0;text-transform:uppercase;text-wrap:balance}
h1 em{font-style:normal;color:var(--amber)}
.tag{margin:0;color:var(--mute);max-width:62ch}
.tools{display:flex;gap:8px}
button{font:inherit;color:inherit;cursor:pointer}
.chip{background:var(--panel);border:1px solid #ffffff1f;border-radius:999px;padding:6px 14px;font-weight:600;font-size:.85rem}
.chip:hover{border-color:#ffffff47}
:focus-visible{outline:2px solid var(--amber);outline-offset:2px}
.stage{position:relative;width:100%;aspect-ratio:16/9;max-width:100%;border-radius:6px;overflow:hidden;background:#1d2633;box-shadow:0 0 0 1px #ffffff17,0 24px 60px #00000080}
.stage canvas{position:absolute;inset:0;display:block;width:100%;height:100%;touch-action:none}
#hud{pointer-events:none}
.vig{position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse at 50% 46%,transparent 58%,rgba(6,8,12,.3) 100%)}
.overlay{position:absolute;inset:0;display:grid;place-items:center;overflow:auto;padding:12px;background:rgba(17,23,33,.72)}
.panel{display:flex;flex-direction:column;gap:12px;width:min(460px,100%);background:var(--panel);border:1px solid #ffffff1c;border-radius:8px;padding:18px 20px;margin:auto}
.panel h2{font-family:var(--display);font-weight:800;font-size:2.1rem;line-height:1;margin:0;text-transform:uppercase;text-wrap:balance}
.panel p{margin:0;color:var(--mute);font-size:.88rem}
.row{display:flex;flex-direction:column;gap:5px}
.label{font-size:.72rem;letter-spacing:.12em;text-transform:uppercase;color:var(--mute);font-weight:600}
.seg{display:flex;border:1px solid var(--line);border-radius:6px;overflow:hidden}
.seg input{position:absolute;opacity:0;pointer-events:none}
.seg label{flex:1;text-align:center;padding:6px 4px;font-weight:600;cursor:pointer;border-right:1px solid var(--line);font-size:.88rem;min-width:0}
.seg label:last-of-type{border-right:0}
.seg input:checked+label{background:var(--amber);color:#1b1407}
.seg input:focus-visible+label{outline:2px solid var(--chalk);outline-offset:-3px}
.desc{font-size:.82rem;color:var(--mute)}
.go{background:var(--amber);color:#1b1407;border:0;border-radius:6px;padding:10px 16px;font-family:var(--display);font-weight:800;font-size:1.3rem;text-transform:uppercase;letter-spacing:.04em}
.go:hover{filter:brightness(1.08)}
.ghost{background:transparent;border:1px solid #ffffff2e;border-radius:6px;padding:9px 14px;font-weight:600}
.btns{display:flex;gap:8px;flex-wrap:wrap}.btns>*{flex:1}
.big{font-family:var(--display);font-weight:800;font-size:3.2rem;line-height:1;font-variant-numeric:tabular-nums;color:var(--amber)}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.stats .gl{grid-column:1/-1}
.padmap{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:12px;align-items:center}
.padmap svg{width:100%;height:auto}.padmap .t{fill:#d7dbe3;font:700 10px var(--body,system-ui);text-anchor:middle}.padmap .s{fill:#a8b3c4;font:600 9.5px var(--body,system-ui);text-anchor:middle}.padmap .b{fill:#0d1118;font:800 13px var(--body,system-ui);text-anchor:middle}
.padkeys{list-style:none;margin:0;padding:0;display:grid;gap:5px;font-size:.84rem;line-height:1.3}.padkeys b{display:inline-grid;place-items:center;min-width:1.7em;height:1.7em;padding:0 4px;margin-right:6px;border-radius:999px;background:#3a4658;color:#f2eee3;font-size:.75rem}
.padkeys .ka{background:#3fae4a;color:#0d1118}.padkeys .kb{background:#d9483b;color:#0d1118}.padkeys .kx{background:#2f73d9;color:#f2eee3}.padkeys .ky{background:#e3b62b;color:#0d1118}
.slagh{margin:4px 0 0;font-size:1rem}.slagwrap{overflow-x:auto;max-height:46vh;overflow-y:auto;border:1px solid #ffffff14;border-radius:6px}
.slag{width:100%;border-collapse:collapse;font-size:.8rem;line-height:1.3}.slag th{position:sticky;top:0;background:#1d2532;text-align:left;font-weight:700}.slag th,.slag td{padding:5px 8px;border-bottom:1px solid #ffffff12;white-space:nowrap}.slag td:first-child{font-weight:600;color:#ffd23f}.slag td:nth-child(2){white-space:normal;color:#c9d3e2}
@media (max-width:640px){.padmap{grid-template-columns:1fr}}
.stats div{display:flex;flex-direction:column;min-width:0}
.stats b{font-family:var(--display);font-size:1.6rem;line-height:1;font-variant-numeric:tabular-nums}
.stats span{font-size:.7rem;color:var(--mute);text-transform:uppercase;letter-spacing:.08em}
.fail{position:absolute;inset:0;display:grid;place-items:center;padding:20px;text-align:center;color:var(--mute)}
.below{display:flex;gap:16px;flex-wrap:wrap;align-items:flex-start;justify-content:space-between}
.keys{display:flex;flex-wrap:wrap;gap:8px 20px;color:var(--mute);font-size:.88rem;margin:0;padding:0;list-style:none}
.keys li{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
kbd{font-family:var(--body);font-size:.75rem;font-weight:600;color:var(--chalk);background:var(--panel);border:1px solid #ffffff26;border-bottom-width:2px;border-radius:4px;padding:1px 6px;min-width:1.6em;text-align:center}
.pad{display:none;width:100%;justify-content:space-between;align-items:center;gap:12px;user-select:none;-webkit-user-select:none}
.stick{position:relative;width:120px;height:120px;border-radius:50%;background:var(--panel);border:1px solid #ffffff2b;touch-action:none}
.knob{position:absolute;left:50%;top:50%;width:52px;height:52px;margin:-26px 0 0 -26px;border-radius:50%;background:#3a4658;border:1px solid #ffffff40}
.pad .grp{display:grid;grid-template-columns:repeat(2,auto);gap:10px;align-items:center;justify-items:center}
.pad button{width:72px;height:72px;border-radius:50%;background:var(--panel);border:1px solid #ffffff2b;font-family:var(--display);font-weight:800;font-size:1.05rem;text-transform:uppercase;touch-action:none}
.pad button.hit{background:var(--amber);color:#1b1407;border:0;width:84px;height:84px;font-size:1.25rem}
.pad button.on{filter:brightness(1.35)}
.note{font-size:.82rem;color:var(--mute);margin:0}
.note a{color:inherit;text-decoration:underline}
@media (pointer:coarse){.pad{display:flex}.keys{display:none}.seg label{padding:10px 4px}.sw label{width:38px;height:38px}}
.fsx{position:absolute;top:calc(44px + env(safe-area-inset-top,0px));right:max(12px,env(safe-area-inset-right,0px));z-index:5;background:rgba(17,23,33,.7);border:1px solid #ffffff30;border-radius:999px;padding:5px 12px;font-weight:600;font-size:.8rem;color:var(--chalk)}
.stage.fs{border-radius:0;box-shadow:none}
#stage:fullscreen{width:100vw;height:100vh;max-width:none;aspect-ratio:auto}
#stage:-webkit-full-screen{width:100vw;height:100vh;max-width:none;aspect-ratio:auto}
.stage.fake{position:fixed;inset:0;z-index:1000;width:100vw;height:100vh;height:100dvh;max-width:none;aspect-ratio:auto}
.stage.fake.rot .pad{padding-left:max(16px,env(safe-area-inset-top,0px));padding-right:max(16px,env(safe-area-inset-bottom,0px));padding-bottom:calc(12px + env(safe-area-inset-left,0px))}
.stage.fake.rot{inset:auto;left:50%;top:50%;width:100vh;width:100dvh;height:100vw;transform:translate(-50%,-50%) rotate(90deg)}
body.noscroll{overflow:hidden}
.stage .pad{position:absolute;left:0;right:0;bottom:0;z-index:3;padding:12px max(16px,env(safe-area-inset-right,0px)) calc(12px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px));pointer-events:none}
.stage .pad>*{pointer-events:auto}
.stage .pad .stick,.stage .pad button{background:rgba(32,42,56,.55)}
.stage .pad button.hit{background:rgba(255,177,43,.85);width:92px;height:92px}
.stage .pad .stick{width:136px;height:136px}
.stage .pad button{width:78px;height:78px}
.overlay{z-index:4;grid-template-columns:minmax(0,1fr)}
*,*::before,*::after{box-sizing:border-box}
select{max-width:100%}
.inline>select{width:0}
[hidden]{display:none!important}
@media (max-width:700px) and (orientation:portrait){.tabs label{font-size:.78rem;letter-spacing:0}
.stage:not(.fake) .overlay{position:fixed;inset:0;z-index:50;background:rgba(17,23,33,.95);place-items:start center;padding-top:max(12px,env(safe-area-inset-top,0px))}}
.tabs label{font-family:var(--display);font-weight:800;text-transform:uppercase;letter-spacing:.02em;font-size:.88rem;padding:6px 3px;hyphens:manual;line-height:1.15;display:flex;align-items:center;justify-content:center}
.panel.wide{width:min(720px,100%)}
.bracket{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.bcol{display:flex;flex-direction:column;justify-content:space-around;gap:8px}
.rhead{font-size:.68rem;letter-spacing:.12em;text-transform:uppercase;color:var(--mute);font-weight:600;text-align:center}
.bm{background:#18202b;border:1px solid var(--line);border-radius:6px;padding:4px 8px;font-size:.82rem;display:flex;flex-direction:column;gap:1px}
.bm div{display:flex;justify-content:space-between;gap:6px;color:var(--mute);min-width:0}
.bm div span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bm .w{color:var(--chalk);font-weight:700}
.bm .me{color:var(--amber)}
.bm.next{border-color:var(--amber);box-shadow:0 0 0 1px var(--amber)}
.bm b{font-variant-numeric:tabular-nums}
.champ{text-align:center;font-family:var(--display);font-weight:800;font-size:1.5rem;text-transform:uppercase;color:var(--amber)}
.tbl{width:100%;border-collapse:collapse;font-size:.86rem}
.tbl th{font-size:.66rem;letter-spacing:.1em;text-transform:uppercase;color:var(--mute);font-weight:600;text-align:right;padding:4px 6px;border-bottom:1px solid var(--line)}
.tbl th:nth-child(-n+2){text-align:left}
.tbl td{padding:5px 6px;text-align:right;font-variant-numeric:tabular-nums;border-bottom:1px solid #ffffff10}
.tbl td:nth-child(-n+2){text-align:left}
.tbl tr.me td{color:var(--amber);font-weight:700}
.tbl td:last-child{font-weight:700}
.reslist{display:flex;flex-direction:column;gap:3px;font-size:.84rem;color:var(--mute)}
.reslist .me{color:var(--amber)}
#tourResumeBox{display:flex;flex-direction:column;gap:6px;background:#18202b;border:1px solid var(--line);border-radius:6px;padding:10px}
.swatches{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.sw{position:relative;display:block}
.sw input{position:absolute;opacity:0;pointer-events:none}
.sw label{display:block;width:30px;height:30px;border-radius:50%;border:2px solid #ffffff38;cursor:pointer}
.sw input:checked+label{border:3px solid var(--amber)}
.sw input:focus-visible+label{outline:2px solid var(--chalk);outline-offset:2px}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
input[type=color]{width:34px;height:34px;padding:0;border:2px solid #ffffff38;border-radius:6px;background:none;cursor:pointer}
select,.code,input[type=text]{font:inherit;font-size:16px;background:#18202b;color:var(--chalk);border:1px solid var(--line);border-radius:6px;padding:7px 9px;min-width:0}
.chkline{display:flex;align-items:center;gap:8px;font-size:.82rem;color:var(--mute);margin-top:4px;cursor:pointer}
.chkline input{accent-color:var(--amber);width:16px;height:16px}
.carbox{display:flex;flex-direction:column;gap:6px;background:#18202b;border:1px solid var(--line);border-radius:6px;padding:10px 12px;margin-top:4px}
.carxp{font-size:.78rem;font-weight:700;color:var(--amber);letter-spacing:.04em;text-transform:uppercase}
.skillrow{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:.84rem}
.skillrow span{flex:1;color:var(--chalk)}
.skillrow b{color:var(--amber);letter-spacing:1px;font-size:.92rem}
.smbtn{padding:2px 10px;font-size:.9rem;line-height:1.2;border-radius:4px}
.stats-tot{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;background:#18202b;border:1px solid var(--line);border-radius:6px;padding:8px 10px}
.stats-tot div{display:flex;flex-direction:column;align-items:center;text-align:center}
.stats-tot b{font-family:var(--display);font-size:1.35rem;line-height:1.05;color:var(--amber);font-variant-numeric:tabular-nums}
.stats-tot span{font-size:.65rem;color:var(--mute);text-transform:uppercase;letter-spacing:.06em}
.h2h-bar{display:flex;height:8px;border-radius:99px;overflow:hidden;background:#2a3444;margin:4px 0}
.h2h-bar > i:first-child{background:var(--amber)}
.h2h-bar > i:last-child{background:#4fa3d9}
.inline{display:flex;gap:8px;align-items:center}
.inline>select{flex:1}
.code{width:6.5em;text-transform:uppercase;letter-spacing:.2em;font-weight:600}
.games{display:flex;flex-direction:column;gap:6px}
.games button{text-align:left;background:#18202b;border:1px solid var(--line);border-radius:6px;padding:8px 10px;font-weight:600}
.games button:hover{border-color:var(--amber)}
.bigcode{font-family:var(--display);font-weight:800;font-size:2.4rem;letter-spacing:.2em;color:var(--amber);line-height:1;margin:6px 0}
#netWait{display:flex;flex-direction:column;gap:6px}
.go:disabled,.ghost:disabled{opacity:.45;cursor:not-allowed}
@media (max-width:640px){.panel{padding:12px 14px;gap:8px}.panel h2{font-size:1.5rem}.go{font-size:1.1rem;padding:8px}.big{font-size:2.2rem}.seg label{padding:5px 2px;font-size:.8rem}.stats{grid-template-columns:repeat(2,1fr)}}
