@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;600;700;900&family=Pretendard:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  word-break: keep-all;
  overflow-wrap: break-word;
}

body, html {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: #0d0f12;
  font-family: 'Pretendard', -apple-system, sans-serif;
  color: #f7f6f2;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* [사용자 요청 반영: 대문 진입 전 고즈넉한 정지 스플래시 화면] */
.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(circle at 50% 42%, #191d24 0%, #0d0f12 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  cursor: pointer;
}

.splash-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  animation: splashFadeIn 0.8s ease-out forwards;
}

@keyframes splashFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.splash-temple-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
}

.splash-temple-svg,
.splash-lotus-svg {
  width: 196px;
  max-width: 72vw;
  height: auto;
  filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.55));
}

.splash-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.82rem;
  font-weight: 700;
  color: #ffd966;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  margin-bottom: 18px;
  text-shadow: 0 2px 14px rgba(212, 175, 55, 0.35);
}

.splash-lines {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.splash-lines p {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: #e4ded3;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
}

#canvas-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  touch-action: none;
}

#canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  touch-action: none;
}

/* 상단 헤더 */
header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  background: linear-gradient(180deg, rgba(10, 12, 16, 0.88) 0%, rgba(10, 12, 16, 0) 100%);
  pointer-events: none;
}

header * {
  pointer-events: auto;
}

.title-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.55);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  flex-shrink: 0;
}

.title-area h1 {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-area span {
  font-size: 0.82rem;
  font-weight: 500;
  color: #e5ded0;
  letter-spacing: 0.04em;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.icon-btn {
  background: rgba(20, 24, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  transition: all 0.2s ease;
}

.icon-btn:hover, .icon-btn:active {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.06);
}

/* 하단 랜드마크 내비게이션 바 */
.bottom-nav-container {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 8px;
  background: rgba(14, 17, 22, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 8px 12px;
  border-radius: 30px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65);
  max-width: 95vw;
  overflow-x: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* [요청 반영: 상단 사찰 타이틀과 전각 이름 겹침 완전 해결] */
/* 전각/명상 모드 입장 시 상단 메인 타이틀 영역을 완전히 숨겨 전각 이름(대웅전/석굴암/산신각)만 단독 표출 */
body.in-meditation header {
  justify-content: flex-end !important;
  background: transparent !important;
}

body.in-meditation header .title-area {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* 명상 모드 시 하단 메뉴 및 힌트 완전 숨김 처리 */
body.in-meditation .bottom-nav-container,
body.in-meditation .control-hint {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateX(-50%) translateY(30px) !important;
}

.nav-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ede7da;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-pill:hover, .nav-pill:active {
  background: rgba(212, 175, 55, 0.25);
  color: #fff;
  border-color: rgba(212, 175, 55, 0.5);
}

.nav-pill.active {
  background: linear-gradient(135deg, #d4af37 0%, #aa8422 100%);
  color: #121212;
  font-weight: 700;
  border-color: #ffd875;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
}

/* 조작 힌트 배지 */
.control-hint {
  position: absolute;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  background: rgba(10, 12, 15, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #fff;
  pointer-events: none;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

body.beomjong-ready .control-hint {
  opacity: 0 !important;
  pointer-events: none !important;
}

.bell-return-btn {
  position: absolute;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  padding: 9px 26px;
  background: rgba(14, 17, 22, 0.92);
  backdrop-filter: blur(12px);
  color: #ffd966;
  border: 1.5px solid rgba(212, 175, 55, 0.75);
  border-radius: 24px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65);
  transition: all 0.2s ease;
}

.bell-return-btn:hover,
.bell-return-btn:active {
  background: rgba(212, 175, 55, 0.22);
  color: #fff;
  transform: translateX(-50%) scale(0.98);
}

/* 전각 근접 팝업 안내: [사용자 요청 반영: 거대하고 어두운 박스를 없애고 뒤의 탑과 전각이 100% 보이도록 투명화] */
.location-card {
  position: absolute;
  top: 112px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 10;
  width: 90%;
  max-width: 440px;
  background: transparent !important;
  backdrop-filter: none !important;
  border: none !important;
  border-radius: 0;
  padding: 10px 14px;
  box-shadow: none !important;
  opacity: 0;
  pointer-events: none; /* 뒤의 3D 공간을 자유롭게 터치 및 스와이프하여 둘러볼 수 있도록 투과 */
  text-align: center;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.location-card.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: none;
}

.location-card-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffd766;
  background: rgba(10, 12, 16, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.55);
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 6px;
  font-family: 'Noto Serif KR', serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* [사용자 요청 반영: 전각 어디인지 알려주는 고품격 전통 문패 스타일 명패] */
.location-card h2 {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.35rem;
  color: #ffd966;
  margin: 0 auto 8px;
  display: inline-block;
  padding: 4px 18px;
  background: rgba(15, 17, 22, 0.6);
  border: 1.5px solid rgba(212, 175, 55, 0.85);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
}

.location-card p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #ffffff;
  margin: 4px auto 14px;
  max-width: 380px;
  white-space: pre-line;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.9);
}

.location-card-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.enter-btn {
  width: auto;
  min-width: 185px;
  max-width: 280px;
  margin: 0;
  padding: 10px 22px;
  background: linear-gradient(135deg, #d4af37 0%, #aa8422 100%);
  color: #141414;
  border: none;
  border-radius: 25px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 12px rgba(212, 175, 55, 0.4);
  pointer-events: auto; /* 버튼만 온전히 탭/클릭 동작 */
  transition: all 0.2s;
}

.bell-stop-btn {
  padding: 10px 20px;
  background: rgba(26, 28, 34, 0.88);
  color: #f4f1ea;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 25px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  transition: all 0.2s;
}

.bell-stop-btn:active {
  transform: scale(0.98);
}

.enter-btn:active {
  transform: scale(0.98);
}

.gwanyok-meditation-msg {
  margin: 10px auto 0;
  padding: 7px 16px;
  max-width: 340px;
  background: rgba(15, 17, 22, 0.72);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 14px;
  color: #fff6df;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}

/* 전각 내부 명상 모드 오버레이 */
.meditation-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 25;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 16px 14px 12px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: transparent; /* 3D 법당 공간이 가려지지 않고 온전히 투과 */
  transition: all 0.5s ease;
}

.meditation-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}

.meditation-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  max-width: 90vw;
  pointer-events: none;
}

#temple-header-group {
  background: rgba(18, 16, 20, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-top: 38px;
  padding: 5px 18px;
  border-radius: 18px;
  border: 1px solid rgba(212, 175, 55, 0.38);
  box-shadow: 0 4px 15px rgba(0,0,0,0.55);
}

.meditation-header h2 {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fffaf0;
  margin: 0;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9);
}

.meditation-header p {
  display: none;
}

/* 탑돌이 진행 카운터 카드: [사용자 요청 반영: 1/3 제거, 깔끔한 2줄 표시 및 투명한 배경] */
.pagoda-counter-card {
  display: none;
  background: rgba(16, 20, 26, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.5);
  backdrop-filter: blur(10px);
  padding: 10px 22px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
  max-width: 360px;
  margin: 78px auto 0;
}

.pagoda-counter-card.visible {
  display: block;
}

.pagoda-round-display {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.18rem;
  font-weight: 700;
  color: #ffd766;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.pagoda-round-desc {
  font-size: 0.85rem;
  color: #f2eee6;
  line-height: 1.45;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.85);
}

/* 현재 등록된 발원문 표시 배지: [사용자 요청 반영: 다중 발원문 추가 지원 & 마우스 오버 시 발원문 변경 / 등 끄기 가능] */
.active-prayer-badge {
  display: none;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  margin-top: 14px;
  font-family: 'Noto Serif KR', serif;
  max-width: 94vw;
  text-align: center;
  pointer-events: auto;
}

.active-prayer-badge.visible {
  display: flex;
}

.prayer-badge-item {
  position: relative;
  background: rgba(22, 18, 14, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.48);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 7px 16px;
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  transition: all 0.2s ease;
  cursor: pointer;
}

.prayer-badge-item:hover {
  border-color: rgba(255, 215, 102, 0.85);
  background: rgba(28, 23, 18, 0.95);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.75);
}

.prayer-badge-actions {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
}

.prayer-badge-item.show-actions .prayer-badge-actions {
  display: flex;
}

@media (hover: hover) {
  .prayer-badge-item:hover .prayer-badge-actions {
    display: flex;
  }
}

.prayer-action-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #ffe8a3;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.prayer-action-btn:hover {
  background: rgba(212, 175, 55, 0.32);
  color: #ffffff;
  border-color: #ffd766;
}

.prayer-action-btn.turn-off:hover {
  background: rgba(180, 60, 60, 0.45);
  border-color: #ff9999;
  color: #ffffff;
}

/* 하얀 연꽃 로고 및 회색 석굴 아이콘 공통 SVG */
.white-lotus-icon,
.gray-cave-icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.18em;
  margin-right: 4px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.65));
}

.prayer-badge-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffd766;
  margin-bottom: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.prayer-badge-text {
  font-size: 0.84rem;
  color: #f7eedf;
  line-height: 1.4;
}

/* [요청 반영] 호흡 가이드 원 (기존 대비 50% 확대: 220px -> 330px) */
.breath-circle-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.breath-circle {
  position: absolute;
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 330px;
  height: 330px;
  border-radius: 50%;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s ease;
  pointer-events: none;
}

/* [요청 반영] 부처님과 촛불 사이에 뜨는 명상 호흡 안내 */
.breath-text-card {
  position: absolute;
  top: 49%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(18, 16, 20, 0.88);
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 20px;
  border-radius: 20px;
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
  animation: fadeIn 0.3s ease;
}

/* 명상 대기 상태 (불상과 제단이 맑고 또렷하게 보이도록 완전 투명 처리) */
.breath-circle.idle {
  animation: none;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* [요청 반영] 명상 시작 후 - 불상을 가리거나 하얗게 번지지 않는 단아하고 은은한 황금 호흡 원상 */
.breath-circle.active {
  border: 2px solid rgba(255, 230, 140, 0.85);
  background: radial-gradient(circle, rgba(255, 240, 180, 0.05) 0%, rgba(255, 215, 100, 0.02) 60%, transparent 80%);
  box-shadow: 0 0 18px rgba(255, 215, 60, 0.35), inset 0 0 14px rgba(255, 225, 100, 0.15);
  animation: breathe 8s infinite ease-in-out;
}

/* 명상 시작 버튼 */
.start-meditation-btn {
  background: rgba(18, 16, 14, 0.78);
  border: 1px solid rgba(245, 207, 98, 0.45);
  border-radius: 24px;
  padding: 8px 18px;
  color: #fff9ea;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.65);
  pointer-events: auto;
  transition: transform 0.2s ease, background 0.2s ease;
}

.start-meditation-btn span:first-child {
  font-size: 1.25rem;
}

.start-meditation-btn:hover, .start-meditation-btn:active {
  transform: scale(1.05);
  color: #ffd766;
  background: rgba(30, 26, 20, 0.9);
}

.breath-text {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.5;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 1), 0 0 8px rgba(0,0,0,0.9);
}

@keyframes breathe {
  0%, 100% {
    transform: translate(-50%, -50%) scale(0.95);
    border-color: rgba(255, 225, 140, 0.75);
    box-shadow: 0 0 14px rgba(255, 210, 50, 0.28);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
    border-color: rgba(255, 245, 180, 0.95);
    box-shadow: 0 0 24px rgba(255, 220, 80, 0.45);
  }
}

/* [사용자 요청: 하단 참배 및 명상 메뉴: 메뉴 밖의 박스 제거, 글씨만 심플하게 배치] */
.meditation-menu-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(420px, 94vw);
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  pointer-events: auto;
  margin-bottom: 8px;
}

.meditation-menu-tab {
  display: none !important;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  width: 100%;
}

.menu-bottom-row {
  display: flex;
  width: 100%;
  gap: 8px;
  align-items: center;
}

.menu-bottom-row .control-grid-btn {
  flex: 1.1;
  padding: 8px 6px;
  font-size: 0.80rem;
  border-radius: 18px;
}

.menu-bottom-row .prayer-wide-btn {
  flex: 1.1;
  margin-top: 0;
  padding: 8px 6px;
  font-size: 0.80rem;
}

.meditation-drawer {
  display: none;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border-radius: 20px;
  background: rgba(16, 15, 20, 0.72);
  border: 1px solid rgba(212, 175, 55, 0.34);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
}

.meditation-menu-box.drawer-open .meditation-drawer {
  display: flex;
}

.meditation-footer-bar {
  display: flex;
  width: 100%;
  gap: 8px;
  align-items: center;
}

.meditation-footer-bar .menu-toggle-btn {
  flex: 1.45;
  padding: 10px 14px;
  font-size: 0.88rem;
  border-color: rgba(212, 175, 55, 0.55);
  background: rgba(22, 20, 24, 0.86);
}

.meditation-footer-bar .exit-btn {
  flex: 0.75;
  padding: 10px 10px;
  font-size: 0.86rem;
  background: rgba(22, 20, 24, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #f7eedf;
  font-family: 'Noto Serif KR', serif;
  font-weight: 600;
  border-radius: 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.meditation-footer-bar .exit-btn:hover, .meditation-footer-bar .exit-btn:active {
  background: rgba(36, 32, 38, 0.95);
  border-color: rgba(245, 207, 98, 0.7);
  color: #ffffff;
}

.control-grid-btn {
  background: rgba(22, 20, 24, 0.82);
  border: 1px solid rgba(212, 175, 55, 0.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #f7eedf;
  padding: 10px 14px;
  border-radius: 20px;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

.control-grid-btn:hover, .control-grid-btn:active {
  background: rgba(36, 32, 38, 0.9);
  border-color: rgba(245, 207, 98, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
}

.control-grid-btn.active {
  background: linear-gradient(135deg, rgba(82, 58, 22, 0.9) 0%, rgba(55, 38, 14, 0.9) 100%);
  border-color: #ffd766;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(245, 207, 98, 0.4);
}

.control-grid-btn.highlight {
  background: rgba(26, 24, 30, 0.85);
  border-color: rgba(212, 175, 55, 0.38);
  color: #f7eedf;
}

.chant-btn {
  width: 100%;
  padding: 7px 14px;
  font-size: 0.83rem;
  border-radius: 18px;
}

.chant-status-card {
  position: absolute;
  top: 54%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(16, 15, 20, 0.84);
  border: 1px solid rgba(212, 175, 55, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f9f1dc;
  padding: 7px 16px;
  border-radius: 16px;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.80rem;
  line-height: 1.45;
  text-align: center;
  max-width: min(360px, 88vw);
  pointer-events: none;
  z-index: 25;
}

/* [요청 반영: 부처님과 촛불 사이에 뜨는 삼배 안내 카드] */
.bow-status-card {
  position: absolute;
  top: 49%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(18, 16, 20, 0.88);
  border: 1px solid rgba(212, 175, 55, 0.65);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff9e6;
  padding: 8px 18px;
  border-radius: 20px;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  width: max-content;
  max-width: min(90vw, 440px);
  box-sizing: border-box;
  white-space: normal;
  word-break: keep-all;
  z-index: 20;
  pointer-events: none;
  animation: fadeIn 0.3s ease;
}

.control-grid-btn.bow-highlight {
  background: linear-gradient(135deg, rgba(62, 40, 28, 0.88) 0%, rgba(32, 22, 16, 0.88) 100%);
  border: 1.5px solid rgba(235, 196, 122, 0.65);
  color: #ffe8b3;
}

.control-grid-btn.bow-highlight:hover {
  background: linear-gradient(135deg, rgba(95, 58, 38, 0.95) 0%, rgba(55, 34, 25, 0.95) 100%);
  border-color: #ffd766;
}

.grid-col-span-2 {
  grid-column: span 2;
}

.exit-btn {
  background: rgba(22, 24, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(10px);
  color: #ffffff;
  padding: 9px 24px;
  border-radius: 25px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  transition: all 0.2s;
}

.exit-btn:hover, .exit-btn:active {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: scale(1.03);
}

/* 발원문 작성 팝업 모달 */
.prayer-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  background: rgba(6, 7, 10, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.prayer-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.prayer-modal {
  width: 100%;
  max-width: 440px;
  background: #f7f3e8;
  color: #2b261f;
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  border: 2px solid #d4af37;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: scale(0.95);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.prayer-modal-overlay.active .prayer-modal {
  transform: scale(1);
}

.prayer-modal h3 {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.3rem;
  color: #4a2f13;
  text-align: center;
}

.prayer-modal p {
  font-size: 0.86rem;
  color: #635747;
  text-align: center;
  line-height: 1.5;
}

.prayer-textarea {
  width: 100%;
  height: 110px;
  background: #ffffff;
  border: 1px solid #c9bea9;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.95rem;
  color: #222;
  resize: none;
  outline: none;
  line-height: 1.6;
}

.prayer-textarea:focus {
  border-color: #aa8422;
  box-shadow: 0 0 8px rgba(170, 132, 34, 0.3);
}

.prayer-modal-actions {
  display: flex;
  gap: 10px;
}

.prayer-submit-btn {
  flex: 2;
  background: linear-gradient(135deg, #a57827 0%, #7d5718 100%);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Noto Serif KR', serif;
}

.prayer-cancel-btn {
  flex: 1;
  background: #dfd8c7;
  color: #443e33;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

/* 스마트폰 가로 모드 (Landscape) 최적화 */
@media (orientation: landscape) and (max-height: 520px) {
  header {
    padding: 8px 16px;
  }
  .title-area h1 {
    font-size: 1.05rem;
  }
  .bottom-nav-container {
    bottom: 8px;
    padding: 5px 10px;
    gap: 6px;
  }
  .nav-pill {
    padding: 6px 11px;
    font-size: 0.78rem;
  }
  .control-hint {
    bottom: 50px;
    padding: 4px 12px;
    font-size: 0.72rem;
  }
  .location-card {
    top: 92px;
    padding: 12px 18px;
    max-width: 420px;
  }
  .location-card h2 {
    font-size: 1.15rem;
    margin-bottom: 4px;
  }
  .location-card p {
    font-size: 0.82rem;
    line-height: 1.35;
    margin-bottom: 10px;
  }
  .enter-btn {
    padding: 8px;
    font-size: 0.88rem;
  }
  .meditation-overlay {
    padding: 8px 12px 6px;
  }
  .meditation-menu-box {
    margin-bottom: 2px;
    width: min(540px, 92vw);
  }
  .action-grid {
    gap: 5px 8px;
  }
  .control-grid-btn {
    padding: 6px 10px;
    font-size: 0.82rem;
  }
  .menu-bottom-row {
    gap: 6px;
  }
  .exit-btn {
    padding: 6px 10px;
    font-size: 0.82rem;
  }
}

/* 음원 출처 및 저작권 안내 모달 */
.credit-modal {
  max-width: 440px;
}

.credit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 18px;
  text-align: left;
}

.credit-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
}

.credit-item strong {
  display: block;
  color: #ffd966;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.credit-item p {
  margin: 2px 0;
  font-size: 0.82rem;
  color: #e9e2d3;
  line-height: 1.45;
}

.credit-item a {
  color: #f6d575;
  text-decoration: underline;
}

/* 동시접속 인원 표시 배지 */
.presence-badge {
  position: fixed;
  top: 58px;
  left: 14px;
  z-index: 12;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 18, 24, 0.72);
  border: 1px solid rgba(255, 217, 102, 0.35);
  color: #f5e6b3;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  backdrop-filter: blur(8px);
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

body.in-meditation .presence-badge {
  top: 14px;
  left: 14px;
}

/* 관욕식에서는 카드를 조금 더 위로 올려 아기 부처님과 겹치지 않게 하고, 설명 아래 바가지 배치 */
body.at-gwanyok .location-card {
  top: 90px;
}

body.at-gwanyok .location-card-actions {
  flex-direction: column;
  gap: 10px;
}

.presence-badge.solo-mode {
  border-color: rgba(255, 180, 120, 0.45);
  color: #ffd8b5;
}

/* 순서 대기 / 차례 안내 배너 */
.turn-toast {
  position: fixed;
  top: 108px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  max-width: min(90vw, 420px);
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(16, 20, 28, 0.90);
  border: 1px solid rgba(255, 217, 102, 0.55);
  color: #fff3cc;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.turn-toast.ready {
  background: rgba(32, 42, 24, 0.94);
  border-color: #ffd966;
  color: #ffe89e;
}

/* 오른쪽 '발원문 보기' 플로팅 버튼 */
.view-prayers-fab {
  position: fixed;
  top: 58px;
  right: 14px;
  z-index: 22;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(20, 17, 14, 0.84);
  border: 1px solid rgba(212, 175, 55, 0.52);
  color: #f7e6b7;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.80rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.view-prayers-fab:hover {
  border-color: rgba(255, 217, 102, 0.9);
  background: rgba(30, 25, 20, 0.94);
  transform: translateY(-1px);
}

.view-prayers-fab:active {
  transform: scale(0.97);
}

.view-prayers-fab .white-lotus-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* 다른 참배객 발원문 목록 모달 */
.prayers-list-modal {
  max-height: 78vh;
  display: flex;
  flex-direction: column;
}

.prayers-list-desc {
  margin-bottom: 10px !important;
}

.prayers-list-body {
  flex: 0 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 48vh;
  padding-right: 4px;
  margin-bottom: 14px;
}

.prayers-list-item {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(179, 143, 64, 0.42);
  border-radius: 12px;
  padding: 10px 13px;
  text-align: left;
  box-shadow: 0 2px 6px rgba(43, 38, 31, 0.06);
}

.prayers-list-item.is-mine {
  border-color: #c8a238;
  background: rgba(255, 248, 224, 0.92);
}

.prayers-list-item-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #8a6914;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.prayers-list-item-text {
  font-size: 0.90rem;
  line-height: 1.5;
  color: #1a1714 !important;
  word-break: keep-all;
  white-space: pre-wrap;
}

.prayers-list-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 0.88rem;
  color: #6b6154;
}

/* 도량 내 참배객 합장 인사 버튼 */
.greet-fab {
  position: fixed;
  bottom: 138px;
  right: 16px;
  z-index: 22;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(38, 30, 22, 0.92), rgba(24, 19, 14, 0.94));
  border: 1.5px solid rgba(212, 175, 55, 0.72);
  color: #ffe8a3;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.86rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.greet-fab:active {
  transform: scale(0.95);
}

body.in-meditation .greet-fab {
  display: none !important;
}

/* 오른쪽 하단 스피커 버튼 & 1회성 소리 안내 버튼 */
.speaker-fab {
  position: fixed;
  bottom: 84px;
  right: 16px;
  z-index: 24;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(16, 18, 24, 0.84);
  border: 1px solid rgba(212, 175, 55, 0.55);
  color: #fff3cc;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.16s ease;
}

.speaker-fab:active {
  transform: scale(0.93);
}

body.in-meditation .speaker-fab {
  bottom: 146px;
  right: 14px;
}

.sound-guide-tip {
  position: fixed;
  bottom: 86px;
  right: 66px;
  z-index: 24;
  max-width: min(70vw, 270px);
  padding: 8px 13px;
  border-radius: 14px;
  background: rgba(20, 17, 14, 0.90);
  border: 1px solid rgba(212, 175, 55, 0.60);
  color: #ffeab3;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.77rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

body.in-meditation .sound-guide-tip {
  bottom: 148px;
  right: 64px;
}

/* 관욕식 작은 바가지 버튼 */
.location-card-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gwanyok-ladle-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff6dc 0%, #f0d48a 100%);
  border: 1.5px solid #b38428;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.gwanyok-ladle-btn:active {
  transform: scale(0.92);
}

.gwanyok-ladle-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.ladle-svg {
  width: 28px;
  height: 28px;
}

.ladle-step-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #2b7cd3;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffffff;
}

/* 반야용선 벽화 앞에서는 누적 방문객 배지 바로 아래(90px)로 콤팩트하게 배치해 제목·벽화 모두 가리지 않음 */
body.at-banya .location-card {
  top: 90px;
  padding: 8px 14px;
  min-width: auto;
}

body.at-banya .location-card h2 {
  display: none;
}

body.at-banya .location-card p {
  white-space: pre-line;
  margin-bottom: 6px;
  font-size: 0.88rem;
  line-height: 1.3;
  font-weight: 600;
  color: #f7e6bd;
}

body.at-banya .enter-btn {
  padding: 7px 14px;
  font-size: 0.86rem;
}

/* 반야용선 피안의 세계 안내 카드 & 수면 모드 (내가 앉은 모습이 보이도록 상단 배치) */
.banya-message-card {
  position: fixed;
  top: 86px;
  left: 50%;
  transform: translateX(-50%);
  width: min(90vw, 440px);
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(18, 24, 38, 0.78);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(235, 200, 128, 0.42);
  color: #f7eedb;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.62;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.36);
  pointer-events: auto;
  z-index: 42;
}

.banya-message-card p {
  margin: 0;
}

.banya-sleep-btn {
  flex: 1.4;
  background: linear-gradient(135deg, rgba(44, 58, 92, 0.92), rgba(28, 38, 64, 0.94));
  border-color: rgba(235, 200, 128, 0.55);
  color: #ffe8b3;
}

.banya-sleep-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: radial-gradient(circle at 50% 35%, #0c1220 0%, #04070e 65%, #000000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.banya-sleep-box {
  max-width: 420px;
  width: 100%;
  padding: 32px 24px;
  border-radius: 22px;
  background: rgba(20, 27, 45, 0.85);
  border: 1px solid rgba(235, 200, 128, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  text-align: center;
  color: #f4ebd8;
}

.banya-sleep-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.banya-sleep-box h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  color: #f5d896;
}

.banya-sleep-box p {
  margin: 0 0 24px;
  font-size: 0.92rem;
  line-height: 1.65;
  color: #d6deec;
}

.banya-wake-btn {
  width: 100%;
  padding: 13px 18px;
  border-radius: 14px;
  border: 1px solid rgba(245, 216, 150, 0.65);
  background: linear-gradient(135deg, #3b4f7d, #253356);
  color: #fff2d1;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
