/* User-supplied artwork; file paths are configured in data.js. */
.ui-icon{display:inline-block;width:28px;height:28px;max-height:none;object-fit:contain;vertical-align:middle}
.brand{display:flex;align-items:center;gap:7px}.brand .ui-icon{width:32px;height:36px}
.hero-ornament{display:flex;align-items:center;justify-content:center;gap:12px;height:34px;margin:0 0 10px}.hero-ornament .ui-icon{width:24px;height:24px}.hero-ornament .ui-icon:nth-child(2){width:60px;height:34px}
.progress span{display:inline-flex;align-items:center;justify-content:center;gap:5px}.progress .ui-icon{width:23px;height:23px}
.seal.seal-avatar{background:none;border:0;box-shadow:none;width:90px;height:76px;padding:0;margin:8px}.seal-avatar .ui-icon{width:100%;height:100%}
button.art-button{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;width:166px;min-width:0;padding:0 6px 4px;border:0;background:transparent;box-shadow:none;border-radius:16px;line-height:1.4;vertical-align:top}
.art-button img{display:block;width:150px;height:100px;max-height:none;object-fit:contain;pointer-events:none}
.art-button span{font-size:12px;letter-spacing:.5px;max-width:100%;color:var(--ink)}
button.art-button:hover{background:transparent;transform:translateY(-3px)}button.art-button:disabled{opacity:.55;transform:none}
.pack-panel{overflow-x:clip;overflow-y:visible}.pack-stage{height:360px;padding:25px 0 0}
.pack{--tear-front:0%;--tear-progress:0;--peel-lift:0px;width:232px;height:auto;aspect-ratio:4/5;background:transparent;border:0;box-shadow:none;overflow:visible;isolation:auto;touch-action:none}
.pack:after{display:none}.pack-layer{position:absolute;inset:0;width:100%;height:100%;max-height:none;object-fit:contain;user-select:none;pointer-events:none}
.pack-body{z-index:1}.pack-closed{z-index:2;opacity:1;clip-path:polygon(var(--tear-front) 0,100% 0,100% 100%,0 100%,0 10.6%,var(--tear-front) 10.6%)}
.pack-strip{z-index:3;opacity:1;clip-path:inset(0 calc(100% - var(--tear-front)) 0 0);transform-origin:12.5% 7.3%;transform:translate(calc(var(--tear)*1px),var(--peel-lift));transition:none}
.pack.tearing,.pack.completing,.pack.opening{animation:none;transform:none}
.pack.opening .pack-strip{animation:strip-release .28s ease-out forwards}
.pack-card-peek{top:52px;width:142px;height:210px;opacity:0;transition:opacity .15s}.pack-card-peek i{background:none;overflow:hidden}.pack-card-peek img{width:100%;height:100%;max-height:none;object-fit:contain}
.pack-card-peek{top:0;left:0;width:100%;height:100%;opacity:1;transition:none;clip-path:polygon(12.4% 4%,var(--tear-front,0%) 4%,var(--tear-front,0%) 10.6%,12.4% 10.6%);pointer-events:none}
.pack-card-peek i{inset:6.5% 21% 18%;border-radius:8px}.drag-hint{margin:8px 0 0}
@keyframes strip-release{from{opacity:1;transform:translate(calc(var(--tear)*1px),var(--peel-lift))}to{opacity:0;transform:translate(calc(var(--tear)*1px),-24px) rotate(-6deg)}}
.card-back,.card-front.image-face{padding:0}.card-back{background:var(--cream)}.card-back:before{display:none}.card-side .card-art{display:block;width:100%;height:100%;max-height:none;object-fit:contain}
.back-label,.sealed-label{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);font-size:10px;line-height:1.6;padding:2px 6px;border-radius:8px;background:#fffaf2e6;white-space:nowrap;color:var(--ink)}
.sealed-detail{display:block;width:min(200px,60vw);height:auto;max-height:38dvh;object-fit:contain;margin:0 auto;border-radius:12px}
.collection-grid .memory-card,.secret-grid .memory-card{width:100%;max-width:none;aspect-ratio:2/3}
.card-fan .memory-card{transform:rotate(calc((var(--i) - (var(--count) - 1)/2)*2deg))}.card-fan .memory-card:hover{transform:translateY(-8px) rotate(calc((var(--i) - (var(--count) - 1)/2)*2deg))}
.flip-focus{max-width:none!important;min-height:0!important;height:auto!important;opacity:1!important;flex:none;transition:transform .3s ease,width .3s ease!important}
.flip-focus:before{display:none}.flip-focus .card-inner{box-shadow:0 12px 45px #49372b55}
.flip-focus.is-flipping{width:var(--from-w)!important;transform:translate(calc(-50% + var(--from-x)),calc(-50% + var(--from-y)))!important}
.flip-focus.is-centered{width:min(250px,65vw)!important;transform:translate(-50%,-50%) scale(1.03)!important}
.magic-bubbles{width:65px;height:55px;position:absolute;left:calc(50% + 30px);top:-16px;transform:rotate(-12deg)}
@media(max-width:700px){
 .hero{padding-top:8px}.hero-ornament{height:28px;margin-bottom:6px}.hero-ornament .ui-icon:nth-child(2){width:48px;height:28px}
 .progress span{gap:3px}.progress .ui-icon{width:19px;height:19px}.pack-stage{height:320px}.pack{width:min(216px,62vw)}
 button.art-button{width:148px}.art-button img{width:132px;height:88px}.art-button span{font-size:11px}
 .card-fan .back-label,.card-fan .sealed-label{font-size:7px;padding:1px 3px;bottom:5px}
 .cards-panel{min-height:520px}.card-fan{min-height:265px}
}

/* Phone-first viewport composition. Long albums scroll inside the app area;
   game screens use the available height rather than assuming a 9:16 device. */
html,body{height:100%;overscroll-behavior:none}
body{overflow:hidden}
.shell{width:min(100%,520px);height:100vh;height:100svh;height:100dvh;max-width:520px;padding:env(safe-area-inset-top,0px) 14px env(safe-area-inset-bottom,0px);display:grid;grid-template-rows:48px minmax(0,1fr) 68px;gap:0}
header{height:auto;min-height:44px;justify-content:flex-end}
header nav{display:flex;gap:8px}header nav button{min-height:44px;font-size:11px;padding:6px 12px}
#app{min-height:0;display:flex;flex-direction:column;overflow-y:auto;overflow-x:clip;scrollbar-width:thin;padding:0 2px}
.hero{padding:8px 0 10px;flex:none}
.hero h1{font-size:clamp(24px,7.5vw,36px);line-height:1.25;letter-spacing:1px;margin:6px 0}
.hero p{font-size:11px;line-height:1.5;margin:6px 0 0}
.progress{margin:10px 0 0;gap:5px}.progress span{font-size:10px;padding:4px 8px}.progress .ui-icon{width:21px;height:21px}
#app>.panel{flex:1;min-height:0;margin:0 0 4px;padding:14px 12px;display:flex;flex-direction:column;justify-content:center}
.panel-controls{flex:none;margin-top:10px;min-height:80px;grid-template-columns:minmax(0,1fr) 84px;gap:8px}
.panel-controls .npc{font-size:10px;line-height:1.4}.panel-controls .seal-avatar{width:58px;height:49px}
button.art-button{width:88px;min-height:60px}.art-button img{width:82px;height:55px}.art-button span{font-size:10px;letter-spacing:0}
.opening-panel .gift{flex:none;width:150px;height:130px;margin:auto auto 18px}.opening-panel .gift:before{left:61px}.opening-panel .gift:after{left:23px}
.opening-panel .placeholder{margin:0}.opening-panel .panel-controls{margin-top:auto}
/* Opening pack: identical, uncropped 5:4 canvases. Only the strip moves. */
.mystery-stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden;container-type:size}
.mystery-pack{--mystery-seam:20.3125%;--mystery-top:7.8125%;position:relative;flex:none;width:min(100%,480px,57dvh);aspect-ratio:5/4;touch-action:none;user-select:none;isolation:isolate}
@supports(width:1cqh){.mystery-pack{width:min(100%,480px,57dvh,125cqh)}}
@supports not (width:1cqh){@media(orientation:landscape) and (max-height:500px){.mystery-pack{width:min(100%,24dvh)}}}
.mystery-layer{position:absolute;inset:0;display:block;width:100%;height:100%;max-width:none;max-height:none;object-fit:contain;pointer-events:none;user-select:none;transition:none}
/* Exact same master and contain rectangle for all layers; no independent crop,
   scaling or alignment. Keep the body fixed below y=260 of the display grid.
   The shared upper mask excludes stray source pixels above the actual seal. */
.mystery-open{z-index:1;clip-path:inset(var(--mystery-seam) 0 0)}
.mystery-sealed{z-index:2;clip-path:inset(var(--mystery-top) 0 calc(100% - var(--mystery-seam)) var(--mystery-front,0%))}
.mystery-strip{z-index:3;opacity:var(--mystery-strip-opacity,1);clip-path:inset(var(--mystery-top) calc(100% - var(--mystery-front,0%)) calc(100% - var(--mystery-seam)) 0);transform:translate(var(--mystery-drag,0px),var(--mystery-lift,0px));transition:none}
.mystery-hint{flex:none;margin:0 0 6px;font-size:11px;line-height:1.5}
.mystery-pack:focus-visible{outline:3px solid #c3a478;outline-offset:3px;border-radius:12px}
/* Scheme B: the wrapper never moves; light begins at the package mouth. */
.mystery-pack[data-stage="glowing"] .mystery-strip,.mystery-pack[data-stage="transitioning"] .mystery-strip{opacity:0}
/* The accepted master needs no wide seam cover. Retain only a fine, quiet
   luminous tear guide, split at the same front as the actual packaging. */
.mystery-seam-light{position:absolute;inset:0;z-index:3;pointer-events:none}
.mystery-seam-light:before{content:'';position:absolute;left:17.4%;top:20%;width:66.7%;height:.55%;border-radius:999px;background:linear-gradient(90deg,#ffe3ee00,#ffe8f4 5%,#fff7dd 18%,#fffbed 50%,#fff2e0 82%,#ffe8f4 95%,#ffe3ee00);box-shadow:0 0 4px #fff4dda0}
.mystery-seam-fixed{clip-path:inset(0 0 0 var(--mystery-front,0%))}
.mystery-seam-moving{z-index:4;clip-path:inset(0 calc(100% - var(--mystery-front,0%)) 0 0);transform:translate(var(--mystery-drag,0px),var(--mystery-lift,0px));opacity:var(--mystery-strip-opacity,1)}
.mystery-pack[data-stage="glowing"] .mystery-seam-moving,.mystery-pack[data-stage="transitioning"] .mystery-seam-moving{opacity:0}
.mystery-mouth-glow{position:absolute;z-index:4;pointer-events:none;left:19%;top:17.3%;width:64%;height:6%;border-radius:50%;background:radial-gradient(ellipse,#fff9eac9 0%,#fff4db6b 42%,#fff8ed00 75%);opacity:0;transform:scale(.85);transition:opacity 300ms ease,transform 300ms ease}
.mystery-pack[data-stage="glowing"] .mystery-mouth-glow,.mystery-pack[data-stage="transitioning"] .mystery-mouth-glow{opacity:1;transform:scale(1)}
.mystery-screen-light{position:fixed;inset:0;z-index:2000;pointer-events:none;background:radial-gradient(circle at var(--light-x) var(--light-y),#fffaf1 0%,#fff8f0 40%,#fdf0ef 75%,#edf3f8 100%);clip-path:circle(0px at var(--light-x) var(--light-y));transition:clip-path 350ms cubic-bezier(.22,.65,.35,1),opacity 350ms ease;opacity:1}
.mystery-screen-light.is-expanded{clip-path:circle(var(--light-radius) at var(--light-x) var(--light-y))}.mystery-screen-light.is-fading{opacity:0}
.selection-panel.is-revealing .pack-choice img{animation:six-pack-reveal 350ms ease-out both;animation-delay:calc(var(--i)*40ms)}
@keyframes six-pack-reveal{from{opacity:0;transform:translateY(12px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}
/* Secret 01: original RGBA artwork, CSS pocket occlusion and HTML text. */
dialog.letter-dialog{width:min(560px,94vw);padding:38px 12px 14px;overflow-y:auto}
.birthday-letter h2{font-size:20px;margin:0 0 4px}.letter-stage{position:relative;width:100%;aspect-ratio:4/3;isolation:isolate;outline-offset:2px}
.letter-layer{position:absolute;inset:0;display:block;width:100%;height:100%;max-height:none;object-fit:contain;pointer-events:none;user-select:none;transition:opacity 250ms ease,transform 300ms ease}
.letter-closed{z-index:5;opacity:1;transform:scale(.86);transform-origin:50% 88.5%}
.letter-open{z-index:1;opacity:0}.letter-half{z-index:2;opacity:0;clip-path:inset(15% 19% 28%);transform:translateY(11%);transition:opacity 180ms ease,transform 600ms cubic-bezier(.2,.7,.3,1)}
.letter-pocket{z-index:3;opacity:0;clip-path:polygon(13.1% 34.4%,45% 60%,50% 54.5%,55% 60%,86.8% 34.4%,86.8% 89%,13.1% 89%)}
.letter-sheet{position:absolute;inset:0;z-index:4;opacity:0;transform:translateY(8%) scale(.96);transition:opacity 300ms ease,transform 300ms ease;pointer-events:none}
.letter-stage[data-state="opened"] .letter-closed,.letter-stage[data-state="extracting"] .letter-closed,.letter-stage[data-state="unfolding"] .letter-closed,.letter-stage[data-state="paper"] .letter-closed{opacity:0}
.letter-stage[data-state="opened"] .letter-open,.letter-stage[data-state="opened"] .letter-pocket,.letter-stage[data-state="extracting"] .letter-open,.letter-stage[data-state="extracting"] .letter-pocket{opacity:1}
.letter-stage[data-state="extracting"] .letter-open{clip-path:polygon(evenodd,0 0,100% 0,100% 100%,0 100%,0 0,19% 26%,19% 75%,81% 75%,81% 26%,19% 26%)}
.letter-stage[data-state="extracting"] .letter-half{opacity:1;transform:translateY(0);transition:transform 600ms cubic-bezier(.2,.7,.3,1)}
.letter-stage[data-state="unfolding"] .letter-half{opacity:0;transform:translateY(-12%)}
.letter-stage[data-state="unfolding"] .letter-sheet,.letter-stage[data-state="paper"] .letter-sheet{opacity:1;transform:translateY(0) scale(1)}
.letter-stage[data-state="paper"] .letter-sheet{pointer-events:auto}
.letter-copy{position:absolute;inset:22% 15% 22%;white-space:pre-wrap;text-align:left;font-size:clamp(12px,3.6vw,16px);line-height:1.75;color:var(--ink);overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin}
.letter-copy[hidden]{display:none}.letter-copy:not([hidden]){animation:letter-copy-in 180ms ease both}.pending-copy{color:var(--muted);text-align:center}
@keyframes letter-copy-in{from{opacity:0}to{opacity:1}}
.birthday-letter .letter-status{font-size:11px;line-height:1.5;margin:4px 0 8px}.birthday-letter>button{min-height:44px;font-size:12px}
.letter-stage.letter-no-art{aspect-ratio:auto;min-height:140px}.letter-no-art .letter-layer{display:none}.letter-no-art .letter-sheet{position:relative;min-height:140px}.letter-no-art .letter-copy{position:relative;inset:auto;padding:16px}
@media(prefers-reduced-motion:reduce){.mystery-layer,.mystery-mouth-glow,.mystery-screen-light,.letter-layer,.letter-sheet{transition:none}.mystery-strip,.selection-panel.is-revealing .pack-choice img,.letter-copy:not([hidden]){animation:none}}
/* Full-canvas NPC slots: stable PNG coordinates, never bob the whole seal. */
.seal-sprite{position:relative;display:block;width:90px;aspect-ratio:1/1;flex:none;pointer-events:none;user-select:none;animation:none!important;transform:none!important}
.seal-frame{position:absolute;inset:0;display:block;width:100%;height:100%;max-height:none;object-fit:contain;pointer-events:none}.seal-frame[hidden]{display:none}
.panel-controls .seal-sprite{margin:0 0 2px auto}.panel-controls .npc:has([data-seal-animation="stir"]){min-width:90px}
.collection-scene{display:flex;flex-direction:column;align-items:flex-end;right:10px;left:10px;bottom:10px}.collection-scene .mini-cauldron{display:none}.collection-scene .npc{margin:0;text-align:right;max-width:160px;font-size:11px;line-height:1.5}.collection-scene .seal-sprite{width:110px;margin-left:auto}.collection-scene p:empty{display:none}
#app[data-page="bake"] .cauldron{visibility:hidden}.handoff-stage{display:flex;justify-content:flex-end;min-height:240px;align-items:flex-end}.handoff-stage .seal-sprite{width:min(240px,65vw)}.seal-handoff h2{font-size:20px;margin:0}.seal-handoff p{font-size:12px}
.material-art .card-inner{box-shadow:none;border-radius:0}.material-art .card-front{background:transparent;border:0;border-radius:0;overflow:visible}.material-art .card-art,.material-dialog .full-card{background:transparent;box-shadow:none}
/* User-replaced game originals now share the 2:3 dealing/back ratio. */
.game-art .card-inner{box-shadow:none;border-radius:0}
.game-art .card-front{padding:0;border:0;border-radius:0;background:transparent;overflow:visible}
.game-art .card-front .card-art{width:100%;height:auto;aspect-ratio:2/3;object-fit:contain;background:transparent;border:0;border-radius:0}
.collection-grid .game-art{aspect-ratio:2/3;min-height:0}
dialog.game-dialog{width:min(600px,94vw,calc(72dvh * 2 / 3 + 36px));padding-top:52px;background:var(--cream)}
.game-dialog>.close{top:6px;right:6px;min-width:44px;height:44px;padding:0;font-size:24px}
.game-dialog .full-card{width:100%;height:auto;max-height:none;aspect-ratio:2/3;object-fit:contain;background:transparent;border:0;border-radius:0;box-shadow:none}
/* Baking is the only scene with a centered working NPC. Collection stays unchanged. */
#app>.baking-panel{justify-content:flex-start}
.baking-workspace{position:relative;flex:1;min-height:270px;width:100%;max-width:420px;margin:0 auto;container-type:size;isolation:isolate}
.baking-host{position:absolute;left:50%;top:50%;width:56%;max-width:250px;transform:translate(-50%,-50%);z-index:1}
.baking-host .seal-sprite{width:100%;margin:0}
@supports(width:1cqh){.baking-host{width:min(56%,250px,68cqh)}}
.floating-ingredient{position:absolute;left:calc(14% + var(--side)*72%);top:calc(4% + var(--row)*31%);width:24%;height:28%;max-width:96px;margin:0;transform:translateX(-50%);pointer-events:none;z-index:2;text-align:center}
.ingredient-art{display:flex;align-items:center;justify-content:center;height:calc(100% - 20px);max-height:100px;animation:ingredient-float 3.8s ease-in-out infinite;animation-delay:calc(var(--i)*-.55s);mask-image:radial-gradient(ellipse,#000 65%,#0000 100%);-webkit-mask-image:radial-gradient(ellipse,#000 65%,#0000 100%)}
.ingredient-art svg{display:block;width:75%;height:75%;overflow:hidden}
.floating-ingredient figcaption{font-size:10px;line-height:18px;white-space:nowrap;color:var(--ink)}
.baking-panel #baking-status{flex:none;font-size:11px;line-height:1.5;margin:8px 0;text-align:center}
.baking-actions{flex:none;justify-content:flex-start;align-items:center;gap:8px;min-height:52px}
.baking-actions button{min-height:44px;font-size:12px;padding:8px 12px}
.baking-actions .primary{min-width:0}
.baking-workspace.is-mixing .ingredient-art{animation-duration:2.6s}
@keyframes ingredient-float{0%,100%{transform:translateY(3px) rotate(-2deg)}50%{transform:translateY(-5px) rotate(2deg)}}
@media(prefers-reduced-motion:reduce){.ingredient-art{animation:none!important}}
@media(max-height:560px){.baking-workspace{min-height:210px}.floating-ingredient figcaption{font-size:9px}}
.mystery-pack:not([data-assets-ready="true"]) .mystery-layer,.letter-stage:not([data-assets-ready="true"]) .letter-layer,.seal-sprite:not([data-assets-ready="true"]) .seal-frame{visibility:hidden}
/* Secret 02: geometry-only frame repair. Opening 797 x (797*16/9), at 12,147. */
dialog.video-dialog{width:min(94vw,calc(82dvh * 7389 / 15866 + 24px));padding:12px;border:0;background:transparent;overflow:visible;box-shadow:none}
.video-dialog>.close{z-index:10;top:-8px;right:-8px;background:var(--cream);border-radius:50%;width:44px;height:44px;font-size:23px}
.birthday-video{position:relative}.birthday-video-player{position:relative;width:100%;aspect-ratio:7389/15866;animation:video-player-pop 850ms cubic-bezier(.2,.7,.2,1) both;isolation:isolate}
.video-frame-art{position:absolute;inset:0;width:100%;height:100%;max-height:none;object-fit:contain;pointer-events:none;border-radius:4px}
.birthday-video-viewport{position:absolute;left:1.46163215590743%;top:8.338585654859449%;width:97.07673568818514%;aspect-ratio:9/16;display:flex;align-items:center;justify-content:center;overflow:hidden}
.video-surface{position:relative;width:100%;aspect-ratio:9/16;flex:none}.video-surface video{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain;background:transparent}
.video-surface video[hidden]{display:none}
.video-placeholder{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;font-size:12px;line-height:1.8;color:var(--muted);pointer-events:none}.video-placeholder[hidden]{display:none}
.video-hotspot{position:absolute;z-index:3;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:0;border-radius:50%;background:transparent;transform:translate(-50%,-50%)}
.video-hotspot:hover{background:#fff8f030;transform:translate(-50%,-50%)}.video-hotspot:disabled{opacity:1}
.video-play{left:50%;top:93.3049892852641%}.video-replay{left:36.3%;top:92.88111685364932%}.video-close{left:94.2%;top:96.57641497541914%}
.video-play.is-playing:after{content:'Ⅱ';display:flex;align-items:center;justify-content:center;margin:auto;width:20px;height:24px;background:#ffd9df;border-radius:50%;font-size:18px;font-weight:bold;color:#a5565b}
.birthday-video .video-status{margin:4px 0 0;font-size:10px;line-height:1.4;color:var(--ink);background:#fffaf1e6;border-radius:5px;padding:3px}
.video-spark{position:absolute;left:50%;top:50%;width:14px;height:14px;border-radius:50%;background:#efc4d3;box-shadow:0 0 24px 12px #f1c4d966;animation:video-spark-away 850ms ease both;pointer-events:none}
@keyframes video-player-pop{0%{opacity:0;transform:scale(.08)}25%{opacity:.25;transform:scale(.32)}75%{opacity:1;transform:scale(1.035)}100%{opacity:1;transform:scale(1)}}
@keyframes video-spark-away{0%,15%{opacity:1;transform:translate(-50%,-50%) scale(.5)}50%{opacity:.6;transform:translate(-50%,-50%) scale(5)}100%{opacity:0;transform:translate(-50%,-50%) scale(7)}}
@media(prefers-reduced-motion:reduce){.birthday-video-player,.video-spark{animation:none}.video-spark{display:none}}
#app>.selection-panel{border:0;background:transparent;box-shadow:none;padding:0 2px;justify-content:center}
.selection-panel h2{font-size:clamp(12px,3.6vw,18px);letter-spacing:.5px;line-height:1.6;margin:12px 0 0;flex:none}
.selection-panel .panel-controls{margin-top:auto}
.boxes{--choice-width:clamp(120px,43vw,190px);position:relative;display:block;flex:1;min-height:190px;width:100%;margin:8px 0 0;isolation:isolate;overflow-x:clip;overflow-y:visible}
.boxes .pack-choice{position:absolute;left:calc((100% - var(--choice-width))/var(--choice-gaps,5)*var(--i));top:50%;width:var(--choice-width);height:auto;aspect-ratio:4/5;min-height:0;max-width:none;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible;transform:translateY(-50%) rotate(var(--angle));z-index:calc(var(--i) + 1);touch-action:manipulation}
.boxes[data-count="1"] .pack-choice{left:calc((100% - var(--choice-width))/2)}
.all-packs-complete{position:absolute;inset:40% 0 auto;text-align:center;font-size:14px}
.boxes .pack-choice:before{display:none}
.boxes .pack-choice img{display:block;width:100%;height:100%;max-height:none;object-fit:contain;pointer-events:none;user-select:none;transition:filter .2s,opacity .2s}
.boxes .pack-choice.opened{background:transparent}
.boxes .pack-choice.completed img{opacity:.6;filter:saturate(.6)}
.boxes .pack-choice:focus-visible{z-index:10;background:transparent;transform:translateY(calc(-50% - 10px)) rotate(0deg)}
.boxes .pack-choice.is-picked{opacity:0}
.is-selecting-pack .pack-choice{pointer-events:none}
.pack-selection-flight{position:fixed;left:50%;top:50%;width:var(--from-w);height:auto;aspect-ratio:4/5;max-width:none;max-height:none;object-fit:contain;z-index:1200;pointer-events:none;filter:drop-shadow(0 12px 12px #8b69532b);animation:pack-choice-flight .72s cubic-bezier(.2,.75,.2,1) both}
@keyframes pack-choice-flight{
 0%{transform:translate(calc(-50% + var(--from-x)),calc(-50% + var(--from-y))) scale(1)}
 35%{transform:translate(calc(-50% + var(--from-x)),calc(-50% + var(--from-y) - 40px)) scale(1.08)}
 85%,100%{transform:translate(-50%,-50%) scale(var(--flight-scale))}
}
.pack-stage{flex:1;min-height:190px;height:auto;padding:10px 0 0}
.pack{width:min(216px,62vw,34dvh);flex:none}
.pack.from-selection{animation:selection-settle .18s ease both}
@keyframes selection-settle{from{opacity:.75}to{opacity:1}}
.pack-panel .drag-hint{margin:4px 0;font-size:11px;flex:none}
.cards-panel .card-fan{flex:1;min-height:180px;padding:28px 3px;align-items:center}
.cards-panel .pack-count{flex:none;margin:6px 0;font-size:11px}
.cake-art{width:min(100%,240px,30dvh);margin:8px auto}.cake-art img{max-height:23dvh}.candles{font-size:28px}
.secret-grid{flex:none;width:min(100%,240px);margin:10px auto;gap:12px}
.secret-grid .memory-card{min-height:0;max-width:none}
#app[data-page="ending"] h2{font-size:20px;margin:8px 0}#app[data-page="ending"] p{margin:5px 0}
#app[data-page="movies"]>.panel,#app[data-page="collection"]>.panel{display:block;flex:none}
#app[data-page="movies"]>.actions,#app[data-page="collection"]>.actions{justify-content:flex-start;flex:none}
footer{padding:4px 0 0;font-size:10px;line-height:1.4;letter-spacing:.6px;display:flex;flex-direction:column;align-items:center;justify-content:center}
footer button{margin:0;min-height:44px;padding:4px 12px;font-size:10px;border:0;background:transparent;text-decoration:underline;text-underline-offset:3px}
dialog{max-height:calc(100vh - 24px);max-height:calc(100svh - 24px);max-height:calc(100dvh - 24px);overflow:auto}
#notice{z-index:1300;bottom:max(12px,env(safe-area-inset-bottom,0px));font-size:11px}
@media(max-height:660px){
 .shell{grid-template-rows:44px minmax(0,1fr) 64px}.hero{padding:3px 0 5px}.hero h1{font-size:25px}
 .progress{margin-top:6px}.panel-controls{min-height:68px;margin-top:6px}.boxes{min-height:145px}
 .pack-stage{min-height:150px}.cards-panel .card-fan{min-height:140px;padding:18px 2px}
 .opening-panel .gift{margin:24px auto 12px}.secret-grid{width:180px;margin:6px auto}
}
@media(prefers-reduced-motion:reduce){.pack-selection-flight{animation:none}.boxes .pack-choice,.boxes .pack-choice img{transition:none}.pack.from-selection{animation:none}}
@media(max-width:350px){.panel-controls button.art-button{width:80px}.panel-controls .art-button img{width:74px;height:50px}}
@media(prefers-reduced-motion:reduce){.pack.opening{animation:none}.pack.opening .pack-strip{animation:none;opacity:0}}

/* Confirmed flow simplification: footer controls are in normal flow, never
   overlaid on the pack, card fan or touch gesture region. */
.panel-controls{display:grid;grid-template-columns:minmax(0,1fr) 84px;align-items:end;gap:8px;margin-top:10px;min-height:80px;text-align:left}
.panel-controls .actions,.panel-controls .pack-actions{display:flex;justify-content:flex-start;align-items:flex-end;gap:8px;flex-wrap:wrap;min-width:0}
.panel-controls .npc{margin:0;text-align:right;min-width:0;font-size:10px;line-height:1.4}
.panel-controls .seal-avatar{display:flex;margin:0 0 4px auto;width:58px;height:49px}
button.art-button{width:88px;min-height:60px;padding:0 3px 4px}
.art-button img{width:82px;height:55px}
.art-button span{font-size:10px;line-height:1.4}
.panel-controls button:not(.art-button){min-height:44px;padding:8px 12px;font-size:12px;min-width:0}
.pack-choice{height:auto;min-height:170px;background:#fff8f0;box-shadow:3px 4px 0 #d8c9b438;padding:4px 2px 12px}
.pack-choice:before{display:none}.pack-choice img{display:block;width:100%;height:135px;max-height:none;object-fit:contain;margin:auto}
.pack-choice.opened{background:#f3e9e4}.pack-choice small{letter-spacing:0;line-height:1.7}
.cards-panel.collecting .panel-controls{opacity:0;pointer-events:none}
@media(max-width:700px){
 .panel-controls{grid-template-columns:minmax(0,1fr) 84px;gap:8px;margin-top:10px;min-height:80px}
 .panel-controls .actions,.panel-controls .pack-actions{gap:4px}
 .panel-controls .npc{font-size:10px}.panel-controls .seal-avatar{width:58px;height:49px}
 button.art-button{width:88px;min-height:60px}.art-button img{width:82px;height:55px}.art-button span{font-size:10px;letter-spacing:0}
 .pack-choice{min-height:158px}.pack-choice img{height:118px}
 header nav{display:flex;gap:4px}header nav button{padding:7px 8px;font-size:11px;min-height:44px}.brand{gap:3px;letter-spacing:1px;font-size:12px}.brand .ui-icon{width:24px}
}
