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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    height: 100vh;
    /* 하늘 그라데이션 배경 */
    background: linear-gradient(to bottom,
        #87CEEB 0%,      /* 밝은 하늘색 */
        #B0E0E6 30%,     /* 파우더 블루 */
        #E0F6FF 60%,     /* 연한 하늘색 */
        #ffffff 100%     /* 구름같은 흰색 */
    );
    position: relative;
}

/* 움직이는 구름 효과 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(ellipse 200px 80px at 20% 30%, rgba(255, 255, 255, 0.6) 0%, transparent 100%),
        radial-gradient(ellipse 150px 60px at 70% 20%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
        radial-gradient(ellipse 180px 70px at 50% 50%, rgba(255, 255, 255, 0.4) 0%, transparent 100%),
        radial-gradient(ellipse 220px 90px at 85% 60%, rgba(255, 255, 255, 0.5) 0%, transparent 100%);
    animation: clouds 30s ease-in-out infinite;
    pointer-events: none;
}

@keyframes clouds {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(30px);
    }
}

#game-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

h1 {
    font-size: 48px;
    color: #2c3e50;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
    animation: fadeIn 2s ease-in;
}

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

#game-screen {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    min-width: 600px;
    min-height: 400px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.9);
}

.story-text {
    font-size: 20px;
    line-height: 1.8;
    color: #34495e;
    margin-bottom: 30px;
    text-align: center;
}

.choices {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.choice-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.choice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

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

/* 점프스케어 전체 화면 오버레이 */
#jumpscare-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: black;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 점프스케어 애니메이션 */
@keyframes shake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-10px, -10px); }
    20% { transform: translate(10px, 10px); }
    30% { transform: translate(-10px, 10px); }
    40% { transform: translate(10px, -10px); }
    50% { transform: translate(-10px, -10px); }
    60% { transform: translate(10px, 10px); }
    70% { transform: translate(-10px, 10px); }
    80% { transform: translate(10px, -10px); }
    90% { transform: translate(-10px, -10px); }
}

@keyframes jumpScareAnim {
    0% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes monsterAnim {
    0% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes monsterHandAnim {
    0% { transform: translateX(-30vw); opacity: 0; }
    100% { transform: translateX(20vw); opacity: 1; }
}

/* 유리 깨지는 효과 */
#glass-break {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    pointer-events: none;
    background:
        /* 중앙 충격 지점 */
        radial-gradient(circle at 50% 50%, transparent 5%, rgba(255,255,255,0.9) 5.5%, transparent 6%),
        /* 주요 균열 선들 */
        linear-gradient(0deg, transparent 49%, rgba(255,255,255,0.95) 49.5%, rgba(255,255,255,0.95) 50.5%, transparent 51%),
        linear-gradient(45deg, transparent 49%, rgba(255,255,255,0.9) 49.5%, rgba(255,255,255,0.9) 50.5%, transparent 51%),
        linear-gradient(90deg, transparent 49%, rgba(255,255,255,0.9) 49.5%, rgba(255,255,255,0.9) 50.5%, transparent 51%),
        linear-gradient(135deg, transparent 49%, rgba(255,255,255,0.85) 49.5%, rgba(255,255,255,0.85) 50.5%, transparent 51%),
        linear-gradient(22deg, transparent 49%, rgba(255,255,255,0.8) 49.5%, rgba(255,255,255,0.8) 50.5%, transparent 51%),
        linear-gradient(112deg, transparent 49%, rgba(255,255,255,0.75) 49.5%, rgba(255,255,255,0.75) 50.5%, transparent 51%),
        linear-gradient(67deg, transparent 49%, rgba(255,255,255,0.7) 49.5%, rgba(255,255,255,0.7) 50.5%, transparent 51%),
        linear-gradient(157deg, transparent 49%, rgba(255,255,255,0.7) 49.5%, rgba(255,255,255,0.7) 50.5%, transparent 51%),
        /* 작은 균열들 */
        linear-gradient(30deg, transparent 49.5%, rgba(255,255,255,0.5) 50%, transparent 50.5%),
        linear-gradient(60deg, transparent 49.5%, rgba(255,255,255,0.5) 50%, transparent 50.5%),
        linear-gradient(120deg, transparent 49.5%, rgba(255,255,255,0.5) 50%, transparent 50.5%),
        linear-gradient(150deg, transparent 49.5%, rgba(255,255,255,0.5) 50%, transparent 50.5%),
        /* 충격 파동 */
        radial-gradient(circle at 50% 50%, transparent 10%, rgba(255,255,255,0.4) 11%, transparent 12%),
        radial-gradient(circle at 50% 50%, transparent 20%, rgba(255,255,255,0.3) 21%, transparent 22%),
        radial-gradient(circle at 50% 50%, transparent 30%, rgba(255,255,255,0.2) 31%, transparent 32%);
    animation: glassShatter 0.3s ease-out forwards;
}

@keyframes glassShatter {
    0% {
        opacity: 0;
        transform: scale(0.5);
        filter: blur(0px);
    }
    10% {
        opacity: 1;
        transform: scale(0.8);
        filter: blur(0px);
    }
    100% {
        opacity: 0.5;
        transform: scale(1.5);
        filter: blur(2px);
    }
}

/* 자화상 다가오는 애니메이션 */
@keyframes doppelgangerApproach {
    0% {
        transform: scale(0.3);
        opacity: 0.5;
    }
    100% {
        transform: scale(3);
        opacity: 1;
    }
}

/* 배경 깜빡이는 효과 */
@keyframes flashBackground {
    0% {
        background: #ff0000;
    }
    50% {
        background: #000000;
    }
    100% {
        background: #ff0000;
    }
}

/* 자동차가 빠르게 다가오는 애니메이션 */
@keyframes carApproach {
    0% {
        transform: scale(0.1);
        opacity: 0.5;
    }
    70% {
        transform: scale(5);
        opacity: 1;
    }
    100% {
        transform: scale(30);
        opacity: 1;
    }
}

/* 자동차 배경 빠른 깜박임 */
@keyframes carFlashBackground {
    0% {
        background: #ffffff;
    }
    50% {
        background: #ff0000;
    }
    100% {
        background: #ffffff;
    }
}

/* 유리 미로 배경 애니메이션 */
@keyframes glassMazeShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 엔딩 도감 버튼 */
.ending-book-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 10px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.ending-book-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* 엔딩 도감 모달 */
.ending-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.ending-modal-content {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.ending-modal-content h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close-btn:hover {
    color: #000;
}

.ending-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    margin: 15px 0;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.ending-item.locked {
    background: rgba(150, 150, 150, 0.3);
    color: #666;
}

.ending-item h3 {
    margin: 0 0 10px 0;
    color: #667eea;
}

.ending-item.locked h3 {
    color: #999;
}

.ending-item p {
    margin: 5px 0;
    line-height: 1.6;
}
