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

body {
    background: #fde4ec;
    color: #b04a72;
    font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

.hidden {
    display: none !important;
}

.screen {
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.title {
    font-size: 40px;
    text-align: center;
}

/* --- Buttons --- */

.btn {
    background: #f7a8c4;
    color: white;
    border: none;
    border-radius: 16px;
    padding: 14px 32px;
    font-family: inherit;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(232, 138, 173, 0.35);
    transition: background 0.2s, scale 0.15s;
}

.btn:hover {
    background: #ee8cb0;
}

.btn:active {
    scale: 0.96;
}

.btn.btn-no {
    background: white;
    color: #b04a72;
    border: 2px solid #f7a8c4;
    box-shadow: none;
}

/* --- Yes/no pop-ups --- */

.popup-layer {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

.popup {
    position: absolute;
    width: min(280px, 85vw);
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(176, 74, 114, 0.25);
    animation: popIn 0.25s ease;
}

.popup.closing {
    animation: popOut 0.2s ease forwards;
    pointer-events: none;
}

.popup-bar {
    height: 34px;
    background: #f7a8c4;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
}

.popup-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
}

.popup-body {
    padding: 22px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
}

.popup-text {
    font-size: 22px;
    font-weight: bold;
}

.popup-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.popup-buttons .btn {
    flex: 1;
    padding: 12px 0;
    font-size: 18px;
}

@keyframes popIn {
    from { opacity: 0; scale: 0.8; }
    to   { opacity: 1; scale: 1; }
}

@keyframes popOut {
    from { opacity: 1; scale: 1; }
    to   { opacity: 0; scale: 0.7; }
}

/* --- Quiz --- */

.screen.quiz {
    justify-content: flex-start;
    align-items: stretch;
    gap: 20px;
    padding-top: 28px;
}

.quiz-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-progress {
    font-size: 14px;
    font-weight: bold;
}

.progress-track {
    height: 10px;
    background: white;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: #f7a8c4;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.quiz-photo {
    align-self: center;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    background-color: #f9c9da;
    background-size: cover;
    background-position: center;
    box-shadow: 0 10px 24px rgba(176, 74, 114, 0.2);
}

.quiz-question {
    font-size: 26px;
    line-height: 1.25;
    text-align: center;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    appearance: none;
    background: white;
    color: #b04a72;
    border: 2px solid #f7c3d6;
    border-radius: 16px;
    padding: 16px 18px;
    font-family: inherit;
    font-size: 18px;
    font-weight: bold;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.option:hover {
    border-color: #f7a8c4;
}

.option.correct {
    background: #f7a8c4;
    border-color: #f7a8c4;
    color: white;
}

.option.wrong {
    background: #fbeef3;
    border-color: #f3d3e0;
    color: #d79ab4;
    text-decoration: line-through;
    cursor: default;
}

.wiggle {
    animation: wiggle 0.4s ease;
}

@keyframes wiggle {
    0%, 100% { translate: 0 0; }
    20%      { translate: -8px 0; }
    40%      { translate: 8px 0; }
    60%      { translate: -5px 0; }
    80%      { translate: 5px 0; }
}

.quiz-feedback {
    min-height: 26px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
}

/* --- Floating hearts --- */

.hearts {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none; /* taps go straight through */
    z-index: -1;          /* behind everything */
}

.heart {
    position: absolute;
    bottom: -40px;
    font-size: var(--size);
    opacity: 0;
    animation: floatUp var(--duration) linear forwards;
}

@keyframes floatUp {
    0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    10%  { opacity: var(--opacity); }
    85%  { opacity: var(--opacity); }
    100% { transform: translate(var(--drift), -110vh) rotate(var(--spin)); opacity: 0; }
}

/* Turn the hearts off for people who've asked their phone for less motion */
@media (prefers-reduced-motion: reduce) {
    .hearts { display: none; }
}

/* --- Letter pop-up --- */

.letter-overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(253, 228, 236, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.4s ease;
}

.letter {
    width: 100%;
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(176, 74, 114, 0.3);
    animation: popIn 0.4s ease;
}

.letter-body {
    padding: 26px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.letter-title {
    font-size: 28px;
    text-align: center;
}

.letter p {
    font-size: 17px;
    line-height: 1.6;
    color: #8a4060;
}

.letter .letter-signature {
    font-weight: bold;
    color: #b04a72;
}

.letter .btn {
    margin-top: 6px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}