/* ===== CSS Variables ===== */
:root {
    --pink-light: #fce4ec;
    --pink-pastel: #f8bbd9;
    --pink-medium: #f48fb1;
    --pink-dark: #ec407a;
    --pink-deep: #d81b60;
    --white: #ffffff;
    --text-dark: #4a4a4a;
    --text-light: #757575;
    --shadow-soft: 0 4px 20px rgba(236, 64, 122, 0.15);
    --shadow-medium: 0 8px 30px rgba(236, 64, 122, 0.2);
    --gradient-pink: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
    --gradient-button: linear-gradient(135deg, #f48fb1 0%, #ec407a 100%);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--gradient-pink);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    color: var(--text-dark);
    -webkit-tap-highlight-color: transparent;
}

/* ===== Floating Hearts Background ===== */
.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-heart {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.3;
    animation: floatUp 15s linear infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* ===== Container ===== */
.container {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    z-index: 1;
}

/* ===== Screens ===== */
.screen {
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 2rem 1.5rem;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

/* ===== Welcome Screen ===== */
.hearts-decoration {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--pink-deep);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--pink-dark);
    margin-bottom: 0.5rem;
}

.name {
    color: var(--pink-deep);
    font-weight: 700;
}

.date {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* ===== Photo Styles ===== */
.photo-frame {
    margin: 1.5rem auto;
    max-width: 280px;
}

.photo-placeholder {
    background: var(--white);
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: var(--shadow-soft);
    border: 3px dashed var(--pink-pastel);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.photo-placeholder span {
    font-size: 3rem;
}

.photo-placeholder p {
    font-weight: 500;
    color: var(--pink-medium);
}

.photo-placeholder small {
    font-size: 0.75rem;
}

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

.photo-placeholder.has-image {
    padding: 0;
    border: none;
    overflow: hidden;
}

.welcome-text {
    font-size: 1rem;
    color: var(--text-dark);
    margin: 1.5rem 0;
    line-height: 1.6;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
}

.primary-btn {
    background: var(--gradient-button);
    color: var(--white);
}

.primary-btn:hover,
.primary-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(236, 64, 122, 0.3);
}

.secondary-btn {
    background: var(--white);
    color: var(--pink-dark);
    border: 2px solid var(--pink-pastel);
}

.secondary-btn:hover,
.secondary-btn:active {
    background: var(--pink-light);
    transform: translateY(-2px);
}

.btn-hearts {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ===== Game Screen ===== */
.game-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    color: var(--pink-deep);
    margin-bottom: 0.5rem;
}

.game-instruction {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.game-instruction small {
    color: var(--text-light);
}

.highlight {
    color: var(--pink-deep);
    font-weight: 600;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 1.5rem;
}

.progress-bar {
    background: var(--white);
    border-radius: 20px;
    height: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-button);
    border-radius: 20px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '💕';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
}

.progress-text {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Game Area */
.game-area {
    position: relative;
    width: 100%;
    height: 350px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    margin-bottom: 1rem;
}

.game-heart {
    position: absolute;
    font-size: 2.5rem;
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s ease;
    animation: heartBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(236, 64, 122, 0.3));
}

.game-heart:active {
    transform: scale(0.8);
}

.game-heart.caught {
    animation: heartCaught 0.5s ease forwards;
}

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

@keyframes heartCaught {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* Love Notes */
.love-notes {
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.love-note {
    background: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--pink-dark);
    box-shadow: var(--shadow-soft);
    animation: noteAppear 0.5s ease;
}

@keyframes noteAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Reveal Screen ===== */
.unlock-animation {
    margin-bottom: 1.5rem;
}

.gift-box {
    font-size: 4rem;
    animation: giftShake 0.5s ease infinite;
}

@keyframes giftShake {
    0%, 100% {
        transform: rotate(-3deg);
    }
    50% {
        transform: rotate(3deg);
    }
}

.reveal-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.2rem;
    color: var(--pink-deep);
    margin-bottom: 1.5rem;
}

/* Photo Gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.gallery-item .photo-placeholder {
    padding: 2rem 1rem;
    aspect-ratio: 1;
}

.gallery-item .photo-placeholder span {
    font-size: 2rem;
}

/* Secret Message */
.secret-message {
    background: var(--white);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-medium);
    margin-bottom: 1.5rem;
    text-align: left;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--pink-light);
}

.lock-icon {
    font-size: 1.5rem;
}

.message-header h3 {
    font-family: 'Dancing Script', cursive;
    font-size: 1.4rem;
    color: var(--pink-deep);
}

.message-content p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-ending {
    font-weight: 600;
    color: var(--pink-dark);
    text-align: center;
    font-size: 1.1rem !important;
}

/* Hint Section */
.hint-section {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.hint-text {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.hint-clues {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.clue {
    font-size: 2.5rem;
    animation: clueHint 2s ease-in-out infinite;
}

.clue:nth-child(2) {
    animation-delay: 0.3s;
}

.clue:nth-child(3) {
    animation-delay: 0.6s;
}

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

/* Final Message */
.final-message {
    margin-bottom: 2rem;
}

.final-message p {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.signature {
    font-family: 'Dancing Script', cursive;
    font-size: 1.3rem !important;
    color: var(--pink-dark);
}

/* ===== Confetti Canvas ===== */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* ===== Responsive Design ===== */
@media (min-width: 480px) {
    .title {
        font-size: 3rem;
    }
    
    .subtitle {
        font-size: 2rem;
    }
    
    .game-area {
        height: 400px;
    }
    
    .game-heart {
        font-size: 3rem;
    }
}

@media (min-width: 768px) {
    .screen {
        padding: 3rem 2rem;
    }
    
    .content {
        max-width: 500px;
    }
    
    .photo-frame {
        max-width: 350px;
    }
    
    .game-area {
        height: 450px;
    }
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

/* ===== Animations on Load ===== */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content > * {
    animation: slideUp 0.6s ease backwards;
}

.content > *:nth-child(1) { animation-delay: 0.1s; }
.content > *:nth-child(2) { animation-delay: 0.2s; }
.content > *:nth-child(3) { animation-delay: 0.3s; }
.content > *:nth-child(4) { animation-delay: 0.4s; }
.content > *:nth-child(5) { animation-delay: 0.5s; }
.content > *:nth-child(6) { animation-delay: 0.6s; }
.content > *:nth-child(7) { animation-delay: 0.7s; }
.content > *:nth-child(8) { animation-delay: 0.8s; }
