/* Willa's Weather Wardrobe — bedroom scene, dresser, weather stage, Willa rig */

#stage {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: #FFF8EC;
}

.screen { position: absolute; inset: 0; z-index: 15; }

/* ══ bedroom layers ══════════════════════════════════════════════════════ */

#bedroom { position: absolute; inset: 0; pointer-events: none; }

#wallpaper {
    position: absolute; inset: 0 0 42% 0;
    background:
        radial-gradient(58px 34px at 24% 26%, rgba(255,255,255,0.5) 58%, transparent 62%),
        radial-gradient(44px 26px at 70% 14%, rgba(255,255,255,0.42) 58%, transparent 62%),
        radial-gradient(50px 30px at 88% 44%, rgba(255,255,255,0.45) 58%, transparent 62%),
        radial-gradient(40px 24px at 48% 52%, rgba(255,255,255,0.35) 58%, transparent 62%),
        linear-gradient(180deg, #FFF8EC 0%, #FFEFDC 55%, #FFE8D6 100%);
}

#floor {
    position: absolute; inset: 58% 0 0 0;
    background:
        repeating-linear-gradient(90deg, transparent 0 132px, rgba(165, 109, 56, 0.22) 132px 135px),
        linear-gradient(180deg, #F5C996 0%, #EFB578 35%, #E09B5C 100%);
    box-shadow: 0 -6px 18px rgba(165, 109, 56, 0.28);
}

#rug {
    position: absolute;
    left: 76%; bottom: 4.5%;
    width: clamp(240px, 42vmin, 400px);
    aspect-ratio: 3 / 0.9;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 42%, #FFDFC8 0%, #FAC49A 62%, #F2AE7E 100%);
    box-shadow: inset 0 0 0 6px rgba(201, 138, 75, 0.35), 0 6px 14px rgba(165, 109, 56, 0.25);
    transition: left 0.8s ease, bottom 0.8s ease, width 0.8s ease;
}
#stage.on-play #rug { left: 53%; bottom: 24.5%; width: clamp(240px, 44vmin, 420px); }

/* window ── */
#window-unit {
    position: absolute;
    left: 4%; top: 6%;
    width: clamp(190px, 24vw, 300px);
    aspect-ratio: 5 / 6;
    filter: drop-shadow(0 10px 22px rgba(90, 60, 130, 0.22));
}
#window-sky {
    position: absolute; inset: 10px;
    border-radius: 10px;
    overflow: hidden;
}
#window-sky svg { width: 100%; height: 100%; display: block; }
#window-sky.sky-sunny { background: linear-gradient(180deg, #FFE9A8 0%, #FFF6D8 100%); }
#window-sky.sky-rainy { background: linear-gradient(180deg, #6E93B8 0%, #8FB8D8 60%, #AECDE8 100%); }
#window-sky.sky-snowy { background: linear-gradient(180deg, #9FBEDF 0%, #C7DCEF 55%, #E8F2FA 100%); }
#window-sky.sky-windy { background: linear-gradient(180deg, #9FD8B8 0%, #B8E0C8 60%, #DFF2E5 100%); }

#window-frame {
    position: absolute; inset: 0;
    border: 11px solid #C98A4B;
    border-radius: 16px;
    box-shadow: inset 0 0 0 4px #A56D38, inset 0 0 26px rgba(74, 59, 92, 0.28);
    pointer-events: none;
    z-index: 3;
}
#window-frame::before { /* horizontal muntin */
    content: ''; position: absolute; left: 0; right: 0; top: 46%;
    height: 9px; background: #C98A4B; box-shadow: 0 2px 0 #A56D38;
}
#window-frame::after { /* sill */
    content: ''; position: absolute; left: -7%; right: -7%; bottom: -18px;
    height: 16px; background: linear-gradient(180deg, #E8A868, #C98A4B);
    border-radius: 8px; box-shadow: 0 4px 8px rgba(74, 59, 92, 0.25);
}

#curtain-rod {
    position: absolute; left: -5%; right: -5%; top: -12px; height: 10px;
    background: linear-gradient(180deg, #B565D8, #8F49B0);
    border-radius: 5px; z-index: 5;
}
#curtain-rod::before, #curtain-rod::after {
    content: ''; position: absolute; top: -4px; width: 18px; height: 18px;
    border-radius: 50%; background: #FCBF49; box-shadow: inset -3px -3px 0 rgba(0,0,0,0.15);
}
#curtain-rod::before { left: -8px; } #curtain-rod::after { right: -8px; }

.curtain {
    position: absolute; top: 2px; bottom: 6%; width: 60%;
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,0.16) 0 12px, transparent 12px 30px),
        linear-gradient(180deg, #FF9FC4 0%, #F480AE 70%, #E76D9E 100%);
    border: 4px solid rgba(74, 59, 92, 0.55);
    border-radius: 8px 8px 42% 42%;
    z-index: 4;
    transition: transform 0.7s cubic-bezier(0.6, 0, 0.3, 1.15);
}
.curtain-l { left: 0; transform-origin: left center; transform: scaleX(0.16); }
.curtain-r { right: 0; transform-origin: right center; transform: scaleX(0.16); }
#window-unit.closed .curtain-l, #window-unit.closed .curtain-r { transform: scaleX(0.92); }

/* weather bubble tag pinned to the window */
#weather-bubble {
    position: absolute;
    left: calc(4% + clamp(190px, 24vw, 300px) - 26px);
    top: 11%;
    width: clamp(52px, 8vmin, 72px); height: clamp(52px, 8vmin, 72px);
    background: #fff; border-radius: 50% 50% 50% 12%;
    box-shadow: 0 6px 16px rgba(90, 60, 130, 0.3);
    padding: 6px; z-index: 16;
    animation: gk-bob 2.6s ease-in-out infinite;
}
#weather-bubble svg { width: 100%; height: 100%; }

/* wall decor ── */
#wall-shelf { position: absolute; right: 4%; top: 19%; width: clamp(140px, 17vw, 230px); }
#wall-frame { position: absolute; right: 23%; top: 15%; width: clamp(90px, 11vw, 150px); transform: rotate(-3deg); }
#wall-shelf svg, #wall-frame svg, #plant svg, #bunting svg { width: 100%; height: auto; display: block; }

#bunting { position: absolute; top: -6px; left: -2%; right: -2%; z-index: 12; }
.bunt-flag { transform-box: fill-box; transform-origin: center top; animation: flag-sway 3.4s ease-in-out infinite; }
.bunt-flag:nth-child(even) { animation-delay: -1.7s; }
@keyframes flag-sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

#plant {
    position: absolute; left: -42px; bottom: -32px;
    width: clamp(130px, 18vmin, 210px);
    z-index: 40; pointer-events: none;
    filter: drop-shadow(0 8px 12px rgba(74, 59, 92, 0.25));
    animation: plant-sway 5s ease-in-out infinite;
    transform-origin: bottom center;
}
@keyframes plant-sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }

#vignette-shade {
    position: absolute; inset: 0; z-index: 7; pointer-events: none;
    background: radial-gradient(ellipse at 50% 42%, transparent 52%, rgba(74, 59, 92, 0.16) 100%);
}

/* ══ Willa ═══════════════════════════════════════════════════════════════ */

#willa-home {
    position: absolute;
    left: 76%; bottom: 4%;
    width: clamp(180px, 28vmin, 300px);
    transform: translateX(-50%);
    z-index: 8;
    pointer-events: none;
    transition: left 0.8s ease, bottom 0.8s ease, width 0.8s ease;
}
#stage.on-play #willa-home { left: 53%; bottom: 26%; width: clamp(175px, 31vmin, 290px); }

.willa-svg { width: 100%; height: auto; display: block; overflow: visible; }

.w-breathe { animation: breathe 2.8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

.w-lid { transform: scaleY(0); transform-box: fill-box; transform-origin: center top; animation: blink 4.4s infinite; }
.w-eye:last-of-type .w-lid { animation-delay: 0.05s; }
@keyframes blink {
    0%, 91%, 98%, 100% { transform: scaleY(0); }
    93.5%, 95.5% { transform: scaleY(1); }
}

.ear-in { transform-box: fill-box; transform-origin: center 90%; animation: ear-twitch 5.6s ease-in-out infinite; }
.w-ear-r .ear-in { animation-delay: -2.6s; }
@keyframes ear-twitch { 0%, 88%, 100% { transform: rotate(0); } 91% { transform: rotate(-9deg); } 94% { transform: rotate(5deg); } }

.w-sweat, .w-drip { opacity: 0; }

/* poses */
#willa-home.pose-shiver .w-rig { animation: shiver 0.16s linear infinite; }
@keyframes shiver { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }

#willa-home.pose-fan .w-arm-r { transform-box: fill-box; transform-origin: center 85%; animation: fan-arm 0.45s ease-in-out infinite; }
#willa-home.pose-fan .w-sweat { opacity: 1; }
#willa-home.pose-fan .w-sweat path { transform-box: fill-box; transform-origin: center; animation: sweat-pop 0.9s ease-out infinite; }
@keyframes fan-arm { 0%, 100% { transform: rotate(-46deg); } 50% { transform: rotate(-88deg); } }
@keyframes sweat-pop { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }

#willa-home.pose-brace .w-rig { animation: brace-lean 0.9s ease-in-out infinite; }
#willa-home.pose-brace .ear-in { animation: ear-flap 0.4s ease-in-out infinite; }
@keyframes brace-lean { 0%, 100% { transform: rotate(-4deg) translateX(-4px); } 50% { transform: rotate(-7deg) translateX(-8px); } }
@keyframes ear-flap { 0%, 100% { transform: rotate(-16deg); } 50% { transform: rotate(10deg); } }

#willa-home.pose-catch .w-arm-l { transform-box: fill-box; transform-origin: center 85%; transform: rotate(70deg); }
#willa-home.pose-catch .w-drip { opacity: 1; }
#willa-home.pose-catch .w-drip circle { transform-box: fill-box; transform-origin: center; animation: drip-fall 1s linear infinite; }
@keyframes drip-fall { 0% { transform: translateY(-56px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(8px); opacity: 0.2; } }

#willa-home.hop .w-rig { animation: hop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes hop {
    0%, 100% { transform: translateY(0) scale(1, 1); }
    25% { transform: translateY(2px) scale(1.06, 0.92); }
    60% { transform: translateY(-26px) scale(0.96, 1.06); }
}

#willa-home.wave .w-arm-r { transform-box: fill-box; transform-origin: center 85%; animation: wave-arm 0.6s ease-in-out infinite; }
@keyframes wave-arm { 0%, 100% { transform: rotate(-120deg); } 50% { transform: rotate(-160deg); } }

#willa-home.twirl .w-rig { animation: twirl 1.2s ease-in-out; }
@keyframes twirl {
    0% { transform: scaleX(1) translateY(0); }
    25% { transform: scaleX(-1) translateY(-14px); }
    50% { transform: scaleX(1) translateY(0); }
    75% { transform: scaleX(-1) translateY(-14px); }
    100% { transform: scaleX(1) translateY(0); }
}

/* wrong-pick face is a GIGGLE, never a frown */
#willa-home.gagging .w-mouth { d: path('M138,148 Q150,166 162,148 Z'); fill: #7A4A3A; }

/* worn clothing pop + gag wobble */
.worn-pop { transform-box: fill-box; transform-origin: center; animation: pop-land 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
.worn-pop.worn-gag { animation: pop-land 0.45s cubic-bezier(0.2, 1.6, 0.4, 1), gag-wobble 0.75s ease-in-out 0.4s; }
@keyframes pop-land { 0% { transform: scale(1.5, 0.6); } 55% { transform: scale(0.85, 1.2); } 100% { transform: scale(1, 1); } }
@keyframes gag-wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 50% { transform: rotate(8deg); } 75% { transform: rotate(-5deg); } }

/* ══ TITLE ═══════════════════════════════════════════════════════════════ */

#screen-title {
    display: flex; flex-direction: column; align-items: center;
    padding-top: clamp(38px, 7vh, 70px);
    gap: clamp(10px, 2.4vh, 26px);
}

#title-art { position: relative; text-align: center; }

#game-title {
    font-size: clamp(2rem, 6.2vmin, 3.6rem);
    line-height: 1.06;
    background: linear-gradient(92deg, #E63946, #F77F00, #FCBF49, #7CB518, #00B4D8, #B565D8);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    filter: drop-shadow(0 3px 0 rgba(255,255,255,0.9)) drop-shadow(0 6px 10px rgba(90,60,130,0.28));
    animation: title-pop 0.8s cubic-bezier(0.2, 1.5, 0.4, 1);
}
@keyframes title-pop { from { transform: scale(0.6) rotate(-3deg); opacity: 0; } to { transform: scale(1); opacity: 1; } }

#orbit-icons {
    display: flex; justify-content: center; gap: clamp(10px, 2vw, 22px);
    margin-top: clamp(8px, 1.6vh, 16px);
}
.orbit-chip {
    width: clamp(44px, 6.4vmin, 62px); height: clamp(44px, 6.4vmin, 62px);
    background: rgba(255, 255, 255, 0.92); border-radius: 50%; padding: 6px;
    box-shadow: 0 5px 12px rgba(90, 60, 130, 0.22);
    animation: gk-bob 2.6s ease-in-out infinite;
}
.orbit-chip svg { width: 100%; height: 100%; display: block; }
.orbit-1 { animation-delay: -0.7s; }
.orbit-2 { animation-delay: -1.3s; }
.orbit-3 { animation-delay: -2s; }

/* NOTE: buttons keep stable bounding boxes (no transform loops) so taps
   always land; the life comes from box-shadow pulses and inner motion. */
#btn-play {
    min-height: 84px; min-width: 240px;
    font-size: clamp(1.5rem, 4.6vmin, 2.1rem);
    animation: play-pulse 1.6s ease-in-out infinite;
    z-index: 16;
}
@keyframes play-pulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(124, 181, 24, 0.4), 0 0 0 0 rgba(124, 181, 24, 0.5); }
    50% { box-shadow: 0 6px 26px rgba(124, 181, 24, 0.55), 0 0 0 14px rgba(124, 181, 24, 0); }
}

#level-row { display: flex; gap: clamp(12px, 2.4vw, 26px); z-index: 16; }

.lv-btn {
    position: relative;
    width: clamp(78px, 11vmin, 104px); height: clamp(78px, 11vmin, 104px);
    border: 4px solid #C98A4B;
    border-radius: 26px;
    background: linear-gradient(180deg, #FFFDF6, #FFF0DB);
    box-shadow: 0 6px 16px rgba(90, 60, 130, 0.2);
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.lv-btn:hover { transform: translateY(-3px) scale(1.04); }
.lv-btn.selected { border-color: #7CB518; box-shadow: 0 0 0 5px rgba(124, 181, 24, 0.35), 0 6px 16px rgba(90, 60, 130, 0.2); }
.lv-art { width: 56%; height: 56%; display: block; }
.lv-art svg { width: 100%; height: 100%; }
.lv-art.lv-grid { display: grid; grid-template-columns: 1fr 1fr; width: 66%; height: 66%; }
.lv-num {
    font-weight: bold; font-size: clamp(0.95rem, 2.4vmin, 1.2rem); color: #4A3B5C;
    background: #FCBF49; border-radius: 12px; padding: 0 10px; margin-top: 2px;
}
.lv-lock {
    display: none;
    position: absolute; inset: 0;
    background: rgba(255, 248, 236, 0.72);
    border-radius: 22px;
    font-size: 2rem;
    align-items: center; justify-content: center;
}
.lv-btn.locked .lv-lock { display: flex; }
.lv-btn.locked { filter: saturate(0.4); }
.lv-btn.shake { animation: lock-shake 0.45s; }
@keyframes lock-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px) rotate(-3deg); } 60% { transform: translateX(7px) rotate(3deg); } }
.lv-btn.just-unlocked { animation: unlock-pop 0.9s cubic-bezier(0.2, 1.6, 0.4, 1) 2; border-color: #FCBF49; }
@keyframes unlock-pop { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.18) rotate(4deg); } }

#star-shelf {
    min-height: 44px;
    font-size: clamp(1.3rem, 3.4vmin, 1.8rem);
    background: rgba(255, 255, 255, 0.82);
    border-radius: 30px; padding: 6px 22px;
    box-shadow: 0 4px 12px rgba(90, 60, 130, 0.16);
    z-index: 16;
    display: flex; align-items: center;
}
.star-hint { font-size: 1.05rem; color: #8a7a9c; }

/* ══ PLAY ════════════════════════════════════════════════════════════════ */

#day-pips { position: absolute; top: 14px; left: 14px; display: flex; gap: 8px; z-index: 30; }
.pip {
    width: clamp(42px, 5.6vmin, 52px); height: clamp(42px, 5.6vmin, 52px);
    background: rgba(255, 255, 255, 0.6); border-radius: 50%; padding: 5px;
    box-shadow: 0 3px 8px rgba(90, 60, 130, 0.18);
    position: relative; opacity: 0.65; transition: opacity 0.3s, transform 0.3s;
}
.pip svg { width: 100%; height: 100%; }
.pip.now { opacity: 1; transform: scale(1.12); background: #fff; box-shadow: 0 0 0 4px rgba(252, 191, 73, 0.6), 0 3px 8px rgba(90, 60, 130, 0.18); }
.pip.done { opacity: 1; }
.pip.done::after {
    content: '✓'; position: absolute; right: -4px; bottom: -4px;
    width: 20px; height: 20px; line-height: 20px; text-align: center;
    background: #7CB518; color: #fff; font-weight: bold; font-size: 0.8rem;
    border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#badge-rack {
    position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 10px; z-index: 30;
}
.badge {
    position: relative;
    width: clamp(48px, 6.6vmin, 60px); height: clamp(48px, 6.6vmin, 60px);
    background: rgba(255, 255, 255, 0.85); border-radius: 50%; padding: 6px;
    border: 3px dashed #C98A4B;
    box-shadow: 0 3px 10px rgba(90, 60, 130, 0.18);
    transition: border-color 0.3s;
}
.badge svg { width: 100%; height: 100%; opacity: 0.75; }
.badge-check {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; font-weight: bold; color: #7CB518;
    text-shadow: 0 2px 0 #fff, 0 0 6px #fff;
    transform: scale(0); transition: transform 0.35s cubic-bezier(0.2, 1.7, 0.4, 1);
}
.badge.stamped { border: 3px solid #7CB518; background: #F2FAE4; }
.badge.stamped .badge-check { transform: scale(1); }

/* dresser ── */
#dresser {
    position: absolute; bottom: 0; left: 50%;
    transform: translate(-50%, 112%);
    width: min(97%, 980px);
    background:
        repeating-linear-gradient(90deg, transparent 0 190px, rgba(165,109,56,0.35) 190px 194px),
        linear-gradient(180deg, #E8A868 0%, #D89755 45%, #C98A4B 100%);
    border: 5px solid #A56D38; border-bottom: none;
    border-radius: 26px 26px 0 0;
    padding: clamp(8px, 1.4vmin, 14px) clamp(8px, 1.6vmin, 18px) 6px;
    box-shadow: 0 -10px 30px rgba(74, 59, 92, 0.3);
    z-index: 20;
    transition: transform 0.55s cubic-bezier(0.2, 1.25, 0.4, 1);
}
#dresser.up { transform: translate(-50%, 0); }
#dresser-top { position: absolute; left: -14px; right: -14px; top: -20px; height: 26px; }
#dresser-top svg { width: 100%; height: 100%; }

#shelves {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: clamp(6px, 1.2vmin, 12px);
}

.shelf {
    display: flex; align-items: center;
    gap: clamp(6px, 1vmin, 10px);
    background: linear-gradient(180deg, #A56D38, #8F5C2C);
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 -2px 0 rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: clamp(5px, 0.9vmin, 10px) clamp(6px, 1.1vmin, 12px);
    transition: filter 0.4s, opacity 0.4s;
}
.shelf.done { filter: saturate(0.55) brightness(0.92); opacity: 0.8; }

.shelf-label {
    width: clamp(40px, 5.6vmin, 52px); height: clamp(40px, 5.6vmin, 52px);
    background: radial-gradient(circle at 38% 32%, #FFE9CE, #E8A868 78%);
    border: 3px solid #7A4E24; border-radius: 50%;
    padding: 4px; flex: none;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}
.shelf-label svg { width: 100%; height: 100%; }

.shelf-tiles { display: flex; gap: clamp(6px, 1vmin, 12px); }

.tile {
    width: clamp(64px, 8.6vmin, 88px); height: clamp(64px, 8.6vmin, 88px);
    border: 3px solid #C98A4B;
    border-radius: 18px;
    background: linear-gradient(180deg, #FFFDF6 0%, #FFF3DF 100%);
    box-shadow: 0 4px 10px rgba(74, 59, 92, 0.25), inset 0 -4px 0 rgba(201, 138, 75, 0.25);
    cursor: pointer; padding: 4px;
    transition: transform 0.15s, opacity 0.3s, filter 0.3s, box-shadow 0.3s;
}
.tile svg { width: 100%; height: 100%; display: block; animation: tile-bob 2.8s ease-in-out infinite; }
.tile:nth-child(2) svg { animation-delay: -0.9s; }
.tile:nth-child(3) svg { animation-delay: -1.8s; }
.tile:nth-child(4) svg { animation-delay: -2.4s; }
@keyframes tile-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.tile:hover { transform: translateY(-4px) scale(1.06); }
.tile:active { transform: scale(0.92); }
.tile.used, .tile.away { opacity: 0; pointer-events: none; }
.tile.tried { opacity: 0.55; filter: saturate(0.6); }
.tile.halo {
    border-color: #FFD700;
    animation: halo-pulse 1.1s ease-in-out infinite;
}
@keyframes halo-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.55), 0 0 22px 6px rgba(255, 215, 0, 0.55); }
    50% { box-shadow: 0 0 0 7px rgba(255, 215, 0, 0.95), 0 0 32px 12px rgba(255, 215, 0, 0.85); }
}

/* ══ fx layer ════════════════════════════════════════════════════════════ */

#fx-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; }

.fly-item { position: fixed; filter: drop-shadow(0 8px 10px rgba(74, 59, 92, 0.3)); }
.fly-item svg { width: 100%; height: 100%; }

.spark {
    position: fixed; font-size: 22px; transform: translate(-50%, -50%);
    animation: spark-fly 0.75s ease-out forwards;
}
@keyframes spark-fly {
    0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.15); opacity: 0; }
}

.gag { position: fixed; transform: translate(-50%, -50%); font-size: 26px; }
.gag span { display: inline-block; animation: gag-pop 1.1s ease-out forwards; opacity: 0; margin: 0 2px; }
@keyframes gag-pop {
    0% { transform: translateY(6px) scale(0.4); opacity: 0; }
    25% { opacity: 1; }
    100% { transform: translateY(-42px) scale(1.2); opacity: 0; }
}

#ghost-hand {
    position: fixed; font-size: clamp(40px, 6vmin, 56px);
    transform: translate(-50%, -12%);
    filter: drop-shadow(0 4px 8px rgba(74, 59, 92, 0.4));
    animation: hand-tap 1.1s ease-in-out infinite;
    z-index: 65;
}
@keyframes hand-tap {
    0%, 100% { transform: translate(-50%, -12%) scale(1); }
    45% { transform: translate(-50%, 2%) scale(0.82); }
    60% { transform: translate(-50%, -4%) scale(1.05); }
}

/* ══ window weather animation ════════════════════════════════════════════ */

.ws-rays { transform-box: fill-box; transform-origin: center; animation: ws-spin 26s linear infinite; }
@keyframes ws-spin { to { transform: rotate(1turn); } }

.ws-cloud-drift { animation: ws-drift 9s ease-in-out infinite alternate; }
@keyframes ws-drift { from { transform: translateX(-10px); } to { transform: translateX(14px); } }

.ws-rain { animation: ws-rainfall 0.7s linear infinite; }
.ws-rain-b { animation-duration: 0.55s; animation-delay: -0.3s; }
@keyframes ws-rainfall {
    0% { transform: translateY(-36px); opacity: 0; }
    25% { opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translateY(190px); opacity: 0; }
}
.ws-puddle { animation: ws-puddle 1.4s ease-in-out infinite; }
@keyframes ws-puddle { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.9; } }

.ws-snow-a { animation: ws-snowdrift 5.5s ease-in-out infinite alternate; }
.ws-snow-b { animation: ws-snowdrift 7.5s ease-in-out infinite alternate-reverse; }
.ws-snow-c { animation: ws-snowdrift 10s ease-in-out infinite alternate; }
@keyframes ws-snowdrift {
    from { transform: translate(-8px, -14px); }
    to { transform: translate(10px, 26px); }
}

.ws-sapling { transform-box: fill-box; transform-origin: 60% 100%; animation: ws-sway 1.5s ease-in-out infinite alternate; }
@keyframes ws-sway { from { transform: rotate(2deg); } to { transform: rotate(-9deg); } }

.ws-swirls { animation: ws-swirl-fade 2.4s ease-in-out infinite; }
@keyframes ws-swirl-fade { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.65; } }

.ws-fly { animation: ws-fly-across 3.4s linear infinite; }
.ws-fly-1 { animation-delay: -1.1s; animation-duration: 4.1s; }
.ws-fly-2 { animation-delay: -2.2s; animation-duration: 3s; }
.ws-fly-3 { animation-delay: -0.6s; animation-duration: 4.7s; }
@keyframes ws-fly-across {
    0% { transform: translate(-30px, 70px) rotate(0turn); }
    100% { transform: translate(470px, 190px) rotate(2turn); }
}

/* small icon motion (pips, bubble) */
.wi-spin { transform-box: fill-box; transform-origin: center; animation: ws-spin 18s linear infinite; }
.wi-drop { animation: wi-drip 1s ease-in-out infinite; }
@keyframes wi-drip { 0%, 100% { opacity: 0.35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(4px); } }
.wi-leaf { transform-box: fill-box; transform-origin: center; animation: gk-wiggle 1.4s ease-in-out infinite; }

/* ══ day-complete vignette ═══════════════════════════════════════════════ */

#vignette {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(74, 59, 92, 0.5);
    display: flex; align-items: center; justify-content: center;
    animation: gk-fade-in 0.3s ease-out;
}

#door-frame {
    position: relative;
    width: min(88vw, 560px);
    height: min(74vh, 470px);
    border: 14px solid #A56D38;
    border-radius: 40px 40px 18px 18px;
    background: #C9E2F5;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4), inset 0 0 0 5px #C98A4B;
    perspective: 900px;
}

#outdoor-scene { position: absolute; inset: 0; }
#outdoor-scene > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.willa-mini svg { width: 100%; height: auto; display: block; overflow: visible; }
#outdoor-scene.vg-sunny { background: linear-gradient(180deg, #9ADCF0 0%, #CFF0FA 60%, #FFF6D8 100%); }
#outdoor-scene.vg-rainy { background: linear-gradient(180deg, #6E93B8 0%, #8FB8D8 70%, #AECDE8 100%); }
#outdoor-scene.vg-snowy { background: linear-gradient(180deg, #B9D2EC 0%, #DCE9F5 70%, #F4F9FE 100%); }
#outdoor-scene.vg-windy { background: linear-gradient(180deg, #8FD3E8 0%, #B8E0C8 100%); }

.willa-mini {
    position: absolute;
    width: 30%; left: 34%; bottom: 3%;
    animation: mini-hop 1.05s ease-in-out infinite;
}
@keyframes mini-hop {
    0%, 100% { transform: translateY(0) scale(1, 1); }
    30% { transform: translateY(1px) scale(1.04, 0.94); }
    65% { transform: translateY(-20px) scale(0.97, 1.05); }
}
.willa-mini.willa-sunny { left: 17%; }
.willa-mini.willa-rainy { left: 22%; }
.willa-mini.willa-snowy { left: 52%; }
.willa-mini.willa-windy { left: 28%; }

#door-leaf {
    position: absolute; inset: 0;
    transform-origin: left center;
    background:
        radial-gradient(circle at 82% 52%, #FCBF49 0 4.2%, #A56D38 4.4% 5.6%, transparent 5.8%),
        linear-gradient(90deg, rgba(255,255,255,0.14), transparent 30%),
        repeating-linear-gradient(0deg, transparent 0 64px, rgba(165,109,56,0.35) 64px 68px),
        linear-gradient(180deg, #E8A868, #C98A4B);
    border-left: 6px solid #A56D38;
    box-shadow: inset 0 0 0 16px rgba(165, 109, 56, 0.55), inset 0 0 0 20px rgba(255, 243, 219, 0.25);
    transition: transform 0.85s cubic-bezier(0.5, 0, 0.3, 1);
    z-index: 5;
}
#door-frame.open #door-leaf { transform: rotateY(-105deg); }

#btn-next-day {
    position: absolute; right: 5%; bottom: 6%;
    width: clamp(84px, 12vmin, 110px); height: clamp(84px, 12vmin, 110px);
    border: none; border-radius: 50%;
    font-size: 2.4rem; color: #fff; cursor: pointer;
    background: linear-gradient(135deg, #7CB518 0%, #A2D149 100%);
    box-shadow: 0 8px 24px rgba(74, 59, 92, 0.5), inset 0 -5px 0 rgba(0, 0, 0, 0.15);
    z-index: 210;
}
#btn-next-day span { display: inline-block; animation: next-bounce 0.9s ease-in-out infinite; }
@keyframes next-bounce { 0%, 100% { transform: translateY(2px) scale(1); } 50% { transform: translateY(-8px) scale(1.12); } }
#btn-next-day:active { transform: scale(0.9); }

/* ══ grown-ups note ══════════════════════════════════════════════════════ */

#info-btn {
    position: fixed; left: 16px; bottom: 16px; z-index: 320;
    width: 64px; height: 64px;
    border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 12px rgba(90, 60, 130, 0.3);
    font-size: 1.6rem; cursor: pointer;
    transition: transform 0.15s;
}
#info-btn:hover { transform: scale(1.1); }

/* Sits above the celebration overlay (z 940) so the note is always the topmost
   card and can never be buried by a screen that appears behind it. */
#info-overlay { position: fixed; inset: 0; z-index: 960; display: flex; align-items: center; justify-content: center; }
#info-scrim { position: absolute; inset: 0; background: rgba(74, 59, 92, 0.5); animation: gk-fade-in 0.25s; }
#info-card {
    position: relative; max-width: min(92vw, 560px); max-height: 84vh; overflow-y: auto;
    padding: 26px 30px 22px;
    animation: gk-pop-in 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}
#info-card h3 {
    color: #F77F00; font-size: 1.4rem; padding-right: 84px;
    min-height: 64px; display: flex; align-items: center; margin-bottom: 8px;
}
#info-card p { margin: 9px 0; font-size: 1rem; line-height: 1.45; }
#info-card .info-small { font-size: 0.85rem; color: #8a7a9c; }
#info-close {
    position: absolute; top: 12px; right: 12px;
    width: 72px; height: 72px;
    border: none; border-radius: 50%;
    background: #FFE8D6; color: #4A3B5C;
    font-size: 1.7rem; font-weight: bold; cursor: pointer;
    box-shadow: 0 3px 10px rgba(90, 60, 130, 0.25);
}
#info-close:active { transform: scale(0.92); }

/* ══ responsive nips ═════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    #wall-frame { display: none; }
    #wall-shelf { width: clamp(120px, 15vw, 180px); top: 24%; }
    #willa-home { width: clamp(210px, 34vmin, 320px); }
    #stage.on-play #willa-home { width: clamp(200px, 34vmin, 300px); bottom: 30%; }
    #stage.on-play #rug { bottom: 28.5%; }
}
/* keep 4-shelf level in a tidy 2x2 grid on narrow tablets */
@media (max-width: 820px) {
    .tile { width: 64px; height: 64px; }
    .shelf-label { width: 36px; height: 36px; }
    .shelf { gap: 5px; padding: 5px 6px; }
    .shelf-tiles { gap: 5px; }
    #shelves { gap: 6px; }
    #dresser { padding: 8px 6px 6px; }
}
@media (max-height: 700px) {
    #screen-title { padding-top: 30px; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .tile, #btn-play, #btn-next-day, .orbit-chip, #weather-bubble, .bunt-flag, #plant,
    .ws-rays, .ws-rain, .ws-snow-a, .ws-snow-b, .ws-snow-c, .ws-sapling, .ws-fly,
    .willa-mini, .w-breathe, .ear-in { animation: none !important; }
}
