:root {
    --flame-color: #ff9d00;
    --flame-core: #ffff00;
    --candle-body: #f0f0f0;
    --glow: rgba(255, 165, 0, 0.6);
}

body {
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
    background-color: #050505;
    color: #e5e5e5;
    overflow-x: hidden;
}

h1, h2, h3, .serif-font {
    font-family: 'Noto Serif KR', serif;
}

/* 촛불 애니메이션 */
.candle-container {
    position: relative;
    width: 20px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    transition: all 0.5s ease;
}

.candle {
    width: 16px;
    height: 80px;
    background: linear-gradient(to right, #e0e0e0, #ffffff, #dcdcdc);
    border-radius: 4px;
    position: relative;
    box-shadow: inset -2px 0 5px rgba(0,0,0,0.1);

    /* 초의 등장 애니메이션을 위해 초기 상태 설정 */
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* 초가 '꽂힌' 상태 */
.candle.placed {
    opacity: 1;
    transform: translateY(0);
}

.wick {
    width: 2px;
    height: 10px;
    background: #333;
    margin-bottom: -2px;
    z-index: 10;
    opacity: 0; /* 심지도 초가 꽂힐 때 같이 나옴 */
    transition: opacity 2s ease;
}
.candle.placed ~ .wick, .wick.visible {
    opacity: 1;
}

.flame {
    width: 20px;
    height: 30px;
    background: radial-gradient(ellipse at bottom, var(--flame-core), var(--flame-color));
    border-radius: 50% 50% 20% 20%;
    position: absolute;
    top: 2px; /* 심지에 붙어있도록 위치 조정 */
    left: 50%;
    transform: translateX(-50%) scale(0);
    opacity: 0;
    transition: all 0.5s ease;
    box-shadow: 0 0 20px var(--glow);
    filter: blur(1px);
    z-index: 20;
}

.flame.lit {
    transform: translateX(-50%) scale(1);
    opacity: 1;
    animation: flicker 0.1s infinite alternate;
}

@keyframes flicker {
    0% { transform: translateX(-50%) scale(1) skewX(2deg); opacity: 0.9; }
    100% { transform: translateX(-50%) scale(1.05) skewX(-2deg); opacity: 1; }
}

/* 샤마쉬(가운데 촛대) 높이 조절 */
.shamash .candle-container {
    height: 186px;
}
.shamash .candle {
    height: 105px;
    margin-bottom: 40px;
}

/* 섹션 스타일 */
.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.gold-text {
    background: linear-gradient(to right, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 별빛 배경 애니메이션 */
.star-bg {
    background: #050505;
    overflow: hidden;
}
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle var(--duration) ease-in-out infinite;
}
@keyframes twinkle {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: var(--opacity); transform: scale(1.2); }
    100% { opacity: 0; transform: scale(0.5); }
}

/* 마이크/미션 관련 스타일 */
.check-mark {
    display: none;
}
.check-mark.show {
    display: block;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* 볼륨 바 기준선 스타일 추가 */
.threshold-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%; /* 성공 기준점 완화 (50%) */
    width: 2px;
    background-color: rgba(255, 255, 255, 0.8);
    border-right: 1px dashed #fff;
    z-index: 10;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.threshold-label {
    position: absolute;
    top: -20px;
    left: 50%; /* 성공 기준점 완화 (50%) */
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #fbbf24; /* yellow-400 */
    white-space: nowrap;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* 음악 플레이어 숨김 처리 */
#bgm-player {
    position: fixed;
    bottom: 0;
    right: 0;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

/* 음악 컨트롤 버튼 애니메이션 */
.music-playing {
    animation: pulse-music 2s infinite;
}
@keyframes pulse-music {
    0% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(234, 179, 8, 0); }
    100% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0); }
}

/* 음식 섹션 캐러셀 스타일 (드래그 스크롤 방식) */
.carousel-container {
    overflow-x: auto; /* 가로 스크롤 허용 */
    overflow-y: hidden;
    position: relative;
    cursor: grab; /* 마우스 커서 손모양 */
    scroll-behavior: smooth; /* 부드러운 스크롤 */
    scroll-snap-type: x mandatory; /* 스크롤 정지 시 스냅 */
    -webkit-overflow-scrolling: touch; /* iOS 부드러운 스크롤 */
    scrollbar-width: none; /* 파이어폭스 스크롤바 숨김 */
}
.carousel-container::-webkit-scrollbar {
    display: none; /* 크롬/사파리 스크롤바 숨김 */
}
.carousel-container:active {
    cursor: grabbing;
    scroll-snap-type: none; /* 드래그 중에는 스냅 해제하여 부드럽게 */
    scroll-behavior: auto;
}
.carousel-track {
    display: flex;
    width: max-content; /* 내용물만큼 너비 확보 */
}
.carousel-slide {
    min-width: 85vw; /* 모바일: 화면의 85% 너비 (다음 카드 살짝 보임) */
    padding: 0 10px;
    box-sizing: border-box;
    user-select: none;
    scroll-snap-align: center; /* 카드 중앙 정렬 스냅 */
}
@media (min-width: 768px) {
    .carousel-slide {
        min-width: 320px; /* 데스크탑: 고정 너비 혹은 적절한 비율 */
        width: 33.333%;
    }
}
.food-card {
    height: 24rem;
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    background-color: #1f2937;
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s ease;
}
.food-card:hover {
    transform: translateY(-5px);
}
.food-img-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.8;
    transition: transform 0.7s ease, opacity 0.3s ease;
}
.food-card:hover .food-img-bg {
    transform: scale(1.1);
    opacity: 0.6;
}

/* 악보 관련 스타일 */
#sheet-music-container {
    transition: all 0.5s ease;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}
#sheet-music-container.visible {
    max-height: 2000px; /* 충분한 높이 지정 */
    opacity: 1;
    margin-top: 2rem;
}


/* ========================================
[갤러리 스타일 추가]
======================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 모바일: 3열 */
    gap: 2px; /* 인스타그램처럼 좁은 간격 */
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr); /* 태블릿: 4열 */
        gap: 8px;
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(5, 1fr); /* PC: 5열 */
    }
}

.gallery-item {
    position: relative;
    aspect-ratio: 1 / 1; /* 정사각형 비율 */
    overflow: hidden;
    background-color: #1a1a1a;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* 라인 제한 (말줄임표) */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}