/* 기본 리셋 및 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* HTML과 body 스크롤 허용 - 가장 높은 우선순위 */
html {
    height: auto !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

html, body {
    scroll-behavior: smooth !important;
}

/* JavaScript에서 설정하는 높이 무시 */
html[style*="height"],
body[style*="height"] {
    height: auto !important;
}

/* 뷰포트 변경 시 실시간 반응형 레이아웃 */
@media screen {
    .container,
    .modal-content,
    .settings-modal-content,
    .story-content,
    .game-menu {
        transition: all 0.2s ease !important;
    }
    
    /* 뷰포트 크기 변경 시 재계산 */
    .modal,
    .settings-modal,
    .save-modal,
    .load-modal {
        width: 100vw !important;
        height: 100vh !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
    }
    
    /* 모든 텍스트 및 UI 요소들이 뷰포트 변경에 즉시 반응 */
    * {
        box-sizing: border-box !important;
    }
    
    /* 뷰포트 단위 사용으로 실시간 반응 */
    .page,
    main,
    section {
        min-height: 100vh;
        width: 100vw;
        max-width: 100vw;
    }
    
    /* 즉시 반응하는 반응형 그리드 */
    .theme-grid,
    .save-slots,
    .load-slots {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
        gap: 15px !important;
        width: 100% !important;
    }
}

/* CSS 변수로 테마 관리 */
:root {
    --bg-color: #0a0a0a;
    --text-color: #f0f0f0;
    --secondary-bg: #1a1a1a;
    --border-color: #333;
    --accent-color: #d4af37;
    --term-color: #4a9eff;
    --term-hover-color: #6bb0ff;
    --vh: 1vh; /* 동적 뷰포트 높이 (JavaScript에서 업데이트) */
}

/* 라이트 테마 */
body.light-theme {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --secondary-bg: #f5f5f5;
    --border-color: #ddd;
    --accent-color: #FFA500;
    --term-color: #0066cc;
    --term-hover-color: #0052a3;
}

/* 라이트 테마에서도 버튼은 어두운 배경 유지 */
body.light-theme .theme-btn,
body.light-theme .font-btn,
/* 라이트 테마에서 메뉴 토글 */
body.light-theme .menu-toggle {
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .menu-toggle .menu-icon {
    color: rgba(0, 0, 0, 0.7) !important;
}

body.light-theme .menu-btn {
    background-color: rgba(60, 60, 65, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #FFFFFF;
}

body.light-theme .size-icon {
    color: #FFD700 !important;  /* 금색 유지 */
    font-weight: 900;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

body.light-theme .menu-icon {
    color: #FFFFFF;
    font-weight: 900;
}

body.light-theme .game-menu {
    background-color: rgba(245, 245, 245, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 세피아 테마 */
body.sepia-theme {
    --bg-color: #f4f1e8;
    --text-color: #5c4b37;
    --secondary-bg: #ebe5d6;
    --border-color: #d4c4a8;
    --accent-color: #8B6835;
    --term-color: #2a5ca6;
    --term-hover-color: #1e4382;
}

/* 세피아 테마에서도 버튼은 어두운 배경 유지 */
body.sepia-theme .theme-btn,
body.sepia-theme .font-btn,
/* 세피아 테마에서 메뉴 토글 */
body.sepia-theme .menu-toggle {
    background: rgba(235, 229, 214, 0.9) !important;
    box-shadow: 0 2px 8px rgba(92, 75, 55, 0.1) !important;
}

body.sepia-theme .menu-toggle .menu-icon {
    color: rgba(92, 75, 55, 0.8) !important;
}

body.sepia-theme .menu-btn {
    background-color: rgba(74, 60, 40, 0.85);
    border: 1px solid rgba(107, 93, 79, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    color: #FFFFFF;
}

body.sepia-theme .size-icon {
    color: #FFD700 !important;  /* 금색 유지 */
    font-weight: 900;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

body.sepia-theme .menu-icon {
    color: #FFFFFF;
    font-weight: 900;
}

body.sepia-theme .game-menu {
    background-color: rgba(235, 229, 214, 0.9);
    border: 1px solid rgba(92, 75, 55, 0.2);
    box-shadow: 0 4px 12px rgba(92, 75, 55, 0.2);
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    overflow-x: hidden;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    transition: background-color 0.3s, color 0.3s;
    font-size: 16px;
}

/* 모달이 열렸을 때 배경 스크롤 방지 */
body.modal-open {
    overflow: hidden;
    /* position과 width 제거 - 스크롤 위치 완전 유지 */
}

/* 챕터3 특별 처리 - 배경색과 글자색 확실히 적용 */
#chapter3,
#chapter3 .story-content,
#chapter3Content,
.chapter3-section-content {
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
}

/* 모바일 기본 폰트 크기 증가 및 터치 최적화 - iOS & Android */
@media (max-width: 768px) {
    /* 안드로이드 & iOS 터치 최적화 */
    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }
    
    body {
        font-size: 17px; /* 약간 작게 조정 */
        line-height: 1.8;
        /* 터치 스크롤 개선 - 안드로이드 WebView 포함 */
        -webkit-overflow-scrolling: touch;
        /* 텍스트 크기 자동 조정 방지 - 안드로이드 브라우저 */
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* 모든 버튼 터치 타겟 최소 44px - 안드로이드 권장 사항 */
    button, .btn-primary, .btn-secondary, a.button, .choice-btn, .main-choice-btn, .menu-btn {
        min-height: 44px;
        touch-action: manipulation; /* 더블탭 줌 방지 */
        min-width: 44px;
        touch-action: manipulation;
        /* 터치 지연 제거 */
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
}

.container {
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    /* 모바일에서 가로 스크롤 방지 */
    overflow-x: hidden;
}

/* 컨테이너 반응형 크기 조정 */
@media (max-width: 768px) {
    .container {
        max-width: 95% !important;
        padding: 15px 20px !important;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .container {
        max-width: 900px !important;
        padding: 25px 40px !important;
    }
}

@media (min-width: 1201px) {
    .container {
        max-width: 1200px !important;
        padding: 30px 60px !important;
    }
}

/* 태블릿 반응형 */
@media (max-width: 1024px) {
    .container {
        padding: 20px; /* 30px에서 축소 */
        max-width: 95%; /* 90%에서 확대 */
        width: 100%;
    }
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px; /* 적절한 좌우 패딩 */
        max-width: 100%;
        overflow-x: hidden; /* 가로 스크롤 방지 */
        min-height: 100vh; /* 최소 높이 설정 */
        width: 100%;
        padding-bottom: 150px; /* 하단 메뉴 공간 */
    }
    
    /* 모바일에서 story-section 패딩 조정 */
    .story-section {
        padding: 15px 10px; /* 패딩 축소 */
        margin-bottom: 15px;
        border-radius: 8px;
        box-sizing: border-box;
        width: 100%;
    }
    
    /* 모바일에서 텍스트 콘텐츠 최적화 */
    .text-content {
        padding: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .text-content p {
        font-size: 0.95em; /* 약간 작게 */
        line-height: 1.7;
        margin-bottom: 1em;
        padding: 0 5px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* 페이지 전환 */
.page {
    display: none !important;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.page.active {
    display: block !important;
    opacity: 1;
}

/* 폭발 효과 */
.explosion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 0, 0, 0);
    pointer-events: none;
    z-index: 9999;
    animation: none;
}

.explosion-overlay.active {
    animation: explosion-flash 2s ease-out;
}

@keyframes explosion-flash {
    0% {
        background-color: rgba(255, 0, 0, 0);
    }
    10% {
        background-color: rgba(255, 0, 0, 0.8);
    }
    20% {
        background-color: rgba(255, 0, 0, 0.6);
    }
    30% {
        background-color: rgba(255, 0, 0, 0.7);
    }
    40% {
        background-color: rgba(255, 0, 0, 0.4);
    }
    50% {
        background-color: rgba(255, 0, 0, 0.5);
    }
    60% {
        background-color: rgba(255, 0, 0, 0.3);
    }
    100% {
        background-color: rgba(255, 0, 0, 0);
    }
}

/* 화면 흔들림 효과 */
.shake {
    animation: shake 0.5s;
}

/* 전화벨 텍스트 흔들림 효과 */
.phone-ring-trigger {
    display: inline-block;
    animation: ring-shake 0.2s ease-in-out;
    animation-iteration-count: 8; /* 2번 울림 x 4번 진동 = 8번 */
    color: #ff0000;
    font-weight: bold;
    font-size: 1.2em;
}

@keyframes ring-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px) rotate(-1deg); }
    75% { transform: translateX(3px) rotate(1deg); }
}

/* 철학 보고서 개선된 스타일 - 메인 페이지와 일관성 */
.report-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.report-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.03) 0%, transparent 70%);
    border-radius: 20px;
    position: relative;
}

.report-header::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent-color), #FFA500, var(--accent-color));
    border-radius: 20px;
    opacity: 0.3;
    z-index: -1;
    animation: pulse 3s ease-in-out infinite;
}

.report-title {
    font-size: 3rem;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.report-subtitle {
    font-size: 1.1rem;
    color: #b0b0b0;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.report-main-content {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.philosopher-section {
    flex: 1;
    text-align: center;
    padding: 30px;
    background: var(--secondary-bg);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    /* 균형잡힌 레이아웃 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
}

.philosopher-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.philosopher-section:hover::before {
    opacity: 1;
}

.philosopher-image {
    width: 180px;
    height: 180px;
    margin: 0 auto 25px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid transparent;
    background: linear-gradient(var(--bg-color), var(--bg-color)) padding-box,
                linear-gradient(45deg, #FFD700, #FFA500) border-box;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.philosopher-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(20%);
}

/* 철학자 이미지 컨테이너 - 심층분석보고서용 */
.philosopher-portrait {
    text-align: center;
    margin: 30px auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.philosopher-image-container {
    position: relative;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid #FFD700;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4),
                0 0 50px rgba(255, 215, 0, 0.2);
}

/* 철학자 이미지 반응형 크기 */
@media (max-width: 768px) {
    .philosopher-image-container {
        width: 150px !important;
        height: 150px !important;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .philosopher-image-container {
        width: 180px !important;
        height: 180px !important;
    }
}

@media (min-width: 1201px) {
    .philosopher-image-container {
        width: 200px !important;
        height: 200px !important;
    }
}
    background: linear-gradient(45deg, #2c2c2c, #3a3a3a);
    animation: philosopherGlow 3s ease-in-out infinite;
}

@keyframes philosopherGlow {
    0%, 100% { box-shadow: 0 15px 40px rgba(0,0,0,0.4), 0 0 50px rgba(255, 215, 0, 0.2); }
    50% { box-shadow: 0 15px 40px rgba(0,0,0,0.4), 0 0 70px rgba(255, 215, 0, 0.4); }
}

.philosopher-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.philosopher-image-container:hover img {
    transform: scale(1.1);
}

/* 이미지 로드 실패 시 폴백 */
.philosopher-image-container.no-image .philosopher-fallback {
    display: flex !important;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.8), rgba(210, 105, 30, 0.8));
}

.philosopher-fallback {
    display: none;
}

/* 철학자 정보 스타일 */
.philosopher-info {
    text-align: center;
    margin-top: 15px;
    width: 100%;
    padding: 0 10px;
}

.philosopher-info h5 {
    font-size: 1.3rem;
    color: #FFD700;
    margin-bottom: 5px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    text-align: center;
}

.philosopher-era {
    font-size: 0.9rem;
    color: #999;
    font-style: italic;
}

/* 클릭 가능한 철학자 이름 */
.philosopher-clickable {
    cursor: pointer;
    color: #FFD700;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    transition: all 0.3s ease;
    display: inline-block;
}

.philosopher-clickable:hover {
    color: #FFA500;
    text-decoration-style: solid;
    transform: scale(1.05);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* 타임라인의 철학 이름 클릭 가능 스타일 */
.timeline-philosophy.philosophy-clickable {
    cursor: pointer;
    color: #FFD700;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    transition: all 0.3s ease;
}

.timeline-philosophy.philosophy-clickable:hover {
    color: #FFA500;
    text-decoration-style: solid;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* 클릭 힌트 텍스트 */
.click-hint {
    font-size: 0.85rem;
    color: rgba(255, 215, 0, 0.7);
    margin-top: 8px;
    opacity: 0;
    animation: fadeInOut 3s infinite;
    text-align: center;
    width: 100%;
    display: block;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* 상호작용 힌트 */
.interaction-hint {
    font-size: 0.9rem;
    color: #999;
    margin-top: 20px;
    padding: 10px;
    background: rgba(255, 215, 0, 0.05);
    border-radius: 5px;
    border-left: 3px solid #FFD700;
}

.philosophy-icon-large {
    font-size: 4rem;
    color: var(--text-color);
    opacity: 0.9;
}

.philosopher-name {
    font-size: 1.5em;
    font-weight: 700;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.philosophy-percentage {
    font-size: 3em;
    font-weight: 800;
    color: var(--text-color);
    margin: 15px 0;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.2);
}

.philosophy-bar {
    width: 100%;
    height: 25px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.philosophy-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    width: 100%;
}

.stat-card {
    background: var(--secondary-bg);
    padding: 18px;
    border-radius: 15px;
    border: 2px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.5s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.1);
    border-color: var(--accent-color);
}

.stat-label {
    font-size: 0.9em; /* 가독성 향상 */
    color: #b0b0b0;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.choices-timeline {
    margin-bottom: 30px;
    padding: 30px;
    background: var(--secondary-bg);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    width: 100%;
}

.timeline-title {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.timeline-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 15px;
    border-left: 4px solid transparent;
    background: linear-gradient(var(--bg-color), var(--bg-color)) padding-box,
                linear-gradient(45deg, #FFD700, #FFA500) border-box;
    transition: all 0.3s ease;
}

.timeline-item:hover {
    transform: translateX(10px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.1);
}

.timeline-chapter {
    font-weight: 700;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-right: 20px;
    min-width: 100px;
    font-size: 1.1em;
}

.timeline-choice {
    flex: 1;
    color: var(--text-color);
    font-size: 1.05em;
    line-height: 1.5;
}

.timeline-philosophy {
    font-size: 0.9em;
    color: #b0b0b0;
    font-style: italic;
    padding: 5px 15px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 20px;
    margin-left: 15px;
}

.detailed-analysis {
    background: var(--secondary-bg);
    padding: 40px;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    margin-bottom: 50px;
    width: 100%;
}

.analysis-title {
    font-size: 2em;
    font-weight: 700;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
    text-align: center;
}

.analysis-content {
    line-height: 2;
    color: var(--text-color);
    font-size: 1.1em;
}

.analysis-quote {
    margin: 30px 0;
    padding: 25px;
    background: var(--bg-color);
    border-radius: 15px;
    border-left: 5px solid transparent;
    background: linear-gradient(var(--bg-color), var(--bg-color)) padding-box,
                linear-gradient(45deg, #FFD700, #FFA500) border-box;
    font-style: italic;
    font-size: 1.2em;
    line-height: 1.8;
    position: relative;
}

.analysis-quote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 4em;
    color: var(--accent-color);
    opacity: 0.3;
}

.quote-author {
    text-align: right;
    margin-top: 15px;
    font-size: 1em;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.report-ending {
    text-align: center;
    padding: 30px;
    background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.05) 0%, transparent 70%);
    border-radius: 20px;
    margin-bottom: 25px;
    border: 2px solid var(--border-color);
    width: 100%;
}

.ending-label {
    font-size: 1em;
    color: #b0b0b0;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.ending-title {
    font-size: 2.5em;
    font-weight: 800;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.ending-description {
    font-size: 1.2em;
    line-height: 1.8;
    color: var(--text-color);
    max-width: 600px;
    margin: 0 auto;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .report-content {
        padding: 20px 16px 120px 16px;
        margin: 0;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
        /* 전체 보고서 컨테이너에 텍스트 오버플로우 방지 */
        word-break: keep-all;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .report-header {
        margin-bottom: 25px;
        padding: 20px 15px;
        border-radius: 15px;
    }
    
    .report-title {
        font-size: 2.2rem;
        margin-bottom: 12px;
        line-height: 1.2;
        word-break: keep-all;
    }
    
    .report-subtitle {
        font-size: 1rem;
        letter-spacing: 1px;
        margin-bottom: 0;
    }
    
    .report-main-content {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .philosopher-section {
        margin-bottom: 15px;
        padding: 20px 15px;
        border-radius: 15px;
    }
    
    .philosopher-image {
        width: 120px;
        height: 120px;
        margin: 0 auto 15px;
        border-width: 3px;
    }
    
    .philosopher-image img {
        max-width: 100%;
        height: auto;
        object-fit: cover;
    }
    
    .philosopher-name {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .philosopher-description {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 12px;
        word-break: keep-all;
        word-wrap: break-word;
    }
    
    .report-stats {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 20px 0;
        padding: 0 5px;
    }
    
    .stats-item {
        padding: 15px 12px;
        border-radius: 12px;
        text-align: center;
    }
    
    .stats-item h4 {
        font-size: 0.9rem;
        margin-bottom: 8px;
        word-break: keep-all;
    }
    
    .stats-item .stats-number {
        font-size: 1.8rem;
        margin-bottom: 5px;
    }
    
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        margin: 10px 0;
        border-radius: 12px;
    }
    
    .timeline-chapter {
        margin-bottom: 8px;
        font-size: 0.95rem;
    }
    
    .timeline-content {
        font-size: 0.85rem;
        line-height: 1.4;
        word-break: keep-all;
        word-wrap: break-word;
    }
    
    .analysis-content {
        padding: 15px 12px;
        margin: 15px 0;
        border-radius: 12px;
        font-size: 0.9rem;
        line-height: 1.6;
        word-break: keep-all;
        word-wrap: break-word;
    }
    
    .analysis-quote {
        padding: 20px 15px;
        margin: 15px 0;
        border-radius: 12px;
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .analysis-title {
        font-size: 1.3rem;
        margin-bottom: 15px;
        text-align: center;
        word-break: keep-all;
    }
    
    .report-ending {
        padding: 20px 15px;
        margin: 20px 0;
        border-radius: 15px;
        text-align: center;
        font-size: 0.9rem;
        line-height: 1.5;
        word-break: keep-all;
        word-wrap: break-word;
    }
    
    /* 보고서 버튼들 모바일 최적화 */
    .report-buttons {
        flex-direction: column;
        gap: 12px;
        margin-top: 25px;
        padding: 0 10px;
    }
    
    .report-buttons .btn-primary,
    .report-buttons .btn-secondary {
        width: 100%;
        padding: 14px 20px;
        font-size: 1rem;
        border-radius: 12px;
        word-break: keep-all;
    }
    
    /* 모바일에서 이미지 깨짐 방지 */
    .report-content img {
        max-width: 100%;
        height: auto;
        object-fit: contain;
        border-radius: 8px;
        display: block;
        margin: 10px auto;
    }
    
    .report-wrapper img {
        max-width: 100%;
        height: auto;
        object-fit: cover;
        border-radius: 8px;
        display: block;
        margin: 8px auto;
    }
    
    /* 철학자 이미지 모바일 최적화 */
    .philosopher-image-container {
        margin: 10px auto;
        max-width: 140px;
    }
    
    .philosopher-image-container img {
        width: 100%;
        height: auto;
        object-fit: cover;
        border-radius: 50%;
    }
    
    /* 스토리 이미지 모바일 최적화 */
    .story-image {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        margin: 15px auto !important;
        display: block !important;
        border-radius: 8px;
    }
    
    /* 모든 이미지 컨테이너 최적화 */
    .image-container,
    .img-container {
        width: 100%;
        text-align: center;
        overflow: hidden;
        border-radius: 8px;
        margin: 10px 0;
    }
    
    .image-container img,
    .img-container img {
        max-width: 100%;
        height: auto;
        object-fit: contain;
        display: block;
        margin: 0 auto;
    }
    
    /* 텍스트 오버플로우 방지 - 강화된 버전 */
    .report-content *,
    .report-wrapper *,
    .report-details * {
        word-break: keep-all !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
    }
    
    .report-content h1,
    .report-content h2,
    .report-content h3,
    .report-content h4,
    .report-content h5,
    .report-content h6 {
        line-height: 1.3 !important;
        margin: 10px 0 !important;
        padding: 0 8px !important;
    }
    
    .report-content p,
    .report-content div,
    .report-content span {
        line-height: 1.5 !important;
        margin: 8px 0 !important;
        padding: 0 4px !important;
    }
    
    /* 보고서 내부 컨테이너들 안전한 여백 적용 */
    .report-wrapper {
        padding: 15px 12px !important;
        margin: 0 auto !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    .report-header,
    .philosophy-overview,
    .path-analysis,
    .choices-timeline,
    .character-interactions,
    .moral-dilemmas,
    .ending-details {
        padding: 12px 8px !important;
        margin: 15px 0 !important;
        border-radius: 10px !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* 타임라인 아이템들 텍스트 오버플로우 방지 */
    .timeline-item {
        padding: 12px 8px 12px 35px !important;
        margin-bottom: 15px !important;
        word-break: keep-all !important;
        overflow: hidden !important;
    }
    
    .timeline-content {
        max-width: calc(100% - 30px) !important;
        overflow: hidden !important;
    }
    
    .choice-context,
    .choice-made,
    .choice-impact,
    .choice-consequences {
        word-break: keep-all !important;
        word-wrap: break-word !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        padding: 4px 0 !important;
    }
    
    /* 캐릭터 카드 텍스트 오버플로우 방지 */
    .character-card {
        padding: 12px 8px !important;
        text-align: center !important;
        overflow: hidden !important;
    }
    
    .character-card h5,
    .character-card p {
        word-break: keep-all !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        margin: 4px 0 !important;
    }
    
    /* 딜레마 카드 텍스트 처리 */
    .dilemma-card {
        padding: 12px 8px !important;
        margin: 10px 0 !important;
        overflow: hidden !important;
    }
    
    .dilemma-description,
    .resolution-choice,
    .dilemma-analysis {
        word-break: keep-all !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        line-height: 1.4 !important;
    }
    
    /* 메타 정보 텍스트 처리 */
    .meta-item {
        display: inline-block !important;
        word-break: keep-all !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 2px 4px !important;
        padding: 2px 4px !important;
        border-radius: 4px !important;
        background: rgba(255, 255, 255, 0.05) !important;
    }
    
    /* 긴 텍스트를 안전하게 처리 */
    .long-text {
        word-break: keep-all !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
        line-height: 1.5 !important;
    }
    
    /* 추가적인 보고서 요소들 텍스트 오버플로우 방지 */
    .choice-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .choice-header h5 {
        word-break: keep-all !important;
        font-size: 1rem !important;
        margin: 0 !important;
        padding: 0 4px !important;
    }
    
    .choice-type {
        word-break: keep-all !important;
        font-size: 0.85rem !important;
        padding: 2px 6px !important;
        border-radius: 4px !important;
        display: inline-block !important;
        margin: 2px 0 !important;
    }
    
    .ending-card {
        padding: 20px 15px !important;
        text-align: center !important;
        overflow: hidden !important;
    }
    
    .ending-card h5 {
        font-size: 1.3rem !important;
        word-break: keep-all !important;
        margin: 10px 0 !important;
        padding: 0 8px !important;
        line-height: 1.3 !important;
    }
    
    .stat-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 0 4px !important;
    }
    
    .stat-item {
        padding: 15px 10px !important;
        text-align: center !important;
        word-break: keep-all !important;
        overflow: hidden !important;
    }
    
    .stat-item h4 {
        font-size: 0.9rem !important;
        margin: 8px 0 !important;
        word-break: keep-all !important;
        line-height: 1.2 !important;
    }
    
    .stat-value {
        font-size: 1.5rem !important;
        word-break: keep-all !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    /* 철학 관련 요소들 */
    .philosophy-description,
    .philosophy-traits,
    .path-description {
        word-break: keep-all !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        line-height: 1.5 !important;
        padding: 8px 4px !important;
        margin: 8px 0 !important;
    }
    
    .philosophy-badge {
        word-break: keep-all !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: inline-block !important;
        max-width: 90% !important;
        font-size: 0.9rem !important;
    }
    
    .philosophy-traits span {
        word-break: keep-all !important;
        font-size: 0.85rem !important;
        display: inline-block !important;
        margin: 2px 4px !important;
        padding: 2px 6px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 4px !important;
    }
    
    /* 관계 상태 텍스트 */
    .relationship-status {
        word-break: keep-all !important;
        font-size: 0.8rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    
    /* 해상도 선택 텍스트 */
    .resolution-label,
    .resolution-choice {
        word-break: keep-all !important;
        font-size: 0.9rem !important;
        display: block !important;
        margin: 4px 0 !important;
        padding: 2px 4px !important;
    }
}

/* 철학 상세 설명 모달 */
.philosophy-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.philosophy-detail-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.philosophy-modal-content {
    position: relative;
    background: var(--bg-color);
    color: var(--text-color);
    max-width: 800px;
    max-height: 90vh;
    margin: 50px auto;
    padding: 40px;
    border-radius: 15px;
    overflow-y: auto;
    border: 2px solid var(--accent-color);
}

.philosophy-modal-content h2 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 1.8em;
}

.philosophy-modal-content h3 {
    color: var(--accent-color);
    margin: 20px 0 10px 0;
    font-size: 1.3em;
}

.philosophy-modal-content h4 {
    color: var(--text-color);
    margin: 15px 0 10px 0;
    font-size: 1.1em;
}

.philosophy-detail-text {
    line-height: 1.8;
    margin-bottom: 30px;
}

.philosophy-detail-text ul,
.philosophy-detail-text ol {
    margin: 10px 0 10px 30px;
}

.philosophy-detail-text li {
    margin: 5px 0;
}

.philosophy-detail-quote {
    margin-top: 30px;
    padding: 20px;
    background: var(--secondary-bg);
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
    font-style: italic;
}

.philosophy-detail-quote cite {
    display: block;
    text-align: right;
    margin-top: 10px;
    color: var(--accent-color);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 30px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.modal-close:hover {
    opacity: 1;
}

.philosopher-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
}

/* 보고서 버튼 스타일 - 메인 페이지와 일관성 */
.report-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    width: 100%;
}

.report-buttons .btn-primary,
.report-buttons .btn-secondary {
    padding: 12px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.report-buttons .btn-primary {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #0a0a0a;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.report-buttons .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5);
    background: linear-gradient(45deg, #FFA500, #FFD700);
}

.report-buttons .btn-secondary {
    background-color: var(--secondary-bg);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.report-buttons .btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.2);
    border-color: var(--accent-color);
    background-color: rgba(255, 215, 0, 0.1);
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.5;
    }
}

/* 엔딩 컬렉션 스타일 */
.ending-collection {
    margin-top: 50px;
    padding: 40px;
    background: var(--secondary-bg);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    width: 100%;
}

.collection-title {
    font-size: 1.8em;
    font-weight: 700;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 20px;
}

.collection-stats {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 20px;
}

.collection-count {
    color: var(--accent-color);
    font-weight: bold;
}

.collection-total {
    color: var(--text-color);
    opacity: 0.7;
}

.collection-progress {
    width: 100%;
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.collection-badges {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.ending-badge {
    padding: 15px 10px;
    background: var(--bg-color);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.ending-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.badge-unlocked {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), transparent);
}

.badge-unlocked::before {
    transform: translateX(100%);
}

.badge-unlocked:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.badge-locked {
    opacity: 0.5;
    border-color: var(--border-color);
}

.badge-key {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.badge-locked .badge-key {
    color: var(--text-color);
    opacity: 0.5;
}

.badge-name {
    display: block;
    font-size: 0.75em;
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.2;
}

.badge-locked .badge-name {
    opacity: 0.3;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .collection-badges {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }
    
    .ending-badge {
        padding: 10px 5px;
    }
    
    .badge-key {
        font-size: 1em;
    }
    
    .badge-name {
        font-size: 0.65em;
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* 폭발 텍스트 스타일 */
.explosion-trigger {
    font-size: 2em;
    font-weight: bold;
    color: #ff3333;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
    display: inline-block;
    opacity: 1; /* Changed to 1 to make it visible */
    /* Ensure element is still interactable for IntersectionObserver */
    visibility: visible;
    pointer-events: none;
}

/* 폭발 효과가 트리거된 텍스트 */
.explosion-trigger.triggered {
    animation: explosionShake 0.5s ease-out 0.8s forwards;
}

/* 폭발 텍스트 흔들림 애니메이션 */
@keyframes explosionShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* 화면 흔들림 효과 */
.screen-shake {
    animation: screenShake 0.5s ease-out;
}

/* 경보음 효과 */
.alarm-trigger {
    display: inline-block;
    animation: alarm-flash 0.3s ease-in-out;
    animation-iteration-count: 6;
    color: #ff0000;
    font-weight: bold;
    font-size: 1.15em;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

@keyframes alarm-flash {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.7;
    }
}

@keyframes screenShake {
    0%, 100% {
        transform: translate(0, 0);
    }
    10% {
        transform: translate(-10px, -5px);
    }
    20% {
        transform: translate(10px, 5px);
    }
    30% {
        transform: translate(-8px, 3px);
    }
    40% {
        transform: translate(8px, -3px);
    }
    50% {
        transform: translate(-6px, 2px);
    }
    60% {
        transform: translate(6px, -2px);
    }
    70% {
        transform: translate(-4px, 1px);
    }
    80% {
        transform: translate(4px, -1px);
    }
    90% {
        transform: translate(-2px, 0);
    }
}

/* 폭발 텍스트 나타나는 애니메이션 */
@keyframes explosionAppear {
    0% {
        opacity: 0;
        transform: scale(2) translateY(-20px);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 빨간 화면 플래시 효과 */
.red-flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 0, 0, 0.5);
    pointer-events: none;
    z-index: 9999;
    animation: redFlash 0.5s ease-out;
}

@keyframes redFlash {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* 전화벨 텍스트 스타일 */
.phone-ring-trigger {
    font-size: 1.5em;
    font-weight: bold;
    color: #4169E1;
    font-style: italic;
    display: inline-block;
    animation: ring 0.5s ease-in-out 3;
}

@keyframes ring {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* 메인 페이지 스타일 */
.main-content {
    text-align: center;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.main-title {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--text-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    text-align: center; /* 중앙 정렬 */
}

/* 메인 타이틀 반응형 폰트 크기 */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.2rem !important;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .main-title {
        font-size: 2.8rem !important;
    }
}

@media (min-width: 1201px) {
    .main-title {
        font-size: 3.5rem !important;
    }
}

.subtitle {
    color: #e0e0e0;
    margin-bottom: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    text-align: center; /* 중앙 정렬 */
}

/* 서브타이틀 반응형 폰트 크기 */
@media (max-width: 768px) {
    .subtitle {
        font-size: 1.0rem !important;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .subtitle {
        font-size: 1.2rem !important;
    }
}

@media (min-width: 1201px) {
    .subtitle {
        font-size: 1.4rem !important;
    }
}

.genre-tag {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 50px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
}

.intro-text {
    margin: 40px 0 60px 0;
    font-size: 1.15rem;
    line-height: 2.2;
    max-width: 600px;
}

.intro-text p {
    margin: 15px 0;
    opacity: 0.9;
}

.intro-text p:first-child {
    font-size: 1.2rem;
    font-weight: 500;
}

.intro-text p:last-child {
    font-style: italic;
    opacity: 0.8;
}

.author {
    font-size: 0.9rem;
    color: #888;
    margin-top: -10px;
    margin-bottom: 20px;
}

.name-input-container {
    margin-top: 20px;
}

.name-input-container label {
    display: block;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #b0b0b0;
    font-weight: 400;
}

.name-input-help {
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 8px;
    margin-bottom: 8px;
    font-style: normal;
    background: rgba(255, 215, 0, 0.1);
    padding: 8px 12px;
    border-radius: 5px;
    border-left: 3px solid var(--accent-color);
}

.footer-credit {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #555;
    opacity: 0.6;
    letter-spacing: 0.5px;
}

.credit-link {
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
}

.credit-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

#userName {
    padding: 15px 25px;
    font-size: 1.1rem;
    background-color: var(--secondary-bg);
    border: 2px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-color);
    width: 280px;
    margin-bottom: 25px;
    transition: all 0.3s;
    text-align: center;
}

#userName:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
}

#userName::placeholder {
    color: #666;
    opacity: 0.7;
}

/* 버튼 스타일 */
.btn-primary, .btn-secondary {
    padding: 15px 40px;
    font-size: 1.2rem;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #0a0a0a;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5);
    background: linear-gradient(45deg, #FFA500, #FFD700);
}

.btn-secondary {
    background-color: #333;
    color: #f0f0f0;
    margin: 10px;
}

.btn-secondary:hover {
    background-color: #444;
}

/* 전체화면 버튼 특별 스타일 */
#fullscreenNoticeBtn {
    background: linear-gradient(45deg, #333, #555);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--accent-color);
    font-weight: 600;
}

#fullscreenNoticeBtn:hover {
    background: linear-gradient(45deg, #555, #777);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

/* 성별 선택 페이지 스타일 */
.gender-content {
    padding: 40px 20px;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gender-content h2 {
    font-family: 'Noto Serif KR', serif;
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.gender-intro {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 50px;
}

.gender-options {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    /* 빈 공간 활용 및 균형 */
    align-items: stretch;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.gender-btn {
    background-color: var(--secondary-bg);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 20px;
    width: 340px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gender-btn:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.gender-btn:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

.gender-btn:active {
    transform: translateY(-3px);
}

.gender-image {
    width: 300px;
    height: 300px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    pointer-events: none; /* 이미지는 클릭 이벤트를 버튼으로 전달 */
}

.gender-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
}

.gender-label {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.gender-desc {
    font-size: 1rem;
    color: var(--text-color);
    opacity: 0.7;
}

.gender-note {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.6;
    font-style: italic;
}

/* 안내사항 페이지 스타일 */
.notice-content {
    padding: 40px 20px;
}

.notice-content h2 {
    font-family: 'Noto Serif KR', serif;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 20px;
    color: #FFD700;
}

.notice-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.notice-content .btn-primary {
    margin: 0;
}

.notice-intro {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 40px;
    color: #b0b0b0;
}

.notice-section {
    margin: 30px 0;
    padding: 20px;
    background-color: var(--secondary-bg);
    border-radius: 10px;
    border-left: 4px solid var(--accent-color);
}

.notice-section h3 {
    color: #FFD700;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

/* 안내 페이지 서브섹션 스타일 추가 */
.notice-subsection {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid rgba(255, 215, 0, 0.3);
    border-radius: 5px;
    box-sizing: border-box;
}

.notice-subsection h4 {
    color: rgba(255, 215, 0, 0.8);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.notice-subsection p {
    margin: 8px 0;
    line-height: 1.8;
}

.blog-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.blog-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* 전체화면 강조 섹션 */
.fullscreen-highlight {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 2px solid var(--accent-color);
    animation: pulse 2s ease-in-out infinite;
}

.fullscreen-highlight h3 {
    font-size: 1.4rem;
}

.fullscreen-highlight .highlight-icon {
    display: inline-block;
    font-size: 1.3em;
    background-color: var(--accent-color);
    color: var(--bg-color);
    padding: 2px 8px;
    border-radius: 5px;
    margin: 0 5px;
    font-weight: bold;
}

.fullscreen-highlight p {
    margin: 10px 0;
    line-height: 1.8;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }
    100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
}

/* 스토리 페이지 스타일 */
.story-content {
    padding: 30px 20px 30px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.story-content h2 {
    font-family: 'Noto Serif KR', serif;
    font-size: 2rem;  /* 원래 크기로 복구 */
    margin-top: 40px;  /* 원래 간격으로 복구 */
    margin-bottom: 25px;  /* 다음 텍스트와의 간격 */
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

/* 첫 번째 h2는 상단 마진 제거 */
.story-content h2:first-child {
    margin-top: 0;
}

.story-content h2::before {
    content: '◆';
    position: absolute;
    left: 20px;
    color: var(--accent-color);
}

.story-content h2::after {
    content: '◆';
    position: absolute;
    right: 20px;
    color: var(--accent-color);
}

/* h2 아래 장식선 */
.story-content h2 .subtitle-line {
    display: block;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    margin: 15px auto 0;
}

.text-content {
    font-size: 1.15em;  /* rem에서 em으로 변경하여 body의 font-size를 상속받도록 함 */
    line-height: 2.2;
    text-align: justify;
    margin-bottom: 15px;
    word-break: keep-all;
    overflow-wrap: break-word;
    letter-spacing: 0.02em;
    /* 모바일에서 텍스트가 넘치지 않도록 */
    max-width: 100%;
    box-sizing: border-box;
}

.text-content p {
    margin-bottom: 20px;  /* 모든 페이지 동일한 문단 간격 */
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 2.3;
    letter-spacing: 0.03em;
}

/* 마지막 문단은 하단 마진 제거 */
.text-content p:last-child {
    margin-bottom: 0;
}

/* 대사와 지문 구분 스타일 */
.text-content .dialogue {
    margin: 10px 0;
    padding-left: 20px;
    position: relative;
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 5px;
    padding-top: 3px;
    padding-bottom: 3px;
}

.text-content .dialogue::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--accent-color);
    opacity: 0.3;
}

.text-content .dialogue-first {
    margin-top: 15px;
    margin-bottom: 10px;
}

.text-content .narration {
    margin-bottom: 15px;
    line-height: 2.2;
    opacity: 0.95;
}

.text-content .mixed-content {
    margin-bottom: 15px;
}

/* 장면 전환 */
.text-content .scene-break {
    margin: 20px auto;
    width: 40%;
    border: none;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    position: relative;
}

.text-content .scene-break::after {
    content: '✦';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-color);
    padding: 0 10px;
    color: var(--accent-color);
    font-size: 0.8em;
    opacity: 0.6;
}

/* 문단 사이 여백 */
.text-content .paragraph-break {
    height: 15px;
}

/* 제목이 포함된 문단 */
.text-content .heading-paragraph {
    margin-top: 10px;
    margin-bottom: 15px;
}

/* 본문 내 제목 스타일 */
.text-content .heading-paragraph {
    color: var(--accent-color);
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    margin: 20px 0 15px 0;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

/* 소제목 내 볼드 텍스트 */
.text-content .heading-paragraph strong {
    color: inherit;
}

/* ## 제목 (더 작은 소제목) */
.text-content .sub-heading,
.text-content h4.sub-heading {
    color: var(--text-color);
    font-size: 1.25em;  /* 일반 텍스트(1.15em)보다 조금 크게 */
    font-weight: 600;
    margin: 30px 0 15px 0;  /* 위쪽 간격을 더 넓게 */
    padding-left: 15px;
    border-left: 3px solid var(--accent-color);
    text-decoration: none !important;  /* h4 기본 underline 제거 */
}
.text-content h1 {
    font-size: 1.8em;
    color: var(--accent-color);
    margin: 20px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--accent-color);
    font-family: 'Noto Serif KR', serif;
}

.text-content h2 {
    font-size: 1.5em;
    color: #FFD700;
    margin: 15px 0 10px 0;
    padding-left: 15px;
    border-left: 5px solid #FFD700;
    background-color: rgba(255, 215, 0, 0.1);
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 700;
    font-family: 'Noto Serif KR', serif;
}

.text-content h3 {
    font-size: 1.3em;
    color: var(--text-color);
    margin: 15px 0 10px 0;
    padding: 8px 12px;
    background-color: var(--secondary-bg);
    border-radius: 5px;
    font-weight: 700;
}

.text-content h4 {
    font-size: 1.2em;
    color: var(--text-color);
    margin: 15px 0 10px 0;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--accent-color);
}

/* 구분선 스타일 */
.text-content hr {
    margin: 15px 0;
    border: none;
    border-top: 2px dashed var(--border-color);
    position: relative;
}

.text-content hr::after {
    content: '❖';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-color);
    padding: 0 10px;
    color: var(--accent-color);
    font-size: 1.2rem;
}

/* 대사 스타일 */
.dialogue {
    font-weight: 600;
    color: inherit;
    font-style: italic;
    letter-spacing: 0.3px;
}


/* 일반 대사 (큰따옴표) - 색상 없음, 일반 텍스트와 동일 */
.text-content .quote-normal {
    color: inherit;
    font-weight: inherit;
    padding: 0 2px;
}

/* 생각이나 독백 (작은따옴표) - 색상 없음, 이탤릭만 */
.text-content .quote-thought {
    color: inherit;
    font-weight: 400;
    font-style: italic;
    opacity: 0.95;
}

/* 강조 대사 - 은은한 강조 */
.text-content .quote-emphasis {
    color: inherit;
    font-weight: 700;
    font-size: 1.02em;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--accent-color);
    text-underline-offset: 3px;
}

/* 화자 이름 - 색상 없음, 볼드만 */
.text-content .speaker {
    color: var(--accent-color);
    font-weight: 700;
    margin-right: 8px;
    font-size: 1.05em;
}

/* 강조 스타일 */
.text-content strong {
    font-weight: 700;
    color: var(--text-color);
    text-shadow: 0 0 1px currentColor;
}

.text-content em {
    font-style: italic;
    letter-spacing: 0.02em;
    opacity: 0.95;
}

/* 대사 내 강조 */
.text-content .dialogue strong {
    text-decoration: underline;
    text-decoration-style: wavy;
    text-decoration-color: var(--accent-color);
    text-underline-offset: 3px;
}

/* 대사 관련 추가 스타일 */
body.light-theme .quote-normal {
    color: inherit;
}

body.light-theme .quote-thought {
    color: inherit;
}

body.light-theme .quote-emphasis {
    color: inherit;
    font-weight: 700;
}

body.sepia-theme .quote-normal {
    color: inherit;
    font-weight: inherit;
}

body.sepia-theme .quote-thought {
    color: inherit;
    opacity: 0.95;
}

body.sepia-theme .quote-emphasis {
    color: inherit;
    font-weight: 700;
}

/* 선택지 스타일 */
.choices-container {
    margin: 25px 0;
    padding-bottom: 20px; /* 모바일에서 하단 여백 추가 */
}

/* 선택지 버튼 컨테이너 */
.choice-buttons {
    margin: 25px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 기본 선택지 버튼 스타일 */
.choice-btn {
    display: block;
    width: 100%;
    padding: 30px 35px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background-color: var(--secondary-bg);
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.7;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 100px;
    /* 모바일 최적화 */
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.choice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-color: var(--accent-color);
    background-color: rgba(255, 215, 0, 0.05);
}

.choice-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 모바일에서 선택지 버튼 크기 증가 - 텍스트 오버플로우 방지 */
@media (max-width: 768px) {
    .choice-btn {
        padding: 40px 30px; /* 패딩 증가 */
        font-size: 1.2rem;
        margin: 15px 0; /* 여백 증가 */
        min-height: 120px; /* 최소 높이 증가 */
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal; /* 텍스트 줄바꿈 허용 */
        line-height: 1.6; /* 줄간격 조정 */
    }
    
    .choice-buttons {
        gap: 18px; /* 버튼 간 간격 증가 */
        margin: 30px 0; /* 상하 여백 증가 */
    }
    
    /* 선택지 텍스트 여백 개선 */
    .choice-btn .choice-text {
        font-size: 1.15rem;
        font-weight: 600;
        margin-bottom: 10px;
        line-height: 1.5;
    }
    
    /* 선택지 설명 텍스트 개선 */
    .choice-btn .choice-desc {
        font-size: 1rem;
        font-weight: 400;
        line-height: 1.5;
        margin-top: 8px;
    }
}

/* 선택지 텍스트 */
.choice-btn .choice-text {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

/* 선택지 설명 */
.choice-btn .choice-desc {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    margin-top: 5px;
}

/* 선택된 버튼 */
.choice-btn.selected {
    border-color: var(--accent-color);
    background-color: rgba(255, 215, 0, 0.1);
    pointer-events: none;
}

.choice-btn.selected::after {
    content: '✓';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--accent-color);
}

/* 비활성화된 버튼 */
.choice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 라이트 테마에서의 선택지 */
body.light-theme .choice-btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.light-theme .choice-btn:hover {
    background-color: rgba(255, 165, 0, 0.05);
}

body.light-theme .choice-btn .choice-desc {
    color: rgba(0, 0, 0, 0.6);
}

/* 세피아 테마에서의 선택지 */
body.sepia-theme .choice-btn .choice-desc {
    color: rgba(92, 75, 55, 0.7);
}

/* 메인 선택지 섹션 (챕터 끝 철학적 선택) */
.main-choice-section {
    margin: 60px 0;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
}

.main-choice-section h3 {
    font-size: 1.8rem;
    margin-bottom: 40px;
    text-align: center;
    color: var(--accent-color);
}

.main-choices {
    display: flex;
    flex-direction: column;
    gap: 25px;
    max-width: 800px;
    margin: 0 auto;
}

/* 메인 선택지 버튼 (크고 중요한 선택) */
.main-choice-btn {
    display: block;
    width: 100%;
    padding: 30px 40px;
    border: 3px solid var(--border-color);
    border-radius: 15px;
    background-color: var(--secondary-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.main-choice-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
}

.main-choice-btn.selected {
    border-color: var(--accent-color);
    background-color: rgba(255, 215, 0, 0.1);
}

.main-choice-btn .choice-label {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
    display: block;
}

.main-choice-btn .choice-desc {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

/* 모바일에서 메인 선택지 버튼 크기 증가 */
@media (max-width: 768px) {
    .main-choice-btn {
        padding: 45px 35px; /* 패딩 대폭 증가 */
        margin-bottom: 25px;
        min-height: 160px; /* 높이 증가 */
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        line-height: 1.6;
    }
    
    .main-choice-btn .choice-label {
        font-size: 1.35rem; /* 글씨 크기 약간 증가 */
        margin-bottom: 15px; /* 여백 증가 */
        line-height: 1.4;
        font-weight: 700;
    }
    
    .main-choice-btn .choice-desc {
        font-size: 1.05rem; /* 설명 텍스트 크기 증가 */
        line-height: 1.5;
        margin-top: 10px;
    }
}
    
    .main-choice-btn .choice-desc {
        font-size: 1rem;
        line-height: 1.7;
    }
}

/* 선택지별 색상 */
.main-choice-btn[data-choice="A"]:hover {
    border-color: #FF6B6B;
    background-color: rgba(255, 107, 107, 0.1);
}

.main-choice-btn[data-choice="B"]:hover {
    border-color: #4ECDC4;
    background-color: rgba(78, 205, 196, 0.1);
}

.main-choice-btn[data-choice="C"]:hover {
    border-color: #95E1D3;
    background-color: rgba(149, 225, 211, 0.1);
}

.choice-button {
    display: block;
    width: 100%;
    padding: 20px;
    margin: 15px 0;
    border: 2px solid transparent;
    border-radius: 10px;
    background-color: var(--secondary-bg);
    color: var(--text-color);
    font-size: 1.2rem;
    line-height: 1.8;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    z-index: 100; /* 설정 버튼보다는 낮게 */
}

.choice-button:hover {
    transform: translateX(10px);
}

.choice-button.utilitarian {
    border-color: #FF4444;
}

.choice-button.utilitarian:hover {
    background-color: rgba(255, 68, 68, 0.1);
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}

.choice-button.rawlsian {
    border-color: #4444FF;
}

.choice-button.rawlsian:hover {
    background-color: rgba(68, 68, 255, 0.1);
    box-shadow: 0 0 20px rgba(68, 68, 255, 0.3);
}

.choice-button.aristotelian {
    border-color: #FFD700;
}

.choice-button.aristotelian:hover {
    background-color: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.choice-icon {
    margin-right: 10px;
    font-size: 1.3rem;
}

/* 엔딩 스타일 */
.ending-content {
    padding: 30px;
    background-color: #1a1a1a;
    border-radius: 10px;
    margin: 30px 0;
    border: 2px solid #FFD700;
}

.ending-content h3 {
    color: #FFD700;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

/* 엔딩 내 프롤로그 인용 스타일 */
.ending-content blockquote {
    background-color: rgba(255, 215, 0, 0.1);
    border-left: 4px solid var(--accent-color);
    padding: 20px 25px;
    margin: 30px 0;
    font-style: italic;
    border-radius: 5px;
}

.ending-content .prologue-recall {
    border-left: 3px solid rgba(255, 215, 0, 0.5);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    opacity: 0.9;
}

.ending-content .teacher-quote {
    color: var(--accent-color);
    font-weight: 500;
}

/* 에필로그 스타일 */
.ending-content .epilogue-section {
    border-top: 2px solid rgba(255, 215, 0, 0.5);
    border-bottom: 2px solid rgba(255, 215, 0, 0.5);
    padding: 25px 0;
    margin: 30px 0;
}

.ending-content .epilogue-section h2 {
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.6rem;
    font-weight: 600;
}

.ending-content .epilogue-time {
    text-align: center;
    color: var(--accent-color);
    opacity: 0.8;
    margin-bottom: 15px;
    font-size: 1rem;
}

/* 프롤로그 섹션 스타일 */
.prologue-section-content {
    margin-bottom: 30px;
    animation: fadeIn 1s ease-in;
}

/* 챕터 섹션 스타일 */
.chapter1-section-content {
    margin-bottom: 30px;
    animation: fadeIn 1s ease-in;
}

.chapter2-section-content,
.chapter3-section-content {
    margin-bottom: 30px;
    animation: fadeIn 1s ease-in;
}

.chapter-choice-section {
    margin: 40px 0;
    padding: 20px;
    background-color: var(--secondary-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    animation: slideUp 0.8s ease-out;
}

.chapter-choice-section .choice-btn {
    display: block;
    width: 100%;
    padding: 20px;
    margin: 15px 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background-color: var(--secondary-bg);
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.8;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* 모바일에서 챕터 선택지 버튼 조정 */
@media (max-width: 768px) {
    .chapter-choice-section .choice-btn {
        padding: 25px 20px; /* 패딩 증가 */
        margin: 18px 0; /* 여백 증가 */
        font-size: 1.15rem; /* 글씨 크기 증가 */
        min-height: 85px; /* 최소 높이 설정 */
        line-height: 1.6;
    }
}

/* 프롤로그 선택지 스타일 */
.prologue-choice-section {
    margin: 40px 0;
    padding: 20px;
    background-color: var(--secondary-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    animation: slideUp 0.8s ease-out;
}

.prologue-choice-section .choice-btn {
    display: block;
    width: 100%;
    padding: 20px;
    margin: 15px 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background-color: var(--secondary-bg);
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.8;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* 모바일에서 프롤로그 선택지 버튼 조정 */
@media (max-width: 768px) {
    .prologue-choice-section .choice-btn {
        padding: 25px 20px; /* 패딩 증가 */
        margin: 18px 0; /* 여백 증가 */
        font-size: 1.15rem; /* 글씨 크기 증가 */
        min-height: 85px; /* 최소 높이 설정 */
        line-height: 1.6;
    }
    
    .prologue-choice-section .choice-desc {
        font-size: 1rem; /* 설명 텍스트 크기 증가 */
        line-height: 1.5;
        margin-top: 8px;
    }
}

.prologue-choice-section .choice-btn:hover {
    transform: translateX(5px);
    border-color: var(--accent-color);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.2);
}

.prologue-choice-section .choice-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.prologue-choice-section .choice-btn.selected {
    background-color: rgba(255, 215, 0, 0.1);
    border-color: var(--accent-color);
}

.prologue-choice-section .choice-desc {
    font-size: 0.95rem;
    color: var(--text-color);
    opacity: 0.8;
    font-style: italic;
}

/* 계속 버튼 스타일 */
.continue-btn {
    background-color: var(--accent-color);
    color: var(--bg-color);
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.continue-btn:active {
    transform: translateY(0);
}

/* 모바일에서 continue 버튼 크기 조정 */
@media (max-width: 768px) {
    .continue-btn {
        padding: 20px 35px !important; /* 패딩 증가 */
        font-size: 1.15rem !important; /* 글씨 크기 증가 */
        min-height: 55px !important; /* 최소 높이 증가 */
        margin: 35px auto !important; /* 여백 증가 */
        max-width: 280px; /* 최대 너비 설정 */
        width: 90%; /* 반응형 너비 */
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }
}

.continue-button-container {
    animation: fadeIn 0.5s ease-out;
}

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

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

.choice-title {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-align: center;
}

.choice-result {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(255, 215, 0, 0.1);
    border-radius: 5px;
    border-left: 3px solid var(--accent-color);
}

.choice-result-text {
    font-style: italic;
    color: var(--text-color);
    opacity: 0.9;
    margin: 0;
}

/* 보고서 페이지 스타일 - 미니멀하고 세련된 디자인 */
.report-content {
    padding: 40px 20px;
    text-align: center;
    background: #050505;
    min-height: 100vh;
    box-sizing: border-box;
}

.report-content h2 {
    font-family: 'Noto Serif KR', serif;
    font-size: 1rem;
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 200;
    letter-spacing: 5px;
    text-transform: uppercase;
}

.report-details {
    background-color: #000;
    padding: 40px 30px;
    border-radius: 0;
    margin-bottom: 25px;
    text-align: left;
    max-width: 720px;
    margin: 0 auto 40px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
    box-sizing: border-box;
    overflow-x: auto;
}

/* 보고서 헤더 - 깔끔하고 우아한 스타일 */
.report-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.report-header h3 {
    font-size: 2.4rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 20px;
    font-weight: 100;
    letter-spacing: -1px;
    line-height: 1.3;
    font-family: 'Noto Serif KR', serif;
}

.report-date {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.75rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 200;
    font-family: 'Noto Sans KR', sans-serif;
}

/* 철학 개요 섹션 - 미니멀 스타일 */
.philosophy-overview {
    margin-bottom: 40px;
}

.philosophy-overview h4 {
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 30px;
    font-size: 0.8rem;
    font-weight: 200;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-family: 'Noto Sans KR', sans-serif;
}

/* 미니멀한 막대 차트 */
.philosophy-visual {
    margin: 30px 0 25px;
}

.philosophy-bars {
    max-width: 450px;
    margin: 0 auto;
}

.bar-item {
    margin-bottom: 45px;
}

.bar-item:last-child {
    margin-bottom: 0;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
}

.bar-percentage {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 200;
    font-variant-numeric: tabular-nums;
}

.bar-track {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.85);
}

.bar-fill.utilitarian {
    background: rgba(255, 255, 255, 0.85);
}

.bar-fill.rawlsian {
    background: rgba(255, 255, 255, 0.85);
}

.bar-fill.aristotelian {
    background: rgba(255, 255, 255, 0.85);
}

/* 차트 컨테이너 - 삭제됨 (미니멀 바 차트로 대체) */

/* 지배적 철학 - 세련된 미니멀 스타일 */
.dominant-philosophy {
    background: transparent;
    padding: 80px 0 0;
    border-radius: 0;
    margin-top: 80px;
    position: relative;
    text-align: center;
}

.philosophy-badge {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 0;
    font-weight: 200;
    margin-bottom: 20px;
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    transition: all 0.3s ease;
}

.philosophy-description {
    font-size: 1.05rem;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.45);
    max-width: 600px; /* 너비 확대 */
    margin: 0 auto;
    font-weight: 300;
    font-family: 'Noto Serif KR', serif;
    word-wrap: break-word; /* 긴 단어 줄바꿈 */
    overflow-wrap: break-word; /* 오버플로우 방지 */
}

/* 타임라인 */
.choices-timeline {
    margin-bottom: 40px;
}

.choices-timeline h4 {
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 30px;
    font-size: 0.8rem;
    font-weight: 200;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-family: 'Noto Sans KR', sans-serif;
}

.timeline-minimal {
    position: relative;
    padding-left: 0;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding-left: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.03);
    margin-left: 12px;
    padding-left: 50px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -12px;
    top: 10px;
    width: 24px;
    height: 24px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    font-family: 'Noto Sans KR', sans-serif;
}

.choice-header {
    display: flex;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 20px;
}

.choice-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.25);
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    font-weight: 200;
}

.choice-type.utilitarian {
    border-color: rgba(255, 255, 255, 0.06);
}

.choice-type.rawlsian {
    border-color: rgba(255, 255, 255, 0.06);
}

.choice-type.aristotelian {
    border-color: rgba(255, 255, 255, 0.06);
}

.timeline-content {
    background: transparent;
    padding: 0;
    border-radius: 0;
    word-wrap: break-word; /* 긴 단어 줄바꿈 */
    overflow-wrap: break-word; /* 오버플로우 방지 */
}

.timeline-content h5 {
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    font-weight: 300;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    font-family: 'Noto Sans KR', sans-serif;
}

.choice-context {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 25px;
    line-height: 1.7;
    font-weight: 300;
}

.choice-made {
    margin: 25px 0 20px;
}

.choice-made strong {
    font-weight: 400;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Noto Serif KR', serif;
    line-height: 1.6;
}

.choice-impact {
    font-style: italic;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    line-height: 1.7;
    font-weight: 300;
    font-family: 'Noto Serif KR', serif;
    word-wrap: break-word; /* 긴 단어 줄바꿈 */
    overflow-wrap: break-word; /* 오버플로우 방지 */
}

/* 엔딩 요약 */
.ending-summary {
    margin-bottom: 120px;
}

.ending-summary h4 {
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 70px;
    font-size: 0.8rem;
    font-weight: 200;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-family: 'Noto Sans KR', sans-serif;
}

.ending-card {
    background: transparent;
    padding: 70px 50px;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    text-align: center;
}

.ending-card h5 {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    font-weight: 100;
    letter-spacing: -0.5px;
    font-family: 'Noto Serif KR', serif;
}

.ending-type {
    display: inline-block;
    padding: 8px 24px;
    background: transparent;
    border-radius: 0;
    margin-bottom: 40px;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-transform: uppercase;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 200;
}

.ending-description {
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.45);
    font-size: 1.05rem;
    max-width: 480px;
    margin: 0 auto;
    font-weight: 300;
    font-family: 'Noto Serif KR', serif;
}

/* 통계 그리드 */
.statistics {
    margin-bottom: 0;
}

.statistics h4 {
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 70px;
    font-size: 0.8rem;
    font-weight: 200;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-family: 'Noto Sans KR', sans-serif;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item {
    background: transparent;
    padding: 60px 20px;
    border-radius: 0;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item:last-child {
    border-right: none;
}

.stat-label {
    display: block;
    font-size: 0.875rem; /* 최소 14px */
    color: rgba(255, 255, 255, 0.25);
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 200;
    font-family: 'Noto Sans KR', sans-serif;
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 100;
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Noto Serif KR', serif;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
}

/* 지나온 이야기 모달 스타일 - 간소화된 버전 */
.story-progress-simple {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid #FFD700;
}

.progress-list-simple {
    max-height: 300px;
    overflow-y: auto;
}

.progress-item-simple {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.progress-title-simple {
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.progress-choice-simple {
    color: #4CAF50;
    font-size: 0.9em;
    margin-left: 10px;
    opacity: 0.9;
}

.story-choices-simple {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.story-choice-simple {
    padding: 8px 12px;
    margin: 8px 0;
    background: rgba(76, 175, 80, 0.15);
    border-radius: 6px;
    color: #4CAF50;
    font-weight: 500;
}

.progress-more-simple {
    text-align: center;
    padding: 15px;
    color: #888;
    font-style: italic;
    margin-top: 10px;
}

/* 상세한 스토리 진행 스타일 */
.story-progress-detailed {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border-left: 4px solid #FFD700;
}

.progress-list-detailed {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.3) transparent;
}

.progress-list-detailed::-webkit-scrollbar {
    width: 8px;
}

.progress-list-detailed::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.progress-list-detailed::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
}

.progress-list-detailed::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

.progress-item-detailed {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border-left: 3px solid rgba(255, 215, 0, 0.3);
}

.progress-title-detailed {
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.progress-content-detailed {
    color: #E0E0E0;
    line-height: 1.6;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.95em;
}

.progress-dialogues-detailed {
    margin: 10px 0;
}

.dialogue-item {
    color: #87CEEB;
    font-style: italic;
    margin: 5px 0;
    padding: 5px 10px;
    border-left: 2px solid #87CEEB;
    background: rgba(135, 206, 235, 0.1);
    border-radius: 4px;
}

.dialogue-more {
    color: #999;
    font-size: 0.85em;
    margin-top: 5px;
    text-align: center;
}

.progress-choices-detailed {
    margin-top: 12px;
}

.progress-choice-selected {
    color: #4CAF50;
    font-weight: 600;
    margin: 8px 0;
    padding: 10px 15px;
    background: rgba(76, 175, 80, 0.2);
    border-radius: 6px;
    border-left: 4px solid #4CAF50;
}

.progress-more-detailed {
    text-align: center;
    padding: 20px;
    color: #888;
    font-style: italic;
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* 지나온 이야기 모달 스타일 - 대폭 개선 */
.story-history-modal .modal-content,
.previous-story-modal .modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden; /* 여기서는 숨기고 내부에서 스크롤 */
    display: flex;
    flex-direction: column;
}

.story-history-content,
.previous-story-content {
    margin: 0;
    flex: 1;
    overflow-y: auto;
    padding: 25px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    /* 스무스 스크롤 */
    scroll-behavior: smooth;
    /* 웹킷 기반 브라우저에서 스크롤 최적화 */
    -webkit-overflow-scrolling: touch;
    /* 스크롤바 스타일링 */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(255, 255, 255, 0.1);
}

/* 웹킷 스크롤바 커스텀 스타일 */
.story-history-content::-webkit-scrollbar,
.previous-story-content::-webkit-scrollbar {
    width: 8px;
}

.story-history-content::-webkit-scrollbar-track,
.previous-story-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.story-history-content::-webkit-scrollbar-thumb,
.previous-story-content::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
    opacity: 0.7;
}

.story-history-content::-webkit-scrollbar-thumb:hover,
.previous-story-content::-webkit-scrollbar-thumb:hover {
    background: var(--term-hover-color);
    opacity: 1;
}

.story-section-summary {
    margin-bottom: 30px;
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.08);
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
    /* 부드러운 그림자 효과 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.story-section-summary:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.story-section-summary h4 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
    /* 제목에 약간의 그림자 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.story-section-summary .section-text {
    font-size: 1.0em;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    /* 더 좋은 가독성을 위한 여백 */
    margin-bottom: 15px;
}

.story-section-summary .section-text p {
    margin-bottom: 12px;
    text-align: justify;
}

.story-section-summary .section-text p:last-child {
    margin-bottom: 0;
}

.story-section-summary .section-choice {
    margin-top: 15px;
    padding: 15px 18px;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    font-size: 0.9em;
    line-height: 1.6;
}

.story-section-summary .section-choice strong {
    color: #FFD700;
    font-weight: 700;
}

/* 스토리 히스토리 모달 헤더 */
.story-history-modal .modal-content > h3 {
    flex-shrink: 0;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-color);
    text-align: center;
    font-size: 1.4em;
    color: var(--accent-color);
}

/* 진행률 표시 */
.story-progress {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 챕터 구분선 */
.chapter-divider {
    margin: 30px 0;
    padding: 15px 0;
    text-align: center;
    border-top: 2px solid var(--accent-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.chapter-divider h3 {
    color: var(--accent-color);
    font-size: 1.3em;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .story-history-modal .modal-content,
    .previous-story-modal .modal-content {
        max-width: 95vw;
        width: 95vw;
        max-height: 95vh;
        margin: 10px auto;
    }
    
    .story-history-content,
    .previous-story-content {
        padding: 20px 15px;
    }
    
    .story-section-summary {
        padding: 15px 20px;
        margin-bottom: 25px;
    }
    
    .story-section-summary h4 {
        font-size: 1.1em;
    }
    
    .story-section-summary .section-text {
        font-size: 0.95em;
        line-height: 1.7;
    }
}

.story-history-btn, .story-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 14px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 5px;
    margin: 3px;
}

.story-history-btn:hover, .story-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

/* 불러오기 화면 슬롯 내부 버튼 */
.save-slot-btn .slot-buttons {
    margin-top: auto;
    display: flex;
    gap: 8px;
    padding: 0 5px; /* 좌우 패딩 추가 */
    flex-direction: column; /* 버튼을 세로로 배치 */
}

.save-slot-btn .load-btn {
    flex: 1;
    padding: 8px 16px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.save-slot-btn .load-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* 섹션 전환 애니메이션 */
.fade-in-section {
    animation: fadeInSection 0.8s ease-out forwards;
}

.chapter1-section-content,
.chapter2-section-content,
.chapter3-section-content,
.prologue-section-content {
    margin-bottom: 2rem;
    position: relative;
}

.section-scroll-marker {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
}

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

/* 선택지 섹션 애니메이션 */
.chapter-choice-section {
    animation: fadeInChoice 0.6s ease-out forwards;
}

@keyframes fadeInChoice {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 자동 저장 인디케이터 애니메이션 */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    20% {
        opacity: 1;
        transform: scale(1);
    }
    80% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* 페이드 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 저장 중 경험 개선 */
.save-in-progress {
    pointer-events: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.continuous-reading-mode {
    scroll-behavior: smooth;
}

/* 알림 토스트 */
.notification-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    font-size: 1rem;
    font-weight: 600;
    transition: bottom 0.3s ease;
    min-width: 250px;
    text-align: center;
}

.notification-toast.show {
    bottom: 30px;
}

/* 보고서 디자인 개선 */
.report-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.report-details {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 20px;
    overflow: visible; /* 콘텐츠가 잘리지 않도록 */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.report-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    position: relative;
}

.report-logo {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.report-header h3 {
    font-size: 2.5rem;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.report-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.report-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.meta-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
}

.meta-divider {
    display: none;
}

/* 철학자 섹션 개선 */
.philosophy-overview {
    padding: 40px;
    background: rgba(255, 255, 255, 0.03);
    margin: 20px;
    border-radius: 15px;
}

.philosopher-portrait {
    margin-bottom: 30px;
}

.philosophy-visual {
    margin: 30px 0;
}

.dominant-philosophy {
    text-align: center;
}

.philosophy-badge {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 700;
    margin-bottom: 15px;
}

.philosophy-badge.utilitarian {
    background: linear-gradient(45deg, #f093fb, #f5576c);
}

.philosophy-badge.rawlsian {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
}

.philosophy-badge.aristotelian {
    background: linear-gradient(45deg, #43e97b, #38f9d7);
}

/* 타임라인 개선 */
.choices-timeline {
    padding: 40px;
}

.timeline-enhanced {
    position: relative;
    padding-left: 40px;
}

.timeline-enhanced::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #FFD700, #FFA500);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    margin-left: 20px;
}

.timeline-marker {
    position: absolute;
    left: -45px;
    top: 25px;
    width: 30px;
    height: 30px;
    background: var(--bg-color);
    border: 3px solid #FFD700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}


.philosophy-score {
    margin: 20px 0;
    padding: 15px;
    background-color: #0a0a0a;
    border-radius: 5px;
}

.philosophy-score h4 {
    margin-bottom: 10px;
}

.score-bar {
    height: 20px;
    background-color: #333;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.score-fill {
    height: 100%;
    transition: width 1s ease-out;
}

.score-fill.utilitarian {
    background-color: rgba(255, 255, 255, 0.8);
}

.score-fill.rawlsian {
    background-color: rgba(255, 255, 255, 0.5);
}

.score-fill.aristotelian {
    background-color: rgba(255, 255, 255, 0.3);
}

.report-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 40px;
    padding-top: 100px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.report-buttons .btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.4);
    font-weight: 200;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 14px 35px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Noto Sans KR', sans-serif;
}

.report-buttons .btn-secondary:hover {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* 추가적인 보고서 시각 효과 */
.report-details::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: -1;
}

.report-details:hover::before {
    opacity: 0.5;
}

/* 애니메이션 효과 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 엔딩 컬렉션 모달 스타일 */
.ending-collection-modal .modal-content {
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.collection-progress {
    margin: 20px 0;
    text-align: center;
}

.collection-progress .progress-text {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.collection-progress .progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.collection-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin: 30px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.ending-badge {
    position: relative;
    padding: 15px 10px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
}

.ending-badge .badge-key {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
    font-family: 'Courier New', monospace;
}

.ending-badge .badge-name {
    font-size: 0.85em;
    opacity: 0.8;
    line-height: 1.2;
}

.ending-badge.badge-unlocked {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.1));
}

.ending-badge.badge-unlocked:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
    border-color: #FFD700;
}

.ending-badge.badge-locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.ending-badge.badge-locked .badge-name {
    content: '???';
}

.ending-badge .badge-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.8em;
}

.ending-badge.badge-unlocked .badge-icon {
    color: #FFD700;
}

/* 전체 컬렉션 달성 시 특별 효과 */
.collection-complete {
    animation: goldPulse 2s infinite;
}

@keyframes goldPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
    }
}

.report-header,
.philosophy-overview,
.choices-timeline,
.ending-summary,
.statistics {
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.philosophy-overview {
    animation-delay: 0.1s;
}

.choices-timeline {
    animation-delay: 0.2s;
}

.ending-summary {
    animation-delay: 0.3s;
}

.statistics {
    animation-delay: 0.4s;
}

/* 바 차트 애니메이션 */
.bar-fill {
    animation: expandWidth 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes expandWidth {
    from {
        width: 0;
    }
}

/* 타임라인 아이템 순차 애니메이션 */
.timeline-item {
    opacity: 0;
    animation: fadeInLeft 0.6s ease-out forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 통계 아이템 호버 효과 */
.stat-item {
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.01);
}

.stat-item:hover .stat-value {
    color: rgba(255, 255, 255, 1);
}

/* 철학 배지 호버 효과 */
.philosophy-badge:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 1);
}

/* 반응형 디자인 - 태블릿 */
@media (max-width: 1024px) {
    /* 태블릿에서 성별 선택 이미지 크기 조정 */
    .gender-image {
        width: 250px;
        height: 250px;
    }
    .container {
        max-width: 90%;
        padding: 20px;
    }
    
    .main-title {
        font-size: 3rem;
    }
    
    .text-content {
        font-size: 1.05em;
    }
    
    /* 태블릿에서 버튼 위치 조정 */
    .theme-selector {
        top: 15px;
        right: 15px;
    }
    
    .font-selector {
        top: 15px;
        right: 70px;
    }
    
    
    .game-menu {
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }
}

/* 반응형 디자인 - 모바일 */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 10px;
    }
    
    .main-title {
        font-size: 2.2rem;
        line-height: 1.3;
        margin-bottom: 20px;
    }
    
    .subtitle {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .genre-tag {
        font-size: 0.8rem;
        margin-bottom: 30px;
    }
    
    .intro-text {
        font-size: 1rem;
        margin: 30px 0 40px 0;
        line-height: 2;
    }
    
    .intro-text p {
        margin: 10px 0;
    }
    
    #userName {
        width: 100%;
        max-width: 280px;
    }
    
    .story-content {
        padding: 20px 10px;
    }
    
    .story-content h2 {
        font-size: 1.5rem;  /* 원래 크기로 복구 */
        margin-bottom: 20px;
    }
    
    .text-content {
        font-size: 1em;
        line-height: 1.8;
        text-align: left;
        padding: 0 5px;
    }
    
    .text-content h1 {
        font-size: 1.5em;
        margin: 30px 0 20px 0;
    }
    
    .text-content h2 {
        font-size: 1.3em;
        margin: 25px 0 20px 0;
        padding: 8px 15px;
    }
    
    .text-content h3 {
        font-size: 1.15em;
        margin: 20px 0 15px 0;
        padding: 8px 12px;
    }
    
    /* 대사와 지문 모바일 대응 */
    .text-content .dialogue {
        margin: 20px 0;
        padding-left: 15px;
    }
    
    .text-content .dialogue::before {
        width: 2px;
    }
    
    .text-content .scene-break {
        margin: 30px auto;
        width: 70%;
    }
    
    /* 성별 선택 모바일 대응 */
    .gender-content h2 {
        font-size: 2rem;
    }
    
    .gender-intro {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .gender-options {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .gender-btn {
        width: 100%;
        max-width: 340px;
        padding: 20px;
    }
    
    .gender-image {
        width: 180px;
        height: 180px;
        margin-bottom: 15px;
    }
    
    .gender-label {
        font-size: 1.2rem;
    }
}

/* 작은 모바일 화면 */
/* 작은 모바일 화면 최적화 */
@media (max-width: 480px) {
    /* 전체 컨테이너 여백 조정 */
    .container {
        padding: 5px;
        margin: 0;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* 스토리 섹션 여백 줄이기 */
    .story-section {
        padding: 10px 5px;
        margin: 8px 0;
        border-radius: 6px;
        width: 100%;
        box-sizing: border-box;
        border-width: 1px;
    }
    
    /* 텍스트 콘텐츠 여백 조정 */
    .text-content {
        padding: 5px;
        font-size: 0.95rem;
        line-height: 1.6;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        text-align: left;
        max-width: 100%;
    }
    
    .text-content p {
        margin-bottom: 12px;
        padding: 0 3px;
    }
    
    /* 이미지 컨테이너 최적화 */
    .story-image {
        margin: 10px -5px;
        padding: 0;
        width: calc(100% + 10px);
        max-width: calc(100% + 10px);
        overflow: hidden;
    }
    
    .story-image img {
        max-height: 45vh;
        width: 100%;
        height: auto;
        max-width: 100%;
        display: block;
        margin: 0 auto;
        object-fit: contain;
        border-radius: 4px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }
    
    
    
    /* 게임 메뉴 모바일 최적화 */
    .game-menu {
        top: 60px; /* 글씨 크기 버튼 아래 */
        right: 10px;
        left: auto;
        transform: none;
        gap: 6px;
        padding: 6px 10px;
        flex-direction: row;
        background: rgba(0, 0, 0, 0.9);
        max-width: calc(100vw - 80px);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .menu-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        flex-shrink: 0;
    }
    
    /* 모달 모바일 최적화 */
    .modal-content {
        width: calc(100vw - 20px);
        max-height: calc(90vh - 40px);
        padding: 20px 15px;
        margin: 20px auto;
        overflow-y: auto;
        box-sizing: border-box;
    }
    
    /* 설정 모달 그리드 조정 */
    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* 엔딩 컬렉션 그리드 조정 */
    .collection-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 10px;
    }
    
    .ending-badge {
        padding: 10px 5px;
    }
    
    .ending-badge .badge-key {
        font-size: 0.9em;
    }
    
    .ending-badge .badge-name {
        font-size: 0.7em;
    }
    
    /* 선택지 버튼 모바일 최적화 */
    .choice-btn {
        padding: 15px 12px !important;
        font-size: 0.95rem !important;
        min-height: 60px !important;
        margin: 8px 0 !important;
        border-width: 1px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .choice-btn .choice-text {
        font-size: 1rem;
        margin-bottom: 5px;
    }
    
    .choice-btn .choice-desc {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    /* 메인 선택지 버튼 조정 */
    .main-choice-btn {
        padding: 20px 15px !important;
        min-height: 80px !important;
        margin: 10px 0 !important;
        border-width: 2px;
    }
    
    .main-choice-btn .choice-label {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .main-choice-btn .choice-desc {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .choice-character {
        font-size: 0.85em;
    }
    
    .choice-text {
        font-size: 0.95em;
    }
    
    /* 성별 선택 버튼 */
    .gender-image {
        width: 140px;
        height: 140px;
    }
    
    .gender-btn {
        padding: 15px;
        min-height: 200px;
    }
    
    .gender-options {
        gap: 15px;
        flex-direction: column;
    }
    
    .gender-desc {
        font-size: 0.9rem;
    }
    
    /* 안내사항 페이지 */
    .notice-content {
        padding: 20px 10px;
    }
    
    .notice-content h2 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .notice-intro {
        font-size: 1rem;
        margin-bottom: 25px;
    }
    
    .notice-section {
        margin: 20px 0;
        padding: 15px;
    }
    
    .notice-section h3 {
        font-size: 1.1rem;
    }
    
    .notice-subsection {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .notice-subsection h4 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .notice-subsection p {
        font-size: 0.95rem;
        margin: 6px 0;
    }
    
    /* 저장/불러오기 슬롯 */
    .save-slot {
        padding: 16px;
        min-height: 70px;
    }
    
    .save-slot-info {
        font-size: 0.85em;
    }
    
    /* 보고서 페이지 모바일 */
    .report-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .report-buttons button {
        width: 100%;
        padding: 14px;
        min-height: 48px;
    }
    
    /* 철학자 섹션 */
    .philosopher-section {
        padding: 15px;
    }
    
    .philosopher-image img {
        width: 70px;
        height: 70px;
    }
    
    /* 모바일에서 클릭 힌트 항상 표시 */
    .click-hint {
        animation: none;
        opacity: 0.8;
    }
    
    .interaction-hint {
        font-size: 0.8rem;
        padding: 8px;
    }
    
    /* 기본 버튼들 */
    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 320px; /* 최대 너비 증가 */
        margin: 10px auto; /* 여백 증가 */
        padding: 18px 25px; /* 패딩 증가 */
        min-height: 50px; /* 최소 높이 추가 */
        font-size: 1.1rem; /* 글씨 크기 약간 증가 */
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        line-height: 1.4;
    }
    
    /* 입력 필드 - iOS & Android 자동 줌 방지 */
    input[type="text"], 
    input[type="email"], 
    select, 
    textarea {
        font-size: 16px !important; /* 자동 줌 방지를 위해 중요 */
        padding: 12px;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        border-radius: 8px;
    }
    
    /* 토글 스위치 크기 증가 */
    .toggle-switch {
        width: 50px;
        height: 28px;
    }
    
    .toggle-switch:before {
        width: 24px;
        height: 24px;
    }
    
    /* 폰트 선택 드롭다운 */
    .font-select {
        padding: 12px;
        font-size: 16px;
    }
    
    .choice-button {
        font-size: 1rem;
        padding: 20px 15px;
        margin: 10px 0;
        text-align: center;
    }
    
    .choice-icon {
        font-size: 1.5rem;
        display: block;
        margin-bottom: 5px;
    }
    
    .report-buttons {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .btn-primary, .btn-secondary {
        font-size: 1rem;
        padding: 15px 25px;
        width: 100%;
        max-width: 300px;
    }
    
    .notice-buttons {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .notice-buttons button {
        width: 100%;
        max-width: 300px;
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    #userName {
        width: 100%;
        max-width: 300px;
        font-size: 1rem;
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .name-input-container {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .name-input-container label {
        margin-bottom: 10px;
        font-size: 1rem;
    }
    
    .name-input-help {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }
    
    .ending-content {
        padding: 20px;
        margin: 20px 0;
    }
    
    .ending-content h3 {
        font-size: 1.3rem;
    }
}

/* 가로 모드 대응 */
@media (max-width: 768px) and (orientation: landscape) {
    /* 상단 버튼들을 더 위로 */
    .theme-selector {
        top: 10px;
    }
    
    .font-selector {
        top: 10px;
        left: 60px;
    }
    
    
    /* 컨테이너 패딩 줄이기 */
    .container {
        padding: 10px 20px;
    }
    
    .main-content {
        padding: 30px 20px;
        min-height: auto;
    }
}

/* 초소형 모바일 (iPhone SE 등) */
@media (max-width: 375px) {
    /* 매우 좁은 화면에서 추가 최적화 */
    .container {
        padding: 5px;
    }
    
    .story-section {
        padding: 10px 5px;
        margin: 8px 0;
    }
    
    .main-title {
        font-size: 1.8rem;
        padding: 15px 10px;
    }
    
    .subtitle {
        font-size: 0.9rem;
        padding: 10px;
    }
    
    .text-content {
        font-size: 0.9rem;
        line-height: 1.6;
        padding: 8px;
    }
    
    /* 선택지 버튼 추가 최적화 */
    .choice-btn {
        padding: 12px 10px !important;
        font-size: 0.9rem !important;
        min-height: 50px !important;
        margin: 6px 0 !important;
    }
    
    .choice-btn .choice-text {
        font-size: 0.95rem;
    }
    
    .choice-btn .choice-desc {
        font-size: 0.8rem;
    }
    
    /* 메인 선택지 버튼 추가 최적화 */
    .main-choice-btn {
        padding: 18px 12px !important;
        min-height: 70px !important;
    }
    
    .main-choice-btn .choice-label {
        font-size: 1rem;
    }
    
    .main-choice-btn .choice-desc {
        font-size: 0.85rem;
    }
    
    /* 이미지 크기 추가 제한 */
    .story-image img {
        max-height: 40vh;
    }
    
    /* 모달 콘텐츠 최적화 */
    .modal-content {
        margin: 10px;
        padding: 15px;
        max-width: calc(100% - 20px);
        max-height: calc(90vh - 20px);
    }
    
    /* 챕터 선택 버튼 */
    .choice-button {
        font-size: 0.9rem;
        padding: 15px 10px;
        margin: 8px 0;
    }
    
    /* 페이지 하단 버튼들 */
    #toChapter1Btn,
    #toReportBtn,
    #restartBtn,
    #saveImageBtn,
    #otherStoriesBtn {
        margin-bottom: 20px; /* 하단 여백 추가 */
    }
    
    /* 버튼들 더 작게 */
    .theme-btn,
    .font-btn {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    
    
    .menu-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    /* 게임 메뉴 패딩 줄이기 */
    .game-menu {
        padding: 8px 12px;
        gap: 8px;
    }
    
    /* 안내화면 추가 최적화 */
    .notice-content {
        padding: 15px 8px;
    }
    
    .notice-content h2 {
        font-size: 1.5rem;
    }
    
    .notice-section {
        padding: 12px;
        margin: 15px 0;
    }
    
    .notice-subsection {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .notice-subsection h4 {
        font-size: 0.95rem;
    }
    
    .notice-subsection p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    /* 심층분석보고서 추가 최적화 */
    .report-content {
        padding: 15px 8px;
    }
    
    .report-content h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .report-details {
        padding: 15px 10px;
        margin: 0 5px 25px;
    }
    
    .stat-item h4 {
        font-size: 0.9rem;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
}

/* 초소형 화면 (320px) 추가 최적화 */
@media (max-width: 320px) {
    /* 전체 레이아웃 조정 */
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 10px 8px;
        padding-bottom: 140px; /* 하단 메뉴 공간 */
        width: 100%;
        box-sizing: border-box;
    }
    
    .story-section {
        padding: 10px 8px;
        margin: 8px 0;
        box-sizing: border-box;
    }
    
    /* 제목과 부제목 */
    .main-title {
        font-size: 1.5rem;
        padding: 12px 8px;
    }
    
    .subtitle {
        font-size: 0.85rem;
        padding: 8px;
    }
    
    /* 텍스트 콘텐츠 */
    .text-content {
        font-size: 0.875rem;
        line-height: 1.5;
        padding: 8px;
        word-break: keep-all; /* 한글 단어 유지 */
    }
    
    /* 이미지 최적화 */
    .story-image {
        margin: 8px 0;
        width: 100%;
        max-width: 100%;
    }
    
    .story-image img {
        max-height: 35vh;
        width: 100%;
        height: auto;
        object-fit: contain;
        border-radius: 3px;
    }
    
    /* 선택지 버튼 극소화 */
    .choice-btn {
        padding: 12px 10px !important;
        font-size: 0.875rem !important;
        min-height: 48px !important;
        margin: 8px 0 !important;
        border-radius: 5px;
    }
    
    .choice-btn .choice-text {
        font-size: 0.9rem;
        margin-bottom: 3px;
    }
    
    .choice-btn .choice-desc {
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    /* 메인 선택지 버튼 */
    .main-choice-btn {
        padding: 15px 10px !important;
        min-height: 60px !important;
        margin: 8px 0 !important;
    }
    
    .main-choice-btn .choice-label {
        font-size: 0.95rem;
        margin-bottom: 5px;
    }
    
    .main-choice-btn .choice-desc {
        font-size: 0.8rem;
        line-height: 1.4;
    }
    
    /* 모달 극소화 */
    .modal-content {
        margin: 10px;
        padding: 15px;
        max-width: calc(100% - 20px);
        font-size: 0.875rem;
    }
    
    /* 버튼 크기 조정 */
    .btn-primary, .btn-secondary {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    /* 메뉴 버튼 */
    .menu-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* 게임 메뉴 */
    .game-menu {
        padding: 8px 10px;
        gap: 8px;
    }
    
    /* 안내화면 추가 최적화 */
    .notice-content {
        padding: 12px 5px;
    }
    
    .notice-content h2 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .notice-intro {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .notice-section {
        padding: 10px;
        margin: 12px 0;
    }
    
    .notice-section h3 {
        font-size: 1rem;
    }
    
    .notice-subsection {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .notice-subsection h4 {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .notice-subsection p {
        font-size: 0.85rem;
        line-height: 1.5;
        margin: 5px 0;
    }
    
    .notice-buttons button {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    /* 심층분석보고서 추가 최적화 */
    .report-content {
        padding: 12px 5px;
    }
    
    .report-content h2 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .report-details {
        padding: 12px 8px;
        margin: 0 3px 20px;
        border-radius: 8px;
    }
    
    .report-header {
        padding: 20px 15px;
    }
    
    .philosophy-score {
        gap: 10px;
    }
    
    .score-item {
        padding: 12px;
    }
    
    .score-item h4 {
        font-size: 0.9rem;
    }
    
    .score-value {
        font-size: 1.5rem;
    }
    
    .stat-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-item {
        padding: 10px;
    }
    
    .stat-item h4 {
        font-size: 0.85rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .report-buttons {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .report-buttons button {
        width: 100%;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* 로딩 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page.active > * {
    animation: fadeIn 0.8s ease-out;
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* 전체화면 모드 스타일 */
:fullscreen {
    background-color: var(--bg-color);
}

:-webkit-full-screen {
    background-color: var(--bg-color);
}

:-moz-full-screen {
    background-color: var(--bg-color);
}

:-ms-fullscreen {
    background-color: var(--bg-color);
}

/* 전체화면에서 컨테이너 최대 너비 증가 */
:fullscreen .container {
    max-width: 1000px;
}

:-webkit-full-screen .container {
    max-width: 1000px;
}

:-moz-full-screen .container {
    max-width: 1000px;
}

:-ms-fullscreen .container {
    max-width: 1000px;
}

/* 설정 버튼 그룹 - 스토리 영역을 가리지 않도록 외곽에 배치 */
/* 테마 선택기 스타일 */
.theme-selector {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9999;
}

/* 폰트 선택기 스타일 */
.font-selector {
    position: fixed;
    top: 10px;
    right: 60px;
    z-index: 9999;
}

/* 메뉴 구분선 스타일 */
.menu-separator {
    width: 1px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 0 8px;
    align-self: center;
}

/* 게임 메뉴 스타일 - 우측 상단 고정 */
.game-menu {
    position: fixed;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: transparent;
    padding: 0;
    border-radius: 0;
    backdrop-filter: none;
    border: none;
}

/* 게임 메뉴 반응형 위치 조정 */
@media (max-width: 768px) {
    .game-menu {
        top: 8px !important;
        right: 8px !important;
        gap: 6px !important;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .game-menu {
        top: 10px !important;
        right: 10px !important;
        gap: 7px !important;
    }
}

@media (min-width: 1201px) {
    .game-menu {
        top: 15px !important;
        right: 15px !important;
        gap: 8px !important;
    }
}

/* 메뉴 토글 버튼 (항상 보임) - PC & 모바일 공통 */
.menu-toggle {
    z-index: 9999;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: none !important;
    opacity: 0.9;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.menu-toggle:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.5) !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

.menu-toggle .menu-icon {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.9);
    opacity: 1;
}

.menu-toggle.active .menu-icon {
    transform: rotate(90deg);
}

/* 메뉴 그룹 (접히는 부분) - 오른쪽 아래로 펼쳐짐 */
.menu-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(70px, 1fr)); /* 최소 너비 보장 */
    gap: 12px; /* 적절한 간격 */
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.98), rgba(40, 40, 40, 0.98));
    border-radius: 20px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7); /* 그림자 강화 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top right;
    position: fixed; /* fixed로 유지 */
    top: 60px; /* 토글 버튼 아래 위치 (토글 버튼이 10px + 40px 높이) */
    right: 10px; /* 우측 정렬 */
    
    /* 기본 상태: 강제로 숨김 */
    max-height: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    transform: scale(0.8) translateY(-10px) !important;
    visibility: hidden !important;
    width: auto;
    box-sizing: border-box;
}

/* 메뉴 펼친 상태 - 화면 충분히 활용 */
.menu-group.expanded {
    max-height: calc(100vh - 100px) !important; /* 뷰포트 높이의 대부분 사용 */
    max-width: min(450px, calc(100vw - 40px)) !important; /* 최대 450px로 증가 */
    width: auto !important;
    padding: 25px !important; /* 충분한 패딩 */
    opacity: 1 !important;
    transform: scale(1) translateY(0) !important;
    visibility: visible !important;
    overflow-y: auto !important; /* 내용이 많을 경우 스크롤 */
    overflow-x: hidden !important;
}

/* 메뉴 아이템 애니메이션 */
.menu-group.expanded .menu-btn {
    animation: slideInRight 0.3s ease backwards;
}

.menu-group.expanded .menu-btn:nth-child(1) { animation-delay: 0.05s; }
.menu-group.expanded .menu-btn:nth-child(2) { animation-delay: 0.1s; }
.menu-group.expanded .menu-btn:nth-child(3) { animation-delay: 0.15s; }
.menu-group.expanded .menu-btn:nth-child(4) { animation-delay: 0.2s; }
.menu-group.expanded .menu-btn:nth-child(5) { animation-delay: 0.25s; }
.menu-group.expanded .menu-btn:nth-child(6) { animation-delay: 0.3s; }
.menu-group.expanded .menu-btn:nth-child(7) { animation-delay: 0.35s; }

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 모바일 환경 최적화 */
@media (max-width: 768px) {
    /* 메뉴 버튼 터치 최적화 - 최소 44px 터치 영역 확보 */
    .menu-toggle {
        width: 44px !important;
        height: 44px !important;
        opacity: 0.8 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        border: none !important;
        background: rgba(0, 0, 0, 0.5) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        /* 터치 영역 확장 */
        position: relative;
    }
    
    /* 터치 영역을 실제 버튼보다 크게 */
    .menu-toggle::before {
        content: '';
        position: absolute;
        top: -6px;
        left: -6px;
        right: -6px;
        bottom: -6px;
        background: transparent;
        border-radius: 12px;
    }

    .menu-toggle:active {
        opacity: 1 !important;
        transform: scale(0.95);
        background: rgba(0, 0, 0, 0.7) !important;
    }

    .menu-toggle .menu-icon {
        font-size: 1.1rem !important;
        color: rgba(255, 255, 255, 0.9) !important;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

    /* 메뉴 그룹 터치 최적화 */
    .menu-group {
        min-width: 140px !important;
        border-radius: 12px !important;
        background: rgba(0, 0, 0, 0.9) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
        top: 50px !important; /* 버튼과 적절한 거리 */
    }

    .menu-group.expanded {
        padding: 10px !important;
        gap: 10px !important;
        max-height: 320px !important;
    }

    /* 메뉴 버튼들 터치 최적화 - 최소 44px 터치 영역 */
    .menu-btn {
        width: 44px !important;
        height: 44px !important;
        font-size: 0.9rem !important;
        padding: 0 !important;
        border-radius: 8px !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        color: rgba(255, 255, 255, 0.9) !important;
        transition: all 0.2s ease !important;
        /* 터치 피드백 개선 */
    }
    
    /* 메뉴 버튼 터치 시 피드백 */
    .menu-btn:active {
        transform: scale(0.95) !important;
        background: rgba(255, 255, 255, 0.2) !important;
        border-color: rgba(255, 255, 255, 0.3) !important;
    }
    
    /* 메뉴 아이콘 중앙 정렬 */
    .menu-btn .menu-icon {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 100% !important;
        font-weight: 600 !important;
        text-align: center !important;
        line-height: 1 !important;
    }
    
    /* 모든 버튼 텍스트 중앙 정렬 */
    .menu-btn,
    .btn-primary,
    .btn-secondary,
    .choice-btn,
    .main-choice-btn,
    .continue-btn {
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1.3 !important;
    }
    
    /* 성별 선택 버튼 이미지-텍스트 간격 개선 */
    .gender-btn {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 12px !important;
        padding: 20px 15px !important;
    }
    
    .gender-image {
        margin-bottom: 8px !important;
    }
    
    .gender-label {
        margin-bottom: 6px !important;
        text-align: center !important;
    }
    
    .gender-desc {
        text-align: center !important;
        line-height: 1.4 !important;
    }
    
    /* 철학자 섹션 이미지-텍스트 균형 */
    .philosopher-section {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 20px 15px !important;
        gap: 10px !important;
    }
    
    .philosopher-image {
        margin: 0 auto 12px !important;
        flex-shrink: 0 !important;
    }
    
    .philosopher-info {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
    .philosopher-name {
        margin-bottom: 8px !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .philosopher-description {
        text-align: center !important;
        line-height: 1.5 !important;
        margin-top: 6px !important;
        padding: 0 8px !important;
        width: 100% !important;
    }
    
    /* 철학자 섹션 가로 레이아웃 (태블릿) */
    @media (min-width: 480px) and (max-width: 768px) {
        .philosopher-section {
            flex-direction: row !important;
            text-align: left !important;
            gap: 20px !important;
        }
        
        .philosopher-image {
            margin: 0 !important;
            width: 100px !important;
            height: 100px !important;
        }
        
        .philosopher-info {
            flex: 1 !important;
            align-items: flex-start !important;
        }
        
        .philosopher-name,
        .philosopher-description {
            text-align: left !important;
            padding-left: 0 !important;
        }
    
        /* 모바일에서만 스크롤 중에는 완전 투명 (읽기 방해 없도록) */
        .game-menu.hide-on-scroll,
        .scrolling .game-menu {
            opacity: 0 !important;
            pointer-events: none !important;
            transition: opacity 0.3s ease !important;
        }

        /* 모바일에서만 스토리 페이지에서 초기 상태는 거의 투명 */
        .page:not(#main):not(#notice):not(#gender) .game-menu {
            opacity: 0.2 !important;
            transition: opacity 0.3s ease !important;
        }

        /* 모바일에서만 메뉴가 펼쳐진 상태가 아니면 더 투명하게 */
        .page:not(#main):not(#notice):not(#gender) .game-menu:not(.menu-expanded) {
            opacity: 0.15 !important;
        }

        /* 모바일에서만 터치/활성 상태에서만 완전 불투명 */
        .page:not(#main):not(#notice):not(#gender) .game-menu:active,
        .page:not(#main):not(#notice):not(#gender) .game-menu.menu-expanded,
        .page:not(#main):not(#notice):not(#gender) .game-menu:hover {
            opacity: 0.95 !important;
        }

        /* 모바일에서만 5초 후 자동 숨김 (읽기 집중을 위해) */
        .page:not(#main):not(#notice):not(#gender) .game-menu.auto-hide {
            opacity: 0.05 !important;
            transition: opacity 1s ease !important;
        }
}

.game-menu::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 30px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
}

.game-menu:hover::before {
    opacity: 1;
}

/* 스토리 페이지에서 버튼 설정 */
.page:not(#main):not(#notice):not(#gender) .game-menu {
    opacity: 0.8; /* 데스크톱에서도 잘 보이도록 0.3에서 0.8로 증가 */
    transition: opacity 0.3s ease;
}

.page:not(#main):not(#notice):not(#gender) .game-menu:hover {
    opacity: 1;
}

/* 스크롤 시 버튼 자동 숨김 */
.scrolling .game-menu {
    opacity: 0.2;
    pointer-events: none;
}


.theme-btn,
.font-btn,
.menu-btn {
    background: linear-gradient(145deg, rgba(30, 30, 58, 0.95), rgba(21, 21, 41, 0.90)) !important;
    border: 1px solid rgba(255, 215, 0, 0.25) !important;
    border-radius: 16px !important;
    width: auto; /* 텍스트에 맞게 자동 조절 */
    min-width: 48px !important;
    height: 48px !important;
    cursor: pointer;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* 아이콘과 텍스트 간격 줄임 */
    padding: 0 10px !important; /* 좌우 패딩 줄임 */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 215, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px) !important;
    position: relative;
    overflow: hidden;
}

/* 메뉴 버튼 미묘한 빛나는 효과 */
.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent
    );
    transition: left 0.5s ease;
    z-index: 1;
}

.menu-btn:hover::before {
    left: 100%;
}

/* 아이콘과 텍스트를 빛나는 효과 위로 */
.menu-btn .menu-icon,
.menu-btn .menu-label {
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

/* 메뉴 아이콘 스타일 */
.menu-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* 메뉴 라벨 스타일 */
.menu-label {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

/* 작은 화면에서 메뉴 버튼 최적화 */
@media (max-width: 768px) {
    .menu-icon {
        font-size: 1rem !important;
    }
    
    .menu-label {
        font-size: 0.75rem !important;
    }
}

@media (max-width: 480px) and (min-width: 321px) {
    /* 매우 작은 화면에서는 아이콘만 표시 (320px 제외) */
    .menu-label {
        display: none !important;
    }
    
    .menu-icon {
        font-size: 1.2rem !important;
        line-height: 1 !important;
    }
    
    .menu-btn {
        min-width: 40px !important;
        padding: 8px !important;
        justify-content: center !important;
        flex-direction: column !important;
        gap: 0 !important;
    }
    
    .menu-group {
        gap: 8px !important;
        grid-template-columns: repeat(3, minmax(40px, 1fr)) !important;
    }
    
    /* 기타 버튼들도 작게 조정 */
    .btn-primary, .btn-secondary {
        padding: 10px 16px !important;
        font-size: 0.9rem !important;
    }
}

@media (max-width: 360px) {
    /* 극소형 화면에서는 아이콘 더 작게 */
    .menu-icon {
        font-size: 0.9rem !important;
    }
    
    .menu-btn {
        min-width: 32px !important;
        padding: 4px !important;
        margin: 2px !important;
        gap: 3px !important;
    }
    
    /* 매우 작은 화면에서는 텍스트 크기 더 줄임 */
    .menu-label {
        font-size: 9px !important;
    }
    
    .menu-group {
        gap: 6px !important;
        grid-template-columns: repeat(3, minmax(36px, 1fr)) !important;
    }
    
    /* 선택지 버튼도 작게 조정 */
    .choice-btn {
        padding: 15px 20px !important;
        font-size: 1rem !important;
        min-height: 60px !important;
    }
}

/* 글씨 크기 조절 버튼 특별 스타일 */
.size-decrease,
.size-increase {
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(135deg, rgba(50, 50, 55, 0.9), rgba(70, 70, 75, 0.9));
    border: 2px solid rgba(255, 215, 0, 0.4);
}

/* 위에서 이미 정의됨 - 중복 제거 */


.font-btn {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
}

.theme-btn:hover {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.95), rgba(255, 165, 0, 0.85)) !important;
    transform: translateY(-2px) rotate(15deg) scale(1.05) !important;
    border-color: rgba(255, 215, 0, 0.8) !important;
    color: #1a1a1a !important;
    box-shadow: 
        0 12px 35px rgba(255, 215, 0, 0.3),
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.font-btn:hover {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.95), rgba(255, 165, 0, 0.85)) !important;
    transform: translateY(-2px) scale(1.1) !important;
    border-color: rgba(255, 215, 0, 0.8) !important;
    color: #1a1a1a !important;
    box-shadow: 
        0 12px 35px rgba(255, 215, 0, 0.3),
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.size-decrease:hover,
.size-increase:hover {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    transform: scale(1.1);
    border-color: #FFA500;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.size-decrease:hover .menu-icon,
.size-increase:hover .menu-icon {
    color: #000000 !important;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

.menu-btn:hover {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.95), rgba(255, 165, 0, 0.85)) !important;
    transform: translateY(-2px) scale(1.05) !important;
    border-color: rgba(255, 215, 0, 0.8) !important;
    color: #1a1a1a !important;
    box-shadow: 
        0 12px 35px rgba(255, 215, 0, 0.3),
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(15px) !important;
}

.menu-btn:hover .menu-icon {
    color: #1a1a1a !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6) !important;
    transform: scale(1.1) !important;
}

.menu-btn:hover .menu-label {
    color: #1a1a1a !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4) !important;
}


.theme-options,
.font-options {
    position: absolute;
    top: 60px;
    right: 0;
    background-color: var(--secondary-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    display: none;
    min-width: 150px;
}

.font-options {
    min-width: 180px;
}

.theme-options.show,
.font-options.show {
    display: block;
}

.theme-option,
.font-option {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.theme-option:hover,
.font-option:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

/* 커스텀 테마 모달 & 설정 모달 & 효과 모달 */
.custom-theme-modal,
.settings-modal,
.effects-modal,
.save-modal,
.load-modal,
.modal {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none !important;
    align-items: center;
    justify-content: center;
    z-index: 15000; /* 설정창(10000)보다 높게 설정 */
}

.custom-theme-modal.show,
.settings-modal.show,
.effects-modal.show,
.save-modal.show,
.load-modal.show,
.modal.show {
    display: flex !important;
}

/* JavaScript 인라인 스타일이 우선권을 가지도록 함 */
.custom-theme-modal[style*="display: none"],
.settings-modal[style*="display: none"],
.effects-modal[style*="display: none"],
.save-modal[style*="display: none"],
.load-modal[style*="display: none"],
.modal[style*="display: none"] {
    display: none !important;
}

/* 강제 숨김 클래스 - 최고 우선순위 */
.force-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    z-index: -999999 !important;
    pointer-events: none !important;
}

.modal-content {
    background-color: var(--secondary-bg);
    padding: 30px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    max-width: 400px;
    width: 90%;
    position: relative; /* X 버튼 위치 설정용 */
}

/* 모달 X 닫기 버튼 - 모든 화면 크기에서 일관된 세련된 디자인 */
.modal-close-x {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(145deg, rgba(30, 30, 58, 0.95), rgba(21, 21, 41, 0.90)) !important;
    border: 2px solid rgba(255, 215, 0, 0.25) !important;
    border-radius: 50% !important;
    color: rgba(255, 215, 0, 0.95) !important;
    font-size: 18px;
    cursor: pointer;
    width: 40px !important;
    height: 40px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 10001;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 215, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-close-x:hover {
    background: linear-gradient(145deg, rgba(60, 20, 20, 0.95), rgba(40, 10, 10, 0.90)) !important;
    border-color: rgba(255, 100, 100, 0.4) !important;
    color: rgba(255, 255, 255, 1) !important;
    transform: scale(1.1);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 100, 100, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 모바일에서 X 버튼 크기 조정 */
@media (max-width: 768px) {
    .modal-close-x {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
        top: 10px;
        right: 10px;
        /* 터치 영역 확장 */
        position: relative;
    }
    
    /* 모달 X 버튼 터치 영역 확장 */
    .modal-close-x::before {
        content: '';
        position: absolute;
        top: -6px;
        left: -6px;
        right: -6px;
        bottom: -6px;
        background: transparent;
        border-radius: 50%;
    }
    
    /* 모달 내 설정 요소들 터치 최적화 */
    .theme-select-btn {
        min-height: 80px !important;
        padding: 15px 12px !important;
        border-radius: 10px !important;
        margin: 8px 0 !important;
    }
    
    .toggle-switch {
        width: 56px !important;
        height: 32px !important;
        border-radius: 16px !important;
        /* 터치 영역 확장을 위한 마진 */
        margin: 8px 12px 8px 0 !important;
    }
    
    .toggle-switch::after {
        width: 26px !important;
        height: 26px !important;
        top: 3px !important;
        left: 3px !important;
    }
    
    .toggle-label input[type="checkbox"]:checked + .toggle-switch::after {
        transform: translateX(24px) !important;
    }
    
    /* 토글 레이블 터치 영역 확장 */
    .toggle-label {
        padding: 12px 8px !important;
        margin: 4px 0 !important;
        border-radius: 8px !important;
        background: rgba(255, 255, 255, 0.02) !important;
        cursor: pointer !important;
        /* 터치하기 쉽게 영역 확장 */
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* 폰트 선택 드롭다운 터치 최적화 */
    .font-select {
        min-height: 48px !important;
        padding: 12px 16px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
        margin: 8px 0 !important;
    }
    
    /* 설정 섹션 버튼들 터치 최적화 */
    .settings-section button {
        min-height: 48px !important;
        padding: 12px 16px !important;
        font-size: 1rem !important;
        border-radius: 8px !important;
        margin: 8px 0 !important;
    }
    
    /* 저장/불러오기 슬롯 터치 최적화 */
    .save-slot,
    .save-slot-btn {
        min-height: 60px !important;
        padding: 12px !important;
        margin: 8px 0 !important;
        border-radius: 10px !important;
        /* 터치 피드백 */
        transition: all 0.2s ease !important;
    }
    
    .save-slot:active,
    .save-slot-btn:active {
        transform: scale(0.98) !important;
        background-color: rgba(255, 255, 255, 0.1) !important;
    }
    
    /* 슬롯 내부 텍스트 터치 최적화 */
    .slot-info {
        padding: 8px 12px !important;
        word-break: keep-all !important;
        word-wrap: break-word !important;
    }
    
    .slot-username,
    .slot-progress,
    .slot-date {
        word-break: keep-all !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 2px 0 !important;
    }
    
    /* 빈 슬롯 표시 개선 */
    .save-slot.empty {
        min-height: 60px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.95rem !important;
        opacity: 0.7 !important;
    }
}

/* 모바일에서 모달 최적화 */
@media (max-width: 768px) {
    .modal-content {
        padding: 20px 15px;
        width: 95%;
        max-width: none;
        max-height: 85vh;
        overflow-y: auto;
        margin: 20px;
        font-size: 0.95rem;
    }
    
    /* 모달 제목 */
    .modal-content h3 {
        font-size: 1.2rem;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--border-color);
    }
    
    /* 모달 내부 섹션 */
    .modal-content .setting-group {
        margin-bottom: 15px;
        padding: 10px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 8px;
    }
    
    /* 모달 버튼들 */
    .modal-content button {
        padding: 12px 20px;
        font-size: 0.95rem;
        width: 100%;
        margin-bottom: 10px;
    }
}

.modal-content h3 {
    color: var(--accent-color);
    margin-bottom: 20px;
    text-align: center;
}

.color-setting {
    margin: 15px 0;
}

.color-setting label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-color);
}

.color-setting input[type="color"] {
    width: 50px;
    height: 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* 모바일 대응 - 개선된 버전 */
@media (max-width: 768px) {
    /* 컨테이너 모바일 최적화 - 좌우 공간 더 활용 */
    .container {
        padding: 20px 16px 150px 16px; /* 적절한 좌우 패딩 */
        max-width: 100%; /* 모바일에서 전체 너비 사용 */
        word-break: keep-all !important; /* 한글 단어 중간 줄바꿈 방지 */
        word-wrap: normal !important; /* 단어 단위로만 줄바꿈 */
    }
    
    /* 모든 텍스트 요소에 한글 단어 유지 적용 */
    p, span, div, h1, h2, h3, h4, h5, h6, button, label, 
    .choice-btn, .menu-btn, .modal-content {
        word-break: keep-all !important;
        overflow-wrap: normal !important;
    }
    
    /* 선택지 버튼 텍스트 */
    .choice-btn {
        word-break: keep-all !important;
        line-height: 1.5 !important;
    }
    
    /* 설정 버튼들을 우측 상단에 더 컴팩트하게 배치 */
    .theme-selector {
        position: fixed;
        top: 5px;
        right: 5px;
        z-index: 9000;
    }
    
    .font-selector {
        position: fixed;
        top: 5px;
        right: 50px;
        z-index: 9000;
    }
    
    
    /* 게임 메뉴는 우측 상단 유지 (모바일에서도) */
    .game-menu {
        position: fixed;
        top: 10px !important;
        right: 10px !important;
        bottom: auto !important;
        transform: none;
        flex-direction: column !important;
        align-items: flex-end;
        gap: 8px;
        padding: 0;
        background: transparent;
        max-width: none;
        border: none;
        z-index: 9998;
    }
    
    /* 메뉴 그룹 - 모바일에서도 오른쪽 아래로 펼쳐짐 */
    .menu-group {
        position: fixed !important;
        top: 55px !important; /* 토글 버튼 아래 (35px 버튼 + 10px top + 10px 간격) */
        bottom: auto !important;
        right: 10px !important;
        left: 10px !important; /* 모바일에서는 좌우 전체 활용 */
        transform-origin: top right !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important; /* 2열 그리드 */
        gap: 10px !important; /* 적절한 터치 간격 */
    }
    
    .menu-group.expanded {
        padding: 20px !important; /* 충분한 패딩 */
        max-width: none !important; /* 최대 너비 제한 없음 */
        width: calc(100vw - 20px) !important; /* 전체 너비 사용 */
        max-height: calc(100vh - 100px) !important; /* 높이 충분히 */
        background: rgba(26, 26, 26, 0.98) !important;
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9) !important;
        border-radius: 15px !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: scale(1) translateY(0) !important;
        overflow-y: auto !important; /* 스크롤 가능 */
        overflow-x: hidden !important;
        z-index: 10000 !important; /* 최상위 */
    }
    
    /* 메뉴 버튼 모바일 크기 및 설명 추가 */
    .menu-btn {
        width: auto !important; /* 너비 자동 */
        min-width: 80px !important; /* 최소 너비 축소 */
        height: 48px !important; /* 적절한 높이 */
        font-size: 1rem !important;
        padding: 6px 10px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
    }
    
    /* 모바일에서 메뉴 아이콘과 텍스트 함께 표시 */
    .menu-btn::before {
        content: attr(title) !important;
        display: block !important;
        font-size: 0.75rem !important;
        margin-top: 4px !important;
        opacity: 0.9 !important;
        font-weight: 400 !important;
    }
    
    /* 모바일에서 툴팁 비활성화 */
    .menu-btn::after {
        display: none;
    }
    
    
    .theme-btn,
    .font-btn {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }
    
    
    /* 옵션 메뉴 위치 조정 */
    .theme-options,
    .font-options {
        position: absolute;
        top: auto;
        left: 60px;
        right: auto;
        bottom: 0;
    }
    
}

/* 폰트 클래스 */
body.font-NotoSans {
    font-family: 'Noto Sans KR', sans-serif;
}

body.font-NotoSerif {
    font-family: 'Noto Serif KR', serif;
}

body.font-NanumGothic {
    font-family: 'Nanum Gothic', sans-serif;
}

body.font-NanumMyeongjo {
    font-family: 'Nanum Myeongjo', serif;
}

body.font-GothicA1 {
    font-family: 'Gothic A1', sans-serif;
}

body.font-Jua {
    font-family: 'Jua', sans-serif;
}

body.font-Sunflower {
    font-family: 'Sunflower', sans-serif;
}

body.font-PoorStory {
    font-family: 'Poor Story', cursive;
}

body.font-GowunBatang {
    font-family: 'Gowun Batang', serif;
}

body.font-GowunDodum {
    font-family: 'Gowun Dodum', sans-serif;
}

/* 글씨 크기 클래스 */
body.size-xs {
    font-size: 14px;
}

body.size-sm {
    font-size: 16px;
}

body.size-md {
    font-size: 18px; /* 기본 */
}

body.size-lg {
    font-size: 20px;
}

body.size-xl {
    font-size: 22px;
}

body.size-xxl {
    font-size: 24px;
}
/* 설정 모달 추가 스타일 */
.settings-section {
    margin: 20px 0;
}

.settings-section h4 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 1.1em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.setting-item {
    margin: 15px 0;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.setting-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-color);
}

.setting-item input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.setting-desc {
    margin: 5px 0 0 28px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

/* 라이트 테마에서 설정 설명 색상 */
body.light-theme .setting-desc {
    color: rgba(0, 0, 0, 0.6);
}

/* 세피아 테마에서 설정 설명 색상 */
body.sepia-theme .setting-desc {
    color: rgba(92, 75, 55, 0.7);
}

/* 대사 강조 비활성화 시 스타일 */
body.no-dialogue-highlight .dialogue {
    color: inherit !important;
    font-weight: 500 !important;
    font-style: normal !important;
}

body.no-dialogue-highlight .text-content .dialogue::before {
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%) !important;
}

/* 화자 강조 비활성화 시 스타일 */
body.no-speaker-highlight .text-content .speaker {
    color: inherit !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}

/* 대사 관련 모든 요소 강조 비활성화 */
body.no-dialogue-highlight .text-content .quote-normal,
body.no-dialogue-highlight .text-content .quote-thought,
body.no-dialogue-highlight .text-content .quote-emphasis {
    color: inherit !important;
}

body.no-dialogue-highlight .text-content .dialogue strong {
    text-decoration: none !important;
}

/* 대사 구분선도 비활성화 */
body.no-dialogue-highlight .text-content .dialogue {
    background-color: transparent !important;
    padding-left: 0 !important;
    margin: 20px 0 !important;
}

/* 스토리 이미지 스타일 - 적응형 레이아웃 */
.story-image {
    margin: 1.5rem auto;
    animation: fadeIn 1s ease-in;
    max-width: 100%;
    position: relative;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    /* 이미지 위치에 따른 자동 정렬 */
    display: flex;
    justify-content: center;
    align-items: center;
    clear: both; /* 플로팅 요소 정리 */
}

.story-image img {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 60vh; /* 화면 높이의 60%로 제한 */
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: block;
    margin: 0 auto;
    object-fit: contain;
    box-sizing: border-box;
}

/* 이미지와 텍스트 균형 맞추기 - 좌측 이미지 */
.story-image.float-left {
    float: left;
    width: 45%;
    margin: 1rem 1.5rem 1rem 0;
    clear: left;
}

.story-image.float-left img {
    width: 100%;
    max-height: 45vh;
}

/* 이미지와 텍스트 균형 맞추기 - 우측 이미지 */
.story-image.float-right {
    float: right;
    width: 45%;
    margin: 1rem 0 1rem 1.5rem;
    clear: right;
}

.story-image.float-right img {
    width: 100%;
    max-height: 45vh;
}

/* 작은 이미지 인라인 처리 */
.story-image.inline-image {
    display: inline-block;
    width: auto;
    max-width: 40%;
    margin: 0.5rem 1rem;
    vertical-align: middle;
}

.story-image.inline-image img {
    max-height: 30vh;
}

/* 텍스트 래핑 최적화 */
.text-content {
    /* 이미지 주변 텍스트 흐름 개선 */
    overflow: hidden;
    word-wrap: break-word;
    line-height: 1.8;
}

.text-content p {
    margin-bottom: 1.2rem;
    text-align: justify;
    text-justify: inter-word;
}

/* 이미지 옆 텍스트 최소 너비 보장 */
.text-content::after {
    content: '';
    display: table;
    clear: both;
}

/* 그리드 레이아웃 - 이미지와 텍스트 나란히 */
.image-text-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: center;
    margin: 1.5rem 0;
}

.image-text-grid .story-image {
    margin: 0;
    width: 100%;
}

.image-text-grid .text-section {
    padding: 1rem;
}

/* 역순 그리드 (텍스트-이미지) */
.image-text-grid.reverse {
    direction: rtl;
}

.image-text-grid.reverse .text-section {
    direction: ltr;
}

/* 뉴스 이미지 특별 스타일 - 원본 비율 유지 */
.story-image img[src*="prologue_news.jpg"] {
    width: auto;
    max-width: 100%;
    max-height: 600px;
    object-fit: contain;
    background-color: #000;
    padding: 10px;
}

/* 이미지 로딩 중 플레이스홀더 */
.story-image img:not([src]) {
    background-color: rgba(139, 69, 19, 0.1);
    min-height: 200px;
}

/* 이미지 로드 실패 시 숨김 */
.story-image img[style*="display: none"] + .image-error {
    display: block;
    padding: 20px;
    background-color: rgba(139, 69, 19, 0.1);
    border-radius: 8px;
    color: var(--text-muted);
    font-style: italic;
}

/* 라이트 테마에서 이미지 그림자 조정 */
body.light-theme .story-image img {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* 세피아 테마에서 이미지 스타일 */
body.sepia-theme .story-image img {
    box-shadow: 0 4px 20px rgba(92, 75, 55, 0.2);
    filter: sepia(0.2);
}

/* 뉴스 이미지는 세피아 필터 제외 */
body.sepia-theme .story-image img[src*="prologue_news.jpg"] {
    filter: none;
}

/* 모바일에서 이미지-텍스트 균형 */
@media (max-width: 768px) {
    .story-image {
        margin: 1rem auto;
        padding: 0;
        display: block; /* 모바일에서는 블록으로 */
        width: 100%;
        float: none !important; /* 플로팅 해제 */
    }
    
    .story-image img {
        max-width: 100%;
        max-height: 50vh; /* 모바일에서 더 작게 */
        border-radius: 5px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }
    
    .story-image img[src*="prologue_news"] {
        max-height: 40vh;
    }
    
    /* 모바일에서 플로팅 이미지 처리 */
    .story-image.float-left,
    .story-image.float-right {
        float: none !important;
        width: 100% !important;
        margin: 1rem auto !important;
        display: block !important;
    }
    
    /* 모바일에서 인라인 이미지 */
    .story-image.inline-image {
        display: block !important;
        width: 80% !important;
        max-width: 80% !important;
        margin: 1rem auto !important;
    }
    
    /* 모바일에서 그리드 레이아웃 세로 배치 */
    .image-text-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .image-text-grid.reverse {
        direction: ltr !important;
    }
    
    /* 모바일에서 텍스트 정렬 */
    .text-content p {
        text-align: left !important; /* 모바일에서는 좌측 정렬이 읽기 편함 */
        padding: 0 0.5rem;
    }
}

/* 효과 설정 모달 스타일 */
.effects-intro {
    text-align: center;
    margin-bottom: 25px;
    color: var(--text-color);
    opacity: 0.9;
}

.effects-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0 30px 0;  /* 아래 마진 증가 */
    padding: 10px;
}

/* 효과 설정 모달 크기 및 스크롤 설정 */
.effects-modal .modal-content {
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* 효과 옵션 영역 스크롤 설정 */
.effects-modal .modal-content > h3 {
    flex-shrink: 0;
}

.effects-modal .effects-intro {
    flex-shrink: 0;
}

.effects-options {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(90vh - 250px); /* 제목, 설명, 버튼 영역 제외 */
}

/* 스크롤바 스타일링 */
.effects-options::-webkit-scrollbar {
    width: 8px;
}

.effects-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.effects-options::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
}

.effects-options::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* 효과 설정 모달 전용 버튼 스타일 */
.effects-modal .modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 215, 0, 0.2);
    flex-shrink: 0; /* 버튼은 항상 보이도록 */
}

.effect-item {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 20px;
    padding-top: 25px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.effect-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.effect-icon {
    font-size: 1.5em;
    margin-bottom: 5px;
    opacity: 0.8;
}

.effect-title {
    font-size: 1em;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 6px;
}

.effect-desc {
    font-size: 0.8em;
    color: var(--text-color);
    opacity: 0.7;
    line-height: 1.2;
    margin: 0;
    padding: 0 5px;
}

/* 체크박스 스타일 */
.effect-item input[type="checkbox"] {
    cursor: pointer;
    z-index: 2;
    accent-color: #FFD700;
}

/* 6번째 빈 슬롯 스타일 */
.effect-item.effect-placeholder {
    background-color: rgba(255, 255, 255, 0.02);
    border-style: dashed;
    cursor: default;
}

.effect-item.effect-placeholder:hover {
    transform: none;
    box-shadow: none;
}

/* 모바일에서 1열로 변경 */
@media (max-width: 768px) {
    .effects-modal .modal-content {
        max-height: 95vh;
        padding: 25px 20px; /* 패딩 증가 */
        width: calc(100% - 20px); /* 좌우 여백 확보 */
        margin: 10px; /* 화면 가장자리와 간격 */
    }
    
    .effects-options {
        grid-template-columns: 1fr;
        gap: 15px;
        max-height: calc(95vh - 200px); /* 모바일에서 조정 */
        padding: 10px 5px; /* 좌우 패딩 추가 */
    }
    
    .effect-item {
        min-height: 140px !important; /* 높이 조정 */
        padding: 20px 50px 20px 20px !important; /* 패딩 최적화 */
        position: relative;
        overflow: visible !important; /* 오버플로우 보이게 */
        background: rgba(255, 255, 255, 0.03) !important; /* 배경 약간 밝게 */
        border: 2px solid rgba(255, 215, 0, 0.2) !important; /* 테두리 강조 */
        margin: 6px !important; /* 항목 간 여백 */
    }
    
    .effect-item input[type="checkbox"] {
        position: absolute !important;
        top: 20px !important; /* 위치 조정 */
        right: 20px !important; /* 우측 여백 증가 */
        width: 32px !important; /* 체크박스 크기 더 증가 */
        height: 32px !important;
        cursor: pointer !important;
    }
    
    .effect-icon {
        font-size: 1.5rem !important; /* 아이콘 크기 조정 - 공간 절약 */
        margin-bottom: 8px !important;
    }
    
    .effect-title {
        font-size: 1.05rem !important; /* 글씨 크기 최적화 */
        font-weight: 600 !important;
        margin-bottom: 8px !important;
        padding: 0 35px 0 0 !important; /* 우측 패딩 */
        line-height: 1.3 !important;
        word-break: keep-all !important; /* 한글 단어 중간 줄바꿈 방지 */
    }
    
    .effect-desc {
        font-size: 0.9rem !important; /* 가독성 향상 */
        line-height: 1.5 !important;
        padding: 0 35px 0 0 !important; /* 우측 패딩 */
        word-break: keep-all !important; /* 한글 단어 중간 줄바꿈 방지 */
        overflow-wrap: normal !important;
        white-space: normal !important;
        color: rgba(255, 255, 255, 0.8) !important; /* 약간 투명하게 */
        max-width: 100% !important;
    }
    
    
    .effects-modal .modal-buttons {
        padding: 20px 15px; /* 패딩 증가 */
        margin-top: 15px; /* 상단 여백 추가 */
        gap: 20px; /* 버튼 간 간격 증가 */
    }
    
    .effects-modal .modal-buttons button {
        padding: 15px 25px !important; /* 버튼 패딩 증가 */
        min-height: 50px !important; /* 최소 높이 설정 */
        font-size: 1.05rem !important; /* 글씨 크기 증가 */
    }
}

/* 라이트 테마에서 효과 아이템 스타일 */
body.light-theme .effect-item {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 세피아 테마에서 효과 아이템 스타일 */
body.sepia-theme .effect-item {
    background-color: rgba(92, 75, 55, 0.1);
}

/* 설정 모달 내부 스타일 - 세련된 디자인 */
.settings-modal-content {
    max-width: 600px !important;
    max-height: 90vh;
    width: 90%;
    margin: 20px auto;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.4) transparent;
    background: linear-gradient(145deg, #1e1e3a 0%, #151529 50%, #0a0a1a 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.3) !important;
    border-radius: 20px !important;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 215, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    padding: 30px !important;
}

/* 태블릿에서 설정 모달 크기 최적화 */
@media (min-width: 769px) and (max-width: 1200px) {
    .settings-modal-content {
        max-width: 700px !important;
        width: 85% !important;
    }
}

/* 모바일에서 설정 모달 최적화 */
@media (max-width: 768px) {
    .settings-modal-content {
        max-width: 95% !important;
        width: 95% !important;
        max-height: 95vh !important;
        margin: 10px auto !important;
        padding: 20px 15px !important;
    }
    
    .settings-modal-content h3 {
        font-size: 1.2em !important;
        margin-bottom: 20px !important;
    }
    
    .settings-modal-content h4 {
        font-size: 0.9em !important;
        margin-bottom: 15px !important;
    }
}

.settings-modal-content::-webkit-scrollbar {
    width: 4px;
}

.settings-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.settings-modal-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 212, 255, 0.5);
    border-radius: 2px;
}

.settings-modal-content h3 {
    font-size: 1.4em;
    margin-bottom: 35px;
    text-align: center;
    color: #FFD700 !important;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 20px rgba(255, 215, 0, 0.3);
    position: relative;
}

.settings-modal-content h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FFD700, transparent);
}

.settings-modal-content h4 {
    font-size: 1.1em;
    margin-bottom: 25px;
    margin-top: 35px;
    color: #E6E6FA !important;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-modal-content h4::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* 테마 그리드 */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.theme-select-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 215, 0, 0.2);
    color: #f0f0f0 !important;
    border-radius: 16px;
    padding: 24px 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 600;
    min-height: 100px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.theme-select-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 215, 0, 0.1));
    opacity: 0;
    transition: opacity 0.3s;
}

.theme-select-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 255, 255, 0.05));
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 8px 30px rgba(255, 215, 0, 0.15),
        0 4px 15px rgba(0, 0, 0, 0.3);
}

.theme-select-btn:hover::before {
    opacity: 1;
}

.theme-select-btn.active {
    border-color: #00D4FF;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.3);
    background: rgba(0, 212, 255, 0.15);
}

.theme-select-btn span:last-child {
    font-size: 0.9em;
    font-weight: 600;
    z-index: 1;
}

.theme-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: block;
}

.dark-preview {
    background: #0a0a0a;
    border: 2px solid #333;
}

.light-preview {
    background: #ffffff;
    border: 2px solid #ddd;
}

.sepia-preview {
    background: #f4f1e8;
    border: 2px solid #d4c4a8;
}

.custom-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* 폰트 선택 드롭다운 */
.font-select {
    width: 100%;
    padding: 12px 15px;
    margin-top: 10px;
    background: var(--secondary-bg);
    border: 2px solid transparent;
    border-radius: 10px;
    color: var(--text-color);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.font-select:hover {
    border-color: var(--accent-color);
    background-color: rgba(255, 215, 0, 0.05);
}

.font-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

/* 라이트 테마에서 폰트 선택 */
body.light-theme .font-select {
    background-color: #f5f5f5;
}

/* 세피아 테마에서 폰트 선택 */
body.sepia-theme .font-select {
    background-color: #ebe5d6;
}

/* 설정 섹션 스타일 개선 */
.settings-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    padding: 25px;
    border-radius: 18px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(5px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.settings-section:hover {
    border-color: rgba(255, 215, 0, 0.2);
    box-shadow: 
        0 12px 35px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* 토글 스위치 스타일 */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-label span {
    color: #f0f0f0 !important;
    font-weight: 500;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 54px;
    height: 30px;
    background: linear-gradient(135deg, rgba(128, 128, 128, 0.4), rgba(64, 64, 64, 0.4));
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 15px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 15px;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #ffffff, #e0e0e0);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 3px 8px rgba(0, 0, 0, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4), rgba(255, 193, 7, 0.3));
    border-color: #FFD700;
    box-shadow: 
        inset 0 2px 4px rgba(255, 215, 0, 0.2),
        0 0 15px rgba(255, 215, 0, 0.3);
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch::after {
    transform: translateX(26px);
    background: linear-gradient(135deg, #FFD700, #FFA500);
    box-shadow: 
        0 3px 12px rgba(255, 215, 0, 0.4),
        0 1px 4px rgba(0, 0, 0, 0.3);
}

body.light-theme .settings-section {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.05);
}

body.sepia-theme .settings-section {
    background: rgba(92, 75, 55, 0.05);
    border-color: rgba(92, 75, 55, 0.1);
}

/* 설정 아이템 스타일 개선 */
.setting-item {
    background: transparent;
    padding: 12px 15px;
    margin: 8px 0;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.setting-item:hover {
    background: rgba(255, 215, 0, 0.05);
    border-color: rgba(255, 215, 0, 0.2);
}

.setting-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.setting-desc {
    margin: 5px 0 0 32px;
    font-size: 0.85em;
    line-height: 1.4;
}

/* 모달 버튼 스타일 개선 */
.modal-buttons {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.modal-buttons .btn-secondary {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.8), rgba(255, 193, 7, 0.9));
    border: none;
    color: #000 !important;
    padding: 14px 28px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 6px 20px rgba(255, 215, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    margin: 0;
}

.modal-buttons .btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.modal-buttons .btn-secondary:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 10px 30px rgba(255, 215, 0, 0.3),
        0 4px 15px rgba(0, 0, 0, 0.4);
}

.modal-buttons .btn-secondary:hover::before {
    left: 100%;
}

.modal-buttons .btn-secondary:active {
    transform: translateY(0) scale(0.98);
}

/* 모든 메뉴 버튼 통일된 금색 스타일 */
#settingsBtn, #saveBtn, #loadBtn, #fullscreenBtn, #homeBtn {
    transition: all 0.3s ease;
    position: relative;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    animation: menuPulse 2s ease-in-out infinite;
    border: 2px solid rgba(255, 215, 0, 0.5) !important;
}

@keyframes menuPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    }
}

/* 설정 버튼 특별 효과 */
#settingsBtn:hover {
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 30px rgba(255, 215, 0, 1);
}

/* 나머지 버튼 호버 효과 */
#saveBtn:hover, #loadBtn:hover, #fullscreenBtn:hover, #homeBtn:hover {
    transform: scale(1.15);
    box-shadow: 0 0 30px rgba(255, 215, 0, 1);
    background: linear-gradient(135deg, #FFED4E 0%, #FFD700 100%) !important;
}

/* 모든 메뉴 아이콘 스타일 통일 */
#settingsBtn .menu-icon, 
#saveBtn .menu-icon, 
#loadBtn .menu-icon, 
#fullscreenBtn .menu-icon,
#homeBtn .menu-icon {
    color: #ffffff !important;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    font-size: 1.4rem;
    font-weight: bold;
}

/* 툴팁 스타일 */
.menu-btn {
    position: relative;
}

.menu-btn::after {
    content: attr(title);
    position: absolute;
    bottom: 110%; /* 버튼에서 더 띄우기 */
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 8px 12px; /* 패딩 증가 */
    border-radius: 8px;
    font-size: 14px; /* 글씨 크기 증가 */
    white-space: nowrap;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 10000;
}

.menu-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* 버튼 텍스트 가시성 향상 */
.size-icon, .menu-icon {
    display: inline-block;
    font-weight: 900;
    color: #000000;
}

/* 글씨 크기 조절 버튼 특별 스타일 */
.size-decrease .menu-icon,
.size-increase .menu-icon {
    color: #FFD700 !important;  /* 금색으로 변경 */
    font-weight: 900;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8),  /* 검은색 외곽선 효곺 */
                 0 0 4px rgba(255, 215, 0, 0.5);  /* 금색 글로우 효과 */
}

.size-decrease .menu-icon {
    font-size: 1.3rem;
}

.size-increase .menu-icon {
    font-size: 1.5rem;
}

/* S, L 버튼 특별 강조 */
#saveBtn .menu-icon,
#loadBtn .menu-icon {
    font-weight: 900;
    font-size: 1.4rem;
    color: #000000;
}

/* 설정 버튼 아이콘 개선 */
#settingsBtn .menu-icon {
    font-size: 1.6rem;
}


/* 버튼 활성 상태 */
.menu-btn:active {
    transform: scale(0.95);
    background-color: rgba(255, 215, 0, 1);
    color: #000000;
}

/* 다크 테마에서 버튼 스타일 */
body.dark-theme .menu-btn {
    background-color: rgba(50, 50, 55, 0.85);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

body.dark-theme .size-icon {
    color: #FFD700 !important;  /* 금색 유지 */
}

body.dark-theme .menu-icon {
    color: #000000;
}

/* 모달 배경 블러 효과 */
.settings-modal.show {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background-color: rgba(0, 0, 0, 0.6);
}

/* 모달 내용 슬라이드 인 애니메이션 */
.settings-modal.show .modal-content {
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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


/* 폭발 효과 이후에 나타날 내용들 - 초기에는 숨김 */
.post-explosion-hidden {
    display: none;
    opacity: 0;
}

/* 폭발 효과 이후의 섹션들 - 초기에는 숨김 */
.post-explosion-section {
    display: none;
    opacity: 0;
}

/* 저장/불러오기 슬롯 스타일 - 2x2 그리드 */
.save-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 25px 0;
    max-height: 520px;
    overflow-y: auto;
    overflow-x: visible; /* 가로로 AUTO 배지가 잘리지 않도록 */
    padding: 20px 15px 15px 15px; /* 상단 패딩 증가 */
}

/* 스크롤바 스타일링 */
.save-slots::-webkit-scrollbar {
    width: 8px;
}

.save-slots::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.save-slots::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
}

.save-slots::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* 기존 save-slot 스타일 비활성화됨 - 맨 아래 통합 스타일 사용 */

/* X 삭제 버튼 */
.slot-delete-x {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.8);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.slot-delete-x:hover {
    background: rgba(231, 76, 60, 1);
    opacity: 1;
    transform: scale(1.1);
}

.save-slot:hover {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.10)) !important;
    border-color: rgba(255, 215, 0, 0.6) !important;
    transform: translateY(-6px) scale(1.02) !important;
    box-shadow: 
        0 20px 45px rgba(255, 215, 0, 0.25),
        0 0 30px rgba(255, 215, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(15px) !important;
}

/* 자동 저장 슬롯 특별 스타일 */
.slot-number.auto-save {
    color: var(--accent-color);
    font-weight: bold;
}

.slot-number.auto-save::before {
    content: "⚡ ";
    margin-right: 4px;
}

.save-slot.empty {
    opacity: 0.5;
    font-style: italic;
}

/* 슬롯 액션 버튼들 */
.slot-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.slot-actions button {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.9em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

/* 슬롯 정보 스타일 */
.slot-info {
    margin-bottom: 10px;
}

.slot-number {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 8px;
}

.slot-details {
    font-size: 0.9em;
    line-height: 1.4;
}

.slot-user {
    font-weight: 600;
    color: var(--text-color);
}

.slot-location {
    color: rgba(255, 255, 255, 0.8);
    margin: 4px 0;
}

.slot-time {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85em;
}

.load-btn, .save-btn {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
}

.load-btn:hover, .save-btn:hover {
    background: linear-gradient(135deg, #357ABD, #2968A8);
    transform: translateY(-1px);
}

.story-btn {
    background: linear-gradient(135deg, #50C878, #3BA460);
    color: white;
    flex: 0 0 auto;
    padding: 8px 14px;
}

.story-btn:hover {
    background: linear-gradient(135deg, #3BA460, #2E8B57);
    transform: translateY(-1px);
}

.delete-btn {
    background: linear-gradient(135deg, #E74C3C, #C0392B);
    color: white;
}

.delete-btn:hover {
    background: linear-gradient(135deg, #C0392B, #A93226);
    transform: translateY(-1px);
}

.save-btn.overwrite {
    background: linear-gradient(135deg, #F39C12, #E67E22);
}

.save-btn.overwrite:hover {
    background: linear-gradient(135deg, #E67E22, #D68910);
}

.save-slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.save-slot-title {
    font-weight: bold;
    color: var(--accent-color);
}

.save-slot-date {
    font-size: 0.85em;
    opacity: 0.7;
}

.save-slot-info {
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 5px;
}

.save-slot-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.5);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.save-slot:hover .save-slot-delete {
    opacity: 1;
}

.save-slot-delete:hover {
    background: rgba(255, 0, 0, 0.7);
}

.modal-description {
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 20px;
}

/* 개선된 저장/불러오기 슬롯 스타일 */
/* 기존 save-slot-btn 스타일 비활성화됨 - 맨 아래 통합 스타일 사용 */
    min-height: 140px;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 12px 35px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 215, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px) !important;
}

/* 모바일에서 저장 슬롯 1열 배치 */
@media (max-width: 768px) {
    .save-slots {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 5px;
        max-height: 70vh;
    }
    
    .save-slot-btn {
        padding: 15px 45px 15px 15px; /* 상단과 우측 패딩 조정 */
        min-height: 120px;
        font-size: 0.95em;
    }
    
    .slot-number-badge {
        font-size: 0.7em;
        padding: 2px 6px;
    }
    
    .slot-story-progress {
        max-height: 80px;
        font-size: 0.85em;
        margin-right: 20px;
    }
    
    .slot-delete-x {
        width: 20px;
        height: 20px;
        font-size: 14px;
    }
    
    .save-slot-info {
        font-size: 0.8em;
    }
}

/* 기존 스타일들 비활성화됨 - 맨 아래 통합 스타일 사용 */

.save-slot-empty {
    border-style: dashed;
}

.save-slot-filled {
    background: rgba(128, 128, 128, 0.03);
    border-color: rgba(128, 128, 128, 0.3);
}

/* 저장/불러오기 모달 크기 조정 */
.save-modal .modal-content,
.load-modal .modal-content {
    max-width: 800px;
    width: 95%;
}

/* 자동저장 슬롯 특별 스타일 */
.save-slot-btn.auto-save-slot {
    background: rgba(255, 215, 0, 0.03); /* 매우 연한 노란색 배경 */
    border: 2px solid rgba(255, 215, 0, 0.5); /* 노란색 테두리 */
    position: relative;
}

.save-slot-btn.auto-save-slot .slot-number-badge {
    color: #FFD700; /* 노란색 텍스트 */
}

.slot-number-badge {
    position: absolute;
    top: 18px;
    left: 18px; /* 왼쪽으로 이동 */
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.95), rgba(255, 193, 7, 0.85)) !important;
    color: #1a1a1a !important;
    padding: 8px 16px;
    border: 2px solid rgba(255, 215, 0, 0.8) !important;
    border-radius: 25px !important;
    font-size: 0.85em;
    font-weight: 700 !important;
    box-shadow: 
        0 6px 20px rgba(255, 215, 0, 0.4),
        0 0 15px rgba(255, 215, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    opacity: 1;
    backdrop-filter: blur(5px) !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) !important;
}

.slot-empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    opacity: 0.7;
    text-align: center;
    height: 100%;
}

.slot-empty-text {
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 0.9;
    font-weight: 500;
    text-align: center;
    font-style: italic;
    margin-top: 15px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
    letter-spacing: 0.5px;
}

.slot-user-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* 텍스트 정렬 개선 */
    margin-bottom: 12px;
    margin-top: 8px; /* 슬롯 번호와 간격 */
    padding-right: 10px; /* 오른쪽 여백 */
}

.slot-username {
    font-size: 1em;
    font-weight: 500;
    color: var(--text-color);
    word-break: break-word; /* 긴 이름 줄바꿈 */
    max-width: 60%; /* 진행도와 겹치지 않게 */
}

.slot-progress {
    background: rgba(128, 128, 128, 0.1);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    color: var(--text-color);
    opacity: 0.8;
    white-space: nowrap; /* 한 줄 유지 */
    flex-shrink: 0; /* 크기 축소 방지 */
}

/* 모바일에서 슬롯 텍스트 크기 증가 */
@media (max-width: 768px) {
    .slot-username {
        font-size: 1.2em;
    }
    
    .slot-progress {
        font-size: 0.95em;
        padding: 6px 14px;
    }
    
    .slot-time-info {
        font-size: 0.95em;
        margin-top: 8px;
    }
    
    .slot-empty-icon {
        font-size: 3em;
    }
    
    .slot-empty-text {
        font-size: 1.05em;
    }
}

.slot-time-info {
    display: flex;
    gap: 12px;
    font-size: 0.85em;
    opacity: 0.7;
    margin-right: 35px; /* X 버튼과 겹치지 않게 */
    flex-wrap: wrap; /* 줄바꿈 허용 */
}

.slot-section-title {
    font-size: 0.95em;
    font-weight: 500;
    color: var(--text-color);
    margin: 8px 40px 4px 0; /* 오른쪽 여백 추가 */
    opacity: 0.9;
    word-break: break-word; /* 긴 제목 줄바꿈 */
}

.slot-section-preview {
    font-size: 0.85em;
    color: var(--text-color);
    opacity: 0.6;
    margin: 4px 40px 8px 0; /* 오른쪽 여백 추가 */
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.slot-choice-info {
    font-size: 0.8em;
    color: var(--accent-color);
    opacity: 0.8;
    margin: 6px 0;
    padding: 3px 8px;
    background: rgba(128, 128, 128, 0.1);
    border-radius: 4px;
    display: inline-block;
}

.slot-date,
.slot-time {
    color: var(--text-color);
    opacity: 0.6;
}

.slot-overwrite-notice,
.slot-load-notice {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color);
    color: var(--bg-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
    transition: bottom 0.3s ease;
}

.save-slot-btn:hover .slot-overwrite-notice,
.save-slot-btn:hover .slot-load-notice {
    bottom: 15px;
}

/* 스토리 진행 정보 스타일 */
.slot-story-progress {
    margin: 10px 0;
    margin-right: 30px; /* X 버튼과 겹치지 않게 */
    max-height: 120px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
}

.slot-story-progress::-webkit-scrollbar {
    width: 6px;
}

.slot-story-progress::-webkit-scrollbar-track {
    background: transparent;
}

.slot-story-progress::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
    opacity: 0.5;
}

.progress-item {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 슬롯 삭제 버튼 스타일 */
.slot-delete-btn {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    background: rgba(255, 68, 68, 0.8) !important;
    color: white !important;
    border: none !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 1.2em !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    transition: all 0.2s !important;
}

.slot-delete-btn:hover {
    background: rgba(255, 0, 0, 0.9) !important;
    transform: scale(1.1);
}

/* 슬롯 컨텐츠가 X 버튼과 겹치지 않게 */
.slot-content {
    padding-right: 40px;
}

.progress-item:last-child {
    border-bottom: none;
}

.progress-title {
    font-size: 0.9em;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 3px;
}

.progress-choice {
    font-size: 0.85em;
    color: #90EE90;
    margin: 3px 0;
}

.progress-dialogue-mini {
    font-size: 0.85em;
    font-style: italic;
    color: #87CEEB;
    margin: 3px 0;
    padding-left: 5px;
}

.progress-content {
    font-size: 0.85em;
    opacity: 0.8;
    line-height: 1.3;
}

.progress-more {
    text-align: center;
    font-size: 0.85em;
    opacity: 0.6;
    margin-top: 5px;
    font-style: italic;
}

.slot-stats {
    display: flex;
    gap: 15px;
    margin: 8px 0;
    font-size: 0.85em;
    opacity: 0.7;
}

.stat-item {
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

/* 스토리 히스토리 모달 개선 */
.story-progress-full {
    margin: 20px 0;
}

.progress-list-scrollable {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(255, 255, 255, 0.1);
}

.progress-list-scrollable::-webkit-scrollbar {
    width: 8px;
}

.progress-list-scrollable::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.progress-list-scrollable::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

.progress-item-full {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 5px;
    border-left: 3px solid var(--accent-color);
}

.progress-number {
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9em;
}

.progress-details {
    flex: 1;
}

.progress-title-full {
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.progress-choice-full {
    color: #90EE90;
    font-size: 0.9em;
    margin: 5px 0;
}

.progress-content-full {
    font-size: 0.9em;
    line-height: 1.4;
    opacity: 0.9;
}

/* 대화문 스타일 */
.progress-dialogues {
    margin: 10px 0;
    padding: 10px;
    background: rgba(0, 100, 200, 0.05);
    border-left: 2px solid rgba(0, 100, 200, 0.3);
    border-radius: 4px;
}

.dialogue-line {
    font-style: italic;
    color: #87CEEB;
    margin: 5px 0;
    font-size: 0.9em;
}

/* 선택지 그룹 스타일 */
.progress-choices {
    margin: 8px 0;
    padding: 8px;
    background: rgba(50, 205, 50, 0.05);
    border-radius: 4px;
}

/* 섹션 타입 표시 */
.progress-section-type {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.8em;
    margin-top: 5px;
    opacity: 0.7;
}

/* 선택되지 않은 버튼 스타일 */
.choice-btn.not-selected {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(128, 128, 128, 0.1);
}

.choice-btn.selected {
    background: rgba(100, 149, 237, 0.2) !important;
    border-color: var(--accent-color) !important;
    position: relative;
}

.choice-btn.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.2em;
}

/* 선택지 체크마크 스타일 */
.choice-checkmark {
    color: var(--accent-color);
    font-weight: bold;
    margin-left: 10px;
    font-size: 1.1em;
}

/* 선택지 상세 정보 스타일 */
.choices-detail-summary {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.choices-detail-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
}

.choice-detail-item {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.choice-section-id {
    font-size: 0.85em;
    color: var(--accent-color);
    margin-bottom: 8px;
    font-weight: bold;
}

.choice-options-list {
    padding-left: 10px;
}

.option-selected {
    color: #90EE90;
    font-weight: bold;
    margin: 5px 0;
    padding: 5px;
    background: rgba(100, 149, 237, 0.1);
    border-radius: 3px;
}

.option-not-selected {
    color: rgba(255, 255, 255, 0.5);
    margin: 5px 0;
    padding: 5px;
}

/* 진행 상황의 선택지 표시 */
.choice-options-header {
    font-size: 0.9em;
    color: var(--accent-color);
    margin-bottom: 5px;
    font-weight: bold;
}

.progress-choice-selected {
    color: #90EE90;
    font-weight: bold;
    margin: 5px 0;
    padding: 8px;
    background: rgba(100, 149, 237, 0.15);
    border-left: 3px solid var(--accent-color);
    border-radius: 3px;
}

.progress-choice-not-selected {
    color: rgba(255, 255, 255, 0.4);
    margin: 5px 0;
    padding: 8px;
    padding-left: 11px;
    background: rgba(128, 128, 128, 0.05);
    border-left: 3px solid transparent;
}

.choice-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-color);
    color: white;
    border-radius: 12px;
    font-size: 0.8em;
    margin-left: 8px;
    font-weight: normal;
}

.choice-info {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    margin-left: 5px;
}

/* 선택된 버튼 강조 효과 */
.choice-btn.selected {
    animation: selectedPulse 2s ease-in-out infinite;
}

@keyframes selectedPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(100, 149, 237, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(100, 149, 237, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(100, 149, 237, 0);
    }
}

/* 저장 알림 애니메이션 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.save-notification {
    transition: all 0.3s ease-out;
}

.philosophy-summary {
    margin: 20px 0;
    padding: 15px;
    background: rgba(100, 149, 237, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(100, 149, 237, 0.3);
}

.philosophy-choice {
    padding: 8px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.story-statistics {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.stat-row {
    padding: 5px 0;
    display: flex;
    justify-content: space-between;
}

/* 모바일에서 스토리 진행 정보 최적화 */
@media (max-width: 768px) {
    .slot-story-progress {
        max-height: 80px;
    }
    
    .progress-list-scrollable {
        max-height: 300px;
    }
}

.slot-error {
    text-align: center;
    color: #ff6b6b;
    padding: 20px;
    font-style: italic;
}

/* 스크롤 유도 마커 */
.explosion-scroll-marker,
.section-scroll-marker {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0; /* Reduced from 50px to 20px for less gap */
}

/* 일반 섹션 스크롤 마커는 보이지 않게 */
.section-scroll-marker {
    opacity: 0;
    height: 50px;
    margin: 0;
    padding: 0;
}

/* 스크롤 유도 애니메이션 - 화살표 숨김 */
.explosion-scroll-marker::after {
    content: '';  /* 화살표 제거 */
    position: absolute;
    bottom: 20px;
    font-size: 2em;
    color: var(--text-color);
    opacity: 0.5;
    animation: scrollPrompt 2s ease-in-out infinite;
}

@keyframes scrollPrompt {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.3;
    }
    50% {
        transform: translateY(10px);
        opacity: 0.7;
    }
}

/* ===== NEW UI ELEMENTS FOR EMOTIONAL TRACKING ===== */

/* Emotional Indicators Container */
.emotional-indicators {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
    transition: opacity 0.3s ease;
}

body.light-theme .emotional-indicators {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.sepia-theme .emotional-indicators {
    background: rgba(244, 241, 232, 0.95);
    border-color: var(--border-color);
}

/* Individual Meters */
.stress-meter, .hope-meter, .conflict-meter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.meter-label {
    font-size: 0.85em;
    min-width: 40px;
    color: var(--text-color);
    opacity: 0.8;
}

.meter-fill {
    height: 8px;
    background: linear-gradient(90deg, #4CAF50 0%, #FFC107 50%, #F44336 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
    flex: 1;
    background-color: rgba(255, 255, 255, 0.2);
}

.stress-meter .meter-fill {
    background: linear-gradient(90deg, #4CAF50 0%, #F44336 100%);
}

.hope-meter .meter-fill {
    background: linear-gradient(90deg, #9E9E9E 0%, #2196F3 100%);
}

.conflict-meter .meter-fill {
    background: linear-gradient(90deg, #4CAF50 0%, #FF9800 100%);
}

/* System Status Display */
.system-status {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    z-index: 100;
    transition: all 0.3s ease;
}

body.light-theme .system-status {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-label {
    color: var(--text-color);
    opacity: 0.7;
}

.status-value {
    font-weight: bold;
    color: var(--text-color);
}

/* Status Colors */
.system-status.stable {
    border-color: #4CAF50;
}

.system-status.stable .status-value {
    color: #4CAF50;
}

.system-status.warning {
    border-color: #FFC107;
}

.system-status.warning .status-value {
    color: #FFC107;
}

.system-status.unstable {
    border-color: #FF9800;
}

.system-status.unstable .status-value {
    color: #FF9800;
}

.system-status.critical {
    border-color: #F44336;
    animation: pulse-critical 1.5s ease-in-out infinite;
}

.system-status.critical .status-value {
    color: #F44336;
}

@keyframes pulse-critical {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(244, 67, 54, 0);
    }
}

/* Foreshadowing Hints - Subtle Visual Cues */
.foreshadowing-hint {
    position: relative;
    display: inline-block;
}

.foreshadowing-hint::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent-color);
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.foreshadowing-hint:hover::after {
    opacity: 0.6;
}

/* Emotional State Descriptions */
.emotional-description {
    font-style: italic;
    color: var(--text-color);
    opacity: 0.8;
    margin: 10px 0;
    padding: 10px;
    border-left: 3px solid var(--accent-color);
    background: rgba(255, 215, 0, 0.05);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .emotional-indicators {
        bottom: 10px;
        right: 10px;
        min-width: 150px;
        padding: 10px;
    }
    
    .system-status {
        top: 60px;
        right: 10px;
        padding: 8px 15px;
        font-size: 0.85em;
    }
    
    .meter-label {
        font-size: 0.75em;
        min-width: 35px;
    }
}

/* Hide indicators during certain scenes */
.page:not(.active) .emotional-indicators,
.page:not(.active) .system-status {
    display: none;
}

/* Playthrough Counter Badge */
.playthrough-badge {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    opacity: 0.6;
    z-index: 100;
}

body.light-theme .playthrough-badge {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

/* Enhanced Choice Buttons with Emotional Weight */
.choice-btn.emotional-heavy {
    position: relative;
    overflow: hidden;
}

.choice-btn.emotional-heavy::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.1) 0%, transparent 70%);
    animation: emotional-pulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes emotional-pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
}

/* ===== 향상된 선택지 디자인 및 전환 효과 ===== */

/* 선택지 버튼 개선 */
.choice-btn {
    background: linear-gradient(135deg, var(--secondary-bg) 0%, rgba(255, 255, 255, 0.02) 100%) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    border-radius: 16px !important;
    padding: 28px 35px !important;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.choice-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s;
    pointer-events: none;
}

.choice-btn:hover {
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 215, 0, 0.2) !important;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
}

.choice-btn:hover::before {
    left: 100%;
}

/* 선택지 컨테이너 애니메이션 */
.choice-buttons {
    animation: choicesFadeIn 0.8s ease-out;
    gap: 20px !important;
    margin: 25px 0 !important;
}

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

/* 각 선택지 순차 애니메이션 */
.choice-buttons > * {
    animation: choiceSlideIn 0.6s ease-out backwards;
}

.choice-buttons > *:nth-child(1) { animation-delay: 0.1s; }
.choice-buttons > *:nth-child(2) { animation-delay: 0.2s; }
.choice-buttons > *:nth-child(3) { animation-delay: 0.3s; }

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

/* 페이지 전환 개선 */
.page {
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.page.active {
    animation: pageSlideIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* 철학적 선택지 특별 효과 */
.main-choice-btn {
    background: linear-gradient(135deg, var(--secondary-bg) 0%, rgba(255, 215, 0, 0.03) 100%) !important;
    border: 3px solid var(--border-color) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.main-choice-btn:hover {
    transform: translateY(-5px) scale(1.03) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 215, 0, 0.3) !important;
}

/* 철학별 색상 효과 강화 */
.main-choice-btn[data-choice="A"]:hover {
    border-color: #FF6B6B !important;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.2), 0 0 20px rgba(255, 107, 107, 0.1) !important;
}

.main-choice-btn[data-choice="B"]:hover {
    border-color: #4ECDC4 !important;
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
    box-shadow: 0 12px 35px rgba(78, 205, 196, 0.2), 0 0 20px rgba(78, 205, 196, 0.1) !important;
}

.main-choice-btn[data-choice="C"]:hover {
    border-color: #95E1D3 !important;
    background: linear-gradient(135deg, rgba(149, 225, 211, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
    box-shadow: 0 12px 35px rgba(149, 225, 211, 0.2), 0 0 20px rgba(149, 225, 211, 0.1) !important;
}

/* 챕터 전환 버튼 */
.to-chapter-btn {
    display: inline-block;
    padding: 18px 40px;
    margin: 40px auto;
    background: linear-gradient(135deg, var(--accent-color) 0%, rgba(255, 215, 0, 0.8) 100%);
    color: #000;
    font-size: 1.3rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.to-chapter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.to-chapter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

.to-chapter-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* 섹션 페이드인 효과 */
.story-section {
    animation: sectionFadeIn 1s ease-out backwards;
    overflow-wrap: break-word; /* 긴 단어 줄바꿈 */
    word-break: keep-all; /* 한글 단어 유지 */
    /* 모바일 최적화 */
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    max-width: 100%;
    text-align: justify; /* 양쪽 정렬로 깔끔하게 */
    text-align-last: left; /* 마지막 줄은 왼쪽 정렬 */
}

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

/* 스크롤 표시기 개선 */
.scroll-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: var(--accent-color);
    animation: scrollBounce 2s ease-in-out infinite;
    opacity: 0.6;
    transition: opacity 0.3s;
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(10px);
    }
}

.scroll-indicator:hover {
    opacity: 1;
}

/* ===== 선택지 클릭 피드백 효과 ===== */

/* 선택 완료 효과 */
.choice-btn.selected {
    animation: selectedPulse 0.5s ease-out;
    pointer-events: none;
    opacity: 0.8;
}

@keyframes selectedPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* 클릭 시 리플 효과 */
.choice-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s, opacity 0.6s;
    opacity: 0;
    pointer-events: none;
}

.choice-btn:active::after {
    width: 300px;
    height: 300px;
    opacity: 0;
}

/* 로딩 스피너 */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    display: none;
    z-index: 9999;
}

.loading-spinner::after {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    margin: 5px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    border-color: var(--accent-color) transparent var(--accent-color) transparent;
    animation: spinner 1.2s linear infinite;
}

@keyframes spinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 페이지 전환 시 페이드 효과 */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-bg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
    z-index: 9998;
}

.page-transition.active {
    opacity: 1;
    pointer-events: all;
}

/* 부드러운 스크롤 */
html {
    scroll-behavior: smooth;
}

/* 새 섹션 나타날 때 하이라이트 */
.story-section.new-section {
    position: relative;
}

.story-section.new-section::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-color);
    animation: highlightBar 1s ease-out forwards;
}

@keyframes highlightBar {
    0% {
        height: 0;
        opacity: 1;
    }
    50% {
        height: 100%;
        opacity: 1;
    }
    100% {
        height: 100%;
        opacity: 0;
    }
}

/* 텍스트 나타나기 효과 */
.story-section p {
    animation: textFadeIn 0.8s ease-out backwards;
}

.story-section p:nth-child(2) { animation-delay: 0.1s; }
.story-section p:nth-child(3) { animation-delay: 0.2s; }
.story-section p:nth-child(4) { animation-delay: 0.3s; }

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

/* content2 섹션 스타일 */
.content2-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--accent-color);
    font-style: italic;
    color: var(--accent-color);
    opacity: 0.9;
}

.content2-section p {
    color: var(--accent-color);
    font-weight: 500;
}

/* 임시 메시지 페이드 인/아웃 애니메이션 */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* 테마 선택 버튼 활성화 스타일 */
.theme-select-btn.active {
    border: 2px solid var(--accent-color);
    background-color: rgba(255, 165, 0, 0.1);
}

.theme-select-btn.active .theme-preview {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.3);
}

/* 설정 모달 개선 */
.settings-modal-content {
    animation: fadeIn 0.3s ease-out;
}

.modal.show .modal-content {
    animation: slideIn 0.3s ease-out;
}

/* 커스텀 테마 모달 스타일 */
.custom-theme-modal .modal-content {
    max-width: 400px;
}

.color-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--secondary-bg);
    border-radius: 8px;
}

.color-setting label {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    font-weight: 500;
}

.color-setting input[type="color"] {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background: none;
}

/* 모달 배경 클릭 시 닫기 */
.modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}


/* 폰트 선택 드롭다운 스타일 개선 */
.font-select {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--secondary-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.font-select:hover {
    border-color: var(--accent-color);
}

.font-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255, 165, 0, 0.2);
}

/* 심층분석 보고서 추가 스타일 */
.report-meta {
    margin-top: 20px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 2px;
}

.meta-item {
    display: inline-block;
    margin: 0 15px;
}

.meta-divider {
    color: rgba(255, 255, 255, 0.15);
    margin: 0 5px;
}

/* 레이더 차트 */
.philosophy-radar {
    max-width: 300px;
    margin: 40px auto;
}

.radar-chart {
    width: 100%;
    height: auto;
}

.radar-grid {
    opacity: 0.3;
}

/* 향상된 철학 바 */
.bar-item.dominant {
    position: relative;
}

.bar-item.dominant::before {
    content: '주요 성향';
    position: absolute;
    top: -25px;
    right: 0;
    font-size: 0.65rem;
    color: rgba(255, 215, 0, 0.8);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.philosophy-mini-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 10px;
    font-style: italic;
}

/* 특성 태그 */
.trait-tags {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.trait-tag {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
}

/* 경로 분석 */
.path-analysis {
    margin-bottom: 40px;
}

.path-analysis h4 {
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 30px;
    font-size: 0.8rem;
    font-weight: 200;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-family: 'Noto Sans KR', sans-serif;
}

.path-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
}

.path-node {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    position: relative;
}

.path-node.utilitarian {
    border-color: rgba(255, 100, 100, 0.6);
}

.path-node.rawlsian {
    border-color: rgba(100, 255, 100, 0.6);
}

.path-node.aristotelian {
    border-color: rgba(100, 100, 255, 0.6);
}

.node-number {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

.node-philosophy {
    font-size: 1.2rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
}

.path-connector {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 100%);
}

.path-summary {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
}

.path-type {
    font-size: 0.9rem;
    color: rgba(255, 215, 0, 0.8);
    letter-spacing: 1px;
}

.path-consistency {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

/* 캐릭터 인터랙션 */
.character-interactions {
    margin-bottom: 120px;
}

.character-interactions h4 {
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 70px;
    font-size: 0.8rem;
    font-weight: 200;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-family: 'Noto Sans KR', sans-serif;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
    max-width: 600px;
    margin: 0 auto;
}

.character-card {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.character-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.character-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.2rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
}

.character-card h5 {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.character-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 20px;
}

.relationship-meter {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.relationship-fill {
    height: 100%;
    background: rgba(255, 215, 0, 0.6);
    transition: width 1s ease;
}

.relationship-status {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* 도덕적 딜레마 */
.moral-dilemmas {
    margin-bottom: 120px;
}

.moral-dilemmas h4 {
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 70px;
    font-size: 0.8rem;
    font-weight: 200;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-family: 'Noto Sans KR', sans-serif;
}

.dilemma-cards {
    display: grid;
    gap: 30px;
}

.dilemma-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 40px;
    position: relative;
}

.dilemma-card h5 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.dilemma-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 25px;
    line-height: 1.6;
}

.dilemma-resolution {
    display: flex;
    align-items: baseline;
    gap: 15px;
    margin-bottom: 20px;
}

.resolution-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.resolution-choice {
    font-size: 1rem;
    color: rgba(255, 215, 0, 0.8);
    font-weight: 400;
}

.dilemma-philosophy {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.philosophy-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}

.philosophy-indicator.utilitarian {
    background: rgba(255, 100, 100, 0.6);
}

.philosophy-indicator.rawlsian {
    background: rgba(100, 255, 100, 0.6);
}

.philosophy-indicator.aristotelian {
    background: rgba(100, 100, 255, 0.6);
}

/* 향상된 타임라인 */
.timeline-enhanced .timeline-marker {
    width: 40px;
    height: 40px;
    left: -20px;
    top: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.marker-number {
    font-size: 0.65rem;
    margin-bottom: 2px;
}

.marker-icon {
    font-size: 0.8rem;
}

.timeline-item.utilitarian .timeline-marker {
    border-color: rgba(255, 100, 100, 0.3);
    background: rgba(255, 100, 100, 0.05);
}

.timeline-item.rawlsian .timeline-marker {
    border-color: rgba(100, 255, 100, 0.3);
    background: rgba(100, 255, 100, 0.05);
}

.timeline-item.aristotelian .timeline-marker {
    border-color: rgba(100, 100, 255, 0.3);
    background: rgba(100, 100, 255, 0.05);
}

.choice-icon {
    color: rgba(255, 215, 0, 0.6);
    margin-right: 10px;
}

.choice-consequences {
    margin-top: 20px;
}

.consequence-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.consequence-list li {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.consequence-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

/* 향상된 엔딩 카드 */
.ending-card.enhanced {
    padding: 80px 60px;
}

.ending-header {
    margin-bottom: 40px;
}

.ending-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
    padding-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ending-stat {
    text-align: center;
}

.stat-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 15px;
    opacity: 0.8;
}

/* 향상된 통계 그리드 */
.stat-grid.enhanced {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0;
}

.stat-item .stat-icon {
    font-size: 1.2rem;
    margin-bottom: 10px;
    opacity: 0.6;
}

/* 철학적 인용구 */
.philosophical-quote {
    margin-top: 120px;
    padding: 80px 40px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.philosophical-quote blockquote {
    font-size: 1.3rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
    font-family: 'Noto Serif KR', serif;
    font-weight: 300;
}

.philosophical-quote blockquote::before,
.philosophical-quote blockquote::after {
    content: '"';
    font-size: 2rem;
    color: rgba(255, 215, 0, 0.3);
    vertical-align: -0.3em;
}

/* 모바일 반응형 개선 */
@media (max-width: 768px) {
    .report-details {
        padding: 25px 20px;
    }
    
    .stat-grid.enhanced {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .character-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ending-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .path-flow {
        flex-direction: column;
        gap: 15px;
    }
    
    .path-connector {
        width: 2px;
        height: 30px;
        background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 100%);
    }
    
    .philosophical-quote blockquote {
        font-size: 1.1rem;
    }
}

/* ============================= */
/* 클릭 가능한 요소들 기본 설정 */
/* ============================= */

button, .btn-primary, .btn-secondary, 
.choice-btn, .save-btn, .load-btn, 
.delete-btn, .story-btn, .slot-delete-x,
.term-highlight, a, [onclick] {
    position: relative;
    z-index: 10;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* 클릭 영역 확장 */
button::before, .btn-primary::before, .btn-secondary::before,
.choice-btn::before, .term-highlight::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    z-index: -1;
}

/* ============================= */
/* 용어 설명 기능 스타일 */
/* ============================= */

/* 용어 하이라이트 - 기본 상태 */
.term-highlight {
    color: var(--term-color);
    cursor: help;
    border-bottom: 1px dotted var(--term-color);
    transition: all 0.2s ease;
    position: relative;
    display: inline-block;
    z-index: 1;
    pointer-events: auto;
}

/* 용어 하이라이트 - 호버 상태 */
.term-highlight:hover {
    color: var(--term-hover-color);
    border-bottom-color: var(--term-hover-color);
    background-color: rgba(74, 158, 255, 0.1);
}

/* 용어 설명 비활성화 시 */
body.terms-disabled .term-highlight {
    color: inherit;
    cursor: inherit;
    border-bottom: none;
    pointer-events: none;
}

body.terms-disabled .term-highlight:hover {
    background-color: transparent;
}

/* 기존 용어 설명 툴팁 (숨김 처리) */
.term-tooltip {
    display: none;
}

/* 용어 설명 팝업 모달 스타일 */
.term-modal-content {
    max-width: 500px;
    width: 90%;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
    border: 2px solid var(--term-color);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    animation: modalGlow 2s ease-in-out infinite alternate;
}

@keyframes modalGlow {
    from {
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    }
    to {
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.5);
    }
}

.term-modal-title {
    color: var(--term-color);
    font-size: 1.5em;
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    font-weight: bold;
}

.term-modal-body {
    padding: 25px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin: 10px;
}

.term-definition-text {
    font-size: 1.15em;
    line-height: 1.7;
    color: #f0f0f0;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--term-color);
    border-radius: 4px;
}

.term-example-text {
    font-size: 1em;
    color: #b0b0b0;
    font-style: italic;
    padding: 15px;
    border-top: 1px dotted #444;
    background: rgba(0, 212, 255, 0.05);
    border-radius: 4px;
    margin-top: 15px;
}

.term-example-text::before {
    content: "💡 예시: ";
    color: var(--term-color);
    font-weight: bold;
    font-style: normal;
}

/* 모달 열릴 때 애니메이션 */
#termModal.show .term-modal-content {
    animation: slideIn 0.3s ease-out;
}

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

/* 모바일에서 용어 모달 최적화 */
@media (max-width: 768px) {
    .term-modal-content {
        max-width: 95%;
        width: 95%;
        margin: 10px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .term-modal-title {
        font-size: 1.2em;
        padding: 15px;
    }
    
    .term-modal-body {
        padding: 15px;
        margin: 5px;
    }
    
    .term-definition-text {
        font-size: 1em;
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .term-example {
        font-size: 0.9em;
        padding: 10px;
    }
    
    .term-related {
        margin-top: 15px;
        padding: 10px;
    }
}

/* 모바일에서 툴팁 */
@media (max-width: 768px) {
    .term-tooltip {
        max-width: 280px;
        font-size: 0.85em;
        padding: 10px 12px;
    }
    
    .term-highlight {
        border-bottom-width: 2px;
    }
}

/* 설정 모달에 용어 설명 토글 스타일 */
.terms-toggle-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.terms-toggle-container .toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.terms-toggle-container .info-text {
    font-size: 0.85em;
    color: rgba(var(--text-color), 0.7);
    margin-top: 5px;
    margin-left: 50px;
}

/* 큰 화면에서 모달 강제 숨김 - 최종 우선순위 */
@media (min-width: 769px) {
    .custom-theme-modal:not(.show),
    .settings-modal:not(.show),
    .effects-modal:not(.show),
    .save-modal:not(.show),
    .load-modal:not(.show),
    .modal:not(.show) {
        display: none !important;
        position: fixed !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}


/* 모든 화면 크기에서 모달 기본 상태 강제 설정 */
.custom-theme-modal:not(.show),
.settings-modal:not(.show), 
.effects-modal:not(.show),
.save-modal:not(.show),
.load-modal:not(.show),
.modal:not(.show) {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 15000 !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* .show 클래스가 있을 때만 모달 표시 - 더 높은 우선순위 */
.custom-theme-modal.show,
.settings-modal.show,
.effects-modal.show,
.save-modal.show,
.load-modal.show,
.modal.show {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 15000 !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
}

/* ========================================================================= */
/* 모든 화면 크기에서 세련된 glassmorphism 디자인 강제 적용 - 최고 우선순위 */
/* ========================================================================= */

/* 메뉴 버튼들 반응형 디자인 - 최고 우선순위 */
.game-menu .menu-btn,
.game-menu .theme-btn,
.game-menu .font-btn,
button.menu-btn,
button.theme-btn,
button.font-btn,
.menu-btn,
.theme-btn,
.font-btn {
    background: linear-gradient(145deg, rgba(30, 30, 58, 0.85), rgba(21, 21, 41, 0.80)) !important;
    border: 1px solid rgba(255, 215, 0, 0.3) !important;
    border-radius: 12px !important;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 215, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(6px) !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

/* 화면 크기별 메뉴 버튼 크기 조정 */
@media (max-width: 768px) {
    .game-menu .menu-btn,
    .game-menu .theme-btn,
    .game-menu .font-btn,
    button.menu-btn,
    button.theme-btn,
    button.font-btn,
    .menu-btn,
    .theme-btn,
    .font-btn {
        padding: 6px 8px !important;
        font-size: 11px !important;
        margin: 3px !important;
        border-radius: 8px !important;
        gap: 4px !important;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .game-menu .menu-btn,
    .game-menu .theme-btn,
    .game-menu .font-btn,
    button.menu-btn,
    button.theme-btn,
    button.font-btn,
    .menu-btn,
    .theme-btn,
    .font-btn {
        padding: 8px 12px !important;
        font-size: 12px !important;
        margin: 4px !important;
        border-radius: 10px !important;
        gap: 5px !important;
    }
}

@media (min-width: 1201px) {
    .game-menu .menu-btn,
    .game-menu .theme-btn,
    .game-menu .font-btn,
    button.menu-btn,
    button.theme-btn,
    button.font-btn,
    .menu-btn,
    .theme-btn,
    .font-btn {
        padding: 10px 16px !important;
        font-size: 13px !important;
        margin: 5px !important;
        border-radius: 12px !important;
        gap: 6px !important;
    }
}

/* 메뉴 버튼 호버 효과 */
.game-menu .menu-btn:hover,
.game-menu .theme-btn:hover,
.game-menu .font-btn:hover,
button.menu-btn:hover,
button.theme-btn:hover,
button.font-btn:hover,
.menu-btn:hover,
.theme-btn:hover,
.font-btn:hover {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.95), rgba(255, 165, 0, 0.85)) !important;
    transform: translateY(-2px) scale(1.05) !important;
    border-color: rgba(255, 215, 0, 0.8) !important;
    color: #1a1a1a !important;
    box-shadow: 
        0 12px 35px rgba(255, 215, 0, 0.3),
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(15px) !important;
}

/* 저장/불러오기 슬롯 디자인 - 모든 가능한 선택자로 최고 우선순위 */
.save-modal .save-slot-btn.save-slot.save-slot-empty,
.load-modal .save-slot-btn.save-slot.save-slot-empty,
.save-modal .save-slot-btn.save-slot,
.load-modal .save-slot-btn.save-slot,
.save-modal .save-slot-btn,
.load-modal .save-slot-btn,
.save-modal .save-slot,
.load-modal .save-slot,
button.save-slot-btn.save-slot.save-slot-empty,
button.save-slot-btn.save-slot,
button.save-slot-btn,
button.save-slot,
.save-slot-btn.save-slot.save-slot-empty,
.save-slot-btn.save-slot,
.save-slot-btn,
.save-slot {
    background: linear-gradient(145deg, rgba(30, 30, 58, 0.95), rgba(21, 21, 41, 0.90)) !important;
    border: 2px solid rgba(255, 215, 0, 0.25) !important;
    border-radius: 16px !important;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 215, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(8px) !important;
    color: #ffffff !important;
    padding: 16px !important;
    margin: 8px !important;
    transition: all 0.3s ease !important;
    min-height: 120px !important;
/* 저장 슬롯 반응형 너비 조정 */
@media (max-width: 768px) {
    .save-modal .save-slot-btn.save-slot.save-slot-empty,
    .load-modal .save-slot-btn.save-slot.save-slot-empty,
    .save-modal .save-slot-btn.save-slot,
    .load-modal .save-slot-btn.save-slot,
    .save-modal .save-slot-btn,
    .load-modal .save-slot-btn,
    .save-modal .save-slot,
    .load-modal .save-slot,
    button.save-slot-btn.save-slot.save-slot-empty,
    button.save-slot-btn.save-slot,
    button.save-slot-btn,
    button.save-slot,
    .save-slot-btn.save-slot.save-slot-empty,
    .save-slot-btn.save-slot,
    .save-slot-btn,
    .save-slot {
        width: calc(50% - 16px) !important;
    }
}

/* 극소형 화면 (320px 이하) 전용 개선사항 */
@media (max-width: 320px) {
    /* 메뉴 버튼들 - 텍스트 크기 줄이고 버튼 높이 증가 */
    .menu-btn {
        padding: 8px 6px !important;
        font-size: 9px !important;
        min-height: 44px !important; /* 터치 영역 보장 */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
    }
    
    /* 메뉴 버튼 아이콘과 텍스트 */
    .menu-btn .menu-icon {
        font-size: 14px !important;
        line-height: 1 !important;
    }
    
    .menu-btn .menu-label {
        font-size: 8px !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        display: block !important; /* 텍스트가 보이도록 강제 */
        visibility: visible !important; /* 숨겨진 텍스트 강제 표시 */
        opacity: 1 !important; /* 투명도 복원 */
    }
    
    /* 메뉴 그리드 간격 줄이기 */
    .menu-grid {
        gap: 4px !important;
        padding: 8px !important;
    }
    
    /* 주인공 선택 카드 텍스트 크기 조정 */
    .gender-btn h3,
    .gender-btn .gender-name {
        font-size: 14px !important;
        line-height: 1.3 !important;
    }
    
    .gender-btn p,
    .gender-btn .gender-desc {
        font-size: 11px !important;
        line-height: 1.4 !important;
    }
    
    /* 주인공 선택 이미지 크기 줄이기 */
    .gender-btn img,
    .gender-image img {
        width: 120px !important;
        height: 120px !important;
    }
    
    /* 모달 헤더 텍스트 크기 조정 */
    .modal-content h3 {
        font-size: 16px !important;
    }
    
    /* 설정 모달 테마 버튼들 */
    .theme-grid .theme-btn {
        padding: 8px !important;
        font-size: 10px !important;
        min-height: 44px !important;
    }
    
    /* 저장/불러오기 슬롯 */
    .save-slot, .load-slot {
        min-height: 44px !important;
        padding: 6px !important;
        font-size: 10px !important;
    }
    
    /* 전체적인 글씨 크기 조정 */
    body {
        font-size: 12px !important;
    }
    
    h1 {
        font-size: 20px !important;
    }
    
    h2 {
        font-size: 16px !important;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .save-modal .save-slot-btn.save-slot.save-slot-empty,
    .load-modal .save-slot-btn.save-slot.save-slot-empty,
    .save-modal .save-slot-btn.save-slot,
    .load-modal .save-slot-btn.save-slot,
    .save-modal .save-slot-btn,
    .load-modal .save-slot-btn,
    .save-modal .save-slot,
    .load-modal .save-slot,
    button.save-slot-btn.save-slot.save-slot-empty,
    button.save-slot-btn.save-slot,
    button.save-slot-btn,
    button.save-slot,
    .save-slot-btn.save-slot.save-slot-empty,
    .save-slot-btn.save-slot,
    .save-slot-btn,
    .save-slot {
        width: calc(33.33% - 16px) !important;
    }
}

@media (min-width: 1201px) {
    .save-modal .save-slot-btn.save-slot.save-slot-empty,
    .load-modal .save-slot-btn.save-slot.save-slot-empty,
    .save-modal .save-slot-btn.save-slot,
    .load-modal .save-slot-btn.save-slot,
    .save-modal .save-slot-btn,
    .load-modal .save-slot-btn,
    .save-modal .save-slot,
    .load-modal .save-slot,
    button.save-slot-btn.save-slot.save-slot-empty,
    button.save-slot-btn.save-slot,
    button.save-slot-btn,
    button.save-slot,
    .save-slot-btn.save-slot.save-slot-empty,
    .save-slot-btn.save-slot,
    .save-slot-btn,
    .save-slot {
        width: calc(25% - 16px) !important;
    }
}

/* 기본 저장 슬롯 스타일 */
.save-modal .save-slot-btn.save-slot.save-slot-empty,
.load-modal .save-slot-btn.save-slot.save-slot-empty,
.save-modal .save-slot-btn.save-slot,
.load-modal .save-slot-btn.save-slot,
.save-modal .save-slot-btn,
.load-modal .save-slot-btn,
.save-modal .save-slot,
.load-modal .save-slot,
button.save-slot-btn.save-slot.save-slot-empty,
button.save-slot-btn.save-slot,
button.save-slot-btn,
button.save-slot,
.save-slot-btn.save-slot.save-slot-empty,
.save-slot-btn.save-slot,
.save-slot-btn,
.save-slot {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

/* 저장/불러오기 슬롯 호버 효과 */
.save-modal .save-slot-btn.save-slot.save-slot-empty:hover,
.load-modal .save-slot-btn.save-slot.save-slot-empty:hover,
.save-modal .save-slot-btn.save-slot:hover,
.load-modal .save-slot-btn.save-slot:hover,
.save-modal .save-slot-btn:hover,
.load-modal .save-slot-btn:hover,
.save-modal .save-slot:hover,
.load-modal .save-slot:hover,
button.save-slot-btn.save-slot.save-slot-empty:hover,
button.save-slot-btn.save-slot:hover,
button.save-slot-btn:hover,
button.save-slot:hover,
.save-slot-btn.save-slot.save-slot-empty:hover,
.save-slot-btn.save-slot:hover,
.save-slot-btn:hover,
.save-slot:hover {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.95), rgba(255, 165, 0, 0.85)) !important;
    transform: translateY(-3px) scale(1.02) !important;
    border-color: rgba(255, 215, 0, 0.8) !important;
    color: #1a1a1a !important;
    box-shadow: 
        0 12px 30px rgba(255, 215, 0, 0.25),
        0 0 15px rgba(255, 215, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

/* 슬롯 내부 텍스트 색상 강제 설정 */
.save-slot-btn .slot-number-badge,
.save-slot .slot-number-badge,
.save-slot-btn .slot-empty-content,
.save-slot .slot-empty-content,
.save-slot-btn .slot-content,
.save-slot .slot-content {
    color: #ffffff !important;
}

.save-slot-btn:hover .slot-number-badge,
.save-slot:hover .slot-number-badge,
.save-slot-btn:hover .slot-empty-content,
.save-slot:hover .slot-empty-content,
.save-slot-btn:hover .slot-content,
.save-slot:hover .slot-content {
    color: #1a1a1a !important;
}
