/* Speelveld en schermen van Paw Makeover v2. Eigenaar: lead. Activities: alleen eigen css/act-<type>.css met prefix .act-<type>. */
.scene-bg { display: none; position: fixed; inset: 0; z-index: -1; background: var(--scene-bg) center / cover no-repeat, var(--color-bg); filter: hue-rotate(var(--scene-tint, 0deg)); }
body[data-state="playing"] .scene-bg, body[data-state="paused"] .scene-bg, body[data-state="reveal"] .scene-bg { display: block; }
body[data-state="playing"], body[data-state="paused"], body[data-state="reveal"] { background: transparent; overflow: hidden; height: 100dvh; }
body[data-state="playing"] .bg-layer, body[data-state="paused"] .bg-layer, body[data-state="reveal"] .bg-layer { display: none !important; }
html[data-bg-art~="home"] body[data-state="reveal"] { background: transparent; }
body[data-state="playing"] #app, body[data-state="paused"] #app, body[data-state="reveal"] #app { max-width: none; padding: 0; height: 100dvh; min-height: 0; overflow: hidden; }

/* ----- game-layout: portret = hud / voortgang / speelveld / paneel; landschap = speelveld links, paneel rechts ----- */
[data-screen="game"] { height: 100dvh; display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; position: relative;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
.hud { grid-row: 1; grid-column: 1 / -1; gap: 8px; }
.hud .btn-icon { width: 52px; height: 52px; min-width: 52px; padding: 0; border-radius: 50%; flex: none; }
.hud-info { flex: 1; min-width: 0; align-items: center; gap: 0; }
.theme-chip { display: inline-block; max-width: 100%; padding: 6px 16px; font-weight: 900; font-size: clamp(15px, 4.4vw, 20px); line-height: 1.15; text-align: center; color: var(--color-text); background: rgba(255, 253, 249, .92); border: 3px solid var(--cream-50); border-radius: 999px; box-shadow: 0 3px 0 rgba(73, 55, 47, .18), 0 6px 12px rgba(73, 55, 47, .15); text-wrap: balance; }
.hud-level { font-size: 12px; font-weight: 800; color: var(--color-text); margin-top: 3px; padding: 1px 10px; background: rgba(255, 253, 249, .8); border-radius: 99px; }
#progress { grid-row: 2; grid-column: 1 / -1; height: 10px; margin: 6px 6px 4px; border-radius: 99px; background: rgba(255, 253, 249, .7); border: 2px solid var(--cream-50); overflow: hidden; box-shadow: 0 2px 4px rgba(73, 55, 47, .15); }
.progress-fill { display: block; height: 100%; width: var(--pct, 0%); border-radius: 99px; background: linear-gradient(var(--mint-300), var(--mint-500)); transition: width .25s cubic-bezier(.18, .85, .25, 1); }
.stage-slot { grid-row: 3; grid-column: 1; position: relative; min-height: 0; min-width: 0; }
.stage { position: absolute; inset: 0; }
.side { grid-row: 4; grid-column: 1; position: relative; z-index: 2; padding: 6px 4px 2px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; max-height: 36dvh; }
.act-panel { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-height: 0; }
.act-panel:empty { display: none; }
.act-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 40; }
.act-overlay > * { pointer-events: auto; }
@media (min-aspect-ratio: 6 / 5) and (min-width: 600px), (max-height: 520px) and (min-aspect-ratio: 6 / 5) {
  [data-screen="game"] { grid-template-columns: minmax(0, 1fr) clamp(260px, 36vw, 400px); }
  .stage-slot { grid-row: 3; grid-column: 1; }
  .side { grid-row: 3; grid-column: 2; max-height: none; justify-content: center; padding: 6px 8px; min-width: 0; }
}

/* ----- speelveld (scene.js) ----- */
.scene-stage { position: absolute; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; container-type: size; }
.scene-dog-wrap { position: absolute; z-index: 3; pointer-events: none; }
.dog-stage { position: absolute; inset: 0; --wet: 0; }
.dog-stage .layer { position: absolute; left: 0; top: 0; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.layer-shadow { z-index: 0; opacity: .5; }
.dog-body { position: absolute; inset: 0; transform-origin: 52% 88%; }
.dog-body .layer-dog { opacity: 0; z-index: 3; transition: opacity .25s ease; }
.dog-body .layer-dog.is-on { opacity: 1; }
.dog-stage.no-trans .layer-dog { transition: none; }
.dog-body .layer-mess { z-index: 4; opacity: 0; transition: opacity .3s; }
.dog-body .layer-mess.is-on { opacity: 1; }
.dog-body .item-back { z-index: 2; }
.dog-body .item-front { z-index: 5; }
.item-layer.just-on { animation: item-pop .28s ease-out; }
@keyframes item-pop { 0% { transform: scale(.85); opacity: .3; } 70% { transform: scale(1.04); } 100% { transform: none; opacity: 1; } }
.dog-stage.is-wet .layer-dog { filter: brightness(calc(1 - var(--wet) * .1)) saturate(calc(1 + var(--wet) * .1)); }
.dog-body .spots { position: absolute; inset: 0; z-index: 9; touch-action: none; }
.scene-props { position: absolute; inset: 0; pointer-events: none; }
.scene-props-back { z-index: 1; } .scene-props-front { z-index: 10; }
.prop { position: absolute; width: calc(var(--w, .2) * 100%); height: auto; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); user-select: none; -webkit-user-drag: none; }
.prop-dog { position: absolute; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); }
.tool-cursor { position: absolute; z-index: 25; pointer-events: none; height: auto; transform: translate(calc(var(--hx, 50%) * -1), calc(var(--hy, 50%) * -1)); filter: drop-shadow(0 4px 4px #49372f44) drop-shadow(0 0 3px #fff9); }
.fx-layer { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.fx-host { position: relative; }
.fx-bit { position: absolute; height: auto; transform: translate(-50%, -50%); pointer-events: none; animation: bit-pop .65s cubic-bezier(.16, .72, .3, 1) forwards; }
@keyframes bit-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(.6); } }
.cheer-layer { position: absolute; inset: 0; z-index: 21; pointer-events: none; }
.cheer-sparkle { position: absolute; width: 8%; height: auto; transform: translate(-50%, -50%); animation: cheer-spark 1.3s ease-out var(--d, 0s) both; }
@keyframes cheer-spark { 0% { opacity: 0; transform: translate(-50%, 0) scale(.2); } 30% { opacity: 1; transform: translate(-50%, -40%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -120%) scale(.8) rotate(40deg); } }
.fx-celebrate { position: absolute; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.confetti-piece { position: absolute; top: -8%; height: auto; animation: confetti-fall var(--dur, 1.4s) ease-in var(--delay, 0s) forwards; }
.confetti-piece.is-static { animation: none; }
@keyframes confetti-fall { to { top: 108%; transform: translateX(var(--sway, 0)) rotate(var(--rot, 300deg)); } }
.dog-body.is-happy-r { animation: dog-happy .9s ease-out; }
.dog-body.is-wow-r { animation: dog-wow .6s ease-out; }
.dog-body.is-oops-r { animation: dog-oops .5s ease-out; }
.dog-body.is-sleepy-r { animation: dog-sleepy 1.4s ease-in-out; }
@keyframes dog-happy { 0%, 100% { transform: none; } 25% { transform: translateY(-3%) scale(1.02, .99); } 55% { transform: rotate(-1.5deg); } 80% { transform: rotate(1deg); } }
@keyframes dog-wow { 0%, 100% { transform: none; } 40% { transform: scale(1.04); } }
@keyframes dog-oops { 0%, 100% { transform: none; } 20% { transform: translateX(-2%); } 40% { transform: translateX(2%); } 60% { transform: translateX(-1.2%); } 80% { transform: translateX(1%); } }
@keyframes dog-sleepy { 0%, 100% { transform: none; } 50% { transform: translateY(1.2%) scale(1.005, .995); } }
body[data-state="paused"] .dog-stage *, body[data-state="paused"] .dog-stage { animation-play-state: paused !important; }

/* hint: geanimeerde hand (pictogram, geen tekst) */
.scene-hint { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.hint-ring { position: absolute; left: calc(var(--u0) * 100%); top: calc(var(--v0) * 100%); width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 3px solid var(--hint-ring); border-radius: 50%; box-shadow: 0 0 12px var(--hint-glow); }
.hint-hand-img { position: absolute; left: calc(var(--u0) * 100%); top: calc(var(--v0) * 100%); width: 52px; height: auto; margin: -8px 0 0 -14px; filter: drop-shadow(0 3px 3px rgba(73, 55, 47, .35)); }
.hint-target { position: absolute; left: calc(var(--u1) * 100%); top: calc(var(--v1) * 100%); width: 28px; height: 28px; margin: -14px 0 0 -14px; border: 3px dashed var(--hint-ring); border-radius: 50%; opacity: .8; }
.scene-hint.is-tap .hint-hand-img { animation: hint-tap 1.1s ease-in-out infinite; }
.scene-hint.is-tap .hint-ring { animation: hint-ring 1.1s ease-out infinite; }
.scene-hint.is-drag .hint-hand-img, .scene-hint.is-drag .hint-ring { animation: hint-drag 1.8s ease-in-out infinite; }
@keyframes hint-tap { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(8px) scale(.94); } }
@keyframes hint-ring { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes hint-drag { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: 1; } 75% { opacity: 1; transform: translate(calc((var(--u1) - var(--u0)) * var(--stage-w, 320px)), calc((var(--v1) - var(--v0)) * var(--stage-h, 320px))); } 100% { opacity: 0; transform: translate(calc((var(--u1) - var(--u0)) * var(--stage-w, 320px)), calc((var(--v1) - var(--v0)) * var(--stage-h, 320px))); } }
.scene-hint.is-static .hint-hand-img, .scene-hint.is-static .hint-ring { animation: none !important; }

/* ----- eindbalk: Volgende groot rechts, klein Home/Opnieuw links ----- */
.act-end { display: flex; flex-direction: column; gap: 10px; align-items: stretch; animation: end-in .35s ease-out; }
@keyframes end-in { from { transform: translateY(14px); opacity: 0; } }
.end-note { margin: 0 auto; max-width: 100%; padding: 8px 18px; font-weight: 900; font-size: clamp(17px, 5vw, 24px); text-align: center; background: rgba(255, 253, 249, .95); border: 3px solid var(--cream-50); border-radius: 22px; box-shadow: 0 4px 0 rgba(73, 55, 47, .18), 0 8px 16px rgba(73, 55, 47, .15); text-wrap: balance; }
.end-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.btn-small { width: 56px; height: 56px; min-width: 56px; padding: 0; border-radius: 50%; }
.btn-next { margin-left: auto; flex: 1 1 0; min-width: 0; max-width: 220px; min-height: 72px; border-radius: 28px; }
.btn-next .icon { width: 40px; height: 40px; }
.btn-next::after { display: none; }

/* ----- pauze/instellingen: pictogrammen ----- */
#btn-resume, #btn-retry-paused, #btn-settings-paused, #btn-home-paused, #btn-back, #set-music, #set-sfx { min-width: 56px; min-height: 56px; }
#btn-resume .icon, #btn-retry-paused .icon, #btn-home-paused .icon { width: 30px; height: 30px; }
#btn-resume span, #btn-retry-paused span, #btn-home-paused span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-screen="paused"] .card { gap: 12px; }
.pause-copy { display: none; }

@media (max-height: 520px) {
  .theme-chip { padding: 3px 12px; font-size: 14px; }
  .hud .btn-icon { width: 44px; height: 44px; min-width: 44px; }
  .btn-next { min-height: 56px; }
}
@media (prefers-reduced-motion: reduce) { .act-end { animation: none; } .progress-fill { transition: none; } }

body[data-state="playing"], body[data-state="reveal"], body[data-state="paused"] { user-select: none; -webkit-user-select: none; }
.act-end .end-actions .btn-small { flex: none; }

.end-finale { display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin-bottom: 2px; }
.end-finale img { width: min(78%, 280px); max-height: 30dvh; object-fit: contain; height: auto; filter: drop-shadow(0 4px 4px rgba(73, 55, 47, .3)); }
body[data-state="playing"] [data-screen="game"], body[data-state="paused"] [data-screen="game"], body[data-state="reveal"] [data-screen="game"] { max-width: 1100px; width: 100%; margin: 0 auto; }

/* pauze/instellingen/modals altijd boven het speelveld en alle activity-lagen */
.overlay { z-index: 1000; }
body[data-state="paused"] .act-overlay, body[data-state="paused"] .act-overlay * { pointer-events: none !important; }
body[data-state="paused"] .tool-cursor, body[data-state="paused"] .scene-hint { visibility: hidden; }

/* eindbalk: alleen doorgaan, geen home/opnieuw (speler blijft spelen) */
#btn-end-home, #btn-end-retry { display: none !important; }

/* "Level x of 15" niet zichtbaar tonen (blijft beschikbaar voor schermlezers) */
.hud-level { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; padding: 0; margin: 0; }

/* eindscherm na level 15: apart scherm, drie pups op willekeurige achtergrond */
.finale { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 16px; }
.finale[hidden] { display: none; }
.finale-bg { position: absolute; inset: 0; background: center / cover no-repeat var(--color-bg); }
.finale-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(255,255,255,.0) 35%, rgba(40,25,20,.35) 100%); }
.finale-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: min(92vw, 640px); text-align: center; animation: finale-pop .6s cubic-bezier(.2,1.3,.4,1) both; }
.finale-dogs { width: min(92vw, 760px); max-height: 62dvh; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(40, 25, 20, .45)); }
.finale-note { margin: 0; padding: 10px 18px; border-radius: 18px; background: rgba(255, 252, 245, .92); color: var(--color-text); font-weight: 800; font-size: clamp(18px, 4.6vw, 28px); box-shadow: 0 4px 12px rgba(40, 25, 20, .25); }
.finale-btn { min-width: 84px; min-height: 64px; display: inline-flex; align-items: center; justify-content: center; }
.finale-btn img { width: 36px; height: 36px; }
@keyframes finale-pop { from { opacity: 0; transform: scale(.85) translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .finale-card { animation: none; } }
