/* PumpkinLab – UI-stijl (vrolijk-griezelig: donkerpaars, slijmgroen, pompoenoranje) */

:root {
  --bg: #12081f;
  --panel: #2a1747;
  --panel-2: #3a2163;
  --panel-edge: #6b3fb0;
  --ink: #1a0b2b;
  --text: #fff6e8;
  --muted: #cdb9ef;
  --orange: #ff8a1f;
  --orange-2: #ffb347;
  --orange-dk: #b14d00;
  --green: #6fe35a;
  --green-2: #a8ff7a;
  --green-dk: #2c8a2a;
  --purple: #8f55e8;
  --purple-2: #b48bff;
  --purple-dk: #4b2390;
  --danger: #ff5a6e;
  --danger-dk: #a3203a;
  --gold: #ffd34d;
  --slime: #7cff6b;
  --font: "Arial Rounded MT Bold", "SF Pro Rounded", ui-rounded, "Nunito", "Varela Round", "Trebuchet MS", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: clamp(14px, 2.4vmin, 24px);
  --gap: clamp(8px, 1.8vmin, 18px);
  --fs: clamp(14px, 2.4vmin, 20px);
  --hud-h: clamp(40px, 7vmin, 60px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body { font-family: var(--font); color: var(--text); }

/* ------------------------------------------------------------ basislaag */
#ui-root, .ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  font-family: var(--font);
  color: var(--text);
  font-size: var(--fs);
  line-height: 1.25;
  z-index: 10;
}
.ui * { box-sizing: border-box; }
.ui .hidden { display: none !important; }

/* ------------------------------------------------------------ iconen */
.icon {
  --icon: 48px;
  display: inline-grid;
  place-items: center;
  width: var(--icon);
  height: var(--icon);
  flex: none;
  position: relative;
}
.icon canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.icon-emoji { font-size: calc(var(--icon) * 0.78); line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.icon-plus {
  position: absolute; right: 2%; bottom: 2%;
  display: grid; place-items: center;
  width: 42%; height: 42%; border-radius: 50%;
  background: var(--green); color: #12330e; border: 2px solid var(--ink);
  font-weight: 900; font-size: calc(var(--icon) * 0.34); line-height: 1;
}

/* ------------------------------------------------------------ knoppen */
.btn {
  --c1: var(--orange-2); --c2: var(--orange); --cd: var(--orange-dk); --glow: rgba(255, 138, 31, .55);
  font: inherit;
  font-weight: 900;
  font-size: clamp(16px, 2.8vmin, 24px);
  letter-spacing: .01em;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
  min-height: 52px;
  min-width: 52px;
  padding: .55em 1.2em;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: 0 5px 0 var(--cd), 0 8px 18px rgba(0, 0, 0, .45), inset 0 2px 0 rgba(255, 255, 255, .45);
  cursor: pointer;
  pointer-events: auto;
  transition: transform .08s ease, box-shadow .12s ease, filter .12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 5px 0 var(--cd), 0 0 22px var(--glow), inset 0 2px 0 rgba(255, 255, 255, .5); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--cd), 0 3px 8px rgba(0, 0, 0, .4), inset 0 2px 0 rgba(255, 255, 255, .35); }
.btn:focus-visible { outline: 4px solid var(--slime); outline-offset: 3px; }
.btn:disabled { cursor: not-allowed; filter: grayscale(.85) brightness(.7); box-shadow: 0 3px 0 #222, inset 0 2px 0 rgba(255, 255, 255, .15); }
.btn-green  { --c1: var(--green-2); --c2: var(--green); --cd: var(--green-dk); --glow: rgba(124, 255, 107, .55); color: #12330e; text-shadow: 0 1px 0 rgba(255, 255, 255, .45); }
.btn-purple { --c1: var(--purple-2); --c2: var(--purple); --cd: var(--purple-dk); --glow: rgba(180, 139, 255, .55); }
.btn-danger { --c1: #ff8a98; --c2: var(--danger); --cd: var(--danger-dk); --glow: rgba(255, 90, 110, .5); }
.btn-ghost  { --c1: #4a3570; --c2: #3a2860; --cd: #1d1135; --glow: transparent; color: var(--muted); }
.btn-big { font-size: clamp(19px, 3.6vmin, 30px); min-height: 60px; padding: .55em 1.5em; }
.btn-stack { flex-direction: column; gap: 0; line-height: 1.05; }
.btn-stack small { font-size: .55em; opacity: .9; letter-spacing: .04em; }

/* ------------------------------------------------------------ schermen en panelen */
.screens { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.screen {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--gap) + var(--safe-t)) calc(var(--gap) + var(--safe-r)) calc(var(--gap) + var(--safe-b)) calc(var(--gap) + var(--safe-l));
  background: radial-gradient(ellipse at 50% 35%, rgba(58, 24, 98, .72), rgba(8, 3, 16, .9) 75%);
  animation: fade-in .25s ease both;
  overflow: hidden;
}
.screen.rerender, .screen.rerender .anim-in, .screen.rerender .late-in, .screen.rerender .bounce { animation: none !important; }

.panel {
  position: relative;
  background:
    radial-gradient(ellipse at 50% -20%, rgba(124, 255, 107, .12), transparent 60%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 3px solid var(--ink);
  border-radius: calc(var(--r) * 1.4);
  box-shadow: 0 0 0 3px var(--panel-edge), 0 0 40px rgba(143, 85, 232, .45), 0 18px 40px rgba(0, 0, 0, .6), inset 0 2px 0 rgba(255, 255, 255, .12);
  padding: clamp(14px, 3vmin, 30px);
  max-width: min(980px, 100%);
  max-height: 100%;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--purple) transparent;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.panel-head { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.panel-title {
  margin: 0;
  font-size: clamp(24px, 5vmin, 44px);
  font-weight: 900;
  color: var(--orange-2);
  text-align: center;
  text-shadow: 0 3px 0 var(--ink), 0 0 18px rgba(255, 138, 31, .5);
  letter-spacing: .02em;
}
.panel-sub { margin: 0; color: var(--muted); font-size: clamp(14px, 2.4vmin, 19px); }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); flex-wrap: wrap; margin-top: 2px; }
.panel-foot.center { justify-content: center; flex-wrap: wrap-reverse; }
.panel-foot.end { justify-content: flex-end; }
.row { display: flex; gap: var(--gap); flex-wrap: wrap; }
.row.center { justify-content: center; }
.note { margin: 0; color: var(--muted); font-size: clamp(13px, 2.1vmin, 17px); text-align: center; }
.lead { margin: 0; font-size: clamp(16px, 2.8vmin, 22px); text-align: center; max-width: 34em; }
.big-title {
  margin: 0;
  font-size: clamp(30px, 7vmin, 64px);
  font-weight: 900;
  color: var(--orange-2);
  text-align: center;
  text-shadow: 0 4px 0 var(--ink), 0 0 26px rgba(255, 138, 31, .6);
  line-height: 1.05;
}
.big-title.danger { color: #ff8a98; text-shadow: 0 4px 0 var(--ink), 0 0 26px rgba(255, 90, 110, .55); }
.big-title.gold { color: var(--gold); text-shadow: 0 4px 0 var(--ink), 0 0 30px rgba(255, 211, 77, .7); }
.chip {
  display: inline-flex; align-items: center; gap: .4em;
  align-self: center;
  padding: .3em .9em .3em .4em;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  border: 2px solid rgba(255, 211, 77, .5);
  font-weight: 900;
  font-size: clamp(16px, 2.8vmin, 24px);
  color: var(--gold);
}
.lost-chip { color: #ff8a98; border-color: rgba(255, 90, 110, .5); }

/* modals */
.modal-back {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: var(--gap);
  background: rgba(8, 3, 16, .72);
  animation: fade-in .2s ease both;
  z-index: 5;
}
.modal { width: min(640px, 100%); }
.settings-modal { width: min(740px, 100%); }
.settings-modal .set-row { grid-template-columns: 8.6em 1fr; }
.settings-modal .seg-btn { padding: .35em .7em; }
.modal-body { display: flex; flex-direction: column; gap: var(--gap); }
.confirm-text { margin: 0; text-align: center; font-size: clamp(16px, 2.6vmin, 21px); max-width: 26em; align-self: center; }

/* ------------------------------------------------------------ titel */
.screen-title {
  background:
    radial-gradient(ellipse 60% 45% at 50% 30%, rgba(255, 138, 31, .22), transparent 70%),
    radial-gradient(ellipse at 50% 120%, rgba(124, 255, 107, .25), transparent 55%),
    linear-gradient(180deg, #1d0b35, #0b0414 80%);
}
.title-wrap { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.title-main { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: clamp(12px, 3.5vmin, 36px); max-height: 100%; }
.logo-box { display: flex; flex-direction: column; align-items: center; gap: clamp(2px, 1vmin, 10px); }
/* logo: "Pumpkin" gloeit oranje, "Lab" is druipend slijm met belletjes */
.logo {
  position: relative;
  margin: 0 0 .3em;
  font-size: clamp(44px, 12.5vmin, 132px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: .01em;
  white-space: nowrap;
}
.logo-w { position: relative; display: inline-block; }
.logo-w.w2 { margin-left: .05em; }
.logo-l {
  position: relative;
  z-index: 1;
  display: inline-block;
  color: var(--ink);
  -webkit-text-stroke: .17em var(--ink);
  text-shadow: 0 .07em 0 var(--ink), 0 .1em .02em #000, 0 0 .4em rgba(255, 138, 31, .6);
  transform: rotate(calc((var(--i) - 3) * 1.4deg));
  animation: letter-bob 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.18s);
}
.logo-l::after {
  content: attr(data-l);
  position: absolute; inset: 0;
  -webkit-text-stroke: 0;
  text-shadow: none;
  color: transparent;
  background: linear-gradient(180deg, #fff1b8 0%, #ffc04d 30%, #ff8a1f 62%, #d85600 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.w2 .logo-l {
  font-size: 1.06em;
  text-shadow: 0 .07em 0 var(--ink), 0 .1em .02em #000, 0 0 .45em rgba(124, 255, 107, .7);
  animation-name: slime-wobble;
  animation-duration: 3s;
}
.w2 .logo-l:nth-child(1) { transform: rotate(-6deg); }
.w2 .logo-l:nth-child(2) { transform: rotate(4deg) translateY(.03em); }
.w2 .logo-l:nth-child(3) { transform: rotate(-3deg); }
.w2 .logo-l::after { background-image: linear-gradient(180deg, #f0ffc8 0%, #a8ff7a 35%, #5fe04a 68%, #3fb832 100%); }
.slime-drip {
  position: absolute; z-index: 2; top: .9em;
  width: .12em; height: var(--len, .2em);
}
.slime-drip > i {
  position: absolute; inset: 0; display: block;
  border-radius: 0 0 .05em .05em;
  background: linear-gradient(90deg, #36a82c, #a8ff7a 45%, #4fd23f);
  filter: drop-shadow(.035em 0 0 #1a0b2b) drop-shadow(-.035em 0 0 #1a0b2b) drop-shadow(0 .035em 0 #1a0b2b);
  transform-origin: 50% 0;
  animation: drip 3.4s ease-in-out infinite;
  animation-delay: inherit;
}
.slime-drip::before {
  content: ""; position: absolute; z-index: 1; left: 50%; top: -.13em;
  width: .26em; height: .24em; translate: -50% 0;
  border-radius: 50% 50% 50% 50% / 25% 25% 75% 75%;
  background: linear-gradient(180deg, rgba(79, 210, 63, 0), #4fd23f 40%, #6fe35a);
  clip-path: polygon(0 0, 100% 0, 72% 100%, 28% 100%);
}
.slime-drip > i::after {
  content: ""; position: absolute; left: 50%; bottom: -.08em;
  width: .19em; height: .2em; translate: -50% 0;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: radial-gradient(circle at 35% 35%, #f0ffc8, #7cff6b 50%, #2c8a2a);
}
.slime-drip.d1 { left: .3em; --len: .3em; }
.slime-drip.d2 { left: .98em; --len: .36em; animation-delay: -1.2s; }
.slime-drip.d3 { left: 1.6em; --len: .24em; animation-delay: -2.3s; }
.slime-bub {
  position: absolute; bottom: .92em; z-index: 2;
  width: .11em; height: .11em; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #a8ff7a 55%, #4fd23f);
  box-shadow: 0 0 .12em rgba(124, 255, 107, .9);
  opacity: 0;
  animation: bubble-rise 2.8s ease-in infinite;
}
.slime-bub.s1 { left: .7em; }
.slime-bub.s2 { left: 1.3em; width: .08em; height: .08em; animation-delay: -1s; }
.slime-bub.s3 { left: 1.85em; width: .13em; height: .13em; animation-delay: -1.9s; }

/* embleem: held-pompoen met labbril, kolf met slijm en een vonk */
.lab-emblem { --pk: clamp(64px, 15vmin, 150px); position: relative; display: flex; justify-content: center; }
.pk-goggles { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.pk-goggles svg, .fl-art svg, .lab-bolt svg { display: block; width: 100%; height: 100%; overflow: visible; }
.lab-flask {
  position: absolute; left: calc(50% + var(--pk) * .44); bottom: calc(var(--pk) * -.04);
  width: calc(var(--pk) * .58); height: calc(var(--pk) * .773);
  rotate: 12deg;
  filter: drop-shadow(0 0 calc(var(--pk) * .1) rgba(124, 255, 107, .55));
}
.fl-art { display: block; width: 100%; height: 100%; }
.fl-bub {
  position: absolute; left: 44%; top: 14%;
  width: calc(var(--pk) * .07); height: calc(var(--pk) * .07); border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #a8ff7a 55%, #4fd23f);
  box-shadow: 0 0 0 2px var(--ink);
  opacity: 0;
  animation: flask-bub 2.4s ease-in infinite;
}
.fl-bub.b2 { left: 34%; width: calc(var(--pk) * .05); height: calc(var(--pk) * .05); animation-delay: -.8s; --dx: -6px; }
.fl-bub.b3 { left: 54%; animation-delay: -1.6s; --dx: 7px; }
.lab-bolt {
  position: absolute; right: calc(50% + var(--pk) * .48); top: calc(var(--pk) * .1);
  width: calc(var(--pk) * .34); height: calc(var(--pk) * .51);
  rotate: -16deg;
  filter: drop-shadow(0 0 calc(var(--pk) * .08) rgba(255, 211, 77, .85));
  animation: zap 2.6s linear infinite;
}
.subtitle { margin: 0; color: var(--muted); font-size: clamp(14px, 2.6vmin, 22px); text-align: center; text-shadow: 0 2px 0 var(--ink); }
.menu { display: flex; flex-direction: column; align-items: stretch; gap: clamp(10px, 1.8vmin, 16px); width: min(440px, 88vw); }
.menu .row { flex-wrap: nowrap; }
.menu .row .btn { flex: 1 1 0; padding-inline: .6em; font-size: clamp(15px, 2.4vmin, 20px); }

.title-deco { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.fog {
  position: absolute; left: -10%; right: -10%; bottom: -8%; height: 38%;
  background:
    radial-gradient(ellipse 30% 60% at 20% 70%, rgba(124, 255, 107, .16), transparent 70%),
    radial-gradient(ellipse 35% 55% at 75% 75%, rgba(180, 139, 255, .18), transparent 70%),
    radial-gradient(ellipse 50% 50% at 50% 100%, rgba(124, 255, 107, .14), transparent 70%);
  filter: blur(6px);
  animation: fog-drift 14s ease-in-out infinite alternate;
}
.twinkles {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(2px 2px at 12% 18%, #fff, transparent),
    radial-gradient(2px 2px at 28% 8%, #ffe9a8, transparent),
    radial-gradient(1.5px 1.5px at 46% 22%, #fff, transparent),
    radial-gradient(2px 2px at 66% 12%, #c9b8ff, transparent),
    radial-gradient(1.5px 1.5px at 82% 26%, #fff, transparent),
    radial-gradient(2px 2px at 91% 9%, #ffe9a8, transparent),
    radial-gradient(1.5px 1.5px at 7% 44%, #c9b8ff, transparent),
    radial-gradient(1.5px 1.5px at 94% 48%, #fff, transparent);
  animation: twinkle 3.5s ease-in-out infinite alternate;
}

/* ------------------------------------------------------------ CSS-pompoen */
.pumpkin { --pk: clamp(70px, 15vmin, 150px); position: relative; width: var(--pk); height: calc(var(--pk) * .9); flex: none; }
.pk-body {
  position: absolute; left: 0; right: 0; bottom: 0; height: 82%;
  border-radius: 48% 48% 44% 44% / 52% 52% 48% 48%;
  background:
    radial-gradient(ellipse 22% 18% at 32% 26%, rgba(255, 255, 255, .45), transparent 70%),
    radial-gradient(ellipse at 50% 35%, #ffb347, #ff7a12 55%, #c84e05 100%);
  border: calc(var(--pk) * .035) solid var(--ink);
  box-shadow: inset 0 calc(var(--pk) * -.08) 0 rgba(120, 30, 0, .35), 0 0 calc(var(--pk) * .35) rgba(255, 138, 31, .45);
  overflow: hidden;
}
.pk-body::before, .pk-body::after {
  content: ""; position: absolute; top: -4%; bottom: -4%;
  border-radius: 50%;
  border-left: calc(var(--pk) * .025) solid rgba(130, 40, 0, .45);
  border-right: calc(var(--pk) * .025) solid rgba(130, 40, 0, .45);
}
.pk-body::before { left: 18%; right: 18%; }
.pk-body::after { left: 36%; right: 36%; }
.pk-stem {
  position: absolute; left: 50%; top: 0; width: 13%; height: 26%;
  transform: translateX(-50%) rotate(8deg);
  background: linear-gradient(90deg, #4f7a24, #7aa83a);
  border: calc(var(--pk) * .03) solid var(--ink);
  border-radius: 30% 30% 20% 20%;
  z-index: 1;
}
.pk-leaf {
  position: absolute; left: 55%; top: 6%; width: 26%; height: 14%;
  background: linear-gradient(180deg, #8fe05a, #3f9a2c);
  border: calc(var(--pk) * .025) solid var(--ink);
  border-radius: 0 80% 0 80%;
  transform: rotate(-12deg);
  z-index: 2;
}
.pk-face { position: absolute; inset: 0; z-index: 3; filter: drop-shadow(0 0 calc(var(--pk) * .05) #ffd23f); }
.pk-eye, .pk-mouth { position: absolute; background: radial-gradient(circle at 50% 70%, #fff7b0, #ffd23f 50%, #ff9a1a); }
.pk-eye { top: 26%; width: 22%; height: 22%; clip-path: polygon(50% 0, 100% 100%, 0 100%); animation: flicker 2.2s infinite; }
.pk-eye.l { left: 20%; }
.pk-eye.r { right: 20%; }
.pk-mouth {
  left: 18%; right: 18%; top: 56%; height: 24%;
  clip-path: polygon(0 0, 14% 30%, 28% 0, 42% 30%, 58% 0, 72% 30%, 86% 0, 100% 0, 88% 70%, 72% 100%, 28% 100%, 12% 70%);
  animation: flicker 2.2s infinite .3s;
}
.pumpkin.hero { --pk: clamp(64px, 15vmin, 150px); animation: bob 2.4s ease-in-out infinite; margin-bottom: clamp(-14px, -1.5vmin, -4px); }
.pumpkin.deco { --pk: clamp(50px, 11vmin, 120px); position: absolute; opacity: .55; filter: saturate(.8); }
.pumpkin.deco.d1 { left: 4%; bottom: 6%; transform: rotate(-10deg); animation: bob 3.2s ease-in-out infinite; }
.pumpkin.deco.d2 { right: 5%; bottom: 10%; --pk: clamp(40px, 8vmin, 90px); transform: rotate(12deg); animation: bob 2.8s ease-in-out infinite -1s; }
.pumpkin.sad .pk-mouth { top: 60%; height: 16%; left: 30%; right: 30%; clip-path: polygon(0 100%, 20% 20%, 50% 0, 80% 20%, 100% 100%, 50% 60%); }
.pumpkin.sad .pk-eye { clip-path: polygon(0 20%, 100% 0, 80% 100%, 20% 100%); top: 30%; height: 16%; }
.pumpkin.sad { --pk: clamp(70px, 14vmin, 130px); animation: wobble 3s ease-in-out infinite; filter: saturate(.75); }
.pumpkin.happy { --pk: clamp(80px, 15vmin, 140px); animation: bob 1.8s ease-in-out infinite; }
.pumpkin.happy .pk-mouth { clip-path: polygon(0 0, 100% 0, 85% 60%, 50% 100%, 15% 60%); }

/* ------------------------------------------------------------ instellingen */
.set-row { display: grid; grid-template-columns: minmax(7em, 30%) 1fr; align-items: center; gap: var(--gap); }
.set-label { font-weight: 900; color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-btn {
  font: inherit; font-weight: 800;
  font-size: clamp(14px, 2.2vmin, 18px);
  color: var(--text);
  min-height: 48px;
  padding: .35em .9em;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: #2a1a46;
  box-shadow: 0 3px 0 #120822, inset 0 1px 0 rgba(255, 255, 255, .12);
  cursor: pointer;
  flex: 1 1 auto;
  transition: transform .08s, background .12s, box-shadow .12s;
  touch-action: manipulation;
}
.seg-btn:hover { background: #3b2662; }
.seg-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #120822; }
.seg-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--orange-2), var(--orange));
  color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
  box-shadow: 0 3px 0 var(--orange-dk), 0 0 14px rgba(255, 138, 31, .55);
}
.seg-btn:focus-visible { outline: 4px solid var(--slime); outline-offset: 2px; }
.seg-btn .num {
  display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: 50%;
  background: rgba(0, 0, 0, .35); font-size: .85em; margin-right: .1em;
}
.slider-wrap { display: flex; align-items: center; gap: 10px; }
.set-val { min-width: 3.2em; text-align: right; font-weight: 900; color: var(--gold); }
.slider {
  --p: 50%;
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 48px; margin: 0; background: transparent; cursor: pointer;
  touch-action: pan-x;
}
.slider::-webkit-slider-runnable-track {
  height: 14px; border-radius: 999px; border: 3px solid var(--ink);
  background: linear-gradient(90deg, var(--green) 0 var(--p), #241538 var(--p) 100%);
}
.slider::-moz-range-track { height: 10px; border-radius: 999px; border: 3px solid var(--ink); background: #241538; }
.slider::-moz-range-progress { height: 10px; border-radius: 999px; background: var(--green); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 32px; height: 32px; margin-top: -12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe08a, var(--orange) 60%);
  border: 3px solid var(--ink); box-shadow: 0 2px 0 var(--orange-dk), 0 0 10px rgba(255, 138, 31, .6);
}
.slider::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe08a, var(--orange) 60%);
  border: 3px solid var(--ink);
}
.slider:focus-visible { outline: 4px solid var(--slime); outline-offset: 2px; border-radius: 12px; }

/* geluid aan/uit: schakelaar + volumeschuif in één rij */
.audio-ctl { display: flex; align-items: center; gap: 12px; min-width: 0; }
.audio-ctl .slider-wrap { flex: 1; min-width: 0; transition: opacity .15s, filter .15s; }
.audio-row.is-off .slider-wrap { opacity: .4; filter: grayscale(1); }
.audio-row.is-off .set-label { color: #8f7bb3; }
.switch {
  font: inherit; font-weight: 900; font-size: clamp(14px, 2.2vmin, 18px);
  flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; min-width: 6.4em;
  padding: 4px 12px 4px 6px;
  border-radius: 999px; border: 3px solid var(--ink);
  background: #2a1a46; color: var(--muted);
  box-shadow: 0 3px 0 #120822, inset 0 1px 0 rgba(255, 255, 255, .12);
  cursor: pointer; touch-action: manipulation;
  text-transform: uppercase; letter-spacing: .04em;
  transition: background .15s, color .15s, box-shadow .15s;
}
.switch:hover { background: #3b2662; }
.switch:active { transform: translateY(2px); box-shadow: 0 1px 0 #120822; }
.switch:focus-visible { outline: 4px solid var(--slime); outline-offset: 2px; }
.switch-track {
  position: relative; flex: none;
  width: 52px; height: 30px; border-radius: 999px;
  background: #170c29; border: 3px solid var(--ink);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .5);
  transition: background .18s;
}
.switch-knob {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #b9a6dc 70%);
  border: 2px solid var(--ink);
  transition: transform .18s cubic-bezier(.3, 1.5, .5, 1), background .18s;
}
.switch.on { background: linear-gradient(180deg, #2f6b2a, #1c4219); color: var(--green-2); box-shadow: 0 3px 0 #0d2a0b, 0 0 12px rgba(124, 255, 107, .35); }
.switch.on .switch-track { background: var(--green); }
.switch.on .switch-knob { transform: translateX(22px); background: radial-gradient(circle at 35% 30%, #fff, #e7ffd9 70%); }
.switch-txt { min-width: 2.2em; text-align: left; }

/* hoe speel je */
.howto { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.howto li { display: flex; align-items: center; gap: 12px; background: rgba(0, 0, 0, .22); border-radius: 14px; padding: 6px 10px; font-size: clamp(14px, 2.2vmin, 18px); }
.howto-ic { flex: none; min-width: 86px; display: flex; justify-content: center; }
.keys { display: inline-flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
kbd {
  font: inherit; font-weight: 900; font-size: .85em;
  min-width: 1.8em; padding: .15em .4em; text-align: center;
  background: #f4ead8; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 7px;
  box-shadow: 0 3px 0 #8d7c63;
}

/* ------------------------------------------------------------ dieren kiezen */
.pets-panel, .shop-panel { overflow: hidden; }
.pets-panel { width: min(980px, 100%); }
.pet-grid, .shop-list { overflow-y: auto; min-height: 0; flex: 0 1 auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--purple) transparent; }
.panel-head, .panel-foot, .shop-panel > .note { flex: none; }
.wolf-hint { color: #c8f7ff; font-weight: 800; }
.pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(132px, 19vmin, 180px), 1fr));
  grid-auto-rows: max-content;
  gap: var(--gap);
  padding: 6px;
}
.pet-card {
  position: relative;
  font: inherit; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 10px 12px;
  min-height: 48px;
  border-radius: var(--r);
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, #3d2568, #2a1747);
  box-shadow: 0 4px 0 #120822, inset 0 2px 0 rgba(255, 255, 255, .1);
  cursor: pointer;
  text-align: center;
  transition: transform .1s, box-shadow .15s, background .15s;
  touch-action: manipulation;
}
.pet-card:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #120822, 0 0 16px rgba(180, 139, 255, .4); }
.pet-card:active { transform: translateY(2px); }
.pet-card:focus-visible { outline: 4px solid var(--slime); outline-offset: 3px; }
.pet-card.on {
  background: linear-gradient(180deg, #2f6b2a, #1c4219);
  box-shadow: 0 4px 0 #0d2a0b, 0 0 0 3px var(--green), 0 0 22px rgba(124, 255, 107, .55);
}
.pet-card .check {
  position: absolute; top: -10px; right: -10px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green); color: #12330e; font-weight: 900; font-size: 20px;
  border: 3px solid var(--ink);
  transform: scale(0); transition: transform .18s cubic-bezier(.3, 1.8, .5, 1);
}
.pet-card.on .check { transform: scale(1); }
.pet-card .pet-ic { --icon: clamp(56px, 10vmin, 80px); filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)); }
.pet-card.on .pet-ic { animation: hop .5s ease; }
.pet-name { font-weight: 900; font-size: clamp(16px, 2.6vmin, 21px); color: var(--orange-2); text-shadow: 0 2px 0 var(--ink); }
.pet-desc { font-size: clamp(12px, 1.9vmin, 15px); color: var(--muted); line-height: 1.2; }
.pet-card.on .pet-desc { color: #d8f5cf; }
.pet-card.pop { animation: pop .3s ease; }
.pet-card.nope { animation: shake .35s ease; }
.stars { display: inline-flex; gap: 1px; font-size: clamp(14px, 2.2vmin, 18px); letter-spacing: 0; }
.star { color: rgba(255, 255, 255, .2); text-shadow: 0 1px 0 var(--ink); }
.star.on { color: var(--gold); text-shadow: 0 1px 0 var(--ink), 0 0 6px rgba(255, 211, 77, .7); }
.counter {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 900; font-size: clamp(20px, 3.4vmin, 30px);
  padding: 6px 16px; border-radius: 999px;
  background: rgba(0, 0, 0, .35); border: 2px solid rgba(124, 255, 107, .35);
}
.counter.full { color: var(--green-2); border-color: var(--green); }
.counter.shake { animation: shake .35s ease; color: #ff8a98; }
.counter-dots { display: inline-flex; gap: 5px; }
.counter-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); background: #241538; }
.counter-dots i.on { background: var(--green); box-shadow: 0 0 8px var(--green); }

/* ------------------------------------------------------------ winkel */
.shop-panel { width: min(900px, 100%); }
.shop-head { flex-direction: row; justify-content: space-between; flex-wrap: wrap; gap: var(--gap); }
.wallet {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px 6px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .4); border: 3px solid rgba(255, 211, 77, .55);
  box-shadow: 0 0 18px rgba(255, 211, 77, .25);
}
.wallet .icon { --icon: clamp(32px, 5vmin, 44px); }
.wallet-txt { display: flex; flex-direction: column; line-height: 1; }
.wallet-label { font-size: clamp(11px, 1.7vmin, 14px); color: var(--muted); }
.wallet-n { font-size: clamp(24px, 4.4vmin, 38px); color: var(--gold); text-shadow: 0 2px 0 var(--ink); }
.wallet.bump { animation: pop .45s ease; }
.shop-list { display: flex; flex-direction: column; gap: 4px; padding: 0 4px 6px; touch-action: pan-y; }
.shop-sec { display: flex; flex-direction: column; }
.shop-sec-title {
  position: sticky; top: 0; z-index: 3;
  margin: 0; padding: 6px 6px 4px;
  display: flex; align-items: center; gap: 10px;
  font-size: clamp(14px, 2.3vmin, 19px); font-weight: 900;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--green-2); text-shadow: 0 2px 0 var(--ink);
  background: #321e58;
  border-radius: 10px;
  box-shadow: 0 6px 8px -4px rgba(10, 4, 20, .7);
}
.shop-sec-title::after { content: ""; flex: 1; height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(124, 255, 107, .5), transparent); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); grid-auto-rows: max-content; align-content: start; gap: var(--gap); padding: 4px 2px 8px; }
.shop-card {
  position: relative;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r);
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, #3d2568, #2c184c);
  box-shadow: 0 4px 0 #120822, inset 0 2px 0 rgba(255, 255, 255, .08);
}
.shop-card.owned { opacity: .62; }
.shop-card.poor .shop-ic { filter: grayscale(.4); }
.shop-card.is-locked { background: linear-gradient(180deg, #2a1d40, #1f1433); border-style: dashed; border-color: #4a3870; box-shadow: 0 4px 0 #120822; }
.shop-card.is-locked .shop-ic > .icon:first-child { filter: grayscale(1) brightness(.6); opacity: .7; }
.shop-card.is-locked .shop-name { color: #b9a6dc; }
.shop-card.is-locked .shop-desc, .shop-card.is-locked .upgrade-stars, .shop-card.is-locked .price { opacity: .55; }
.shop-card.nope { animation: shake .35s ease; }
.lock-badge { position: absolute; right: -8px; bottom: -8px; --icon: 30px !important; filter: drop-shadow(0 2px 0 var(--ink)); z-index: 1; }
.lock-badge.is-emoji .icon-emoji { font-size: 24px; }
.lock-btn {
  font: inherit; font-weight: 900; font-size: clamp(13px, 2vmin, 16px);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 44px; min-width: 7.2em; padding: .3em .8em;
  border-radius: 999px; border: 3px dashed #6b5596;
  background: rgba(0, 0, 0, .3); color: var(--gold);
  white-space: nowrap; cursor: not-allowed; touch-action: manipulation;
}
.lock-btn:focus-visible { outline: 4px solid var(--slime); outline-offset: 2px; }
.lock-btn .lock-ic { --icon: 22px !important; }
.lock-btn .lock-ic .icon-emoji { font-size: 17px; }
.shop-card.bought { animation: pop .45s ease; box-shadow: 0 4px 0 #120822, 0 0 0 3px var(--green), 0 0 26px rgba(124, 255, 107, .6); }
.shop-ic { position: relative; display: grid; place-items: center; width: clamp(54px, 9vmin, 72px); height: clamp(54px, 9vmin, 72px); border-radius: 16px; background: radial-gradient(circle, rgba(255, 211, 77, .18), rgba(0, 0, 0, .25) 70%); }
.shop-ic > .icon:first-child { --icon: clamp(46px, 8vmin, 64px) !important; } /* beats the inline --icon of icon() */
.bought-pop {
  position: absolute; left: 50%; top: 0;
  font-weight: 900; color: var(--green-2); white-space: nowrap;
  text-shadow: 0 2px 0 var(--ink), 0 0 10px rgba(124, 255, 107, .8);
  animation: float-up 1s ease-out forwards;
  pointer-events: none;
}
.shop-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shop-name { font-weight: 900; font-size: clamp(16px, 2.6vmin, 21px); color: var(--orange-2); text-shadow: 0 2px 0 var(--ink); }
.shop-desc { font-size: clamp(12px, 1.9vmin, 15px); color: var(--muted); }
.upgrade-stars { display: inline-flex; align-items: center; gap: 4px; }
.upgrade-stars .arrow { color: var(--green-2); font-weight: 900; }
.heart-count { font-weight: 900; color: #ff8a98; }
.shop-buy { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.price { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; font-size: clamp(16px, 2.6vmin, 22px); color: var(--gold); text-shadow: 0 2px 0 var(--ink); }
.price .icon { --icon: clamp(20px, 3vmin, 26px); }
.owned-tag { color: var(--green-2); font-size: 26px; }
.buy-btn { font-size: clamp(14px, 2.2vmin, 18px); min-width: 7.2em; padding: .4em .8em; }

/* ------------------------------------------------------------ level klaar / overwinning */
.celebrate { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.complete-panel, .victory-panel, .gameover-panel { width: min(640px, 100%); align-items: center; text-align: center; z-index: 2; }
.reveal { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.reveal-stage {
  position: relative;
  width: clamp(130px, 30vmin, 240px); height: clamp(130px, 30vmin, 240px);
  display: grid; place-items: center;
}
.reveal-stage.small { width: clamp(110px, 22vmin, 170px); height: clamp(110px, 22vmin, 170px); }
.rays {
  position: absolute; inset: -18%;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 211, 77, .38) 0 10deg, transparent 10deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 70%);
  mask: radial-gradient(circle, #000 25%, transparent 70%);
  animation: spin 9s linear infinite, fade-in .6s ease .3s both;
}
.reveal-glow { position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(circle, rgba(124, 255, 107, .55), transparent 70%); animation: pulse 1.6s ease-in-out infinite; }
.reveal-icon { position: relative; z-index: 2; animation: reveal 1s cubic-bezier(.2, 1.6, .4, 1) .35s both; }
.reveal-icon .icon { --icon: clamp(110px, 24vmin, 190px) !important; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .4)); }
.reveal-stage.small .reveal-icon .icon { --icon: clamp(80px, 15vmin, 120px) !important; }
.reveal-name { margin: 0; font-size: clamp(22px, 4.6vmin, 40px); color: var(--green-2); text-shadow: 0 3px 0 var(--ink), 0 0 18px rgba(124, 255, 107, .6); animation: rise-in .5s ease 1s both; }
.reveal-desc { margin: 0; max-width: 28em; color: var(--text); font-size: clamp(14px, 2.4vmin, 19px); animation: rise-in .5s ease 1.2s both; }
.sparkles i {
  position: absolute; left: 50%; top: 50%;
  color: var(--gold); font-style: normal; font-size: clamp(16px, 3vmin, 26px);
  text-shadow: 0 0 8px var(--gold);
  transform: rotate(calc(var(--i) * 60deg)) translateY(clamp(-130px, -16vmin, -70px));
  animation: twinkle 1.2s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * .2s);
  z-index: 3;
}
.late-in { animation: rise-in .4s ease 1.4s both; }
.bounce { animation: title-bounce .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.confetti i {
  position: absolute; top: -20px;
  width: 10px; height: 16px; border-radius: 2px;
  border: 1.5px solid rgba(0, 0, 0, .4);
  animation: confetti-fall 3s linear infinite;
}
.confetti i:nth-child(3n) { border-radius: 50%; width: 12px; height: 12px; }
.crown-pumpkin { position: relative; display: flex; flex-direction: column; align-items: center; }
.crown {
  width: clamp(50px, 9vmin, 84px); height: clamp(30px, 5vmin, 48px);
  margin-bottom: -8px; z-index: 4;
  background: linear-gradient(180deg, #fff2a8, var(--gold) 50%, #d99a00);
  clip-path: polygon(0 100%, 0 25%, 22% 60%, 50% 0, 78% 60%, 100% 25%, 100% 100%);
  filter: drop-shadow(0 0 10px rgba(255, 211, 77, .8));
  animation: bob 1.8s ease-in-out infinite;
}
.fireworks { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.fireworks i {
  position: absolute;
  left: calc(10% + var(--i) * 20%); top: calc(12% + (var(--i) * 37 % 4) * 9%);
  width: 8px; height: 8px; border-radius: 50%;
  box-shadow:
    0 -40px 0 #ffd34d, 28px -28px 0 #ff8a1f, 40px 0 0 #7cff6b, 28px 28px 0 #b67dff,
    0 40px 0 #ff5ab4, -28px 28px 0 #5ad8ff, -40px 0 0 #ffd34d, -28px -28px 0 #7cff6b;
  animation: firework 1.8s ease-out infinite;
  animation-delay: calc(var(--i) * .37s);
  opacity: 0;
}

/* ------------------------------------------------------------ pauze */
.pause-wrap { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.pause-panel { width: min(440px, 100%); align-items: stretch; }
.pause-panel .menu { width: 100%; }

/* ------------------------------------------------------------ HUD */
.hud {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 10;
  height: calc(var(--hud-h) + var(--safe-t));
  padding: calc(var(--safe-t) + 4px) calc(var(--safe-r) + 8px) 4px calc(var(--safe-l) + 8px);
  /* links en rechts nemen wat ze nodig hebben; het level-label staat in de ruimte ertussen en botst nooit */
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px;
  background: linear-gradient(180deg, rgba(10, 4, 20, .7), rgba(10, 4, 20, .35) 70%, transparent);
  pointer-events: none;
  font-size: clamp(13px, 2.4vmin, 20px);
}
.hud-left, .hud-right { display: flex; align-items: center; gap: clamp(4px, 1vmin, 10px); min-width: 0; }
.hud-right { justify-content: flex-end; }
.hud-mid { display: flex; justify-content: center; min-width: 0; }
.hud-pill {
  display: flex; align-items: center; gap: 4px;
  height: calc(var(--hud-h) - 10px);
  padding: 0 10px 0 6px;
  border-radius: 999px;
  background: rgba(20, 8, 36, .72);
  border: 2px solid rgba(180, 139, 255, .35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}
.hud .icon { --icon: calc(var(--hud-h) - 16px) !important; }
.hud-hearts { display: flex; gap: 0; }
/* 6-7 hartjes / 4-5 dieren: de iconen schuiven iets over elkaar (het plaatje vult maar ~65% van het vakje),
   zodat alles op ware grootte in de balk past */
.hud-hearts.many .hud-heart + .hud-heart { margin-left: calc((var(--hud-h) - 16px) * -.2); }
.hud-pets.many .hud-pet + .hud-pet { margin-left: calc((var(--hud-h) - 16px) * -.22); }
.hud-heart.empty { filter: grayscale(1) brightness(.9) contrast(.8); opacity: .4; }
.hud-heart.lost { animation: heart-lost .6s ease; }
.hud-heart.gained { animation: pop .5s ease; }
.hud-shields { display: flex; align-items: center; gap: 2px; margin-left: 6px; padding-left: 8px; border-left: 2px solid rgba(255, 255, 255, .15); color: #9fe2ff; font-weight: 900; }
.hud-level {
  font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  padding: 4px 14px; border-radius: 999px;
  background: rgba(20, 8, 36, .72); border: 2px solid rgba(255, 138, 31, .45);
  color: var(--orange-2); text-shadow: 0 2px 0 var(--ink);
}
.hud-coin-txt { display: flex; flex-direction: column; line-height: 1; }
.hud-coin-n { color: var(--gold); font-size: 1.1em; text-shadow: 0 2px 0 var(--ink); }
.hud-levelcoins { font-size: .62em; color: var(--green-2); font-weight: 800; white-space: nowrap; }
.hud-club { position: relative; padding: 0 6px; }
.hud-club.boosted { border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 211, 77, .6); }
.hud-club .sparkle {
  position: absolute; top: -4px; right: -4px; color: var(--gold); font-size: 1em;
  text-shadow: 0 0 6px var(--gold), 0 1px 0 var(--ink);
  animation: twinkle .8s ease-in-out infinite alternate;
}
.hud-pets { display: flex; gap: 0; padding: 0 8px; }
.hud-pet { display: inline-flex; }
.hud-pause {
  pointer-events: auto;
  width: max(48px, calc(var(--hud-h) - 4px)); height: max(48px, calc(var(--hud-h) - 4px));
  flex: none;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, var(--purple-2), var(--purple));
  box-shadow: 0 3px 0 var(--purple-dk), 0 0 10px rgba(180, 139, 255, .4);
  display: grid; place-items: center;
  cursor: pointer;
  touch-action: manipulation;
}
.hud-pause:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--purple-dk); }
.hud-pause:focus-visible { outline: 4px solid var(--slime); outline-offset: 2px; }
.pause-bars { width: 40%; height: 40%; display: block; background: linear-gradient(90deg, #fff 0 34%, transparent 34% 66%, #fff 66%); border-radius: 2px; filter: drop-shadow(0 1px 0 var(--ink)); }
.bump { animation: pop .35s ease; }

/* ------------------------------------------------------------ toasts */
.toasts {
  position: absolute; left: 50%; top: calc(var(--hud-h) + var(--safe-t) + 8px);
  transform: translateX(-50%);
  z-index: 50;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none;
  width: max-content; max-width: 92vw;
}
.toast {
  padding: .5em 1.1em;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(58, 33, 99, .95), rgba(34, 18, 60, .95));
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 2px rgba(255, 138, 31, .7), 0 6px 18px rgba(0, 0, 0, .5), 0 0 20px rgba(255, 138, 31, .35);
  font-weight: 900; font-size: clamp(15px, 2.8vmin, 24px);
  text-align: center;
  text-shadow: 0 2px 0 var(--ink);
  animation: toast-in .35s cubic-bezier(.2, 1.6, .4, 1) both;
}
.toast:not(:first-child) { opacity: .8; transform: scale(.9); }
.toast.out { animation: toast-out .35s ease forwards; }

/* ------------------------------------------------------------ touch */
.touch { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.joy {
  --js: clamp(120px, 28vmin, 190px);
  position: absolute;
  left: calc(var(--safe-l) + clamp(16px, 4vmin, 40px));
  bottom: calc(var(--safe-b) + clamp(16px, 4vmin, 40px));
  width: var(--js); height: var(--js);
  border-radius: 50%;
  pointer-events: auto;
  touch-action: none;
}
.joy-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .05) 40%, rgba(180, 139, 255, .18) 70%);
  border: 3px solid rgba(255, 255, 255, .28);
  box-shadow: 0 0 18px rgba(143, 85, 232, .3), inset 0 0 20px rgba(0, 0, 0, .3);
}
.joy-knob {
  position: absolute; left: 50%; top: 50%;
  width: 44%; height: 44%; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .7), rgba(180, 139, 255, .6) 60%);
  border: 3px solid rgba(26, 11, 43, .6);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .4);
  opacity: .7;
  pointer-events: none;
}
.joy.active .joy-knob { opacity: .95; }
.joy.active .joy-ring { border-color: rgba(124, 255, 107, .5); }
.hit-btn {
  --hs: clamp(96px, 22vmin, 150px);
  position: absolute;
  right: calc(var(--safe-r) + clamp(16px, 4vmin, 44px));
  bottom: calc(var(--safe-b) + clamp(16px, 4vmin, 44px));
  width: var(--hs); height: var(--hs);
  border-radius: 50%;
  border: 4px solid rgba(26, 11, 43, .7);
  background: radial-gradient(circle at 35% 30%, rgba(255, 210, 140, .85), rgba(255, 138, 31, .65) 55%, rgba(177, 77, 0, .65));
  box-shadow: 0 6px 0 rgba(120, 50, 0, .6), 0 0 22px rgba(255, 138, 31, .45);
  pointer-events: auto;
  touch-action: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #fff; font: inherit; font-weight: 900; font-size: clamp(14px, 2.6vmin, 20px);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .45);
  opacity: .78;
  cursor: pointer;
}
.hit-btn.pressed { transform: translateY(4px) scale(.95); box-shadow: 0 2px 0 rgba(120, 50, 0, .6), 0 0 30px rgba(255, 211, 77, .7); opacity: .95; }
.hit-ic {
  width: 38%; height: 38%;
  background: linear-gradient(135deg, transparent 0 38%, #7b4a24 38% 62%, transparent 62%), radial-gradient(circle at 72% 28%, #a8703c 0 30%, transparent 31%);
  border-radius: 6px;
  transform: rotate(-10deg);
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .4));
}

/* ------------------------------------------------------------ kleine schermen */
@media (max-height: 520px) {
  .title-main { flex-direction: row; gap: clamp(16px, 5vw, 60px); }
  .logo { font-size: clamp(40px, 12vmin, 80px); }
  .menu { width: min(360px, 44vw); }
  .menu .row { flex-wrap: wrap; }
  .pumpkin.deco { display: none; }
  .howto li { padding: 4px 8px; }
  .pet-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; row-gap: 0; align-items: center; justify-items: start; padding: 6px 10px; text-align: left; }
  .pet-card .pet-ic { grid-row: 1 / 3; --icon: 48px !important; }
  .pet-card .pet-desc { display: none; }
  .pet-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .panel-title { font-size: 22px; }
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
  .shop-card { padding: 6px 8px; gap: 8px; }
  .shop-ic { width: 46px; height: 46px; }
  .shop-ic > .icon:first-child { --icon: 40px !important; }
  .lock-badge { --icon: 24px !important; right: -6px; bottom: -6px; }
  .shop-sec-title { padding: 2px 6px 2px; font-size: 13px; }
  .shop-grid { gap: 6px; padding: 2px 2px 6px; }
  .shop-desc { font-size: 12px; line-height: 1.15; }
  .switch { min-height: 44px; padding: 2px 10px 2px 4px; }
  .audio-ctl { gap: 8px; }
  .buy-btn { min-width: 6em; min-height: 44px; padding: .25em .7em; font-size: 15px; }
  .lock-btn { min-height: 40px; min-width: 6em; padding: .2em .6em; font-size: 13px; }
  .shop-buy { gap: 2px; }
  .price { font-size: 16px; }
  .shop-name { font-size: 16px; line-height: 1.1; }
  /* Telefoon (liggend): "Verder" naast de titel, zodat de lijst bijna de hele hoogte krijgt */
  .shop-panel {
    height: 100%;
    display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto minmax(0, 1fr);
    gap: 4px 10px; padding: 8px 10px;
  }
  .shop-panel > .shop-head { grid-column: 1; grid-row: 1; flex-wrap: nowrap; }
  .shop-panel > .panel-foot { grid-column: 2; grid-row: 1; margin: 0; }
  .shop-panel > .panel-foot .btn-big { min-height: 48px; font-size: 19px; padding: .3em 1.1em; }
  .shop-panel > .note { grid-column: 1 / -1; grid-row: 2; font-size: 12px; }
  .shop-panel > .shop-list { grid-column: 1 / -1; grid-row: 3; }
  .shop-head .wallet { padding: 2px 12px 2px 4px; }
  .shop-head .wallet .icon { --icon: 30px !important; }
  .wallet-n { font-size: 22px; }
  .set-row { gap: 6px; }
  .modal-body { gap: 6px; }
  .settings-modal { padding: 8px 14px 10px; gap: 6px; }
  .settings-modal .panel-title { font-size: 20px; }
  .settings-modal .set-row { grid-template-columns: 8.2em 1fr; }
  .settings-modal .set-label { font-size: 14px; line-height: 1.1; }
  .settings-modal .seg-btn { min-height: 42px; font-size: 14px; padding: .2em .55em; }
  .settings-modal .switch { min-height: 42px; }
  .settings-modal .slider { height: 42px; }
  .settings-modal .btn { min-height: 44px; padding: .3em 1.2em; font-size: 18px; }
  .complete-panel, .victory-panel, .gameover-panel { gap: 6px; }
}
@media (max-width: 720px) {
  .hud-levelcoins { display: none; }
}
@media (max-width: 640px) {
  .hud-level { padding: 3px 8px; font-size: .85em; }
  .set-row { grid-template-columns: 1fr; gap: 4px; }
  .shop-card { grid-template-columns: auto 1fr; }
  .shop-buy { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }
}

/* ------------------------------------------------------------ animaties */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.anim-in { animation: panel-in .35s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes panel-in { from { opacity: 0; transform: scale(.9) translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes letter-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -.06em; } }
@keyframes slime-wobble { 0%, 100% { translate: 0 0; scale: 1 1; } 30% { translate: 0 -.04em; scale: .96 1.05; } 60% { translate: 0 .01em; scale: 1.04 .97; } }
@keyframes drip { 0%, 100% { scale: 1 1; } 55% { scale: 1 1.22; } 70% { scale: 1 .92; } }
@keyframes bubble-rise { 0% { opacity: 0; transform: translateY(0) scale(.4); } 20% { opacity: .95; } 100% { opacity: 0; transform: translateY(-.6em) scale(1.1); } }
@keyframes flask-bub { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 3px), calc(var(--pk) * -.5)) scale(1.1); } }
@keyframes zap { 0%, 38%, 46%, 54%, 100% { opacity: 1; scale: 1; } 42% { opacity: .5; scale: .92; } 50% { opacity: .65; scale: 1.08; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes wobble { 0%, 100% { rotate: -4deg; } 50% { rotate: 4deg; } }
@keyframes flicker { 0%, 100% { opacity: 1; } 45% { opacity: .85; } 50% { opacity: .6; } 55% { opacity: .95; } }
@keyframes twinkle { from { opacity: .35; } to { opacity: 1; } }
@keyframes fog-drift { from { transform: translateX(-3%); } to { transform: translateX(3%); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes heart-lost { 0% { transform: scale(1.4); filter: none; } 30% { transform: scale(.8) rotate(-12deg); } 100% { transform: none; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes pulse { 0%, 100% { transform: scale(.9); opacity: .7; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes reveal { 0% { transform: scale(0) rotate(-30deg); opacity: 0; } 60% { transform: scale(1.18) rotate(6deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes title-bounce { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes float-up { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -40px); } }
@keyframes confetti-fall {
  0% { transform: translate(0, -20px) rotate(0); }
  100% { transform: translate(var(--drift), 110vh) rotate(var(--rot)); }
}
@keyframes firework { 0% { opacity: 0; transform: scale(.1); } 15% { opacity: 1; } 70% { opacity: 1; transform: scale(1.4); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(.9); } }

@media (prefers-reduced-motion: reduce) {
  .ui *, .ui *::before, .ui *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .slime-bub, .fl-bub { opacity: .85; }
}
