:root {
    --primary-color: #ff0000; /* New Red background */
    --secondary-color: #d80032;
    --accent-color: #ffffff; /* White text */
    --card-back-color: #ff0000; /* Back of card red */
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--primary-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.mobile-container {
    width: 100%;
    max-width: 460px;
    height: 100vh;
    background: var(--primary-color);
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.view {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* Home Page Specific */
.hero-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.image-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    padding: 10px;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 2px solid var(--glass-border);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: floating 3s ease-in-out infinite;
    z-index: 2;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.content {
    margin-top: 80px; /* Increased from 60px to move it further down */
    text-align: center;
    width: 100%;
    z-index: 1;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: white;
    text-align: center;
    margin: 20px 0;
}

/* Surprise Page Grid */
.back-button {
    margin: 20px auto;
    padding: 10px 30px;
    background: white;
    color: red;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.progress-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: -10px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 20px 10px;
    margin-top: 20px;
}

/* Final View Styles */
.final-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding-top: 40px;
}

.crown {
    font-size: 4rem;
    margin-bottom: -20px;
    z-index: 10;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
    animation: floatingCrown 3s ease-in-out infinite;
}

.photo-frame {
    width: 280px;
    height: 350px;
    background: white;
    padding: 0; /* Removed padding to fill the frame */
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 8px solid #ffd700; /* Gold frame */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    overflow: hidden; /* Ensures img stays inside border radius */
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.placeholder-icon {
    font-size: 5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    color: #ff0000;
}

.final-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.heart-text {
    font-style: italic;
    line-height: 1.6;
    padding: 0 20px;
}

@keyframes floatingCrown {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

/* Flipping Cards */
.card {
    background-color: transparent;
    width: 100%;
    aspect-ratio: 1 / 1;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card.is-flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0; /* Changed from 15px to 0 for full-bleed images */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    overflow: hidden; /* Ensures img doesn't spill out */
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-front {
    background-color: white;
    color: #ff0000;
    font-size: 3rem;
}

.card-back {
    background-color: var(--secondary-color);
    color: white;
    transform: rotateY(180deg);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    padding: 15px; /* Restore padding for text */
}

/* Confetti Hearts */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.heart-confetti {
    position: absolute;
    width: 15px;
    height: 15px;
    background: red;
    transform: rotate(45deg);
    opacity: 0;
    animation: heartFall 3s linear forwards;
}

.heart-confetti::before,
.heart-confetti::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: red;
    border-radius: 50%;
}

.heart-confetti::before {
    left: -7.5px;
}

.heart-confetti::after {
    top: -7.5px;
}

@keyframes heartFall {
    0% {
        transform: translateY(-10vh) rotate(45deg) scale(0);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(405deg) scale(1);
        opacity: 0;
    }
}

@keyframes floating {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}
