body {
    background-color: #ffe6e6;
    /* 연한 핑크 배경 */
    color: #333;
    font-family: 'Pretendard', sans-serif;
    text-align: center;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    color: #ff6b81;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 테마 선택 화면 UI */
.theme-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    width: 800px;
    max-width: 90%;
}

.theme-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.theme-btn {
    width: 150px;
    height: 200px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.theme-btn:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.2);
}

.booth-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

/* 카메라 화면 컨테이너 (라이브 프레임 역할) */
.camera-view {
    position: relative;
    width: 640px;
    height: 480px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    background: #000;
    border: 15px solid transparent;
    /* 기본 투명 테두리 */
    transition: border-color 0.3s ease;
}

/* 라이브 뷰어 테마 적용 (선택한 프레임 색상으로 테두리 장식) */
.camera-view.theme-pink {
    border-color: #ffb8b8;
}

.camera-view.theme-blue {
    border-color: #74b9ff;
}

.camera-view.theme-black {
    border-color: #2d3436;
}

.camera-view.theme-white {
    border-color: #f5f6fa;
    box-shadow: 0 0 0 2px #dcdde1, 0 10px 20px rgba(0, 0, 0, 0.1);
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    /* 거울 모드 */
}

/* 캐릭터 오버레이 - 사진 찍을 때 같이 나옴 */
#character-overlay {
    position: absolute;
    bottom: 0;
    right: 20px;
    height: 80%;
    /* 캐릭터 크기 조절 */
    z-index: 10;
    pointer-events: none;
    /* 클릭 방지 */
    filter: drop-shadow(2px 4px 6px black);
    /* 약간의 그림자 추가 */
    display: none;
    /* ✨ 처음에 안보이게 기본 설정 변경! */
}

/* 4장 미리보기 컨테이너 (세로형) */
.preview-strip {
    width: 150px;
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: background-color 0.3s ease, border 0.3s ease;
}

/* 미리보기 스트립 테마 적용 */
.preview-strip.theme-pink {
    background-color: #ffb8b8;
}

.preview-strip.theme-blue {
    background-color: #74b9ff;
}

.preview-strip.theme-black {
    background-color: #2d3436;
}

.preview-strip.theme-white {
    background-color: #f5f6fa;
    border: 2px solid #dcdde1;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.preview-slot {
    width: 100%;
    aspect-ratio: 4/3;
    background: #f1f2f6;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a4b0be;
    font-weight: bold;
    overflow: hidden;
}

.preview-slot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* 미리보기는 비율 유지 */
}

/* 중앙 하단 컨트롤 영역 */
.controls {
    margin-top: 20px;
}

.btn-start {
    background-color: #ff4757;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
    transition: all 0.3s ease;
}

.btn-start:hover {
    background-color: #ff6b81;
    transform: translateY(-2px);
}

.btn-start:disabled {
    background-color: #a4b0be;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 카운트다운 화면 전체 덮기 */
#countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 120px;
    color: white;
    font-weight: bold;
    z-index: 20;
    display: none;
    /* 평소엔 숨김 */
}

/* 플래시 효과 */
#flash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 30;
    opacity: 0;
    pointer-events: none;
}

/* 결과 모달 (인생네컷 완성본) */
#result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    display: none;
}

/* 인생네컷 프레임 구조 */
.final-frame {
    background-color: #eb4d4b;
    /* 프레임 기본 배경색 (기본 테마) */
    padding: 20px 15px 60px 15px;
    /* 위, 양옆 여백 / 아래 여백(QR 및 로고용) */
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    max-height: 90vh;
    transition: background-color 0.3s ease;
}

/* ✨ 다양한 테마 색상 정의 */
.final-frame.theme-pink {
    background-color: #ffb8b8;
}

.final-frame.theme-blue {
    background-color: #74b9ff;
}

.final-frame.theme-black {
    background-color: #2d3436;
}

.final-frame.theme-white {
    background-color: #f5f6fa;
    border: 2px solid #dcdde1;
}

.final-frame.theme-white .frame-logo {
    color: #2f3542;
}

/* 화이트 테마는 글자를 어둡게 */

.final-frame .photo-slot {
    width: 300px;
    /* 사진 너비 고정 */
    aspect-ratio: 4/3;
    /* 웹캠 비율 유지 */
    background: white;
    border-radius: 5px;
    overflow: hidden;
}

.final-frame .photo-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 프레임 하단 텍스트 및 QR 영역 */
.frame-footer {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
}

.frame-logo {
    color: white;
    font-weight: bold;
    font-size: 20px;
    letter-spacing: 2px;
}

.qr-code {
    width: 40px;
    height: 40px;
    background: white;
    padding: 2px;
    border-radius: 5px;
}

.result-actions {
    margin-left: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-action {
    background: white;
    color: #333;
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.btn-action.primary {
    background: #ff4757;
    color: white;
}