/* 쿼오파 98 — docs/quopa98.md §7. 영상 영역(.video-wrap) 안에서만 그린다(framework §18.1). 전부 #quopa98Root 안으로 한정. */
.game-quopa98 { --game-color: 220, 38, 38; }

#quopa98Root {
  position: absolute; inset: 0; width: 100%; height: 100%; box-sizing: border-box;
  z-index: 40; display: none; overflow: hidden;
  color: #e8edf5; font-family: inherit; font-size: 13px; background: #05070d;
}
#quopa98Root.q9-visible { display: block; }
#quopa98Root * { box-sizing: border-box; }
#quopa98Root [hidden] { display: none !important; }
#quopa98Root button { font: inherit; color: inherit; cursor: pointer; }
#quopa98Root button:focus-visible { outline: 3px solid #fca5a5; outline-offset: 1px; }
.q9-body { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }

/* CSS 확대만 쓴다. requestFullscreen 계열 금지(framework §18.3). */
#quopa98Root.q9-expanded {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: 10000;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
/* 확대 중에는 오른쪽 위 축소 버튼 하나만 — 머리의 확대 토글은 숨기고 그 자리를 비운다(좁은 화면의 머리 padding보다 우선) */
#quopa98Root.q9-expanded .q9-head, #quopa98Root.q9-expanded.q9-narrow .q9-head { padding-right: var(--q9-head-pad, 72px); }   /* 머리줄 zoom만큼 fitHead가 키운다 */
#quopa98Root.q9-expanded .q9-head [data-act="expand"] { display: none; }
.q9-collapse { position: absolute; top: 6px; right: 6px; z-index: 50; display: none; padding: 6px 12px; border-radius: 8px;
  border: 1px solid #3f3f46; background: #18181b; color: #f4f4f5; font-weight: 700; font-size: 12px; }
/* 외부 확대 버튼(framework §18.3) — 모바일에서는 app.js 공통 자리(가로 = 플레이리스트 줄, 세로 = 채팅 머리줄)가 크기를 줄인다 */
#quopa98Expand { display: none; margin: 5px auto; padding: 9px 16px; border-radius: 9px; border: 1px solid #3f3f46; background: none; color: #d4d4d8; font: inherit; cursor: pointer; }
@media (pointer: coarse), (max-width: 900px) { #quopa98Expand.q9-show { display: block; } }
/* 모바일 세로 경기 화면: 영상 칸을 16:9보다 높여 게임이 폭을 채우게 한다 — 높이는 클라이언트가 --q9-tall-h로 준다(docs §7).
   조건은 mobile.css의 세로 레이아웃과 같다(가로 landscape-mobile·PC는 그대로). 선수는 게임을 위로 붙이고 아래를 가상패드 줄로 쓴다. */
@media (max-width: 768px) and (orientation: portrait), (max-width: 1024px) and (any-pointer: coarse) and (orientation: portrait) {
  body:not(.landscape-mobile) .video-wrap.q9-tall { aspect-ratio: auto !important; height: var(--q9-tall-h) !important; max-height: none !important; }
  body:not(.landscape-mobile) .video-wrap.q9-tall #quopa98Root.q9-pad-room:not(.q9-expanded) .q9-screen { object-position: center top; }
}

/* 머리 */
.q9-head { display: flex; align-items: center; gap: 8px; padding: 5px 10px; background: linear-gradient(90deg, rgba(127, 29, 29, .55), rgba(30, 27, 75, .55)); border-bottom: 1px solid #27272a; flex: none; }
.q9-head-info { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.q9-title { font-size: 14px; white-space: nowrap; }
.q9-vs { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; justify-content: center; }
.q9-vs b { color: #fbbf24; font-size: 12px; letter-spacing: .08em; }
.q9-name { min-width: 3em; /* 좁은 머리에서 짧은 이름(CPU)이 한 글자씩 꺾이지 않게 */ font-weight: 700; overflow-wrap: anywhere; line-height: 1.2; }
.q9-p1 { color: #93c5fd; }
.q9-p2, .q9-cpu { color: #fca5a5; }
.q9-p3 { color: #86efac; }
.q9-p4 { color: #fde047; }
/* 협동 머리줄: 1P~4P 이름을 한 줄로(fitHead가 폭에 맞춰 통째로 줄인다), 자리 번호 꼬리표 */
.q9-coop-names { gap: 6px; }
.q9-coop-names i { color: #71717a; font-style: normal; }
.q9-seat-tag { font-size: 10px; font-weight: 800; color: #a1a1aa; margin-right: 2px; }
.q9-join { color: #fde68a; border-color: #b45309 !important; background: #78350f; }
.q9-msg.q9-note { font-size: 12px; font-weight: 600; }
.q9-off { opacity: .5; text-decoration: line-through; }
.q9-head-btns { display: flex; gap: 6px; flex: none; }
.q9-mini { padding: 4px 10px; border-radius: 999px; border: 1px solid #3f3f46; background: #18181b; font-size: 11px; font-weight: 700; }
.q9-warn { color: #fca5a5; border-color: #7f1d1d !important; }
/* 게임 소리만 조절(사이트 볼륨 × 게임 볼륨) — 쿼 비스트와 같은 🔊 + 슬라이더 */
.q9-sound { display: flex; align-items: center; gap: 4px; flex: none; }
.q9-sound .q9-mini { padding: 4px 7px; line-height: 1; }
.q9-vol { width: 64px; height: 14px; margin: 0; accent-color: #f87171; cursor: pointer; }
.q9-vol.q9-muted { opacity: .45; }

/* 화면: 304×224 논리 해상도를 비율 유지로 맞추고 픽셀 그대로 키운다 */
.q9-stage { position: relative; flex: 1 1 auto; min-height: 0; background: #000; }
.q9-screen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; image-rendering: crisp-edges; }
.q9-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10px; pointer-events: none; }
.q9-overlay > * { pointer-events: auto; }
.q9-msg { padding: 8px 14px; border-radius: 10px; background: rgba(0, 0, 0, .72); border: 1px solid #3f3f46; font-weight: 700; text-align: center; }
.q9-card { max-width: 92%; padding: 14px 18px; border-radius: 14px; background: rgba(9, 9, 11, .88); border: 1px solid #b91c1c; text-align: center; }
.q9-card h3 { margin: 0 0 6px; font-size: 20px; color: #fde68a; }
.q9-card p { margin: 4px 0; }
.q9-card.q9-lose h3 { color: #a1a1aa; }
.q9-rematch { margin: 8px 0 6px !important; }
.q9-rematch-time { color: #fbbf24; font-weight: 800; }
.q9-rematch-btns { display: flex; gap: 8px; justify-content: center; }
.q9-btn { padding: 7px 16px; border-radius: 9px; border: 1px solid #3f3f46; background: #27272a; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.q9-btn.q9-primary { background: #dc2626; border-color: #dc2626; color: #fff; }
.q9-btn.q9-danger { background: #7f1d1d; border-color: #b91c1c; color: #fff; }

/* 좁은 영상 영역(폰 세로 기본) */
#quopa98Root.q9-narrow .q9-head { gap: 4px 6px; padding: 4px 6px; }
/* 머리줄은 한 줄로 두고(이름 줄바꿈 없음), 좁은 화면에서는 client fitHead가 그 폭에 맞게 zoom으로 통째로 줄인다(docs §7).
   q9-measure = 한 줄 제 폭을 재는 순간에만. 0.55배로도 안 들어가면 q9-oneline을 풀어 예전처럼 이름을 꺾는다. */
.q9-head.q9-oneline .q9-name { white-space: nowrap; }
.q9-head.q9-measure { width: max-content; }
#quopa98Root.q9-narrow .q9-title-text { display: none; }
#quopa98Root.q9-narrow .q9-vs { gap: 5px; font-size: 12px; }
#quopa98Root.q9-narrow .q9-vol { width: 44px; }
#quopa98Root.q9-short .q9-card { padding: 8px 12px; }
#quopa98Root.q9-short .q9-card h3 { font-size: 16px; }

/* 로비(framework §8·§18.2): 자리 2줄 + 안내 + 버튼. 키 설정 탭은 사용자가 여는 보조 패널이라 목록만 내부 스크롤 */
#quopa98Root[data-phase="lobby"] .q9-stage { display: none; }
/* 로비 크기는 로비 영역에 맞춰 커진다: 글자 크기를 영역의 높이·폭에서 정하고(container query) 나머지는 em — 넓은 PC 화면에서 여백만 남지 않게(사용자 요청 2026-09-28) */
/* 오락실 테마(사용자 요청 2026-10-04): 어두운 보라 바탕에 위 분홍·아래 하늘 네온 번짐 + 화면 전체 옅은 주사선. 깜빡이는 효과는 쓰지 않는다 */
.q9-lobby { position: relative; flex: 1 1 auto; min-height: 0; container-type: size; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 10px;
  background: radial-gradient(90% 70% at 50% -10%, rgba(236, 72, 153, .22), transparent 60%), radial-gradient(70% 60% at 50% 115%, rgba(56, 189, 248, .14), transparent 65%), linear-gradient(180deg, #0c0719, #05050c); }
.q9-lobby::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 3px); }
.q9-lobby-card { position: relative; font-size: clamp(13px, min(3.1cqh, 1.9cqw), 22px); width: 100%; max-width: 48em; max-height: 100%; min-height: 0; display: flex; flex-direction: column; gap: .5em; }
.q9-lobby-card.q9-keys-open { flex: 1 1 auto; }
.q9-tabs { display: flex; align-items: center; gap: .3em; flex: none; }
/* 탭 줄 오른쪽 네온 간판(높이를 더 쓰지 않는다) */
.q9-neon { margin-left: auto; padding-right: .2em; font-weight: 900; font-style: italic; letter-spacing: .2em; font-size: 1.05em; color: #fdf2f8; white-space: nowrap;
  text-shadow: 0 0 .12em #fff, 0 0 .35em #f472b6, 0 0 .8em #ec4899, 0 0 1.4em #be185d; }
.q9-tab { padding: .3em .9em; border-radius: .6em; border: 1px solid #3f3f46; background: #18181b; font-size: .95em; font-weight: 700; color: #a1a1aa; }
.q9-tab[aria-selected="true"] { background: #4c1d95; border-color: #a855f7; color: #fff; box-shadow: 0 0 .55em rgba(168, 85, 247, .45); }
.q9-lobby-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: .5em; }
.q9-slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3em; flex: none; }
.q9-slot { display: flex; align-items: center; gap: .6em; padding: .3em .6em; min-height: 2.6em; border-radius: .7em; background: rgba(24, 24, 27, .92); border: 1px solid #27272a; }
.q9-slot.q9-mine { border-color: #be185d; box-shadow: 0 0 .5em rgba(236, 72, 153, .25); }
/* 자리 색 = 게임 머리줄의 1P~4P 색(파랑·빨강·초록·노랑) — 오락실 조작판 색처럼 왼쪽 띠와 자리 번호 */
.q9-slot[data-seat] { border-left: .28em solid var(--seat, #52525b); }
.q9-slot[data-seat="0"] { --seat: #60a5fa; }
.q9-slot[data-seat="1"] { --seat: #f87171; }
.q9-slot[data-seat="2"] { --seat: #4ade80; }
.q9-slot[data-seat="3"] { --seat: #facc15; }
/* 협동 4자리: 두 줄 두 칸(세로 높이가 낮은 영상 칸에도 들어가게) */
.q9-slots.q9-slots-4 { display: grid; grid-template-columns: 1fr 1fr; gap: .3em; }
.q9-slots.q9-slots-4 .q9-slot { min-width: 0; flex-wrap: wrap; row-gap: .15em; }
.q9-seat { flex: none; width: 1.7em; font-weight: 900; color: var(--seat, #fbbf24); text-shadow: 0 0 .45em var(--seat, transparent); }
.q9-slot-name { flex: 1 1 auto; min-width: 0; }
.q9-slot-state { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .3em; flex: 0 1 auto; }
.q9-slot-act { flex: none; }
.q9-tag { padding: .08em .55em; border-radius: 999px; background: #27272a; color: #a1a1aa; font-size: .85em; font-weight: 700; white-space: nowrap; }
.q9-tag.q9-ready { background: #14532d; color: #86efac; }
.q9-tag.q9-owner { background: #422006; color: #fcd34d; }
.q9-tag.q9-data { color: #93c5fd; }
.q9-tag.q9-level { color: #fde68a; }
.q9-level-ctl { display: inline-flex; align-items: center; gap: .3em; }
.q9-level-ctl .q9-btn.q9-small { min-width: 2em; padding: .15em .5em; }
.q9-cpu small { font-weight: 600; opacity: .8; }
.q9-empty { color: #71717a; font-weight: 600; }
.q9-lobby-msg { margin: 0; font-size: .92em; color: #a1a1aa; }
/* 로딩(전원 READY 뒤 모두 데이터를 받을 때까지): 안내 줄을 강조 */
.q9-lobby-msg.q9-prep { color: #fde68a; font-weight: 700; }
.q9-lobby-msg.q9-prep [data-prep-time] { font-variant-numeric: tabular-nums; }
/* 옵션 줄(협동 난이도·시작 스테이지) */
.q9-game-row { display: flex; align-items: center; flex-wrap: wrap; gap: .35em; flex: none; }
.q9-game-label { color: #a1a1aa; font-size: .9em; font-weight: 700; margin-right: .2em; }
.q9-game-cur { color: #fde68a; }
.q9-game-row small { color: #71717a; }
/* 게임 고르기(사용자 요청 2026-10-05, docs §7): 위 = 고른 게임 간판(큰 CRT 썸네일 + 네온 이름 + 꼬리표 + 협동 옵션, 모두 같다),
   아래(주인) = 작은 썸네일 한 줄 띠(대전 빨강 | 협동 하늘 묶음). 게임이 늘어도 한 줄 — 넘치면 좌우 스크롤·◀ ▶·남은 쪽 가장자리 흐림
   (넘침 상태 class는 .q9-lobby에 — 클라이언트 fitStrip, 로비 부분 갱신이 건드리지 않는 곳) */
.q9-cab-screen { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: .3em; background: #111 center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .8); }
.q9-cab-screen::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .28) 0 1px, transparent 1px 3px),
  radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, .5)); }
.q9-cab-tag { align-self: center; padding: .05em .5em; border-radius: 999px; font-size: .64em; font-weight: 800; white-space: nowrap;
  color: #fecaca; background: rgba(239, 68, 68, .18); border: 1px solid rgba(239, 68, 68, .45); }
.q9-coop .q9-cab-tag, .q9-cab-tag.q9-coop { color: #a5f3fc; background: rgba(34, 211, 238, .14); border-color: rgba(34, 211, 238, .45); }
.q9-marquee { display: flex; align-items: center; gap: .8em; flex: none; padding: .5em .7em; border-radius: .8em;
  background: linear-gradient(90deg, rgba(76, 29, 149, .55), rgba(30, 20, 52, .85)); border: 1px solid #5b3f8f; box-shadow: 0 0 .8em rgba(168, 85, 247, .22); }
.q9-marquee .q9-cab-screen { flex: none; width: 9em; border-radius: .4em; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .8), 0 0 0 .14em #2a2140, 0 0 .9em rgba(244, 114, 182, .35); }
.q9-marquee-text { display: flex; flex-direction: column; align-items: flex-start; gap: .35em; min-width: 0; }
.q9-marquee-name { font-size: 1.45em; font-weight: 900; line-height: 1.15; color: #fdf2f8; text-shadow: 0 0 .4em rgba(244, 114, 182, .7); }
.q9-marquee small { color: #a1a1aa; }
.q9-marquee .q9-cab-tag { align-self: flex-start; font-size: .78em; }
.q9-strip-wrap { display: flex; align-items: stretch; gap: .3em; flex: none; padding: .35em; border-radius: .8em;
  background: linear-gradient(180deg, rgba(30, 20, 52, .92), rgba(12, 10, 22, .92)); border: 1px solid #3b2a5c; box-shadow: inset 0 0 1.2em rgba(0, 0, 0, .6); }
.q9-strip { --fl: 0px; --fr: 0px; position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: stretch; gap: .35em; overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain; scrollbar-width: none; padding: .15em 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%); }
.q9-strip::-webkit-scrollbar { display: none; }
/* 양 끝 빈 칸: 가로 스크롤 끝 padding은 스크롤 범위에 안 들어가(크롬) 맨 끝 썸네일의 선택 테두리가 잘렸다 */
.q9-strip::before, .q9-strip::after { content: ''; flex: none; width: .2em; }
.q9-lobby.q9-strip-over:not(.q9-strip-start) .q9-strip { --fl: 1.4em; }
.q9-lobby.q9-strip-over:not(.q9-strip-end) .q9-strip { --fr: 1.4em; }
.q9-strip-nav { display: none; flex: none; width: 1.7em; padding: 0; border-radius: .5em; border: 1px solid #4c3a70; background: #1c1530; color: #e9d5ff; font-size: .85em; }
.q9-lobby.q9-strip-over .q9-strip-nav { display: block; }
.q9-strip-nav:disabled { opacity: .3; cursor: default; }
.q9-strip-nav:not(:disabled):hover { background: #2e2250; border-color: #a855f7; }
/* 묶음 이름(세로 글자) — 대전 빨강·협동 하늘, 두 번째 묶음 앞은 조금 띄운다 */
.q9-strip-label { flex: none; display: flex; align-items: center; justify-content: center; padding: .3em .18em; border-radius: .4em; writing-mode: vertical-rl; text-orientation: upright;
  font-size: .62em; font-weight: 900; letter-spacing: .15em; color: #fecaca; background: rgba(239, 68, 68, .14); border: 1px solid rgba(239, 68, 68, .4); }
.q9-strip-label.q9-coop { color: #a5f3fc; background: rgba(34, 211, 238, .12); border-color: rgba(34, 211, 238, .4); }
.q9-strip-label + .q9-thumb ~ .q9-strip-label { margin-left: .35em; }
.q9-thumb { position: relative; flex: 1 0 4.4em; max-width: 6.4em; padding: .18em; border-radius: .45em; border: 1px solid #3f3354; border-top: .2em solid var(--cab, #ef4444);
  background: linear-gradient(180deg, #2a2140, #151020); transition: transform .12s, box-shadow .12s, border-color .12s; }
.q9-thumb.q9-coop { --cab: #22d3ee; }
.q9-thumb .q9-cab-screen { width: 100%; }
.q9-thumb:not(:disabled):hover { transform: translateY(-2px); border-color: #7c6aa8; border-top-color: var(--cab, #ef4444); }
.q9-thumb.q9-cab-on { border-color: #f472b6; border-top-color: var(--cab, #ef4444); box-shadow: 0 0 0 1px #f472b6, 0 0 .7em rgba(244, 114, 182, .7); }
.q9-thumb:disabled { cursor: not-allowed; filter: grayscale(1); opacity: .45; }
/* 이름은 마우스를 올리거나 키보드로 고를 때만(고른 게임 이름은 간판에 크게 있다). 롬 없는 게임은 늘 「준비 중」 */
.q9-thumb-name { position: absolute; left: .18em; right: .18em; bottom: .18em; padding: .9em .25em .2em; border-radius: 0 0 .3em .3em; pointer-events: none;
  font-size: .58em; font-weight: 800; line-height: 1.15; color: #fdf2f8; text-align: center; overflow-wrap: anywhere;
  background: linear-gradient(180deg, transparent, rgba(8, 6, 16, .92) 45%); opacity: 0; transition: opacity .12s; }
.q9-thumb:hover .q9-thumb-name, .q9-thumb:focus-visible .q9-thumb-name, .q9-thumb:disabled .q9-thumb-name { opacity: 1; }
/* 협동 옵션 줄(난이도 −/+ · 시작 스테이지) */
.q9-coop-opts .q9-level-ctl { margin-right: .5em; }
.q9-stage-pick { max-width: 100%; min-width: 0; padding: .2em .4em; border-radius: .5em; border: 1px solid #3f3f46; background: #18181b; color: #f4f4f5; font: inherit; font-size: .92em; }
.q9-lobby-actions { display: flex; flex-wrap: wrap; gap: .45em; }
.q9-lobby .q9-btn { padding: .5em 1.2em; border-radius: .7em; font-size: 1em; }
.q9-lobby .q9-btn.q9-small { padding: .22em .75em; font-size: .92em; }
/* 오락기 누름 버튼(READY·참가): 아래 그림자로 두께를 주고 누르면 내려간다 */
.q9-lobby .q9-btn.q9-primary { background: linear-gradient(180deg, #f43f5e, #be123c); border-color: #fb7185; box-shadow: 0 .16em 0 #7f1d1d, 0 0 .7em rgba(244, 63, 94, .4); }
.q9-lobby .q9-btn.q9-primary:active { transform: translateY(.12em); box-shadow: 0 .04em 0 #7f1d1d; }
.q9-keys { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: .5em; }
.q9-keys-grid { flex: 0 1 auto; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(20em, 1fr)); gap: .25em .9em; align-content: start; }
.q9-key-row { display: grid; grid-template-columns: minmax(8em, 1.35fr) 1fr 1fr; gap: .3em; align-items: center; padding: .15em .3em; border-radius: .45em; }
.q9-key-row.q9-hit { background: rgba(250, 204, 21, .25); }
.q9-key-label { white-space: nowrap; }
.q9-key-label small { color: #a1a1aa; font-size: .85em; }
.q9-bind { min-height: 2em; padding: .2em .45em; border-radius: .45em; border: 1px solid #3f3f46; background: #18181b; font-size: .95em; overflow-wrap: anywhere; }
.q9-bind.q9-unset { color: #52525b; }
.q9-bind.q9-listen { border-color: #facc15; color: #fde68a; background: #422006; }
.q9-keys-foot { display: flex; align-items: center; gap: .6em; flex: none; }
.q9-keys-note { margin: 0; flex: 1; font-size: .85em; color: #a1a1aa; }
/* 폰 세로 기본 화면처럼 낮은 영역: 가장 작게, 간격도 줄인다 */
#quopa98Root.q9-short .q9-lobby { padding: 5px 8px; }
#quopa98Root.q9-short .q9-lobby-card { font-size: 12px; gap: .35em; }
#quopa98Root.q9-short .q9-lobby-body { gap: .35em; }
#quopa98Root.q9-short .q9-slot { min-height: 2.4em; padding: .15em .6em; }
#quopa98Root.q9-short .q9-tab { padding: .15em .8em; }
#quopa98Root.q9-short .q9-lobby .q9-btn { padding: .3em 1em; }
#quopa98Root.q9-short .q9-lobby .q9-btn.q9-small { padding: .15em .6em; }
#quopa98Root.q9-short .q9-bind { min-height: 1.9em; padding: .15em .4em; }
#quopa98Root.q9-short .q9-lobby-msg:not(.q9-prep) { display: none; }   /* 낮은 화면: 안내 한 줄은 확대 화면에서 본다(로딩 안내는 남긴다) */
#quopa98Root.q9-short .q9-marquee { gap: .6em; padding: .3em .45em; }
#quopa98Root.q9-short .q9-marquee .q9-cab-screen { width: 5.6em; }
#quopa98Root.q9-short .q9-marquee-text { gap: .2em; }
#quopa98Root.q9-short .q9-marquee-name { font-size: 1.2em; }
#quopa98Root.q9-short .q9-strip-wrap { padding: .25em; }
#quopa98Root.q9-short .q9-thumb { flex-basis: 3.8em; padding: .14em; }

/* 인게임 채팅 입력창(축구·쿼 비스트와 같은 가운데 아래 한 줄, PC 선수만) */
#quopa98Root .q9-chat-input { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); z-index: 6; width: min(420px, 80%);
  padding: 9px 14px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 18px; background: rgba(11, 19, 26, .9); color: #fff;
  font: inherit; font-size: 14px; outline: none; pointer-events: auto; box-shadow: 0 4px 16px rgba(0, 0, 0, .6); }

/* 모바일 가상패드(framework §18.4): 아래 좌우 구석, 가운데는 비운다. 오른쪽 네 버튼은 --s 단위 좌표(--x·--y)로 엄지 호를 따라 비스듬히(2026-09-28). */
.q9-pad { position: absolute; inset: auto 0 0 0; height: 46%; display: flex; justify-content: space-between; align-items: flex-end; padding: 6px 10px; pointer-events: none; touch-action: none; --s: min(15.5vmin, 68px); }
.q9-dpad { position: relative; width: min(34vmin, 150px); aspect-ratio: 1; border-radius: 50%; pointer-events: auto; touch-action: none;
  background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 255, 255, .22); }
.q9-dpad span { position: absolute; left: 50%; top: 50%; width: 34%; height: 34%; transform: translate(calc(-50% + var(--kx, 0px)), calc(-50% + var(--ky, 0px)));
  border-radius: 50%; background: rgba(255, 255, 255, .18); transition: transform .04s linear, background .08s; }
.q9-dpad.q9-on { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .45); }
.q9-dpad.q9-on span { background: rgba(250, 204, 21, .6); }
/* 방향 화살표: 들어가는 방향만 켜진다 */
.q9-arrow { position: absolute; width: 0; height: 0; border: 6px solid transparent; opacity: .35; transition: opacity .06s; }
.q9-arrow[data-d="u"] { top: 7%; left: 50%; transform: translateX(-50%); border-top-width: 0; border-bottom: 8px solid #fff; }
.q9-arrow[data-d="d"] { bottom: 7%; left: 50%; transform: translateX(-50%); border-bottom-width: 0; border-top: 8px solid #fff; }
.q9-arrow[data-d="l"] { left: 7%; top: 50%; transform: translateY(-50%); border-left-width: 0; border-right: 8px solid #fff; }
.q9-arrow[data-d="r"] { right: 7%; top: 50%; transform: translateY(-50%); border-right-width: 0; border-left: 8px solid #fff; }
.q9-dpad.q9-u .q9-arrow[data-d="u"] { opacity: 1; border-bottom-color: #facc15; }
.q9-dpad.q9-d .q9-arrow[data-d="d"] { opacity: 1; border-top-color: #facc15; }
.q9-dpad.q9-l .q9-arrow[data-d="l"] { opacity: 1; border-right-color: #facc15; }
.q9-dpad.q9-r .q9-arrow[data-d="r"] { opacity: 1; border-left-color: #facc15; }
/* 길게 누르기로 글자 선택·복사 메뉴(iOS 콜아웃)·탭 강조가 뜨지 않게 — 게임 화면과 패드만 */
#quopa98Root .q9-stage, #quopa98Root .q9-stage * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.q9-btns { position: relative; flex: none; width: calc(var(--s) * 2.46); height: calc(var(--s) * 2.34); pointer-events: none; }
.q9-btns button { position: absolute; left: calc(var(--s) * var(--x)); bottom: calc(var(--s) * var(--y)); width: var(--s); height: var(--s); padding: 0;
  pointer-events: auto; touch-action: none; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); background: rgba(220, 38, 38, .28); color: #fff;
  font-weight: 800; font-size: 16px; line-height: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.q9-btns button small { font-size: 9px; font-weight: 600; opacity: .8; }
.q9-btns button.q9-on { background: rgba(250, 204, 21, .55); }
/* 축소 화면: 세로 폰에서 게임 화면 양옆 검은 띠에 최대한 들어가게 */
#quopa98Root:not(.q9-expanded) .q9-pad { padding: 4px; --s: min(10vmin, 40px); }
#quopa98Root:not(.q9-expanded) .q9-dpad { width: min(24vmin, 100px); }
#quopa98Root:not(.q9-expanded) .q9-btns button { font-size: 13px; }
#quopa98Root:not(.q9-expanded) .q9-btns button small { display: none; }
/* 협동(D&D) 코인·스타트: 방향판과 버튼 사이 아래쪽 작은 알약 두 개 */
.q9-sys { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); display: flex; gap: 8px; pointer-events: none; }
.q9-sys[hidden] { display: none; }
.q9-sys button { pointer-events: auto; touch-action: none; padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(24, 24, 27, .6); color: #f4f4f5; font-size: 12px; font-weight: 700; }
.q9-sys button.q9-on { background: rgba(250, 204, 21, .55); }
#quopa98Root:not(.q9-expanded) .q9-sys button { padding: 3px 9px; font-size: 11px; }

/* 신청·초대·항복 팝업(게임 root 밖, 확대 화면 위에도 뜬다) */
.q9-modal { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; background: rgba(2, 6, 23, .55); }
.q9-modal-card { min-width: 260px; max-width: 92vw; padding: 16px 18px; border-radius: 14px; border: 1px solid #b91c1c; background: #0f0f12; color: #e4e4e7; text-align: center; }
.q9-modal-card h3 { margin: 0 0 6px; }
.q9-modal-card p { margin: 4px 0 12px; }
.q9-modal-time { margin: 6px 0 10px; color: #fbbf24; font-weight: 700; }
