/* Painted multi-orb clue covers: soap / balloons / petals / lanterns / candies / yarn */
.bubble-clue{position:relative;overflow:hidden;border-radius:22px;margin:0 auto;box-shadow:0 10px 0 #ead9b4;isolation:isolate}
.bubble-clue .scratch-picture{width:100%;height:100%;background-image:url('assets/clues.webp');background-repeat:no-repeat}
.clue-veil{position:absolute;inset:0;z-index:2;background:var(--veil-wash,linear-gradient(145deg,#7ec8e8,#f7a8d0 45%,#ffe08a))}
.clue-veil-hit{appearance:none;border:0;padding:0;margin:0;width:100%;height:100%;display:block;position:relative;cursor:pointer;background:transparent;touch-action:pan-y}
.clue-veil-splash{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:4}
.clue-veil-orbs{position:absolute;inset:0;overflow:hidden;z-index:2}
.clue-veil-orb{position:absolute;width:var(--s,36px);height:var(--s,36px);margin:0;transform:translate(-50%,-50%) rotate(var(--rot,0deg));border-radius:50%;background:
  radial-gradient(circle at 30% 26%,var(--hi,#fff8) 0 18%,transparent 42%),
  radial-gradient(circle at 50% 55%,var(--mid,#7ad7f0) 0 58%,var(--deep,#2f8fb8) 100%);
  box-shadow:inset -3px -4px 8px #0003,inset 3px 4px 7px #fff6,0 4px 8px #0003;pointer-events:none}
.clue-veil-orb.shape-balloon{border-radius:48% 48% 46% 46% / 58% 58% 40% 40%;box-shadow:inset -3px -4px 8px #0003,inset 3px 4px 7px #fff6,0 5px 10px #0003}
.clue-veil-orb.shape-balloon::after{content:"";position:absolute;left:50%;bottom:-10%;width:14%;height:18%;transform:translateX(-50%);background:linear-gradient(#fff8,var(--deep));border-radius:2px;opacity:.85}
.clue-veil-orb.shape-petal{border-radius:68% 32% 64% 36% / 42% 62% 38% 58%;width:calc(var(--s,36px)*1.15);height:calc(var(--s,36px)*.78)}
.clue-veil-orb.shape-lantern{border-radius:42%;box-shadow:inset -3px -4px 8px #0004,inset 3px 4px 8px #fff5,0 0 14px color-mix(in srgb,var(--mid) 55%,transparent),0 4px 8px #0004}
.clue-veil-orb.shape-candy{border-radius:46%;box-shadow:inset -2px -3px 6px #0003,inset 2px 3px 6px #fff7,0 3px 6px #0003}
.clue-veil-orb.shape-yarn{border-radius:50%;background:
  repeating-conic-gradient(from 20deg,var(--mid) 0 12deg,var(--deep) 12deg 22deg),
  radial-gradient(circle at 32% 28%,var(--hi) 0 16%,transparent 40%);
  background-blend-mode:multiply,normal;box-shadow:inset -3px -4px 7px #0004,0 4px 8px #0003}
/* Painted ice cube: same framing; each tap crossfades to a heavier crack phase */
.clue-veil[data-theme="ice"]{
  background:var(--veil-wash,linear-gradient(160deg,#b9d4e6,#e8f3f8 48%,#9ebfd4));
}
.clue-ice-fog{
  position:absolute;inset:0;z-index:1;
  background:
    radial-gradient(ellipse at 50% 58%,#d7ebf5 0%,#b4d0e4 52%,#8eb4cc 100%),
    linear-gradient(165deg,#cfe4f0,#9ebfd4);
}
.clue-ice-cube{
  position:absolute;left:50%;top:56%;z-index:2;
  width:min(88%,280px);aspect-ratio:1;
  transform:translate(-50%,-58%);
  transform-origin:50% 62%;
  filter:drop-shadow(0 18px 22px #2a557066);
  pointer-events:none;
}
.clue-ice-phase{
  position:absolute;inset:0;margin:0;z-index:0;
  /* Identical crop so the cube stays in place while cracks grow */
  background-repeat:no-repeat;background-position:center 46%;background-size:112% auto;
  opacity:0;
  transition:opacity .42s ease;
  will-change:opacity;
}
.clue-ice-cube[data-phase="0"] .clue-ice-phase[data-p="0"]{opacity:1;z-index:1}
.clue-ice-cube[data-phase="1"] .clue-ice-phase[data-p="0"],
.clue-ice-cube[data-phase="1"] .clue-ice-phase[data-p="1"]{opacity:1}
.clue-ice-cube[data-phase="1"] .clue-ice-phase[data-p="1"]{z-index:2}
.clue-ice-cube[data-phase="2"] .clue-ice-phase[data-p="1"],
.clue-ice-cube[data-phase="2"] .clue-ice-phase[data-p="2"]{opacity:1}
.clue-ice-cube[data-phase="2"] .clue-ice-phase[data-p="2"]{z-index:2}
.clue-ice-cube[data-phase="3"] .clue-ice-phase[data-p="2"],
.clue-ice-cube[data-phase="3"] .clue-ice-phase[data-p="3"]{opacity:1}
.clue-ice-cube[data-phase="3"] .clue-ice-phase[data-p="3"]{z-index:2}
.clue-ice-cube[data-phase="4"] .clue-ice-phase[data-p="3"],
.clue-ice-cube[data-phase="4"] .clue-ice-phase[data-p="4"]{opacity:1}
.clue-ice-cube[data-phase="4"] .clue-ice-phase[data-p="4"]{z-index:2}
.clue-ice-cube.is-thud{animation:clue-ice-thud .26s ease}
.clue-ice-cube.is-fracture{animation:clue-ice-thud .26s ease,clue-ice-fracture .4s ease}
.clue-ice-cube.is-breaking{opacity:0;filter:brightness(1.4)}
.clue-veil-shards{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:4}
.clue-veil[data-theme="ice"] .clue-veil-hud{
  top:7%;transform:translate(-50%,0);
  background:#f4fbffe8;box-shadow:0 8px 22px #2a5a7830,inset 0 0 0 2px #ffffffcc;
}
.clue-veil[data-theme="ice"][data-crack="1"] .clue-ice-cube{filter:drop-shadow(0 16px 20px #2a557055) contrast(1.04)}
.clue-veil[data-theme="ice"][data-crack="2"] .clue-ice-cube{filter:drop-shadow(0 14px 18px #2a55705a) contrast(1.07)}
.clue-veil[data-theme="ice"][data-crack="3"] .clue-ice-cube{filter:drop-shadow(0 12px 16px #2a557066) contrast(1.1) saturate(.95)}
.clue-veil[data-theme="ice"][data-crack="4"] .clue-ice-cube{filter:drop-shadow(0 10px 14px #2a557077) contrast(1.14) saturate(.9) brightness(1.03)}
.clue-veil[data-theme="ice"].is-shatter .clue-veil-hud,
.clue-veil[data-theme="ice"].is-shatter .clue-ice-fog{opacity:0;transition:opacity .14s ease}
@keyframes clue-ice-thud{
  0%,100%{transform:translate(-50%,-58%) scale(1)}
  40%{transform:translate(-50%,-58%) scale(.98)}
}
@keyframes clue-ice-fracture{
  0%{filter:drop-shadow(0 18px 22px #2a557066) brightness(1)}
  40%{filter:drop-shadow(0 10px 26px #7ec8ff77) brightness(1.16)}
  100%{filter:drop-shadow(0 18px 22px #2a557066) brightness(1)}
}
@media(prefers-reduced-motion:reduce){
  .clue-ice-cube.is-thud,.clue-ice-cube.is-fracture,.clue-ice-cube.is-breaking{animation:none;transition:none;filter:none}
  .clue-ice-phase{transition:none}
}
.clue-veil-orb.is-pop{animation:clue-veil-pop .28s ease forwards}
.clue-veil-hud{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:5;min-width:112px;padding:10px 14px;border-radius:16px;background:#fffffff0;box-shadow:0 8px 22px #244b4530,inset 0 0 0 2px #ffffffaa;display:grid;gap:2px;justify-items:center;pointer-events:none}
.clue-veil-hud b{font:900 22px/1.1 Nunito,system-ui,sans-serif;color:#1f4f5c}
.clue-veil-hud small{font:800 12px/1.2 Nunito,system-ui,sans-serif;color:#3f6a74}
.bubble-clue.open .clue-veil{display:none}
@keyframes clue-veil-pop{0%{opacity:1;transform:translate(-50%,-50%) scale(1)}55%{opacity:.55;transform:translate(-50%,-50%) scale(1.35)}100%{opacity:0;transform:translate(-50%,-50%) scale(1.7)}}
@media(prefers-reduced-motion:reduce){
  .clue-veil-orb.is-pop{animation:none;opacity:0}
}
/* Keep legacy single-bubble rules harmless if markup returns */
.bubble-clue .soap-bubble{display:none}

.bubble-clue,.bubble-clue.open,.bubble-clue.open .scratch-picture{touch-action:pan-y}

body.quest-app .scratch.open{touch-action:pan-y}
