:root {
    --primary-font: 'Quicksand', sans-serif;
    --heading-font: 'Cormorant Garamond', serif;
    --glow-color: #c9a7f5;
    --text-color: #e3d8f7;
    --bg-color: #0c001f;
}

html {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path fill="%23e3d8f7" stroke="%23c9a7f5" stroke-width="0.7" d="M12 4.248c-3.148-5.402-12-3.825-12 2.944 0 4.631 7.928 9.27 12 14.808 4.072-5.538 12-10.177 12-14.808 0-6.792-8.875-8.306-12-2.944z"/></svg>'), auto;
}

body {
    margin: 0;
    font-family: var(--primary-font);
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    text-align: center;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(108, 36, 179, 0.25) 0%, rgba(12, 0, 31, 0) 70%);
    z-index: -1;
    animation: pulse-nebula 8s infinite alternate ease-in-out;
}

a, button, .gallery-item, .mood-button {
    cursor: inherit;
}

.cursor-trail {
    position: absolute;
    height: 6px;
    width: 6px;
    background-color: var(--glow-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2000;
    box-shadow: 0 0 10px var(--glow-color), 0 0 20px var(--glow-color);
    animation: fade-out-trail 0.5s forwards;
    transform: translate(-50%, -50%);
}

main {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    width: 100%;
    animation: fadeIn 2s ease-in-out;
}

h1, h2, h3 {
    font-family: var(--heading-font);
    font-weight: 700;
    color: white;
    text-shadow: 0 0 15px var(--glow-color), 0 0 25px var(--glow-color);
    margin: 0 0 40px 0;
    text-transform: lowercase;
}

h1 { font-size: 4rem; margin-bottom: 20px; }
h2 { font-size: 3rem; }
h3 { font-size: 1.8rem; margin-bottom: 15px; }

.starry-night, .floating-particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.stars, .twinkling, .clouds { position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; display: block; }
.stars { background: #000 url('../assets/background.jpg') repeat top center; background-size: cover; }
.twinkling { background: transparent url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1231630/twinkling.png') repeat top center; animation: move-twink-back 200s linear infinite; }
.clouds { background: transparent url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1231630/clouds.png') repeat top center; opacity: 0.3; animation: move-clouds-back 200s linear infinite; }

.floating-particles span {
    position: absolute;
    bottom: -50px;
    color: rgba(201, 167, 245, 0.4);
    font-size: 1.5rem;
    animation: float-particle 15s linear infinite;
    text-shadow: 0 0 8px rgba(201, 167, 245, 0.8);
}

.together-counter-container { margin: 40px 0; }
.together-counter-container p { margin: 0; font-size: 1.1rem; opacity: 0.8; }
#together-counter {
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 0 10px var(--glow-color);
    letter-spacing: 2px;
    margin-top: 5px;
}

.menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 800px;
}
.menu-button, .back-button {
    font-family: var(--primary-font);
    font-size: 1.2rem;
    color: white;
    background: transparent;
    border: 2px solid var(--glow-color);
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 0 10px var(--glow-color);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-transform: lowercase;
    flex-grow: 1;
    flex-basis: 250px;
    max-width: 45%;
}
.menu-button:hover, .back-button:hover { background: rgba(201, 167, 245, 0.2); box-shadow: 0 0 25px var(--glow-color); transform: translateY(-5px); }
.back-button { margin-top: 40px; display: inline-block; flex-grow: 0; flex-basis: auto; max-width: none; }

.quote-container {
    margin-top: 50px;
    min-height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}
#quote-text {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    font-style: italic;
    color: rgba(227, 216, 247, 0.7);
    text-shadow: 0 0 8px rgba(201, 167, 245, 0.5);
    transition: opacity 1.5s ease-in-out;
}

.page-container { padding: 40px 5%; }
.content-wrapper {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(201, 167, 245, 0.2);
    max-width: 900px;
    width: 100%;
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.37);
    animation: slideUp 1s ease-out;
}

.mood-bubbles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 40px;
}
.mood-button { font-family: var(--primary-font); font-size: 1rem; color: white; background: rgba(201, 167, 245, 0.1); border: 1px solid var(--glow-color); padding: 12px 25px; border-radius: 50px; transition: all 0.3s ease; }
.mood-button:hover, .mood-button.active { background: rgba(201, 167, 245, 0.3); box-shadow: 0 0 15px var(--glow-color); }
.message-container { min-height: 150px; }
.message-content { display: none; animation: fadeIn 0.8s ease; }
.message-content.active { display: block; }
.message-content p { font-size: 1.2rem; line-height: 1.7; max-width: 600px; margin: 0 auto; }

.gallery { display: flex; flex-direction: column; align-items: center; gap: 30px; }
.gallery-item { border-radius: 10px; overflow: hidden; width: 100%; max-width: 700px; }
.gallery-item img, .gallery-item video { width: 100%; height: auto; display: block; }
.gallery-item img { transition: transform 0.4s ease; }
.gallery-item:hover img { transform: scale(1.03); }
.lightbox { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.85); backdrop-filter: blur(10px); justify-content: center; align-items: center; animation: fadeIn 0.5s; }
.lightbox-content { max-width: 90%; max-height: 90%; border-radius: 10px; box-shadow: 0 0 50px var(--glow-color); }
.close-button { position: absolute; top: 30px; right: 45px; color: white; font-size: 40px; font-weight: bold; }

.timeline { position: relative; max-width: 700px; margin: 0 auto; padding: 20px 0; }
.timeline::after { content: ''; position: absolute; width: 4px; background-color: rgba(201, 167, 245, 0.3); top: 0; bottom: 0; left: 50%; margin-left: -2px; }
.timeline-item { padding: 10px 40px; position: relative; width: 50%; box-sizing: border-box; }
.timeline-item::after { content: ''; position: absolute; width: 16px; height: 16px; background-color: var(--bg-color); border: 4px solid var(--glow-color); top: 25px; border-radius: 50%; z-index: 1; box-shadow: 0 0 10px var(--glow-color); }
.timeline-item:nth-child(odd) { left: 0; text-align: right; padding-right: 30px; }
.timeline-item:nth-child(odd)::after { right: -10px; }
.timeline-item:nth-child(even) { left: 50%; text-align: left; padding-left: 30px; }
.timeline-item:nth-child(even)::after { left: -10px; }
.timeline-date { font-weight: bold; color: white; margin-bottom: 10px; text-transform: lowercase; }
.timeline-content { padding: 20px; background: rgba(0,0,0,0.4); border-radius: 8px; }
.timeline-content h3 { margin-top: 0; }

.song-intro { font-size: 1.1rem; max-width: 500px; margin: 0 auto 30px; opacity: 0.9; }
.music-player-card { max-width: 350px; width: 100%; margin: 0 auto 30px; padding: 20px; }
.album-art { width: 100%; padding-bottom: 100%; border-radius: 15px; margin-bottom: 25px; background: linear-gradient(45deg, #ff7e5f, #feb47b, #fceabb, #a7c5eb, #c9a7f5); background-size: 300% 300%; animation: gradient-flow 10s ease infinite; box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 30px var(--glow-color); }
.song-info { margin-bottom: 20px; }
.song-title { font-size: 2rem; margin: 0; text-shadow: none; }
.song-artist { font-size: 1.1rem; margin: 5px 0 0; opacity: 0.8; }
.progress-bar-container { width: 100%; height: 6px; background-color: rgba(255, 255, 255, 0.2); border-radius: 5px; margin-bottom: 8px; }
.progress-bar { width: 0%; height: 100%; background-color: var(--glow-color); border-radius: 5px; transition: width 0.1s linear; }
.time-display { display: flex; justify-content: space-between; font-size: 0.8rem; opacity: 0.7; margin-bottom: 15px; }
.player-controls { display: flex; justify-content: center; align-items: center; }
#play-pause-btn { width: 60px; height: 60px; border-radius: 50%; border: none; background-color: var(--glow-color); display: flex; justify-content: center; align-items: center; box-shadow: 0 0 20px rgba(201, 167, 245, 0.7); transition: transform 0.2s ease; }
#play-pause-btn:hover { transform: scale(1.1); }
#play-pause-btn svg { width: 30px; height: 30px; fill: var(--bg-color); }
.play-icon { display: block; }
.pause-icon { display: none; }
#play-pause-btn.playing .play-icon { display: none; }
#play-pause-btn.playing .pause-icon { display: block; }

.countdown-container { margin-bottom: 50px; }
#countdown { font-size: 2.5rem; color: white; text-shadow: 0 0 10px var(--glow-color); letter-spacing: 5px; }
.vision-grid { display: flex; flex-direction: column; align-items: center; gap: 30px; }
.vision-item { position: relative; border-radius: 10px; overflow: hidden; width: 100%; max-width: 700px; }
.vision-item img { width: 100%; height: auto; display: block; filter: brightness(0.7); transition: filter 0.4s ease; }
.vision-item:hover img { filter: brightness(1); }
.vision-text { position: absolute; bottom: 0; left: 0; width: 100%; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); color: white; padding: 30px 15px 15px; font-size: 1.3rem; font-family: var(--heading-font); font-weight: 700; transition: opacity 0.4s ease; }
.vision-item:hover .vision-text { opacity: 0; }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(12, 0, 31, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: rgba(0, 0, 0, 0.4);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(201, 167, 245, 0.3);
    box-shadow: 0 0 30px rgba(201, 167, 245, 0.3);
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.modal-overlay.visible .modal-content {
    transform: scale(1);
}
.modal-content.shake {
    animation: shake 0.5s ease;
}
.close-modal {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: rgba(255,255,255,0.5);
    transition: color 0.3s ease, transform 0.3s ease;
}
.close-modal:hover {
    color: white;
    transform: scale(1.2);
}
.modal-content h3 {
    margin-bottom: 10px;
}
.modal-text {
    opacity: 0.8;
    margin-top: 0;
    margin-bottom: 30px;
}
.modal-input {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--glow-color);
    background-color: rgba(0,0,0,0.3);
    color: white;
    font-family: var(--primary-font);
    font-size: 1rem;
    box-sizing: border-box;
    margin-bottom: 20px;
    text-align: center;
    transition: box-shadow 0.3s ease;
}
.modal-input:focus {
    outline: none;
    box-shadow: 0 0 15px var(--glow-color);
}
.modal-button {
    font-family: var(--primary-font);
    font-size: 1rem;
    color: white;
    background: transparent;
    border: 2px solid var(--glow-color);
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 0 10px var(--glow-color);
    transition: all 0.3s ease;
    width: 100%;
}
.modal-button:hover {
    background: rgba(201, 167, 245, 0.2);
    box-shadow: 0 0 25px var(--glow-color);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes move-twink-back { from { background-position: 0 0; } to { background-position: -10000px 5000px; } }
@keyframes move-clouds-back { from { background-position: 0 0; } to { background-position: 10000px 0; } }
@keyframes float-particle {
    from { transform: translateY(0) rotate(0deg); opacity: 1; }
    to { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}
@keyframes pulse-nebula {
    from { transform: scale(1); opacity: 0.8; }
    to { transform: scale(1.1); opacity: 1; }
}
@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}
@keyframes fade-out-trail {
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
}
@keyframes heart-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotate(-10deg); }
    100% { transform: scale(1); }
}

@media (max-width: 768px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.5rem; }

    .menu-button { max-width: 100%; }

    .timeline::after {
        left: 20px;
        margin-left: 0;
    }
    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        width: 100%;
        text-align: left;
        padding-left: 55px;
        padding-right: 15px;
        left: 0;
    }
    .timeline-item::after,
    .timeline-item:nth-child(odd)::after,
    .timeline-item:nth-child(even)::after {
        left: 12px;
    }
    .mood-bubbles {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .mood-bubbles {
        grid-template-columns: 1fr;
    }
}

/* --- GAME STYLES --- */
#game-container {
    position: relative;
    width: 900px;
    height: 600px;
    max-width: 100%;
    box-sizing: border-box;
}

#gameCanvas {
    background-color: var(--bg-color);
    border-radius: 20px;
    border: 1px solid rgba(201, 167, 245, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.37);
    width: 100%;
    height: 100%;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(12, 0, 31, 0.8);
    backdrop-filter: blur(5px);
    color: white;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    z-index: 10;
}

.game-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.game-overlay h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.game-overlay p {
    font-size: 1.2rem;
    max-width: 600px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.game-overlay .start-button {
    font-family: var(--primary-font);
    font-size: 1.2rem;
    color: white;
    background: transparent;
    border: 2px solid var(--glow-color);
    padding: 15px 30px;
    border-radius: 50px;
    text-shadow: 0 0 10px var(--glow-color);
    transition: all 0.3s ease;
}

.game-overlay .start-button:hover {
    background: rgba(201, 167, 245, 0.2);
    box-shadow: 0 0 25px var(--glow-color);
}

/* Marriage Letter Styles */
#marriage-letter {
    font-family: var(--heading-font);
    border: 2px solid var(--glow-color);
    padding: 30px 40px;
    border-radius: 10px;
    max-width: 500px;
    background: rgba(12, 0, 31, 0.5);
    box-shadow: 0 0 30px var(--glow-color);
}

#marriage-letter h3 {
    font-size: 2.5rem;
    text-shadow: 0 0 20px var(--glow-color);
    margin-bottom: 25px;
}

.letter-text {
    font-family: var(--primary-font);
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.9;
    margin-bottom: 30px;
}

.signature-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#signature-input {
    font-family: var(--heading-font);
    font-style: italic;
    font-size: 1.5rem;
    width: 100%;
    padding: 10px;
    border: none;
    border-bottom: 1px solid var(--glow-color);
    background-color: transparent;
    color: white;
    text-align: center;
}

#signature-input:focus {
    outline: none;
    box-shadow: 0 2px 10px var(--glow-color);
}

#signature-button {
    font-family: var(--primary-font);
    font-size: 1rem;
    color: var(--bg-color);
    background-color: var(--glow-color);
    border: none;
    padding: 12px 35px;
    border-radius: 50px;
    box-shadow: 0 0 20px var(--glow-color);
    transition: all 0.3s ease;
    width: auto;
}
#signature-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--glow-color);
}

#signed-text {
    margin-top: 30px;
    font-family: var(--heading-font);
    font-style: italic;
    font-size: 2rem;
    color: var(--glow-color);
    text-shadow: 0 0 15px var(--glow-color);
}
