/* 경기 화면 전용. 메뉴 화면은 style.css, 경기 중 화면은 이 파일에서만 다룹니다. */
body.in-match { overflow: hidden; overscroll-behavior: none; }
body.in-match #toast { z-index: 40; }
.match-full { position: fixed; inset: 0; z-index: 30; overflow: hidden; background: #d98a4a; user-select: none; -webkit-user-select: none; touch-action: none; --mf-plum: #381d32; --mf-cream: #fff0d5; --mf-board: max(186px, min(400px, 29vw, 52vh)); --mf-top: max(10px, env(safe-area-inset-top)); --mf-right: max(14px, env(safe-area-inset-right)); --mf-bottom: max(12px, env(safe-area-inset-bottom)); --mf-left: max(14px, env(safe-area-inset-left)); }
.match-full [hidden] { display: none !important; }
.match-full #court { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; display: block; }

.mf-board { position: absolute; top: var(--mf-top); left: var(--mf-left); width: var(--mf-board); aspect-ratio: 938 / 228; background: url('art/match/scoreboard.webp') center / 100% 100% no-repeat; container-type: inline-size; color: var(--mf-plum); pointer-events: none; }
.mf-name, .mf-score, .mf-mid { position: absolute; display: grid; place-items: center; line-height: 1; }
.mf-name { top: 47.5%; height: 34%; width: 30%; padding: 0 2%; font-size: 4.2cqw; font-weight: 800; }
.mf-name { display: block; line-height: 1; padding-top: 3%; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mf-name.long { font-size: 3.1cqw; padding-top: 3.6%; }
.mf-name.left { left: 4.3%; }
.mf-name.right { right: 4%; }
.mf-name.serving::before { content: ''; display: inline-block; width: 2.4cqw; height: 2.4cqw; margin-right: 1.4cqw; border-radius: 50%; background: #e09a12; vertical-align: .25cqw; }
.mf-name.mine { font-weight: 900; text-decoration: underline; text-decoration-thickness: .5cqw; text-underline-offset: .9cqw; }
.mf-score { top: 43%; height: 42%; width: 10%; font-size: 7.4cqw; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.mf-score.left { left: 37.2%; }
.mf-score.right { left: 53.2%; }
.mf-score.bump { animation: mf-bump .45s ease-out; }
.mf-mid { left: 47%; width: 6.2%; top: 43%; height: 42%; color: var(--mf-cream); font-size: 4cqw; font-weight: 900; white-space: nowrap; }
@keyframes mf-bump { 30% { transform: scale(1.45); color: #a82f52; } }

.mf-pause { position: absolute; top: var(--mf-top); right: var(--mf-right); width: 46px; height: 46px; display: flex; justify-content: center; align-items: center; gap: 6px; border: 2px solid var(--mf-cream); border-radius: 13px; background: var(--mf-plum); }
.mf-pause span { width: 5px; height: 18px; border-radius: 2px; background: var(--mf-cream); }
.match-full button:focus-visible, .match-full summary:focus-visible { outline: 3px solid #ffd24a; outline-offset: 2px; }

.mf-call { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); font-size: clamp(38px, 10vmin, 86px); font-weight: 900; letter-spacing: -.02em; color: #fff6e2; -webkit-text-stroke: .16em var(--mf-plum); paint-order: stroke fill; pointer-events: none; animation: mf-call .95s both; }
.mf-call.in { color: #ffd24a; }
.mf-call.out, .mf-call.net { color: #ff8fab; }
@keyframes mf-call { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.7); } 16% { opacity: 1; transform: translate(-50%, -50%) scale(.95); } 24% { transform: translate(-50%, -50%); } 78% { opacity: 1; } 100% { opacity: 0; } }
.mf-prompt { position: absolute; left: var(--mf-left); top: calc(var(--mf-top) + var(--mf-board) * .243 + 8px); width: max-content; max-width: var(--mf-board); padding: 6px 14px; border-radius: 20px; background: #381d32e0; color: var(--mf-cream); font-size: 13px; font-weight: 700; text-align: center; pointer-events: none; }
.mf-prompt:empty { display: none; }
.mf-rotate { display: none; }

.mf-keys { position: absolute; left: var(--mf-left); bottom: var(--mf-bottom); display: none; flex-direction: column; gap: 5px; padding: 10px 14px 10px 10px; border-radius: 14px; background: #381d32d9; color: var(--mf-cream); font-size: 12px; font-weight: 700; pointer-events: none; transition: opacity 1.2s; }
.mf-keys.quiet { opacity: .28; }
.mf-key { display: flex; align-items: center; gap: 7px; }
.mf-key img { width: 26px; height: 26px; border-radius: 8px; background: var(--mf-cream); }
.mf-key kbd { min-width: 24px; padding: 2px 6px; border-radius: 6px; background: #5d3a53; color: inherit; font: inherit; text-align: center; }

.match-full .joystick { position: absolute; display: block; left: calc(var(--mf-left) + 12px); bottom: calc(var(--mf-bottom) + 10px); width: clamp(100px, 30vmin, 138px); height: clamp(100px, 30vmin, 138px); margin: 0; border: 2px solid #fff6e2a6; background: #fff6e238; }
.match-full .joystick .stick { box-shadow: none; opacity: .9; }
.match-full .shots { position: absolute; display: block; right: var(--mf-right); bottom: var(--mf-bottom); margin: 0; width: clamp(196px, 58vmin, 250px); height: clamp(176px, 52vmin, 226px); pointer-events: none; }
.match-full .shots .control { position: absolute; display: grid; place-items: center; align-content: center; gap: 0; width: 34%; min-width: 0; min-height: 0; height: auto; aspect-ratio: 1; padding: 0; border: 2px solid #fff6e2; border-radius: 50%; background: #fff6e2d1; color: var(--mf-plum); font-size: clamp(10px, 2.9vmin, 13px); font-weight: 800; white-space: nowrap; pointer-events: auto; touch-action: none; }
.match-full .shots .control img { width: 56%; height: auto; pointer-events: none; }
.match-full .shots .control.active { background: #ffd24a; border-color: #ffd24a; color: var(--mf-plum); }
.match-full .shots [data-shot=smash] { right: 0; bottom: 0; width: 44%; }
.match-full .shots [data-shot=drop] { right: 48%; bottom: 0; }
.match-full .shots [data-shot=clear] { right: 42%; bottom: 43%; }
.match-full .shots [data-shot=drive] { right: 2%; bottom: 54%; }
@media (pointer: fine) and (min-width: 651px) {
  body.in-match .match-full .joystick, body.in-match .match-full .shots { display: none; }
  .mf-keys { display: flex; }
}

.mf-menu { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 12px; background: #2a1226a6; overflow: auto; touch-action: auto; }
.mf-panel { display: grid; gap: 9px; width: min(330px, 100%); padding: 20px; border: 3px solid var(--mf-cream); border-radius: 20px; background: var(--mf-plum); color: var(--mf-cream); }
.mf-panel h2 { font-size: 19px; word-break: keep-all; text-wrap: balance; font-weight: 900; text-align: center; }
.mf-note { color: #e5becf; font-size: 13px; text-align: center; }
.mf-panel .button { justify-content: center; width: 100%; }
#dialog [data-music][aria-pressed="false"]::after, .mf-panel [aria-pressed="false"]::after { content: ' 꺼짐'; }
#dialog [data-music][aria-pressed="true"]::after, .mf-panel [aria-pressed="true"]::after { content: ' 켜짐'; }
.mf-panel summary { padding: 8px; border-radius: 10px; font-size: 14px; font-weight: 800; text-align: center; cursor: pointer; }
.mf-panel ul { display: grid; gap: 4px; margin: 4px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }

@media (orientation: portrait) and (max-width: 650px) {
  .mf-rotate { display: block; position: absolute; top: calc(var(--mf-top) + 84px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 92%; margin: 0; padding: 6px 12px; border-radius: 10px; background: #381d32e0; color: var(--mf-cream); font-size: 12px; }
  .mf-board { width: min(440px, calc(100vw - 100px)); }
  .mf-prompt { top: calc(var(--mf-top) + 122px); left: 50%; transform: translateX(-50%); max-width: 90%; }
}
@media (max-height: 540px) {
  .mf-prompt { padding: 3px 11px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .mf-call, .mf-score.bump { animation: none; }
}
