:root {
    --bg: #cdeafe;
    --bg-2: #e7f6ff;
    --yes: #ff7eb9;
    --yes-dark: #ff4f9a;
    --no: #b8c6d1;
    --text: #4a5a6a;
    --card: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Feuerwerk-Canvas über allem, aber hinter dem Popup */
#fireworks {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

/* ---- Lade-Overlay mit Bühnenvorhang ---- */
.loader {
    position: fixed;
    inset: 0;
    z-index: 200;
    overflow: hidden;
}

.loader.done {
    pointer-events: none;
}

/* Vorhang-Hälften */
.curtain {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(180deg, #ff7eb9 0%, #ff4f9a 100%);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.18);
    transition: transform 1.1s cubic-bezier(0.7, 0, 0.3, 1);
    z-index: 1;
}

.curtain-left {
    left: 0;
    border-right: 3px solid rgba(255, 255, 255, 0.35);
}

.curtain-right {
    right: 0;
    border-left: 3px solid rgba(255, 255, 255, 0.35);
}

/* Vorhang-Falten */
.curtain::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.08) 0px,
        rgba(255, 255, 255, 0.08) 14px,
        rgba(0, 0, 0, 0.06) 28px,
        rgba(0, 0, 0, 0.06) 42px
    );
}

/* Loader-Inhalt (Titel + Balken) */
.loader-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    z-index: 2;
    transition: opacity 0.5s ease;
}

.loader-title {
    color: #ffffff;
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    animation: bounce 1.4s ease-in-out infinite;
}

.loader-bar {
    width: min(320px, 70vw);
    height: 18px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.18);
}

.loader-bar-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #fff 0%, #ffe66d 100%);
    transition: width 3s linear;
}

/* Vorhang öffnet sich wie auf einer Bühne */
.loader.open .curtain-left {
    transform: translateX(-100%);
}

.loader.open .curtain-right {
    transform: translateX(100%);
}

.loader.open .loader-content {
    opacity: 0;
}

.loader.hidden {
    display: none;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    font-family: "Segoe UI", "Comic Sans MS", system-ui, sans-serif;
    background: linear-gradient(160deg, var(--bg-2) 0%, var(--bg) 100%);
    color: var(--text);
    padding: 24px;
    overflow-x: hidden;
    overflow-y: hidden;
}

.container {
    background: var(--card);
    max-width: 480px;
    width: 100%;
    text-align: center;
    padding: clamp(24px, 5vw, 40px) clamp(20px, 4vw, 32px);
    border-radius: clamp(20px, 4vw, 28px);
    box-shadow: 0 18px 40px rgba(120, 170, 210, 0.35);
    border: 3px solid #ffffff;
    animation: pop 0.5s ease-out;
}

.container h1 {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    margin-bottom: 16px;
    color: #ff4f9a;
    line-height: 1.3;
}

.container p {
    font-size: clamp(0.95rem, 3vw, 1.05rem);
    line-height: 1.6;
    color: var(--text);
}

.row {
    display: flex;
    gap: clamp(14px, 3vw, 20px);
    flex-wrap: wrap;
    justify-content: center;
}

.row a {
    display: inline-block;
    text-decoration: none;
    font-size: clamp(1rem, 3.5vw, 1.15rem);
    font-weight: 700;
    padding: clamp(13px, 3vw, 16px) clamp(26px, 6vw, 36px);
    border-radius: 999px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    user-select: none;
}

/* Ja-Button: hervorstechend und süß */
.btn-yes {
    color: #ffffff;
    background: linear-gradient(135deg, var(--yes) 0%, var(--yes-dark) 100%);
    box-shadow: 0 10px 22px rgba(255, 79, 154, 0.45);
}

.btn-yes:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 16px 28px rgba(255, 79, 154, 0.55);
}

.btn-yes:active {
    transform: translateY(0) scale(0.98);
}

/* Nein-Button: hervorstechend, rennt aber vor dem Cursor weg */
.btn-no {
    color: #ffffff;
    background: linear-gradient(135deg, #7ec8ff 0%, #4f9aff 100%);
    box-shadow: 0 10px 22px rgba(79, 154, 255, 0.45);
    transition: transform 0.18s ease;
}

.btn-no.runaway {
    position: fixed;
    margin: 0;
    width: auto;
    z-index: 10;
}

/* Spur, die der Nein-Button hinter sich herzieht */
.trail {
    position: fixed;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(126, 200, 255, 0.9) 0%, rgba(79, 154, 255, 0.5) 60%, rgba(79, 154, 255, 0) 100%);
    pointer-events: none;
    z-index: 9;
    animation: trailFade 0.6s ease-out forwards;
}

@keyframes trailFade {
    0% {
        opacity: 0.8;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.2);
    }
}

@keyframes pop {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Dankes-Popup */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(120, 170, 210, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
}

.overlay.show {
    display: flex;
    animation: fade 0.3s ease-out;
}

.popup {
    background: var(--card);
    max-width: 420px;
    width: 100%;
    text-align: center;
    padding: 40px 32px;
    border-radius: 28px;
    box-shadow: 0 22px 50px rgba(120, 170, 210, 0.5);
    border: 3px solid #ffffff;
    animation: pop 0.45s ease-out;
}

.popup-emoji {
    font-size: 3rem;
    margin-bottom: 12px;
    animation: bounce 1.2s ease-in-out infinite;
}

.popup h2 {
    color: #ff4f9a;
    font-size: 1.6rem;
    margin-bottom: 14px;
}

.popup p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 26px;
}

.popup-close {
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, var(--yes) 0%, var(--yes-dark) 100%);
    border: none;
    padding: 14px 34px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(255, 79, 154, 0.45);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.popup-close:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 16px 28px rgba(255, 79, 154, 0.55);
}

@keyframes fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Große Schlussnachricht in der Mitte */
.final-message {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    font-size: clamp(2rem, 9vw, 5rem);
    font-weight: 900;
    line-height: 1.1;
    background: linear-gradient(135deg, #ff7eb9 0%, #ff4f9a 40%, #4f9aff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #ff4f9a;
    text-shadow: 0 4px 18px rgba(255, 79, 154, 0.25);
    z-index: 60;
    pointer-events: none;
}

.final-message.show {
    display: flex;
    animation: finalPop 0.7s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes finalPop {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Popup fluid */
.popup {
    padding: clamp(28px, 5vw, 40px) clamp(20px, 4vw, 32px);
}

.popup-emoji {
    font-size: clamp(2.4rem, 8vw, 3rem);
}

.popup h2 {
    font-size: clamp(1.3rem, 5vw, 1.6rem);
}

.popup p {
    font-size: clamp(0.95rem, 3vw, 1.05rem);
}

/* Kleinere Bildschirme: Buttons untereinander */
@media (max-width: 480px) {
    body {
        gap: 24px;
        padding: 16px;
    }

    .row {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
    }

    .row a {
        text-align: center;
        width: 100%;
    }
}

/* Sehr niedrige Bildschirme (Querformat Handy) */
@media (max-height: 480px) {
    body {
        gap: 18px;
    }
}
