/* css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Serif JP', serif;
    /* 배경 색 대신 이미지를 넣습니다 */
    background-image: url('../assets/bg_main.jpg'); 
    background-size: cover; /* 화면 꽉 차게 */
    background-position: center;
    background-attachment: fixed; /* 스크롤 해도 배경 고정 */
    color: #333;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* 모바일 컨테이너: 앱처럼 보이게 하는 핵심 */
.mobile-container {
    width: 100%;
    max-width: 480px; /* 아이폰 Max 너비 정도 */
    background-color: #fffaf0; /* 따뜻한 종이 색감 */
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 상하 분배 */
    padding: 40px 20px;
}

/* 타이틀 영역 */
.header-area {
    margin-top: 40px;
}
.brand-logo {
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
    letter-spacing: 2px;
}
.main-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.4;
    color: #b71c1c; /* 신사의 붉은 색 */
    margin-bottom: 10px;
}
.sub-title {
    font-size: 16px;
    color: #555;
    font-weight: 400;
}

/* 메인 이미지 영역 (오미쿠지 통 들어갈 자리) */
.main-visual {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.omikuji-box-img {
    width: 200px; /* 임시 크기 */
    height: auto;
}

/* 버튼 영역 */
.btn-area {
    margin-bottom: 40px;
}
.start-btn {
    display: block;
    width: 100%;
    background-color: #b71c1c;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    padding: 18px 0;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(183, 28, 28, 0.3);
    transition: transform 0.1s;
}
.start-btn:active {
    transform: scale(0.98);
}

/* --- style.css 맨 아래에 추가하세요 --- */

/* 흔들리는 애니메이션 정의 */
@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); }
}

/* 이 클래스가 붙으면 미친 듯이 흔들립니다 */
.shaking {
    animation: shake 0.5s;
    animation-iteration-count: infinite; /* 무한 반복 */
}

/* 로딩 멘트 스타일 */
.loading-text {
    font-size: 20px;
    font-weight: bold;
    color: #555;
    margin-top: 20px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* --- style.css 맨 아래에 추가 (결과 페이지용) --- */

/* 결과 페이지 컨텐츠 */
.result-area {
    padding: 20px;
    text-align: left;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.result-header {
    text-align: center;
    border-bottom: 2px solid #b71c1c;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.daikichi-title {
    font-size: 32px;
    color: #b71c1c;
    margin: 10px 0;
    font-weight: 900;
}

.daikichi-subtitle {
    font-size: 18px;
    color: #555;
    font-weight: bold;
}

.intro-text {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin-bottom: 30px;
    font-style: italic;
}

/* 운세 항목별 스타일 */
.luck-item {
    margin-bottom: 25px;
}
.luck-label {
    display: inline-block;
    background-color: #b71c1c;
    color: #fff;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 5px;
}

.luck-text {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    word-break: break-all; /* 👈 이렇게 바꾸면 무조건 칸 안에서 줄바꿈됩니다 */
}

/* 조심해야 할 것 (강조) */
.advice-box {
    background-color: #fff5f5;
    border: 1px solid #ffcdd2;
    padding: 15px;
    border-radius: 8px;
    margin-top: 30px;
}
.advice-title {
    color: #c62828;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
}

/* 공유하기 모달 (팝업) */
.modal-overlay {
    display: none; /* 평소엔 숨김 */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active {
    display: flex; /* 활성화되면 보임 */
}
.modal-content {
    background: white;
    width: 90%;
    max-width: 350px;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
}
.modal-img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.share-btns {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
}
.sns-btn {
    background: #eee;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}
.close-btn {
    margin-top: 15px;
    background: none;
    border: none;
    text-decoration: underline;
    color: #888;
    cursor: pointer;
}

/* 모달 내부 스타일 추가 */
.guide-text {
    font-size: 12px;
    color: #666;
    margin-top: -10px;
    margin-bottom: 20px;
}

.share-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2열 배치 */
    gap: 10px;
    margin-bottom: 15px;
}

.sns-btn {
    border: none;
    padding: 12px 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
    transition: opacity 0.2s;
}
.sns-btn:active { opacity: 0.8; }

/* 각 버튼 브랜드 컬러 */
.sns-btn.line { background-color: #06C755; } /* 라인 초록 */
.sns-btn.x { background-color: #000; }      /* X 검정 */
.sns-btn.insta { 
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); 
} 
.sns-btn.copy { background-color: #888; }    /* 회색 */

/* --- style.css 맨 아래에 추가 (경품 버튼용) --- */

.coupon-btn {
    /* 고급스러운 황금색 그라데이션 */
    background: linear-gradient(45deg, #FFD700, #FDB931);
    color: #333 !important; /* 글자색 검정 */
    font-weight: 900 !important;
    border: 1px solid #eebb00;
    margin-bottom: 10px;
    
    /* 두근두근 애니메이션 효과 */
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); } /* 살짝 커짐 */
    100% { transform: scale(1); }
}

/* --- style.css 맨 아래에 추가 (잠김 버튼용) --- */

/* 잠겨있는 회색 버튼 */
.locked-btn {
    background-color: #ddd; /* 회색 */
    color: #888 !important;
    border: 1px solid #ccc;
    font-weight: bold;
    cursor: not-allowed; /* 금지 아이콘 커서 */
    box-shadow: none;
}

/* 잠금 해제되었을 때 (기존 coupon-btn과 동일하지만 JS로 클래스 교체용) */
.unlocked-btn {
    background: linear-gradient(45deg, #FFD700, #FDB931);
    color: #333 !important;
    font-weight: 900 !important;
    border: 1px solid #eebb00;
    animation: pulse 1.5s infinite; /* 두근두근 효과 */
    cursor: pointer;
}