.tree-quiz-body {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at -10% 50%, rgba(8, 72, 43, 0.48) 0%, rgba(3, 25, 17, 0.22) 14%, transparent 26%),
        radial-gradient(circle at 110% 50%, rgba(7, 72, 55, 0.46) 0%, rgba(3, 27, 23, 0.2) 14%, transparent 26%),
        #000 !important;
    color: #f7f3df;
}

.tree-quiz-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background: none;
    opacity: 0;
}

.tree-quiz-body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 50%, #000 0%, #000 58%, rgba(0, 0, 0, 0.94) 76%, rgba(0, 0, 0, 0.62) 100%),
        linear-gradient(90deg, rgba(3, 42, 27, 0.46), transparent 13%, transparent 87%, rgba(3, 48, 39, 0.46));
}

.tree-quiz-body footer {
    margin-top: 0 !important;
    background: #030504;
}

.tree-quiz-page {
    min-height: calc(100vh - 58px);
    overflow-x: hidden;
    padding: 26px 16px 44px;
}

.tree-quiz-shell {
    width: min(1420px, 100%);
    margin: 0 auto;
}

.tree-quiz-panel {
    min-height: 78vh;
    color: #f7f3df;
    position: relative;
    overflow: visible;
}

.tree-quiz-panel::before {
    content: none;
    position: absolute;
    inset: 4% 8%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 28%, rgba(65, 130, 84, 0.16), transparent 30%),
        radial-gradient(circle at 52% 78%, rgba(0, 0, 0, 0.68), transparent 42%);
    filter: blur(34px);
    opacity: 0.92;
}

.tree-quiz-header {
    padding: 28px 24px 18px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.tree-quiz-title-row {
    display: inline-grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: center;
    gap: 22px;
    max-width: 100%;
}

.tree-quiz-kicker,
.tree-question-tag,
.tree-result-kicker {
    margin: 0 0 10px;
    color: #f2cf69;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-shadow: 0 0 22px rgba(242, 207, 105, 0.24);
}

.tree-quiz-header h1 {
    margin: 0;
    color: #fff;
    font-size: 4.65rem;
    font-weight: 950;
    line-height: 1.02;
    letter-spacing: 0;
    text-shadow: 0 18px 50px rgba(0, 0, 0, 0.72);
}

.tree-quiz-header p {
    max-width: 720px;
    margin: 12px auto 0;
    color: rgba(248, 243, 220, 0.82);
    font-size: 1.06rem;
    line-height: 1.5;
}

.tree-quiz-stage,
.tree-result {
    min-height: 550px;
    width: min(1280px, 100%);
    margin: 0 auto;
    padding: 24px 30px 34px;
    background: transparent;
    border: 0;
    box-shadow: none;
    position: relative;
    z-index: 1;
    overflow: visible;
}

.tree-quiz-stage::before,
.tree-result::before {
    content: none;
    position: absolute;
    inset: 2% -6% -10%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 38%, rgba(13, 38, 27, 0.74), transparent 46%),
        radial-gradient(circle at 28% 62%, rgba(126, 210, 139, 0.08), transparent 18%),
        radial-gradient(circle at 72% 58%, rgba(230, 195, 109, 0.08), transparent 18%);
    filter: blur(30px);
    animation: forestPulse 11s ease-in-out infinite;
}

.tree-quiz-topline,
.tree-result-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.tree-quiz-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-width: 0;
    color: #fff8dc;
    font-size: 0.95rem;
    font-weight: 900;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}

.tree-quiz-step-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.tree-quiz-bar {
    width: min(520px, 62vw);
    max-width: none;
    height: 7px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.tree-quiz-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #76d78c, #f0cf66);
    box-shadow: 0 0 24px rgba(126, 210, 139, 0.56);
    transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.tree-quiz-ghost,
.tree-quiz-next {
    min-height: 44px;
    border: 0;
    font-weight: 950;
    cursor: pointer;
}

.tree-quiz-ghost {
    min-width: 142px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
    font-size: 0.95rem;
    white-space: nowrap;
}

.tree-quiz-next {
    padding: 12px 26px;
    background: linear-gradient(135deg, #f1cf62, #85da92);
    color: #07110b;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

.tree-question {
    display: flex;
    min-height: 440px;
    flex-direction: column;
    justify-content: center;
    padding: 22px 0 4px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.tree-question h2 {
    max-width: 920px;
    margin: 0 auto 10px;
    color: #fff;
    font-size: 3.35rem;
    font-weight: 950;
    line-height: 1.12;
    letter-spacing: 0;
    animation: spellText 1.15s cubic-bezier(0.22, 1, 0.36, 1) both;
    text-shadow: 0 20px 52px rgba(0, 0, 0, 0.8);
    overflow: visible;
}

.tree-question-context {
    max-width: 760px;
    min-height: 28px;
    margin: 0 auto 30px;
    color: rgba(248, 243, 220, 0.82);
    font-size: 1.12rem;
    line-height: 1.45;
    animation: spellText 1.22s 0.14s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tree-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(28px, 4.5vw, 70px);
    width: min(1340px, 100%);
    margin: 0 auto;
    perspective: 1400px;
}

.tree-choice-grid.choice-count-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(1380px, 100%);
    gap: clamp(18px, 2vw, 30px);
}

.tree-choice-grid.is-entering .tree-choice-card {
    animation: cardAppear 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tree-choice-card {
    min-height: 520px;
    padding: 0 18px 10px;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: visible;
    transform-style: preserve-3d;
    transition: transform 0.65s ease, filter 0.65s ease;
    backdrop-filter: none;
    box-shadow: none;
}

.tree-choice-card::before {
    content: none;
    position: absolute;
    inset: 6% 12% 30%;
    background:
        radial-gradient(circle at 50% 50%, rgba(126, 210, 139, 0.22), transparent 56%),
        radial-gradient(circle at 50% 56%, rgba(240, 207, 102, 0.1), transparent 46%);
    opacity: 0.58;
    filter: blur(34px);
    transition: opacity 0.55s ease, transform 0.55s ease;
    pointer-events: none;
}

.tree-choice-card::after {
    content: none;
    position: absolute;
    inset: 2% 17% 42%;
    background: linear-gradient(115deg, transparent 36%, rgba(255, 255, 255, 0.22) 50%, transparent 64%);
    transform: translateX(-75%) rotate(8deg);
    opacity: 0;
    transition: opacity 0.55s ease, transform 1.4s ease;
    pointer-events: none;
}

.tree-choice-card:hover,
.tree-choice-card:focus-visible {
    transform: translateY(-12px) scale(1.035);
    filter: brightness(1.08);
    outline: none;
}

.tree-choice-card:hover::before,
.tree-choice-card:focus-visible::before {
    opacity: 0.95;
    transform: scale(1.08);
}

.tree-choice-card:hover::after,
.tree-choice-card:focus-visible::after {
    opacity: 1;
    transform: translateX(72%) rotate(8deg);
}

.tree-choice-image {
    width: min(390px, 92%);
    height: 440px;
    object-fit: contain;
    margin: 0 0 20px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 24px rgba(86, 170, 102, 0.18));
    animation: imageFloat 7s ease-in-out infinite;
}

.tree-choice-card > span {
    display: block;
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 92px;
    transition: opacity 0.28s ease, filter 0.28s ease;
}

.tree-choice-title {
    display: block;
    color: #fff9d9;
    font-size: 1.78rem;
    font-weight: 950;
    line-height: 1.16;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.62);
    overflow-wrap: anywhere;
}

.tree-choice-subtitle {
    display: block;
    max-width: 360px;
    margin: 12px auto 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.98rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.choice-count-4 .tree-choice-card {
    min-height: 390px;
    padding: 0 10px 8px;
}

.choice-count-4 .tree-choice-image {
    width: min(250px, 90%);
    height: 300px;
}

.choice-count-4 .tree-choice-title {
    font-size: 1.32rem;
}

.choice-count-4 .tree-choice-subtitle {
    font-size: 0.9rem;
    line-height: 1.38;
}

.tree-choice-card.is-selected {
    z-index: 5;
    pointer-events: none;
    animation: chosenToCenter 3.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    box-shadow: none;
    filter: none;
}

.tree-choice-card.is-selected::before,
.tree-choice-card.is-selected::after,
.tree-choice-card.is-falling::before,
.tree-choice-card.is-falling::after {
    opacity: 0;
}

.tree-choice-card.is-selected .tree-choice-image {
    animation: none;
    filter: none;
}

.tree-choice-card.is-selected > span {
    animation: selectedTextFade 3.15s linear forwards;
}

.tree-choice-card.is-falling {
    animation: treeFall 1.3s cubic-bezier(0.64, 0, 0.78, 0) forwards;
    pointer-events: none;
}

.tree-result {
    padding: clamp(20px, 3vw, 42px);
}

.tree-result[hidden] {
    display: none;
}

.tree-result h2 {
    margin: 0 0 24px;
    color: #fff;
    font-size: 4.9rem;
    font-weight: 950;
    text-align: center;
    line-height: 0.95;
    animation: spellText 1.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tree-result-kicker {
    text-align: center;
}

.tree-result-layout {
    display: grid;
    grid-template-columns: minmax(260px, 430px) minmax(0, 1fr);
    gap: clamp(22px, 4vw, 52px);
    align-items: center;
    position: relative;
    z-index: 2;
}

.tree-result-image-wrap {
    display: flex;
    min-height: 380px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 0;
    backdrop-filter: blur(8px);
    box-shadow: inset 0 0 70px rgba(126, 210, 139, 0.08), 0 26px 70px rgba(0, 0, 0, 0.32);
}

.tree-result-image-wrap img {
    width: min(360px, 88%);
    max-height: 350px;
    object-fit: contain;
    filter: drop-shadow(0 28px 28px rgba(0, 0, 0, 0.45));
    animation: resultFloat 7.5s ease-in-out infinite;
}

.tree-result-copy {
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.14rem;
    line-height: 1.72;
}

.tree-result-copy h3 {
    margin: 22px 0 6px;
    color: #f3c85b;
    font-size: 1.24rem;
    font-weight: 950;
}

.tree-result-copy p {
    margin: 0;
}

.tree-result-actions {
    justify-content: center;
    margin-top: 30px;
}

@keyframes spellText {
    0% {
        filter: blur(12px);
        opacity: 0;
        transform: translateX(-18px);
    }
    100% {
        filter: blur(0);
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(36px) rotateX(14deg) scale(0.94);
        filter: blur(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes chosenToCenter {
    0% {
        opacity: 1;
        filter: blur(0);
        transform: translate3d(0, 0, 0) rotateY(0deg) scale(1);
    }
    44% {
        opacity: 1;
        filter: blur(0);
        transform: translate3d(var(--move-x), var(--move-y), 0) rotateY(360deg) scale(1.16);
    }
    72% {
        opacity: 1;
        filter: blur(0);
        transform: translate3d(var(--move-x), var(--move-y), 0) rotateY(360deg) scale(1.16);
    }
    100% {
        opacity: 0;
        filter: blur(14px);
        transform: translate3d(var(--move-x), var(--move-y), 0) rotateY(360deg) scale(1.25);
    }
}

@keyframes selectedTextFade {
    0% {
        opacity: 1;
        filter: blur(0);
    }
    14%, 100% {
        opacity: 0;
        filter: blur(8px);
    }
}

@keyframes treeFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotateZ(0) rotateX(0);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: translateY(190px) rotateZ(10deg) rotateX(20deg) scale(0.88);
        filter: blur(12px);
    }
}

@keyframes forestPulse {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotate(0);
        opacity: 0.42;
    }
    50% {
        transform: translate3d(3%, -2%, 0) rotate(5deg);
        opacity: 0.72;
    }
}

@keyframes cardAura {
    0% {
        transform: rotate(0deg) scale(1);
    }
    100% {
        transform: rotate(360deg) scale(1.02);
    }
}

@keyframes imageFloat {
    0%, 100% {
        transform: translateY(0) rotateZ(-0.6deg);
    }
    50% {
        transform: translateY(-10px) rotateZ(0.6deg);
    }
}

@keyframes resultFloat {
    0%, 100% {
        transform: translateY(0) rotateY(-5deg) rotateZ(-1deg);
    }
    50% {
        transform: translateY(-12px) rotateY(8deg) rotateZ(1deg);
    }
}

@media (max-width: 980px) {
    .tree-quiz-page {
        padding: 20px 12px 34px;
    }

    .tree-quiz-header {
        padding: 22px 16px 16px;
    }

    .tree-quiz-header h1 {
        font-size: 3.35rem;
        line-height: 1.04;
    }

    .tree-quiz-title-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .tree-quiz-header p {
        font-size: 1rem;
    }

    .tree-quiz-stage,
    .tree-result {
        padding: 18px 12px 28px;
    }

    .tree-quiz-topline {
        align-items: stretch;
        flex-direction: column;
    }

    .tree-quiz-progress {
        align-items: center;
        flex-direction: row;
        gap: 8px;
    }

    .tree-quiz-bar {
        width: 100%;
        max-width: none;
    }

    .tree-question {
        min-height: 0;
        padding-top: 18px;
    }

    .tree-question h2 {
        font-size: 2.65rem;
        line-height: 1.14;
    }

    .tree-question-context {
        margin-bottom: 24px;
        font-size: 1.02rem;
    }

    .tree-choice-grid,
    .tree-choice-grid.choice-count-4 {
        grid-template-columns: 1fr 1fr;
    }

    .tree-choice-card,
    .choice-count-4 .tree-choice-card {
        min-height: 250px;
    }

    .tree-choice-title,
    .choice-count-4 .tree-choice-title {
        font-size: 1.42rem;
    }

    .tree-choice-subtitle,
    .choice-count-4 .tree-choice-subtitle {
        font-size: 0.9rem;
    }

    .tree-result h2 {
        font-size: 3.5rem;
    }

    .tree-result-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .tree-quiz-page {
        padding-inline: 8px;
    }

    .tree-choice-grid,
    .tree-choice-grid.choice-count-4 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tree-quiz-header h1 {
        font-size: 2.35rem;
    }

    .tree-quiz-ghost {
        min-width: 132px;
        min-height: 40px;
        padding: 9px 14px;
        font-size: 0.9rem;
    }

    .tree-question h2 {
        font-size: 2rem;
    }

    .tree-question-context {
        font-size: 0.95rem;
        margin-bottom: 18px;
    }

    .tree-choice-card,
    .choice-count-4 .tree-choice-card {
        min-height: 220px;
        padding: 20px 18px 22px;
    }

    .tree-choice-image,
    .choice-count-4 .tree-choice-image {
        width: min(170px, 68%);
        height: 104px;
        margin-bottom: 14px;
    }

    .tree-choice-card > span {
        min-height: 86px;
    }

    .tree-choice-title,
    .choice-count-4 .tree-choice-title {
        font-size: 1.34rem;
    }

    .tree-result h2 {
        font-size: 2.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tree-choice-card,
    .tree-choice-grid.is-entering .tree-choice-card,
    .tree-choice-image,
    .tree-result-image-wrap img,
    .tree-quiz-bar span,
    .tree-question h2,
    .tree-question-context {
        animation: none;
        transition: none;
    }
}
