:root {
    --ink: #20302f;
    --muted: #5b6b67;
    --paper: #fffdf6;
    --leaf: #3f7f61;
    --leaf-dark: #23513d;
    --petal: #f06f9d;
    --rose: #c5406e;
    --sun: #f6bd50;
    --sky: #d8f0ee;
    --water: #77bfd2;
    --cream: #fff4cf;
    --shadow: 0 18px 50px rgba(34, 54, 49, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.45) 0 1px, transparent 1px 18px),
        linear-gradient(180deg, #d7f2ee 0%, #f9f5dc 54%, #e5f4df 100%);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

.ambient-field {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.ambient-field span {
    position: absolute;
    top: -12vh;
    width: 14px;
    height: 22px;
    border-radius: 14px 14px 3px 14px;
    background: rgba(240, 111, 157, 0.34);
    box-shadow: 0 10px 28px rgba(197, 64, 110, 0.16);
    animation: petal-drift 14s linear infinite;
}

.ambient-field span:nth-child(1) {
    left: 9%;
    animation-delay: -2s;
    animation-duration: 15s;
}

.ambient-field span:nth-child(2) {
    left: 24%;
    width: 12px;
    height: 19px;
    background: rgba(246, 189, 80, 0.34);
    animation-delay: -7s;
    animation-duration: 18s;
}

.ambient-field span:nth-child(3) {
    left: 48%;
    background: rgba(63, 127, 97, 0.28);
    animation-delay: -4s;
    animation-duration: 16s;
}

.ambient-field span:nth-child(4) {
    left: 67%;
    width: 16px;
    height: 24px;
    background: rgba(119, 191, 210, 0.3);
    animation-delay: -9s;
    animation-duration: 19s;
}

.ambient-field span:nth-child(5) {
    left: 82%;
    animation-delay: -1s;
    animation-duration: 13s;
}

.ambient-field span:nth-child(6) {
    left: 92%;
    width: 11px;
    height: 18px;
    background: rgba(246, 189, 80, 0.3);
    animation-delay: -12s;
    animation-duration: 20s;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.app {
    width: min(100%, 520px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px;
    display: grid;
}

.screen {
    display: none;
}

.screen-active {
    display: flex;
    animation: screen-rise 520ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.intro,
.final {
    min-height: calc(100vh - 36px);
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 18px;
}

.intro h1,
.final h2,
.game h2 {
    margin: 0;
    line-height: 1.02;
    letter-spacing: 0;
}

.intro h1 {
    max-width: 9ch;
    font-size: clamp(3rem, 18vw, 5.4rem);
}

.final h2 {
    font-size: clamp(2.8rem, 14vw, 4.8rem);
}

.game h2 {
    font-size: 2rem;
}

.intro p,
.final p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: 1.05rem;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--rose);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand-mark {
    position: relative;
    width: 96px;
    height: 96px;
    margin-bottom: 8px;
    filter: drop-shadow(0 14px 18px rgba(197, 64, 110, 0.18));
    animation: gentle-bob 3.2s ease-in-out infinite;
}

.brand-mark span {
    position: absolute;
    width: 54px;
    height: 54px;
    border-radius: 54px 54px 12px 54px;
    background: var(--petal);
    transform-origin: 100% 100%;
    box-shadow: inset -8px -10px 0 rgba(160, 42, 84, 0.14);
}

.brand-mark span:nth-child(1) {
    left: 9px;
    top: 10px;
    transform: rotate(-20deg);
}

.brand-mark span:nth-child(2) {
    left: 34px;
    top: 22px;
    background: var(--sun);
    transform: rotate(48deg);
}

.brand-mark span:nth-child(3) {
    left: 18px;
    top: 46px;
    background: var(--leaf);
    transform: rotate(128deg);
}

.primary-action,
.ghost-action {
    min-height: 50px;
    border: 0;
    border-radius: 999px;
    padding: 0 22px;
    font-weight: 800;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.primary-action {
    color: #fff;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 42%),
        linear-gradient(135deg, var(--leaf-dark), #2f7353 58%, #c5406e);
    box-shadow: 0 14px 28px rgba(35, 81, 61, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.ghost-action {
    color: var(--ink);
    background: #e8eee3;
}

.primary-action:hover,
.ghost-action:hover,
.primary-action:focus-visible,
.ghost-action:focus-visible {
    transform: translateY(-2px);
    filter: saturate(1.08);
}

.primary-action:active,
.ghost-action:active {
    transform: translateY(1px) scale(0.99);
}

.access-form {
    display: grid;
    gap: 10px;
    padding-top: 4px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.66);
    border-radius: 24px;
    background: rgba(255, 253, 246, 0.62);
    backdrop-filter: blur(14px);
}

.access-form label {
    color: var(--leaf-dark);
    font-size: 0.95rem;
    font-weight: 900;
}

.access-form input {
    width: 100%;
    border: 2px solid #c7ded0;
    border-radius: 16px;
    padding: 14px 15px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

.access-form input:focus {
    border-color: var(--leaf);
    box-shadow: 0 0 0 4px rgba(63, 127, 97, 0.14);
}

.access-status {
    min-height: 24px;
    margin: 0;
    color: var(--rose) !important;
    font-weight: 800;
}

.game {
    min-height: calc(100vh - 36px);
    flex-direction: column;
    gap: 14px;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0 0;
}

.progress-pill {
    flex: 0 0 auto;
    min-width: 66px;
    padding: 12px 14px;
    border-radius: 999px;
    color: #fff;
    background: var(--rose);
    text-align: center;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(197, 64, 110, 0.22);
}

.garden {
    position: relative;
    min-height: 68vh;
    overflow: hidden;
    border-radius: 24px;
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.85) 0 5%, transparent 6%),
        linear-gradient(180deg, var(--sky) 0 39%, #dcefc8 39% 100%);
    box-shadow: var(--shadow);
    isolation: isolate;
}

.garden::before {
    content: "";
    position: absolute;
    left: -8%;
    right: -8%;
    bottom: -18px;
    height: 44%;
    background:
        radial-gradient(circle at 14% 52%, #f2c0cb 0 3%, transparent 3.4%),
        radial-gradient(circle at 84% 38%, #f6d26f 0 3%, transparent 3.4%),
        radial-gradient(circle at 62% 62%, #f06f9d 0 3%, transparent 3.4%),
        linear-gradient(180deg, #8fcf79, #5ea86b);
    border-radius: 50% 50% 0 0;
}

.garden::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(circle at 24% 74%, rgba(255, 255, 255, 0.72) 0 2px, transparent 3px),
        radial-gradient(circle at 77% 58%, rgba(255, 255, 255, 0.62) 0 2px, transparent 3px),
        radial-gradient(circle at 54% 44%, rgba(255, 244, 207, 0.8) 0 2px, transparent 3px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 42%);
    opacity: 0.78;
    pointer-events: none;
    animation: garden-shimmer 4.2s ease-in-out infinite alternate;
}

.sun,
.cloud,
.path {
    position: absolute;
    pointer-events: none;
}

.sun {
    top: 24px;
    right: 28px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--sun);
    box-shadow: 0 0 0 14px rgba(246, 189, 80, 0.18);
    animation: sun-glow 3.8s ease-in-out infinite alternate;
}

.cloud {
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
}

.cloud::before,
.cloud::after {
    content: "";
    position: absolute;
    bottom: 8px;
    border-radius: 50%;
    background: inherit;
}

.cloud::before {
    left: 14px;
    width: 34px;
    height: 34px;
}

.cloud::after {
    right: 16px;
    width: 42px;
    height: 42px;
}

.cloud-one {
    top: 72px;
    left: 22px;
    width: 112px;
    animation: cloud-slide 9s ease-in-out infinite alternate;
}

.cloud-two {
    top: 142px;
    right: -18px;
    width: 128px;
    animation: cloud-slide 11s ease-in-out infinite alternate-reverse;
}

.path {
    left: 33%;
    bottom: -20px;
    width: 34%;
    height: 58%;
    border-radius: 50% 50% 0 0;
    background: linear-gradient(180deg, #f5deb8, #cfae77);
    transform: perspective(180px) rotateX(18deg);
    opacity: 0.9;
}

.treasure {
    position: absolute;
    z-index: 2;
    width: 96px;
    min-height: 96px;
    border: 0;
    border-radius: 22px;
    display: grid;
    place-items: center;
    gap: 4px;
    color: var(--ink);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 253, 246, 0.78)),
        var(--paper);
    box-shadow: 0 14px 30px rgba(34, 54, 49, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    font-size: 0.84rem;
    font-weight: 900;
    transform-origin: 50% 100%;
    transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
    animation: treasure-idle 3.6s ease-in-out infinite;
}

.treasure:hover,
.treasure:focus-visible {
    transform: translateY(-6px) scale(1.04) rotate(-1deg);
    box-shadow: 0 18px 36px rgba(34, 54, 49, 0.24), 0 0 0 6px rgba(255, 255, 255, 0.34);
}

.treasure-found {
    opacity: 0.58;
    animation: treasure-unlocked 520ms ease both;
}

.treasure-found::after {
    content: "OK";
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 7px 8px;
    border-radius: 999px;
    color: #fff;
    background: var(--leaf-dark);
    font-size: 0.72rem;
}

.flower-treasure {
    left: 24px;
    top: 185px;
}

.mug-treasure {
    right: 28px;
    top: 235px;
}

.brush-treasure {
    left: 42px;
    bottom: 38px;
}

.basket-treasure {
    right: 42px;
    bottom: 92px;
}

.gift-treasure {
    left: calc(50% - 48px);
    top: 54%;
    animation-delay: -1.7s;
}

.flower-treasure {
    animation-delay: -0.2s;
}

.mug-treasure {
    animation-delay: -0.8s;
}

.brush-treasure {
    animation-delay: -1.2s;
}

.basket-treasure {
    animation-delay: -0.5s;
}

.burst-petal {
    position: absolute;
    z-index: 5;
    left: var(--burst-x);
    top: var(--burst-y);
    width: 12px;
    height: 18px;
    border-radius: 18px 18px 4px 18px;
    background: var(--burst-color, var(--petal));
    pointer-events: none;
    animation: burst-petal 850ms ease-out forwards;
}

.flower-shape,
.mug-shape,
.brush-shape,
.basket-shape,
.gift-shape {
    position: relative;
    width: 44px;
    height: 44px;
    display: block;
}

.flower-shape {
    border-radius: 50%;
    background: var(--sun);
}

.flower-shape::before,
.flower-shape::after {
    content: "";
    position: absolute;
    inset: -9px 10px;
    border-radius: 999px;
    background: var(--petal);
    z-index: -1;
}

.flower-shape::after {
    transform: rotate(90deg);
}

.mug-shape {
    width: 42px;
    height: 38px;
    margin-top: 3px;
    border-radius: 8px 8px 14px 14px;
    background: var(--water);
}

.mug-shape::after {
    content: "";
    position: absolute;
    right: -13px;
    top: 8px;
    width: 17px;
    height: 18px;
    border: 5px solid var(--water);
    border-left: 0;
    border-radius: 0 14px 14px 0;
}

.brush-shape {
    height: 50px;
    transform: rotate(35deg);
}

.brush-shape::before {
    content: "";
    position: absolute;
    left: 17px;
    top: 3px;
    width: 10px;
    height: 46px;
    border-radius: 999px;
    background: var(--leaf-dark);
}

.brush-shape::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 0;
    width: 26px;
    height: 18px;
    border-radius: 18px 18px 6px 6px;
    background: var(--petal);
}

.basket-shape {
    width: 52px;
    height: 35px;
    margin-top: 10px;
    border-radius: 8px 8px 16px 16px;
    background: #b9824b;
}

.basket-shape::before {
    content: "";
    position: absolute;
    left: 8px;
    top: -16px;
    width: 36px;
    height: 28px;
    border: 6px solid #9b6534;
    border-bottom: 0;
    border-radius: 30px 30px 0 0;
}

.gift-shape {
    width: 48px;
    height: 42px;
    margin-top: 8px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--rose) 0 39%, #fff4cf 39% 56%, var(--rose) 56% 100%);
}

.gift-shape::before {
    content: "";
    position: absolute;
    left: -4px;
    top: -9px;
    width: 56px;
    height: 13px;
    border-radius: 6px;
    background: var(--petal);
}

.found-list {
    display: flex;
    min-height: 42px;
    flex-wrap: wrap;
    gap: 8px;
}

.found-badge {
    padding: 9px 12px;
    border-radius: 999px;
    color: var(--leaf-dark);
    background: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    font-weight: 800;
}

.question-dialog {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: 50%;
    width: min(calc(100% - 28px), 440px);
    max-height: calc(100dvh - 24px);
    margin: 0;
    border: 0;
    border-radius: 26px;
    padding: 0;
    color: var(--ink);
    background: var(--paper);
    box-shadow: var(--shadow);
    overflow: auto;
    animation: dialog-pop 240ms ease both;
}

.question-dialog::backdrop {
    background: rgba(32, 48, 47, 0.46);
    backdrop-filter: blur(5px);
}

.question-card {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 22px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 253, 246, 0.94)),
        var(--paper);
}

.question-card h3 {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.05;
}

.question-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.question-card label,
.choice-form label {
    color: var(--leaf-dark);
    font-size: 0.9rem;
    font-weight: 900;
}

.answer-zone {
    display: grid;
    gap: 10px;
}

.question-card.reward-mode .answer-zone,
.question-card.reward-mode .ghost-action {
    display: none;
}

.question-card.reward-mode {
    text-align: center;
    overflow: hidden;
}

.question-card.reward-mode::after {
    content: "";
    position: absolute;
    inset: -40% 20%;
    background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.82), transparent);
    transform: rotate(20deg) translateX(-130%);
    animation: reward-shine 1.4s ease-out 160ms both;
    pointer-events: none;
}

.question-card.reward-mode .dialog-actions {
    grid-template-columns: 1fr;
}

.question-card.reward-mode h3::before {
    content: "Bravo !";
    display: block;
    margin-bottom: 8px;
    color: var(--rose);
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.question-card input,
.choice-form select,
.choice-form textarea {
    width: 100%;
    border: 2px solid #c7ded0;
    border-radius: 16px;
    padding: 14px 15px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

.question-card input:focus,
.choice-form select:focus,
.choice-form textarea:focus {
    border-color: var(--leaf);
    box-shadow: 0 0 0 4px rgba(63, 127, 97, 0.14);
}

.hint {
    min-height: 42px;
    color: var(--rose) !important;
    font-weight: 800;
}

.dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.final {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
}

.final-burst {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.final-burst span {
    position: absolute;
    width: 16px;
    height: 36px;
    border-radius: 999px;
    background: var(--petal);
    animation: floaty 2.8s ease-in-out infinite alternate;
}

.final-burst span:nth-child(1) {
    left: 9%;
    top: 15%;
}

.final-burst span:nth-child(2) {
    right: 12%;
    top: 13%;
    background: var(--sun);
    animation-delay: 0.4s;
}

.final-burst span:nth-child(3) {
    left: 20%;
    bottom: 18%;
    background: var(--water);
    animation-delay: 0.9s;
}

.final-burst span:nth-child(4) {
    right: 22%;
    bottom: 14%;
    background: var(--leaf);
    animation-delay: 0.2s;
}

.final-burst span:nth-child(5) {
    right: 42%;
    top: 8%;
    background: var(--rose);
    animation-delay: 0.7s;
}

.choice-form {
    position: relative;
    display: grid;
    gap: 10px;
    padding-top: 8px;
}

.choice-form textarea {
    resize: vertical;
}

.save-status {
    min-height: 26px;
    color: var(--leaf-dark) !important;
    font-weight: 900;
}

@keyframes floaty {
    from {
        transform: translateY(0) rotate(-10deg);
    }
    to {
        transform: translateY(18px) rotate(14deg);
    }
}

@keyframes screen-rise {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes gentle-bob {
    0%,
    100% {
        transform: translateY(0) rotate(-1deg);
    }
    50% {
        transform: translateY(-7px) rotate(2deg);
    }
}

@keyframes petal-drift {
    0% {
        transform: translate3d(0, -8vh, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translate3d(42px, 118vh, 0) rotate(420deg);
        opacity: 0;
    }
}

@keyframes garden-shimmer {
    from {
        opacity: 0.5;
        transform: translateY(0);
    }
    to {
        opacity: 0.86;
        transform: translateY(4px);
    }
}

@keyframes sun-glow {
    from {
        transform: scale(1);
        box-shadow: 0 0 0 14px rgba(246, 189, 80, 0.18);
    }
    to {
        transform: scale(1.04);
        box-shadow: 0 0 0 20px rgba(246, 189, 80, 0.12);
    }
}

@keyframes cloud-slide {
    from {
        transform: translateX(-8px);
    }
    to {
        transform: translateX(10px);
    }
}

@keyframes treasure-idle {
    0%,
    100% {
        translate: 0 0;
    }
    50% {
        translate: 0 -4px;
    }
}

@keyframes treasure-unlocked {
    0% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.16) rotate(2deg);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes burst-petal {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(0deg) scale(0.7);
    }
    to {
        opacity: 0;
        transform: translate(calc(-50% + var(--burst-dx)), calc(-50% + var(--burst-dy))) rotate(260deg) scale(1.1);
    }
}

@keyframes dialog-pop {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes reward-shine {
    to {
        transform: rotate(20deg) translateX(130%);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}

@media (max-width: 380px) {
    .app {
        padding: 12px;
    }

    .garden {
        min-height: 65vh;
        border-radius: 18px;
    }

    .treasure {
        width: 84px;
        min-height: 86px;
        border-radius: 18px;
        font-size: 0.76rem;
    }

    .flower-treasure {
        left: 16px;
    }

    .mug-treasure {
        right: 16px;
        top: 176px;
    }

    .brush-treasure {
        left: 18px;
    }

    .basket-treasure {
        right: 18px;
        bottom: 18px;
    }

    .gift-treasure {
        left: calc(50% - 42px);
    }
}
