:root {
    --bg: #0f0f12;
    --card: #17171b;
    --text: #f6f7fb;
    --muted: #b8bbd4;
    --accent: #ff4d6d;
    --accent-2: #ffd166;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    background: radial-gradient(1200px 800px at 50% -10%, #1b1b20 0%, var(--bg) 60%, #0a0a0c 100%);
    color: var(--text);
    line-height: 1.6;
}

.container {
    width: min(100%, 960px);
    margin-inline: auto;
    padding: 1.25rem;
}

.center {
    text-align: center;
}

.title {
    font-size: clamp(1.6rem, 2.8vw + 1rem, 3.2rem);
    line-height: 1.1;
    margin: 2rem 0 .5rem;
    letter-spacing: .5px;
}

.title small {
    display: block;
    font-size: clamp(.9rem, 1.2vw + .6rem, 1.2rem);
    color: var(--muted);
    margin-top: .5rem;
    letter-spacing: 1.2px;
}

.subtitle {
    color: var(--muted);
    margin-top: .25rem;
    margin-bottom: 1rem;
}

.btn {
    appearance: none;
    border: 0;
    padding: .8rem 1.1rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #ff758f);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform .12s ease, filter .12s ease;
}

.btn:active {
    transform: translateY(1px) scale(.98);
}

.btn:focus-visible {
    outline: 2px solid #fff3;
    outline-offset: 3px;
}

.linklike {
    background: none;
    border: none;
    color: var(--muted);
    text-decoration: underline;
    cursor: pointer;
    padding: .25rem .5rem;
}

.card {
    background: color-mix(in oklab, var(--card) 92%, black 8%);
    border: 1px solid #ffffff10;
    border-radius: 18px;
    padding: 1.25rem;
    margin: 1rem 0;
    box-shadow: var(--shadow);
}

.message {
    font-size: clamp(1rem, .6rem + 1vw, 1.25rem);
    min-height: 3lh;
    white-space: pre-wrap;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem;
}

.gallery img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #ffffff12;
    box-shadow: var(--shadow);
}

.gallery figcaption {
    font-size: .9rem;
    color: var(--muted);
    margin-top: .3rem;
    text-align: center;
}

/* Floating heart particles (background) */
.bg-hearts {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

/* Hearts generated via JS are absolutely positioned spans with this base style */
.heart {
    position: absolute;
    font-size: 16px;
    will-change: transform, opacity;
    animation: floatUp 6s linear forwards;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35));
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(.8) rotate(0deg);
        opacity: .95;
    }

    60% {
        opacity: .9;
    }

    100% {
        transform: translateY(-120vh) scale(1.2) rotate(360deg);
        opacity: 0;
    }
}

/* Light theme toggle */
.light {
    --bg: #fff6f8;
    --card: #ffffff;
    --text: #221b1d;
    --muted: #5b5963;
    --accent: #e63946;
    --accent-2: #ffb703;
    background: radial-gradient(1400px 800px at 50% -10%, #fff 0%, var(--bg) 60%, #ffeef2 100%);
}

.footnote {
    color: var(--muted);
    margin: 1rem 0 2rem;
}

/* Print as a card */
@media print {
    body {
        background: #fff;
    }

    .bg-hearts,
    #burstBtn,
    #toggleTheme {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border-color: #ddd;
    }

    .gallery img {
        height: 160px;
    }
}

/* Accessibility helpers */
.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
}