/* ── Reset & Base ─────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: 'Lato', sans-serif;
    color: #0f172a;
    background: linear-gradient(180deg, #f1f5f9 0%, #ffffff 100%);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* ── App Container ───────────────────────────── */
#app {
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    height: 100%;
}
@media (min-width: 481px) {
    #app {
        padding: 40px;
    }
}

/* ── Typography ──────────────────────────────── */
.headline {
    font-size: 28px;
    line-height: 38px;
    font-weight: 700;
    color: #0f172a;
}
@media (min-width: 481px) {
    .headline {
        font-size: 36px;
        line-height: 48px;
    }
}
@media (min-width: 821px) {
    .headline {
        font-size: 48px;
        line-height: 64px;
    }
}

.subline {
    font-size: clamp(16px, 4vw, 24px);
    line-height: clamp(24px, 5vw, 32px);
    font-weight: 700;
    color: #475569;
}
@media (min-width: 481px) {
    .subline {
        font-size: 20px;
        line-height: 28px;
    }
}
@media (min-width: 821px) {
    .subline {
        font-size: 24px;
        line-height: 32px;
    }
}

.body-text {
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
    color: #0f172a;
}

/* ── Screens ─────────────────────────────────── */
.screen {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    animation: screenIn 0.4s ease both;
}

.screen.active {
    display: flex;
}

.screen.fade-out {
    animation: screenOut 0.25s ease both;
}

@keyframes screenIn {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes screenOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-60px);
    }
}

/* ── Start Screen ────────────────────────────── */
.start-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 24px;
}
@media (min-width: 481px) {
    .start-screen {
        gap: 36px;
    }
}

.start-screen .headline {
    color: #2563eb;
    max-width: 650px;
    text-wrap-style: balance;
}

.start-screen .subline {
    max-width: 480px;
}

.start-screen .gif-placeholder {
    border-radius: 16px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 14px;
    overflow: hidden;
    max-width: 90vw;
    max-height: 90vw;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 20px 56px;
    font-family: 'Lato', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    background: #2563eb;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition:
        background 0.2s,
        transform 0.15s;
}
@media (min-width: 481px) {
    .btn-primary {
        padding: 18px 44px;
        font-size: 22px;
    }
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-primary:active {
    transform: scale(0.97);
}

/* ── Progress Bar ────────────────────────────── */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.progress-bar:not(.visible) {
    display: none;
}

.progress-bar.visible {
    opacity: 1;
}

.progress-bar__fill {
    height: 100%;
    background: #2563eb;
    border-radius: 4px;
    transition: width 1.5s ease;
}

/* ── Question Screen ─────────────────────────── */
.question-screen {
    gap: 24px;
}

.question-screen .headline {
    flex-shrink: 0;
    font-size: clamp(22px, 5vw, 32px);
    line-height: 30px;
    margin: 20px 0 0;
    text-wrap-style: pretty;
}
@media (min-width: 481px) {
    .question-screen .headline {
        font-size: 36px;
        line-height: 48px;
        margin: 40px 0 20px;
    }
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    justify-content: center;
    overflow: hidden;
}
@media (min-width: 481px) {
    .answers {
        gap: 10px;
    }
}

.answer-card {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 14px 16px;
    gap: 4px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #0f172a;
    text-align: left;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition:
        border-color 0.2s,
        transform 0.15s,
        box-shadow 0.2s;
    overflow: hidden;
}
@media (min-width: 481px) {
    .answer-card {
        gap: 8px;
        padding: 28px;
        font-size: 24px;
        line-height: 36px;
    }
}
@media (min-width: 821px) {
    .answer-card {
        padding: 32px;
    }
}

.answer-card__title {
    font-size: clamp(16px, 5vw, 28px);
    font-weight: 700;
    color: #0f172a;
}

.answer-card__subtitle {
    font-size: clamp(16px, 4vw, 24px);
    line-height: clamp(24px, 5vw, 32px);
    font-weight: 400;
    color: #475569;
    text-wrap-style: pretty;
    hyphens: auto;
}

.answer-card:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.12);
}

.answer-card:active {
    transform: scale(0.98);
}

.answer-card.selected {
    border-color: #2563eb;
    background: #eff6ff;
    transform: scale(0.97);
}

/* ── Result Screen ───────────────────────────── */
.result-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 24px;
}

/* ── Thermometer ─────────────────────────────── */
.thermometer-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.thermometer {
    position: relative;
    width: 60px;
    height: 200px;
    background: #e2e8f0;
    border-radius: 40px;
    overflow: hidden;
}
@media (min-width: 481px) {
    .thermometer {
        width: 70px;
        height: 260px;
    }
}
@media (min-width: 821px) {
    .thermometer {
        width: 80px;
        height: 320px;
    }
}

.thermometer__fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 0 0 40px 40px;
    transition:
        height 1.8s cubic-bezier(0.22, 1, 0.36, 1),
        background-color 1.8s ease;
    height: 0%;
}

.thermometer__bulb {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    transition: background-color 1.8s ease;
    z-index: 1;
}

.score-label {
    font-size: clamp(16px, 4vw, 24px);
    font-weight: 700;
    color: #475569;
}

/* ── Screen Flash ─────────────────────────────── */
.screen-flash {
    --flash-intensity: 0.3;
    position: fixed;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
}

.screen-flash.active {
    animation: flash 0.9s ease-out both;
}

@keyframes flash {
    0% {
        opacity: 0;
    }
    15% {
        opacity: calc(var(--flash-intensity) * 0.8);
    }
    40% {
        opacity: calc(var(--flash-intensity) * 0.2);
    }
    60% {
        opacity: calc(var(--flash-intensity) * 0.55);
    }
    100% {
        opacity: 0;
    }
}

.result-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
@media (min-width: 481px) {
    .result-copy {
        gap: 28px;
    }
}

.result-headline {
    font-size: clamp(32px, 6vw, 52px);
    line-height: clamp(40px, 7vw, 64px);
    font-weight: 700;
}

.result-tip {
    font-size: clamp(16px, 4vw, 24px);
    line-height: clamp(24px, 5vw, 32px);
    color: #475569;
    max-width: 560px;
    text-wrap-style: pretty;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-family: 'Lato', sans-serif;
    font-size: clamp(16px, 4vw, 24px);
    font-weight: 700;
    color: #2563eb;
    background: #eff6ff;
    border: 2px solid #2563eb;
    border-radius: 12px;
    cursor: pointer;
    transition:
        background 0.2s,
        transform 0.15s;
    margin-top: 8px;
}

.btn-secondary:hover {
    background: #dbeafe;
}

.btn-secondary:active {
    transform: scale(0.97);
}
