/* 3D 무대 확대·축소·원래대로 단추(2026-11-15 - 파셜 site_features/shared/_stage_view_controls, lib/transit/stage_zoom). 길체크 상황판(gilcheck.css .gc-view-*)과 같은 꼴.
   파크 골프장·고속버스·KTX·지하철·버스·마을버스 무대가 같이 쓴다(각 사이트 파셜이 이 파일을 head 에 건다). */

/* 오른쪽 아래 묶음 - 단추 줄 아래에 무대의 말풍선·안내 문구(파크 골프장·KTX 말풍선, 지하철·마을버스 안내)를 둔다. 말풍선이 뜨면 단추가 그 위로 선다
   (사용자 결정 2026-11-15 - 단추를 문구 위로). 묶음 폭은 무대 폭에 가깝게(왼쪽 여백까지) 두어 말풍선·문구가 제 CSS 의 최대 폭(무대의 60%·70%)을 그대로
   쓴다 - 묶음 폭을 70% 로 줄이고 100% 로 덮었더니 말풍선이 60% 에서 70% 로 넓어져 왼쪽 아래 범례에 닿을 수 있었다(검수). 묶음은 누르기를 받지 않고 단추만 받는다. */
.stage-corner {
  position: absolute; right: 0.6rem; bottom: 0.6rem; left: 0.9em; z-index: 4;
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; pointer-events: none;
  /* 툴팁 최대 폭의 기준(cqw) - 화면 폭(vw)으로 재면 두 칸 화면(1024px 이상)의 반쪽 무대에서 큰글씨·영어 툴팁 왼쪽이 무대 밖으로 잘렸다(2차 검토, 길체크와 같은 처방). */
  container-type: inline-size;
}
/* 묶음 안에서는 말풍선·문구도 흐름을 따른다(제 CSS 의 absolute·right·bottom 을 덮는다 - 최대 폭은 제 것 그대로). */
.stage-corner > :not(.stage-view) { position: static; }
/* 왼쪽 아래 범례가 있는 무대(파크 골프장·KTX)의 말풍선은 범례 줄 위에 선다 - 범례 줄 윗변은 무대 바닥에서 약 2.06em(0.8em + 칩 한 줄)이라 말풍선 바닥을
   무대 글자 2.3em 에 둔다(말풍선 글자는 0.75em 이고 묶음 바닥이 0.6rem). 영어·스페인어 상태 글(100자 안팎)이 넓은 무대에서 범례 칩 위로 넘어왔다(2026-11-15
   배치 시험 - 종전 자리에서도 겹치던 것). */
.stage-corner > :is(.park-golf-bubble, .ktx-bubble) { margin-bottom: calc(3.1em - 0.6rem); }
/* 단추가 선 동안(3D) 같은 무대의 제목 머리와 왼쪽 아래 요소(범례·[전체 노선도])는 단추 열 몫(오른쪽 여백 0.6rem + 단추 2.25rem + 틈)을 비운다 - 낮은 무대
   (폰·큰글씨)에서 단추 열이 제목 글자에 닿고, 좁은 폭(영어·스페인어·큰글씨)에서 범례 칩·[전체 노선도]가 [-] 밑으로 들어갔다(2차 검토 2026-11-15). 고속버스
   노선 글은 express_bus.css 에서 같은 몫을 뺀다. */
:is([data-gl="gpu"], [data-gl="software"]) > :is(.park-golf-stage-head, .ktx-stage-head, .express-bus-stage-head, .transit-stage-head, .vb-stage-head) { right: 3.4rem; }
:is([data-gl="gpu"], [data-gl="software"]) > :is(.park-golf-legend, .ktx-legend, .transit-map-open) { max-width: calc(100% - 0.9em - 3.4rem); }
/* 큰글씨 모드의 좁은 무대(묶음 19em 미만 - 폰, 두 칸 화면의 큰글씨 3단)에서는 지하철·마을버스 무대 설명을 숨긴다 - 제목이 여러 줄로 늘어 설명과 겹치고,
   마을버스는 설명을 얹은 단추 열이 무대 위끝 밖으로 나갔다(2026-11-15 배치 시험 - 폭 320·360·390·1024 × 세 언어 × 큰글씨 단계). 설명은 결과 칸이 같은 내용을
   보이는 장식(aria-hidden)이다 - 지하철은 앞서 큰글씨 3단 폰에서 숨겼다(transit.css). 큰글씨가 아니면 320px 에서도 그대로 보인다. */
@container (max-width: 19em) {
  html.silver :is(.transit-stage-caption, .vb-stage-caption) { display: none; }
}

/* 단추 줄 - 3D 가 선 동안만(포스터·WebGL 없음이면 숨김). 보이는 원 36px, 누르는 자리 44px. */
.stage-view { display: none; flex-direction: column; align-items: flex-end; gap: 0.5rem; pointer-events: auto; }
[data-gl="gpu"] .stage-view, [data-gl="software"] .stage-view { display: flex; }
.stage-view-btn {
  position: relative; width: 2.25rem; height: 2.25rem; border: 0; border-radius: 999px; display: grid; place-items: center; cursor: pointer;
  color: #fff; background: rgb(17 24 39 / 0.62); box-shadow: 0 6px 14px -8px rgb(0 0 0 / 0.7); touch-action: manipulation;
}
.stage-view-btn::after { content: ""; position: absolute; inset: -0.25rem; }
.stage-view-btn svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.stage-view-btn:hover:not([aria-disabled="true"]) { background: rgb(17 24 39 / 0.78); }
.stage-view-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* 끝에 닿은 단추 - aria-disabled 라 키보드 초점을 그대로 받는다. 바탕·그림자·아이콘만 흐린다(단추 전체 opacity 면 초점 테두리까지 흐려진다 - 길체크 검수). */
.stage-view-btn[aria-disabled="true"] { cursor: default; color: rgb(255 255 255 / 0.35); background: rgb(17 24 39 / 0.217); box-shadow: 0 6px 14px -8px rgb(0 0 0 / 0.245); }
.stage-view-btn[hidden] { display: none; }

/* 툴팁 - 단추 왼쪽, 아래끝을 단추 아래끝에 맞춰 위로 자란다(가운데 맞춤이면 맨 아래 [-] 의 세 줄 툴팁이 무대 밖으로 잘린다). 마우스를 올리면(마우스 기기만)
   0.15초 뒤, Tab 초점이면 바로. 끝에 닿아 흐린 단추에도 뜬다. Esc 를 누르면 data-tip-off 로 닫는다. 글자는 em - 사이트 큰글씨 배율을 따른다. */
.stage-view-item { position: relative; display: flex; }
.stage-view-item:has(> .stage-view-btn[hidden]) { display: none; }
.stage-view-tip {
  position: absolute; right: calc(100% + 0.5rem); bottom: 0; display: grid; gap: 0.15rem; width: max-content; max-width: min(26em, calc(100vw - 6rem)); max-width: min(26em, calc(100cqw - 3.25rem));
  padding: 0.4rem 0.6rem; border-radius: 0.6rem; background: rgb(17 24 39 / 0.92); color: #fff; box-shadow: 0 8px 18px -10px rgb(0 0 0 / 0.8);
  font-size: 0.78em; font-weight: 400; line-height: 1.35; text-align: left; white-space: normal; visibility: hidden; opacity: 0; transition: opacity 0.1s ease, visibility 0s linear 0.1s;
}
/* 단추와 툴팁 사이 틈 - 마우스를 툴팁으로 옮기는 동안 꺼지지 않게 잇는다. */
.stage-view-tip::after { content: ""; position: absolute; top: 0; bottom: 0; left: 100%; width: 0.5rem; }
.stage-view-tip-name { font-weight: 800; }
.stage-view-tip-hint { color: #d5dceb; }
.stage-view-tip:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) {
  .stage-view-item:hover .stage-view-tip { visibility: visible; opacity: 1; transition: opacity 0.12s ease 0.15s, visibility 0s linear 0.15s; }
}
.stage-view-btn:focus-visible + .stage-view-tip { visibility: visible; opacity: 1; transition: opacity 0.12s ease; }
/* 마우스가 다른 단추에 올라가 있으면 초점 쪽 툴팁은 숨긴다(둘이 겹쳐 안내 한 줄이 가려졌다 - 길체크 검수). */
@media (hover: hover) and (pointer: fine) {
  .stage-view:has(.stage-view-item:hover) .stage-view-item:not(:hover) .stage-view-tip { visibility: hidden; opacity: 0; transition: none; }
}
.stage-view-item[data-tip-off] .stage-view-tip { visibility: hidden; opacity: 0; transition: none; }
@media (prefers-reduced-motion: reduce) { .stage-view-tip, .stage-view-item:hover .stage-view-tip, .stage-view-btn:focus-visible + .stage-view-tip { transition: none; } }
@media (forced-colors: active) {
  .stage-view-btn[aria-disabled="true"] { color: GrayText; }
  .stage-view-tip { outline: 1px solid transparent; }
}
