.match-menu{position:absolute;inset:0;z-index:80;display:flex;padding:16px;background:#081b29c9;backdrop-filter:blur(8px);color:#edf5f2;cursor:default;font-size:16px;text-align:left;isolation:isolate}
.match-menu[hidden],.match-menu [hidden]{display:none!important}
.match-menu *{box-sizing:border-box}
.match-menu button,.match-menu input{font:inherit}
.match-menu button{cursor:pointer}
.match-menu-panel{width:100%;height:100%;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:#142c38;border:1px solid #ffffff26;border-radius:16px;box-shadow:0 16px 70px #020d1b66}
.match-menu-header{flex:none;padding:24px 32px 22px;border-bottom:1px solid #ffffff14}
.match-menu-title{margin:0;font-size:30px;line-height:1.2;font-weight:800;letter-spacing:.06em;outline:none!important}
.match-menu-body{flex:1;min-height:0;display:grid;grid-template-columns:286px minmax(0,1fr);gap:32px;padding:28px 32px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.match-menu-body--setup{
 grid-template-areas:"settings players" "settings courts";
 align-content:start;align-items:start;row-gap:16px;
}
.match-menu-body--setup>.match-menu-settings{grid-area:settings}
.match-menu-body--setup>.match-menu-players{grid-area:players}
.match-menu-body--setup>.match-menu-courts{grid-area:courts}
.match-menu-settings{display:flex;flex-direction:column;gap:17px;min-width:0}
.match-menu-settings legend,.match-menu-courts legend{margin-bottom:8px}
.match-menu fieldset{margin:0;padding:0;border:0;min-width:0}
.match-menu legend{padding:0;margin:0 0 16px;font-size:17px;line-height:1.4;font-weight:700;color:#c8d9df}
.match-menu-rule-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.match-menu-radio-card{position:relative;display:flex;flex-direction:column;min-width:0;border:1px solid #48626d;border-radius:10px;background:#203b47;overflow:hidden;cursor:pointer}
.match-menu-radio-card:hover{border-color:#8bada8}
.match-menu-radio-card.is-selected{border-color:#97d6b2;background:#294c4e;box-shadow:inset 0 0 0 1px #97d6b2}
.match-menu-radio-card:has(input:focus-visible){outline:3px solid #e7cf77;outline-offset:3px}
.match-menu-radio-card input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;z-index:2;cursor:pointer}
.match-menu-rule-card{min-height:76px;padding:14px 12px;justify-content:center}
.match-menu-rule-points{display:flex;align-items:baseline;gap:6px;font-size:30px;line-height:1;font-weight:800;font-variant-numeric:tabular-nums;letter-spacing:-.03em}
.match-menu-rule-points small{font-size:15px;font-weight:650;letter-spacing:0;color:#bad0d0;white-space:nowrap}
.match-menu-rule-card>strong{font-size:14px;margin-top:8px;font-weight:600;color:#e0eeee}
.match-menu-selection-mark{display:grid;place-items:center;width:23px;height:23px;flex:none;border:1px solid #78978f;border-radius:50%;color:transparent;font-size:14px;font-weight:800}
.match-menu-rule-card>.match-menu-selection-mark{position:absolute;right:10px;top:10px;width:17px;height:17px;font-size:10px}
.match-menu-radio-card.is-selected .match-menu-selection-mark{border-color:#a9e2bd;background:#a9e2bd;color:#153a34}
.match-menu-level-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.match-menu-format-options{grid-template-columns:repeat(2,minmax(0,1fr))}
.match-menu-start-power-options{grid-template-columns:repeat(4,minmax(0,1fr))}
.match-menu-level-options label{position:relative;cursor:pointer}
.match-menu-level-options input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;z-index:2;cursor:pointer}
.match-menu-level-options span{display:block;border:1px solid #48626d;border-radius:8px;padding:9px 4px;color:#c7d9de;text-align:center;font-size:14px;white-space:nowrap;background:#203b47}
.match-menu-level-options input:checked+span{border-color:#97d6b2;background:#294c4e;box-shadow:inset 0 0 0 1px #97d6b2;color:#f2fff8;font-weight:700}
.match-menu-level-options input:focus-visible+span{outline:3px solid #e7cf77;outline-offset:3px}
.match-menu-courts{align-self:start}
.match-menu-court-grid{display:grid;grid-template-columns:repeat(3,minmax(0,160px));gap:8px}
.match-menu-court-picture{position:relative;display:grid;place-items:center;height:54px;overflow:hidden;background:radial-gradient(ellipse at 50% 50%,#496954,#304c41 75%)}
.match-menu-court-card:has(input[value="hard"]) .match-menu-court-picture{background:radial-gradient(ellipse at 50% 50%,#46647a,#2c495d 75%)}
.match-menu-court-card:has(input[value="clay"]) .match-menu-court-picture{background:radial-gradient(ellipse at 50% 50%,#ac795e,#735442 75%)}
.match-menu-court-info{display:block;padding:6px;border-top:1px solid #ffffff12}
.match-menu-court-heading{display:flex;align-items:center;justify-content:space-between;gap:3px}
.match-menu-court-heading strong{font-size:13px;font-weight:750;letter-spacing:.02em}
.match-menu-court-heading .match-menu-selection-mark{width:14px;height:14px;font-size:9px}
.match-menu-court-traits{display:grid;gap:2px;margin-top:6px;font-size:10px;color:#a8c0c8}
.match-menu-court-traits>span{display:flex;justify-content:space-between;gap:4px}
.match-menu-court-traits b{font-weight:700;color:#edf7f2}
.match-menu-court-art{display:block;width:min(96%,clamp(155px,18vw,340px));height:auto;flex-shrink:0;--court-ground:#508458;--court-stripe:#639462;--court-edge:#3c6346}
.match-menu-court-picture>.match-menu-court-art{width:min(88%,70px)}
.match-menu-court-art--hard{--court-ground:#417cb5;--court-stripe:#417cb5;--court-edge:#294d79}
.match-menu-court-art--clay{--court-ground:#bd7048;--court-stripe:#bd7048;--court-edge:#914a2d}
.match-menu-court-art__ground{fill:var(--court-ground)}
.match-menu-court-art__stripes{fill:var(--court-stripe)}
.match-menu-court-art__edge{fill:var(--court-edge)}
.match-menu-court-art__lines{fill:none;stroke:#f3f9eb;stroke-width:1.15}
.match-menu-court-art__net{fill:#183b2fc9}
.match-menu-court-art__mesh{fill:none;stroke:#e0eee59c;stroke-width:.6}
.match-menu-court-art__tape,.match-menu-court-art__posts{fill:none;stroke:#edf6ec;stroke-width:1.7;stroke-linecap:round}
.match-menu-footer{flex:none;display:flex;align-items:center;justify-content:flex-end;gap:24px;min-height:88px;padding:18px 32px;border-top:1px solid #ffffff14;background:#112630}
.match-menu-primary{min-width:200px;min-height:52px;padding:14px 36px;border:1px solid #c6f4d5;border-radius:8px;background:#b8e9c9;color:#163e34;font-size:18px;font-weight:800;box-shadow:0 4px 14px #061a2140}
.match-menu-primary:hover{background:#d1f8dd}.match-menu-secondary{min-width:200px;min-height:52px;padding:14px 36px;border:1px solid #6f8c95;border-radius:8px;background:transparent;color:#dcebee;font-size:18px;font-weight:700}.match-menu-secondary:hover{background:#ffffff12}.match-menu-secondary:focus-visible{outline:3px solid #e7cf77;outline-offset:3px}
.match-menu-primary:focus-visible{outline:3px solid #e7cf77;outline-offset:3px}
.match-menu-primary:disabled{opacity:.55;cursor:wait}
.match-menu-error{margin:0;color:#ffd7bd;font-size:15px}
.match-menu-players{display:flex;flex-direction:column;gap:20px;min-width:0}
.match-menu-match-controls{display:flex;flex-wrap:wrap;gap:12px 16px}
.match-menu-match-controls fieldset{flex:1 1 176px;max-width:224px}
.match-menu-match-controls legend{margin-bottom:6px}
.match-menu-player-group{--side-color:#4fb3ff;--side-glow:#4fb3ffaa;--side-ink:#04233d}
.match-menu-player-group[data-team="cpu"]{--side-color:#ff5f9a;--side-glow:#ff5f9aaa;--side-ink:#3d0419}
.match-menu-body--setup[data-spectator="true"] .match-menu-player-group legend{color:var(--side-color)}
.match-menu-player-group legend{display:flex;align-items:center;gap:12px;margin-bottom:12px;font-size:18px;font-weight:800;letter-spacing:.08em;color:#f2fbff}
.match-menu-side-tag{display:inline-grid;place-items:center;width:76px;min-height:32px;padding:4px 10px;transform:skewX(-14deg);background:var(--side-color);color:var(--side-ink);font-size:15px;font-weight:900;font-style:italic;letter-spacing:.06em;box-shadow:0 0 14px var(--side-glow)}
.match-menu-side-tag[data-menu-action="swap-player"]{border:1px solid var(--side-color);background:transparent;color:var(--side-color);box-shadow:none}
.match-menu-side-tag[data-menu-action="swap-player"]:hover{background:var(--side-color);color:var(--side-ink)}
.match-menu-side-tag[data-menu-action="swap-player"]:focus-visible{outline:3px solid #e7cf77;outline-offset:3px}
.match-menu-character-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}
.match-menu-character-card{--character-color:#7f97a3}
.match-menu-character-picture{position:relative;display:grid;place-items:center;height:clamp(80px,13vh,110px);overflow:hidden;background:linear-gradient(150deg,color-mix(in srgb,var(--character-color) 78%,#fff) ,color-mix(in srgb,var(--character-color) 55%,#0b2230))}
.match-menu-character-picture img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 16%}
.match-menu-character-initial{font-size:38px;line-height:1;font-weight:800;color:#fff;text-shadow:0 2px 10px #0b223055}
.match-menu-character-card--random .match-menu-character-picture{background:repeating-linear-gradient(135deg,#2a4855 0 10px,#24404c 10px 20px)}
.match-menu-character-card--random .match-menu-character-initial{color:#c8d9df}
.match-menu-character-info{flex:1;display:flex;flex-direction:column;gap:3px;min-height:60px;padding:8px 8px 9px;border-top:1px solid #ffffff12}
.match-menu-character-info strong{font-size:clamp(12px,1.25vw,15px);font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.match-menu-character-info small{font-size:11px;line-height:1.35;color:#a8c0c8;line-break:strict}
.match-menu-character-card{transition:transform .18s cubic-bezier(.3,1.6,.5,1),box-shadow .18s,border-color .18s}
.match-menu-character-card .match-menu-character-picture img{transition:filter .18s,transform .25s}
.match-menu-character-grid:has(.is-selected) .match-menu-character-card:not(.is-selected) .match-menu-character-picture{filter:brightness(.5) saturate(.45)}
.match-menu-character-grid:has(.is-selected) .match-menu-character-card:not(.is-selected) .match-menu-character-info{opacity:.6}
.match-menu-character-card:not(.is-selected):hover{transform:translateY(-3px)}
.match-menu-character-grid .match-menu-character-card:not(.is-selected):hover .match-menu-character-picture{filter:none}
.match-menu-character-grid .match-menu-character-card:not(.is-selected):hover .match-menu-character-info{opacity:1}
.match-menu-character-picture{transition:filter .18s}
.match-menu-player-group .match-menu-character-card.is-selected{z-index:1;transform:translateY(-6px) scale(1.04);border-color:var(--side-color);background:#142c38;box-shadow:0 0 0 3px var(--side-color),0 0 24px 4px var(--side-glow),0 12px 22px #020d1b80;animation:match-menu-pick .32s cubic-bezier(.3,1.6,.5,1),match-menu-pulse 1.6s ease-in-out .32s infinite}
.match-menu-character-card.is-selected .match-menu-character-picture img{transform:scale(1.06)}
.match-menu-character-card.is-selected .match-menu-character-picture:after{content:"";position:absolute;inset:0;background:linear-gradient(115deg,transparent 35%,#ffffff55 50%,transparent 65%) no-repeat;background-size:250% 100%;animation:match-menu-shine .7s ease-out both}
.match-menu-character-card.is-selected .match-menu-character-info{background:var(--side-color);border-top-color:transparent}
.match-menu-character-card.is-selected .match-menu-character-info strong{color:var(--side-ink)}
.match-menu-character-card.is-selected .match-menu-character-info small{color:var(--side-ink);opacity:.8}
.match-menu-side-badge{position:absolute;right:-4px;top:10px;z-index:1;padding:3px 12px 3px 10px;transform:skewX(-14deg) translateX(110%);background:var(--side-color);color:var(--side-ink);font-size:14px;font-weight:900;font-style:italic;letter-spacing:.06em;box-shadow:0 2px 8px #020d1b80;transition:transform .2s cubic-bezier(.3,1.6,.5,1)}
.match-menu-character-card.is-selected .match-menu-side-badge{transform:skewX(-14deg) translateX(0)}
.match-menu-body--setup[data-match-mode="doubles"] .match-menu-players{gap:12px}
.match-menu-body--setup[data-match-mode="doubles"] .match-menu-player-group--cpu{margin-top:10px;padding-top:10px;border-top:1px solid #ffffff26}
.match-menu-body--setup[data-match-mode="doubles"] .match-menu-player-group legend{font-size:15px;margin-bottom:8px}
.match-menu-body--setup[data-match-mode="doubles"] .match-menu-side-tag{width:54px;min-height:24px;padding:2px 6px;font-size:12px}
.match-menu-body--setup[data-match-mode="doubles"] .match-menu-character-grid{gap:8px}
.match-menu-body--setup[data-match-mode="doubles"] .match-menu-character-picture{height:clamp(42px,8vh,65px)}
.match-menu-body--setup[data-match-mode="doubles"] .match-menu-character-info{min-height:0;padding:5px 6px}
.match-menu-body--setup[data-match-mode="doubles"] .match-menu-character-info small,
.match-menu-body--setup[data-match-mode="doubles"] .match-menu-side-badge{display:none}
.match-menu-body--setup[data-match-mode="doubles"] .match-menu-character-card.is-selected{transform:none;box-shadow:0 0 0 1px var(--side-color);animation:none}
@keyframes match-menu-pick{0%{transform:translateY(0) scale(.94)}60%{transform:translateY(-8px) scale(1.07)}100%{transform:translateY(-6px) scale(1.04)}}
@keyframes match-menu-pulse{0%,100%{box-shadow:0 0 0 3px var(--side-color),0 0 18px 2px var(--side-glow),0 12px 22px #020d1b80}50%{box-shadow:0 0 0 3px var(--side-color),0 0 32px 8px var(--side-glow),0 12px 22px #020d1b80}}
@keyframes match-menu-shine{from{background-position:120% 0}to{background-position:-120% 0}}
@media(prefers-reduced-motion:reduce){.match-menu-player-group .match-menu-character-card.is-selected{animation:none}.match-menu-character-card.is-selected .match-menu-character-picture:after{animation:none;background:none}.match-menu-character-card,.match-menu-side-badge{transition:none}}@media(max-width:1000px){.match-menu-body{grid-template-columns:250px minmax(0,1fr);gap:24px;padding:24px}.match-menu-character-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:761px){.match-menu-body--setup{padding-block:22px}}
@media(max-width:760px){
 .match-menu{padding:12px}.match-menu-panel{border-radius:12px}.match-menu-header{padding:20px}.match-menu-title{font-size:26px}.match-menu-body{display:flex;flex-direction:column;gap:28px;padding:22px 20px}.match-menu legend{font-size:16px}.match-menu-body--setup{gap:18px;align-items:stretch}.match-menu-body--setup>.match-menu-settings,.match-menu-body--setup>.match-menu-players,.match-menu-body--setup>.match-menu-courts{flex:none}.match-menu-settings{gap:18px}.match-menu-rule-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.match-menu-rule-card>strong{font-size:13px}
 .match-menu-courts{align-self:stretch}
 .match-menu-footer{min-height:84px;padding:16px 20px;gap:12px}.match-menu-primary,.match-menu-secondary{flex:1;width:100%;min-width:0;min-height:50px}.match-menu-error{font-size:14px}.match-menu-character-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.match-menu-character-picture{height:clamp(72px,15vh,108px)}
}

@media(min-width:660px) and (max-width:760px) and (max-height:520px){
 .match-menu-body--setup{display:grid;grid-template-columns:minmax(215px,250px) minmax(0,1fr);align-items:start}
}
@media(max-width:350px){.match-menu-court-info{padding-inline:5px}.match-menu-court-heading strong{font-size:13px}.match-menu-court-traits{font-size:10px}}
@media(max-height:520px) and (min-width:761px){.match-menu-header{padding:17px 24px}.match-menu-title{font-size:26px}.match-menu-body{padding:22px 24px;gap:24px;grid-template-columns:250px minmax(0,1fr)}.match-menu-footer{min-height:80px;padding:14px 24px}}

.first-serve{
 --side:#66bfff;
 width:min(460px,calc(100% - 32px));max-height:calc(100% - 32px);overflow:auto;
 margin:auto;padding:clamp(18px,5vh,38px) clamp(16px,5vw,44px);
 border:1px solid #668d9c;border-radius:18px;text-align:center;color:#f2fbff;
 background:radial-gradient(ellipse at 50% 40%,#254955,#102630 76%);
 box-shadow:0 18px 78px #020d1b80;
}
.first-serve::backdrop{background:#081b29b8;backdrop-filter:blur(5px)}
.first-serve[data-server="cpu"]{--side:#ff78a8}
.first-serve h2{margin:0;font-size:clamp(18px,4vw,24px);letter-spacing:.08em;outline:none}
.first-serve-racket-stage{
 display:grid;place-items:center;height:clamp(136px,31vh,208px);perspective:640px;
 background:radial-gradient(ellipse 30% 5% at 50% 87%,#081b29aa,transparent);
}
.first-serve-racket-stage[hidden]{display:none}
.first-serve-racket-stage[hidden]+.first-serve-result{margin-top:20px}
.first-serve-racket{
 --rim:#e2eae5;
 position:relative;width:clamp(44px,9vh,68px);height:clamp(94px,19vh,143px);
 transform-origin:50% 93%;transform-style:preserve-3d;
}
.first-serve[data-stage="reveal"] .first-serve-racket{--rim:var(--side)}
.first-serve-racket-head,.first-serve-racket-face{
 position:absolute;inset:0 0 43%;border-radius:48% 48% 46% 46%;
}
.first-serve-racket-head{
 border:4px solid var(--rim);
 background:repeating-linear-gradient(0deg,#a8c7cbaa 0 1px,transparent 1px 5px),
            repeating-linear-gradient(90deg,#a8c7cbaa 0 1px,transparent 1px 5px),#152f38;
 box-shadow:inset 0 0 0 1px #263f48,0 2px 6px #081b2999;
}
.first-serve-racket-face{
 display:grid;place-items:center;backface-visibility:hidden;
 font-size:clamp(11px,2.7vh,18px);font-weight:900;color:#f2fbff;
 transform:translateZ(2px);
}
.first-serve-racket-face span{padding:0 3px;background:#102630;border-radius:3px}
.first-serve-racket-face--back{transform:rotateY(180deg) translateZ(2px)}
.first-serve-racket-throat{
 position:absolute;top:52%;left:50%;width:45%;height:19%;
 transform:translateX(-50%);
}
.first-serve-racket-throat::before,.first-serve-racket-throat::after{
 content:"";position:absolute;top:0;width:17%;height:110%;border-radius:8px;
 background:var(--rim);
}
.first-serve-racket-throat::before{left:15%;transform:rotate(-25deg)}
.first-serve-racket-throat::after{right:15%;transform:rotate(25deg)}
.first-serve-racket-grip{
 position:absolute;top:70%;left:50%;width:20%;height:30%;transform:translateX(-50%);
 border:1px solid #70838b;border-bottom:3px solid var(--rim);border-radius:4px;
 background:repeating-linear-gradient(-19deg,#273842 0 4px,#4b6069 4px 5px);
}
.first-serve-result{
 margin:0;min-height:1.85em;padding:.24em .15em;color:#102630;
 font-size:clamp(22px,5vw,35px);font-weight:900;background:var(--side);letter-spacing:.04em;
}
.first-serve[data-stage="toss"] .first-serve-result{visibility:hidden}
.first-serve[data-stage="reveal"][data-motion="true"] .first-serve-result{animation:first-serve-reveal .38s cubic-bezier(.22,.8,.3,1) both}
@keyframes first-serve-reveal{
 from{transform:translateY(12px) scaleX(.72);opacity:0}
 to{transform:none;opacity:1}
}
