:root {
  --bg: #0a0a0f;
  --bg-panel: #121218;
  --bg-card: #1a1a24;
  --fg: #f2f2f5;
  --fg-dim: #9a9aa8;
  --accent: #7c6cf0;
  --accent-soft: rgba(124, 108, 240, 0.18);
  --line: #26262f;
  --radius: 14px;
}

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

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

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

.screen[hidden] {
  display: none !important;
}

/* ---------- 랜딩 ---------- */
.landing {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(124, 108, 240, 0.35), transparent 60%),
    radial-gradient(ellipse 70% 45% at 50% 110%, rgba(60, 130, 220, 0.25), transparent 60%),
    var(--bg);
  z-index: 20;
  padding: 24px;
}

.landing-brand {
  font-size: 13px;
  letter-spacing: 0.35em;
  color: var(--fg-dim);
  margin-bottom: 10px;
}

.landing-title {
  font-size: clamp(40px, 10vw, 64px);
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 22px;
}

.landing-desc {
  color: var(--fg-dim);
  margin-bottom: 14px;
}

.landing-desc-sub {
  font-size: 13px;
  opacity: 0.7;
  margin-bottom: 40px;
}

.lang-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.lang-btn {
  width: min(260px, 70vw);
  padding: 14px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--fg);
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.lang-btn:first-child {
  background: var(--fg);
  color: #111;
  border-color: var(--fg);
}

.lang-btn:active {
  transform: scale(0.97);
}

/* ---------- 주의사항 스플래시 (게임 로고 스타일) ---------- */
.screen.notice-splash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.notice-stage {
  width: 100%;
  padding: 24px;
  display: flex;
  justify-content: center;
}

/* 한 화면에 주의사항 2개. 화면 단위로 페이드된다.
   fill-mode 를 쓰지 않는다. 애니메이션이 실행되지 않는 환경
   (모션 줄이기 설정, 배경 탭 throttling 등)에서도 글자가 보여야 하기 때문. */
.splash-page {
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 34px;
  opacity: 1;
  animation: splashFade 3s ease;
}

@keyframes splashFade {
  0%   { opacity: 0; transform: scale(0.97); }
  12%  { opacity: 1; transform: scale(1); }
  88%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .splash-page { animation: none; }
}

.splash-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.splash-item .notice-icon {
  width: 62px;
  height: 62px;
  margin-bottom: 14px;
}

.splash-item .notice-icon svg {
  width: 32px;
  height: 32px;
}

.splash-title {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 8px;
}

.splash-body {
  font-size: 14.5px;
  color: var(--fg-dim);
  line-height: 1.65;
}

.notice-skip-hint {
  position: absolute;
  bottom: calc(28px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: var(--fg-dim);
  opacity: 0.6;
}

.notice-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.notice-icon svg {
  width: 24px;
  height: 24px;
  fill: var(--accent);
}

/* ---------- 가이드 레이아웃 ----------
   iOS Safari의 position:fixed 스크롤 버그를 피하기 위해
   페이지 스크롤 대신 flex 컬럼(탭/콘텐츠/플레이어) 내부 스크롤 구조를 사용 */
.guide {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.guide[hidden] {
  display: none;
}

/* ---------- 탭 ---------- */
.tabs {
  flex: none;
  display: flex;
  background: rgba(10, 10, 15, 0.92);
  border-bottom: 1px solid var(--line);
}

.tab {
  flex: 1;
  padding: 16px 4px 13px;
  font-size: 14px;
  color: var(--fg-dim);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.tab.is-active {
  color: var(--fg);
  font-weight: 700;
  border-bottom-color: var(--fg);
}

/* ---------- 패널 ---------- */
.panels {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 18px 32px;
}

/* 풀블리드 패널 (벙커 소개, 관 상세): 패딩 없이 화면 높이 100% */
.panel-full.is-active {
  max-width: none;
  padding: 0;
  height: 100%;
}

.cover-full {
  width: 100%;
  height: 100%;
}

.cover-full img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.cover-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--fg-dim);
  background:
    radial-gradient(ellipse 80% 80% at 50% 20%, rgba(124, 108, 240, 0.4), transparent 65%),
    var(--bg-card);
}

/* 전시관 소개 */
.about-hero {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse 80% 80% at 50% 20%, rgba(124, 108, 240, 0.5), transparent 65%),
    radial-gradient(ellipse 60% 60% at 80% 90%, rgba(60, 130, 220, 0.4), transparent 60%),
    var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.about-hero span {
  font-size: 13px;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.75);
}

.about-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 14px;
}

.about-body {
  color: #c9c9d4;
  white-space: pre-line;
  font-size: 15px;
}

.about-listen {
  margin-top: 24px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  border: 1px solid rgba(124, 108, 240, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.about-listen svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* 안내 포인트 리스트 */
.sector-head {
  margin: 26px 2px 12px;
}

.sector-head:first-child {
  margin-top: 4px;
}

.sector-name {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-weight: 700;
}

.sector-theme {
  font-size: 19px;
  font-weight: 800;
}

.sector-summary {
  font-size: 13px;
  color: var(--fg-dim);
}

.track-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.track-card.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.track-thumb {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, #3d3670, #1e2a4a);
  position: relative;
  overflow: hidden;
}

.track-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-num {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.65);
  border-top-right-radius: 8px;
}

.track-meta {
  min-width: 0;
  flex: 1;
}

.track-title {
  font-weight: 700;
  font-size: 16px;
}

.track-desc {
  font-size: 13px;
  color: var(--fg-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.track-state {
  flex: none;
  font-size: 12px;
  color: var(--fg-dim);
}

.track-state.is-ready {
  color: var(--accent);
  font-size: 18px;
}

/* 가이드 맵 */
.map-wrap {
  text-align: center;
}

.map-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.map-desc {
  color: var(--fg-dim);
  font-size: 13px;
  margin-bottom: 20px;
}

.route-map {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 14px;
}

.route-sector {
  text-align: left;
  margin-bottom: 18px;
}

.route-sector:last-child {
  margin-bottom: 0;
}

.route-sector-label {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}

.route-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.route-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
  font-size: 13px;
}

.route-step .num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.route-arrow {
  color: var(--fg-dim);
  font-size: 12px;
}

/* ---------- 플레이어 ---------- */
.player {
  flex: none;
  background: rgba(16, 16, 22, 0.97);
  border-top: 1px solid var(--line);
  padding: 12px 18px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-info {
  text-align: center;
  min-height: 40px;
}

.player-title {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-sub {
  font-size: 12px;
  color: var(--fg-dim);
}

.player-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-time {
  font-size: 11px;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
}

.seekbar {
  flex: 1;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  accent-color: var(--accent);
}

.player-controls {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

.ctrl-speed {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.ctrl {
  color: var(--fg);
  opacity: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ctrl svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  display: block;
}

.ctrl:disabled {
  opacity: 0.35;
  cursor: default;
}

.ctrl-play {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--fg);
  color: #111;
}

.ctrl-play svg {
  width: 20px;
  height: 20px;
}

.ctrl-play .icon-play {
  margin-left: 2px; /* 재생 삼각형의 시각적 중심 보정 */
}

.ctrl-play .icon-pause,
.ctrl-play.is-playing .icon-play {
  display: none;
}

.ctrl-play.is-playing .icon-pause {
  display: block;
}

.ctrl-speed {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-dim);
  min-width: 34px;
}

/* ---------- 공간 안내 (이미지 + 관 이름 갤러리) ---------- */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gallery-card {
  display: block;
  text-align: left;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 0;
}

.gallery-img {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #3d3670, #1e2a4a);
}

.gallery-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
}

.gallery-card.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.gallery-img {
  position: relative;
}

.gallery-audio {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-audio svg {
  width: 11px;
  height: 11px;
  fill: #fff;
  margin-left: 1px;
}

.gallery-label {
  display: block;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 만족도 조사 ---------- */
.survey-pending {
  text-align: center;
  color: var(--fg-dim);
  padding: 60px 20px;
}

/* ---------- 관 상세 (풀블리드) ---------- */
.detail-cover {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.detail-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.detail-bg-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.25);
  background: linear-gradient(135deg, #3d3670, #1e2a4a);
}

.detail-back {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px 9px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
}

.detail-back svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.detail-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 48px 20px 22px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.45) 60%, transparent);
}

.detail-title {
  font-size: 23px;
  font-weight: 800;
  margin-bottom: 8px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.detail-no {
  color: var(--accent);
}

.detail-body {
  color: #e3e3ea;
  font-size: 14.5px;
  white-space: pre-line;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

@media (min-width: 720px) {
  .tabs {
    justify-content: center;
  }

  .tab {
    flex: none;
    padding-left: 36px;
    padding-right: 36px;
  }
}

/* ---------- 안내도 (공간 안내 상단) ---------- */
.map-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
}

.map-sheets {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 26px;
}

.map-sheet {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #000;
  display: block;
}

/* 업로드 아이콘을 쓰는 주의사항 */
.notice-icon img {
  width: 60%;
  height: 60%;
  object-fit: contain;
}

/* ---------- 로딩 실패 ---------- */
.fatal {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  text-align: center;
  color: var(--fg-dim);
}

.fatal button {
  margin-top: 14px;
  padding: 12px 28px;
  border-radius: 999px;
  background: var(--fg);
  color: #111;
  font-weight: 700;
}

/* ---------- 만족도 조사 ---------- */
/* 설문은 한 문항씩 보여준다 */
.survey-step {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}

.survey-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.survey-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.survey-count {
  font-size: 12px;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}

.survey-step .sq-label {
  font-size: 19px;
  line-height: 1.45;
  margin-bottom: 6px;
}

.survey-nav {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
}

.survey-back {
  flex: none;
  padding: 15px 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--fg-dim);
  font-weight: 700;
  font-size: 15px;
}

.survey-nav .survey-submit { flex: 1; }

.sq-label {
  font-weight: 700;
  font-size: 15.5px;
  margin-bottom: 10px;
}

.sq-req { color: var(--accent); }

.sq-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sq-options.is-scale {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}

.sq-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14.5px;
  cursor: pointer;
}

.sq-options.is-scale .sq-opt {
  flex: 1;
  min-width: 64px;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  font-size: 13px;
  padding: 12px 6px;
}

.sq-opt input { accent-color: var(--accent); width: 18px; height: 18px; }

.sq-opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.sq-text {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  padding: 12px 14px;
  font: inherit;
  resize: vertical;
}

.sq-error {
  color: #f37272;
  font-size: 13.5px;
  text-align: center;
}

.survey-submit {
  padding: 15px;
  border-radius: 999px;
  background: var(--fg);
  color: #111;
  font-weight: 700;
  font-size: 16px;
}

.survey-submit:disabled { opacity: 0.5; }

.survey-thanks {
  text-align: center;
  color: var(--fg);
  font-size: 16px;
  font-weight: 700;
  padding: 80px 20px;
}
