/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    font-family: 'Noto Serif KR', serif;
    background-color: #000;
    overflow: hidden; /* Prevent scrolling */
    color: #fff;
}

/* Background Scene */
.scene-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 1.5s ease-in-out;
    z-index: 1;
}

/* Vignette to make text readable */
.overlay-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0) 40%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
    z-index: 2;
}

/* UI Container */
.ui-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    padding: 2rem;
}

/* Top Bar */
.top-bar {
    text-align: center;
    animation: fadeInDown 1s ease-out;
}

.top-bar h1 {
    font-family: 'Cinzel', serif;
    font-weight: 400;
    font-size: 1.5rem;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    color: #ffd700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.progress-bar-container {
    width: 60%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 auto;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #ffd700;
    width: 0%;
    transition: width 0.8s ease-in-out;
}

/* Hotspots Center Area */
.hotspot-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hotspot-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #ffd700;
    color: #ffd700;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-family: 'Noto Serif KR', serif;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    animation: fadeIn 1.5s ease;
}

.hotspot-btn:hover {
    background: #ffd700;
    color: #000;
    transform: scale(1.05);
}

.pulse {
    display: block;
    width: 15px;
    height: 15px;
    background: #ffd700;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 1);
    animation: pulseObj 2s infinite;
}
.hotspot-btn:hover .pulse {
    background: #000;
    animation: none;
}

/* Glassmorphism Info Panel */
.glass {
    background: rgba(15, 15, 15, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    padding: 2.5rem;
    border-radius: 15px 15px 0 0;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    animation: fadeInUp 1s ease-out;
}

.info-panel h2 {
    color: #ffd700;
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.info-panel p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #f0f0f0;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Floating Back Button */
.btn-floating-prev {
    position: fixed;
    bottom: 2.5rem;
    left: 17rem; /* Next to the minimap */
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    background: rgba(15, 15, 15, 0.85);
    border: 1px solid #ffd700;
    color: #ffd700;
    font-family: 'Noto Serif KR', serif;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    transition: all 0.3s ease;
    z-index: 60;
    backdrop-filter: blur(5px);
}

.btn-floating-prev:hover {
    background: #ffd700;
    color: #000;
    transform: translateY(-2px);
}

.btn-floating-home {
    position: fixed;
    top: 2.5rem;
    right: 2.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    background: rgba(15, 15, 15, 0.85);
    border: 1px solid #ffd700;
    color: #ffd700;
    font-family: 'Noto Serif KR', serif;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    transition: all 0.3s ease;
    z-index: 60;
    backdrop-filter: blur(5px);
}

.btn-floating-home:hover {
    background: #ffd700;
    color: #000;
    transform: translateY(-2px);
}

.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseObj {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 15px rgba(255, 215, 0, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

/* Info Panel Toggle Buttons */
.info-panel {
    position: relative;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-panel.panel-hidden {
    transform: translateY(150%);
    opacity: 0;
    pointer-events: none;
}

.btn-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.btn-close:hover {
    color: #ffd700;
}

.btn-open {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(15, 15, 15, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.5);
    color: #ffd700;
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    font-style: italic;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    transition: all 0.3s ease;
    z-index: 60;
    backdrop-filter: blur(5px);
}

.btn-open:hover {
    background: #ffd700;
    color: #000;
    transform: scale(1.1);
}

.btn-open.hidden {
    display: none;
}

/* Artifact Accordion Styles */
.artifacts-container {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.artifact-item {
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.15);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.artifact-item:hover {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
}

.artifact-btn {
    width: 100%;
    padding: 0.8rem 1rem;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 0.95rem;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.artifact-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    color: #fff;
}

.artifact-btn.active {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
}

.artifact-icon {
    font-size: 1.2rem;
    color: #bbb;
    transition: transform 0.3s;
}

.artifact-btn.active .artifact-icon {
    color: #ffd700;
}

.artifact-details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
    padding: 0 1rem;
    background: rgba(0, 0, 0, 0.3);
}

.artifact-details.expanded {
    max-height: 500px;
    opacity: 1;
    padding: 1rem;
}

.artifact-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #ccc;
    margin-bottom: 0.8rem;
}

.artifact-verse {
    font-style: italic;
    font-size: 0.85rem;
    color: #ffd700;
    opacity: 0.9;
    padding-left: 0.8rem;
    border-left: 2px solid rgba(255, 215, 0, 0.5);
}

/* Minimap Styles */
.minimap-container {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 200px;
    padding: 1.5rem;
    z-index: 50;
    border-radius: 12px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    -webkit-touch-callout: none;
}

.minimap-container.dragging {
    cursor: grabbing;
}

.minimap-container * {
    pointer-events: none;
}

.minimap-title {
    font-size: 0.95rem;
    color: #ffd700;
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: 0.15em;
    font-weight: 700;
}

.temple-map {
    width: 100%;
    height: auto;
    display: block;
}

.map-area {
    fill: rgba(255, 255, 255, 0.05);
    stroke: #aa8c30;
    stroke-width: 1.5;
    transition: all 0.6s ease;
}

.map-area.active {
    fill: rgba(255, 215, 0, 0.4);
    stroke: #ffd700;
    stroke-width: 3;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8));
}

/* ========================================================= */
/* Map Intro Scene Styles */
/* ========================================================= */
.map-intro-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1a1a24 0%, #0a0a0f 100%);
    z-index: 100;
    display: flex;
    transition: opacity 1s ease, transform 1s ease;
}

.map-intro-scene.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
}

.intro-left {
    flex: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    border-right: 1px solid rgba(255,215,0,0.2);
}

.intro-title {
    font-family: 'Cinzel', serif;
    color: #ffd700;
    font-size: 2.5rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 10px rgba(255,215,0,0.3);
}

.intro-subtitle {
    font-family: 'Noto Serif KR', serif;
    color: #aaa;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.intro-map-wrapper {
    width: 100%;
    max-width: 600px;
    height: auto;
}

.intro-map-svg {
    width: 100%;
    height: 100%;
    max-height: 75vh;
    animation: fadeIn 1.5s ease-out;
}

.map-hotspot {
    fill: rgba(30, 30, 40, 0.6);
    stroke: #aa8c30;
    stroke-width: 2;
    cursor: crosshair;
    transition: all 0.3s ease;
    transform-origin: center;
}

.map-hotspot:hover, .map-hotspot.active {
    fill: rgba(255, 215, 0, 0.35) !important;
    stroke: #ffd700 !important;
    stroke-width: 5 !important;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
}

#loc-gentiles { fill: rgba(15, 15, 20, 0.8); }

.map-base {
    fill: none;
    stroke: rgba(255,215,0,0.3);
    stroke-width: 2;
    pointer-events: none;
}

.map-deco {
    fill: rgba(255, 50, 50, 0.2);
    stroke: rgba(255, 50, 50, 0.6);
    pointer-events: none;
}

.intro-right {
    flex: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: url('assets/ai_holy_place.png') center/cover no-repeat;
    position: relative;
}

.intro-right::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
}

.intro-info-card {
    position: relative;
    z-index: 2;
    max-width: 500px;
    width: 100%;
    text-align: left;
    padding: 3rem;
    background: rgba(10, 10, 15, 0.75);
    border: 1px solid rgba(255,215,0,0.4);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.intro-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(255,215,0,0.8) 0%, rgba(255,215,0,0) 100%);
    margin: 0.5rem 0;
}

#intro-card-title {
    color: #ffd700;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.3;
}

#intro-card-desc {
    color: #eee;
    font-size: 1.15rem;
    line-height: 1.8;
    font-weight: 300;
    min-height: 150px;
}

.intro-verse {
    font-family: 'Noto Serif KR', serif;
    font-style: italic;
    color: #e2c044;
    font-size: 1.1rem;
    background: rgba(255,215,0,0.05);
    padding: 1.5rem;
    border-left: 4px solid #ffd700;
    line-height: 1.6;
}

.btn-start-tour {
    margin-top: 1rem;
    background: transparent;
    border: 2px solid #ffd700;
    color: #ffd700;
    padding: 1.2rem 2.5rem;
    font-size: 1.3rem;
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.btn-start-tour:hover {
    background: #ffd700;
    color: #000;
    box-shadow: 0 0 20px rgba(255,215,0,0.6);
}

.btn-watch-video {
    margin-top: 1rem;
    background: transparent;
    border: 2px solid #ffffff;
    color: #ffffff;
    padding: 1.2rem 2.5rem;
    font-size: 1.3rem;
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-decoration: none;
}

.btn-watch-video .video-icon {
    font-size: 1rem;
}

.btn-watch-video:hover {
    background: #ffffff;
    color: #000;
    box-shadow: 0 0 20px rgba(255,255,255,0.6);
}

@media (max-width: 1100px) {
    .minimap-container {
        top: 2rem;
        left: 2rem;
        bottom: auto;
        width: 140px;
    }
    .btn-floating-prev {
        left: 2rem;
        bottom: 15rem; /* Safely above the info panel */
    }
    .btn-floating-home {
        right: 2rem;
        top: 2rem;
        bottom: auto;
    }
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .ui-container { padding: 1rem; }
    .glass { padding: 1.5rem; }
    .info-panel h2 { font-size: 1.5rem; }
    .info-panel p { font-size: 1rem; }
    .top-bar h1 { font-size: 1.2rem; }
    
    .minimap-container {
        top: 4.5rem;
        left: 1rem;
        width: 100px;
        padding: 0.8rem;
    }
    .minimap-title { font-size: 0.75rem; margin-bottom: 0.5rem; }
    
    .btn-floating-prev {
        left: auto;
        right: 1rem;
        top: 1rem;
        bottom: auto;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    .btn-floating-home {
        right: 1rem;
        top: 4rem;
        bottom: auto;
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .map-intro-scene {
        flex-direction: column;
        overflow-y: auto;
        padding-bottom: 3rem;
    }
    .intro-left {
        border-right: none;
        border-bottom: 1px solid rgba(255,215,0,0.2);
        padding: 2rem 1rem;
        flex: none;
        height: 60vh;
    }
    .intro-right {
        padding: 2rem 1rem;
        flex: none;
    }
    .intro-info-card {
        padding: 2rem;
    }
}

/* ==========================================
   First-person Viewer
   (마우스 시차 둘러보기 + 걸어 들어가기 전환 + 앰비언트 효과)
   ========================================== */
.viewer {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    background: #000;
}

.camera {
    position: absolute;
    inset: 0;
    perspective: 950px;
}

.scene-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.03);
    will-change: transform, opacity, filter;
    pointer-events: none;
}

.scene-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.18); /* 시차 패닝 여유분 */
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

#fx-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.look-hint {
    position: absolute;
    left: 50%;
    bottom: 17%;
    transform: translateX(-50%);
    z-index: 6;
    opacity: 0;
    transition: opacity 1.2s ease;
    pointer-events: none;
    font-family: 'Noto Serif KR', serif;
    font-size: 1rem;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 215, 0, 0.35);
    border-radius: 30px;
    padding: 0.6rem 1.5rem;
    backdrop-filter: blur(4px);
}

.look-hint.show { opacity: 1; }

/* --- Scene-space light FX (이미지와 함께 패닝됨) --- */
.fx-rays {
    position: absolute;
    display: none;
    width: 55vmin;
    height: 75vmin;
    transform: translate(-50%, -12%);
    background: linear-gradient(to bottom, rgba(255, 242, 205, 0.32), rgba(255, 242, 205, 0) 75%);
    clip-path: polygon(42% 0, 58% 0, 95% 100%, 5% 100%);
    filter: blur(7px);
    mix-blend-mode: screen;
    pointer-events: none;
    animation: raysPulse 8s ease-in-out infinite;
    z-index: 2;
}

.fx-flicker {
    position: absolute;
    display: none;
    --fl-color: 255, 190, 80;
    width: 40vmin;
    height: 40vmin;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(var(--fl-color), 0.32) 0%, rgba(var(--fl-color), 0) 68%);
    mix-blend-mode: screen;
    filter: blur(6px);
    pointer-events: none;
    animation: lampFlicker 2.1s linear infinite;
    z-index: 2;
}

.fx-glow {
    position: absolute;
    display: none;
    width: 55vmin;
    height: 55vmin;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 228, 150, 0.5) 0%, rgba(255, 210, 120, 0.18) 40%, rgba(255, 210, 120, 0) 70%);
    mix-blend-mode: screen;
    filter: blur(4px);
    pointer-events: none;
    animation: shekinahPulse 5.5s ease-in-out infinite;
    z-index: 2;
}

@keyframes raysPulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

@keyframes lampFlicker {
    0% { opacity: 0.78; } 9% { opacity: 0.92; } 18% { opacity: 0.7; }
    29% { opacity: 1; } 41% { opacity: 0.8; } 53% { opacity: 0.95; }
    64% { opacity: 0.72; } 78% { opacity: 0.9; } 89% { opacity: 0.8; }
    100% { opacity: 0.78; }
}

@keyframes shekinahPulse {
    0%, 100% { opacity: 0.65; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

/* 걸음걸이 흔들림 (전환 중 카메라 보브) */
@keyframes walkBob {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-9px); }
    60% { transform: translateY(3px); }
}

/* 전환 중 UI 숨김 */
.ui-container.ui-walking .info-panel,
.ui-container.ui-walking .hotspot-container,
.ui-container.ui-walking .btn-floating-prev,
.ui-container.ui-walking .btn-open,
.ui-container.ui-walking .btn-floating-home {
    opacity: 0 !important;
    pointer-events: none;
    transition: opacity 0.45s ease;
}

@media (prefers-reduced-motion: reduce) {
    .fx-rays, .fx-flicker, .fx-glow { animation: none; }
}

/* ==========================================
   2단계: 360° 파노라마 / 안내 모드 / 모바일 개선
   ========================================== */

/* 360° 파노라마 캔버스 (장면 레이어 내부) */
.pano-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 1;
}

.viewer.pano-mode { cursor: grab; }
.viewer.pano-mode.grabbing { cursor: grabbing; }

/* 안내 방식 토글 (텍스트 / 음성) */
.guide-toggle {
    display: inline-flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
    justify-content: center;
}

.guide-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #ddd;
    font-family: 'Noto Serif KR', serif;
    font-size: 0.85rem;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(4px);
}

.guide-btn:hover { border-color: #ffd700; color: #fff; }

.guide-btn.active {
    background: rgba(255, 215, 0, 0.85);
    color: #1a1a1a;
    border-color: #ffd700;
    font-weight: 700;
}

.guide-label { letter-spacing: 0.04em; }

/* 음성 안내 재생 중 표시 */
.guide-btn.speaking { animation: speakingPulse 1.2s ease-in-out infinite; }

@keyframes speakingPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.6); }
    50% { box-shadow: 0 0 0 8px rgba(255, 215, 0, 0); }
}

/* 모바일: 설명 패널이 화면을 덮지 않도록 콤팩트한 바텀시트로 */
@media (max-width: 768px) {
    .info-panel {
        max-height: 32vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .glass.info-panel { padding: 1rem 1.2rem; }
    .info-panel h2 { font-size: 1.15rem; margin-bottom: 0.4rem; }
    .info-panel p { font-size: 0.85rem; line-height: 1.55; }
    .artifact-btn { font-size: 0.85rem; padding: 0.7rem 0.9rem; }
    .artifact-desc { font-size: 0.8rem; }
    .artifact-verse { font-size: 0.78rem; }
    .hotspot-btn { font-size: 0.95rem; padding: 0.65rem 1.1rem; }
    .guide-btn { font-size: 0.78rem; padding: 0.3rem 0.7rem; }
    .look-hint { font-size: 0.82rem; bottom: 38%; width: max-content; max-width: 86vw; }
}

/* ==========================================
   인트로: 실사 조감 사진 + 핫스팟 핀
   ========================================== */
.intro-map-photo {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 215, 0, 0.25);
    animation: fadeIn 1.5s ease-out;
}

.intro-map-photo img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

/* 사진 가장자리를 어둡게 눌러 핀이 돋보이도록 */
.intro-map-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,0.45) 100%);
    pointer-events: none;
}

.photo-pin {
    position: absolute;
    transform: translate(-50%, -50%);
    background: none;
    border: none;
    padding: 12px;            /* 터치 영역 확보 */
    cursor: pointer;
    z-index: 3;
    fill: none;
    stroke: none;
}

.pin-dot {
    display: block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff3c0, #ffd700 60%, #b8860b);
    box-shadow: 0 0 6px 2px rgba(255, 215, 0, 0.7), 0 1px 3px rgba(0,0,0,0.8);
    animation: pinPulse 2.4s ease-in-out infinite;
}

@keyframes pinPulse {
    0%, 100% { box-shadow: 0 0 6px 2px rgba(255, 215, 0, 0.7), 0 1px 3px rgba(0,0,0,0.8); }
    50% { box-shadow: 0 0 14px 5px rgba(255, 215, 0, 0.45), 0 1px 3px rgba(0,0,0,0.8); }
}

.photo-pin:hover .pin-dot,
.photo-pin.active .pin-dot {
    background: radial-gradient(circle at 35% 35%, #ffffff, #ffe66e 55%, #d4af37);
    transform: scale(1.45);
    animation: none;
    box-shadow: 0 0 18px 7px rgba(255, 225, 90, 0.75), 0 1px 3px rgba(0,0,0,0.8);
}

.pin-label {
    position: absolute;
    bottom: calc(100% - 4px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    white-space: nowrap;
    font-family: 'Noto Serif KR', serif;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: #ffe9a0;
    background: rgba(10, 10, 14, 0.82);
    border: 1px solid rgba(255, 215, 0, 0.45);
    border-radius: 14px;
    padding: 0.18rem 0.6rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.photo-pin:hover .pin-label,
.photo-pin.active .pin-label {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.intro-map-credit {
    margin-top: 0.7rem;
    text-align: center;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .pin-label { font-size: 0.68rem; }
    .photo-pin { padding: 14px; }
    /* 핀 정렬이 어긋나지 않도록 사진은 항상 원본 비율 유지 */
    .intro-map-wrapper { max-width: 92vw; }
}

/* ==========================================
   장면 속 유물 핫스팟 + 설명 팝업 카드
   ========================================== */

/* UI 오버레이가 장면 클릭(핫스팟, 360° 드래그)을 막지 않도록 통과시키고
   실제 인터랙티브 요소만 클릭을 받게 함 */
.ui-container { pointer-events: none; }
.ui-container .top-bar,
.ui-container .hotspot-btn,
.ui-container .info-panel,
.ui-container .btn-open,
.ui-container .btn-floating-prev,
.ui-container .btn-floating-home { pointer-events: auto; }
.overlay-vignette { pointer-events: none; }

.spot-layer {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.scene-layer.live .spot-layer > * { pointer-events: auto; }

.viewer.is-walking .spot-layer { pointer-events: none; }
.viewer.is-walking .spot-layer > * { pointer-events: none; }

.artifact-spot {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spot-ring {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(255, 215, 0, 0.85);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5), inset 0 0 6px rgba(255, 215, 0, 0.3);
    animation: spotPing 2.2s ease-out infinite;
}

@keyframes spotPing {
    0% { transform: scale(0.8); opacity: 0.9; }
    70% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

.spot-core {
    position: relative;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(10, 10, 14, 0.75);
    border: 1.5px solid #ffd700;
    color: #ffd700;
    font-size: 15px;
    line-height: 19px;
    text-align: center;
    transition: all 0.25s ease;
    backdrop-filter: blur(2px);
}

.artifact-spot:hover .spot-core {
    background: #ffd700;
    color: #1a1a1a;
    transform: scale(1.2);
    box-shadow: 0 0 16px rgba(255, 225, 90, 0.8);
}

.spot-card {
    position: absolute;
    width: min(340px, 78vw);
    background: rgba(12, 12, 18, 0.92);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    z-index: 6;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
    cursor: default;
}

.spot-card h3 {
    font-family: 'Noto Serif KR', serif;
    color: #ffd700;
    font-size: 1.02rem;
    margin-bottom: 0.5rem;
    padding-right: 1.6rem;
}

.spot-card p {
    font-size: 0.84rem;
    line-height: 1.6;
    color: #ddd;
    margin-bottom: 0.6rem;
    max-height: 32vh;
    overflow-y: auto;
}

.spot-card-verse {
    font-style: italic;
    font-size: 0.78rem;
    color: #ffd700;
    opacity: 0.9;
    padding-left: 0.7rem;
    border-left: 2px solid rgba(255, 215, 0, 0.5);
}

.spot-card-close {
    position: absolute;
    top: 0.3rem;
    right: 0.6rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}

.spot-card-close:hover { color: #ffd700; }

@media (max-width: 768px) {
    .spot-card { width: min(300px, 84vw); }
    .spot-card p { font-size: 0.8rem; max-height: 26vh; }
}

/* 설명 패널이 장면을 덜 가리도록: 높이 제한 + 중앙 정렬 폭 제한 */
.info-panel {
    max-height: 32vh;
    overflow-y: auto;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}
