/* ==========================================
   3D 인스펙터 룸 모달 (Popup Modal)
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(8px);
    display: none; /* 평소에는 완전히 걷어내어 마우스 호버 이벤트를 차단하지 않도록 함 */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    width: 90%;
    max-width: 1100px;
    height: 85vh;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

/* 모달 닫기 버튼 */
.modal-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1010;
    transition: color 0.3s ease;
}
.modal-close-btn:hover {
    color: var(--primary-color);
}

/* ==========================================
   좌측 영역: 3D 뷰어 존 (40%)
   ========================================== */
.viewer-zone {
    width: 40%;
    height: 100%;
    position: relative;
    border-right: 1px solid var(--card-border);
    background: radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.05) 0%, transparent 80%);
}

model-viewer {
    width: 100%;
    height: 100%;
    display: block;
    background-color: transparent;
}

/* 3D 로딩 안내 슬롯 */
.viewer-loading-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    z-index: 2;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(212, 175, 55, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.viewer-loading-placeholder p {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    color: var(--primary-color);
}

/* ==========================================
   구글 model-viewer 핫스팟 (Hotspot) 스타일
   ========================================== */
.hotspot-pin {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
}

/* 반짝이는 파동 효과 */
.hotspot-pin::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    opacity: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.6);
        opacity: 1;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.hotspot-pin:hover {
    transform: scale(1.2);
}

/* 핫스팟 설명 팝오버 툴팁 */
.hotspot-tooltip {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid var(--primary-color);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    width: 220px;
    font-size: 0.8rem;
    color: var(--text-color);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    line-height: 1.4;
    z-index: 10;
}

.hotspot-pin:hover .hotspot-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: 35px;
}

/* ==========================================
   우측 영역: 콘텐츠 존 (60%)
   ========================================== */
.content-zone {
    width: 60%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
    overflow-y: auto;
}

.inspector-header {
    margin-bottom: 2rem;
}

.inspector-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.inspector-header .inspector-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* 탭 네비게이션 */
.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 2rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-glow);
}

/* 탭 패널 내용 */
.tab-content {
    flex-grow: 1;
    line-height: 1.7;
    font-size: 0.95rem;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.tab-panel.active {
    display: block;
}

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

/* 에피소드 탭 스페셜 디자인 */
.episode-card {
    background: rgba(13, 17, 23, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* TTS 도슨트 재생기 바 */
.docent-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.1);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.docent-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary-color);
}

.docent-btn {
    background: var(--primary-color);
    color: var(--bg-color);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.docent-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* 유물 정보 탭 디자인 */
.artifact-detail-box {
    display: flex;
    gap: 1.5rem;
    background: rgba(13, 17, 23, 0.4);
    border: 1px solid var(--card-border);
    padding: 1.5rem;
    border-radius: 8px;
}

.artifact-detail-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.5rem;
}

.artifact-detail-info h4 {
    color: var(--primary-color);
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.artifact-detail-info p {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

/* 계보 탭 디자인 */
.relations-box {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.relation-item {
    display: flex;
    background: rgba(13, 17, 23, 0.3);
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.relation-label {
    width: 100px;
    font-weight: 600;
    color: var(--primary-color);
}

/* ==========================================
   반응형 모바일 미디어 쿼리 (인스펙터)
   ========================================== */
@media (max-width: 820px) {
    .modal-container {
        flex-direction: column;
        height: 90vh;
    }
    .viewer-zone {
        width: 100%;
        height: 40%;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
    }
    .content-zone {
        width: 100%;
        height: 60%;
        padding: 1.5rem;
    }
    .artifact-detail-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* ==========================================
   신규 확장 콘텐츠 스타일 (3단계 고도화)
   ========================================== */

/* 오디오 플레이어 슬라이더 및 재생바 */
.audio-progress-container {
    flex-grow: 1;
    margin: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.audio-time-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 40px;
    text-align: center;
}
.audio-progress-bar {
    flex-grow: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}
.audio-progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    border-radius: 2px;
    position: absolute;
    top: 0;
    left: 0;
    transition: width 0.1s linear;
}

/* 능력치 스탯 보드 */
.stats-board {
    background: rgba(13, 17, 23, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.stats-board h4 {
    color: var(--primary-color);
    font-size: 1.05rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.stat-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
}
.stat-row:last-child {
    margin-bottom: 0;
}
.stat-label {
    width: 120px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.stat-gauge-bg {
    flex-grow: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 1rem;
}
.stat-gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.5) 0%, var(--primary-color) 100%);
    width: 0%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.1, 0.8, 0.3, 1);
}
.stat-value {
    width: 30px;
    text-align: right;
    font-weight: bold;
    color: var(--primary-color);
}

/* 수호 동식물 */
.sacred-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.sacred-item {
    background: rgba(13, 17, 23, 0.3);
    border: 1px solid var(--card-border);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.sacred-item span:first-child {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.sacred-item span:last-child {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* 트리비아 박스 */
.trivia-box {
    background: rgba(212, 175, 55, 0.03);
    border: 1px dashed rgba(212, 175, 55, 0.2);
    padding: 1.25rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    position: relative;
}
.trivia-box::before {
    content: '💡 신화 트리비아';
    display: block;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0.5rem;
}
.trivia-box p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
}

/* 명화 카드 뷰어 */
.masterpiece-box {
    margin-top: 1.5rem;
    background: rgba(13, 17, 23, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
}
.masterpiece-img-container {
    width: 100%;
    height: 240px; /* 명화를 좀 더 시원하게 볼 수 있도록 높이 확장 */
    background: #000;
    position: relative;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
}
.masterpiece-img-container.grabbing {
    cursor: grabbing;
}
.masterpiece-img {
    width: 100%;
    height: auto;
    min-height: 100%;
    display: block;
    object-fit: cover;
    opacity: 0.85;
    pointer-events: none; /* 드래그 오동작 완벽 차단 */
    transition: opacity 0.3s ease;
}
.masterpiece-info {
    padding: 1.25rem;
    border-top: 1px solid var(--card-border);
}
.masterpiece-title {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}
.masterpiece-artist {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.masterpiece-desc {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-color);
}

/* 라이벌 및 동맹 워프 링크 */
.relations-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}
.warp-link-card {
    background: rgba(13, 17, 23, 0.4);
    border: 1px solid var(--card-border);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.warp-link-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
    transform: translateY(-2px);
}
.warp-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.warp-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.warp-name {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--primary-color);
}
.warp-arrow {
    color: var(--primary-color);
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}
.warp-link-card:hover .warp-arrow {
    transform: translateX(3px);
}

@media (max-width: 600px) {
    .sacred-box, .relations-links {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   3D 인스펙터 모달 3단 반응형 최적화
   ========================================== */

/* 태블릿 이하 (1024px 이하) */
@media (max-width: 1024px) {
    .modal-container {
        width: 94%;
        height: 88vh;
    }
    .viewer-zone {
        width: 35%;
    }
    .content-zone {
        width: 65%;
        padding: 2rem;
    }
}

/* 모바일 전용 수직 1열 전환 (768px 이하) */
@media (max-width: 768px) {
    .modal-container {
        flex-direction: column; /* 수직 1열 배치 */
        width: 96%;
        height: 90vh;
        overflow-y: auto; /* 모달 내부 전체 스크롤 */
    }

    /* 상단: 3D 뷰어 영역 */
    .viewer-zone {
        width: 100%;
        height: 260px; /* 높이 고정 축소 */
        border-right: none;
        border-bottom: 1px solid var(--card-border);
        flex-shrink: 0;
    }

    /* 하단: 텍스트 정보 영역 */
    .content-zone {
        width: 100%;
        height: auto;
        overflow-y: visible;
        padding: 1.5rem 1.2rem;
    }

    .modal-close-btn {
        top: 0.75rem;
        right: 0.75rem;
        font-size: 1.6rem;
    }

    .inspector-header h2 {
        font-size: 1.5rem;
    }
    
    .inspector-header p.inspector-subtitle {
        font-size: 0.85rem;
    }

    .tab-nav {
        margin-bottom: 1.25rem;
        overflow-x: auto; /* 모바일 전용 탭 수평 스크롤 허용 */
        white-space: nowrap;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .tab-nav::-webkit-scrollbar {
        display: none; /* 스크롤바 바 숨김 */
    }

    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    /* 스탯바 모바일 1열 전환 */
    .stats-container {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* 유물 카드 모바일 1열 전환 */
    .artifact-details-box {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .artifact-image-container {
        max-width: 130px;
        margin: 0 auto;
    }

    /* 명화 모바일 1열 전환 */
    .masterpiece-card {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .masterpiece-img-box {
        max-height: 180px;
    }

    /* 관계도 클릭 바로가기 카드 모바일 2열 정렬 */
    .warp-cards-group {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.6rem !important;
    }
    
    .warp-link-card {
        padding: 0.5rem 0.75rem !important;
    }
    
    .warp-name {
        font-size: 0.85rem !important;
    }
}

/* ==========================================
   ☀️ 아폴론 낮 테마 (Light Theme) 인스펙터 시인성 최적화 패치
   ========================================== */
body.theme-apollon .relation-item {
    background: rgba(255, 255, 255, 0.75) !important;
    border: 1px solid rgba(212, 175, 55, 0.25) !important;
    border-left: 4px solid #d4af37 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    color: #1f2937 !important;
}

body.theme-apollon .relation-item span.relation-label {
    color: #b8860b !important;
}

body.theme-apollon .warp-link-card {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    color: #1f2937 !important;
}

body.theme-apollon .warp-link-card:hover {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: #d4af37 !important;
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.15) !important;
}

body.theme-apollon .warp-role {
    color: #6b7280 !important;
}

body.theme-apollon .warp-name {
    color: #b8860b !important;
}

body.theme-apollon .episode-card {
    background: rgba(255, 255, 255, 0.65) !important;
    border: 1px solid rgba(212, 175, 55, 0.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    color: #1f2937 !important;
}

body.theme-apollon .stats-board {
    background: rgba(255, 255, 255, 0.65) !important;
    border: 1px solid rgba(212, 175, 55, 0.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    color: #1f2937 !important;
}

body.theme-apollon .stat-gauge-bg {
    background: rgba(0, 0, 0, 0.06) !important;
}

body.theme-apollon .sacred-item {
    background: rgba(255, 255, 255, 0.65) !important;
    border: 1px solid rgba(212, 175, 55, 0.18) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

body.theme-apollon .sacred-item span:last-child {
    color: #b8860b !important;
}

body.theme-apollon .masterpiece-box {
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(212, 175, 55, 0.2) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

body.theme-apollon .masterpiece-info {
    border-top: 1px solid rgba(212, 175, 55, 0.15) !important;
}

body.theme-apollon .masterpiece-title {
    color: #b8860b !important;
}

body.theme-apollon .masterpiece-desc {
    color: #2b303a !important;
}

body.theme-apollon .trivia-box {
    background: rgba(212, 175, 55, 0.05) !important;
    border: 1px dashed rgba(212, 175, 55, 0.3) !important;
}

body.theme-apollon .trivia-box p {
    color: #212529 !important;
}

body.theme-apollon .artifact-detail-box {
    background: rgba(255, 255, 255, 0.75) !important;
    border: 1px solid rgba(212, 175, 55, 0.25) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    color: #1f2937 !important;
}

body.theme-apollon .artifact-detail-img {
    background: rgba(0, 0, 0, 0.04) !important;
    border: 1px solid rgba(212, 175, 55, 0.15) !important;
}

body.theme-apollon .artifact-detail-info h4 {
    color: #b8860b !important;
}

body.theme-apollon .artifact-detail-info p {
    color: #2b303a !important;
}

body.theme-apollon .artifact-detail-info strong {
    color: #1f2937 !important;
}

/* ==========================================
   🔗 관계 설명글(.relation-desc-text) 레이아웃 및 테마별 시인성 패치
   ========================================== */
.relation-desc-text {
    font-size: 0.76rem;
    line-height: 1.45;
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
    color: #cbd5e1; /* 밤 테마: 부드럽고 가독성 높은 연한 청회색 */
    word-break: keep-all;
    text-align: left;
}

/* ☀️ 아폴론 낮 테마 상태에서의 시인성 오버라이딩 */
body.theme-apollon .relation-desc-text {
    border-top-color: rgba(212, 175, 55, 0.18) !important;
    color: #4b5563 !important; /* 낮 테마: 명도 대비가 우수한 진한 차콜색 */
}

body.theme-apollon .warp-link-card {
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(212, 175, 55, 0.22) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

body.theme-apollon .warp-name {
    color: #1f2937 !important; /* 낮 테마: 이름의 시인성을 블랙차콜로 고정 */
}

body.theme-apollon .warp-role {
    color: #b8860b !important;
}

/* ==========================================
   🌌 천공의 성좌(Constellation) 3D Flip 카드 및 레이아웃 시스템
   ========================================== */
.constellation-tab-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .constellation-tab-wrapper {
        grid-template-columns: 1fr;
    }
}

/* 3D 플립 카드 뷰포트 컨테이너 */
.constellation-card-container {
    width: 100%;
    height: 340px;
    perspective: 1000px; /* 3D 원근 효과 활성화 */
    cursor: pointer;
}

/* 실제 3D 회전하는 카드 바디 */
.constellation-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

/* flipped 클래스 토글 시 Y축 180도 정역 플립 회전 (클릭 시마다 무한 반복 동작 보장) */
.constellation-card.flipped {
    transform: rotateY(180deg);
}

/* 앞면과 뒷면 공통 스타일링 */
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* 뒷면은 보이지 않게 처리해 겹침 방지 */
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 앞면 (실시간 Canvas 성도) */
.card-front {
    background: #040914;
    transform: rotateY(0deg); /* 기본 위치 */
}

/* 뒷면 (모험가의 신화 일러스트) */
.card-back {
    background: #090e1a;
    transform: rotateY(180deg); /* 뒤집힌 상태로 대기 */
}

/* 실시간 2D Canvas 및 일러스트 크기 꽉 채우기 */
.constellation-star-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.constellation-illus-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.constellation-card-container:hover .constellation-illus-img {
    transform: scale(1.04);
}

/* 힌트 뱃지 (아티팩트 느낌 연출) */
.card-hint-badge {
    position: absolute;
    bottom: 12px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.72rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    pointer-events: none;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* 우측 정보판 레이아웃 */
.constellation-info-panel {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.constellation-title {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-family: var(--font-heading);
    border-bottom: 2px solid rgba(212, 175, 55, 0.25);
    padding-bottom: 0.5rem;
    margin: 0;
}

.constellation-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.meta-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.meta-val {
    font-size: 0.82rem;
    color: #fff;
    font-weight: 600;
}

.constellation-story-box {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--accent-color);
    padding: 0.85rem 1.1rem;
    border-radius: 4px 12px 12px 4px;
}

.constellation-story-box h5 {
    margin: 0 0 0.5rem 0;
    color: var(--accent-color);
    font-size: 0.85rem;
    font-family: var(--font-heading);
}

.constellation-story-box p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #cbd5e1;
    word-break: keep-all;
}

.constellation-others-box {
    font-size: 0.76rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    padding-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.others-label {
    color: var(--text-muted);
}

.others-val {
    color: #93c5fd;
    font-weight: 500;
}

/* ☀️ 아폴론 낮 테마 상태에서의 시인성 오버라이딩 패치 */
body.theme-apollon .constellation-title {
    border-bottom-color: rgba(212, 175, 55, 0.35) !important;
}

body.theme-apollon .meta-item {
    background: rgba(255, 255, 255, 0.65) !important;
    border: 1px solid rgba(212, 175, 55, 0.15) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

body.theme-apollon .meta-val {
    color: #1f2937 !important; /* 짙은 차콜색 */
}

body.theme-apollon .meta-label {
    color: #6b7280 !important;
}

body.theme-apollon .constellation-story-box {
    background: rgba(255, 255, 255, 0.6) !important;
    border-left-color: #b8860b !important; /* 골드 칼라 지배자 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

body.theme-apollon .constellation-story-box h5 {
    color: #b8860b !important;
}

body.theme-apollon .constellation-story-box p {
    color: #2b303a !important; /* 가독성을 위한 최강의 차콜색 */
}

body.theme-apollon .constellation-others-box {
    border-top-color: rgba(212, 175, 55, 0.15) !important;
}

body.theme-apollon .others-val {
    color: #b8860b !important;
}

body.theme-apollon .card-front {
    border-color: rgba(212, 175, 55, 0.22) !important;
}

body.theme-apollon .card-back {
    border-color: rgba(212, 175, 55, 0.22) !important;
}
