/* 🌟 [던전앤파이터 비트비트체] 웹폰트 등록 */
@font-face {
    font-family: 'DNFBitBitv2';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2112@1.0/DNFBitBitv2.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* 🌟 [갈무리 폰트] 웹폰트 등록 (RPG 픽셀 감성용) */
@import url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2301@1.0/Galmuri9.woff2');

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

/* 🌟 기본 폰트는 모두 '고운바탕'으로 설정 */
body, html, button, input, textarea, span, div, h1, h2, h3, p {
    font-family: 'Gowun Batang', serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* 🌟 포인트 폰트(던파 비트비트체)를 적용할 특정 클래스 생성 */
.font-dnf {
    font-family: 'DNFBitBitv2', sans-serif !important;
}

/* 🌟 [추가] "황혼의 경계가 열리기까지" 전용 갈무리 픽셀 폰트 클래스 */
.rpg-countdown {
    font-family: 'SchoolSafetyStarrySky', sans-serif !important;
}

/* 🌟 [수정] 모바일 끊김 현상 방지를 위해 html/body 배경색 통일 및 바운스 고정 */
body, html {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background-color: #0d0d15; /* 가장 어두운 테마 배경색으로 완전 고정 */
    color: #f0f0f0;
    overscroll-behavior-y: none; /* 아이폰/안드로이드 당김 바운스 시 빈틈 노출 방지 */
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh; /* 모바일 주소창 높이 변화 완벽 대응 */
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    height: 100dvh; /* 모바일 화면 끊김 방지 */
    max-height: 900px;
    background: linear-gradient(135deg, #181829 0%, #0d0d15 100%);
    position: relative;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-behavior: smooth;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    border-radius: 20px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.app-container::-webkit-scrollbar {
    display: none;
    width: 0px;
    background: transparent;
}

@media (max-width: 480px) {
    .app-container {
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
    }
}

section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh; /* 섹션 간 배경 끊김 방지 */
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: block;
    flex-shrink: 0;
    background-color: #0d0d15; /* 페이지 전환 시 배경 빈틈 방지 */
}

.hero-section {
    background: #0d0d15;
}

.poster-container {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: #0d0d15;
}

.main-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.second-page-section {
    position: relative;
    width: 100%;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh;
    min-height: 100dvh;
    background: #0d0d15;
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
}

.constellation-container {
    position: relative;
    width: 100%;
    max-width: 430px;
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    overflow: hidden;
}

.constellation-bg, 
.constellation-bg-overlay {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.constellation-draw-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 0 100% 0);
    -webkit-clip-path: inset(0 0 100% 0);
    pointer-events: none;
    will-change: clip-path;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* 모든 버튼, 링크, 그리고 클릭 가능한 요소에서 기본 파란색 터치 박스 제거 */
button, a, .invisible-star-spot, .tab-btn {
    -webkit-tap-highlight-color: transparent; 
    outline: none; 
}

.invisible-star-spot {
    position: absolute;
    width: 45px;
    height: 45px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.1s ease, box-shadow 0.1s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.invisible-star-spot:active {
    transform: translate(-50%, -50%) scale(0.85) !important;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 20px 8px rgba(222, 194, 238, 0.7);
}

.star-timetable   { top: 31.5%; left: 10.5%; }
.star-map         { top: 50.0%; left: 76.5%; }
.star-goods       { top: 53.5%; left: 86.5%; }
.star-booth       { top: 58.5%; left: 89.0%; }
.star-food        { top: 64.0%; left: 83.5%; }
.star-performance { top: 74.5%; left: 64.5%; }
.star-timecapsule { top: 87.5%; left: 67.0%; }

.festival-live-section {
    background-image: url('images/Today.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 60px 16px 50px 16px !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 16px;
    border-top: 1px solid rgba(222, 194, 238, 0.2);
}

.live-header {
    text-align: center;
    margin-bottom: 5px;
}

.live-badge {
    display: inline-block;
    background: rgba(222, 194, 238, 0.15);
    color: #efd4ff;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 14px;
    letter-spacing: 1px;
}

.live-header h2 {
    font-size: 1.2rem;
    color: #fff;
    letter-spacing: 0.5px;
    margin-bottom: 15px !important;
}

.live-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(222, 194, 238, 0.25);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 410px;
    margin: 0 auto;
}

.card-label {
    display: block;
    font-size: 0.9rem;
    color: #efd4ff;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.artist-name-highlight {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.artist-photo-box {
    width: 100%;
    height: 180px !important;
    overflow: hidden;
    border-radius: 8px;
}

.artist-photo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.daily-schedule-card {
    display: flex;
    align-items: center; 
    justify-content: center; 
    gap: 30px; 
    padding: 10px 0; 
    margin-bottom: 10px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.date-box {
    font-family: 'Gowun Batang', serif !important; 
    font-weight: 700; 
    font-size: 3.5rem; 
    color: #ffffff; 
    line-height: 1;
    text-shadow: 
        0 0 10px rgba(245, 228, 255, 0.8), 
        0 0 20px rgba(245, 228, 255, 0.5), 
        0 0 35px rgba(222, 194, 238, 0.4); 
    flex-shrink: 0; 
    transform: translateY(-30px); 
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 12px; 
}

.schedule-item {
    display: flex;
    gap: 12px; 
    align-items: flex-start;
}

.s-time {
    color: #ffffff; 
    font-size: 0.95rem;
    font-weight: bold;
    white-space: nowrap; 
    width: 110px; 
    flex-shrink: 0; 
    text-shadow: none; 
}

.s-desc {
    color: #ffffff; 
    font-size: 0.95rem;
    word-break: keep-all; 
    line-height: 1.4;
    flex-grow: 1; 
    text-align: left; 
    text-shadow: none; 
}

.timetable-content-area {
    font-size: 0.85rem;
    color: #ddd;
    line-height: 1.4;
}
.timetable-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.timetable-row:last-child {
    border-bottom: none;
}
.t-time {
    color: #DEC2EE;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}
.t-desc {
    color: #2d2534;
    font-weight: 500;
    flex-grow: 1;
    text-align: right;
    word-break: keep-all;
    line-height: 1.4;
}

.festival-last-section {
    background-image: url('images/Last.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

.scroll-star-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    z-index: 10;
    animation: bounce 1.8s infinite ease-in-out;
    transition: transform 0.15s ease;
    text-decoration: none;
}

.scroll-star-indicator:active {
    transform: translateX(-50%) scale(0.85);
}

.festival-live-section .scroll-star-indicator {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin: 30px auto 10px auto;
    animation: bounce-top 1.8s infinite ease-in-out;
}

.star-icon {
    font-size: 1.3rem;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 2px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.9));
}

.star-text {
    font-size: 0.65rem;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 2px;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    text-transform: uppercase;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateX(-50%) translateY(0);}
    40% {transform: translateX(-50%) translateY(-6px);}
    60% {transform: translateX(-50%) translateY(-3px);}
}

@keyframes bounce-top {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-5px);}
    60% {transform: translateY(-2px);}
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 20, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.popup-card {
    width: 88%;
    max-width: 380px;
    max-height: 85vh;
    background: linear-gradient(135deg, #ffffff 100%, #151525 0%);
    border: 1px solid rgba(222, 194, 238, 0.4);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.popup-overlay.active .popup-card {
    transform: scale(1);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    flex-shrink: 0;
}

.popup-title {
    font-size: 1.15rem;
    color: #c8a3dd;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.popup-close-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, transform 0.15s;
}

.popup-close-btn:active {
    transform: scale(0.8);
    color: #dec2ee;
}

.popup-body {
    font-size: 0.95rem;
    color: #514857;
    line-height: 1.6;
    overflow-y: auto;
    max-height: 65vh;
    padding-right: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.popup-body::-webkit-scrollbar {
    display: none;
}

.pagination-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 15px;
    padding-bottom: 10px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%; 
    background: rgba(164, 118, 196, 0.2); 
    transition: all 0.3s ease; 
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.dot.active {
    background: #a476c4; 
    width: 20px; 
    border-radius: 10px; 
}

.timetable-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(222, 194, 238, 0.2);
    color: #aaa;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

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

.tab-btn.active {
    background: rgba(222, 194, 238, 0.2);
    color: #514857;
    border-color: #dec2ee;
}

.tab-content {
    display: none;
}

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

@media screen and (min-width: 768px) {
    body {
        background-color: #0d0d15;
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        min-height: 100dvh;
        margin: 0;
    }

    .app-container {
        width: 100%;
        max-width: 430px;
        height: 100vh;
        height: 100dvh;
        max-height: 932px;
        overflow-y: auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
        position: relative;
        margin: 0;
        border-radius: 20px;
    }
}