@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Poppins:wght@300;400;600;700&display=swap');

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

body {
    font-family: 'Poppins', 'Arial', sans-serif;
    background: #0a0010;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Starry Background */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(120, 40, 200, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 100, 180, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(100, 50, 200, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}

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

.floating-heart {
    position: absolute;
    bottom: -50px;
    font-size: 20px;
    animation: floatHeart linear infinite;
    opacity: 0;
}

@keyframes floatHeart {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 0.8; }
    100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

/* Container */
.container {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 60px 20px 40px;
    margin-bottom: 20px;
}

.crown {
    font-size: 3.5em;
    animation: crownBob 2s ease-in-out infinite;
    display: block;
    margin-bottom: 10px;
}

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

.title {
    font-family: 'Dancing Script', cursive;
    font-size: 4em;
    color: #fff;
    text-shadow: 0 0 30px rgba(255, 150, 220, 0.6), 0 0 60px rgba(200, 100, 255, 0.3);
    line-height: 1.2;
}

.name-title {
    font-size: 5em;
    background: linear-gradient(135deg, #ff9ff3, #feca57, #ff6b9d, #ff9ff3);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
    margin-top: -10px;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%       { background-position: 100% 50%; }
}

.subtitle {
    font-size: 1.3em;
    color: rgba(255, 200, 240, 0.9);
    margin-top: 20px;
    min-height: 2em;
    font-style: italic;
    font-weight: 300;
}

/* Countdown Section */
.countdown-section {
    margin: 30px 0 50px;
    display: flex;
    justify-content: center;
}

.countdown-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 150, 220, 0.3);
    border-radius: 20px;
    padding: 30px 40px;
    text-align: center;
    backdrop-filter: blur(10px);
    max-width: 700px;
    width: 100%;
}

.countdown-label {
    color: rgba(255, 200, 240, 0.8);
    font-size: 1em;
    margin-bottom: 20px;
    font-weight: 300;
    letter-spacing: 1px;
}

.countdown-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.countdown-val {
    font-size: 2.5em;
    font-weight: 700;
    color: #ff9ff3;
    line-height: 1;
    text-shadow: 0 0 20px rgba(255, 150, 220, 0.5);
}

.countdown-sub {
    font-size: 0.7em;
    color: rgba(255, 200, 240, 0.6);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
}

.countdown-dot {
    font-size: 1.2em;
    opacity: 0.6;
}

/* Music Control */
.music-control {
    text-align: center;
    margin-bottom: 50px;
}

.music-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 14px 35px;
    font-size: 1em;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 25px rgba(240, 90, 200, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    letter-spacing: 0.5px;
}

.music-btn:hover {
    transform: scale(1.07);
    box-shadow: 0 8px 30px rgba(240, 90, 200, 0.6);
}

.music-btn:active { transform: scale(0.97); }

.music-icon { font-size: 1.1em; }

/* Gallery Section */
.gallery-section {
    margin: 60px 0;
    animation: fadeInUp 1s ease both;
}

.gallery-section h2 {
    text-align: center;
    font-family: 'Dancing Script', cursive;
    color: #fff;
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 150, 220, 0.4);
}

.gallery-note {
    text-align: center;
    color: rgba(255, 200, 240, 0.8);
    font-size: 1.05rem;
    margin-bottom: 35px;
    font-weight: 300;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 60px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(255, 150, 220, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s;
    height: 260px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(180, 50, 140, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 18px;
}

.gallery-overlay span {
    color: white;
    font-size: 1.3em;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    padding: 8px 22px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.4);
}

.gallery-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(200, 50, 150, 0.4);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 12px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 0 0 18px 18px;
}

/* Message Section */
.message-section {
    margin: 60px 0;
    animation: fadeInUp 1.2s ease both;
    text-align: center;
}

.section-title {
    font-family: 'Dancing Script', cursive;
    color: #fff;
    font-size: 3em;
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(255, 150, 220, 0.4);
}

.section-hint {
    color: rgba(255, 200, 240, 0.6);
    font-size: 0.95em;
    margin-bottom: 40px;
    font-weight: 300;
}

.envelope-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* Envelope */
.envelope {
    position: relative;
    width: 320px;
    height: 200px;
    cursor: pointer;
    transition: transform 0.3s;
}

.envelope:hover {
    transform: scale(1.05) rotate(-2deg);
}

.envelope-body {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(240, 90, 200, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: transform 0.5s;
}

.envelope-closed-text {
    color: white;
    font-size: 1.4em;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.envelope-flap {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 55%;
    background: linear-gradient(135deg, #ff9ff3 0%, #f368e0 100%);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: top center;
    transition: transform 0.6s ease;
    z-index: 3;
    border-radius: 12px 12px 0 0;
}

.envelope.open .envelope-flap {
    transform: rotateX(-180deg);
}

.envelope.open .envelope-body {
    transform: rotateX(-8deg);
}

/* Message Card (outside envelope) */
.message-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,200,240,0.08) 100%);
    border: 1px solid rgba(255, 150, 220, 0.35);
    border-radius: 24px;
    padding: 45px 50px;
    max-width: 580px;
    width: 100%;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(200, 50, 150, 0.2);
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: none;
}

.message-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    display: block;
}

.message-card-inner h2 {
    font-family: 'Dancing Script', cursive;
    color: #ff9ff3;
    font-size: 2.2em;
    margin-bottom: 25px;
    text-shadow: 0 0 15px rgba(255, 150, 220, 0.4);
}

.message-card-inner p {
    color: rgba(255, 230, 245, 0.9);
    font-size: 1.05em;
    line-height: 2;
    margin-bottom: 12px;
    font-weight: 300;
}

.signature {
    font-family: 'Dancing Script', cursive;
    font-size: 1.6em !important;
    margin-top: 25px !important;
    color: #feca57 !important;
    font-weight: 700 !important;
}

/* Reasons Section */
.reasons-section {
    margin: 70px 0;
    text-align: center;
    animation: fadeInUp 1.3s ease both;
}

.reasons-section h2 {
    font-family: 'Dancing Script', cursive;
    color: #fff;
    font-size: 3em;
    margin-bottom: 35px;
    text-shadow: 0 0 20px rgba(255, 150, 220, 0.4);
}

.reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.reason-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 150, 220, 0.2);
    border-radius: 16px;
    padding: 20px 15px;
    transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
    cursor: default;
}

.reason-card:hover {
    transform: translateY(-8px) scale(1.03);
    background: rgba(255, 150, 220, 0.12);
    box-shadow: 0 10px 30px rgba(200, 50, 150, 0.3);
}

.reason-number {
    font-size: 1.8em;
    font-weight: 700;
    color: #feca57;
    display: block;
    margin-bottom: 8px;
}

.reason-text {
    color: rgba(255, 220, 245, 0.85);
    font-size: 0.9em;
    line-height: 1.5;
    font-weight: 300;
}

/* Surprise Section */
.surprise-section {
    text-align: center;
    margin: 60px 0 80px;
}

.surprise-btn {
    background: linear-gradient(135deg, #feca57 0%, #ff9f43 100%);
    color: #2d0a1e;
    border: none;
    padding: 18px 45px;
    font-size: 1.2em;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 30px rgba(254, 202, 87, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
    letter-spacing: 0.5px;
    animation: pulseBtn 2.5s ease-in-out infinite;
}

@keyframes pulseBtn {
    0%, 100% { box-shadow: 0 6px 30px rgba(254, 202, 87, 0.5); }
    50%       { box-shadow: 0 6px 50px rgba(254, 202, 87, 0.9); }
}

.surprise-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 40px rgba(254, 202, 87, 0.7);
}

.surprise-btn:active { transform: scale(0.97); }

.surprise-message {
    margin-top: 35px;
    animation: fadeInUp 0.6s ease both;
}

.surprise-message p {
    color: #fff;
    font-size: 1.6em;
    font-family: 'Dancing Script', cursive;
    line-height: 2;
    text-shadow: 0 0 20px rgba(255, 150, 220, 0.6);
}

/* Balloons */
.balloon {
    position: fixed;
    bottom: -120px;
    width: 35px;
    height: 45px;
    border-radius: 50% 50% 50% 0;
    pointer-events: none;
    z-index: 0;
    animation: balloonFloat 10s infinite ease-in;
}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 1px;
    height: 15px;
    background: rgba(255,255,255,0.5);
}

.balloon:nth-child(1)  { background: #ff6b9d; animation-delay: 0s; }
.balloon:nth-child(2)  { background: #feca57; animation-delay: 1.2s; }
.balloon:nth-child(3)  { background: #48dbfb; animation-delay: 2.4s; }
.balloon:nth-child(4)  { background: #1dd1a1; animation-delay: 3.6s; }
.balloon:nth-child(5)  { background: #ee5a6f; animation-delay: 4.8s; }
.balloon:nth-child(6)  { background: #ffa502; animation-delay: 6s; }
.balloon:nth-child(7)  { background: #54a0ff; animation-delay: 7.2s; }
.balloon:nth-child(8)  { background: #ff9ff3; animation-delay: 8.4s; }
.balloon:nth-child(9)  { background: #a29bfe; animation-delay: 9.6s; }
.balloon:nth-child(10) { background: #fd79a8; animation-delay: 0.6s; }

@keyframes balloonFloat {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-inner {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 90vw;
}

.modal-content {
    max-width: 80vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 0 60px rgba(200, 50, 150, 0.4);
    display: block;
}

.modal-nav {
    background: rgba(255, 150, 220, 0.2);
    border: 1px solid rgba(255, 150, 220, 0.4);
    color: #fff;
    font-size: 2.5em;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.2s;
    flex-shrink: 0;
    padding-bottom: 3px;
}

.modal-nav:hover {
    background: rgba(255, 150, 220, 0.4);
    transform: scale(1.1);
}

.close-modal {
    position: absolute;
    top: 20px; right: 30px;
    color: #fff;
    font-size: 45px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
    line-height: 1;
}

.close-modal:hover {
    color: #ff9ff3;
    transform: rotate(90deg);
}

.modal-caption {
    text-align: center;
    color: rgba(255, 220, 245, 0.9);
    font-size: 1.1em;
    margin-top: 20px;
    font-style: italic;
    font-weight: 300;
    padding: 0 20px;
}

.modal-counter {
    color: rgba(255, 200, 240, 0.5);
    font-size: 0.85em;
    margin-top: 8px;
    letter-spacing: 2px;
}

/* Celebration Popup */
.celebration-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
}

.celebration-popup.active {
    display: flex;
}

.celebration-content {
    background: linear-gradient(135deg, rgba(240, 93, 200, 0.9) 0%, rgba(100, 30, 180, 0.9) 100%);
    border: 1px solid rgba(255, 150, 220, 0.5);
    border-radius: 24px;
    padding: 50px 40px;
    text-align: center;
    max-width: 480px;
    width: 90%;
    animation: celebrationBounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    box-shadow: 0 30px 80px rgba(200, 50, 150, 0.5);
}

.celebration-emoji {
    font-size: 2.5em;
    margin-bottom: 20px;
    animation: emojiFloat 2s ease-in-out infinite;
    display: block;
}

.celebration-content h2 {
    font-family: 'Dancing Script', cursive;
    color: white;
    font-size: 2.8em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.3);
}

.celebration-content p {
    color: rgba(255, 240, 255, 0.92);
    font-size: 1.1em;
    margin-bottom: 12px;
    line-height: 1.7;
    font-weight: 300;
}

.close-celebration-btn {
    background: white;
    color: #c0247e;
    border: none;
    padding: 15px 35px;
    font-size: 1em;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 25px;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
}

.close-celebration-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

@keyframes celebrationBounce {
    0%   { transform: scale(0.2); opacity: 0; }
    60%  { transform: scale(1.07); }
    80%  { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

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

/* Responsive */
@media (max-width: 768px) {
    .title     { font-size: 2.8em; }
    .name-title { font-size: 3.5em; }
    .countdown-val { font-size: 1.8em; }
    .countdown-unit { min-width: 50px; }
    .gallery-section h2, .section-title, .reasons-section h2 { font-size: 2.2em; }
    .message-card { padding: 30px 25px; }
    .envelope    { width: 260px; height: 165px; }
    .gallery-container { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
    .modal-nav   { display: none; }
}

@media (max-width: 480px) {
    .title     { font-size: 2.2em; }
    .name-title { font-size: 2.7em; }
    .countdown-numbers { gap: 5px; }
    .countdown-dot { display: none; }
}
