/* ko-linebreak:2026-10-08 한국어 줄바꿈 기본값. lang="ko" 인 글에만 적용 */
[lang|="ko"] { word-break: keep-all; line-break: strict; overflow-wrap: break-word; }
:where(h1, h2, h3, h4, caption, figcaption, th):where(:lang(ko)) { text-wrap-style: balance; }
:where(p, li, dd, td, blockquote, .note):where(:lang(ko)) { text-wrap-style: pretty; }
:where(code, .url):where(:lang(ko)) { overflow-wrap: anywhere; }
:where(button, .btn, .badge, .chip):where(:lang(ko)) { white-space: nowrap; }
:where(.user-text):where(:lang(ko)) { white-space: pre-line; }
/* /ko-linebreak */
/* 한국어 줄바꿈 예외: 문장·설명이 들어가는 버튼(퀴즈 보기, 엔딩 입구, 난이도 카드)은 줄바꿈 허용 */
.quiz__choice, .floormap__outro-btn, .m4-diffbtn { white-space: normal; }

/* 미스터리 놀이터 RE:PLAY — 공통 스타일
   태블릿 가로 화면(랜드스케이프) 키오스크 기준. 다크 전시실 테마.
   본문 서체: 페이퍼로지(Paperlogy) — vendor/fonts에 로컬 번들(오프라인 동작) */

/* font-display: swap — 폰트 로드 전에도 텍스트가 즉시 보여 첫 화면이 비지 않는다 */
@font-face {
  font-family: 'Paperlogy';
  src: url('../vendor/fonts/Paperlogy-4Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Paperlogy';
  src: url('../vendor/fonts/Paperlogy-5Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Paperlogy';
  src: url('../vendor/fonts/Paperlogy-6SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Paperlogy';
  src: url('../vendor/fonts/Paperlogy-7Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Paperlogy';
  src: url('../vendor/fonts/Paperlogy-8ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'Paperlogy';
  src: url('../vendor/fonts/Paperlogy-9Black.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}

:root {
  --ink: #17202a;
  --paper: #f2efe9;
  --paper-card: #fbfaf7;
  --night-1: #0b1626;
  --night-2: #14263f;
  --night-text: #f2f6fb;
  --night-dim: #9db0c6;
  --accent: #4ea1ff;
  --accent-strong: #2469b5;
  --gold: #f5b942;
  --correct: #34c98e;
  --wrong: #e2574c;
  /* 흰 글자를 얹는 '면' 색. 위의 밝은 색은 어두운 바탕 위 글자·선용이고(대비 6.8:1 이상),
     같은 색을 면으로 깔고 흰 글자를 얹으면 2.1~3.7:1로 WCAG AA(4.5:1)에 못 미친다.
     면에는 한 단계 깊은 이 색을 쓴다(흰 글자 기준 accent 4.7 · correct 4.4 · wrong 4.5). */
  --accent-fill: #2b74c8;
  --correct-fill: #128a5f;
  --wrong-fill: #d1463b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--night-1);
  color: var(--night-text);
  word-break: keep-all;
  overflow-wrap: break-word;
  font-family: 'Paperlogy', 'Apple SD Gothic Neo', 'Pretendard', 'Noto Sans KR', system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }

#app { width: 100%; height: 100%; }

.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ============================================================ 버튼 */
.btn {
  border-radius: 14px;
  font-weight: 700;
  transition: transform 0.12s ease, opacity 0.12s ease;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
/* 그림자는 색 없는 오프셋 그림자만 쓴다. 버튼 색을 번지게 하는 글로우는 깊이가 아니라 장식이다. */
.btn--primary {
  background: var(--accent-strong);
  color: #fff;
  padding: 16px 44px;
  font-size: 22px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.btn--xl { padding: 20px 64px; font-size: 26px; border-radius: 18px; }
.btn--ghost {
  min-height: 44px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  padding: 12px 20px;
  font-size: 17px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
}

/* ============================================================ 플로어 맵 (다크 전시실) */
.screen--floormap {
  background: linear-gradient(160deg, var(--night-1), var(--night-2));
  color: var(--night-text);
}

.floormap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 2.5vh, 30px) clamp(24px, 4vw, 64px);
}

.floormap__header { text-align: center; }
.floormap__lang {
  min-height: 44px;
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 5;
  padding: 8px 14px;
  font-size: 14px;
}
.floormap__eyebrow {
  font-size: 15px;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
:lang(en) .floormap__eyebrow { letter-spacing: 0.04em; }
.floormap__title {
  font-size: clamp(28px, 4.6vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.floormap__title-quote { color: #aebfd6; }
.floormap__subtitle {
  margin-top: 6px;
  font-size: clamp(14px, 1.6vw, 18px);
  font-weight: 600;
  color: var(--night-dim);
}
.floormap__invite {
  margin-top: clamp(6px, 1.2vh, 12px);
  font-size: 16px;
  font-weight: 600;
  color: var(--night-dim);
  letter-spacing: -0.01em;
}

.floormap__content {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3.5vw, 56px);
  margin-top: 6px;
  overflow: hidden; /* 어떤 화면비에서도 헤더 위로 올라타지 않게 */
}

.floormap__mapbox {
  height: 100%;
  max-height: min(100%, 430px);
  flex-shrink: 0;
  aspect-ratio: 920 / 940;
  position: relative;
}
.floormap__maplabel {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--night-text);
  border-bottom: 3px solid var(--night-text);
  padding-bottom: 4px;
  z-index: 2;
}
.floormap__svg { display: block; width: 100%; height: 100%; }
.floormap__label { font-size: 17px; font-weight: 700; fill: #d5deec; letter-spacing: 0.12em; }
.floormap__tiny { font-size: 12px; font-weight: 700; fill: #aebfd6; letter-spacing: 0.08em; }
/* 지도 위 아이콘(화장실·완료 체크)은 SVG 아이콘이라 fill이 아니라 color로 색을 준다 */
.floormap__wc { color: #aebfd6; }

.floormap__badge--game { cursor: pointer; }
.floormap__badge--game:active circle { opacity: 0.85; }
.floormap__badge--static { opacity: 0.88; }
.floormap__badge-num {
  font-size: 28px;
  font-weight: 900;
  fill: #fff;
  pointer-events: none;
}
.floormap__badge-num--sm { font-size: 24.5px; }
.floormap__badge-check {
  color: var(--night-1);
  pointer-events: none;
}
.floormap__pulse {
  animation: badge-pulse 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes badge-pulse {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.6; }
}

/* 범례의 폭·터치 높이·글자 크기는 고정하고 간격만 화면 높이에 맞춘다.
   완료 체크는 번호 모서리에 얹어 완료 수가 바뀌어도 이름과 지도 위치를 유지한다. */
.floormap__side {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.4vh, 12px);
  width: 460px;
  flex: 0 0 460px;
  max-height: 100%;
  min-height: 0;
}
.floormap__cta {
  font-size: clamp(18px, 3.2vh, 20px);
  font-weight: 800;
  color: var(--night-text);
  flex-shrink: 0;
}
.floormap__legend {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(5px, 1vh, 8px);
  min-height: 0;
}
.floormap__legend-item {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  padding: 6px 8px;
  font-size: 15px;
  transition: transform 0.12s ease;
}
.floormap__legend-item--game { cursor: pointer; }
.floormap__legend-item--game:active { transform: scale(0.97); }
.floormap__legend-item--static { opacity: 0.6; }
/* 기획 지시(2026-08-28): 기술설명 체험은 회색 카드, 키메시지 체험은 기본 카드로 구분.
   글자는 둘 다 흰색이므로 회색은 흰 글씨가 읽히는 명도까지만 올린다(완료 금색이 이기도록 위에 둔다). */
.floormap__legend-item--tech { background: rgba(192, 192, 192, 0.34); border-color: rgba(192, 192, 192, 0.44); }
.floormap__legend-item--done { border-color: var(--gold); background: rgba(245, 185, 66, 0.12); }
/* 기획 지시: 기술 설명 칸은 완료 뒤에도 연한 회색 그대로. 완료는 금테·체크로만 보인다 */
.floormap__legend-item--tech.floormap__legend-item--done { background: rgba(192, 192, 192, 0.34); }
.floormap__legend-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.floormap__legend-name { font-weight: 700; flex: 1; white-space: nowrap; font-size: 15px; }
.floormap__legend-done {
  position: absolute;
  top: 1px;
  left: 27px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--night-1);
  pointer-events: none;
}
.floormap__progress {
  font-size: clamp(14px, 2vh, 16px);
  color: var(--night-dim);
  text-align: right;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
/* 범례 회색 칸(kind: 'tech')의 뜻. 견본 색은 .floormap__legend-item--tech 와 같다 */
.floormap__key { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.floormap__key-swatch { width: 16px; height: 16px; border-radius: 4px; background: rgba(192, 192, 192, 0.34); border: 1px solid rgba(192, 192, 192, 0.44); }
.floormap__progress strong { color: var(--night-text); font-size: clamp(16px, 2.4vh, 19px); margin: 0 3px; }
.floormap__outro-btn {
  min-height: 44px;
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: clamp(10px, 1.8vh, 16px) 20px;
  font-size: clamp(15px, 2.2vh, 19px);
  font-weight: 700;
  color: #221a05;
  background: linear-gradient(120deg, #f5b942, #ffd97a);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(245, 185, 66, 0.4);
  animation: outro-cta-glow 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes outro-cta-glow {
  0%, 100% { box-shadow: 0 6px 20px rgba(245, 185, 66, 0.25); }
  50% { box-shadow: 0 6px 28px rgba(245, 185, 66, 0.5); }
}

/* ============================================================ 미션 공통 */
.screen[class*='screen--mission-'] {
  background: linear-gradient(160deg, var(--night-1), var(--night-2));
  color: var(--night-text);
}

.mission {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 2.5vh, 28px) clamp(20px, 3vw, 48px);
}

.mission__header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.mission__home { justify-self: start; }
.mission__titlebox {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: min(56vw, 660px);
  min-width: 0;
}
.mission__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--mission-color);
  color: var(--mission-number-ink, #fff);
  font-size: 22px;
  font-weight: 900;
}
.mission__title {
  min-width: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mission__step {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  justify-self: end;
  font-size: 15px;
  font-weight: 600;
  color: var(--night-dim);
  white-space: nowrap;
}

.mission__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

/* ----- 스텝 카드 ----- */
.step-card {
  width: min(880px, 94%);
  max-height: 100%;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: clamp(24px, 4vh, 48px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.step-card--center { align-items: center; text-align: center; }
/* 아이콘은 currentColor를 따르므로 색은 여기서 정한다.
   미션별로 다른 색을 쓰고 싶으면 icon(name, { className }) + 각 게임의 injectStyle로 덮어쓴다. */
.step-card__icon { font-size: clamp(48px, 8vh, 80px); line-height: 1; color: var(--accent); }
.step-card__icon--guide { color: var(--night-dim); }
.step-card__icon--think { color: var(--night-dim); }
.step-card__icon--error { color: var(--night-dim); } /* 카메라 오류: 눈에 튀지 않는 회청색 */
.step-card__lead { text-wrap: balance; font-size: clamp(22px, 3vw, 32px); font-weight: 700; }
.step-card__line { font-size: clamp(16px, 2vw, 21px); color: var(--night-dim); font-weight: 500; }
.step-card__heading { text-wrap: balance; font-size: clamp(20px, 2.6vw, 28px); font-weight: 700; line-height: 1.4; }
.step-card .btn--primary { margin-top: 10px; align-self: center; }

.step-card--start { width: min(640px, 94%); }
.step-card--start .step-card__icon { font-size: 88px; }
.mission--card-step .step-card__lead { font-size: 28px; line-height: 1.35; }
.mission--card-step .step-card__heading { font-size: 26px; }
.step-card--guide > .step-card__icon { align-self: center; }
.step-card--guide .step-card__instructions { display: flex; flex-direction: column; gap: 16px; width: fit-content; max-width: 100%; align-self: center; }
.step-card--guide .step-card__instruction { display: flex; align-items: center; gap: 12px; text-align: left; }
.step-card--guide .step-card__instruction > p, .step-card--guide .step-card__instruction > h2 { flex: 1; min-width: 0; }
.step-card--guide .step-card__pictogram { width: 30px; font-size: 30px; line-height: 1; color: var(--night-dim); flex: none; }

/* flex: none — 결과 화면처럼 세로가 빠듯할 때도 [다음] 버튼은 줄어들지 않고
   자기 자리를 지킨다(결과 내용이 버튼 위로 밀려 겹치는 것을 막는다). */
.step-nav { display: flex; justify-content: center; margin-top: 12px; flex: none; }

/* ----- 체험 컨테이너 ----- */
.experience {
  width: 100%;
  height: 100%;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.experience > .step-card { margin: auto; }

/* 카메라 게임용 2분할 레이아웃 */
.split {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 16px;
}
.split__pane {
  flex: 1;
  min-width: 0;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #060d18;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}
.split__pane-label {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 15px;
  font-weight: 700;
}
.cam-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* 거울 모드 */
}
.experience__hint {
  position: absolute;
  bottom: 16px;
  /* left/right + margin auto 로 가운데 정렬한다. left:50% 방식은 왼쪽 절반을 여백으로 잡아
     알약이 무대 폭의 절반까지만 넓어지고, 긴 문구(영어)가 불필요하게 여러 줄로 접힌다. */
  left: 12px;
  right: 12px;
  margin: 0 auto;
  width: -webkit-fit-content;
  width: fit-content;
  z-index: 6;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 18px;
  font-weight: 700;
  /* 무대 폭을 넘으면 잘리지 않고 접힌다 — 같은 문구라도 언어에 따라 길이가 크게 다르다. */
  text-align: center;
  line-height: 1.35;
  word-break: keep-all;
}

.loading-msg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 20px;
  font-weight: 700;
  color: var(--night-dim);
  z-index: 4;
}
.loading-msg::before {
  content: '';
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- 원리 설명 ----- */
.principle-chain {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.principle-chain__item {
  flex: 1;
  min-width: 150px;
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 18px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.principle-chain__icon { font-size: 38px; line-height: 1; color: var(--accent); }
.principle-chain__name { font-size: 19px; font-weight: 700; color: var(--night-text); }
.principle-chain__desc { font-size: 15px; color: var(--night-dim); line-height: 1.5; }
.principle-chain__arrow {
  align-self: center;
  font-size: 26px;
  font-weight: 900;
  color: var(--night-dim);
}

.tech-box {
  background: rgba(78, 161, 255, 0.1);
  border: 1.5px solid rgba(78, 161, 255, 0.35);
  border-radius: 18px;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tech-box__label { font-size: 14px; letter-spacing: 0.1em; font-weight: 800; color: var(--night-text); }
.tech-box__label:lang(en) { letter-spacing: 0.04em; }
.tech-box__desc [class$="-tech-note"] { display: block; margin-top: 10px; color: var(--night-text); font-weight: 700; }
.tech-box__name { font-size: 21px; font-weight: 700; }
.tech-box__desc { font-size: 16px; color: var(--night-dim); line-height: 1.6; }

/* ----- 퀴즈 ----- */
.quiz { display: flex; flex-direction: column; gap: 12px; }
.quiz__question { display: flex; align-items: baseline; gap: 12px; }
.quiz__q-label {
  width: 28px;
  height: 28px;
  flex: none;
  border: 1.5px solid var(--night-dim);
  border-radius: 50%;
  color: var(--night-text);
  font-size: 16px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quiz__choice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 18px 22px;
  font-size: 19px;
  font-weight: 600;
  color: var(--night-text);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.quiz__choice:not(:disabled):active { transform: scale(0.98); }
.quiz__choice-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.quiz__choice--correct {
  border-color: var(--correct);
  background: rgba(52, 201, 142, 0.15);
}
.quiz__choice--correct .quiz__choice-num { background: var(--correct-fill); color: #fff; }
.quiz__choice--wrong {
  border-color: color-mix(in srgb, var(--wrong) 50%, transparent);
  animation: shake 0.4s ease;
}
.quiz__choice:disabled { cursor: default; }
.quiz__choice--wrong .quiz__choice-text { opacity: 0.5; }
.quiz__choice--wrong .quiz__choice-num { background: var(--night-1); border: 2px solid var(--wrong); color: var(--wrong); }
.quiz__choice--wrong .quiz__choice-num svg { width: 24px; height: 24px; }
.quiz--answered .quiz__choice:not(.quiz__choice--correct) { opacity: 0.45; animation: none; }
.quiz__retry { font-size: 16px; }
.quiz__retry[hidden] { display: none; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
.quiz__explain {
  background: rgba(52, 201, 142, 0.12);
  border: 1.5px solid rgba(52, 201, 142, 0.4);
  border-radius: 16px;
  padding: 18px 22px;
  font-size: 18px;
  line-height: 1.6;
}
.quiz__explain strong { color: var(--correct); margin-right: 8px; }

/* ----- 생각해보기 / 완료 ----- */
.mission--think .step-card__heading [class$="-think-lead"] {
  display: block;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--night-dim);
}

.complete__stamp {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  background: var(--mission-color);
  color: var(--mission-number-ink, #fff);
  font-size: 52px;
  font-weight: 900;
  animation: complete-stamp 400ms ease-out;
}
.complete__seal {
  position: absolute;
  top: -5px;
  right: -7px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--night-1);
  font-size: 24px;
}
@keyframes complete-stamp {
  0% { transform: scale(1.15); opacity: 0; }
  65% { transform: scale(0.97); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.complete__title { font-size: clamp(28px, 4vw, 40px); font-weight: 700; }
.complete__progress { font-size: 16px; }
.complete__return { position: relative; overflow: hidden; isolation: isolate; }
.complete__return::before {
  content: '';
  position: absolute;
  inset: auto 12px 4px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
}
.complete__return-fill {
  position: absolute;
  inset: auto 12px 4px;
  height: 5px;
  border-radius: 3px;
  background: var(--night-text);
  transform: scaleX(0);
  transform-origin: left;
  animation: complete-return var(--auto-return-ms) linear forwards;
  pointer-events: none;
}
.complete__return-label { position: relative; }
@keyframes complete-return { to { transform: scaleX(1); } }

/* ----- 결과 ----- */
.result {
  flex: 0 1 auto;
  max-height: calc(100% - 68px);
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

/* ============================================================ 낮은 화면 대응 (컴팩트)
   전시 태블릿(갤럭시 탭 A7 가로)은 CSS 뷰포트가 1000x600, 브라우저 주소창이 있으면
   540 안팎까지 내려간다. 이 높이에서는 기본 여백·글자 크기로는 퀴즈 해설이 붙는 순간
   카드가 넘쳐 [다음] 버튼이 화면 밖으로 잘린다. 세로만 촘촘하게 줄여 한 화면에 담는다.
   (가로 여백·글자 색·구성은 그대로 — 전시장에서 읽는 인상이 달라지지 않는다) */
@media (max-height: 700px) {
  /* 안드로이드 제스처 바와 콘텐츠 사이에 safe-area 만큼 여유를 둔다. */
  .mission {
    padding: 10px clamp(18px, 3vw, 40px);
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }
  .mission__header { gap: 14px; }

  .mission__step { font-size: 14px; }
  .mission__body { margin-top: 6px; }

  .step-card { padding: 16px 26px; gap: 11px; border-radius: 18px; }
  .step-card__icon { font-size: clamp(38px, 6.5vh, 54px); }
  .step-card__lead { font-size: clamp(19px, 2.6vw, 26px); }
  .step-card__line { font-size: clamp(14px, 1.9vw, 18px); }
  .step-card__heading { font-size: clamp(17px, 2.2vw, 23px); }
  .step-card .btn--primary { margin-top: 2px; }
  .step-nav { margin-top: 6px; }

  .btn--primary { padding: 12px 34px; font-size: 19px; }
  .btn--xl { padding: 13px 46px; font-size: 21px; border-radius: 15px; }
  .btn--ghost { padding: 9px 16px; font-size: 15px; }

  .principle-chain { gap: 10px; }
  .principle-chain__item { padding: 8px 12px; gap: 4px; border-radius: 14px; }
  .principle-chain__icon { font-size: 30px; }
  .principle-chain__name { font-size: 17px; }
  .principle-chain__desc { font-size: 15px; }

  .tech-box { padding: 12px 18px; gap: 3px; border-radius: 14px; }
  .tech-box__name { font-size: 18px; }
  .tech-box__desc { font-size: 16px; line-height: 1.5; }

  .quiz { gap: 8px; }
  .quiz__choice { padding: 11px 18px; font-size: 17px; gap: 10px; border-radius: 13px; }
  .quiz__choice-num { width: 28px; height: 28px; }
  .quiz__explain { padding: 12px 18px; font-size: 16px; line-height: 1.5; border-radius: 13px; }

  .complete__stamp { width: 80px; height: 80px; font-size: 42px; }
  .mission--card-step .step-card { gap: 10px; }
  .mission--card-step .step-card__lead { font-size: 26px; }
  .mission--card-step .step-card__heading { font-size: 24px; }
  .step-card--start .step-card__icon { font-size: 80px; }
  .step-card--guide .step-card__instructions { gap: 12px; }
  .mission--principle .step-nav, .mission--quiz .step-nav { margin-top: 4px; }
  .complete__title { font-size: clamp(24px, 3.4vw, 32px); }
}

/* ============================================================ OUTRO (10개 전부 완료 시)
   미션 화면과 같은 다크 전시실 톤 위에 황금빛 축하 연출을 얹는다.
   연출은 전부 CSS 애니메이션(transform·opacity)이라 rAF·타이머가 필요 없다. */
.screen--outro {
  background:
    radial-gradient(30% 30% at 50% 30%, rgba(245, 185, 66, 0.08), transparent 100%),
    linear-gradient(160deg, var(--night-1), var(--night-2));
  color: var(--night-text);
}

.outro {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 2.5vh, 28px) clamp(20px, 3vw, 48px);
}

/* ----- 파티클 층 (별·반짝임이 아래에서 위로 흘러간다) ----- */
.outro__sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.outro--lit .outro__sky { opacity: 1; }
.outro__particle {
  position: absolute;
  bottom: -8%;
  display: inline-flex;
  line-height: 0;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
  animation-name: outro-rise;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}
@keyframes outro-rise {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(0.7); opacity: 0; }
  12% { opacity: 0.95; }
  78% { opacity: 0.75; }
  100% { transform: translate3d(var(--drift, 0px), -112vh, 0) rotate(210deg) scale(1.05); opacity: 0; }
}

/* ----- 본문 ----- */
.outro__stage {
  position: relative;
  z-index: 1;
  max-width: min(940px, 94%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(8px, 1.6vh, 16px);
}

.outro__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: clamp(7px, 1.2vh, 11px) clamp(16px, 2.4vw, 24px);
  background: rgba(245, 185, 66, 0.14);
  border: 1.5px solid rgba(245, 185, 66, 0.45);
  color: var(--gold);
  font-size: clamp(14px, 1.9vh, 17px);
  font-weight: 800;
  letter-spacing: 0.04em;
  animation: outro-in 0.6s ease both;
}

.outro__key {
  position: relative;
  width: clamp(96px, 17vh, 168px);
  height: clamp(96px, 17vh, 168px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: outro-key-drop 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.12s;
}
.outro__key::before {
  content: '';
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 185, 66, 0.42), transparent 68%);
  animation: outro-glow 2.8s ease-in-out infinite;
}
.outro__key-svg {
  position: relative;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 18px rgba(245, 185, 66, 0.4));
  animation: outro-key-float 4.2s ease-in-out infinite;
}
@keyframes outro-key-drop {
  from { transform: translateY(-42px) scale(0.6); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes outro-key-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-9px) rotate(2deg); }
}
@keyframes outro-glow {
  0%, 100% { opacity: 0.55; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1.06); }
}

.outro__title {
  font-size: clamp(32px, 6.2vh, 58px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--gold);
  animation: outro-in 0.7s ease both;
  animation-delay: 0.62s;
}

.outro__lines {
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.9vh, 9px);
  animation: outro-in 0.7s ease both;
  animation-delay: 0.82s;
}
.outro__line {
  font-size: clamp(15px, 2.5vh, 22px);
  font-weight: 600;
  line-height: 1.55;
  color: var(--night-text);
}
.outro__line + .outro__line { color: var(--night-dim); }

/* 버튼만 opacity로 등장시킨다 — transform을 애니메이션이 붙들면 .btn:active의 눌림 효과가 죽는다 */
.outro__btn {
  margin-top: clamp(6px, 1.4vh, 16px);
  background: linear-gradient(120deg, #f7c65c, #eaa524);
  color: #2b1c02;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  animation: outro-fade-in 0.6s ease both;
  animation-delay: 1.05s;
}

@keyframes outro-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes outro-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================================ 무반응 경고
   js/core/idle.js가 body에 붙인다. 닫히는 동안에도 탭을 가로챈다. */
.idle-warn {
  position: fixed;
  inset: 0;
  z-index: 1000;
  padding: 24px;
  transition: opacity 0.16s ease;
  animation: idle-warn-in 0.16s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 10, 20, 0.72);
  color: var(--night-text);
}
/* 닫힌 직후 잠깐 DOM 에 남아 탭을 삼키는 동안은 보이지 않게 */
.idle-warn--closing { opacity: 0; }

.idle-warn .idle-warn__card {
  width: min(560px, 100%);
  max-height: 100%;
  padding: 28px 32px;
  gap: 14px;
  background: var(--night-2);
  border: 1px solid var(--night-dim);
  border-radius: 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  animation: idle-card-in 0.18s ease;
}
.idle-warn .idle-warn__title { font-size: 28px; line-height: 1.3; }
.idle-warn .idle-warn__hint { font-size: 18px; color: var(--night-dim); }
.idle-warn__count {
  font-size: clamp(64px, 13vh, 80px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--night-text);
}
.idle-warn .idle-warn__btn { min-height: 52px; min-width: 220px; margin-top: 0; }
.idle-warn--closing { animation: none; }
@keyframes idle-warn-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes idle-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 장식만 멈춘다. 게임 진행 애니메이션과 로딩 스피너는 유지한다. */
@media (prefers-reduced-motion: reduce) {
  .complete__stamp,
  .floormap__pulse,
  .floormap__outro-btn,
  .outro__particle,
  .outro__badge,
  .outro__key,
  .outro__key::before,
  .outro__key-svg,
  .outro__title,
  .outro__lines,
  .outro__btn,
  .idle-warn,
  .idle-warn .idle-warn__card {
    animation: none;
  }
  .outro__badge, .outro__key, .outro__title, .outro__lines, .outro__btn,
  .idle-warn .idle-warn__card { opacity: 1; transform: none; }
  .floormap__pulse { opacity: 0.3; }
  .outro__key::before { opacity: 0.55; transform: none; }
  .outro__sky { opacity: 1; }
  .outro__particle { bottom: 5%; opacity: 0.3; transform: none; }
  .outro__particle:nth-child(3n) { top: 5%; bottom: auto; }
  .outro__particle:nth-child(3n + 1) { top: 10%; bottom: auto; }
  .btn, .floormap__legend-item, .outro__sky, .idle-warn { transition-duration: 0.01s; }
}

/* 최종 태블릿 다듬기: 표시 전용, 게임 단계 전환에는 관여하지 않는다. */
.mission__steps { display: flex; gap: 6px; }
.mission__step-dot { width: 8px; height: 8px; border: 1px solid var(--night-dim); border-radius: 50%; }
.mission__step-dot--past { background: rgba(255, 255, 255, 0.65); border-color: transparent; }
.mission__step-dot--current { background: var(--mission-color); border-color: var(--mission-color); }
.mission--result .step-nav { margin-top: 16px; }
.mission--double-digit .complete__stamp > span:first-child { font-size: 0.85em; }
.mission--double-digit .complete__seal { top: -9px; right: -13px; }
.floormap__legend-item--double-digit .floormap__legend-done { top: -3px; left: 31px; }
.idle-warn .idle-warn__note { font-size: 16px; line-height: 1.5; color: var(--night-dim); text-wrap: balance; }
@media (max-height: 700px) {
  .mission--result .m2-result { gap: 12px; }
  .mission--result .m2-result--share { flex-wrap: nowrap; }
  .mission--result .m2-result--qr .m2-qr canvas { width: min(28vw, 250px, calc(100vh - 300px)); }
  .mission--result .m2-share { gap: 8px; }
  .mission--result .m2-share .btn--primary { background: transparent; border: 1px solid var(--night-dim); box-shadow: none; }
  .idle-warn .idle-warn__card { padding: 24px 28px; gap: 12px; }
}
