/* Poppy's Letter Picnic — scene, characters and juice.
   Loads after gamekit.css (tokens + shared components). */

:root {
    --poppy-gold: #E8A828;
    --sky-top: #9BD7F5;
    --sky-mid: #C8E8FA;
    --sky-bot: #FFF8EC;
    --hill-back: #A2D149;
    --hill-front: #7CB518;
    --leaf-1: #5E9C1E;
    --leaf-2: #7CB518;
    --leaf-3: #A2D149;
    --sun-1: #FFD166;
    --sun-2: #FFE9A8;
    --cloud: #FFFFFF;
    --string: #8F5F30;
    --gc: var(--gk-blue);     /* current guest accent */
}

/* Sunset Feast (level 3) recolors the whole meadow */
body.lv3 {
    --sky-top: #F7975F;
    --sky-mid: #FFC98A;
    --sky-bot: #FFE9C4;
    --hill-back: #CBB050;
    --hill-front: #96A22F;
    --leaf-1: #6E8B22;
    --leaf-2: #86982C;
    --leaf-3: #B3AE48;
    --sun-1: #FFB25E;
    --sun-2: #FFD9A0;
    --cloud: #FFE3C2;
}

html, body { overflow: hidden; }

/* ══════════ SCENE LAYERS ══════════ */

#scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#scene > div { position: absolute; }

#sky {
    inset: 0;
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 52%, var(--sky-bot) 100%);
    transition: background 1.2s ease;
}

#sun {
    top: 72px; right: 2.5vw;
    width: clamp(110px, 16vw, 190px);
    height: clamp(110px, 16vw, 190px);
}
#sun svg { width: 100%; height: 100%; animation: sun-spin 90s linear infinite; }
@keyframes sun-spin { to { transform: rotate(1turn); } }

.cloud { top: 9vh; width: clamp(130px, 17vw, 220px); opacity: 0.95; }
.cloud svg { width: 100%; }
#cloud-a { animation: cloud-drift 75s linear infinite; animation-delay: -28s; }
#cloud-b { top: 20vh; width: clamp(100px, 13vw, 170px); animation: cloud-drift 105s linear infinite; animation-delay: -70s; }
@keyframes cloud-drift {
    from { transform: translateX(-260px); }
    to   { transform: translateX(calc(100vw + 260px)); }
}

#hills { left: 0; right: 0; bottom: 0; height: 72vh; }
#hills svg { width: 100%; height: 100%; }
.hill-back  { fill: var(--hill-back);  transition: fill 1.2s ease; }
.hill-front { fill: var(--hill-front); transition: fill 1.2s ease; }

#oak { left: -7vw; bottom: 46vh; width: clamp(170px, 23vw, 300px); }
#oak svg { width: 100%; }
.oak-1 { fill: var(--leaf-1); transition: fill 1.2s ease; }
.oak-2 { fill: var(--leaf-2); transition: fill 1.2s ease; }
.oak-3 { fill: var(--leaf-3); transition: fill 1.2s ease; }

#flowers { inset: 0; }
.flower {
    position: absolute;
    font-size: clamp(18px, 2.6vw, 30px);
    transform-origin: 50% 100%;
    animation: flower-sway 4.5s ease-in-out infinite;
    filter: drop-shadow(0 2px 2px rgba(90, 60, 30, 0.2));
}
@keyframes flower-sway {
    0%, 100% { transform: rotate(-6deg); }
    50%      { transform: rotate(6deg); }
}

#butterfly {
    position: absolute;
    top: 26vh; left: -60px;
    font-size: clamp(20px, 3vw, 32px);
    animation: butterfly-fly 46s linear infinite;
    animation-delay: -12s;
}
@keyframes butterfly-fly {
    0%   { transform: translate(0, 0) rotate(8deg); }
    10%  { transform: translate(12vw, -6vh) rotate(-10deg); }
    25%  { transform: translate(32vw, 2vh) rotate(10deg); }
    40%  { transform: translate(52vw, -8vh) rotate(-8deg); }
    55%  { transform: translate(70vw, -2vh) rotate(10deg); }
    70%  { transform: translate(85vw, -9vh) rotate(-10deg); }
    85%  { transform: translate(100vw, -4vh) rotate(8deg); }
    100% { transform: translate(115vw, -10vh) rotate(-8deg); }
}

#fireflies { inset: 0; display: none; }
body.lv3 #fireflies { display: block; }
.firefly {
    position: absolute;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle, #FFF3B0 0%, #FFD166 55%, transparent 75%);
    box-shadow: 0 0 10px 3px rgba(255, 220, 120, 0.65);
    animation: firefly-float 7s ease-in-out infinite alternate, gk-twinkle 2.6s ease-in-out infinite;
}
@keyframes firefly-float {
    from { transform: translate(0, 0); }
    to   { transform: translate(26px, -34px); }
}

/* Gingham picnic blanket, slight perspective */
#blanket {
    left: -2vw; right: -2vw; bottom: 0;
    height: 45vh;
    background-color: #FFF6F2;
    background-image:
        repeating-linear-gradient(0deg,  rgba(230, 57, 70, 0.55) 0 26px, transparent 26px 52px),
        repeating-linear-gradient(90deg, rgba(230, 57, 70, 0.55) 0 26px, transparent 26px 52px);
    clip-path: polygon(7% 0, 93% 0, 100% 100%, 0 100%);
}
#blanket::before { /* soft fold shadow along the top edge */
    content: '';
    position: absolute; left: 0; right: 0; top: 0; height: 18px;
    background: linear-gradient(180deg, rgba(90, 30, 30, 0.22), transparent);
}

/* Basket (bottom-right on the blanket) */
#basket-wrap {
    right: 1.5vw; bottom: 1vh;
    width: clamp(120px, 16vw, 190px);
    filter: drop-shadow(0 8px 10px rgba(90, 50, 20, 0.3));
}
#basket-wrap svg { width: 100%; }
.b-lid {
    transform-box: fill-box;
    transform-origin: 8% 85%;
    transition: transform 0.55s cubic-bezier(0.3, 1.4, 0.5, 1);
}
#basket-wrap.open .b-lid { transform: rotate(-108deg); }

/* ══════════ POPPY THE BEAR ══════════ */

#poppy-wrap {
    z-index: 8;
    width: clamp(120px, 15vw, 185px);
    transition: left 0.9s cubic-bezier(0.5, 0, 0.3, 1), bottom 0.9s ease, transform 0.9s ease;
    filter: drop-shadow(0 8px 12px rgba(90, 50, 20, 0.28));
}
.mode-start #poppy-wrap {
    left: 50%; bottom: 30vh;
    transform: translateX(-50%) scale(1.3);
    pointer-events: auto;   /* tap Poppy for a hello */
    cursor: pointer;
}
.mode-play #poppy-wrap {
    left: calc(100vw - clamp(120px, 16vw, 190px) - clamp(110px, 14vw, 170px) - 2.5vw);
    bottom: 1.2vh;
    transform: scale(1);
}
#poppy-hop svg { width: 100%; display: block; }
.mode-start #poppy-hop { animation: gk-bob 2.6s ease-in-out infinite; }
/* Poppy's 2-3s hop-in hello — plays once when the game opens, then settles to a bob. */
.intro.mode-start #poppy-hop {
    animation: poppy-hello-in 2.3s cubic-bezier(0.3, 0.7, 0.4, 1) both,
               gk-bob 2.6s ease-in-out 2.3s infinite;
}
@keyframes poppy-hello-in {
    0%   { transform: translateX(-150vw) translateY(0) rotate(-6deg); }
    32%  { transform: translateX(-52vw)  translateY(-46px) rotate(5deg); }
    50%  { transform: translateX(-24vw)  translateY(0) rotate(-4deg) scale(1.05, 0.92); }
    66%  { transform: translateX(-6vw)   translateY(-34px) rotate(3deg); }
    82%  { transform: translateX(0)      translateY(0) rotate(-2deg) scale(1.06, 0.9); }
    100% { transform: translateX(0)      translateY(0) rotate(0); }
}

/* Idle breathing while Poppy hosts the picnic (mode-play). */
#poppy-hop { transform-box: fill-box; transform-origin: 50% 100%; }
.mode-play #poppy-hop { animation: poppy-breathe 3.6s ease-in-out infinite; }
@keyframes poppy-breathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-3px) scale(1.015, 0.99); }
}

/* Eyes — idle blink + happy squint. */
.p-eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: poppy-blink 4.6s ease-in-out infinite; }
@keyframes poppy-blink {
    0%, 90%, 100% { transform: scaleY(1); }
    93%, 96%      { transform: scaleY(0.12); }
}
/* Ears — occasional twitchy fidget, offset so they never twitch in sync. */
.p-ear { transform-box: fill-box; transform-origin: 50% 100%; }
.p-ear-l { animation: poppy-ear 5.5s ease-in-out infinite; }
.p-ear-r { animation: poppy-ear 6.7s ease-in-out 1.2s infinite; }
@keyframes poppy-ear {
    0%, 86%, 100% { transform: rotate(0deg); }
    90%           { transform: rotate(-9deg); }
    94%           { transform: rotate(5deg); }
}

.p-arm { transform-box: fill-box; transform-origin: 50% 14%; }
.mode-start .p-arm-r { animation: poppy-wave 1.9s ease-in-out infinite; }
@keyframes poppy-wave {
    0%, 100% { transform: rotate(0deg); }
    40%      { transform: rotate(-62deg); }
    55%      { transform: rotate(-46deg); }
    70%      { transform: rotate(-66deg); }
}
.poppy.clap .p-arm-l { animation: poppy-clap-l 0.42s ease-in-out 2; }
.poppy.clap .p-arm-r { animation: poppy-clap-r 0.42s ease-in-out 2; }
@keyframes poppy-clap-l { 50% { transform: rotate(58deg) translateY(-6px); } }
@keyframes poppy-clap-r { 50% { transform: rotate(-58deg) translateY(-6px); } }
.poppy.cheer { animation: poppy-cheer 0.55s cubic-bezier(0.3, 1.5, 0.5, 1) 4 alternate; }
@keyframes poppy-cheer {
    from { transform: translateY(0) rotate(-2deg); }
    to   { transform: translateY(-26px) rotate(2deg); }
}

/* Happy bounce (correct) — squash-and-stretch + a big smiley squint. */
.poppy { transform-origin: 50% 100%; }
.poppy.happy { animation: poppy-happy 0.66s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes poppy-happy {
    0%   { transform: translateY(0) scale(1); }
    28%  { transform: translateY(-18px) scale(1.09, 0.92); }
    52%  { transform: translateY(0) scale(0.95, 1.07); }
    72%  { transform: translateY(-6px) scale(1.02, 0.98); }
    100% { transform: translateY(0) scale(1); }
}
.poppy.happy .p-eyes { animation: poppy-happy-eyes 0.66s ease-in-out; }
@keyframes poppy-happy-eyes {
    0%, 100% { transform: scaleY(1); }
    35%, 70% { transform: scaleY(0.28); }
}
/* Gentle encourage (wrong) — a caring head-tilt, warm and never sad. */
.poppy.encourage { animation: poppy-encourage 0.76s ease-in-out; }
@keyframes poppy-encourage {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    25%      { transform: rotate(-5deg) translateY(-3px); }
    62%      { transform: rotate(4deg) translateY(-1px); }
}
.poppy.encourage .p-eyes { animation: poppy-blink 0.76s ease-in-out; }

/* Poppy's hello speech bubble on the start screen. */
#poppy-hello {
    position: absolute;
    left: 50%; top: -22%;
    transform: translateX(-50%) scale(0);
    transform-origin: 50% 120%;
    background: #FFF;
    color: var(--gk-text);
    font-weight: bold;
    font-size: clamp(0.72rem, 1.5vw, 0.92rem);
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(90, 60, 130, 0.24);
    pointer-events: none;
}
#poppy-hello::after {
    content: '';
    position: absolute;
    bottom: -9px; left: 50%;
    margin-left: -8px;
    width: 18px; height: 14px;
    background: #FFF;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.mode-start #poppy-hello { animation: poppy-hello-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) 2.2s both; }
.mode-play #poppy-hello { display: none; }
@keyframes poppy-hello-pop {
    from { transform: translateX(-50%) scale(0); }
    60%  { transform: translateX(-50%) scale(1.12); }
    to   { transform: translateX(-50%) scale(1); }
}

/* ══════════ GARLAND ══════════ */

#garland {
    position: fixed;
    left: 0; right: 0; top: 0;
    height: 150px;
    z-index: 12;
    pointer-events: none;
}
#garland-string { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 90px; }
#pennants { position: absolute; inset: 0; }
.pennant {
    position: absolute;
    width: clamp(38px, 4.6vw, 50px);
    height: clamp(46px, 5.6vw, 60px);
    margin-left: calc(clamp(38px, 4.6vw, 50px) / -2);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    background: rgba(255, 255, 255, 0.42);
    display: flex;
    justify-content: center;
    padding-top: 5px;
    font-weight: bold;
    font-size: clamp(1.15rem, 2.4vw, 1.6rem);
    color: #FFF;
    text-shadow: 0 2px 3px rgba(60, 30, 60, 0.35);
    transform-origin: 50% 0;
    animation: pennant-sway 4s ease-in-out infinite;
}
.pennant:nth-child(2n) { animation-delay: -2s; }
.pennant:nth-child(3n) { animation-delay: -1.2s; }
@keyframes pennant-sway {
    0%, 100% { transform: rotate(-4deg); }
    50%      { transform: rotate(4deg); }
}
.pennant.won { background: var(--pc, var(--gk-blue)); animation: pennant-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1), pennant-sway 4s ease-in-out 0.5s infinite; }
/* On the start screen the garland wears festive rainbow bunting */
.pennant.deco { background: var(--pc, var(--gk-blue)); }
.mode-start .pennant { animation: none; transform: scale(0.74) rotate(-3deg); opacity: 0.95; }
.mode-start .pennant:nth-child(2n) { transform: scale(0.74) rotate(4deg); }
@keyframes pennant-pop {
    from { transform: scale(0.2) rotate(-20deg); }
    to   { transform: scale(1) rotate(0deg); }
}
#garland.sway .pennant { animation: pennant-sway 0.9s ease-in-out infinite; }

.fly-letter {
    position: fixed;
    z-index: 60;
    font-weight: bold;
    line-height: 1;
    pointer-events: none;
    text-shadow: 0 3px 6px rgba(60, 30, 60, 0.3);
}

/* ══════════ GUEST + SPEECH BUBBLE ══════════ */

#guest-zone {
    position: fixed;
    left: 5vw;
    bottom: 41vh;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    pointer-events: none;
}
.mode-start #guest-zone, .mode-start #plates { display: none; }

#bubble-wrap {
    position: relative;
    margin-left: clamp(30px, 5vw, 80px);
    margin-bottom: 20px;
    opacity: 0;
    visibility: hidden; /* never an invisible tap target between guests */
    transform: scale(0.3);
    transition: opacity 0.25s, transform 0.3s cubic-bezier(0.2, 1.5, 0.4, 1),
                visibility 0s 0.3s;
    pointer-events: auto;
}
#bubble-wrap.show { opacity: 1; visibility: visible; transform: scale(1); transition-delay: 0s; }

#bubble {
    position: relative;
    min-width: clamp(120px, 15vh, 165px);
    min-height: clamp(104px, 15vh, 150px);
    padding: 6px 26px 10px;
    background: #FFF;
    border: none;
    border-radius: 28px;
    box-shadow: 0 8px 22px rgba(90, 60, 130, 0.25);
    cursor: pointer;
    transition: transform 0.15s;
}
#bubble:active { transform: scale(0.95); }
#bubble::after { /* fat rounded tail toward the guest */
    content: '';
    position: absolute;
    bottom: -17px; left: 30px;
    width: 34px; height: 26px;
    background: #FFF;
    clip-path: polygon(0 0, 100% 0, 26% 100%);
}
#bubble-letter {
    display: block;
    font-size: clamp(64px, 12vh, 106px);
    font-weight: bold;
    line-height: 1.05;
    color: var(--gc);
}
#bubble-letter.bounce { animation: letter-bounce 0.55s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes letter-bounce {
    0%   { transform: scale(0) rotate(-25deg); }
    70%  { transform: scale(1.2) rotate(6deg); }
    100% { transform: scale(1) rotate(0deg); }
}
#bubble.pulse { animation: bubble-pulse 0.55s ease-in-out 2; }
@keyframes bubble-pulse {
    50% { transform: scale(1.1); box-shadow: 0 8px 30px rgba(230, 57, 70, 0.4); }
}
#bubble-hint {
    position: absolute;
    top: 8px; right: 12px;
    font-size: clamp(1rem, 2.4vh, 1.4rem);
    font-weight: bold;
    color: #B9B3C8;
}
#ear-btn {
    position: absolute;
    right: -22px; bottom: -16px;
    width: 64px; height: 64px;
    border: none;
    border-radius: 50%;
    background: var(--gk-yellow);
    box-shadow: 0 5px 14px rgba(160, 110, 20, 0.4);
    font-size: 1.7rem;
    cursor: pointer;
    transition: transform 0.15s;
}
#ear-btn:hover  { transform: scale(1.08); }
#ear-btn:active { transform: scale(0.9); }

#guest-slot { height: clamp(140px, 25vh, 210px); }
.guest-wrap { height: 100%; }
.guest-wrap svg { height: 100%; display: block; filter: drop-shadow(0 7px 9px rgba(80, 60, 30, 0.25)); }
.guest-wrap.enter { animation: guest-hop-in 0.85s cubic-bezier(0.3, 0.7, 0.4, 1) backwards; }
@keyframes guest-hop-in {
    0%   { transform: translateX(-52vw) translateY(0); }
    18%  { transform: translateX(-40vw) translateY(-52px); }
    36%  { transform: translateX(-27vw) translateY(0) scale(1.06, 0.9); }
    46%  { transform: translateX(-22vw) translateY(-42px) scale(1); }
    64%  { transform: translateX(-10vw) translateY(0) scale(1.06, 0.9); }
    74%  { transform: translateX(-6vw) translateY(-30px) scale(1); }
    90%  { transform: translateX(0) translateY(0) scale(1.1, 0.86); }
    100% { transform: translateX(0) translateY(0) scale(1); }
}
.guest-wrap.exit { animation: guest-hop-out 0.7s ease-in forwards; }
@keyframes guest-hop-out {
    0%   { transform: translateX(0) translateY(0); }
    22%  { transform: translateX(8vw) translateY(-44px) scaleX(-1) rotate(3deg); }
    45%  { transform: translateX(22vw) translateY(0) scaleX(-1); }
    65%  { transform: translateX(36vw) translateY(-38px) scaleX(-1); }
    100% { transform: translateX(70vw) translateY(-4px) scaleX(-1); }
}

.g-head { transform-box: fill-box; transform-origin: 50% 78%; transition: transform 0.3s ease; }
.guest.oops .g-head { transform: rotate(9deg); }
.g-arm { transform-box: fill-box; transform-origin: 50% 12%; transition: transform 0.3s ease; }
.guest.oops .g-arm-r { transform: rotate(-95deg); }
.m-open { opacity: 0; }
.guest.chomp .m-open  { opacity: 1; }
.guest.chomp .m-closed { opacity: 0; }
.guest.chomp .g-head { animation: chomp-bob 0.3s ease-in-out; }
@keyframes chomp-bob {
    50% { transform: translateY(5px) scale(1.04); }
}

/* ══════════ PLATES ══════════ */

#plates {
    position: fixed;
    left: clamp(10px, 12vw, 200px);
    /* keep clear of Poppy + basket in the host corner */
    right: calc(clamp(120px, 16vw, 190px) + clamp(110px, 14vw, 170px) + 4.5vw);
    bottom: 10vh;
    z-index: 30;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(6px, 1.6vw, 24px);
    pointer-events: none;
}
.plate {
    position: relative;
    flex: 0 1 clamp(110px, 12vw, 160px);
    min-width: 92px;
    min-height: 108px;
    padding: 4px 0 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    pointer-events: auto;
    transition: transform 0.15s;
}
.plate.deal { animation: deal-in 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) backwards; }
.plate:hover .food  { transform: translateY(-5px) scale(1.06); }
.plate:active       { transform: scale(0.94); }
@keyframes deal-in {
    from { opacity: 0; transform: scale(0.1) translateY(60px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.plate .food {
    font-size: clamp(50px, 6vw, 72px);
    line-height: 1;
    margin-bottom: -16px;
    z-index: 2;
    transition: transform 0.2s;
    filter: drop-shadow(0 4px 5px rgba(90, 40, 20, 0.3));
}
.plate svg { width: 92%; }
.plate.wrong { animation: plate-wiggle 0.6s ease-in-out; }
@keyframes plate-wiggle {
    0%, 100% { transform: translateX(0) rotate(0); }
    20% { transform: translateX(-10px) rotate(-5deg); }
    40% { transform: translateX(9px) rotate(4deg); }
    60% { transform: translateX(-7px) rotate(-3deg); }
    80% { transform: translateX(5px) rotate(2deg); }
}
.plate.hint .food { animation: hint-bounce 0.9s ease-in-out infinite; }
.plate.hint::before {
    content: '';
    position: absolute;
    inset: 4px 6px 12px;
    border-radius: 50%;
    box-shadow: 0 0 0 6px rgba(255, 200, 40, 0.95), 0 0 30px 14px rgba(255, 205, 60, 0.6);
    animation: hint-glow 0.9s ease-in-out infinite;
    pointer-events: none;
}
@keyframes hint-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-14px) scale(1.12); }
}
@keyframes hint-glow {
    0%, 100% { opacity: 0.45; }
    50%      { opacity: 1; }
}

.fly-food {
    position: fixed;
    z-index: 60;
    line-height: 1;
    pointer-events: none;
    filter: drop-shadow(0 4px 5px rgba(90, 40, 20, 0.3));
}
.crumb {
    position: fixed;
    z-index: 61;
    width: 10px; height: 10px;
    border-radius: 50%;
    pointer-events: none;
}

/* ══════════ FINALE ══════════ */

#finale-line {
    position: fixed;
    left: 4vw; right: 18vw;
    bottom: 7vh;
    z-index: 25;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(2px, 1vw, 16px);
    pointer-events: none;
}
.mini-guest { height: clamp(90px, 16vh, 150px); animation: mini-dance 0.5s ease-in-out infinite alternate; }
.mini-guest svg { height: 100%; filter: drop-shadow(0 5px 7px rgba(80, 60, 30, 0.25)); }
@keyframes mini-dance {
    from { transform: translateY(0) rotate(-4deg); }
    to   { transform: translateY(-22px) rotate(4deg); }
}
.burst-food {
    position: fixed;
    z-index: 62;
    font-size: 2rem;
    line-height: 1;
    pointer-events: none;
}

/* ══════════ START SCREEN ══════════ */

#start-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: max(10vh, 88px) 16px max(2.5vh, 14px);
    pointer-events: none;
    text-align: center;
}
.mode-play #start-screen { display: none; }
#start-screen button { pointer-events: auto; }

#start-top { position: relative; }
#game-title {
    font-size: clamp(2.3rem, 6.5vw, 3.8rem);
    line-height: 1.05;
    background: linear-gradient(90deg, var(--gk-red), var(--gk-orange), var(--gk-yellow), var(--gk-green), var(--gk-blue), var(--gk-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(74, 59, 92, 0.25);
    filter: drop-shadow(0 3px 0 rgba(255, 255, 255, 0.92));
}
#tagline {
    margin-top: 8px;
    font-size: clamp(1rem, 2.6vw, 1.3rem);
    font-weight: bold;
    color: var(--gk-text);
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.85);
}
.title-spark { position: absolute; font-size: 1.6rem; }
.title-spark.s1 { left: -34px; top: -8px; }
.title-spark.s2 { right: -34px; bottom: 2px; animation-delay: -1.1s; }

#start-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
#btn-start { font-size: clamp(1.3rem, 4vw, 1.7rem); padding: 16px 52px; }

#star-row {
    background: rgba(255, 255, 255, 0.88);
    border-radius: 40px;
    padding: 8px 24px;
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(90, 60, 130, 0.18);
}
#level-row { display: flex; gap: 14px; }
.lvl-btn {
    width: 66px; height: 66px;
    border: 4px solid transparent;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 4px 12px rgba(90, 60, 130, 0.2);
    font-family: inherit;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--gk-text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.05;
    transition: transform 0.15s, border-color 0.2s;
}
.lvl-btn:active { transform: scale(0.92); }
.lvl-btn .lvl-stars { font-size: 0.62rem; letter-spacing: -1px; }
.lvl-btn.selected { border-color: var(--gk-green); transform: scale(1.12); }
.lvl-btn.locked { opacity: 0.65; filter: grayscale(0.5); }
.lvl-btn.pop { animation: lvl-pop 0.7s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes lvl-pop {
    30% { transform: scale(1.45) rotate(8deg); }
}

/* ══════════ GROWN-UPS ══════════ */

#info-btn {
    position: fixed;
    left: 14px; bottom: 14px;
    z-index: 120;
    width: 58px; height: 58px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 12px rgba(90, 60, 130, 0.25);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.15s;
}
#info-btn:hover  { transform: scale(1.1); }
#info-btn:active { transform: scale(0.9); }
.mode-play #info-btn { display: none; } /* mid-game it lives in the HUD instead */

#info-overlay {
    position: fixed;
    inset: 0;
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(74, 59, 92, 0.45);
    animation: gk-fade-in 0.25s ease-out;
    padding: 18px;
}
#info-card {
    max-width: 540px;
    max-height: 86vh;
    overflow-y: auto;
    text-align: center;
    animation: gk-pop-in 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}
#info-card h2 { color: var(--gk-orange); margin-bottom: 10px; font-size: clamp(1.3rem, 4vw, 1.7rem); }
#info-card p { margin: 10px 0; font-size: clamp(0.95rem, 2.6vw, 1.1rem); line-height: 1.45; text-align: left; }
#info-card .info-tip {
    background: #FFF3D6;
    border-radius: 14px;
    padding: 10px 14px;
}
#info-close { margin-top: 8px; }

/* ══════════ RESPONSIVE ══════════ */

@media (orientation: portrait) {
    #guest-zone { bottom: 52vh; left: 4vw; }
    #guest-slot { height: clamp(130px, 20vh, 190px); }
    #plates {
        left: 3vw; right: 3vw;
        bottom: 16vh;
        flex-wrap: wrap;
    }
    .plate { flex: 0 0 clamp(106px, 17vw, 150px); }
    #oak { bottom: 51vh; left: -10vw; width: clamp(160px, 30vw, 260px); }
    #hills { height: 76vh; }
    #blanket { height: 49vh; }
    .mode-play #poppy-wrap {
        left: auto;
        right: calc(clamp(100px, 16vw, 150px) + 3vw);
        bottom: 0.5vh;
        transform: scale(0.82);
        transform-origin: 100% 100%;
    }
    #basket-wrap { right: 2vw; bottom: 0.8vh; width: clamp(100px, 16vw, 150px); }
    #finale-line { right: 4vw; bottom: 16vh; }
}

@media (max-height: 800px) and (orientation: landscape) {
    #guest-slot { height: clamp(130px, 23vh, 185px); }
    #bubble-wrap { margin-bottom: 14px; }
}

/* ══════════ CALM MODE ══════════ */

@media (prefers-reduced-motion: reduce) {
    .cloud, #sun svg, .flower, #butterfly, .firefly, .pennant,
    .mode-start #poppy-hop, .intro.mode-start #poppy-hop, .mode-play #poppy-hop,
    .mode-start .p-arm-r, .mini-guest,
    .p-eyes, .p-ear-l, .p-ear-r,
    .poppy.happy, .poppy.happy .p-eyes, .poppy.encourage, .poppy.encourage .p-eyes { animation: none !important; }
    .guest-wrap.enter { animation-duration: 0.01s; }
    .guest-wrap.exit  { animation-duration: 0.01s; }
    /* Keep Poppy's hello bubble legible without its pop-in animation. */
    .mode-start #poppy-hello { animation: none; transform: translateX(-50%) scale(1); }
}
