* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #fff4f2 0%, #fef4f7 42%, #f9ebf2 100%);
    color: #432a32;
    overflow-x: hidden;
    transition: background 0.5s ease;
    position: relative;
}

body::before,
body::after {
    content: "";
    position: fixed;
    width: 38rem;
    height: 38rem;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.42;
    z-index: 0;
    pointer-events: none;
}

body::before {
    top: -8rem;
    left: -8rem;
    background: rgba(255, 171, 204, 0.55);
}

body::after {
    right: -8rem;
    bottom: -8rem;
    background: rgba(244, 153, 182, 0.5);
}

body.dark {
    background: linear-gradient(135deg, #f3b0c0 0%, #f7c5d7 42%, #fce1ea 100%);
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 20px 60px;
    text-align: center;
    position: relative;
    z-index: 1;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0.02em;
}

h1 {
    font-size: clamp(2.2rem, 3.4vw, 3rem);
}

h2 {
    font-size: clamp(2rem, 3vw, 2.6rem);
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #d45a84;
}

.quiz-card,
.stats-section {
    max-width: 760px;
    margin: 0 auto;
    padding: 32px 24px 36px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(212, 93, 136, 0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 20px 44px rgba(171, 92, 120, 0.15);
    position: relative;
    overflow: hidden;
}

.quiz-card::before,
.stats-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0));
    pointer-events: none;
}

.quiz-card {
    margin-bottom: 24px;
}

.quiz-intro,
.congrats-text {
    margin: 12px 0 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #6b3f48;
}

.quiz-question {
    margin-top: 24px;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 700;
    color: #432a32;
}

.quiz-options {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.quiz-option {
    border: none;
    border-radius: 999px;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 600;
    color: #422b34;
    background: linear-gradient(135deg, #fff8fb 0%, #ffeaf2 100%);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.quiz-option:hover,
.quiz-option:focus-visible {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #ffeaf2 0%, #ffdfe9 100%);
    box-shadow: 0 10px 24px rgba(212, 93, 136, 0.18);
    outline: none;
}

.quiz-feedback {
    min-height: 24px;
    margin-top: 18px;
    font-weight: 700;
    color: #b64a6d;
}

.hint {
    margin: 16px auto 40px;
    max-width: 560px;
    font-size: 1rem;
    opacity: 0.82;
    font-style: italic;
    color: #6a3f4f;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 24px;
    justify-items: center;
    margin: 0 auto;
    width: min(100%, 900px);
    animation: fadeInUp 0.8s ease both;
}

.stat {
    position: relative;
    width: 100%;
    max-width: 180px;
    min-height: 140px;
    padding: 24px 18px 18px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(212, 93, 136, 0.08);
    box-shadow: 0 18px 40px rgba(171, 92, 120, 0.12);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    overflow: visible;
}

.stat:hover,
.stat:focus-within,
.stat.active {
    transform: translateY(-6px);
    border-color: rgba(212, 93, 136, 0.18);
    box-shadow: 0 24px 50px rgba(171, 92, 120, 0.17);
}

.number {
    margin: 0;
    font-size: clamp(2.4rem, 4vw, 3.2rem);
    font-weight: 700;
    color: #e4487d;
}

.label {
    margin: 10px 0 0;
    font-size: 1rem;
    color: #613d4c;
}

.tooltip {
    display: none;
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    color: #4a2c2c;
    text-align: left;
    box-shadow: 0 12px 24px rgba(135, 76, 102, 0.14);
    font-size: 0.95rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.mobile-tooltip-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(68, 34, 45, 0.38);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 300;
    margin: 0;
    border: 0;
    box-sizing: border-box;
}

.mobile-tooltip-overlay[hidden] {
    display: none;
}

.mobile-tooltip-card {
    position: relative;
    width: min(420px, calc(100vw - 32px));
    padding: 18px 18px 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(212, 93, 136, 0.12);
    box-shadow: 0 20px 44px rgba(94, 48, 64, 0.2);
    max-height: calc(100vh - 40px);
    overflow: auto;
    text-align: center;
    animation: modalIn 0.22s ease;
}

.mobile-tooltip-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #dd467e;
    text-align: center;
}

.mobile-tooltip-text {
    margin: 0 0 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #4a2c2c;
    text-align: left;
}

.mobile-tooltip-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #fff5f9 0%, #ffeaf3 100%);
    color: #b64a6d;
    font-weight: 700;
    cursor: pointer;
    margin: 0 auto;
    box-shadow: 0 12px 22px rgba(214, 88, 129, 0.12);
}

.stat.active .tooltip,
.stat:hover .tooltip,
.stat:focus-within .tooltip {
    display: none;
}

.tooltip {
    display: none !important;
}

@media (max-width: 540px) {
    .stat {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        min-height: auto;
    }
}

.actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 44px;
}

.secret-btn,
.secondary-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.secret-btn {
    background: linear-gradient(135deg, #f65d8d 0%, #d84d74 100%);
    color: #fff;
    box-shadow: 0 18px 30px rgba(214, 88, 129, 0.22);
}

.secondary-btn {
    background: linear-gradient(135deg, #fff6fa 0%, #ffeaf2 100%);
    color: #b64a6d;
}

.secret-btn:hover,
.secret-btn:focus-visible,
.secondary-btn:hover,
.secondary-btn:focus-visible {
    transform: scale(1.05);
    box-shadow: 0 18px 30px rgba(214, 88, 129, 0.26);
    outline: none;
}

.big-heart {
    display: none;
    margin: 28px auto 0;
    font-size: clamp(3rem, 7vw, 6rem);
    color: #f54f82;
    animation: pulse 1.6s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(245, 79, 130, 0.25);
    opacity: 0;
    transform: scale(0.75);
}

.big-heart.visible {
    opacity: 1;
    transform: scale(1);
    animation: pulse 1.6s ease-in-out infinite;
}

.secret-message {
    display: none;
    margin: 20px auto 0;
    max-width: 780px;
    font-size: 1rem;
    line-height: 1.75;
    color: #5a2d3a;
    padding: 22px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(214, 88, 129, 0.12);
    box-shadow: 0 18px 40px rgba(145, 69, 92, 0.12);
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    position: relative;
    z-index: 1;
}

.secret-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.burst {
    position: fixed;
    font-size: 1.2rem;
    animation: pop 2.2s ease forwards;
    pointer-events: none;
    z-index: 0;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.16); }
}

@keyframes pop {
    0% { opacity: 1; transform: scale(1) translate(0, 0); }
    100% { opacity: 0; transform: scale(1.35) translate(var(--x), var(--y)); }
}

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

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 540px) {
    .container {
        padding: 20px 14px 40px;
    }

    .quiz-card,
    .stats-section {
        padding: 24px 16px 28px;
        border-radius: 24px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .quiz-question {
        margin-top: 18px;
        font-size: 1.05rem;
    }

    .quiz-option,
    .secret-btn,
    .secondary-btn {
        width: 100%;
        padding: 13px 16px;
        font-size: 0.95rem;
    }

    .actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 28px;
    }

    .stats {
        gap: 14px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat {
        min-height: 120px;
        max-width: none;
        padding: 18px 12px 14px;
    }

    .number {
        font-size: 1.9rem;
    }

    .label {
        font-size: 0.9rem;
    }

    .tooltip {
        display: none;
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        top: auto;
        transform: none;
        width: 100%;
        max-width: none;
        max-height: none;
        margin-top: 12px;
        overflow-y: visible;
        font-size: 0.9rem;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
    }

    .stat.active .tooltip,
    .stat:hover .tooltip,
    .stat:focus-within .tooltip {
        display: block;
        transform: none;
    }
}
