/* =========================================================================
   픽셀 학교 투어 — 디자인
   글꼴은 학과·입학 안내 페이지와 같은 파일(../assets/fonts)을 씁니다.
   ========================================================================= */

@font-face {
  font-family: "CookieRun";
  font-weight: 900;
  font-display: swap;
  src: url("../../assets/fonts/CookieRun-Black.otf") format("opentype");
}
@font-face {
  font-family: "Elice DX Neolli";
  font-weight: 100 599;
  font-display: swap;
  src: url("../../assets/fonts/EliceDXNeolli-Medium.otf") format("opentype");
}
@font-face {
  font-family: "Elice DX Neolli";
  font-weight: 600 1000;
  font-display: swap;
  src: url("../../assets/fonts/EliceDXNeolli-Bold.otf") format("opentype");
}

:root {
  /* 휴대폰 브라우저의 '강제 다크 모드'가 그림·캐릭터 색을 뒤집지 않도록 늘 밝은 화면으로 */
  color-scheme: only light;
  --navy: #14285a;
  --navy-2: #1d3673;
  --ink: #17223b;
  --muted: #5d6a7a;
  --green: #2b5a45;
  --green-soft: #e6ecdc;
  --cream: #f7f4ea;
  --paper: #fffcf2;
  --line: #d8dccf;
  --line-strong: #9fae94;
  --orange: #a8611e;
  --focus: #e08a1e;
  --pixel-shadow: 3px 3px 0 rgba(20, 40, 90, .18);
  --font: "Elice DX Neolli", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", system-ui, sans-serif;
  --font-title: "CookieRun", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: break-word;
}
img { max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.container { width: min(1200px, 100% - 40px); margin-inline: auto; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: #fff; padding: 10px 14px; border: 2px solid var(--navy);
}
.skip-link:focus { top: 12px; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  color: var(--green);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--navy); background: #fff; color: var(--navy);
  font-weight: 700; font-size: 14px; text-decoration: none;
  box-shadow: var(--pixel-shadow);
}
.btn:hover { background: #eef2fb; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }

/* ---------- 상단 ---------- */

.tour-header { background: var(--navy); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 36px; height: auto; background: #fff; border-radius: 50%; padding: 2px; }
.brand strong { display: block; font-size: 15px; line-height: 1.3; }
.brand small { display: block; font-size: 12px; opacity: .8; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, .5); text-decoration: none; font-size: 14px; font-weight: 700;
}
.back-link:hover { background: rgba(255, 255, 255, .12); }

/* ---------- 소개 ---------- */

.intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 36px 0 24px; }
.intro h1 {
  margin: 0 0 14px;
  font-family: var(--font-title); font-weight: 900;
  font-size: clamp(32px, 4.4vw, 50px); line-height: 1.25; letter-spacing: -.5px;
  color: var(--navy);
}
.lead { margin: 0; font-size: 16px; color: var(--muted); }
.guide { width: 104px; height: auto; margin-right: 40px; flex-shrink: 0; }

.scene-notice { background: var(--green-soft); border-left: 5px solid var(--green); padding: 14px 18px; font-size: 14px; }
.scene-notice strong { font-size: 17px; color: var(--green); }
.scene-notice p { margin: 4px 0 0; }

/* ---------- 층 선택 ---------- */

.scene-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 14px; }
.scene-nav button {
  min-width: 64px; min-height: 44px; padding: 8px 14px;
  background: var(--paper); border: 1px solid var(--line-strong);
  font-weight: 700; font-size: 15px;
}
.scene-nav button:hover { background: #f1eedf; }
.scene-nav button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: var(--pixel-shadow); }

/* ---------- 도구 ---------- */

.tour-tools { padding: 14px; background: #eef0e2; border: 1px solid #c4ccb4; }
.tour-position { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tour-position strong { margin-right: auto; font-size: 16px; color: var(--green); }
.tour-position button, .scene-toolbar button, .direction button, .facility-chip {
  min-height: 44px; padding: 8px 12px;
  background: var(--paper); border: 1px solid var(--line-strong);
  font-size: 14px;
}
.tour-position button:hover, .scene-toolbar button:hover, .direction button:hover, .facility-chip:hover { background: #f4ebcf; }

.space-search { position: relative; display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 14px; font-weight: 700; }
.space-search input {
  flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--line-strong); background: #fffdf6;
  font: inherit; font-size: 16px; font-weight: 400;
}
#search-results {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
  margin: 0; padding: 4px; list-style: none;
  max-height: 300px; overflow: auto;
  background: #fffdf6; border: 1px solid var(--line-strong); box-shadow: 0 10px 24px rgba(20, 40, 90, .15);
  font-weight: 400;
}
#search-results button {
  display: flex; gap: 10px; align-items: baseline; width: 100%; min-height: 44px; padding: 10px;
  text-align: left; background: none; border: 0; border-bottom: 1px solid #ebe7d8;
}
#search-results button:hover, #search-results button:focus-visible { background: #f4ebcf; }
.search-floor { flex-shrink: 0; min-width: 38px; font-size: 12px; font-weight: 700; color: var(--green); }
.search-empty { padding: 10px; font-size: 14px; color: var(--muted); }

.tour-help { margin-top: 10px; font-size: 14px; }
.tour-help summary { min-height: 32px; padding: 4px 0; cursor: pointer; font-weight: 700; }
.tour-help ul { margin: 4px 0 0; padding-left: 20px; }
.tour-help li { margin: 3px 0; }

/* ---------- 지도 ---------- */

.map-section { margin-top: 18px; }
.scene-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.zoom { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.zoom button { min-width: 44px; }
#fit[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
#zoom-value { min-width: 56px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }

.map-frame { position: relative; }
#scene-scroll {
  overflow: auto;
  width: 100%;          /* 높이를 정해도 2:1 비율 때문에 폭이 늘어나지 않게 */
  aspect-ratio: 2;      /* 스크립트가 높이를 정하기 전 첫 화면용 */
  background: #fff3da;
  border: 1px solid #c1cbae;
  touch-action: none;
  overscroll-behavior: contain;
  scrollbar-color: #7d9570 #e9ecdc;
  cursor: grab;
}
#scene-scroll.dragging { cursor: grabbing; }
/* 지도 칸 높이는 camera.js가 그림 높이와 max-height 중 작은 값으로 정합니다 */
@media (min-width: 761px) and (max-height: 700px) {
  #scene-scroll { max-height: 82svh; }
}
#scene-scroll.fit { scrollbar-width: none; }
#scene-stage {
  --stage-w: 1800px;
  position: relative;
  aspect-ratio: 2;
  width: 150%;
  margin-inline: auto;
  -webkit-user-select: none; user-select: none;
}
#scene-image { display: block; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }
#map-load-status {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0;
  padding: 10px 16px; background: rgba(255, 252, 242, .95); border: 1px solid var(--line-strong);
  font-size: 14px;
}

#scene-walker {
  position: absolute; z-index: 5;
  width: max(26px, calc(var(--stage-w) * .054));
  aspect-ratio: 4 / 5;
  transform: translate(-50%, -87.5%);
  background: url("../img/walker.png") no-repeat 50% 0 / 300% 400%;
  image-rendering: pixelated;
  pointer-events: none;
}

/* 공간 이름표 */
.room-label {
  position: absolute; z-index: 3;
  width: var(--label-w);
  transform: translate(-50%, -50%);
  padding: 0; border: 0; background: none;
  font-size: clamp(10px, calc(var(--stage-w) * .0072), 14px);
  font-weight: 700; line-height: 1.3; text-align: center;
}
.room-label-text {
  display: inline-block; max-width: 100%;
  padding: .25em .45em;
  border: 1px solid #6e8369; background: rgba(255, 251, 237, .94); color: #223b36;
  word-break: keep-all; overflow-wrap: normal;   /* 단어 중간에서 끊지 않음 (안 들어가면 labels.js가 글씨를 줄임) */
  box-shadow: 1px 1px 0 rgba(23, 56, 45, .25);
}
.room-label-text small { display: block; font-size: .8em; color: var(--orange); }
.room-label.is-facility .room-label-text { font-weight: 400; background: rgba(240, 244, 248, .92); border-color: #8a97a8; }
.room-label.is-planned .room-label-text { border-color: var(--orange); }
.room-label:hover .room-label-text, .room-label:focus-visible .room-label-text { background: #f6dd9c; }
/* 체험 게임이 있는 공간: 이름표(작은 지도에서는 점) 위에 도장 아이콘 */
.room-label.has-game::after, .room-label.has-practice::after {
  content: "🎮"; position: absolute; left: 50%; top: 0; transform: translate(-50%, calc(-100% + 3px));   /* 이름표 바로 위, 겹치지 않게 */
  /* 게임이 있다는 걸 한눈에: 크게 + 흰 동그라미 배지 + 살짝 통통 */
  font-size: 1.6em; line-height: 1; width: 1.8em; height: 1.8em; box-sizing: border-box; pointer-events: none;
  display: flex; align-items: center; justify-content: center;   /* 이모지를 동그라미 정중앙에 */
  background: #fffbed; border: 2px solid var(--navy, #1d3673); border-radius: 50%;
  box-shadow: 0 2px 0 rgba(20, 40, 90, .35);
  animation: game-badge-bob 1.6s ease-in-out infinite;
}
@keyframes game-badge-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }
@media (prefers-reduced-motion: reduce) { .room-label.has-game::after, .room-label.has-practice::after { animation: none; } }
.room-label.has-practice::after { content: "📖"; }
.compact-labels .room-label.has-game::after, .compact-labels .room-label.has-practice::after { font-size: 18px; transform: translate(-50%, calc(-100% - 2px)); }
/* 이름만 보여 주는 공간: 누를 수 없고, 작은 지도에서는 점도 숨김 */
.room-label.is-quiet { pointer-events: none; }
.room-label.is-quiet .room-label-text { box-shadow: none; }
.compact-labels .room-label.is-quiet { display: none; }
/* 칸이 좁아도 글씨를 줄이지 않고 한 줄로 (칸 밖으로 나가도 됨) */
.room-label.is-overflow { width: auto; }
.room-label.is-overflow .room-label-text { white-space: nowrap; max-width: none; }
/* 눌러 보는 지점 (야외 드론 사진 등) */
.room-label.is-spot .room-label-text { background: var(--navy); border-color: var(--navy); color: #fff; padding: .45em .8em; box-shadow: 3px 3px 0 rgba(20, 40, 90, .3); }
.room-label.is-spot .room-label-text small { color: #ffd84d; }
.room-label.is-spot:hover .room-label-text, .room-label.is-spot:focus-visible .room-label-text { background: var(--navy-2); }
.compact-labels .room-label.is-spot::before { width: 14px; height: 14px; background: var(--navy); }
/* 야외의 층 입구 이름표 (1층 중앙현관 · 2층 바깥 계단) — 작은 지도에서도 글씨 그대로 */
.room-label.is-door { width: auto; font-size: clamp(14px, calc(var(--stage-w) * .012), 24px); }
.room-label.is-door .room-label-text { background: var(--green); border: 2px solid #fffbed; color: #fff; padding: .3em .75em; white-space: nowrap; box-shadow: 3px 3px 0 rgba(23, 56, 45, .4); }
.room-label.is-door:hover .room-label-text, .room-label.is-door:focus-visible .room-label-text { background: var(--navy); }
.compact-labels .room-label.is-door { width: auto; height: auto; }
.compact-labels .room-label.is-door::before { content: none; }
.compact-labels .room-label.is-door .room-label-text { position: static; width: auto; height: auto; overflow: visible; clip-path: none; font-size: 10px; padding: .2em .5em; border-width: 1px; }
/* 작은 지도: 이름 대신 누를 수 있는 점 (이름은 점을 누르면 설명 창에서) */
.compact-labels .room-label { width: 28px; height: 28px; }
.compact-labels .room-label-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.compact-labels .room-label::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; transform: translate(-50%, -50%);
  border: 2px solid #fffbed; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px rgba(23, 56, 45, .5);
}
.compact-labels .room-label.is-facility::before { width: 8px; height: 8px; background: #7d8899; }
.compact-labels .room-label.is-planned::before { background: var(--orange); }
.compact-labels .room-label:hover::before, .compact-labels .room-label:focus-visible::before { background: var(--navy); }

/* 길 안내 화살표 */
.route-hint {
  position: absolute; z-index: 4;
  display: flex; align-items: center; gap: 4px;
  transform: translate(-50%, -50%);
  pointer-events: none; color: #385e4c;
}
.route-hint svg {
  width: max(18px, calc(var(--stage-w) * .014)); height: auto; aspect-ratio: 1;
  fill: #5d7f58; stroke: #fff8df; stroke-width: 1; shape-rendering: crispEdges;
}
.route-hint small {
  padding: 2px 5px; white-space: nowrap;
  background: rgba(255, 248, 223, .92); border: 1px solid #91a381;
  font-size: clamp(10px, calc(var(--stage-w) * .0065), 13px); font-weight: 700;
}
.fit .route-hint small, .compact-labels .route-hint small { display: none; }

/* 계단 버튼 */
.stair-controls {
  position: absolute; z-index: 6;
  display: flex; flex-direction: column; gap: 3px;
  transform: translate(-50%, -50%);
}
.stair-controls button {
  min-height: 32px; padding: 3px 9px; white-space: nowrap;
  background: #fff8df; border: 1px solid #385e4c; color: #223b36;
  font-size: clamp(11px, calc(var(--stage-w) * .0075), 14px); font-weight: 700;
  box-shadow: 2px 2px 0 rgba(23, 56, 45, .3);
}
.stair-controls button:hover { background: #f6dd9c; }
.stair-controls.is-near button { background: var(--navy); border-color: var(--navy); color: #fff; animation: stair-pulse 1.2s ease-in-out 3; }
.compact-labels .stair-controls { flex-direction: row; }
.compact-labels .stair-controls button { min-height: 28px; padding: 2px 5px; font-size: 10px; }
@keyframes stair-pulse { 50% { transform: translateY(-2px); } }

/* 계단 앞 Enter·스페이스바: 갈 층 고르는 창 */
.stair-menu {
  position: absolute; z-index: 20; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; gap: 6px; width: min(280px, calc(100% - 24px));
  padding: 12px; background: var(--paper); border: 2px solid var(--navy); box-shadow: 6px 6px 0 rgba(20, 40, 90, .25);
}
.stair-menu-title { margin: 0 0 2px; font-weight: 700; color: var(--navy); }
.stair-menu button {
  min-height: 44px; padding: 8px 12px; text-align: left;
  background: #fff; border: 1px solid var(--line-strong); font-weight: 700; font-size: 15px;
}
.stair-menu button:hover, .stair-menu button:focus-visible { background: var(--navy); border-color: var(--navy); color: #fff; }
.stair-menu-help { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.direction { display: flex; gap: 6px; margin-top: 12px; }
.direction button { width: 48px; height: 48px; padding: 0; font-size: 20px; touch-action: none; }
#scene-status { margin: 10px 0 0; font-size: 14px; color: var(--muted); }

/* 크게 보기 */
.expand-button { font-weight: 700; }
.map-topbar, .rotate-hint { display: none; }
.map-frame.is-expanded {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: var(--navy);
}
.map-frame.is-expanded { --bar-h: 52px; }   /* 위 도구 줄 높이 — 지도 칸 높이 계산에 씀 */
.is-expanded .map-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; }
.map-topbar-floors { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
/* 크게 보기 안의 확대·축소·전체 보기·내 위치·멈춤 (아래 도구 버튼과 같은 동작) */
.map-tools { display: flex; gap: 4px; flex-shrink: 0; }
.map-tools button { white-space: nowrap; }
.map-tools [data-map-action="zoom-out"], .map-tools [data-map-action="zoom-in"] { font-size: 18px; }
/* 좁은 화면: 층 버튼·닫기 한 줄, 지도 조작 버튼은 그 아래 한 줄 */
@media (max-width: 720px) {
  .map-frame.is-expanded { --bar-h: 98px; }
  .map-tools { order: 3; flex-basis: 100%; }
  .map-tools button { flex: 1; min-width: 0; padding: 4px 6px; }
}
.map-topbar button {
  min-height: 40px; min-width: 44px; padding: 4px 10px; flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; font-weight: 700; font-size: 14px;
}
.map-topbar button[aria-pressed="true"] { background: #fff; color: var(--navy); }
.map-close { font-size: 18px !important; }
.is-expanded #scene-scroll { border: 0; max-height: calc(100dvh - var(--bar-h) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
.is-expanded .rotate-hint {
  display: block; position: absolute; z-index: 9; left: 50%; top: calc(var(--bar-h) + 6px); transform: translateX(-50%);
  margin: 0; padding: 6px 12px; white-space: nowrap; pointer-events: none;
  background: rgba(20, 40, 90, .88); color: #fff; font-size: 13px;
  opacity: 0; transition: opacity .6s ease;
}
/* 크게 보기를 열 때 잠깐 보였다가 사라짐 (tour.js가 .is-showing을 3.5초 뒤 뗌) */
.is-expanded .rotate-hint.is-showing { opacity: 1; }
@media (orientation: landscape), (pointer: fine) { .is-expanded .rotate-hint { display: none; } }
body.map-expanded { overflow: hidden; }

/* 휴대폰과 크게 보기: 방향 버튼을 지도 위에 띄움 */
.is-expanded .direction {
  position: absolute; z-index: 9; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  margin: 0; padding: 5px; background: rgba(20, 40, 90, .35);
}
.is-expanded .direction button { width: 50px; height: 46px; background: rgba(255, 252, 242, .9); }
/* 가로로 눕힌 크게 보기: 그림 옆 빈 여백에 십자 모양으로 */
@media (orientation: landscape) and (max-height: 500px) {
  /* 오른쪽 150px은 방향 버튼 자리로 비워 두고 그 왼쪽에 층 전체를 */
  .is-expanded #scene-scroll { width: calc(100% - 150px); }
  .is-expanded .direction {
    display: grid; grid-template-columns: repeat(3, 42px); grid-auto-rows: 40px; gap: 4px;
    left: auto; right: calc(8px + env(safe-area-inset-right, 0px)); transform: none; background: none;
  }
  .is-expanded .direction button { width: 42px; height: 40px; font-size: 18px; }
  .is-expanded .direction [data-dir="up"] { grid-area: 1 / 2; }
  .is-expanded .direction [data-dir="left"] { grid-area: 2 / 1; }
  .is-expanded .direction [data-dir="down"] { grid-area: 2 / 2; }
  .is-expanded .direction [data-dir="right"] { grid-area: 2 / 3; }
}
/* 터치 기기: 방향 버튼 대신 반투명 원형 조이스틱 */
.joystick { display: none; }
@media (pointer: coarse) {
  .direction { display: none !important; }
  .joystick {
    display: block; position: absolute; z-index: 9;
    right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: 112px; height: 112px; border-radius: 50%;
    background: rgba(255, 255, 255, .14); border: 2px solid rgba(20, 40, 90, .2);
    box-shadow: inset 0 0 0 10px rgba(20, 40, 90, .04);
    touch-action: none; -webkit-user-select: none; user-select: none;
  }
  .joystick-knob {
    position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%;
    background: rgba(20, 40, 90, .32); border: 2px solid rgba(255, 255, 255, .6);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    transition: transform .12s ease-out;
  }
  .joystick.is-active { background: rgba(255, 255, 255, .24); }
  .joystick.is-active .joystick-knob { transition: none; background: rgba(20, 40, 90, .55); }
}
/* 가로로 눕힌 크게 보기: 오른쪽 빈 여백 가운데에 */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  .is-expanded .joystick { right: calc(19px + env(safe-area-inset-right, 0px)); }
}
.caveat { margin: 12px 0 0; padding-bottom: 14px; border-bottom: 1px dashed #bcc6b0; font-size: 13px; color: var(--muted); }

/* ---------- 공간 카드 ---------- */

.cards-section { margin-top: 28px; }
.cards-section h2 { margin: 0; font-size: 24px; color: var(--navy); }
.cards-lead { margin: 4px 0 16px; font-size: 14px; color: var(--muted); }
#scene-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scene-card {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
  padding: 12px 16px; min-height: 64px;
  text-align: left; background: var(--paper); border: 1px solid var(--line);
  transition: transform .15s, box-shadow .15s;
}
.scene-card:hover { transform: translateY(-2px); box-shadow: var(--pixel-shadow); border-color: var(--line-strong); }
.scene-card-status { font-size: 12px; color: #6c745b; }
.scene-card strong { font-size: 16px; line-height: 1.35; }
.scene-card small { font-size: 12px; color: var(--muted); }
.scene-card .scene-card-game { font-weight: 700; color: var(--orange); }
.scene-card.is-planned { background: #fff4e0; border-color: #e4bf8a; }
.scene-card.is-planned .scene-card-status { color: var(--orange); font-weight: 700; }
.facilities { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.facilities::before { content: "편의시설·기타"; align-self: center; margin-right: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.facility-chip { min-height: 36px; padding: 4px 10px; font-size: 13px; }
.omitted { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- 입학 안내 연결 ---------- */

.admissions-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin: 36px 0 0; padding: 22px 24px;
  background: #fff; border: 2px solid var(--navy); box-shadow: 6px 6px 0 rgba(20, 40, 90, .15);
}
.admissions-cta strong { font-family: var(--font-title); font-weight: 900; font-size: 22px; color: var(--navy); }
.admissions-cta p { margin: 4px 0 0; color: var(--muted); }
.cta-links { display: flex; flex-wrap: wrap; gap: 10px; }

.tour-footer { margin-top: 40px; padding: 26px 0 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.tour-footer strong { color: var(--navy); font-size: 14px; }
.tour-footer p { margin: 6px 0 0; }

/* ---------- 상세 창 ---------- */

dialog {
  width: min(480px, 100% - 28px); max-height: 90dvh; padding: 0;
  border: 2px solid var(--navy); background: var(--cream); color: var(--ink);
  box-shadow: 8px 8px 0 rgba(20, 40, 90, .2);
}
dialog::backdrop { background: rgba(18, 38, 52, .6); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 20px; }
.dialog-head .eyebrow { margin: 0; }
#close { width: 44px; height: 44px; border: 0; background: none; font-size: 20px; }
.detail-image { position: relative; overflow: hidden; height: 240px; background: #efe9d4; }
.detail-image img { position: absolute; max-width: none; height: auto; image-rendering: pixelated; }
.detail-image.is-photo img { inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.detail-image.is-missing { display: grid; place-items: center; color: var(--muted); font-size: 14px; }
/* 넓은 상세 창 (드론 전경 사진) */
dialog.is-wide { width: min(1000px, 100% - 28px, 62dvh * 4 / 3); }
dialog.is-wide .detail-image { width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 62dvh; background: #0f1d33; }
dialog.is-wide .detail-image.is-photo img { object-fit: contain; }
/* 사진 넘겨 보기 */
.gallery-nav {
  position: absolute; z-index: 2; top: 50%; transform: translateY(-50%);
  width: 44px; height: 56px; padding: 0; border: 0;
  background: rgba(15, 29, 51, .55); color: #fff; font-size: 30px; line-height: 1;
}
.gallery-nav:hover, .gallery-nav:focus-visible { background: rgba(15, 29, 51, .8); }
.gallery-nav.is-prev { left: 0; }
.gallery-nav.is-next { right: 0; }
.gallery-count {
  position: absolute; z-index: 2; right: 8px; bottom: 8px; padding: 2px 8px;
  background: rgba(15, 29, 51, .65); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums;
}
.detail-image.is-photo { touch-action: pan-y; }
.dialog-body { padding: 18px 22px 22px; }
.dialog-body h2 { margin: 10px 0 6px; font-size: 26px; color: var(--navy); }
.dialog-body p { margin: 0 0 12px; font-size: 15px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }   /* 바로가기 링크 · 체험 게임 버튼 */
.detail-link { margin-top: 4px; }
.detail-link[hidden] { display: none; }
.tag { display: inline-block; padding: 3px 9px; background: var(--paper); border: 1px solid var(--line-strong); font-size: 12px; }
.tag.is-planned { border-color: var(--orange); color: var(--orange); font-weight: 700; }

/* ---------- 휴대폰 ---------- */

@media (max-width: 760px) {
  .container { width: min(100% - 32px, 1200px); }
  .hide-sm { display: none; }
  .brand strong { font-size: 14px; }
  .back-link { padding: 6px 10px; font-size: 13px; }
  .intro { padding: 26px 0 18px; }
  .eyebrow { letter-spacing: 1px; }
  .guide { width: 72px; margin-right: 0; }
  .lead { font-size: 15px; }
  .scene-nav { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
  .scene-nav button { min-width: 0; padding: 8px 2px; font-size: 14px; }
  .tour-tools { padding: 12px; }
  .space-search { flex-direction: column; align-items: stretch; gap: 6px; }
  .space-search input { width: 100%; }
  .scene-toolbar { flex-wrap: wrap; gap: 8px; }
  .zoom button { min-width: 40px; padding: 8px 10px; }
  #zoom-value { min-width: 46px; }
  .expand-button { flex: 1; }
  /* 휴대폰: 지도는 화면 높이에서 위쪽 도구만큼 뺀 높이까지. 방향 버튼은 지도 위에 띄움 */
  #scene-scroll { max-height: clamp(300px, calc(100svh - 140px), 720px); }
  .direction {
    position: absolute; z-index: 9; left: 50%; bottom: 10px; transform: translateX(-50%);
    margin: 0; padding: 5px; background: rgba(20, 40, 90, .35);
  }
  .direction button { width: 50px; height: 46px; background: rgba(255, 252, 242, .9); }
  #scene-status { text-align: center; font-size: 13px; }
  #scene-cards { grid-template-columns: repeat(2, 1fr); }
  .scene-card { padding: 10px 12px; min-height: 56px; }
  .scene-card strong { font-size: 15px; }
  .admissions-cta { padding: 18px; }
  .cta-links { width: 100%; }
  .cta-links .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (min-width: 761px) and (max-width: 1000px) {
  #scene-cards { grid-template-columns: repeat(3, 1fr); }
}

/* 가상 스틱 켜고 끄기: 터치 기기에서만 보임 */
.stick-toggle { display: none; }
@media (pointer: coarse) {
  .stick-toggle { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; white-space: nowrap; }
  .stick-toggle[aria-pressed="false"] { color: var(--muted); border-style: dashed; }
  .stick-off .joystick { display: none !important; }
}
/* 휴대폰: 확대 도구는 한 줄, 그 아래 「크게 보기」와 「스틱」을 나란히 */
@media (pointer: coarse) and (max-width: 640px) {
  .scene-toolbar .zoom { flex-basis: 100%; }
  .scene-toolbar .zoom #fit { flex: 1; }
  .scene-toolbar .stick-toggle { flex: none; }
  .scene-toolbar .zoom button { min-width: 44px; }
}
