/* 루팡 포춘 쿠키 스타일 */
.fortune-cookie-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    min-height: 100vh;
    padding-bottom: calc(50px + 20px);
    text-align: left; /* 기본 텍스트 정렬을 왼쪽으로 설정 */
}

/* 뒤로가기 버튼은 왼쪽 정렬 (다른 컨텐츠와 동일하게) */
.fortune-cookie-container > .back-button {
    display: inline-flex;
    width: auto;
    margin-bottom: 30px;
}

.fortune-header {
    text-align: center;
    margin-bottom: 40px;
}

.fortune-title {
    font-size: 42px;
    font-weight: 700;
    color: #2D2D2D;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8), 0 0 10px rgba(255, 182, 193, 0.5);
}

.fortune-subtitle {
    font-size: 18px;
    color: #5A5A5A;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* 쿠키 섹션 */
.cookie-section {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    margin-bottom: 40px;
}

.cookie-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.cookie {
    position: relative;
    width: 200px;
    height: 200px;
    transition: transform 0.1s ease;
}

.cookie-left,
.cookie-right {
    position: absolute;
    width: 100px;
    height: 200px;
    background: linear-gradient(135deg, #FFE4B5 0%, #FFDAB9 30%, #DEB887 60%, #FFDAB9 100%);
    border-radius: 50% 0 0 50%;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.2),
        inset -8px 0 15px rgba(255, 255, 255, 0.4),
        inset 8px 0 15px rgba(139, 69, 19, 0.15),
        inset 0 -5px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(139, 69, 19, 0.1);
}

.cookie-right {
    left: 100px;
    border-radius: 0 50% 50% 0;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.2),
        inset 8px 0 15px rgba(255, 255, 255, 0.4),
        inset -8px 0 15px rgba(139, 69, 19, 0.15),
        inset 0 -5px 10px rgba(0, 0, 0, 0.1);
}

/* 쿠키 내부 패턴 (참깨 같은 효과) */
.cookie-left::before,
.cookie-right::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(139, 69, 19, 0.3) 1.5px, transparent 1.5px),
        radial-gradient(circle at 60% 50%, rgba(139, 69, 19, 0.25) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(139, 69, 19, 0.3) 1.5px, transparent 1.5px),
        radial-gradient(circle at 40% 80%, rgba(139, 69, 19, 0.25) 1px, transparent 1px);
    background-size: 100% 100%;
    border-radius: inherit;
    pointer-events: none;
}

/* 흔들림 애니메이션 */
.cookie.shaking {
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: rotate(-5deg);
    }
    20%, 40%, 60%, 80% {
        transform: rotate(5deg);
    }
}

/* 깨짐 애니메이션 */
.cookie.broken .cookie-left {
    transform: rotate(-45deg) translateX(-50px) translateY(-20px);
    opacity: 0.8;
}

.cookie.broken .cookie-right {
    transform: rotate(45deg) translateX(50px) translateY(-20px);
    opacity: 0.8;
}

/* 메시지 섹션 */
.message-section {
    width: 100%;
    max-width: 700px;
    margin-top: 50px;
    animation: fadeInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.message-section.hidden {
    display: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-card {
    background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
    border-radius: var(--radius-xl);
    padding: 50px 40px;
    box-shadow: 
        0 10px 40px rgba(255, 182, 193, 0.2),
        0 0 0 1px rgba(255, 182, 193, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 3px solid rgba(255, 182, 193, 0.3);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.message-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 182, 193, 0.1) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg);
    }
}

.message-icon {
    font-size: 70px;
    margin-bottom: 25px;
    animation: bounce 1.5s ease infinite;
    filter: drop-shadow(0 4px 8px rgba(255, 182, 193, 0.4));
    position: relative;
    z-index: 1;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-15px) scale(1.1);
    }
}

.message-text {
    font-size: 26px;
    font-weight: 600;
    color: #2D2D2D;
    line-height: 1.8;
    margin-bottom: 35px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    border: 2px dashed rgba(255, 182, 193, 0.3);
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 2px 8px rgba(255, 182, 193, 0.1);
}

.reset-btn {
    padding: 14px 28px;
    background: var(--primary-gradient);
    color: #2D2D2D;
    border: 2px solid rgba(255, 182, 193, 0.3);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Pretendard', sans-serif;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(255, 182, 193, 0.2);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 182, 193, 0.4);
    border-color: var(--primary-pink);
}

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

/* 반응형 */
@media (max-width: 768px) {
    .fortune-cookie-container {
        padding: 30px 15px 70px;
    }

    .fortune-title {
        font-size: 32px;
    }

    .fortune-subtitle {
        font-size: 16px;
    }

    .cookie-wrapper {
        width: 250px;
        height: 250px;
    }

    .cookie {
        width: 160px;
        height: 160px;
    }

    .cookie-left,
    .cookie-right {
        width: 80px;
        height: 160px;
    }

    .cookie-right {
        left: 80px;
    }

    .message-card {
        padding: 35px 25px;
    }

    .message-text {
        font-size: 20px;
        min-height: 80px;
        padding: 15px;
    }

    .message-icon {
        font-size: 55px;
    }
}

@media (max-width: 480px) {
    .cookie-wrapper {
        width: 200px;
        height: 200px;
    }

    .cookie {
        width: 140px;
        height: 140px;
    }

    .cookie-left,
    .cookie-right {
        width: 70px;
        height: 140px;
    }

    .cookie-right {
        left: 70px;
    }

    .message-card {
        padding: 30px 20px;
    }

    .message-text {
        font-size: 18px;
        min-height: 70px;
        padding: 12px;
    }

    .message-icon {
        font-size: 45px;
    }
}
