﻿/* Stage 6.0: independent adventure layer; approved scene and character assets stay intact. */
#butterflyGame{position:absolute;inset:0;pointer-events:none}
.butterfly-progress{position:absolute;left:50%;top:clamp(10px,1.4vw,24px);transform:translateX(-50%);display:flex;align-items:center;justify-content:center;gap:18px;white-space:nowrap;max-width:calc(100% - 24px);padding:11px 22px;min-height:54px;border:1px solid #fff9e8;border-radius:22px;background:linear-gradient(#fffcf0f5,#f7eedaf5);box-shadow:0 5px 22px #59662c22;color:#7a8058;font-size:17px;pointer-events:none}
.butterfly-progress strong{font-size:24px;color:#6b8351;font-variant-numeric:tabular-nums}
.butterfly-pips{display:flex;gap:8px}.butterfly-pip{position:relative;display:block;width:23px;height:24px;opacity:.3;transition:opacity .5s;filter:grayscale(.4)}
.butterfly-pip::before,.butterfly-pip::after{content:'';position:absolute;top:3px;width:11px;height:18px;border-radius:65% 70% 55% 60%;background:currentColor;box-shadow:inset 0 1px 3px #fff9de}
.butterfly-pip::before{left:0;transform:rotate(-18deg)}.butterfly-pip::after{right:0;transform:rotate(18deg)}
.butterfly-pip.blue{color:#8cb9d7}.butterfly-pip.yellow{color:#e0bb5c}.butterfly-pip.pink{color:#d39bb8}.butterfly-pip.orange{color:#d99a62}.butterfly-pip.purple{color:#a18ac8}.butterfly-pip.pending{opacity:.6;filter:none}.butterfly-pip.filled{opacity:1;filter:none}
.butterfly-links{display:flex;align-items:center;justify-content:center;gap:12px;flex:none;height:54px;padding:5px 12px;background:linear-gradient(#fff9eb,#f5edda);border-top:1px solid #fff8df}
.butterfly-links .small-button{min-width:145px;min-height:44px;background:#fffcf2}
.butterfly-victory{display:flex;align-items:center;justify-content:center;gap:20px;flex:none;height:110px;padding:10px 18px;background:linear-gradient(#fff9e7,#f3e8cc);border-top:1px solid #fff2c7;color:#78834f}
.butterfly-victory h2{font:400 30px Georgia,serif;margin:0 0 5px}.butterfly-victory p{font-size:16px;line-height:1.5;margin:0;max-width:285px}.butterfly-victory .apple-replay{min-width:150px;min-height:52px;font-size:17px}
#app[data-screen=butterflies] #sceneTitle,#app[data-screen=butterflies] #gameLinks{display:none}
#app[data-screen=butterflies]{--butterfly-win-h:0px}
#app[data-screen=butterflies]:has(#butterflyVictory:not([hidden])){--butterfly-win-h:110px}
#app[data-screen=butterflies]:has(#butterflyVictory:not([hidden])) #butterflyProgress{display:none}
#app[data-screen=butterflies] .stage{width:min(100%,calc((100dvh - var(--toolbar-h) - 54px - var(--butterfly-win-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom))*1.77777778))}
#app[data-screen=butterflies] .stage:fullscreen{width:100vw}
#app[data-screen=butterflies] .stage:fullscreen .scene-frame,#app[data-screen=butterflies] .stage:fullscreen .game-bar,#app[data-screen=butterflies] .stage:fullscreen .butterfly-links,#app[data-screen=butterflies] .stage:fullscreen .butterfly-victory{width:min(100%,calc((100dvh - var(--toolbar-h) - 54px - var(--butterfly-win-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom))*1.77777778))}
.adventure-picture canvas{position:relative;width:140px;height:140px;object-fit:contain;filter:drop-shadow(0 13px 10px #81633140)}
@media(max-width:700px),(max-height:500px){.butterfly-progress{top:8px;gap:10px;padding:7px 12px;min-height:44px;border-radius:16px;font-size:13px}.butterfly-progress strong{font-size:21px}.butterfly-pips{gap:4px}.butterfly-pip{width:16px;height:18px}.butterfly-pip::before,.butterfly-pip::after{width:8px;height:14px;top:2px}.butterfly-victory{gap:12px;padding:8px 12px}.butterfly-victory h2{font-size:23px}.butterfly-victory p{font-size:13px;max-width:200px}.butterfly-victory .apple-replay{min-width:132px;padding:8px 14px;font-size:16px}.butterfly-links{gap:8px}.butterfly-links .small-button{min-width:130px;font-size:13px}}
@media(max-width:350px){.butterfly-progress{gap:7px;padding:6px 10px;font-size:12px}.butterfly-progress strong{font-size:19px}.butterfly-pips{gap:3px}.butterfly-victory{gap:8px}.butterfly-victory .apple-replay{min-width:124px;padding:7px 10px}.butterfly-victory p{font-size:12px}}
@media(prefers-reduced-motion:reduce){.butterfly-pip{transition:none}}
