:root {
    --bg-1: #fff7f8;
    --bg-2: #ffe8ec;
    --card: #ffffff;
    --text: #3d2a34;
    --muted: #7b6570;
    --accent: #ff6f91;
    --accent-dark: #ef4f77;
    --soft: #ffd7e1;
    --success: #2f9e69;
    --shadow: 0 16px 30px rgba(169, 93, 120, 0.18);
    --radius-lg: 24px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Trebuchet MS", "Lucida Sans Unicode", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 10%, #ffffff 0%, transparent 45%),
        radial-gradient(circle at 80% 90%, #ffd8e3 0%, transparent 40%),
        linear-gradient(150deg, var(--bg-1), var(--bg-2));
    display: grid;
    place-items: center;
    padding: 20px;
    transition: background 0.4s ease;
}

body.answered {
    background:
        radial-gradient(circle at 15% 15%, #fff4f8 0%, transparent 45%),
        radial-gradient(circle at 85% 88%, #ffe0ea 0%, transparent 42%),
        linear-gradient(150deg, #fff2f7, #ffdce8);
}

.wrapper {
    width: min(720px, 100%);
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    border: 1px solid #ffdbe5;
}

h1 {
    margin: 0 0 8px;
    font-size: clamp(1.45rem, 4vw, 2.1rem);
    line-height: 1.2;
    text-wrap: balance;
}

.subtitle {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 1rem;
}

.range-block {
    background: #fff4f7;
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid #ffd6e1;
}

.current-choice {
    margin: 0 0 12px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #5b3a47;
}

input[type="range"] {
    width: 100%;
    appearance: none;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--soft), #ffc2d2);
    outline: none;
    margin: 8px 0 10px;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: var(--accent);
    box-shadow: 0 4px 12px rgba(239, 79, 119, 0.35);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 30px;
    height: 30px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 4px 12px rgba(239, 79, 119, 0.35);
    cursor: pointer;
}

.labels {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 0.85rem;
}

.labels span {
    flex: 1;
    text-align: center;
}

.actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

button {
    border: 0;
    border-radius: 999px;
    padding: 12px 20px;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease;
    min-height: 44px;
}

button:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

button:focus-visible,
input[type="range"]:focus-visible {
    outline: 3px solid rgba(255, 111, 145, 0.35);
    outline-offset: 2px;
}

.result {
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: #fff0f4;
    border: 1px solid #ffd0dd;
    font-weight: 700;
    font-size: x-large;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.28s ease, transform 0.28s ease;
    min-height: 56px;
    display: flex;
    align-items: center;
}

.result.show {
    opacity: 1;
    transform: translateY(0);
}

.placeholder-text {
    margin-top: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1px dashed #ffb8ca;
    color: #644c56;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.28s ease 0.05s, transform 0.28s ease 0.05s;
    display: none;
}

.placeholder-text.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.question-view.hide {
    display: none;
}

.answer-view {
    display: none;
}

.answer-view.show {
    display: block;
    animation: fadeInUp 0.32s ease;
}

.answer-title {
    margin: 0 0 10px;
    font-size: clamp(1.4rem, 4vw, 2rem);
}

.yippi-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.yippi-image {
    max-width: min(260px, 100%);
    width: 100%;
    height: auto;
    border-radius: 14px;
    border: 1px solid #ffd0dd;
    box-shadow: 0 10px 20px rgba(169, 93, 120, 0.2);
}

.back-button {
    margin-top: 14px;
}

.hidden {
    display: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result.success {
    border-color: #b8e8ce;
    background: #effcf5;
    color: var(--success);
}

@media (max-width: 560px) {
    .wrapper {
        padding: 18px;
    }

    .labels {
        font-size: 0.75rem;
    }
}
