/* 기본 설정 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f7f5f4; /* 따뜻한 중앙 배경색 */
    color: #333;
    font-family: 'Pretendard', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    padding-bottom: 50px;
}

/* 폰트 */
h1, h2, h3, .tab-btn {
    font-family: 'GmarketSansMedium', sans-serif;
}
.story-title {
    font-family: 'GmarketSansBold', sans-serif;
}

/* 배경 이미지 배치 */
.bg-decoration-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px; /* 배경 높이 축소 유지 */
    background: url('images/bg_top.webp') no-repeat center top;
    background-size: cover;
    z-index: -1;
    opacity: 0.8;
}

.bg-decoration-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px; /* 배경 높이 축소 유지 */
    background: url('images/bg_bottom.webp') no-repeat center bottom;
    background-size: cover;
    z-index: -1;
    opacity: 0.8;
}

/* 네비게이션 */
.nav-tabs {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    background: rgba(247, 245, 244, 0.85);
    backdrop-filter: blur(10px);
    z-index: 100;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tab-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 15px;
    transition: 0.3s;
}

.tab-btn.active {
    color: #FF69B4;
    border-bottom: 3px solid #FF69B4;
    font-weight: bold;
}

/* 탭 컨텐츠 */
.tab-content {
    display: none;
    padding: 20px;
    min-height: 80vh;
    animation: fadeIn 0.5s;
}
.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- STORY 탭 --- */
.story-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    text-align: center;
}

.logo-wrapper {
    margin-bottom: 10px;
    width: 100%;
    display: flex;
    justify-content: center;
}
.main-logo {
    max-width: 80%;
    width: 250px;
    height: auto;
    display: block;
}

.story-title {
    font-size: 3.5rem;
    color: #FF69B4;
    text-shadow: 
        2px 2px 0 #fff, 
        -2px -2px 0 #fff, 
        2px -2px 0 #fff, 
        -2px 2px 0 #fff, 
        4px 4px 0 rgba(0,0,0,0.1);
    margin-bottom: 20px;
    margin-top: -10px;
    letter-spacing: -2px;
}

.story-card {
    background: #fff;
    width: 100%;
    max-width: 500px;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    transform: rotate(-1deg);
    line-height: 1.8;
}

.pin {
    width: 15px;
    height: 15px;
    background: #e74c3c;
    border-radius: 50%;
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

.intro-date { font-size: 0.95rem; color: #666; margin-bottom: 20px; }
.highlight-text { color: #FF69B4; font-weight: bold; }

.dialogue-box {
    background: #fff0f6;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    border: 1px dashed #FF69B4;
}
.quote { font-size: 1.1rem; font-weight: bold; color: #d63384; margin-bottom: 5px; }

.main-desc { font-size: 1rem; margin-bottom: 20px; }
.main-desc strong { color: #333; font-size: 1.1rem; background: linear-gradient(to top, #fffd7e 40%, transparent 40%); }

.highlight-box {
    margin: 20px 0;
    padding: 15px;
    border-left: 4px solid #FFD700;
    background: #fafafa;
    text-align: left;
}
.highlight-box p { margin: 5px 0; }
.highlight-box strong { font-size: 1.1rem; }

.outro { font-size: 1rem; margin-top: 30px; font-weight: bold; }
.genre-text { color: #FF69B4; }

/* 캐릭터 리스트 */
.character-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.char-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
}
.char-card:active { transform: scale(0.98); }

.char-card img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
}

.char-info { padding: 12px; text-align: center; }
.char-info h3 { font-size: 1rem; color: #333; margin-bottom: 4px; }

.tag.growth {
    font-size: 0.7rem;
    color: #fff;
    background-color: #FF69B4;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

.footer-spacer { height: 80px; }

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.close-btn {
    color: #333;
    float: right;
    font-size: 28px;
    cursor: pointer;
}

#modalTitle { color: #333; margin-bottom: 5px; }
#modalDesc { color: #666; margin-bottom: 20px; font-size: 0.95rem; }

/* --- [수정됨] 갤러리 스크롤 physics --- */
.gallery-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 0;
    scroll-snap-type: x mandatory; /* 스냅 활성화 */
    -webkit-overflow-scrolling: touch; /* iOS 부드러운 스크롤 */
}

.gallery-item {
    min-width: 100%; /* 한 화면에 하나씩 */
    scroll-snap-align: center; /* 중앙 정렬 */
    scroll-snap-stop: always;  /* ★핵심: 가속도가 붙어도 무조건 한 장씩 멈춤★ */
    position: relative;
}

.gallery-item img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: block;
}

/* 블러 처리 */
.blur-wrapper {
    position: relative;
    cursor: pointer;
    width: 100%;
}
.blur-wrapper img { filter: blur(20px); transition: filter 0.5s; }

.lock-overlay {
    color: #fff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    text-align: center;
}
.lock-icon { font-size: 3rem; display: block; margin-bottom: 5px; }

.unlocked img { filter: blur(0) !important; }
.unlocked .lock-overlay { display: none; }