/* 쿼켓몬 배틀 — docs/pokemon.md §7. 영상 영역(.video-wrap) 안에서만 그린다(framework §18.1). 전부 #pokemonRoot 안으로 한정. */
.game-pokemon { --game-color: 234, 179, 8; }

#pokemonRoot {
  position: absolute; inset: 0; width: 100%; height: 100%; box-sizing: border-box;
  z-index: 40; display: none; overflow: hidden; container-type: size;
  color: #eef2f7; font-family: inherit; font-size: 13px; background: #0b1020;
}
#pokemonRoot.pk-visible { display: block; }
#pokemonRoot * { box-sizing: border-box; }
#pokemonRoot [hidden] { display: none !important; }
/* 기본 버튼 글꼴·색은 상속 — :where로 우선순위 0(버튼마다 정한 글자색이 이긴다. #id로 두면 흰 기술 버튼 글자가 흰색이 됐다) */
:where(#pokemonRoot) button { font: inherit; color: inherit; cursor: pointer; }
#pokemonRoot button:disabled { cursor: default; }
#pokemonRoot button:focus-visible { outline: 3px solid #fde047; outline-offset: 1px; }
.pk-body { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }

/* CSS 확대만 쓴다. requestFullscreen 계열 금지(framework §18.3). */
#pokemonRoot.pk-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);
}
/* 확대 중 「축소」 버튼 자리는 client fitHead가 머리줄 오른쪽 여백으로 비운다(zoom 보정) */
#pokemonRoot.pk-expanded .pk-head [data-act="expand"] { display: none; }
.pk-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; }
#pokemonExpand { 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) { #pokemonExpand.pk-show { display: block; } }
/* 모바일 세로 대전 화면: 영상 칸을 16:9보다 높여 무대 아래에 명령 줄을 둔다 — 높이는 클라이언트가 --pk-tall-h로 준다(docs §7). */
@media (max-width: 768px) and (orientation: portrait), (max-width: 1024px) and (any-pointer: coarse) and (orientation: portrait) {
  body:not(.landscape-mobile) .video-wrap.pk-tall { aspect-ratio: auto !important; height: var(--pk-tall-h) !important; max-height: none !important; }
}

/* 머리줄(framework §18.6): 한 줄로 두고 좁으면 client fitHead가 zoom으로 통째로 줄인다 */
.pk-head { display: flex; align-items: center; gap: 8px; padding: 5px 10px; flex: none;
  background: linear-gradient(90deg, #c52a0b 0, #e3350d 3.2em, #1b2340 3.2em, #22305e); border-bottom: 2px solid #ffcb05; }
.pk-head-info { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.pk-title { font-size: 14px; white-space: nowrap; }
.pk-mode { font-size: 11px; color: #cbd5e1; white-space: nowrap; }
.pk-vs { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; justify-content: center; }
.pk-vs b { color: #fde047; font-size: 12px; letter-spacing: .08em; margin: 0 4px; }
.pk-amp { font-style: normal; color: #64748b; margin: 0 2px; }
.pk-name { font-weight: 700; overflow-wrap: anywhere; line-height: 1.2; }
.pk-name small { font-size: .78em; color: #fca5a5; }
.pk-t0 { color: #93c5fd; }
.pk-t1 { color: #fca5a5; }
.pk-off { opacity: .5; text-decoration: line-through; }
.pk-ai-took { opacity: .7; }
.pk-empty { color: #64748b; font-weight: 600; }
.pk-clock { flex: none; font-size: 12px; font-weight: 700; color: #e2e8f0; white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.pk-clock .pk-hurry { color: #fca5a5; }
.pk-bank, .pk-total { color: #94a3b8; font-weight: 600; }
.pk-head-btns { display: flex; gap: 6px; flex: none; }
.pk-mini { padding: 4px 10px; border-radius: 999px; border: 1px solid #3f3f46; background: #111827; font-size: 11px; font-weight: 700; }
.pk-mini[aria-pressed="true"] { background: #1e3a8a; }
.pk-warn { color: #fca5a5; border-color: #7f1d1d !important; }
.pk-sound { display: flex; align-items: center; gap: 4px; flex: none; }
.pk-sound .pk-mini { padding: 4px 7px; line-height: 1; }
.pk-vol { width: 64px; height: 14px; margin: 0; accent-color: #facc15; cursor: pointer; }
.pk-vol.pk-muted { opacity: .45; }
.pk-head.pk-oneline .pk-name { white-space: nowrap; }
.pk-head.pk-measure { width: max-content; }
#pokemonRoot.pk-narrow .pk-title-text, #pokemonRoot.pk-narrow .pk-mode { display: none; }
#pokemonRoot.pk-narrow .pk-vol { width: 44px; }

/* 공통 버튼 */
.pk-btn { padding: 7px 16px; border-radius: 9px; border: 1px solid #3f3f46; background: #1f2937; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.pk-btn.pk-primary { background: #dc2626; border-color: #dc2626; color: #fff; }
.pk-btn.pk-danger { background: #7f1d1d; border-color: #b91c1c; color: #fff; }
.pk-btn.pk-small { padding: .2em .7em; font-size: .92em; }
.pk-btn:disabled { opacity: .45; }
.pk-tag { padding: .08em .55em; border-radius: 999px; background: #1f2937; color: #94a3b8; font-size: .85em; font-weight: 700; white-space: nowrap; }
.pk-tag.pk-ready { background: #14532d; color: #86efac; }
.pk-tag.pk-owner { background: #422006; color: #fcd34d; }
.pk-type { display: inline-block; padding: .05em .45em; border-radius: .35em; background: var(--tc, #888); color: #fff; font-style: normal; font-size: .78em; font-weight: 800; text-shadow: 0 1px 1px rgba(0, 0, 0, .45); white-space: nowrap; }

/* 전투 밖 화면(로비·드래프트·미리보기): 영역 크기에 맞춰 글자 크기가 바뀐다(framework §18.2).
   포켓몬 톤(사용자 요청 2026-09-29): 몬스터볼 빨강 #e3350d · 로고 노랑 #ffcb05 · 로고 파랑 #3d7dca, 남색 바탕에 몬스터볼 무늬 */
.pk-panel { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px 12px; overflow: hidden;
  background:
    radial-gradient(circle at 88% 118%, transparent 0 17%, rgba(255, 255, 255, .045) 17% 17.8%, transparent 17.8%),
    linear-gradient(transparent calc(100% - 2px), transparent),
    radial-gradient(120% 80% at 50% -10%, rgba(61, 125, 202, .45), transparent 65%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 14px, transparent 14px 28px),
    #141c36; }
.pk-card { width: 100%; max-width: 56em; max-height: 100%; min-height: 0; display: flex; flex-direction: column; gap: .5em;
  font-size: clamp(12px, min(3.2cqh, 2.6cqw), 20px); }
.pk-hint { margin: 0; font-size: .9em; color: #c7d2fe; text-align: center; }
.pk-rules { margin: 0; font-size: .76em; color: #7c89b8; text-align: center; }
.pk-actions { display: flex; flex-wrap: wrap; gap: .5em; justify-content: center; }

/* 몬스터볼 아이콘 */
.pk-ball { position: relative; display: inline-block; width: 1em; height: 1em; flex: none; border-radius: 50%; vertical-align: -.14em;
  background: linear-gradient(#e3350d 0 45%, #1b1b1b 45% 55%, #fff 55%); box-shadow: 0 0 0 .07em #1b1b1b; }
.pk-ball::after { content: ''; position: absolute; left: 50%; top: 50%; width: .34em; height: .34em; transform: translate(-50%, -50%);
  border-radius: 50%; background: #fff; box-shadow: 0 0 0 .07em #1b1b1b; }

/* 로비 */
.pk-lobby { max-width: 46em; gap: .6em; }
.pk-modes { display: grid; grid-template-columns: 1fr 1fr; gap: .5em; }
.pk-mode-grp { display: grid; grid-template-columns: 1fr 1fr; gap: .35em; padding: .45em; border-radius: .9em; background: rgba(10, 16, 36, .6); border: 1px solid rgba(255, 255, 255, .08); position: relative; }
.pk-mode-label { position: absolute; left: .9em; top: -.62em; padding: 0 .4em; font-size: .72em; font-weight: 800; color: #ffcb05; background: #141c36; border-radius: .4em; letter-spacing: .02em; }
.pk-mode-btn { display: flex; align-items: center; gap: .45em; padding: .45em .6em; border-radius: .7em; border: 2px solid transparent; background: rgba(255, 255, 255, .06);
  color: #dbe4ff; text-align: left; transition: background .15s, border-color .15s, transform .1s; }
.pk-mode-btn:not(:disabled):hover { background: rgba(255, 255, 255, .12); }
.pk-mode-btn:not(:disabled):active { transform: scale(.97); }
.pk-mode-ico { font-size: 1.35em; line-height: 1; flex: none; }
.pk-mode-txt { display: flex; flex-direction: column; min-width: 0; }
.pk-mode-txt b { font-size: 1em; line-height: 1.2; }
.pk-mode-txt small { font-size: .74em; opacity: .75; line-height: 1.25; }
.pk-mode-btn.pk-on { background: #ffcb05; border-color: #fff3b0; color: #1b2340; box-shadow: 0 .15em .6em rgba(255, 203, 5, .35); }
.pk-mode-btn.pk-on small { opacity: .85; }
.pk-mode-btn:disabled:not(.pk-on) { opacity: .45; }
.pk-owner-note { margin: -.2em 0 0; font-size: .74em; color: #8b98c9; text-align: center; }

/* 대전 구도: A팀 | VS | B팀 */
.pk-arena { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5em; }
.pk-side { min-width: 0; display: flex; flex-direction: column; gap: .3em; }
.pk-side-h { margin: 0; padding: .15em .8em; border-radius: .5em; font-size: .85em; font-weight: 900; letter-spacing: .08em; color: #fff; width: max-content; }
.pk-side-0 .pk-side-h { background: #3d7dca; }
.pk-side-1 .pk-side-h { background: #e3350d; margin-left: auto; }
.pk-lvs { font-size: 1.9em; font-weight: 900; font-style: italic; color: #ffcb05; letter-spacing: -.03em; text-shadow: .06em .06em 0 #e3350d, -.03em -.03em 0 #1b2340; padding: 0 .1em; }
.pk-tcs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35em; }
/* 트레이너 카드 */
.pk-tc { position: relative; display: flex; align-items: center; gap: .55em; min-height: 3.4em; padding: .45em .6em; border-radius: .85em;
  background: linear-gradient(100deg, rgba(255, 255, 255, .96), rgba(236, 241, 255, .94)); color: #1b2340; box-shadow: 0 .15em .5em rgba(0, 0, 0, .3); }
.pk-side-0 .pk-tc { border-left: .35em solid #3d7dca; }
.pk-side-1 .pk-tc { border-right: .35em solid #e3350d; flex-direction: row-reverse; text-align: right; }
.pk-tc.pk-mine { box-shadow: 0 0 0 .16em #ffcb05, 0 .15em .6em rgba(0, 0, 0, .35); }
.pk-tc-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .15em; }
.pk-side-1 .pk-tc-main { align-items: flex-end; }
.pk-tc .pk-name { font-size: 1.05em; font-weight: 800; }
.pk-tc .pk-t0, .pk-tc .pk-t1 { color: #1b2340; }
.pk-tc-row { display: flex; flex-wrap: wrap; align-items: center; gap: .3em; }
.pk-side-1 .pk-tc-row { justify-content: flex-end; }
.pk-tc-sub { font-size: .78em; font-weight: 700; color: #5a6690; }
.pk-av { position: relative; flex: none; width: 2.4em; height: 2.4em; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: var(--av, #3d7dca); color: #fff; font-weight: 900; font-size: 1em; box-shadow: 0 0 0 .14em #fff, 0 0 0 .24em rgba(27, 35, 64, .25); }
.pk-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pk-av-bot { background: #e8ecfb; font-size: 1.2em; }
.pk-av-empty { background: rgba(255, 255, 255, .08); box-shadow: none; font-size: 1.5em; opacity: .55; }
/* 준비 도장 */
.pk-stamp { flex: none; display: inline-flex; align-items: center; gap: .3em; padding: .2em .6em; border-radius: 999px; font-size: .78em; font-weight: 900; white-space: nowrap;
  background: #e2e7f5; color: #5a6690; }
.pk-stamp-ready { background: #16a34a; color: #fff; box-shadow: 0 0 .6em rgba(22, 163, 74, .45); }
.pk-stamp-ai { background: #1b2340; color: #ffcb05; letter-spacing: .06em; }
/* 빈 자리: 점선 카드 */
.pk-tc.pk-tc-empty { background: rgba(255, 255, 255, .05); color: #c7d2fe; box-shadow: none; border: .12em dashed rgba(199, 210, 254, .35); }
.pk-side-0 .pk-tc.pk-tc-empty, .pk-side-1 .pk-tc.pk-tc-empty { border-left-width: .12em; border-right-width: .12em; }
.pk-tc-empty .pk-name.pk-empty { color: #8b98c9; font-size: .95em; }
.pk-tc-btns { display: flex; flex-wrap: wrap; gap: .3em; }
.pk-side-1 .pk-tc-btns { justify-content: flex-end; }
/* 로비 버튼 */
.pk-lb { padding: .28em .75em; border-radius: 999px; font-size: .8em; font-weight: 800; border: 1.5px solid rgba(199, 210, 254, .45); background: rgba(255, 255, 255, .08); color: #e6ebff; }
.pk-lb:hover { background: rgba(255, 255, 255, .16); }
.pk-lb-go { background: #ffcb05; border-color: #ffcb05; color: #1b2340; }
.pk-lb-x { padding: .15em .5em; border-color: #c3cbe6; background: #fff; color: #7c89b8; }
.pk-lv-seg { display: inline-flex; border-radius: 999px; overflow: hidden; border: 1.5px solid #c3cbe6; }
.pk-lv-btn { padding: .18em .6em; border: 0; background: #fff; color: #5a6690; font-size: .76em; font-weight: 800; }
.pk-lv-btn + .pk-lv-btn { border-left: 1.5px solid #c3cbe6; }
.pk-lv-btn.pk-on { background: #1b2340; color: #ffcb05; }
/* 큰 버튼: 준비 완료 = 몬스터볼 빨강 */
.pk-big { display: inline-flex; align-items: center; gap: .4em; padding: .5em 1.4em; border-radius: 999px; font-size: 1.05em; font-weight: 900; border: 0; color: #fff; }
.pk-big-ready { background: linear-gradient(#f0492a, #c52a0b); box-shadow: 0 .2em 0 #8e1d07, 0 .35em .8em rgba(227, 53, 13, .4); }
.pk-big-ready:active { transform: translateY(.12em); box-shadow: 0 .08em 0 #8e1d07; }
.pk-big-cancel { background: #475569; }
.pk-big-go { background: #ffcb05; color: #1b2340; box-shadow: 0 .2em 0 #b38e00; }
.pk-big-ghost { background: transparent; border: 2px solid rgba(199, 210, 254, .4); color: #dbe4ff; }
/* 좁은·낮은 화면(폰 세로 기본 화면): 모드 두 묶음을 세로로 */
#pokemonRoot.pk-narrow .pk-modes { grid-template-columns: 1fr; gap: .7em; }
#pokemonRoot.pk-narrow .pk-arena { gap: .3em; }
#pokemonRoot.pk-narrow .pk-lvs { font-size: 1.4em; }
#pokemonRoot.pk-narrow .pk-av { width: 2em; height: 2em; }

/* 드래프트 */
.pk-draft, .pk-preview { max-width: none; height: 100%; font-size: clamp(10px, min(2.3cqh, 1.35cqw), 16px); }
.pk-draft-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4em .6em; font-size: 1.1em; }
/* 뽑기 순서 줄(팀 색 칸, 지금 칸은 크게, 내 칸은 「나」) */
.pk-ord-strip { display: flex; flex-wrap: wrap; gap: .22em; margin-left: auto; font-size: .78em; }
.pk-ord { display: grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: .45em; border: 1px solid; font-size: .95em; font-weight: 800; color: #cbd5e1; background: rgba(15, 23, 42, .85); overflow: hidden; }
.pk-ord-t0 { border-color: #3b82f6; }
.pk-ord-t1 { border-color: #ef4444; }
.pk-ord-me:not(.pk-ord-done) { color: #2a1d00; background: #facc15; border-color: #fde047; }
.pk-ord-done { opacity: .5; }
.pk-ord .pk-ico { width: 1.8em; height: 1.8em; }
.pk-ord-now { transform: scale(1.22); border-width: 2px; box-shadow: 0 0 .5em currentColor; opacity: 1; }
.pk-ord-now.pk-ord-t0 { color: #93c5fd; }
.pk-ord-now.pk-ord-t1 { color: #fca5a5; }
.pk-ord-now.pk-ord-me { color: #2a1d00; background: #fde047; }
/* 차례 띠 */
.pk-dturn { position: relative; flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: .3em .7em; padding: .45em .8em .6em; border-radius: .6em; border: 2px solid; overflow: hidden; font-size: 1.15em; color: #fff; }
.pk-dturn-text { font-weight: 800; }
.pk-dturn small { font-size: .78em; font-weight: 700; opacity: .9; }
.pk-dturn-sec { margin-left: auto; font-weight: 900; font-variant-numeric: tabular-nums; }
.pk-dturn-sec.pk-hurry { color: #b91c1c; }
.pk-dturn-bar { position: absolute; left: 0; right: 0; bottom: 0; height: .3em; background: rgba(0, 0, 0, .3); }
.pk-dturn-bar span { display: block; height: 100%; width: 100%; background: currentColor; transition: width .25s linear; }
.pk-dturn-bar span.pk-hurry { background: #ef4444; }
.pk-dturn-me { color: #2a1d00; border-color: #fde047; background: linear-gradient(90deg, #facc15, #fbbf24 60%, #f59e0b); animation: pk-dturn-glow 1.4s ease-in-out infinite; }
.pk-dturn-me .pk-btn { margin-left: .2em; }
.pk-dturn-t0 { border-color: #3b82f6; background: rgba(29, 78, 216, .35); }
.pk-dturn-t1 { border-color: #ef4444; background: rgba(185, 28, 28, .35); }
.pk-dturn-t0 .pk-dturn-bar span { background: #93c5fd; }
.pk-dturn-t1 .pk-dturn-bar span { background: #fca5a5; }
.pk-dturn .pk-name { color: inherit; }
.pk-dturn-next { color: #fde047; }
@keyframes pk-dturn-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, .0); } 50% { box-shadow: 0 0 .9em .15em rgba(250, 204, 21, .55); } }
.pk-draft-teams { display: flex; gap: .6em; flex: none; }
.pk-dt { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: .2em; padding: .25em .4em; border-radius: .6em; background: rgba(17, 24, 39, .8); }
.pk-dt0 { border: 1px solid #1d4ed8; }
.pk-dt1 { border: 1px solid #b91c1c; }
.pk-draft-p { display: flex; flex-wrap: wrap; align-items: center; gap: .3em; min-height: 2.1em; padding: .1em .3em; border-radius: .45em; }
.pk-draft-p.pk-picking { background: rgba(250, 204, 21, .14); box-shadow: 0 0 0 1px rgba(250, 204, 21, .6); }
.pk-picking-tag { margin-left: auto; padding: .05em .45em; border-radius: 1em; background: #facc15; color: #2a1d00; font-size: .72em; font-style: normal; font-weight: 800; }
.pk-dslot { flex: none; width: 1.6em; height: 1.6em; border-radius: 50%; border: 1px dashed #475569; }
.pk-draft-p img { width: 2.2em; height: 2.2em; object-fit: contain; image-rendering: pixelated; }
.pk-pool { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(15em, 1fr)); gap: .35em; align-content: start; }
.pk-set { position: relative; display: grid; grid-template-columns: 3.4em 1fr auto; grid-template-rows: auto auto auto auto; column-gap: .45em; row-gap: .12em; align-items: center;
  padding: .3em .45em; border-radius: .6em; border: 1px solid #334155; background: #111827; text-align: left; font-size: 1em; }
.pk-set:not(:disabled):hover { border-color: #facc15; }
.pk-draft-mine .pk-pool .pk-set:not(:disabled) { border-color: rgba(250, 204, 21, .45); cursor: pointer; }
.pk-draft-mine .pk-pool .pk-set:not(:disabled):hover { border-color: #facc15; box-shadow: 0 0 0 1px #facc15; }
.pk-pool-wait .pk-set:not(:disabled) { opacity: .62; cursor: default; }
.pk-pool-wait .pk-set:not(:disabled):hover { border-color: #334155; }
.pk-set-go { position: absolute; right: .4em; bottom: .3em; padding: .05em .45em; border-radius: 1em; background: #facc15; color: #2a1d00; font-size: .72em; font-weight: 800; }
.pk-set.pk-sel { border-color: #facc15; box-shadow: 0 0 0 2px rgba(250, 204, 21, .45); }
.pk-set.pk-taken { opacity: .45; }
.pk-set.pk-by0 { border-color: #1d4ed8; }
.pk-set.pk-by1 { border-color: #b91c1c; }
.pk-set-img { grid-row: 1 / span 4; width: 3.4em; height: 3.4em; object-fit: contain; image-rendering: pixelated; }
.pk-set-name { font-weight: 800; }
.pk-set-lv { font-size: .8em; color: #94a3b8; justify-self: end; }
.pk-set-types { grid-column: 2 / span 2; display: flex; flex-wrap: wrap; gap: .2em; }
.pk-set-moves { grid-column: 2 / span 2; display: flex; flex-wrap: wrap; gap: .15em .35em; font-size: .8em; color: #cbd5e1; }
.pk-set-moves i { font-style: normal; }
.pk-set-meta { grid-column: 2 / span 2; font-size: .75em; color: #94a3b8; }
.pk-set-by { position: absolute; right: .4em; bottom: .3em; font-size: .75em; font-weight: 800; color: #fde047; }
.pk-tera-t { opacity: .9; }

/* 미리보기 */
.pk-pv-mine h4 { margin: 0 0 .25em; font-size: .95em; color: #fde047; }
.pk-pv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(15em, 1fr)); gap: .35em; margin-bottom: .4em; }
.pk-pv.pk-lead { border-color: #facc15; }
.pk-lead-tag, .pk-order { position: absolute; left: .3em; top: .2em; font-size: .7em; font-weight: 800; padding: 0 .35em; border-radius: .3em; background: #facc15; color: #111; }
.pk-order { background: #334155; color: #e2e8f0; }
.pk-pv-others { display: flex; flex-wrap: wrap; gap: .4em; }
.pk-pv-other { display: flex; flex-direction: column; gap: .2em; padding: .3em .5em; border-radius: .6em; background: rgba(17, 24, 39, .85); }
.pk-pv-icons img { width: 2.4em; height: 2.4em; object-fit: contain; image-rendering: pixelated; }

/* 전투: 무대(16:9 논리 640×360, 통째로 축소) + 명령 줄 */
.pk-battle { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.pk-stage-host { position: relative; flex: 1 1 auto; min-height: 0; background: #000; }
.pk-field-wrap { position: absolute; inset: 0; overflow: hidden; }
.pk-field { position: absolute; left: 0; top: 0; width: 640px; height: 360px; transform-origin: 0 0; overflow: hidden; }
.pk-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.pk-bg.pk-bg-default { background: linear-gradient(#8ecdf2 0%, #cdeafa 48%, #86c56b 49%, #5fa84a 100%); }
.pk-tint { position: absolute; inset: 0; pointer-events: none; transition: background .6s; }
.pk-tint[data-weather="RainDance"], .pk-tint[data-weather="PrimordialSea"] { background: rgba(30, 64, 175, .22); }
.pk-tint[data-weather="SunnyDay"], .pk-tint[data-weather="DesolateLand"] { background: rgba(251, 191, 36, .2); }
.pk-tint[data-weather="Sandstorm"] { background: rgba(180, 140, 70, .28); }
.pk-tint[data-weather="Snowscape"], .pk-tint[data-weather="Snow"], .pk-tint[data-weather="Hail"] { background: rgba(224, 242, 254, .3); }
.pk-fx { position: absolute; left: 0; top: 0; width: 640px; height: 360px; pointer-events: none; }
.pk-fx[hidden] { display: none; }
/* PokeRogue ADD·DIFFERENCE 연출 그래픽 층(pokemon_anim.js blendCanvases) — plus-lighter 미지원이면 screen */
.pk-fx-add { mix-blend-mode: screen; mix-blend-mode: plus-lighter; }
.pk-fx-diff { mix-blend-mode: difference; }
.pk-mon { position: absolute; width: 0; height: 0; }
.pk-shadow { position: absolute; left: -48px; top: -10px; width: 96px; height: 18px; border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, .38), transparent 70%); }
/* spr = 그림 + 보석 광택 + 테라 왕관(연출 변형은 spr에) */
.pk-spr { position: absolute; left: 0; bottom: 0; translate: -50% 0; transform-origin: 50% 50%; line-height: 0; }
.pk-sprite { display: block; image-rendering: auto; max-width: none; user-select: none; -webkit-user-drag: none; }
/* 테라스탈(원작: 결정체 몸 + 머리 위 테라 쥬얼): 타입 색 테두리, 그림 모양으로 자른 보석 결·흐르는 광택, 왕관 */
.pk-gloss { position: absolute; inset: 0; display: none; pointer-events: none; opacity: .8; mix-blend-mode: screen;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  background:
    linear-gradient(115deg, transparent 0 38%, rgba(255, 255, 255, .85) 46%, transparent 54%) 0 0 / 260% 100%,
    repeating-linear-gradient(60deg, rgba(255, 255, 255, .28) 0 2px, transparent 2px 10px),
    repeating-linear-gradient(-60deg, rgba(255, 255, 255, .2) 0 2px, transparent 2px 12px),
    linear-gradient(160deg, color-mix(in srgb, var(--tc) 70%, #fff), color-mix(in srgb, var(--tc) 55%, transparent));
  animation: pk-tera-shine 2.6s linear infinite; }
.pk-crown { position: absolute; left: 50%; top: 0; width: 38px; translate: -50% -78%; display: none; color: var(--tc); pointer-events: none;
  filter: drop-shadow(0 0 3px var(--tc)) drop-shadow(0 0 6px rgba(255, 255, 255, .7)); animation: pk-crown-bob 1.8s ease-in-out infinite; }
.pk-crown svg { display: block; width: 100%; height: auto; }
/* 던지는 몬스터볼(무대 논리 좌표, 가운데 기준) */
.pk-throw { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; z-index: 3; pointer-events: none; font-size: 18px; }
.pk-spr.pk-terad .pk-gloss, .pk-spr.pk-terad .pk-crown { display: block; }
/* 3D 모델 GIF는 부드럽게 확대, 진짜 도트(gen5 정지 그림)만 각지게 */
.pk-sprite.pk-pixel { image-rendering: pixelated; }
.pk-spr.pk-terad .pk-sprite { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 0 5px var(--tc)) saturate(1.2) contrast(1.08); }
/* 스텔라 테라스탈은 무지갯빛 */
.pk-spr.pk-stellar .pk-gloss { background:
    linear-gradient(115deg, transparent 0 38%, rgba(255, 255, 255, .9) 46%, transparent 54%) 0 0 / 260% 100%,
    repeating-linear-gradient(60deg, rgba(255, 255, 255, .28) 0 2px, transparent 2px 10px),
    linear-gradient(135deg, #ff6b6b, #ffd93d, #6bff95, #6bc5ff, #c56bff); }
@keyframes pk-tera-shine { from { background-position: 130% 0, 0 0, 0 0, 0 0; } to { background-position: -130% 0, 0 0, 0 0, 0 0; } }
@keyframes pk-crown-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
/* 정보 창(스칼렛·바이올렛풍 어두운 유리 캡슐): 이름·성별·테라 타입·Lv, 상태 + HP 바(+ 내 쪽은 실제 HP 숫자) */
.pk-info { position: absolute; width: 232px; padding: 6px 11px 7px; border-radius: 14px 5px 14px 5px; color: #fff;
  background: linear-gradient(180deg, rgba(34, 45, 84, .93), rgba(18, 25, 50, .93)); box-shadow: 0 3px 10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .14); font-size: 13px; }
.pk-info-own { border-left: 4px solid #3d7dca; }
.pk-info-foe { border-left: 4px solid #e3350d; }
.pk-info-top { display: flex; align-items: center; gap: 5px; }
.pk-info-name { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 118px; letter-spacing: -.01em; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.pk-g { font-style: normal; font-weight: 900; font-size: 13px; }
.pk-gm { color: #7cb8ff; } .pk-gf { color: #ff8fc7; }
.pk-lv { margin-left: auto; font-weight: 800; font-size: 12px; color: #ffcb05; }
.pk-tera { font-style: normal; font-size: 10px; font-weight: 900; padding: 1px 5px; border-radius: 5px; background: var(--tc); color: #fff; box-shadow: 0 0 6px var(--tc); text-shadow: 0 1px 1px rgba(0, 0, 0, .4); }
.pk-tera::before { content: '✦ '; }
.pk-hpline { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.pk-st { font-style: normal; font-size: 10px; font-weight: 900; padding: 1px 5px; border-radius: 5px; background: var(--sc); color: #fff; }
.pk-hplabel { font-size: 10px; font-weight: 900; color: #ffcb05; letter-spacing: .02em; }
.pk-hpbar { position: relative; flex: 1 1 auto; height: 8px; border-radius: 5px; background: rgba(0, 0, 0, .45); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); overflow: hidden; }
.pk-hpfill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35); }
.pk-hp-g { background: linear-gradient(90deg, #16a34a, #4ade80); } .pk-hp-y { background: linear-gradient(90deg, #ca8a04, #facc15); } .pk-hp-r { background: linear-gradient(90deg, #b91c1c, #f87171); }
.pk-hptext { flex: none; font-size: 12px; font-weight: 800; min-width: 60px; text-align: right; color: #e6ebff; font-variant-numeric: tabular-nums; }

/* 명령 줄: 넓은 화면 = 무대 아래쪽에 겹침, 세로로 긴 화면 = 무대 아래 */
.pk-band { position: absolute; left: 0; right: 0; bottom: 0; min-height: 26%; max-height: 62%; padding: 6px 8px; display: flex; flex-direction: column; justify-content: flex-end;
  font-size: clamp(11px, min(3.6cqh, 2cqw), 18px); pointer-events: none; }
.pk-band > * { pointer-events: auto; }
#pokemonRoot.pk-tall-layout .pk-band { position: relative; min-height: 0; max-height: none; flex: 0 0 auto; background: #0b1020; font-size: clamp(12px, 3.6cqw, 17px); }
/* 세로로 긴 화면: 무대는 남는 높이 가운데(폭 기준 16:9), 명령 줄은 맨 아래(엄지가 닿는 자리) */
#pokemonRoot.pk-tall-layout .pk-stage-host { flex: 1 1 auto; min-height: 0; }
.pk-msgbox { padding: .6em 1em; border-radius: .9em; background: linear-gradient(180deg, rgba(27, 35, 64, .94), rgba(14, 19, 40, .94)); min-height: 3.4em;
  border: 2px solid rgba(255, 255, 255, .14); box-shadow: 0 4px 14px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .1); }
.pk-msg { margin: 0; font-size: 1.08em; font-weight: 800; line-height: 1.4; min-height: 1.4em; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.pk-wait { display: block; margin-top: .2em; font-size: .85em; color: #9fb0e6; }
.pk-cmd { padding: .5em; border-radius: .9em; background: linear-gradient(180deg, rgba(27, 35, 64, .95), rgba(14, 19, 40, .95));
  border: 2px solid rgba(255, 255, 255, .14); box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
.pk-cmd-main { display: flex; gap: .55em; align-items: stretch; }
.pk-cmd-left { flex: 0 0 30%; display: flex; flex-direction: column; justify-content: space-between; gap: .35em; min-width: 0; }
.pk-prompt { margin: 0; font-weight: 800; font-size: 1em; line-height: 1.3; color: #fff; }
.pk-cmd-btns { display: flex; flex-wrap: wrap; gap: .35em; }
.pk-band .pk-btn { padding: .38em .9em; font-size: .92em; border-radius: 999px; border: 2px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); color: #fff; font-weight: 800; }
.pk-band .pk-btn:hover { background: rgba(255, 255, 255, .16); }
.pk-tera-btn { border-color: var(--tc) !important; }
.pk-tera-btn small { font-size: .8em; opacity: .9; }
.pk-tera-btn.pk-on { background: var(--tc) !important; color: #fff; box-shadow: 0 0 12px var(--tc), inset 0 1px 0 rgba(255, 255, 255, .4); }
.pk-moves { flex: 1 1 auto; display: grid; grid-template-columns: 1fr 1fr; gap: .35em; min-width: 0; }
/* 기술 버튼: 흰 알약 + 왼쪽 타입 색 띠(스칼렛·바이올렛 기술 목록 느낌) */
.pk-mv { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .12em; padding: .38em .7em .38em 1.05em; border-radius: 999px; text-align: left; min-width: 0;
  border: 0; background: linear-gradient(90deg, var(--tc) 0 .5em, #f7f9ff .5em); color: #1b2340; box-shadow: 0 2px 0 rgba(0, 0, 0, .35); transition: transform .08s, box-shadow .12s; }
.pk-mv:not(:disabled):hover { box-shadow: 0 0 0 3px #ffcb05, 0 2px 0 rgba(0, 0, 0, .35); }
.pk-mv:not(:disabled):active { transform: translateY(1px); }
.pk-mv:disabled { opacity: .4; }
.pk-mv-name { font-weight: 900; font-size: 1.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pk-mv-meta { display: flex; align-items: center; gap: .35em; font-size: .78em; color: #5a6690; width: 100%; }
.pk-pp { margin-left: auto; font-weight: 800; color: #1b2340; font-variant-numeric: tabular-nums; }
.pk-eff { font-style: normal; font-weight: 900; font-size: .92em; padding: 0 .35em; border-radius: .35em; white-space: nowrap; flex: none; }
.pk-eff2 { background: #16a34a; color: #fff; } .pk-effh { background: #94a3b8; color: #fff; } .pk-eff0 { background: #1b2340; color: #cbd5e1; }
.pk-cmd-top { display: flex; align-items: center; justify-content: space-between; gap: .5em; margin-bottom: .35em; }
.pk-sw-list, .pk-targets { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35em; }
.pk-sw, .pk-tg { display: flex; align-items: center; gap: .4em; padding: .28em .5em; border-radius: .8em; border: 0; background: #f7f9ff; color: #1b2340; text-align: left; min-width: 0; box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.pk-sw:not(:disabled):hover, .pk-tg:hover { box-shadow: 0 0 0 3px #ffcb05; }
.pk-sw img, .pk-tg img { width: 2.3em; height: 2.3em; object-fit: contain; image-rendering: pixelated; flex: none; }
.pk-sw-name { font-weight: 900; font-size: .92em; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-sw-name small { font-weight: 700; color: #5a6690; }
.pk-sw-hp { display: flex; flex-direction: column; gap: .12em; width: 4.4em; flex: none; font-size: .8em; }
.pk-sw .pk-hpbar { background: #cfd6ea; box-shadow: none; }
.pk-sw:disabled { opacity: .45; }
.pk-tg-foe { background: linear-gradient(90deg, #e3350d 0 .4em, #f7f9ff .4em); }
.pk-log { position: absolute; right: 6px; top: 6px; width: min(46%, 340px); max-height: 60%; overflow-y: auto; padding: 6px 9px; border-radius: 8px;
  background: rgba(2, 6, 23, .86); border: 1px solid #334155; font-size: 12px; line-height: 1.45; white-space: pre-wrap; z-index: 5; }
#pokemonRoot.pk-narrow .pk-sw-list, #pokemonRoot.pk-narrow .pk-targets { grid-template-columns: repeat(2, 1fr); }
#pokemonRoot.pk-narrow .pk-cmd-main { flex-direction: column; }
#pokemonRoot.pk-narrow .pk-cmd-left { flex: none; flex-direction: row; align-items: center; }

/* 결과 */
.pk-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10px; pointer-events: none; z-index: 8; }
.pk-result { pointer-events: auto; max-width: 92%; padding: 14px 20px; border-radius: 14px; background: rgba(9, 9, 11, .9); border: 2px solid #facc15; text-align: center; }
.pk-result h3 { margin: 0 0 6px; font-size: 22px; color: #fde68a; }
.pk-result p { margin: 4px 0; }
.pk-result.pk-lose { border-color: #475569; }
.pk-result.pk-lose h3 { color: #94a3b8; }

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

/* 길게 누르기로 글자 선택·복사 메뉴가 뜨지 않게 — 무대와 명령 줄만 */
#pokemonRoot .pk-battle, #pokemonRoot .pk-battle * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }

/* VS 라인업(배틀 전): 파랑 A팀 / 빨강 B팀이 양옆에서 들어오고 가운데 VS가 튄다 */
.pk-panel:has(.pk-intro) { padding: 0; }
.pk-intro { position: relative; width: 100%; height: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; overflow: hidden;
  font-size: clamp(11px, min(3cqh, 1.9cqw), 20px); background: #0f1530; }
.pk-intro::before, .pk-intro::after { content: ''; position: absolute; top: -10%; bottom: -10%; width: 58%; z-index: 0; }
.pk-intro::before { left: -6%; background: linear-gradient(135deg, #2b5ea8, #3d7dca 60%, #6aa2e8); transform: skewX(-12deg); animation: pk-in-l .45s cubic-bezier(.2, .8, .2, 1) both; }
.pk-intro::after { right: -6%; background: linear-gradient(225deg, #a8230a, #e3350d 60%, #ff6a3d); transform: skewX(-12deg); animation: pk-in-r .45s cubic-bezier(.2, .8, .2, 1) both; }
.pk-in-side { position: relative; z-index: 1; display: flex; flex-direction: column; gap: .5em; padding: .6em 1em; min-width: 0; }
.pk-in-0 { animation: pk-slide-l .5s .05s cubic-bezier(.2, .8, .2, 1) both; }
.pk-in-1 { animation: pk-slide-r .5s .05s cubic-bezier(.2, .8, .2, 1) both; align-items: flex-end; }
.pk-in-side h3 { margin: 0; font-size: 1em; font-weight: 900; letter-spacing: .12em; color: rgba(255, 255, 255, .75); }
.pk-in-row { display: flex; flex-direction: column; gap: .3em; }
.pk-in-1 .pk-in-row { align-items: flex-end; }
.pk-in-trainer { display: flex; align-items: center; gap: .45em; color: #fff; font-size: 1.15em; text-shadow: 0 2px 4px rgba(0, 0, 0, .45); }
.pk-in-1 .pk-in-trainer { flex-direction: row-reverse; }
.pk-in-trainer .pk-av { width: 1.9em; height: 1.9em; font-size: .85em; }
.pk-in-mons { display: grid; grid-template-columns: repeat(3, minmax(0, 5.6em)); gap: .3em .4em; }
.pk-in-mon { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .1em; opacity: 0; animation: pk-in-pop .3s calc(.25s + var(--i) * .06s) cubic-bezier(.2, 1.4, .4, 1) both; }
.pk-in-img { width: 5em; height: 4.2em; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; border-radius: .6em; background: radial-gradient(ellipse at 50% 88%, rgba(0, 0, 0, .28), transparent 60%); }
.pk-in-img img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; image-rendering: auto; }
.pk-in-img img.pk-pixel { image-rendering: pixelated; }
.pk-in-0 .pk-in-img img { transform: scaleX(-1); }   /* A팀은 가운데(오른쪽)를 보게 */
.pk-in-mon figcaption { margin-top: .15em; padding: .05em .45em; border-radius: .5em; background: rgba(0, 0, 0, .35); font-size: .72em; font-weight: 800; color: #fff; text-align: center; line-height: 1.15; text-shadow: 0 1px 2px rgba(0, 0, 0, .55); white-space: nowrap; }
.pk-in-mon figcaption small { display: block; font-weight: 700; opacity: .8; }
.pk-in-vs { position: relative; z-index: 2; display: grid; place-items: center; width: 4.6em; height: 4.6em; border-radius: 50%; background: #1b2340;
  box-shadow: 0 0 0 .25em #ffcb05, 0 0 1.4em rgba(255, 203, 5, .55); animation: pk-in-vs .5s .3s cubic-bezier(.2, 1.6, .4, 1) both; }
.pk-in-vs span { font-size: 2em; font-weight: 900; font-style: italic; color: #ffcb05; text-shadow: .06em .06em 0 #e3350d; letter-spacing: -.04em; }
.pk-in-load { position: absolute; left: 0; right: 0; bottom: .7em; margin: 0; text-align: center; z-index: 3; color: #fff; font-size: .78em; font-weight: 800; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); pointer-events: none; }
.pk-in-load:empty { display: none; }
.pk-in-bar { position: absolute; left: 0; right: 0; bottom: 0; height: .35em; background: rgba(0, 0, 0, .35); z-index: 3; }
.pk-in-bar span { display: block; height: 100%; width: 100%; background: #ffcb05; }
.pk-intro-wait { display: grid; place-items: center; color: #dbe4ff; font-weight: 800; }
.pk-intro-wait::before, .pk-intro-wait::after { display: none; }
.pk-spin { animation: pk-spin 1s linear infinite; }
@keyframes pk-in-l { from { transform: translateX(-60%) skewX(-12deg); opacity: 0; } }
@keyframes pk-in-r { from { transform: translateX(60%) skewX(-12deg); opacity: 0; } }
@keyframes pk-slide-l { from { transform: translateX(-40%); opacity: 0; } }
@keyframes pk-slide-r { from { transform: translateX(40%); opacity: 0; } }
@keyframes pk-in-pop { from { opacity: 0; transform: translateY(.6em) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes pk-in-vs { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }
@keyframes pk-spin { to { transform: rotate(360deg); } }
/* 좁은 화면: 한 줄 3마리 → 칸을 줄인다 */
#pokemonRoot.pk-narrow .pk-in-mons { grid-template-columns: repeat(3, minmax(0, 4.2em)); }
#pokemonRoot.pk-narrow .pk-in-img { width: 3.8em; height: 3.2em; }
#pokemonRoot.pk-narrow .pk-in-vs { width: 3.2em; height: 3.2em; }
#pokemonRoot.pk-narrow .pk-in-side { padding: .4em .4em; }

/* 기술 정보 카드: 명령 창 바로 위(전투 화면 쪽)에 떠 있는 창. PC = 마우스 올림·포커스, 터치 = 길게 누르기.
   흐름 밖(absolute)이라 설명 줄 수와 관계없이 명령 창·기술 버튼 크기가 그대로다(사용자 지적 2026-09-29 — 칸 안에 두면 커졌다 줄었다 했다) */
.pk-cmd-main { position: relative; }
.pk-cmd-area { flex: 1 1 auto; min-height: 0; }
.pk-cmd-ask { display: flex; flex-direction: column; gap: .2em; }
.pk-mv-hint { margin: 0; font-size: .74em; color: #8b98c9; }
.pk-mv-info { position: absolute; left: 0; bottom: calc(100% + .9em); z-index: 6; width: min(26em, 64%); max-height: 55cqh; overflow-y: auto;
  display: flex; flex-direction: column; gap: .3em; padding: .6em .8em; border-radius: .8em; pointer-events: none;
  background: linear-gradient(180deg, rgba(34, 45, 84, .97), rgba(18, 25, 50, .97)); border: 2px solid rgba(255, 203, 5, .55); box-shadow: 0 4px 16px rgba(0, 0, 0, .5); }
.pk-mv-info[hidden] { display: none; }
.pk-mi-head { display: flex; align-items: center; gap: .4em; }
.pk-mi-head b { font-size: 1.02em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 분류·위력·명중·PP: 라벨과 값을 같은 크기·같은 줄로 */
.pk-mi-stats { display: flex; flex-wrap: wrap; gap: .15em .8em; font-size: .82em; line-height: 1.35; }
.pk-mi-stat { display: inline-flex; align-items: baseline; gap: .3em; white-space: nowrap; }
.pk-mi-stat i { font-style: normal; font-weight: 700; color: #8b98c9; }
.pk-mi-stat b { font-weight: 800; color: #ffcb05; font-variant-numeric: tabular-nums; }
.pk-mi-desc { margin: 0; font-size: .84em; line-height: 1.45; color: #dbe4ff; }
.pk-mi-eff { margin: 0; display: flex; flex-wrap: wrap; gap: .2em .6em; font-size: .78em; font-weight: 800; color: #86efac; }
#pokemonRoot.pk-narrow .pk-mv-info { width: 100%; }

/* 도구·특성 발동 알림 띠(무대 논리 좌표) */
.pk-pop { position: absolute; z-index: 7; display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px; border-radius: 8px; pointer-events: none;
  background: linear-gradient(90deg, rgba(27, 35, 64, .96), rgba(27, 35, 64, .85)); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  animation: pk-pop 1.7s ease both; white-space: nowrap; }
.pk-pop i { font-style: normal; font-size: 14px; }
.pk-pop span { display: flex; flex-direction: column; line-height: 1.15; }
.pk-pop small { font-size: 10px; color: #9fb0e6; font-weight: 700; }
.pk-pop b { font-size: 13px; font-weight: 900; }
.pk-pop-own { border-left: 3px solid #3d7dca; }
.pk-pop-foe { border-left: 3px solid #e3350d; }
.pk-pop-ability b { color: #ffcb05; }
@keyframes pk-pop { 0% { opacity: 0; transform: translateX(-14px); } 12%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateX(8px); } }
/* 명령 창의 지금 포켓몬 특성·도구, 교체 목록의 도구 */
.pk-held { margin: .15em 0 0; display: flex; flex-wrap: wrap; gap: .1em .7em; font-size: .76em; color: #8b98c9; }
.pk-held b { color: #e6ebff; font-weight: 800; }
.pk-sw-item { display: block; font-style: normal; font-size: .78em; font-weight: 700; color: #5a6690; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── PokeRogue 도트 무대(2026-09-29 사용자 결정: 도트 스타일로 통일) ── */
.pk-pcv { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.pk-spr.pk-px .pk-gloss { display: none !important; }            /* 도트는 캔버스에 보석 몸을 직접 그린다 */
.pk-mon:has(.pk-spr.pk-px) .pk-shadow { display: none; }          /* 발판이 있으니 그림자 없음(PokeRogue와 같다) */
.pk-spr.pk-terad .pk-pcv { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 4px var(--tc)); }
.pk-bg { overflow: hidden; }
.pk-ar { position: absolute; left: 0; top: 0; width: 640px; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
.pk-ar-bg { height: 360px; }
.pk-ar-b { left: 40px; }
.pk-in-px { display: block; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; image-rendering: pixelated; }
.pk-in-0 .pk-in-px { transform: scaleX(-1); }

/* 정보 창을 작게(사용자 요청 2026-09-29 — UI가 화면을 너무 차지) */
.pk-info { width: 196px; padding: 4px 9px 5px; font-size: 12px; border-radius: 11px 4px 11px 4px; }
.pk-info-name { font-size: 13px; max-width: 100px; }
.pk-g { font-size: 11px; }
.pk-lv { font-size: 11px; }
.pk-hpline { margin-top: 3px; gap: 4px; }
.pk-hpbar { height: 6px; }
.pk-hptext { font-size: 10.5px; min-width: 52px; }
.pk-tera { font-size: 9px; padding: 0 4px; }

/* 정보 창 + 남은 포켓몬 볼 줄(원작 트레이너 배틀의 파티 볼) — hud 가 무대 좌표에 놓이고 정보 창은 그 안에서 흐른다 */
.pk-hud { position: absolute; display: flex; flex-direction: column; }
.pk-hud > .pk-info { position: relative; }
/* 숨긴 정보 창(기절·빈자리)도 자리는 남겨 볼 줄이 제자리에 있게 */
#pokemonRoot .pk-hud > .pk-info[hidden] { display: block !important; visibility: hidden; }
/* 바탕 없이 창 안 글자 줄에 맞춘다: 상대 = 왼쪽 테두리 4 + 안쪽 여백 9 → "HP" 글자 왼쪽 선, 내 편 = 오른쪽 여백 9 → HP 숫자 오른쪽 선
   (사용자 지적 2026-10-04 — 바탕 캡슐이 테두리 바깥선에 걸쳐 따로 놀았다) */
.pk-balls { display: flex; gap: 3px; width: max-content; margin: 3px 0 0 13px; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .65)); }
.pk-hud-own .pk-balls { align-self: flex-end; margin: 3px 9px 0 0; }
/* 멀티 내 편: 창 왼쪽, HP 줄 높이에 */
.pk-hud-side .pk-balls { position: absolute; right: calc(100% + 6px); bottom: 7px; margin: 0; }
.pk-pb { position: relative; flex: none; width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(180deg, #e3350d 0 43%, #15171c 43% 57%, #f4f5f8 57%); box-shadow: inset 0 0 0 1px #15171c; }
.pk-pb::after { content: ''; position: absolute; left: 3px; top: 3px; width: 4px; height: 4px; border-radius: 50%; background: #f4f5f8; box-shadow: 0 0 0 1px #15171c; }
.pk-pb[data-st]::before { content: ''; position: absolute; right: -3px; bottom: -2px; z-index: 1; width: 5px; height: 5px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 0 1px #12182f; }
.pk-pb-fnt { filter: grayscale(1) brightness(.55); opacity: .6; }
.pk-pb-down { animation: pk-pb-down .55s ease-out; }
@keyframes pk-pb-down { 0% { transform: scale(1.6); filter: none; opacity: 1; } 35% { transform: scale(1.6); filter: none; opacity: 1; } }

/* 겹침 배치: 명령 줄은 무대 아래쪽 칸(PokeRogue uiTop 132/180)에 정확히 맞춰진다(client placeBand) — 안의 창이 칸을 채운다 */
#pokemonRoot:not(.pk-tall-layout) .pk-band { padding: .3em .4em; }
#pokemonRoot:not(.pk-tall-layout) .pk-band > .pk-msgbox, #pokemonRoot:not(.pk-tall-layout) .pk-band > .pk-cmd { flex: 1 1 auto; min-height: 0; }
#pokemonRoot:not(.pk-tall-layout) .pk-cmd { padding: .35em; }
#pokemonRoot:not(.pk-tall-layout) .pk-cmd-main { height: 100%; }
#pokemonRoot:not(.pk-tall-layout) .pk-moves { gap: .25em; }
#pokemonRoot:not(.pk-tall-layout) .pk-mv { padding: .2em .6em .2em .9em; }
#pokemonRoot:not(.pk-tall-layout) .pk-sw-list, #pokemonRoot:not(.pk-tall-layout) .pk-targets { gap: .25em; }
.pk-backdrop { position: absolute; inset: -20px; background: #0b1020 center / cover no-repeat; filter: blur(14px) brightness(.55) saturate(1.1); }
/* 교체·대상 목록 제목 줄은 작게(목록이 들어갈 자리를 남긴다) */
.pk-cmd-top { margin-bottom: .25em; }
.pk-cmd-top .pk-prompt { font-size: .86em; }
.pk-cmd-top .pk-btn { padding: .15em .75em !important; font-size: .8em !important; }
#pokemonRoot:not(.pk-tall-layout) .pk-band[data-mode="switch"] > .pk-cmd, #pokemonRoot:not(.pk-tall-layout) .pk-band[data-mode="target"] > .pk-cmd { flex: 0 0 auto; }
/* 목록 도트 아이콘(드래프트·미리보기·교체·대상) */
.pk-icon-px { object-fit: contain; object-position: 50% 100%; image-rendering: pixelated; }
.pk-draft-p .pk-ico { width: 2.2em; height: 2.2em; }
.pk-pv-icons .pk-ico { width: 2.4em; height: 2.4em; }
.pk-sw .pk-ico, .pk-tg .pk-ico { width: 2.3em; height: 2.3em; flex: none; }
.pk-lv-btn { white-space: nowrap; }
.pk-lv-seg { flex-wrap: nowrap; }
@media (prefers-reduced-motion: reduce) { .pk-dturn-me, .pk-pb-down { animation: none; } }
