:root {
    --bg-dark: #0a0a0a;
    --text-light: #f5f5f5;
    --accent-red: #ff3e3e;
    --accent-gold: #ffd700;
    --accent-silver: #c8c8c8;
}

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

html {
    scroll-behavior: smooth;
}

/* a 태그가 btn 클래스를 가질 때 기본 링크 스타일 초기화 */
a.btn {
    text-decoration: none;
    display: none;
    /* 기본은 숨김, 단계별 CSS로 display:flex 설정 */
}

body {
    background-color: #ffffff;
    color: var(--text-light);
    font-family: 'Noto Sans KR', sans-serif;
    overflow-x: hidden;
}

/* ── 일렁이는 배경 세팅 ── */
.shimmer-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.25;
    background:
        radial-gradient(circle at 20% 30%, rgba(40, 60, 150, 0.4) 0%, transparent 60%),
        radial-gradient(circle at 80% 70%, rgba(80, 40, 110, 0.4) 0%, transparent 60%);
    filter: blur(80px);
    animation: drift 20s ease-in-out infinite alternate;
}

@keyframes drift {
    from {
        transform: scale(1) translate(0, 0);
    }

    to {
        transform: scale(1.2) translate(20px, 10px);
    }
}

/* ── 전역 히어로 배경 이미지 제거 (사용자 요청: scene1에만 적용) ── */
/* .hero-bg-image 스타일 삭제됨 */

/* ── 스크롤 진행 바 ── */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 9999;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--accent-red), var(--accent-gold));
    transition: width 0.1s linear;
}

/* ── 레이아웃 ── */
.mainpage {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content {
    background: linear-gradient(to bottom, #1a1a1a, #000);
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 10;
}

/* ── 씬 공통 ── */
.scene1,
.scene2,
.scene3,
.scene4 {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.scene1 {
    min-height: 400vh;
    justify-content: flex-start;
    padding-top: 50vh;
    gap: 80vh;
    position: relative;
    background: #000;
    overflow: hidden;
}

/* 씬별 배경 레이어 (이미지가 정해진 위치에 한 번만 보이도록 설정) */
.scene-bg-layer {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100vh;
    background-size: 100% auto;
    background-repeat: no-repeat;
    background-position: top center;
    z-index: 0;
}

/* 어두운 오버레이로 배경과 글자 대비 확보 */
.scene1::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.6) 0%,
            rgba(0, 0, 0, 0.2) 20%,
            rgba(0, 0, 0, 0.6) 80%,
            rgba(0, 0, 0, 1) 100%);
    z-index: 1;
}

.scene2 {
    min-height: 150vh;
    justify-content: center;
    gap: 20px;
    /* padding: 10vh 20px; */
    background-image: url('assets/find_gun.png');
    background-size: 100% auto;
    background-repeat: no-repeat;
    background-position: center;
}

.scene3 {
    min-height: 80vh;
    justify-content: center;
    padding: 10vh 0;
    background: #000;
}

.scene4 {
    min-height: 80vh;
    /* 엔딩 버튼이 한눈에 보이도록 높이 조정 */
    justify-content: center;
    background: #000;
    padding: 10vh 20px;
    position: relative;
    overflow: hidden;
    z-index: 6;
}


.vampire-bg {
    position: fixed;
    top: 0;
    left: 50%;
    width: 50%;
    /* .content와 동일한 너비 */
    height: 100vh;
    background-image: url('assets/vampire.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center 30%;
    /* 화면 중앙보다 살짝 위 */
    z-index: 5;
    transform: translateX(-50%) scale(0.08);
    transform-origin: center 38%;
    /* 이 지점(얼굴)에서 확대 */
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

/* ── 텍스트 ── */
.desc {
    font-size: 1.2rem;
    line-height: 1.6;
    opacity: 0.9;
}

.accent {
    color: var(--accent-red);
    font-weight: 700;
}

.desc.gold {
    color: var(--accent-gold);
}

.desc.red {
    color: var(--accent-red);
}

/* ── 콘텐츠 블록 ── */
.content-block {
    z-index: 10;
}

/* ── 패럴렉스 아이템 ── */
.parallax-item {
    will-change: transform;
}

/* ── 스크롤 슬라이드 업 (JS 미사용 시 가시성 확보) ── */
.slide-up {
    opacity: 1;
    /* 강제 가시성 확보 */
    transform: translateY(0);
    /* 위치 초기화 */
    transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 10;
    position: relative;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    font-weight: 700;
}

.slide-up.in-view {
    opacity: 1;
    transform: translateY(0);
}

.falldown {
    margin: 50px 0;
}

.falldown-img {
    width: 100%;
    height: auto;
    margin-top: 20px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.vampire {
    width: 100%;
    /* 너비 꽉 채우기 */
    /* margin-top: 50vh;
    margin-bottom: 50vh; */
}

.vampire-img {
    width: 100%;
    height: 50vh;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.2);
}

.screem {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    font-weight: 900;
    color: #ff3e3e86;
    background-color: black;
    padding: 300px 0;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8), 0 0 40px rgba(0, 0, 0, 0.9);
    letter-spacing: 10px;
    animation: shake 0.1s infinite;
    user-select: none;
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

/* ============================================================
   Scene 3: 라디오 버튼 기반 회전 약실
   ============================================================ */

/* 라디오 버튼 숨김 */
input[type="radio"] {
    display: none;
}

/* 전체 래퍼 */
.main-wrapper {
    position: relative;
    width: 500px;
    height: 320px;
}

/* 반원 뷰 (위쪽 절반만 보임) */
.carousel-view {
    width: 100%;
    height: 260px;
    /* 반지름 = 250px, 아이템 높이 절반 포함 */
    overflow: hidden;
    position: relative;
}

/* 약실 리스트 - 전체 원 크기 */
.item-list {
    position: absolute;
    width: 100%;
    height: 500px;
    /* 지름 */
    top: 0;
    left: 0;
    list-style: none;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center 250px;
    /* 회전 중심: 원의 바닥 */
}

/* 약실 개별 칸 */
.item {
    position: absolute;
    width: 80px;
    height: 80px;
    background: #2a2a2a;
    border: 3px solid #555;
    color: #aaa;
    border-radius: 50%;
    left: calc(50% - 40px);
    top: 0px;
    transform-origin: center 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    transition: background 0.3s, border-color 0.3s;
}

.noitem {
    position: absolute;
    width: 80px;
    height: 80px;
    background: #2a2a2a;
    border: 3px solid #555;
    color: #aaa;
    border-radius: 50%;
    left: calc(50% - 40px);
    top: 0px;
    transform-origin: center 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    transition: background 0.3s, border-color 0.3s;
}

.noitem.empty {
    background: #131313;
    /* 단순 검은색에서 금속 느낌의 회색으로 조정 */
    border-color: #666;
    color: #131313;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

/* 은 탄환 슬롯 강조 */
.item.silver {
    background: rgba(200, 200, 200, 0.39);
    border-color: var(--accent-silver);
    color: var(--accent-silver);
    text-shadow: 0 0 10px rgba(200, 200, 200, 0.6);
    box-shadow: 0 0 15px rgba(200, 200, 200, 0.653);
}

/* 6개 약실 60도 간격 배치 (item, noitem 공통 적용) */
.item-list li:nth-child(1) {
    transform: rotate(0deg);
}

.item-list li:nth-child(2) {
    transform: rotate(60deg);
}

.item-list li:nth-child(3) {
    transform: rotate(120deg);
}

.item-list li:nth-child(4) {
    transform: rotate(180deg);
}

.item-list li:nth-child(5) {
    transform: rotate(240deg);
}

.item-list li:nth-child(6) {
    transform: rotate(300deg);
}

/* 단계별 회전 */
#step1:checked~.carousel-view .item-list {
    transform: rotate(0deg);
}

#step2:checked~.carousel-view .item-list {
    transform: rotate(-60deg);
}

#step3:checked~.carousel-view .item-list {
    transform: rotate(-120deg);
}

#step4:checked~.carousel-view .item-list {
    transform: rotate(-180deg);
}

#step5:checked~.carousel-view .item-list {
    transform: rotate(-240deg);
}

#step6:checked~.carousel-view .item-list {
    transform: rotate(-300deg);
}

/* ── 중앙 버튼 (반원 바닥 중심) ── */
.center-button-area {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.btn {
    width: 90px;
    height: 90px;
    background: #1c1c1c;
    color: #ccc;
    border: 2px solid #444;
    border-radius: 50%;
    display: none;
    /* 기본 숨김 */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    user-select: none;
}

.btn:hover {
    background: #2a2a2a;
    transform: scale(1.05);
}

/* 은 탄환 단계 버튼 강조 */
.silver-btn {
    border-color: var(--accent-silver) !important;
    color: var(--accent-silver) !important;
    box-shadow: 0 0 20px rgba(200, 200, 200, 0.3), 0 4px 20px rgba(0, 0, 0, 0.6) !important;
}

/* 발사 버튼 강조 */
.fire-btn {
    background: #3a0000 !important;
    border-color: var(--accent-red) !important;
    color: var(--accent-red) !important;
    font-size: 1.1rem !important;
    animation: fire-pulse 0.8s ease-in-out infinite;
    box-shadow: 0 0 25px rgba(255, 60, 60, 0.4), 0 4px 20px rgba(0, 0, 0, 0.6) !important;
}

@keyframes fire-pulse {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(255, 60, 60, 0.3), 0 4px 20px rgba(0, 0, 0, 0.6);
    }

    50% {
        box-shadow: 0 0 35px rgba(255, 60, 60, 0.7), 0 4px 20px rgba(0, 0, 0, 0.6);
    }
}

/* 현재 단계에 맞는 버튼만 표시 */
#step1:checked~.center-button-area .b1,
#step2:checked~.center-button-area .b2,
#step3:checked~.center-button-area .b3,
#step4:checked~.center-button-area .b4,
#step5:checked~.center-button-area .b5,
#step6:checked~.center-button-area .b6 {
    display: flex;
}

/* ── 단계별 안내 힌트 텍스트 ── */
.step-hint {
    position: absolute;
    bottom: -30px;
    width: 100%;
    text-align: center;
}

.hint {
    display: none;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #666;
    opacity: 0.9;
}

/* 단계별 힌트 크기 단계적 상향 */
.hint.h1 {
    font-size: 1.1rem;
}

.hint.h2 {
    font-size: 1.3rem;
}

.hint.h3 {
    font-size: 1.5rem;
}

.hint.h4 {
    font-size: 1.75rem;
}

.hint.h5 {
    font-size: 1.6rem;
}

.hint.h6 {
    font-size: 1.2rem;
}

.hint.gold {
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* 단계별 힌트 크기 상향 */
.hint.h1 {
    font-size: 1rem;
}

.hint.h2 {
    font-size: 1.4rem;
}

.hint.h3 {
    font-size: 1.8rem;
}

.hint.fire {
    color: var(--accent-red);
    text-shadow: 0 0 10px rgba(255, 60, 60, 0.5);
    font-size: 2.2rem;
    /* 훨씬 크게 강조 */
}

/* 단계별 힌트 표시 */
#step1:checked~.step-hint .h1 {
    display: block;
}

#step2:checked~.step-hint .h2 {
    display: block;
    animation: pop 0.3s ease;

}

#step3:checked~.step-hint .h3 {
    display: block;
    animation: pop 0.5s ease;
}

#step4:checked~.step-hint .h4 {
    display: block;
}

#step5:checked~.step-hint .h5 {
    display: block;
}

#step6:checked~.step-hint .h6 {
    display: block;
}

@keyframes pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ── Scene 4: 엔딩 ── */
.ending {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 10;
}

/* 생존 엔딩 초기 숨김 */
.survival-ending {
    display: none;
}

/* step6 활성화 시 결말 전환 */
#step6:checked~.center-button-area~* .survival-ending,
.main-wrapper:has(#step6:checked)~* .survival-ending {
    display: flex;
}

#step6:checked~.center-button-area~* .death-ending,
.main-wrapper:has(#step6:checked)~* .death-ending {
    display: none;
}

.end-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    letter-spacing: -2px;
    opacity: 0.9;
}

.end-title.red {
    color: var(--accent-red);
    text-shadow: 0 0 30px rgba(255, 60, 60, 0.4);
}

.end-title.first {
    color: var(--accent-gold);
    font-size: 0.5em;
    text-shadow: 0 0 60px rgba(255, 255, 255, 0.6);
}

.end-title.second {
    color: var(--accent-gold);
    font-size: 1em;
    text-shadow: 0 0 80px rgba(255, 255, 255, 0.7);
}

/* dim 텍스트 */
.desc.dim {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

/* 사망 엔딩 링크 버튼 - 일반 배치로 변경하여 가시성 확보 */
/* 사망 엔딩 링크 버튼 - 불길한 붉은 네온 효과 */
.end-link {
    margin-top: 50vh;
    display: inline-block;
    padding: 20px 45px;
    color: #ff3e3e;
    text-decoration: none;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 5px;
    border: 1px solid #ff3e3e;
    border-radius: 50px;
    transition: all 0.3s ease;
    position: relative;
    opacity: 1;
    pointer-events: auto;
    white-space: nowrap;

    /* 네온 효과: 바깥쪽 광운 + 안쪽 광운 */
    box-shadow:
        0 0 15px rgba(255, 62, 62, 0.6),
        0 0 30px rgba(255, 62, 62, 0.4),
        inset 0 0 15px rgba(255, 62, 62, 0.4);
    text-shadow: 0 0 10px rgba(255, 62, 62, 0.8);

    /* 불길하게 깜빡이는 효과 */
    animation: neon-pulse 1.5s infinite alternate;
}

@keyframes neon-pulse {
    0% {
        box-shadow: 0 0 10px rgba(255, 62, 62, 0.5), 0 0 20px rgba(255, 62, 62, 0.3), inset 0 0 10px rgba(255, 62, 62, 0.3);
        text-shadow: 0 0 5px rgba(255, 62, 62, 0.6);
        transform: scale(1);
    }

    100% {
        box-shadow: 0 0 20px rgba(255, 62, 62, 0.8), 0 0 40px rgba(255, 62, 62, 0.5), inset 0 0 20px rgba(255, 62, 62, 0.5);
        text-shadow: 0 0 15px rgba(255, 62, 62, 0.9);
        transform: scale(1.02);
    }
}

/* 
.end-link.visible {
    opacity: 1;
    pointer-events: auto;
} */

.end-link:hover {
    background: rgba(255, 60, 60, 0.1);
    color: #ff3e3e;
    border-color: rgba(255, 60, 60, 0.6);
}

/* ── 모바일 ── */
@media (max-width: 700px) {
    .content {
        width: 100%;
    }

    .main-wrapper {
        width: 340px;
        height: 240px;
    }

    .carousel-view {
        height: 200px;
    }

    .item-list {
        height: 400px;
        transform-origin: center 200px;
    }

    .item {
        transform-origin: center 200px;
        width: 60px;
        height: 60px;
        left: calc(50% - 30px);
    }

    #step1:checked~.carousel-view .item-list {
        transform: rotate(0deg);
    }

    #step2:checked~.carousel-view .item-list {
        transform: rotate(-60deg);
    }

    #step3:checked~.carousel-view .item-list {
        transform: rotate(-120deg);
    }

    #step4:checked~.carousel-view .item-list {
        transform: rotate(-180deg);
    }

    #step5:checked~.carousel-view .item-list {
        transform: rotate(-240deg);
    }

    #step6:checked~.carousel-view .item-list {
        transform: rotate(-300deg);
    }
}