/* Child-first prize collection, offline and without third-party libraries. */
.sound-toggle{display:grid;place-items:center;flex:none;width:44px;height:44px;min-height:44px;border-radius:16px;background:#fff;border:1px solid #e4ddce;font-size:23px}
.game-header .sound-toggle{width:40px;height:44px;min-width:40px;font-size:21px}
.sticker-collection{position:absolute;inset:0;z-index:15;display:flex;flex-direction:column;gap:12px;padding:max(14px,env(safe-area-inset-top)) 16px max(14px,env(safe-area-inset-bottom));background:#fff8ed;overflow:hidden}
.sticker-collection[hidden],.reward-popup[hidden]{display:none!important}
.sticker-header{display:flex;align-items:center;justify-content:space-between;gap:10px}
.sticker-header h2{font-size:clamp(20px,5vw,26px);margin:0}
.sticker-header>span{font-size:14px;font-weight:800;color:#6a7967;white-space:nowrap}
.sticker-back{background:#fff;border:1px solid #dedbd0;border-radius:16px;font-size:34px;width:52px;height:52px;flex:none}
.sticker-body{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;justify-content:flex-start;gap:18px}
.sticker-empty{margin:auto 4px;align-self:stretch;padding:22px 18px;text-align:center;border:2px dashed #c8d6be;background:#f2f9ec;border-radius:30px;max-width:470px}
.sticker-big{font-size:70px;margin:0 auto 8px}
.sticker-empty h3{font-size:25px;margin:5px 0 10px}
.sticker-empty p{font-size:17px;line-height:1.5;color:#5a6b57}
.sticker-empty-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:20px}
.sticker-button{display:grid;place-items:center;min-height:52px;padding:10px 16px;border-radius:18px;background:#fff;border:1px solid #dedbd1;font-weight:800;cursor:pointer}
.sticker-empty-actions .sticker-button{background:#fffdf4;font-size:16px}
.sticker-intro{text-align:center;color:#6a765f;margin:6px 0 0;font-size:15px}
.sticker-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding-bottom:20px}
.sticker-owned{padding:8px 5px;border-radius:22px;background:#fff;border:2px solid #f0db95;display:flex;flex-direction:column;gap:4px;min-width:0}
.sticker-owned img{width:100%;aspect-ratio:1;object-fit:contain;background:#fff}
.sticker-owned strong{font-size:13px;font-weight:800;text-align:center}
.sticker-detail{position:absolute;inset:15%;z-index:20;background:#fff;border:2px solid #f1d790;border-radius:25px;box-shadow:0 0 0 300px #23304755;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;padding:15px}
.sticker-detail img{max-width:100%;max-height:60%;object-fit:contain}
.sticker-detail h3{margin:0}
.reward-popup{position:absolute;inset:0;z-index:40;display:grid;place-items:center;overflow:hidden}
.reward-shade{position:absolute;inset:0;background:#37426194;backdrop-filter:blur(4px)}
.reward-panel{position:relative;z-index:2;background:#fffdf7;border:5px solid #f5d963;box-shadow:0 18px 45px #26374855;border-radius:32px;text-align:center;padding:22px 16px;max-width:420px;width:calc(100% - 30px);animation:reward-enter .32s ease-out}
.reward-stars{font-size:32px}
.reward-panel h2{font-size:31px;color:#43874d;margin:5px 0}
.reward-panel p{font-size:17px;font-weight:750;margin:8px 0}
.reward-images{display:flex;align-items:center;justify-content:center;gap:12px;height:min(30vh,205px);padding:8px}
.reward-images img{height:100%;width:46%;object-fit:contain;background:white;border-radius:20px;box-shadow:0 5px 12px #4b5e4233;animation:sticker-arrive .5s ease-out}
.reward-images img:only-child{width:55%}
.reward-trophy{font-size:90px}
.reward-actions{display:flex;flex-direction:column;gap:10px}
.reward-actions button{min-height:53px;border-radius:17px;background:#e1f2da;border:2px solid #a8d19e;font-size:17px;font-weight:800}
.reward-actions button:last-child{background:#fff;border-color:#e9e3d8}
.confetti-layer{position:absolute;inset:0;z-index:3;pointer-events:none;overflow:hidden}
.confetti-piece{position:absolute;left:var(--x);top:-30px;width:11px;height:17px;border-radius:2px;background:var(--c);animation:confetti-fall var(--duration) ease-in var(--delay) both}
.memory-card[data-face=matched] .memory-inner{animation:matched-pop .35s ease-out}
#placed-pieces image{animation:piece-placed .3s ease-out}
@keyframes confetti-fall{0%{transform:translateY(-10vh) rotate(0);opacity:1}95%{opacity:1}100%{transform:translateY(110vh) rotate(var(--spin));opacity:0}}
@keyframes reward-enter{from{transform:scale(.65);opacity:.4}to{transform:scale(1);opacity:1}}
@keyframes sticker-arrive{from{transform:rotate(-18deg) scale(.3)}to{transform:rotate(0) scale(1)}}
@keyframes matched-pop{0%{transform:rotateY(0) scale(.9)}55%{transform:rotateY(0) scale(1.09)}100%{transform:rotateY(0) scale(1)}}
@keyframes piece-placed{from{opacity:.4;transform:scale(.96)}to{opacity:1;transform:scale(1)}}
@media(max-width:350px){.sticker-grid{gap:6px}.sticker-owned strong{font-size:11px}.reward-panel{padding:12px}.game-header .sound-toggle{width:35px;min-width:35px}}
@media(prefers-reduced-motion:reduce){.confetti-piece,.reward-panel,.reward-images img,.memory-card[data-face=matched] .memory-inner,#placed-pieces image{animation:none!important}}

.sticker-loading{margin:auto;text-align:center;font-size:18px;color:#6b766b}
/* Sticker scenery workshop: 4 large backgrounds and draggable transparent animals. */
.scene-editor{flex:1;min-height:0;display:flex;flex-direction:column;gap:8px}
.scene-instruction{margin:0;text-align:center;font-size:14px;font-weight:800;color:#607268;flex:none}
.scene-choices{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;flex:none}
.scene-choice.sticker-button{min-height:47px;min-width:0;padding:4px 2px;border-radius:14px;font-weight:850;font-size:clamp(11px,3.3vw,14px);background:#fff;color:#3e5063}
.scene-choice[aria-pressed=true]{background:#def1e1;border:2px solid #79b78c}
.scene-board{position:relative;flex:1;min-height:130px;width:100%;max-width:440px;align-self:center;border:5px solid #f1d46e;border-radius:24px;box-shadow:0 5px 0 #dfc369;overflow:hidden;touch-action:none;background:#c7ebd0}
.scene-background{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;user-select:none;pointer-events:none}
.scene-stickers{position:absolute;inset:0;overflow:hidden}
.scene-sticker{position:absolute;transform:translate(-50%,-50%);background:transparent;border:0;padding:0;aspect-ratio:1;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;filter:drop-shadow(0 3px 3px #1c384d45)}
.scene-sticker[aria-pressed=true]{outline:3px dashed #fff;border-radius:15px;outline-offset:2px;filter:drop-shadow(0 4px 3px #1c384d55)}
.scene-sticker img{width:100%;height:100%;object-fit:contain;pointer-events:none;-webkit-user-drag:none}
.scene-controls{display:flex;align-items:center;justify-content:center;gap:10px;flex:none}
.scene-controls button{display:grid;place-items:center;width:50px;height:45px;border-radius:13px;background:#fff;border:1px solid #d6d9d0;font-weight:850;font-size:26px}
.scene-controls button:disabled{opacity:.32}
.scene-controls span{flex:1;min-width:0;max-width:165px;font-size:12px;color:#728072;font-weight:750;text-align:center;line-height:1.2}
.scene-tray-label{flex:none;text-align:center;font-size:12px;line-height:1.25;font-weight:800;color:#667365;margin:0}
.scene-tray{display:flex;align-items:center;gap:8px;overflow-x:auto;overflow-y:hidden;min-height:88px;height:88px;max-width:100%;padding:3px 2px 5px;scrollbar-width:none;flex:none}
.scene-tray::-webkit-scrollbar{display:none}
.sticker-tray-item.sticker-owned{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:0 0 83px;width:83px;min-width:83px;height:82px;min-height:0;padding:5px 3px;border:2px solid #e7d6a9;border-radius:15px;background:#fff}
.sticker-tray-item img{width:55px;height:54px;object-fit:contain}
.sticker-tray-item strong{font-size:11px;font-weight:800}
@media(max-height:650px){.sticker-collection{padding-top:8px;padding-bottom:8px;gap:7px}.scene-editor{gap:5px}.scene-instruction{font-size:12px}.scene-choice.sticker-button{min-height:40px}.scene-tray{height:74px;min-height:74px}.sticker-tray-item.sticker-owned{height:71px}.sticker-tray-item img{height:44px}.scene-controls button{height:40px}.scene-tray-label{font-size:11px}}
@media(max-height:530px) and (orientation:landscape){
 .sticker-collection{padding:6px 12px;gap:3px}
 .sticker-header{min-height:42px;height:42px}
 .sticker-header .sticker-back{width:44px;height:42px}
 .sticker-body{overflow:hidden}
 .scene-editor{display:grid;grid-template-columns:minmax(0,1fr) 168px;grid-template-rows:40px minmax(0,1fr) 55px;gap:5px;min-height:0}
 .scene-instruction,.scene-tray-label{display:none}
 .scene-choices{grid-column:1/-1;grid-row:1;display:flex;align-items:stretch;justify-content:center;gap:5px}
 .scene-choice.sticker-button{min-height:38px;min-width:90px}
 .scene-board{grid-column:1;grid-row:2/4;height:100%;min-height:0;max-width:none;width:100%;margin:0}
 .scene-controls{grid-column:2;grid-row:2;align-self:center;display:flex;flex-wrap:wrap;gap:4px}
 .scene-controls button{width:45px;height:42px}
 .scene-controls span{flex:0 0 100%;order:4;font-size:10px}
 .scene-tray{grid-column:2;grid-row:3;height:54px;min-height:54px;align-self:center;padding:0}
 .sticker-tray-item.sticker-owned{height:50px;flex:0 0 59px;min-width:59px;width:59px;gap:0}
 .sticker-tray-item img{height:34px;width:43px}
 .sticker-tray-item strong{font-size:9px}
}

/* Safari/WebKit drag: keep a fixed layout anchor, transform only the sticker compositor layer. */
.scene-board{isolation:isolate;contain:layout paint}
.scene-stickers{isolation:isolate;transform:translateZ(0);-webkit-transform:translateZ(0)}
.scene-sticker{left:50%;top:50%;transform:translate3d(-50%,-50%,0);-webkit-backface-visibility:hidden;backface-visibility:hidden;will-change:transform;contain:layout style;filter:none!important;-webkit-filter:none!important;z-index:1}
.scene-sticker.dragging{z-index:10;cursor:grabbing}
.scene-sticker img{backface-visibility:hidden;-webkit-backface-visibility:hidden;transform:translateZ(0);-webkit-transform:translateZ(0)}
.scene-sticker.dragging[aria-pressed=true]{outline:none!important;box-shadow:none!important}
