/* Mixie's Paint Parade — styles. Loads after gamekit.css. */

:root {
    --paint: #7ED6A5;          /* Mixie's current tint (mint at rest) */
    --out: #4A3B5C;
    --wood: #C08552;
    --wood-dark: #8E5B33;
}

body { background: #FDE7F3; }

.screen { position: fixed; inset: 0; overflow: hidden; }
.screen.enter { animation: scr-in 0.45s ease-out; }
@keyframes scr-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ══════════ street backdrop ══════════ */

.backdrop, .bk { position: absolute; inset: 0; pointer-events: none; }
.bk-sky {
    position: absolute; inset: 0;
    background: linear-gradient(#C8E8FA 0%, #E7F4FD 45%, #FDE7F3 100%);
    transition: opacity 0.6s;
}
.twilight .bk-sky { background: linear-gradient(#2E2A5E 0%, #6C4A9E 55%, #B565D8 100%); }
.bk-far  { position: absolute; top: 0; left: 0; width: 100%; height: 62%; }
.bk-mid  { position: absolute; bottom: 17%; left: 0; width: 100%; height: 52%; }
.bk-near { position: absolute; bottom: 0; left: 0; width: 100%; height: 26%; }

.bk-sun  { transform: translate(84%, 26%); }
.bk-sun .bk-rays { animation: sun-spin 40s linear infinite; }
@keyframes sun-spin { to { transform: rotate(360deg); } }
.bk-moon { display: none; transform: translate(84%, 26%); }
.twilight .bk-sun  { display: none; }
.twilight .bk-moon { display: block; }

.bk-cloud { animation: cloud-drift 60s linear infinite; }
.bk-c2 { animation-duration: 78s; animation-delay: -30s; }
.bk-c3 { animation-duration: 92s; animation-delay: -55s; }
@keyframes cloud-drift {
    from { transform: translate(-220px, var(--cy, 0)) scale(var(--cs, 1)); }
    to   { transform: translate(1420px, var(--cy, 0)) scale(var(--cs, 1)); }
}
.bk-c1 { --cy: 130px; --cs: 1.15; }
.bk-c2 { --cy: 70px;  --cs: 0.85; }
.bk-c3 { --cy: 185px; --cs: 1; }
.bk-c4 { --cy: 330px; --cs: 0.7; animation-duration: 84s; animation-delay: -18s; }

.bk-flag { animation: gk-wiggle 2.6s ease-in-out infinite; }
.bk-flag:nth-of-type(2n) { animation-delay: 0.6s; }
.bk-flag:nth-of-type(3n) { animation-delay: 1.2s; }

.bk-bulb { display: none; }
.twilight .bk-bulb { display: block; animation: bulb-glow 1.8s ease-in-out infinite; }
@keyframes bulb-glow { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.bk-balloon { animation: gk-bob 3s ease-in-out infinite; }
.marching-fast .bk-balloon { animation-duration: 1.2s; }

.twilight .bk-mid, .twilight .bk-near { filter: brightness(0.82) saturate(0.9); }

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

#screen-title { display: flex; flex-direction: column; align-items: center; }

.corner-splat {
    position: absolute; width: 34vmin; height: 34vmin; opacity: 0.5; z-index: 1;
    background:
        radial-gradient(circle at 30% 30%, #FF7BAC 0 18%, transparent 19%),
        radial-gradient(circle at 70% 20%, #FCBF49 0 12%, transparent 13%),
        radial-gradient(circle at 20% 72%, #00B4D8 0 15%, transparent 16%),
        radial-gradient(circle at 66% 66%, #B565D8 0 20%, transparent 21%);
    filter: blur(1px);
}
.cs-tl { top: -8vmin; left: -8vmin; }
.cs-br { bottom: -6vmin; right: -6vmin; }

.title-stack { position: relative; z-index: 3; text-align: center; margin-top: max(4vh, 20px); }
#game-title { display: flex; flex-direction: column; line-height: 1; }
#game-title .t-owner {
    font-size: clamp(1.4rem, 4vw, 2.2rem); color: #FFFFFF;
    text-shadow: 0 3px 0 rgba(74, 59, 92, 0.35); transform: rotate(-3deg);
}
#game-title .t-main {
    font-size: clamp(2.6rem, 8vw, 4.6rem); font-weight: bold;
    background: linear-gradient(90deg, #E63946, #F77F00, #FCBF49, #7CB518, #00B4D8, #B565D8);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 3px 0 #FFFFFF) drop-shadow(0 6px 10px rgba(74, 59, 92, 0.3));
    animation: title-tilt 5s ease-in-out infinite;
}
@keyframes title-tilt { 0%, 100% { transform: rotate(-1.4deg); } 50% { transform: rotate(1.4deg); } }
.tagline {
    margin-top: 12px; font-size: clamp(1rem, 2.6vw, 1.3rem); color: var(--out);
    background: rgba(255, 255, 255, 0.75); border-radius: 30px; padding: 6px 22px; display: inline-block;
}

#title-mixie {
    position: absolute; z-index: 3; left: clamp(8px, 9vw, 150px); bottom: 12vh;
    width: clamp(160px, 24vw, 300px); animation: gk-bob 2.8s ease-in-out infinite;
}
#title-mixie svg { width: 100%; }

#btn-start {
    position: relative; z-index: 3; margin-top: auto; margin-bottom: 6vh;
    min-height: 84px; padding: 18px 64px; font-size: clamp(1.6rem, 4.5vw, 2.2rem);
    box-shadow: 0 8px 26px rgba(124, 181, 24, 0.55), 0 0 0 8px rgba(255, 255, 255, 0.55);
}
.start-inner { display: inline-block; animation: gk-bob 1.6s ease-in-out infinite; }

#btn-gallery-door {
    position: absolute; z-index: 3; right: clamp(14px, 6vw, 80px); bottom: 5vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 108px; min-height: 96px; padding: 20px 8px 10px;
    background: linear-gradient(#B98863, #96603C); border: 4px solid var(--out); border-radius: 14px 14px 8px 8px;
    box-shadow: 0 6px 16px rgba(74, 59, 92, 0.35); cursor: pointer;
    color: #FFF8EC; font-weight: bold; font-size: 1.05rem;
    transition: transform 0.18s;
}
#btn-gallery-door:hover { transform: scale(1.06); }
#btn-gallery-door .door-roof {
    position: absolute; top: -18px; left: -12px; right: -12px; height: 22px;
    background: #E63946; border: 4px solid var(--out); border-radius: 10px;
}
#btn-gallery-door .door-ic { font-size: 2rem; line-height: 1.1; }

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

/* ══════════ SELECT ══════════ */

#screen-select { display: flex; flex-direction: column; align-items: center; }
.select-veil { position: absolute; inset: 0; background: rgba(255, 248, 236, 0.45); backdrop-filter: blur(2px); }

.prompt {
    position: relative; z-index: 3; margin-top: max(3.5vh, 16px);
    font-size: clamp(1.5rem, 4vw, 2.3rem); color: var(--out);
    background: rgba(255, 255, 255, 0.9); padding: 10px 34px; border-radius: 40px;
    box-shadow: var(--gk-shadow);
}

#select-mixie {
    position: absolute; z-index: 3; left: clamp(4px, 3vw, 40px); bottom: 4vh;
    width: clamp(120px, 15vw, 200px); animation: gk-bob 2.8s ease-in-out infinite;
}
#select-mixie svg { width: 100%; }

#cards {
    position: relative; z-index: 3; flex: 1; width: min(96vw, 1100px);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: clamp(10px, 2vw, 26px); padding: 2vh 8px 4vh;
}
.animal-card {
    width: clamp(150px, 24vw, 215px); padding: 10px 8px 6px;
    background: var(--card, #FFF); border: 5px solid var(--out); border-radius: 26px;
    cursor: pointer; box-shadow: 0 8px 0 rgba(74, 59, 92, 0.22), var(--gk-shadow);
    transition: box-shadow 0.18s, filter 0.3s;
    font-family: inherit;
}
.animal-card:hover { box-shadow: 0 11px 0 rgba(74, 59, 92, 0.25), var(--gk-shadow); }
.animal-card .card-anim { pointer-events: none; }
.animal-card .card-anim svg { width: 100%; display: block; }
.animal-card .card-name {
    font-size: clamp(1.05rem, 2.4vw, 1.4rem); font-weight: bold; color: var(--out);
    background: rgba(255, 255, 255, 0.8); border-radius: 20px; margin-top: 4px; padding: 3px 0;
}
.animal-card.locked { filter: grayscale(0.75) opacity(0.8); }
.animal-card.locked .card-anim svg { filter: brightness(1.04); }
.animal-card .zzz {
    display: none; position: absolute; top: 4px; right: 12px; font-size: 1.5rem;
}
.animal-card { position: relative; }
.animal-card.locked .zzz { display: block; animation: zzz-float 2.4s ease-in-out infinite; }
@keyframes zzz-float { 0%, 100% { transform: translateY(0) rotate(-6deg); opacity: 0.75; } 50% { transform: translateY(-9px) rotate(6deg); opacity: 1; } }
.animal-card.locked .pp-lid { transform: scaleY(1) !important; animation: none !important; }
.animal-card.nap-wiggle { animation: nap-wiggle 0.55s ease-in-out; }
@keyframes nap-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }

/* ══════════ animal rig (shared) ══════════ */

.pp-animal { display: block; }
.pp-bodygrp { animation: pp-breathe 3.6s ease-in-out infinite; transform-origin: 260px 380px; }
@keyframes pp-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.008, 0.988); } }

.pp-contour, .pp-paint, .pp-lines, .pp-face, .pp-mid { pointer-events: none; }
.pp-hit * { cursor: crosshair; }

.pp-lid {
    transform: scaleY(0); transform-box: fill-box; transform-origin: 50% 0%;
    animation: pp-blink 4.4s ease-in-out infinite; animation-delay: var(--blinkd, 0s);
}
@keyframes pp-blink { 0%, 91%, 100% { transform: scaleY(0); } 94%, 97% { transform: scaleY(1); } }
.pp-happy { opacity: 0; }
.giggling .pp-happy { opacity: 1; }
.giggling .pp-pupil, .giggling .pp-lid { opacity: 0; }
.giggling .pp-bodygrp { animation: pp-giggle 0.45s ease-in-out 2; }
@keyframes pp-giggle { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-2.4deg) scale(1.015, 0.985); } 70% { transform: rotate(2.4deg) scale(0.99, 1.01); } }

.pp-tail { animation: tail-sway 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 0% 50%; }
@keyframes tail-sway { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(9deg); } }

.pp-glit { animation: glit-twinkle 1.3s linear infinite; }
@keyframes glit-twinkle {
    0%, 100% { opacity: 1; stroke-dashoffset: 0; }
    50% { opacity: 0.35; stroke-dashoffset: 11; }
}

.pp-pop { animation: stamp-pop 0.42s cubic-bezier(0.2, 1.7, 0.4, 1); transform-box: fill-box; transform-origin: center; }
@keyframes stamp-pop { 0% { transform: scale(0.1, 0.1); } 55% { transform: scale(1.25, 0.8); } 80% { transform: scale(0.92, 1.12); } 100% { transform: scale(1, 1); } }

.pp-mid-dash { animation: mid-shimmer 1.4s linear infinite; }
@keyframes mid-shimmer { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -20; } }

.pp-wheel { }
.marching .pp-wheel { animation: wheel-spin 0.45s linear infinite; }
@keyframes wheel-spin { to { transform: rotate(360deg); } }
.marching .pp-bodygrp { animation: march-bounce 0.4s ease-in-out infinite; }
@keyframes march-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ══════════ Mixie rig ══════════ */

.mx-tint { transition: fill 0.35s; }
.mx-tint-stroke { transition: stroke 0.35s; }
.pp-mixie .pp-lid { animation-delay: 1.1s; }
.mx-arm { transform-box: fill-box; transform-origin: 90% 60%; }
.mx-wave .mx-arm { animation: mx-wave 1.8s ease-in-out infinite; }
@keyframes mx-wave { 0%, 100% { transform: rotate(6deg); } 50% { transform: rotate(-38deg); } }
.mx-tailgrp { transform-box: fill-box; transform-origin: 10% 60%; animation: mx-tail 3s ease-in-out infinite; }
@keyframes mx-tail { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-6deg); } }
.mx-glance { animation: mx-glance 0.7s ease-in-out; }
@keyframes mx-glance { 0%, 100% { transform: rotate(0); } 40% { transform: rotate(-7deg) translateY(3px); } }

/* ══════════ STUDIO ══════════ */

#screen-studio {
    display: grid; grid-template-columns: 92px 1fr; grid-template-rows: 1fr auto;
    background:
        radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.5), transparent 40%),
        linear-gradient(#FFF6E4, #FCEBD3);
    transition: background 0.6s;
}
#screen-studio.twilight {
    background:
        radial-gradient(circle at 20% 10%, rgba(181, 101, 216, 0.18), transparent 45%),
        linear-gradient(#F3E4EC, #E6D3E8);
}

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

#studio-window {
    position: absolute; top: 3vh; left: clamp(96px, 11vw, 150px);
    width: clamp(150px, 19vw, 250px); opacity: 0.96;
}
#studio-window svg { width: 100%; filter: drop-shadow(0 6px 14px rgba(74, 59, 92, 0.25)); }
.twilight .win-sun { display: none; }
.win-moon { display: none; }
.twilight .win-moon { display: block; }
.twilight #pp-winsky stop:first-child { stop-color: #2E2A5E; }
.twilight #pp-winsky stop:last-child { stop-color: #B565D8; }
.win-cloud { animation: win-cloud-drift 26s linear infinite; }
@keyframes win-cloud-drift { from { transform: translateX(-130px); } to { transform: translateX(200px); } }

#studio-doodles { position: absolute; top: 2.5vh; right: clamp(170px, 20vw, 300px); display: flex; gap: 14px; }
.doodle {
    width: clamp(48px, 6vw, 74px); background: #FFFFFF; border-radius: 6px; padding: 6px;
    box-shadow: 0 4px 10px rgba(74, 59, 92, 0.2); position: relative;
}
.doodle svg { width: 100%; display: block; }
.doodle .tape {
    position: absolute; top: -7px; left: 50%; transform: translateX(-50%) rotate(-4deg);
    width: 60%; height: 12px; background: rgba(255, 211, 182, 0.85); border-radius: 2px;
}

#studio-shelf { position: absolute; top: 24vh; right: 12px; width: clamp(120px, 15vw, 190px); }
#studio-shelf .shelf-plank {
    height: 14px; background: linear-gradient(#C08552, #8E5B33); border: 3px solid var(--out);
    border-radius: 6px; box-shadow: 0 6px 10px rgba(74, 59, 92, 0.25);
}
#studio-mixie { width: 82%; margin: 0 auto -6px; }
#studio-mixie svg { width: 100%; display: block; }

#studio-lights { position: absolute; top: 0; left: 0; right: 0; height: 12px; display: none; }
.twilight #studio-lights {
    display: block;
    background: repeating-linear-gradient(90deg, transparent 0 34px, #FFD700 34px 42px);
    filter: blur(1px); opacity: 0.8; animation: bulb-glow 2.2s ease-in-out infinite;
}

#tools {
    grid-area: 1 / 1; align-self: center; z-index: 5;
    display: flex; flex-direction: column; gap: 14px; padding-left: 12px;
}
.tool-btn {
    width: 72px; height: 72px; border: 4px solid var(--out); border-radius: 20px;
    background: #FFFFFF; cursor: pointer; padding: 6px;
    box-shadow: 0 5px 0 rgba(74, 59, 92, 0.25); transition: background 0.2s, box-shadow 0.15s;
}
.tool-btn svg { width: 100%; height: 100%; display: block; }
.tool-btn.active { background: #FFF3B0; box-shadow: 0 2px 0 rgba(74, 59, 92, 0.25), 0 0 0 5px rgba(252, 191, 73, 0.55); }
.tool-btn.pulse-once { animation: tool-hello 0.9s ease-in-out 3; }
@keyframes tool-hello { 0%, 100% { box-shadow: 0 5px 0 rgba(74, 59, 92, 0.25); } 50% { box-shadow: 0 5px 0 rgba(74, 59, 92, 0.25), 0 0 0 10px rgba(181, 101, 216, 0.4); } }

#canvas-wrap {
    grid-area: 1 / 2; position: relative; z-index: 4;
    display: flex; align-items: flex-end; justify-content: center;
    padding: 8px 10px 0;
    min-height: 0;
}
#paint-canvas { height: 100%; width: 100%; max-height: 100%; touch-action: none; }
#paint-canvas .pp-hit * { pointer-events: fill; }

#wish-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.wish {
    position: absolute; width: 120px; animation: wish-float 3.4s ease-in-out infinite;
    filter: drop-shadow(0 6px 12px rgba(74, 59, 92, 0.3));
    transition: opacity 0.8s, transform 0.8s;
}
.wish svg { width: 100%; display: block; }
@keyframes wish-float { 0%, 100% { margin-top: 0; } 50% { margin-top: -14px; } }
.wish.pop { animation: wish-pop 0.4s ease-out forwards; }
@keyframes wish-pop { to { transform: scale(1.5); opacity: 0; } }
.wish.drift { opacity: 0; transform: translateY(-70px); }

#table {
    grid-area: 2 / 1 / 3 / 3; position: relative; z-index: 7;
    padding: 12px 10px 14px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.12), transparent 30%),
        repeating-linear-gradient(90deg, #C08552 0 90px, #B67B48 90px 180px);
    border-top: 6px solid var(--wood-dark);
    box-shadow: 0 -8px 20px rgba(74, 59, 92, 0.18);
}
#pots { display: flex; justify-content: center; gap: clamp(4px, 1vw, 12px); }
.pot-btn {
    width: clamp(64px, 7.4vw, 76px); height: clamp(64px, 7.4vw, 76px);
    border: none; background: transparent; cursor: pointer; padding: 0;
    border-radius: 50%; transition: transform 0.18s; position: relative;
}
.pot-btn svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 3px rgba(74, 59, 92, 0.3)); }
.pot-btn.selected { transform: translateY(-10px); }
.pot-btn.selected::after {
    content: ''; position: absolute; inset: -4px; border-radius: 50%;
    border: 4px dashed rgba(255, 255, 255, 0.95); pointer-events: none;
    animation: pot-ring 6s linear infinite;
}
@keyframes pot-ring { to { transform: rotate(360deg); } }
.pot-btn.wob .pot-blob { animation: pot-slosh 0.5s ease-in-out; transform-box: fill-box; transform-origin: center; }
@keyframes pot-slosh { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-9deg) translateY(-2px); } 70% { transform: rotate(8deg); } }
.pot-sparkles circle { animation: gk-twinkle 1.4s ease-in-out infinite; }
.pot-sparkles circle:nth-child(2) { animation-delay: 0.5s; }
.pot-sparkles circle:nth-child(3) { animation-delay: 0.9s; }

#btn-hang {
    position: absolute; right: 18px; bottom: 130px; z-index: 8;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    min-width: 104px; min-height: 108px; padding: 8px 12px;
    background: linear-gradient(#FFE58A, #F2B33D); border: 5px solid #B98117; border-radius: 20px;
    cursor: pointer; box-shadow: 0 6px 0 #8a5f10, 0 10px 24px rgba(74, 59, 92, 0.35);
    animation: hang-glow 1.2s ease-in-out infinite;
    color: #6b4a08; font-weight: bold; font-size: 1.15rem; font-family: inherit;
}
@keyframes hang-glow {
    0%, 100% { box-shadow: 0 6px 0 #8a5f10, 0 10px 24px rgba(74, 59, 92, 0.35); }
    50% { box-shadow: 0 6px 0 #8a5f10, 0 0 0 12px rgba(255, 215, 0, 0.4), 0 10px 24px rgba(74, 59, 92, 0.35); }
}
#btn-hang .hang-frame {
    display: grid; place-items: center; width: 62px; height: 52px;
    background: #FFF8EC; border: 5px solid #B98117; border-radius: 8px;
}
#btn-hang .hang-pic { font-size: 1.7rem; animation: gk-bob 1.2s ease-in-out infinite; }
#btn-hang.appear { animation: hang-appear 0.6s cubic-bezier(0.2, 1.5, 0.4, 1), hang-glow 1.2s ease-in-out 0.6s infinite; }
@keyframes hang-appear { from { opacity: 0; transform: scale(0.4) rotate(-8deg); } to { opacity: 1; transform: none; } }

#stamp-tray {
    position: absolute; left: 50%; bottom: 118px; z-index: 9;
    width: max-content; max-width: calc(100vw - 130px);
    transform: translateX(-50%);
    display: flex; justify-content: center; flex-wrap: wrap; gap: clamp(6px, 1.4vw, 16px);
    background: #FFFFFF; border: 4px solid var(--out); border-radius: 24px;
    padding: 12px; box-shadow: var(--gk-shadow);
    transition: transform 0.3s cubic-bezier(0.2, 1.2, 0.4, 1), opacity 0.3s;
}
#stamp-tray.tray-hidden { transform: translateX(-50%) translateY(40px); opacity: 0; pointer-events: none; }
.stamp-btn {
    width: clamp(64px, 7vw, 76px); height: clamp(64px, 7vw, 76px);
    border: 4px solid transparent; border-radius: 18px; background: #FFF6E4; cursor: pointer; padding: 8px;
    transition: border-color 0.2s, background 0.2s;
}
.stamp-btn svg { width: 100%; height: 100%; display: block; }
.stamp-btn.selected { border-color: var(--out); background: #FFF3B0; }

#coach {
    position: absolute; inset: 0; z-index: 10; pointer-events: none;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 45%, transparent 30%, rgba(74, 59, 92, 0.18));
    transition: opacity 0.5s;
}
#coach.fading { opacity: 0; }
#coach svg { width: min(52vw, 470px); overflow: visible; }
.coach-trail {
    stroke-dasharray: 460; stroke-dashoffset: 460; opacity: 0.85;
    animation: trail-draw 2.6s ease-in-out infinite;
}
@keyframes trail-draw {
    0% { stroke-dashoffset: 460; } 55%, 78% { stroke-dashoffset: 0; opacity: 0.85; }
    95%, 100% { stroke-dashoffset: 0; opacity: 0; }
}
.coach-hand {
    offset-path: path('M70 230 C140 110 280 110 350 210'); offset-rotate: 0deg;
    animation: hand-run 2.6s ease-in-out infinite;
}
@keyframes hand-run { 0% { offset-distance: 0%; } 55% { offset-distance: 100%; } 78% { offset-distance: 100%; } 100% { offset-distance: 100%; opacity: 0; } }
.coach-ripple { animation: ripple 1.3s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ripple { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }

/* coach mini-bubble for new tools */
.tool-hint {
    position: absolute; left: 104px; z-index: 10; width: 200px; padding: 12px;
    background: #FFFFFF; border: 4px solid var(--out); border-radius: 18px;
    box-shadow: var(--gk-shadow); font-size: 1rem; color: var(--out); font-weight: bold;
    animation: gk-pop-in 0.4s ease-out;
}
.tool-hint::before {
    content: ''; position: absolute; left: -16px; top: 26px;
    border: 8px solid transparent; border-right-color: var(--out);
}

/* background tap puff */
.pp-puff {
    position: fixed; width: 46px; height: 46px; border-radius: 50%; pointer-events: none; z-index: 60;
    background: radial-gradient(circle, var(--pc, #FFD3B6) 0 45%, transparent 70%);
    animation: puff 0.6s ease-out forwards;
}
@keyframes puff { from { transform: translate(-50%, -50%) scale(0.3); opacity: 0.9; } to { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } }

#brush-cursor {
    position: fixed; z-index: 50; width: 54px; pointer-events: none;
    transform: translate(-8px, -46px) rotate(var(--tilt, 0deg)); transition: transform 0.1s;
}
#brush-cursor svg { width: 100%; }

/* ══════════ PARADE ══════════ */

#parade-float {
    position: absolute; bottom: 4vh; left: 0; z-index: 4;
    width: min(52vh, 44vw);
    animation: pp-march 2.7s linear forwards;
}
#parade-float svg { width: 100%; filter: drop-shadow(0 10px 18px rgba(74, 59, 92, 0.3)); }
@keyframes pp-march { from { transform: translateX(-105%); } to { transform: translateX(115vw); } }

/* ══════════ GALLERY ══════════ */

#screen-gallery { background: linear-gradient(#E8C77B, #D9B25F); }
#gallery-wall { position: absolute; inset: 0; }
#gallery-wall::before { /* wainscoting */
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 20%;
    background: linear-gradient(#C9A25E, #B48D48);
    border-top: 10px solid #A67F3B; box-shadow: 0 -4px 0 #E8D9A8;
}
#gallery-banner {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3;
    background: #B23A48; color: #FFF3B0; font-weight: bold; font-size: clamp(1.1rem, 2.6vw, 1.6rem);
    padding: 10px 38px; border-radius: 14px; border: 4px solid #7A2430;
    box-shadow: 0 6px 14px rgba(74, 59, 92, 0.35);
}
#frames {
    position: absolute; top: 70px; bottom: 15%; left: 50%; transform: translateX(-50%);
    width: min(94vw, 1080px);
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 14px;
    align-items: center; justify-items: center; z-index: 2;
}
@media (max-aspect-ratio: 1/1) { #frames { grid-template-columns: repeat(3, 1fr); } }
.frame-slot { position: relative; display: flex; flex-direction: column; align-items: center; }
.cone {
    position: absolute; top: -46px; width: 130%; height: 52px; z-index: 1;
    clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
    background: linear-gradient(rgba(255, 243, 176, 0.05), rgba(255, 243, 176, 0.6));
    opacity: 0; transition: opacity 0.8s;
}
.frame-slot.filled .cone { opacity: 1; }
.frame {
    width: clamp(104px, 12.5vw, 168px); aspect-ratio: 10 / 9;
    background: #FCF6E8; border: 7px solid #E8A828; outline: 4px solid #B98117; border-radius: 6px;
    box-shadow: inset 0 0 0 3px #F5E1A0, 0 8px 14px rgba(122, 84, 10, 0.4);
    position: relative; z-index: 2; padding: 0; cursor: default; overflow: hidden;
    display: grid; place-items: center;
}
button.frame { cursor: pointer; font-family: inherit; }
.frame .thumb, .frame .thumb svg { width: 100%; height: 100%; display: block; }
.frame.empty { background: #EFE6D2; color: #C9B88E; font-size: 2rem; font-weight: bold; }
.frame-slot { animation: frame-sway 5s ease-in-out infinite; }
.frame-slot:nth-child(2n) { animation-delay: 1.4s; }
.frame-slot:nth-child(3n) { animation-delay: 2.6s; }
@keyframes frame-sway { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(1deg); } }
.frame.glow { animation: frame-glow 1.4s ease-in-out 3; }
@keyframes frame-glow {
    0%, 100% { box-shadow: inset 0 0 0 3px #F5E1A0, 0 8px 14px rgba(122, 84, 10, 0.4); }
    50% { box-shadow: inset 0 0 0 3px #FFF3B0, 0 0 30px 14px rgba(255, 215, 0, 0.75); }
}
.plaque {
    margin-top: 5px; z-index: 2; font-size: clamp(0.6rem, 1.3vw, 0.8rem); font-weight: bold; color: #6b4a08;
    background: linear-gradient(#F5E1A0, #E8C77B); border: 2px solid #B98117; border-radius: 5px;
    padding: 1px 10px; box-shadow: 0 2px 4px rgba(74, 59, 92, 0.3);
}
#gallery-rope { position: absolute; left: 0; right: 0; bottom: 0; height: 13%; z-index: 4; pointer-events: none; }
#gallery-rope svg { width: 100%; height: 100%; }

#fly-snap {
    position: fixed; z-index: 30; width: 300px; pointer-events: none;
    transition: transform 0.85s cubic-bezier(0.4, 0, 0.3, 1);
    filter: drop-shadow(0 12px 22px rgba(74, 59, 92, 0.4));
}
#fly-snap svg { width: 100%; }

#btn-paint-another {
    position: absolute; bottom: 3.2vh; left: 50%; transform: translateX(-50%); z-index: 6;
    min-height: 78px; font-size: clamp(1.3rem, 3.4vw, 1.7rem);
}
#btn-paint-another.pulse { animation: another-pulse 1.4s ease-in-out infinite; }
@keyframes another-pulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(181, 101, 216, 0.45); }
    50% { box-shadow: 0 6px 20px rgba(181, 101, 216, 0.45), 0 0 0 12px rgba(255, 123, 172, 0.35); }
}

/* ══════════ zoom overlay ══════════ */

#zoom-overlay {
    position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
    background: rgba(74, 59, 92, 0.55); animation: gk-fade-in 0.25s ease-out; cursor: pointer;
}
#zoom-card {
    background: #FCF6E8; border: 12px solid #E8A828; outline: 6px solid #B98117; border-radius: 10px;
    padding: 12px; max-width: min(84vw, 560px); width: 70vmin;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); animation: gk-pop-in 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}
#zoom-art svg { width: 100%; display: block; }
#zoom-caption { text-align: center; font-weight: bold; font-size: clamp(1.1rem, 3vw, 1.5rem); color: var(--out); margin-top: 6px; }

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

#info-overlay {
    position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center;
    background: rgba(74, 59, 92, 0.5); animation: gk-fade-in 0.25s ease-out;
}
.info-card { position: relative; max-width: min(92vw, 540px); max-height: 86vh; overflow: auto; }
.info-card h3 { color: var(--gk-orange); font-size: 1.4rem; margin-bottom: 8px; }
.info-card p { margin: 8px 0; line-height: 1.45; }
.info-card .tool-legend { display: flex; gap: 14px; flex-wrap: wrap; background: #FFF6E4; border-radius: 14px; padding: 10px 14px; font-weight: bold; }
.info-card .tool-legend small { font-weight: normal; opacity: 0.75; }
#info-close {
    position: absolute; top: 10px; right: 10px; width: 52px; height: 52px;
    border: none; border-radius: 50%; background: #F1E4F7; font-size: 1.3rem; cursor: pointer;
}
#info-back { display: block; margin: 14px auto 4px; }

/* ══════════ responsive tuning ══════════ */

@media (max-width: 860px) {
    #studio-doodles { right: 90px; }
    #studio-doodles .doodle:nth-child(3) { display: none; }
    .tool-btn { width: 64px; height: 64px; }
    #screen-studio { grid-template-columns: 84px 1fr; }
    #btn-hang { bottom: 122px; }
}

@media (max-height: 820px) and (orientation: landscape) {
    #studio-window { width: clamp(140px, 16vw, 210px); }
}

/* ══════════ reduced motion ══════════ */

@media (prefers-reduced-motion: reduce) {
    .bk-cloud, .bk-sun .bk-rays, .bk-flag, .bk-balloon, .bk-bulb,
    .pp-bodygrp, .pp-lid, .pp-tail, .pp-glit, .pp-mid-dash, .pp-wheel,
    .mx-arm, .mx-tailgrp, .start-inner, #title-mixie, #select-mixie,
    .wish, .frame-slot, .coach-hand, .coach-trail, .coach-ripple,
    #btn-hang, #btn-hang .hang-pic, #btn-paint-another.pulse,
    .win-cloud, #game-title .t-main, .pot-btn.selected::after { animation: none !important; }
}
