/* =============================================
   대동여지도 탐구 - Learn Pages Styles
   ============================================= */

/* Learn Page Layout */
.learn-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background-color: var(--color-background);
}

.learn-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: calc(56px + var(--safe-area-top));
}

/* =============================================
   Learn Tabs Navigation (1~5)
   ============================================= */
.learn-tabs {
    position: fixed;
    top: calc(56px + var(--safe-area-top));
    left: 0;
    right: 0;
    z-index: 15;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 32px;
    border-bottom: 1.5px solid var(--gold-primary);
    background: transparent;
    pointer-events: none;
}

.learn-page:has(.legend-section) .learn-tabs {
    background: var(--color-background);
}

.learn-tab {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 26px;
    border-radius: 6px 6px 0 0;
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.2s ease;
    background: var(--hanji-aged);
    border: 1.5px solid var(--gold-primary);
    border-bottom: none;
    color: var(--color-text-light);
    margin-bottom: -1.5px;
}

.learn-tab.active {
    height: 30px;
    font-size: 0.85rem;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.08);
    background: var(--color-primary);
    color: var(--color-background);
}

.learn-tab:not(.active):active {
    background: var(--hanji-cream);
    transform: scale(0.96);
}

/* =============================================
   Learn Question Bar (Pages 1~5 공통 상단 질문)
   ============================================= */
.learn-question-bar {
    padding: 10px 20px 8px;
    text-align: center;
}

.learn-question-bar .question-text {
    font-family: var(--font-primary);
    font-size: 1.0rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.learn-question-bar .question-desc {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin: 4px 0 0;
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 1.3;
}

.learn-question-bar .distance-route-buttons {
    margin-top: 8px;
}

.learn-question-bar .question-hint {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: #A89070;
    margin: 4px 0 0;
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 1.3;
}

/* Canvas Area for 3D/Animation */
.learn-canvas-area {
    flex: 1;
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.learn-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

/* Text Info Area */
.learn-info {
    padding: var(--spacing-lg);
    text-align: center;
    background-color: var(--color-white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.learn-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

.learn-description {
    font-size: 1rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

.learn-step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

/* 도트: 기본 = 완료(금색) */
.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--gold-primary);
    border: 2px solid var(--gold-primary);
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* 도트 간 연결선 */
.step-dot + .step-dot {
    margin-left: 20px;
}

.step-dot + .step-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    width: 24px;
    height: 2px;
    background-color: var(--gold-primary);
    transform: translateY(-50%);
    z-index: -1;
    transition: background-color 0.3s ease;
}

/* 활성 도트: 단청 빨간색 + 금테두리 + 글로우 */
.step-dot.active {
    background-color: var(--dancheong-red);
    border-color: var(--gold-primary);
    box-shadow: 0 0 8px rgba(199, 62, 58, 0.4);
}

/* 미래 도트 (활성 이후): 회색 */
.step-dot.active ~ .step-dot {
    background-color: #ddd;
    border-color: #ddd;
}

/* 미래 연결선: 회색 */
.step-dot.active ~ .step-dot::before {
    background-color: #ddd;
}

/* Navigation Buttons */
.learn-nav {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    padding-bottom: calc(var(--spacing-lg) + var(--safe-area-bottom));
    background-color: var(--color-white);
}

.learn-nav-btn {
    flex: 1;
    padding: 2px 20px;
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 800;
    border-radius: var(--radius-md);
    text-align: center;
    text-decoration: none;
    transition: all var(--transition-fast);
}

/* 이전 버튼 - 한지 솔리드 스타일 */
.learn-nav-btn.prev {
    background: var(--hanji-aged);
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-family: var(--font-primary);
    font-weight: 800;
}

/* 다음 버튼 - 갈색 솔리드 스타일 */
.learn-nav-btn.next {
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    color: var(--color-background);
    font-family: var(--font-primary);
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: none;
}

.learn-nav-btn:hover,
.learn-nav-btn:focus {
    transform: translateY(-1px);
}

.learn-nav-btn.prev:hover {
    background: #d9ccb5;
    border-color: #6d3610;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.learn-nav-btn.next:hover {
    background: #6d3610;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.learn-nav-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* =============================================
   Common Bottom Panel (drag to collapse/expand)
   ============================================= */
.learn-bottom-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--hanji-cream);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(0);
    transition: transform 0.3s ease, opacity 0.3s ease;
    touch-action: none;
    padding-bottom: var(--safe-area-bottom);
}

.learn-bottom-panel.panel-hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.learn-bottom-panel.collapsed {
    transform: translateY(calc(100% - 24px));
}

.panel-drag-handle {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0;
    cursor: grab;
}

.panel-drag-handle:active {
    cursor: grabbing;
}

.drag-bar {
    width: 40px;
    height: 4px;
    background: #999;
    border-radius: 2px;
}

.panel-content {
    padding: 0 16px 8px;
    text-align: center;
}

.panel-title {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-light);
    line-height: 1.4;
    margin-bottom: 4px;
    word-break: keep-all;
}

html[lang="en"] .panel-title {
    font-size: 1.05rem;
}

.panel-description {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    color: var(--color-text-light);
    line-height: 1.5;
    margin-bottom: 16px;
    word-break: keep-all;
}

.panel-nav {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0 var(--spacing-sm);
}

.panel-nav .learn-nav-btn {
    flex: 1;
    padding: 2px 20px;
    font-size: 1.25rem;
    font-weight: normal;
    border-radius: var(--radius-md);
    text-align: center;
    text-decoration: none;
    transition: all var(--transition-fast);
}

/* Woodblock Page Specific */
.woodblock-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.woodblock-item {
    position: absolute;
    width: 80px;
    height: 120px;
    background-color: #5C4033;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    transition: transform 0.5s ease;
}

.woodblock-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* Paper Animation */
.paper-sheet {
    position: absolute;
    width: 200px;
    height: 280px;
    background-color: #FFF8E7;
    border: 1px solid #E0D5C0;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(-50px);
}

.paper-sheet.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease;
}

/* Touch Prompt */
.touch-prompt {
    position: fixed;
    top: 30%;
    left: 0;
    right: 0;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, var(--hanji-cream) 0%, var(--hanji-aged) 100%);
    padding: 12px 24px;
    border-radius: 24px;
    border: 1.5px solid var(--gold-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 0 12px rgba(201, 162, 39, 0.15);
}

.touch-prompt-compact {
    padding: 8px 24px;
    top: 30%;
}

.touch-prompt-icon {
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto var(--spacing-sm);
    animation: touchPrompt 1.5s ease-in-out infinite;
    color: #333;
}

.touch-prompt-text {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
}

.touch-prompt .tool-note {
    font-size: 0.65rem;
    font-weight: 400;
    opacity: 0.75;
    white-space: normal;
}

/* Rubbing Tool Image */
.rubbing-tool {
    position: fixed;
    width: 80px;
    height: auto;
    pointer-events: none;
    z-index: 10;
    left: 50%;
    top: 65%;
    transform: translate(-50%, -100%);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}
.rubbing-tool.hidden { display: none; }

/* Animation Progress Bar */
.animation-progress {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    max-width: 250px;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.animation-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #C73E3A, #D4A853);
    border-radius: 3px;
    transition: width 0.2s ease-out;
}

.animation-progress.hidden {
    display: none;
}

/* Grid Overlay (Woodblock Step 3) */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: rgba(0, 0, 0, 0.85);
}

.grid-overlay.hidden {
    display: none;
}

.grid-overlay-map {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.grid-overlay-cells {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.grid-cell {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-sizing: border-box;
    transition: opacity 0.3s ease;
}

.grid-cell.surviving {
    border: 2px solid #FF8C00;
    background: rgba(255, 140, 0, 0.25);
    animation: survivingPulse 2s ease-in-out infinite;
}

@keyframes survivingPulse {
    0%, 100% { background: rgba(255, 140, 0, 0.2); }
    50% { background: rgba(255, 140, 0, 0.35); }
}

/* Map Info Page - 22첩 Display */
.map-sections-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    width: 100%;
    overflow-y: auto;
}

.map-section-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
    max-width: 320px;
    padding: var(--spacing-md);
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.4s ease;
}

.map-section-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.map-section-thumb {
    width: 60px;
    height: 80px;
    background-color: var(--color-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.map-section-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-section-info {
    flex: 1;
}

.map-section-number {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
}

.map-section-name {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

/* Full Map Page */
.full-map-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.full-map-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
}

/* Doseongdo 3D Page - Full Screen Layout */
.learn-page:has(.doseongdo-container) .learn-content {
    padding-top: 0;
}

.learn-page:has(.doseongdo-container) .learn-canvas-area {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 100vh;
    min-height: 100dvh;
    z-index: 1;
}

.doseongdo-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.doseongdo-canvas {
    width: 100%;
    height: 100%;
    background-color: #E8DCC8;  /* 한지색 - 로딩 전 배경 */
}

.doseongdo-controls {
    position: absolute;
    top: calc(60px + var(--safe-area-top));
    right: var(--spacing-md);
    display: flex;
    gap: var(--spacing-sm);
    z-index: 5;
}

#woodblock-reset-controls {
    top: 12px;
}

/* 도성도 컨트롤 버튼 - 전통 아이콘 스타일 */
.doseongdo-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hanji-cream) 0%, var(--hanji-aged) 100%);
    border: 2px solid var(--gold-primary);
    border-radius: 50%;
    font-size: 0.875rem;
    box-shadow:
        inset 0 0 0 3px var(--hanji-cream),
        inset 0 0 0 5px var(--dancheong-red),
        0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all var(--transition-fast);
}

.doseongdo-btn:hover,
.doseongdo-btn:focus {
    box-shadow:
        inset 0 0 0 3px var(--hanji-cream),
        inset 0 0 0 5px var(--dancheong-red),
        0 6px 16px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(201, 162, 39, 0.3);
    transform: translateY(-2px);
}

.doseongdo-btn svg {
    width: 20px;
    height: 20px;
    color: var(--gold-primary);
    stroke: var(--gold-primary);
}

.doseongdo-btn:hover svg {
    color: var(--dancheong-red);
    stroke: var(--dancheong-red);
}

/* Explore Button (on doseongdo page) */
.explore-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    background-color: var(--color-accent);
    color: var(--color-white);
    font-weight: 600;
    border-radius: var(--radius-lg);
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}

.explore-btn:hover,
.explore-btn:focus {
    background-color: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-2px);
}

/* =============================================
   Plates Page - 현존 목판 표시
   ============================================= */

/* Viewport */
.plates-viewport {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0;
    background: transparent;
    overflow-x: hidden;
    overflow-y: auto;
}

.plates-transform {
    position: relative;
    display: inline-block;
    max-width: 96%;
}

.plates-map-image {
    display: block;
    max-width: 100%;
    min-height: 500px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.plates-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Grid Cells */
.plates-cell {
    position: absolute;
    background: #faebd7;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.plates-cell.surviving {
    pointer-events: auto;
    z-index: 2;
}

.plates-cell.surviving.active {
    border: none;
    background-color: transparent;
    background-size: cover;
    background-position: center;
    animation: platesPulse 2s ease-in-out infinite;
}

.plates-cell.surviving.touchable {
    border: 1.5px solid rgba(201, 162, 39, 0.6);
    animation: platesTouchHint 2s ease-in-out infinite;
}

@keyframes platesTouchHint {
    0%, 100% {
        box-shadow: 0 0 4px rgba(201, 162, 39, 0.2), inset 0 0 3px rgba(201, 162, 39, 0.1);
        border-color: rgba(201, 162, 39, 0.3);
    }
    50% {
        box-shadow: 0 0 10px rgba(201, 162, 39, 0.5), inset 0 0 6px rgba(201, 162, 39, 0.2);
        border-color: rgba(201, 162, 39, 0.7);
    }
}

.plates-cell.surviving.selected {
    border: none;
    background: transparent;
    animation: none;
    box-shadow: none;
}

/* 터치 영역 확장 (작은 셀 대응) */
.plates-cell.surviving::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
}

@keyframes platesPulse {
    0%, 100% { background: rgba(30, 25, 20, 0.4); }
    50% { background: rgba(30, 25, 20, 0.6); }
}

/* Badge (face marker number) */
.plates-cell-badge {
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 8px;
    background: linear-gradient(135deg, #C73E3A 0%, #A83232 100%);
    border: 1.5px solid #D4A853;
    color: #fff;
    font-size: 0.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), 0 0 6px rgba(199, 62, 58, 0.2);
    position: absolute;
    z-index: 5;
}

/* Multi-badge positioning within cell.
   Uses margin negative offset instead of translate(-50%,-50%) so GSAP
   scale animation does not override the centering. translateZ(10px) lifts
   the badge above the flip card's preserve-3d stacking context. */
.plates-cell .plates-cell-badge:only-child {
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    transform: none;
}

.plates-cell .plates-cell-badge:first-child:not(:only-child) {
    top: 50%;
    left: 30%;
    margin-top: -8px;
    margin-left: -8px;
    transform: none;
}

.plates-cell .plates-cell-badge:last-child:not(:only-child) {
    top: 50%;
    left: 70%;
    margin-top: -8px;
    margin-left: -8px;
    transform: none;
}

/* Badge explored state */
.plates-cell-badge.explored {
    background: linear-gradient(135deg, #D4A853 0%, #C9A227 100%);
    border-color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), 0 0 8px rgba(201, 162, 39, 0.4);
}

/* Counter Overlay */
.plates-counter {
    position: absolute;
    top: 42%;
    right: 16px;
    transform: translateY(-50%);
    display: flex;
    align-items: baseline;
    gap: 4px;
    z-index: 15;
    pointer-events: none;
}

.plates-counter.hidden {
    display: none;
}

.plates-counter-number {
    font-family: var(--font-primary);
    font-size: 4rem;
    font-weight: 800;
    color: #D4A853;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 30px rgba(212, 168, 83, 0.3);
    line-height: 1;
}

.plates-counter-unit {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 800;
    color: #D4A853;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Detail Card (bottom slide-up) */
.plates-detail-card {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background: linear-gradient(180deg, #F7F2E4 0%, #EDE0CC 100%);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    padding-bottom: var(--safe-area-bottom);
    transform: translateY(100%);
}

.plates-detail-card.hidden {
    display: none;
}

.detail-drag-handle {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0 4px;
    cursor: grab;
}

.detail-drag-handle:active {
    cursor: grabbing;
}

.detail-content {
    padding: 0 24px 20px;
    text-align: center;
}

.detail-plate-badge {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #C73E3A 0%, #A83232 100%);
    border: 3px solid #D4A853;
    color: #fff;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.3),
        0 2px 8px rgba(199, 62, 58, 0.3);
}

.detail-title {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 700;
    color: #2C1810;
    margin-bottom: 12px;
}

.detail-subtitle {
    font-family: var(--font-primary);
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin: 0 0 16px;
    line-height: 1.4;
}

.detail-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.detail-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--gold-primary);
    background: linear-gradient(135deg, var(--hanji-cream) 0%, var(--hanji-aged) 100%);
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow:
        inset 0 0 0 2px var(--hanji-cream),
        inset 0 0 0 3.5px var(--dancheong-red),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.detail-nav-btn:active {
    background: linear-gradient(135deg, var(--dancheong-red), #A83232);
    color: #fff;
    border-color: var(--gold-primary);
}

.detail-nav-count {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: #5C4033;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}


/* =============================================
   Unfold Map Page - 22첩 인터랙티브 펼치기
   ============================================= */

.unfold-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background: var(--color-paper, #F5E6D3);
}

/* Preload image - hidden */
.unfold-preload-image {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* Title Area - 공통 .learn-question-bar 사용 (unfold-container 밖으로 이동) */
html[lang="en"] .learn-question-bar .question-hint-ko {
    display: none;
}

/* Strips Container */
.unfold-strips {
    position: absolute;
    left: 0;
    right: 0;
    overflow: hidden;
}

/* Individual Strip */
.unfold-strip {
    position: absolute;
    left: 0;
    right: 0;
    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Map Layer (background image, hidden initially) */
.unfold-strip-map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    opacity: 0;
}

/* Cover Layer (hanji texture that slides away) */
.unfold-strip-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #EDE0CC 0%, #E0D2BC 50%, #D8C9B0 100%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 16px;
    z-index: 2;
    will-change: transform;
}

/* Cheop number label on cover */
.unfold-strip-label {
    display: none;
}

/* Click-active strip (gold glow pulse) */
.unfold-strip.click-active .unfold-strip-cover {
    box-shadow: inset 0 0 0 2px rgba(201, 162, 39, 0.6);
    animation: cheopClickPulse 1.5s ease-in-out infinite;
}

/* Subtle glow for upcoming manual strips */
.unfold-strip.click-prompt .unfold-strip-cover {
    box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.25);
}

@keyframes cheopClickPulse {
    0%, 100% {
        box-shadow: inset 0 0 0 2px rgba(201, 162, 39, 0.4);
        background: linear-gradient(135deg, #EDE0CC 0%, #E0D2BC 50%, #D8C9B0 100%);
    }
    50% {
        box-shadow: inset 0 0 0 2px rgba(201, 162, 39, 0.9), 0 0 12px rgba(201, 162, 39, 0.3);
        background: linear-gradient(135deg, #F2E8D6 0%, #EAD9C0 50%, #E0D0B8 100%);
    }
}

/* Click Hint (floating touch icon) */
.unfold-click-prompt {
    position: absolute;
    left: 50%;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 6px;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, var(--hanji-cream) 0%, var(--hanji-aged) 100%);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--gold-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 0 12px rgba(201, 162, 39, 0.15);
    cursor: pointer;
}

.unfold-click-prompt.hidden {
    display: none;
}

.unfold-click-icon {
    width: 22px;
    height: 22px;
    color: #C9A227;
    animation: touchPromptBounce 1.2s ease-in-out infinite;
}

.unfold-click-text {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
}

@keyframes touchPromptBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Column 컨테이너 - 3D perspective 부모 */
.unfold-strip-columns {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    perspective: 800px;
}

/* 개별 column - 초기 접힌 상태 */
.unfold-col {
    position: absolute;
    top: 0; height: 100%;
    background-repeat: no-repeat;
    transform-origin: right center;
    transform: rotateY(-90deg);
    backface-visibility: hidden;
    will-change: transform;
}

/* Responsive */
@media (min-width: 768px) {
    .learn-info {
        padding: var(--spacing-xl);
    }

    .learn-title {
        font-size: 1.75rem;
    }

    .map-sections-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .map-section-item {
        width: calc(50% - var(--spacing-md));
    }
}

/* Landscape adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .learn-content {
        flex-direction: row;
    }

    .learn-canvas-area {
        flex: 1;
    }

    .learn-info {
        width: 40%;
        max-width: 300px;
        border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    }
}

/* =============================================
   Distance Page - 거리 표시
   ============================================= */

.distance-viewport {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.distance-map-wrapper {
    position: relative;
    transform-origin: 0 0;
    will-change: transform;
}

.distance-map-crop {
    position: relative;
    overflow: visible;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.distance-map-image {
    display: block;
    border-radius: 4px;
}

.distance-svg-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.distance-svg-overlay .location-marker {
    pointer-events: auto;
    cursor: pointer;
}

.distance-route-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 12px;
}

.distance-route-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--gold-primary);
    background: linear-gradient(135deg, var(--hanji-cream), var(--hanji-aged));
    color: var(--color-text);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.distance-route-btn.active {
    background: linear-gradient(135deg, var(--dancheong-red), #A83232);
    color: #fff;
    box-shadow: 0 0 12px rgba(199, 62, 58, 0.4);
}

.distance-route-btn.dimmed {
    opacity: 0.5;
}

.distance-result {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: #5A4510;
    padding: 8px 18px;
    border-radius: 12px;
    border: 2px solid #C9A227;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    z-index: 10;
    font-family: var(--font-primary);
    font-weight: 800;
    white-space: nowrap;
}

.distance-result-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.distance-result.hidden {
    display: none;
}

.distance-result-dots,
.distance-result-ri {
    color: #FFD700;
    font-size: 1.1rem;
}

.distance-result-eq {
    color: rgba(255, 235, 180, 0.7);
    font-size: 0.95rem;
}

.distance-result-km {
    color: rgba(255, 235, 180, 0.7);
    font-size: 0.85rem;
}


.distance-popup {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--gold-primary);
    max-width: 240px;
    z-index: 15;
    pointer-events: none;
}

.distance-popup-title {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 800;
    color: var(--dancheong-red);
    margin-bottom: 4px;
}

.distance-popup-desc {
    font-family: var(--font-primary);
    font-size: 0.7rem;
    color: var(--color-text-light);
    line-height: 1.4;
}

/* =============================================
   Map Legend Page - 지도표 보기
   ============================================= */

/* Section containers */
.legend-section,
.finder-section {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.legend-section.hidden,
.finder-section.hidden {
    display: none;
}

/* Section 1: Legend Title Bar */
.legend-title-bar {
    padding: 12px 16px 8px;
    padding-top: calc(96px + var(--safe-area-top) + 12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-background);
    flex-shrink: 0;
}

.legend-title {
    font-family: var(--font-primary);
    font-size: 1.0rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 2px;
    word-break: keep-all;
}

.legend-subtitle {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: #A89070;
    margin: 0;
    word-break: keep-all;
}

/* Section 1: Accordion Symbol List */
.legend-symbol-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px 120px;
}

.symbol-row {
    border-bottom: 1px solid rgba(201, 162, 39, 0.25);
}

.symbol-row:last-child {
    border-bottom: none;
}

.symbol-row-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s ease;
}

.symbol-row.expanded .symbol-row-header {
    background: rgba(201, 162, 39, 0.08);
}

.symbol-row-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1.5px solid var(--gold-primary);
    background: var(--hanji-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.symbol-row-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.symbol-row-name {
    flex: 1;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 800;
    color: #2C1810;
    line-height: 1.3;
}

.symbol-row-name .hanja {
    font-weight: 400;
    color: #8B7355;
}

.symbol-row-name .en-name {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--gold-dark, #8B6914);
    font-style: italic;
    font-family: var(--font-primary);
}

.symbol-row-chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--gold-primary);
    transition: transform 0.3s ease;
}

.symbol-row.expanded .symbol-row-chevron {
    transform: rotate(180deg);
}

.symbol-row-detail {
    height: 0;
    overflow: hidden;
}

.symbol-row-detail-inner {
    padding: 0 8px 12px 64px;
}

.symbol-detail-desc {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: var(--color-text-light);
    line-height: 1.5;
    margin: 0;
}

/* ---- Map Legend Gamification ---- */

/* Progress Counter Badge */
.legend-progress {
    display: flex;
    align-items: baseline;
    gap: 2px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 2px solid var(--gold-primary);
    background: linear-gradient(135deg, var(--hanji-cream), var(--hanji-aged));
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.legend-progress-number {
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gold-primary);
    display: inline-block;
}

.legend-progress-total {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 800;
    color: #8B7355;
}

.legend-progress.complete {
    background: linear-gradient(135deg, var(--dancheong-red), #A83232);
    border-color: var(--gold-primary);
}

.legend-progress.complete .legend-progress-number,
.legend-progress.complete .legend-progress-total {
    color: #fff;
}

/* Undiscovered state — grayscale + dim */
.symbol-row:not(.discovered) .symbol-row-icon {
    filter: grayscale(1);
    opacity: 0.5;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.symbol-row:not(.discovered) .hanja,
.symbol-row:not(.discovered) .en-name {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.symbol-row:not(.discovered) .symbol-row-chevron {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

/* "?" undiscovered hint overlay */
.symbol-undiscovered-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--gold-primary);
    background: rgba(245, 230, 211, 0.6);
    border-radius: 6px;
    pointer-events: none;
}

.symbol-row.discovered .symbol-undiscovered-hint {
    display: none;
}

/* Check badge — top-right of icon */
.symbol-discovered-check {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4CAF50;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.symbol-discovered-check.hidden {
    display: none;
}

/* Shimmer animation for celebration */
@keyframes legendCheckShimmer {
    0% { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 0 12px rgba(201, 162, 39, 0.8), 0 0 20px rgba(201, 162, 39, 0.4); }
    100% { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
}

.symbol-discovered-check.shimmer {
    animation: legendCheckShimmer 0.6s ease-in-out;
}

/* Discovered state — color restored */
.symbol-row.discovered .symbol-row-icon {
    filter: none;
    opacity: 1;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.symbol-row.discovered .hanja,
.symbol-row.discovered .en-name {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.symbol-row.discovered .symbol-row-chevron {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* icon needs position:relative for check badge */
.symbol-row-icon {
    position: relative;
}


/* Section 2: Finder Title Bar */
.finder-title-bar {
    padding: 12px 16px 8px;
    text-align: center;
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.95) 0%, rgba(26, 26, 26, 0) 100%);
    z-index: 5;
    flex-shrink: 0;
}

.finder-title {
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Section 2: Finder Viewport */
.finder-viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
    touch-action: none;
    background: #F5E6D3;
    --magnifier-x: 60%;
    --magnifier-y: 60%;
}

.finder-viewport::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--magnifier-x) var(--magnifier-y), transparent 14%, rgba(0,0,0,0.5) 36%, rgba(0,0,0,0.85) 65%);
    -webkit-backdrop-filter: grayscale(1);
    backdrop-filter: grayscale(1);
    -webkit-mask-image: radial-gradient(circle at var(--magnifier-x) var(--magnifier-y), transparent 14%, black 36%);
    mask-image: radial-gradient(circle at var(--magnifier-x) var(--magnifier-y), transparent 14%, black 36%);
    pointer-events: none;
    z-index: 4;
    transition: opacity 1.5s ease;
}

.finder-viewport.all-found::after {
    opacity: 0;
}

.finder-map-wrapper {
    position: relative;
    display: inline-flex;
    transform-origin: 0 0;
    will-change: transform;
}

.finder-map-gray {
    display: flex;
    transition: filter 1.5s ease;
}

.finder-map-color {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    clip-path: circle(0px at 0px 0px);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.finder-map-img {
    display: block;
    width: 100%;
    height: auto;
    flex-shrink: 0;
}

.finder-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.firefly-hint-group { pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
    .firefly-hint-group { display: none; }
}

.shimmer-dot-group { pointer-events: none; }
.shimmer-dot {
    fill: rgba(139, 69, 19, 0.25);
    opacity: 0.3;
    animation: shimmerBreath 3s ease-in-out infinite;
}
@keyframes shimmerBreath {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.7; }
}
@media (prefers-reduced-motion: reduce) {
    .shimmer-dot { animation: none; opacity: 0.3; }
}

.finder-magnifier-ring {
    position: absolute;
    pointer-events: none;
    top: 60%;
    left: 60%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 130px;
    height: auto;
    will-change: left, top;
}

/* Section 2: Checklist Bar (top) */
.finder-checklist {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    overflow-x: hidden;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 2px solid var(--gold-primary);
    padding: 8px 12px;
    gap: 4px;
    flex-shrink: 0;
}

.finder-checklist-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    flex: 1;
    flex-shrink: 1;
    padding: 4px 6px;
    border-radius: 8px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    position: relative;
}

.finder-checklist-item.found {
    opacity: 1;
}

.checklist-icon {
    position: relative;
    margin-bottom: 2px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checklist-label {
    font-family: var(--font-primary);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--color-text);
    text-align: center;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.checklist-check {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.checklist-check img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.checklist-check.hidden {
    display: none;
}

/* Finder Summary Close Button */
.finder-summary-content {
    position: relative;
}

.finder-summary-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    font-size: 1.4rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* =============================================
   Doseongdo Landmark Popup
   ============================================= */

.landmark-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 25;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.landmark-popup-overlay.active {
    opacity: 1;
}

.landmark-popup-overlay.hidden {
    display: none;
}

.landmark-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background: linear-gradient(180deg, #F7F2E4 0%, #EDE0CC 100%);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    padding-bottom: var(--safe-area-bottom);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.landmark-popup.active {
    transform: translateY(0);
}

.landmark-popup.hidden {
    display: none;
}

.landmark-popup-handle {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0 4px;
}

.landmark-popup-content {
    padding: 0 24px 24px;
    text-align: center;
}

.landmark-popup-type {
    display: inline-block;
    padding: 2px 14px;
    border-radius: 12px;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.landmark-popup-type.type-mountain {
    background: #294042;
    color: #A0CA9D;
    border: 1px solid #A0CA9D;
}

.landmark-popup-type.type-gate {
    background: #6B3A2A;
    color: #E8C9A0;
    border: 1px solid #8B5E3C;
}

.landmark-popup-type.type-palace {
    background: #453E2B;
    color: #CBBA9E;
    border: 1px solid #8B6914;
}

.landmark-popup-title {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    font-weight: 800;
    color: #2C1810;
    margin: 0 0 12px;
}

.landmark-popup-desc {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    color: var(--color-text-light);
    line-height: 1.7;
    margin: 0;
    text-align: left;
}

/* =============================================
   Question Overlays (Woodblock, Plates) - 공통 .learn-question-bar 사용
   ============================================= */

/* =============================================
   Legend Image Viewer + Hotspots
   ============================================= */
.legend-image-viewer {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 80px;
}
.legend-image-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}
.legend-full-image {
    max-width: 100%;
    width: auto;
    display: block;
    object-fit: contain;
}
.legend-hotspots {
    position: absolute;
}
/* Chart section below hotspots */
.legend-chart-section {
    width: 100%;
    padding: 0 0 24px;
    box-sizing: border-box;
}
.legend-chart-divider {
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
    margin: 24px auto 20px;
}
.legend-chart-title {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 12px;
}
.legend-chart-image {
    width: 100%;
    display: block;
    border-radius: 8px;
}
/* ── Hotspot keyframes ── */
@keyframes hotspotBreathGlow {
    0%, 100% {
        border-color: rgba(201, 162, 39, 0.12);
        box-shadow: inset 0 0 4px rgba(201, 162, 39, 0.05), 0 0 3px rgba(201, 162, 39, 0);
    }
    50% {
        border-color: rgba(201, 162, 39, 0.55);
        box-shadow: inset 0 0 8px rgba(201, 162, 39, 0.15), 0 0 8px rgba(201, 162, 39, 0.2);
    }
}
@keyframes hotspotCornerSweep {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 0.9; }
}
/* ── Hotspot base ── */
.legend-hotspot {
    position: absolute;
    cursor: pointer;
    border: 2px solid rgba(201, 162, 39, 0.15);
    box-sizing: border-box;
    transition: border-color 0.3s, background 0.3s;
    animation: hotspotBreathGlow 2.5s ease-in-out infinite;
    animation-delay: var(--stagger-delay, 0s);
}
/* Corner brackets (::before) */
.legend-hotspot::before {
    content: '';
    position: absolute;
    inset: -1px;
    pointer-events: none;
    background:
        /* top-left corner */
        linear-gradient(to right, rgba(201,162,39,0.8), rgba(201,162,39,0.8)) 0 0 / 8px 2px no-repeat,
        linear-gradient(to bottom, rgba(201,162,39,0.8), rgba(201,162,39,0.8)) 0 0 / 2px 8px no-repeat,
        /* top-right corner */
        linear-gradient(to left, rgba(201,162,39,0.8), rgba(201,162,39,0.8)) 100% 0 / 8px 2px no-repeat,
        linear-gradient(to bottom, rgba(201,162,39,0.8), rgba(201,162,39,0.8)) 100% 0 / 2px 8px no-repeat,
        /* bottom-left corner */
        linear-gradient(to right, rgba(201,162,39,0.8), rgba(201,162,39,0.8)) 0 100% / 8px 2px no-repeat,
        linear-gradient(to top, rgba(201,162,39,0.8), rgba(201,162,39,0.8)) 0 100% / 2px 8px no-repeat,
        /* bottom-right corner */
        linear-gradient(to left, rgba(201,162,39,0.8), rgba(201,162,39,0.8)) 100% 100% / 8px 2px no-repeat,
        linear-gradient(to top, rgba(201,162,39,0.8), rgba(201,162,39,0.8)) 100% 100% / 2px 8px no-repeat;
    animation: hotspotCornerSweep 2.5s ease-in-out infinite;
    animation-delay: var(--stagger-delay, 0s);
}
.legend-hotspot:active {
    background: rgba(201, 162, 39, 0.15);
    border-color: rgba(201, 162, 39, 0.5);
}

/* Discovered state — stop animations */
.legend-hotspot.discovered {
    border: 2px solid var(--gold-primary);
    background: rgba(201, 162, 39, 0.1);
    animation: none;
}
.legend-hotspot.discovered::before {
    opacity: 0.6;
    animation: none;
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .legend-hotspot,
    .legend-hotspot::before {
        animation: none;
    }
    .legend-hotspot {
        border-color: rgba(201, 162, 39, 0.35);
    }
    .legend-hotspot::before {
        opacity: 0.6;
    }
}
.legend-tooltip {
    position: absolute;
    right: 8px;
    transform: translateY(-50%);
    background: rgba(90, 69, 16, 0.95);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    z-index: 20;
    max-width: 240px;
    pointer-events: none;
    transition: opacity 0.3s;
}
.legend-tooltip.hidden { opacity: 0; pointer-events: none; }
.legend-tooltip-name { font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.legend-tooltip-name img { width: 80px; height: 80px; object-fit: contain; flex-shrink: 0; }
.legend-tooltip-desc { font-size: 0.85rem; opacity: 0.9; white-space: pre-line; }

/* =============================================
   3D 페이지 제스처 가이드 오버레이
   ============================================= */
.gesture-guide {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: flex; flex-direction: column;
    align-items: center; gap: 8px;
    pointer-events: none;
    z-index: 10;
    animation: gestureFloat 2s ease-in-out infinite;
}
.gesture-guide-text {
    font-size: 13px; color: var(--color-primary);
    background: rgba(245,230,211,0.9);
    padding: 4px 12px; border-radius: 12px;
    border: 1px solid var(--gold-primary);
}
@keyframes gestureFloat {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -55%) scale(1.05); }
}

/* 숨은기호찾기 상단 안내 텍스트 */
.finder-guide-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 11;
    text-align: center;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    pointer-events: none;
}

/* 숨은기호찾기 터치 가이드 */
.finder-touch-guide {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: flex; flex-direction: column;
    align-items: center; gap: 8px;
    pointer-events: none;
    z-index: 10;
    animation: gestureFloat 2s ease-in-out infinite;
}
.finder-touch-guide-text {
    font-size: 13px; color: var(--color-primary);
    background: rgba(245,230,211,0.9);
    padding: 4px 12px; border-radius: 12px;
    border: 1px solid var(--gold-primary);
}
