/* PLAYORA 공용 화면 부품 - 다트·낚시가 함께 씀 (원본: darts-site/css/plkit.css)
   색과 글꼴은 각 게임 style.css의 변수(--k-*)로 정합니다. */
.pk-stage { position: relative; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; font-family: var(--f-body); color: var(--k-ink); }
.pk-stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* :where()로 우선순위를 낮춤: .tb·.btn·.x·.chip 같은 클래스 규칙의 글꼴·색이 이 기본값에 덮이지 않게 */
:where(.pk-stage) button { font: inherit; color: inherit; cursor: pointer; white-space: nowrap; touch-action: manipulation; }
:where(.pk-stage) button:disabled { cursor: default; opacity: 0.45; }
.pk-stage button:focus-visible, .pk-stage input:focus-visible { outline: 2px solid var(--k-focus); outline-offset: 2px; }
.pk-stage [hidden] { display: none !important; }

/* 위 막대 */
.bar { position: absolute; top: 0; left: 0; right: 0; height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px; z-index: 8; pointer-events: none; }
.bar-l, .bar-r { display: flex; align-items: center; gap: 4px; pointer-events: auto; min-width: 0; }
.bar-l { overflow: hidden; }
/* 오른쪽 묶음은 줄어들지 않게: 좁은 화면에서 왼쪽 글이 길면 같이 줄어들어 안의 단추(flex: none)가 무대 밖으로 밀려남 (남는 폭은 .bar-l이 줄여서 말줄임) */
.bar-r { flex: none; }
.bar-mode { font: 600 13px/1 var(--f-body); color: var(--k-ink-2); padding-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--k-line); background: var(--k-chip); color: var(--k-ink); font: 600 13px/1 var(--f-body); flex: none; }
.tb:hover:not(:disabled) { border-color: var(--k-ink-3); background: var(--k-chip-hover); }
.tb[aria-pressed="true"] { color: var(--k-ink-3); }
.pk-narrow .tb { padding: 0 8px; font-size: 12px; }

/* 덮는 화면 공통 */
.scr { position: absolute; inset: 0; z-index: 5; display: flex; }
.btn { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--k-line); background: var(--k-btn); color: var(--k-ink); font: 600 14px/1 var(--f-body); }
.btn:hover:not(:disabled) { border-color: var(--k-ink-3); }
.btn.big { background: var(--k-acc); border-color: var(--k-acc-2); color: var(--k-acc-ink); font-weight: 700; }
.btn.small { height: 32px; font-size: 13px; padding: 0 12px; }

/* 창(모달) */
.modal { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 50px 12px 12px; background: var(--k-scrim); }
.mbox { width: min(560px, 100%); max-height: 100%; display: flex; flex-direction: column; border-radius: 16px; background: var(--k-sheet); color: var(--k-sheet-ink); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35); overflow: hidden; }
.mhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--k-sheet-line); }
.mtitle { margin: 0; font: 700 22px/1.1 var(--f-disp); }
.x { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--k-sheet-line); background: transparent; font: 600 13px/1 var(--f-body); }
.mbody { padding: 12px 16px 16px; overflow-y: auto; overscroll-behavior: contain; font-size: 14px; line-height: 1.6; }
.mbody h4 { margin: 16px 0 4px; font: 700 15px/1.3 var(--f-body); }
.mbody h4:first-child { margin-top: 0; }
.mbody p { margin: 0 0 8px; }
.mbody ul { margin: 0 0 8px; padding-left: 1.2em; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--k-sheet-line); }
.set-row:last-child { border-bottom: 0; }
.set-row > span { font-weight: 600; min-width: 0; }
.set-row small { display: block; font-weight: 400; font-size: 12px; color: var(--k-sheet-2); white-space: normal; }
.set-row input[type="range"] { width: min(180px, 42vw); accent-color: var(--k-acc-2); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--k-sheet-line); background: transparent; font: 600 13px/1 var(--f-body); color: var(--k-sheet-ink); }
.chip[aria-pressed="true"] { background: var(--k-acc); border-color: var(--k-acc-2); color: var(--k-acc-ink); }

/* 알림, 클릭하면 시작 */
.toast { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 14; margin: 0; padding: 8px 16px; border-radius: 999px; background: var(--k-toast); color: var(--k-toast-ink); font-size: 13px; font-weight: 600; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.focus-hint { position: absolute; inset: 0; z-index: 12; display: grid; place-content: center; gap: 8px; text-align: center; border: 0; background: var(--k-scrim); color: #fff; }
.focus-hint b { font: 700 40px/1 var(--f-disp); padding: 10px 28px 12px; border-radius: 999px; background: var(--k-acc); color: var(--k-acc-ink); }
.focus-hint span { font-size: 14px; color: #fff; }
.ai { display: inline-block; font-style: normal; font: 700 12px/1 var(--f-body); padding: 3px 5px; border-radius: 4px; background: var(--k-ai); color: var(--k-ai-ink); vertical-align: 2px; letter-spacing: 0.02em; }
@media (prefers-reduced-motion: reduce) { .pk-stage *, .pk-stage *::before, .pk-stage *::after { transition: none !important; animation: none !important; } }
