:root {
    --primary-color: #ffd700;
    --primary-glow: rgba(255, 215, 0, 0.6);
    --secondary-color: #ffaa00;
    --dark-bg: #0f1015;
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--dark-bg);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(255, 215, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, rgba(255, 170, 0, 0.05) 0%, transparent 50%);
    color: var(--text-color);
    font-family: 'Montserrat', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background Animation */
#petal-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.petal {
    position: absolute;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 15% 50% 15% 50%;
    opacity: 0.7;
    box-shadow: 0 0 15px var(--primary-glow);
    animation: fall linear forwards;
    z-index: 1;
}

@keyframes fall {
    0% {
        transform: translateY(-10vh) rotate(0deg) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    80% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(110vh) rotate(360deg) scale(1.2);
        opacity: 0;
    }
}

/* Card 3D Wrapper */
.wrapper {
    position: relative;
    z-index: 10;
    perspective: 1200px;
    width: 90vw;
    max-width: 480px;
}

/* The Card */
.card {
    width: 100%;
    height: 650px;
    position: relative;
    transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.card.open {
    transform: rotateY(180deg);
}

/* Faces */
.card-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--card-shadow), inset 0 0 0 1px rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

/* Card Front Elements */
.intro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.icon-pulse {
    font-size: 3rem;
    animation: pulse 2s infinite;
    margin-bottom: 10px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; text-shadow: 0 0 20px var(--primary-glow); }
}

.title {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    color: var(--primary-color);
    line-height: 1.1;
    text-shadow: 0 0 25px var(--primary-glow);
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.1rem;
    color: #b0b0b0;
    font-weight: 300;
    margin-bottom: 40px;
    letter-spacing: 0.5px;
}

/* Card Inside Elements */
.card-inside {
    transform: rotateY(180deg);
    padding: 30px;
    justify-content: space-between;
}

.inside-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
}

.inside-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-shadow: 0 0 15px var(--primary-glow);
}

.image-frame {
    position: relative;
    width: 100%;
    height: 220px;
    border-radius: 16px;
    padding: 4px;
    background: linear-gradient(135deg, rgba(255,215,0,0.5), rgba(255,255,255,0.1));
    margin-bottom: 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    transform: translateZ(30px); /* 3D effect if we added mouse rotate */
}

.image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    transition: transform 0.5s ease;
}

.image-frame:hover img {
    transform: scale(1.03);
}

.image-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: -1;
}

.image-frame:hover .image-glow {
    opacity: 0.8;
}

.message-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 25px;
    width: 100%;
}

.message {
    font-size: 1rem;
    line-height: 1.6;
    color: #e0e0e0;
    font-weight: 300;
}

/* Beautiful Buttons */
.glow-btn {
    position: relative;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #111;
    border: none;
    padding: 16px 45px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.3);
    overflow: hidden;
    z-index: 1;
}

.glow-btn span {
    position: relative;
    z-index: 2;
    letter-spacing: 1px;
}

.glow-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(45deg, var(--secondary-color), #ffe600);
    z-index: 0;
    transition: opacity 0.4s ease;
    opacity: 0;
}

.glow-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 25px rgba(255, 215, 0, 0.5);
}

.glow-btn:hover::before {
    opacity: 1;
}

.glow-btn.outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    box-shadow: none;
    padding: 12px 35px;
    font-size: 0.95rem;
    margin-top: auto;
}

.glow-btn.outline::before {
    background: rgba(255, 215, 0, 0.1);
}

.glow-btn.outline:hover {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 768px) {
    .wrapper { width: 95vw; }
    .title { font-size: 3.5rem; }
    .inside-title { font-size: 2.5rem; }
}

@media (max-height: 750px) {
    .card { height: 600px; }
    .image-frame { height: 180px; }
    .title { font-size: 3.2rem; }
    .inside-title { font-size: 2.2rem; margin-bottom: 10px; }
    .message { font-size: 0.9rem; }
}

@media (max-width: 480px) {
    .wrapper { width: 92vw; }
    .card { height: 85vh; min-height: 560px; max-height: 680px; }
    .card-face { padding: 25px 15px; overflow-y: auto; }
    
    /* Scrollbar hidden for aesthetic but allowing scroll */
    .card-face::-webkit-scrollbar { width: 4px; }
    .card-face::-webkit-scrollbar-thumb { background: rgba(255, 215, 0, 0.3); border-radius: 4px; }

    .intro-content { justify-content: center; height: 100%; }
    .card-inside { padding: 25px 15px; justify-content: flex-start; }
    .inside-content { justify-content: flex-start; height: auto; min-height: 100%; }

    .title { font-size: 2.8rem; margin-bottom: 10px; }
    .subtitle { font-size: 0.95rem; margin-bottom: 25px; }
    .icon-pulse { font-size: 2.5rem; margin-bottom: 15px; }
    .glow-btn { padding: 12px 30px; font-size: 1rem; }

    .inside-title { font-size: 2rem; margin-bottom: 15px; }
    .image-frame { height: 160px; max-height: 160px; margin-bottom: 15px; padding: 3px; }
    .message-box { padding: 15px; margin-bottom: 15px; }
    .message { font-size: 0.85rem; line-height: 1.5; }
    .glow-btn.outline { padding: 10px 25px; font-size: 0.9rem; margin-top: 10px; margin-bottom: 10px; }

    .back-link { top: 15px; left: 15px; padding: 8px 15px; font-size: 0.85rem; }
}

@media (max-width: 360px) {
    .card { height: 85vh; min-height: 520px; }
    .title { font-size: 2.4rem; }
    .inside-title { font-size: 1.7rem; }
    .message { font-size: 0.75rem; }
    .image-frame { height: 130px; max-height: 130px; }
    .glow-btn { padding: 10px 25px; }
}

/* Back Link Styles */
.back-link {
    position: absolute;
    top: 25px;
    left: 25px;
    z-index: 100;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.back-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.back-link:hover .back-icon {
    transform: translateX(-4px);
}
