/* =========================================
   GOLF FORTUNE - TRENDY POP & NEON STYLE
   - Theme: "Cyber Pop / 3D Fun"
   - Style: Deep Navy, Neon Gradients, 3D Stickers
========================================= */

/* 1. Modal Overlay (Deep Space Aurora) */
.fortune-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 120%, #1a103c 0%, #0f172a 60%, #000000 100%);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Floating Neon Particles */
.fortune-modal-overlay::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(#39FF14 1px, transparent 1px),
        radial-gradient(#00f3ff 1px, transparent 1px);
    background-size: 50px 50px, 90px 90px;
    background-position: 0 0, 40px 40px;
    opacity: 0.3;
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50px);
    }
}

/* Wrapper Panel */
.fortune-card-wrapper {
    width: 360px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    /* High-Gloss Glass Panel */
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
    border-radius: 40px;
    padding: 60px 20px 30px;
    margin-top: 20px;
}

/* Close Button - Neon Circle */
.close-fortune-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-fortune-btn:hover {
    border-color: #39FF14;
    color: #39FF14;
    transform: rotate(90deg);
}

/* Header - Pop Style */
.fortune-header {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
    z-index: 2;
}

.fortune-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    color: #fff;
    font-weight: 800;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0px #39FF14;
    /* Offset Pop Shadow */
    margin-bottom: 5px;
    font-style: italic;
}

.fortune-header p {
    color: #00f3ff;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
}


/* 2. The CARD (3D Scene) */
.fortune-scene {
    width: 300px;
    height: 480px;
    perspective: 1200px;
}

.fortune-card-container {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Jelly Bounce */
    transform-style: preserve-3d;
    cursor: pointer;
}

.fortune-card-container.flipped {
    transform: rotateY(180deg);
}

.fortune-card-front,
.fortune-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    overflow: hidden;
    border-radius: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

/* === FRONT: Mystery Box === */
.fortune-card-front {
    background: linear-gradient(135deg, #1e1e2e, #2d2d44);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.fortune-card-front .card-center-symbol {
    font-size: 5rem;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(57, 255, 20, 0.4));
}

.click-hint {
    margin-top: 25px;
    color: #39FF14;
    font-weight: 700;
    letter-spacing: 2px;
}

/* === BACK: The Reveal === */
.fortune-card-back {
    transform: rotateY(180deg);
    /* Frosted Glass */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.card-frame-inner {
    padding: 30px 25px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* === ICON: 3D Sticker + Sparkles === */
.fortune-result-icon {
    position: relative;
    margin-bottom: 20px;
    padding: 10px;
}

.emoji-3d {
    font-size: 5.5rem;
    display: inline-block;
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.4));
    /* Deep Shadow for 3D */
    transform: perspective(500px) rotateX(15deg);
    animation: bouncePop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bouncePop {
    0% {
        transform: scale(0);
    }

    80% {
        transform: scale(1.1);
    }

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

/* Sparkles around icon */
.fortune-result-icon::before,
.fortune-result-icon::after {
    content: '✨';
    position: absolute;
    font-size: 1.5rem;
    animation: twinkle 2s infinite;
    opacity: 0;
}

.fortune-result-icon::before {
    top: 0;
    left: -10px;
    animation-delay: 0.2s;
}

.fortune-result-icon::after {
    bottom: 10px;
    right: -10px;
    animation-delay: 0.5s;
    font-size: 1.2rem;
    color: #39FF14;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0;
        transform: scale(0.5);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}


/* === MAIN TEXT === */
.fortune-content-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

#fortune-result-text {
    font-family: 'Gowun Dodum', sans-serif;
    font-size: 1.8rem;
    line-height: 1.35;
    font-weight: 700;
    color: #fff;
    margin: 0;
    word-break: keep-all;
}

.highlight-text {
    color: #39FF14;
    text-shadow: 0 0 15px rgba(57, 255, 20, 0.6);
    position: relative;
    z-index: 1;
}


/* === MINIMALIST DESCRIPTION PANEL (Clean & Modern) === */
.fortune-content-bottom {
    width: 100%;
    margin-top: 25px;
    position: relative;
}

/* The Simple Panel */
#fortune-result-desc {
    position: relative;
    /* Sophisticated Translucent Dark */
    background: rgba(255, 255, 255, 0.05);
    color: #eeeeee;
    /* Soft White */

    font-family: 'Pretendard', 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;

    /* Airy Layout */
    line-height: 1.8;
    padding: 25px 30px;

    border-radius: 24px;
    text-align: center;
    word-break: keep-all;

    /* No border, no tail, just subtle presence */
    border: none;
    box-shadow: none;

    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.2px;
}

/* Highlight accents inside remain */
#fortune-result-desc em,
#fortune-result-desc strong,
#fortune-result-desc .highlight-text {
    color: #39FF14;
    font-weight: 700;
}

/* No pseudo-elements needed */


/* === FOOTER === */
.fortune-footer {
    width: 100%;
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.save-fortune-btn {
    background: linear-gradient(90deg, #39FF14, #00f3ff);
    color: #000;
    border: none;
    padding: 14px 45px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(57, 255, 20, 0.4);
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-fortune-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 30px rgba(57, 255, 20, 0.6);
}

.fortune-watermark {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

/* Helpers */
.hidden {
    display: none !important;
}

/* --- Mode Tabs (Rounding / Screen) --- */
.fortune-type-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    z-index: 5;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fortune-tab {
    background: transparent;
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    color: #888;
    font-family: 'Pretendard', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fortune-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.fortune-tab i {
    font-size: 1rem;
}

.fortune-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 700;
}

.fortune-tab.active[data-mode="rounding"] {
    color: #39FF14;
    /* Neon Green */
    border: 1px solid rgba(57, 255, 20, 0.4);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.2);
    background: rgba(57, 255, 20, 0.15);
}

.fortune-tab.active[data-mode="screen"] {
    color: #00f3ff;
    /* Neon Cyan */
    border: 1px solid rgba(0, 243, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
    background: rgba(0, 243, 255, 0.15);
}

/* --- Mode Specific Card Fronts --- */

/* Rounding Mode (Green/Mystic) */
.fortune-card-container.mode-rounding .fortune-card-front {
    border: 2px solid rgba(57, 255, 20, 0.3);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(57, 255, 20, 0.1);
    background: linear-gradient(135deg, #1e1e2e, #1a2f23);
}

.fortune-card-container.mode-rounding .card-center-symbol {
    filter: drop-shadow(0 0 25px rgba(57, 255, 20, 0.4));
    animation: float 3s ease-in-out infinite;
}

/* Screen Mode (Blue/Cyber) */
.fortune-card-container.mode-screen .fortune-card-front {
    border: 2px solid rgba(0, 243, 255, 0.3);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 243, 255, 0.1);
    background: linear-gradient(135deg, #1e1e2e, #18223d);
}

.fortune-card-container.mode-screen .card-center-symbol {
    filter: drop-shadow(0 0 25px rgba(0, 243, 255, 0.5));
    animation: pulse 1.5s ease-in-out infinite alternate;
    font-size: 5.5rem;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 15px rgba(0, 243, 255, 0.4));
    }

    100% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 35px rgba(0, 243, 255, 0.7));
    }
}