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

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 80, 140, 0.18), transparent 32%),
        radial-gradient(circle at 85% 10%, rgba(255, 182, 193, 0.12), transparent 28%),
        linear-gradient(135deg, #1a0712 0%, #3a0d24 48%, #12030c 100%);
    color: #fff;
    font-family: "Poppins", sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

.heart-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.floating-bg-heart {
    position: absolute;
    color: rgba(255, 105, 180, 0.28);
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0% { transform: translateY(100vh) scale(0.5); opacity: 0; }
    50% { opacity: 0.85; }
    100% { transform: translateY(-10vh) scale(1.2); opacity: 0; }
}

.welcome-gate {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 50% 30%, rgba(255, 105, 180, 0.2), transparent 40%),
        rgba(12, 3, 8, 0.92);
    padding: 24px;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.welcome-gate.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.gate-card {
    max-width: 460px;
    text-align: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 182, 193, 0.28);
    border-radius: 24px;
    padding: 36px 28px;
    backdrop-filter: blur(16px);
}

.gate-kicker {
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: #ffd1dc;
}

.gate-card h1 {
    font-family: "Great Vibes", cursive;
    font-size: 3.4rem;
    color: #ffb6c1;
    margin: 8px 0 14px;
}

.gate-card p {
    color: #f1d6e6;
    line-height: 1.7;
    margin-bottom: 22px;
}

.music-navbar {
    position: fixed;
    top: 14px;
    right: 18px;
    background: rgba(40, 10, 25, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 182, 193, 0.3);
    padding: 10px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 1000;
}

.music-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.disc-icon {
    font-size: 1.4rem;
    color: #ff69b4;
    animation: spin 6s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.track-details {
    display: flex;
    flex-direction: column;
}

.track-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffd1dc;
}

.track-status {
    font-size: 0.7rem;
    color: #ccc;
}

.music-btn,
.btn-primary,
.btn-poetry,
.btn-close-poetry {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    background: linear-gradient(45deg, #ff416c, #ff4b2b);
    border: none;
    color: white;
    padding: 9px 16px;
    border-radius: 22px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(255, 65, 108, 0.35);
}

.music-btn:hover,
.btn-primary:hover,
.btn-poetry:hover {
    transform: translateY(-1px);
}

.main-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 96px 20px 56px;
    position: relative;
    z-index: 1;
}

.hero-section {
    text-align: center;
    margin-bottom: 28px;
}

.main-title {
    font-family: "Great Vibes", cursive;
    font-size: 3.4rem;
    color: #ffb6c1;
    text-shadow: 0 0 15px rgba(255, 182, 193, 0.5);
}

.subtitle {
    color: #e0b0d0;
    font-weight: 300;
}

.envelope-wrapper {
    background: none;
    border: 0;
    cursor: pointer;
    margin-bottom: 12px;
}

.envelope {
    width: 230px;
    height: 148px;
    margin: 0 auto;
    position: relative;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.4));
}

.pocket {
    position: absolute;
    inset: 0;
    background: linear-gradient(#e63946, #c1121f);
    border-radius: 0 0 12px 12px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 78px;
    background: #ff6b6b;
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    transform-origin: top center;
    transition: transform 0.6s ease;
    z-index: 3;
}

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

.mini-letter {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 34px;
    height: 90px;
    background: #fff7f8;
    color: #c1121f;
    border-radius: 6px;
    display: grid;
    place-items: center;
    font-weight: 600;
    z-index: 2;
    transition: transform 0.6s ease;
}

.envelope.open .mini-letter {
    transform: translateY(-28px);
}

.heart-seal {
    position: absolute;
    left: 50%;
    top: 58%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    z-index: 4;
}

.letter-card,
.music-section,
.reasons-section,
.memories-section,
.game-section,
.reply-section {
    margin-bottom: 36px;
}

.letter-card,
.music-section,
.game-section,
.reply-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 182, 193, 0.2);
    border-radius: 20px;
    padding: 28px;
}

.letter-header,
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffb6c1;
    margin-bottom: 10px;
}

.letter-body p,
.section-desc {
    font-size: 1.02rem;
    line-height: 1.8;
    color: #f1d6e6;
    margin-bottom: 12px;
}

.letter-closing {
    margin-top: 18px;
    text-align: right;
    font-family: "Dancing Script", cursive;
    font-size: 1.7rem;
    color: #ffb6c1;
}

.letter-footer-btns {
    margin-top: 18px;
    text-align: center;
}

.btn-poetry {
    background: linear-gradient(45deg, #d4145a, #fbb03b);
    padding: 12px 24px;
}

.spotify-wrap,
.yt-wrap {
    margin-top: 8px;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
}

.yt-wrap iframe {
    width: 100%;
    height: 220px;
    border: 0;
    display: block;
}

.spotify-link {
    margin-top: 10px;
    font-size: 0.88rem;
    color: #ffd1dc;
}

.spotify-link a {
    color: #1db954;
}

.yt-fallback {
    margin-top: 14px;
    color: #ccc;
}

.yt-fallback summary {
    cursor: pointer;
}

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

.reason-card {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 182, 193, 0.18);
    border-radius: 16px;
    padding: 16px;
}

.reason-card span {
    color: #ff8fab;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.reason-card h3 {
    margin: 6px 0 8px;
    font-size: 1.02rem;
}

.reason-card p {
    color: #f1d6e6;
    font-size: 0.9rem;
    line-height: 1.55;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}

.gallery-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 182, 193, 0.2);
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
}

.gallery-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    object-position: top;
    display: block;
}

.card-overlay {
    display: none;
}

.caption {
    padding: 12px 14px;
    font-size: 0.85rem;
    color: #ffd1dc;
    text-align: center;
}

.game-container {
    min-height: 260px;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-instructions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.game-icon {
    font-size: 2.8rem;
    color: #ff416c;
    animation: pulse 1.5s infinite;
}

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

.score-board {
    position: absolute;
    top: 12px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.82rem;
    color: #ffb6c1;
    z-index: 10;
}

.game-heart {
    position: absolute;
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
    animation: floatDown 4s linear forwards;
}

@keyframes floatDown {
    0% { top: -40px; opacity: 1; }
    100% { top: 260px; opacity: 0; }
}

.reply-form {
    display: grid;
    gap: 10px;
}

.reply-form input,
.reply-form textarea {
    width: 100%;
    border: 1px solid rgba(255, 182, 193, 0.25);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    font-family: inherit;
}

.form-status {
    min-height: 1.2em;
    color: #ffd1dc;
    font-size: 0.88rem;
}

.notes-list {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.note-card {
    background: rgba(0, 0, 0, 0.22);
    border-radius: 12px;
    padding: 12px;
}

.note-card strong {
    color: #ffb6c1;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #2b0c1e, #4a1535);
    border: 1px solid rgba(255, 182, 193, 0.4);
    padding: 32px 24px;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    position: relative;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 2rem;
    cursor: pointer;
    color: #ccc;
    background: none;
    border: 0;
}

.poetry-card h3 {
    font-family: "Great Vibes", cursive;
    font-size: 2.4rem;
    color: #ffb6c1;
    margin-bottom: 16px;
}

.poetry-lines p {
    font-size: 1.05rem;
    line-height: 1.9;
    color: #ffd1dc;
    font-style: italic;
}

.btn-close-poetry {
    margin-top: 20px;
}

.lightbox-content {
    max-width: 92%;
    max-height: 85vh;
    border-radius: 10px;
}

@media (max-width: 700px) {
    .main-title { font-size: 2.4rem; }
    .music-navbar {
        top: 8px;
        right: 10px;
        left: 10px;
        justify-content: space-between;
    }
    .main-container { padding-top: 88px; }
    .score-board { flex-wrap: wrap; }
}
