.is-hidden { display: none !important; }

/* =========================
   GLOBAL BACKGROUND CONTROL
   - Welcome (00) ohne Küche
   - Ab Step 01 mit Küche
========================= */
.spaghetti-game {
  max-width: 900px;
  margin: 0 auto;
  position: relative;

  /* background-image:url("/public/images/kids-kitchen/spaghetti/kitchen-bg.jpg");
  background-size: contain;
  background-position:center;
  background-repeat:no-repeat; */

  border-radius: 18px;
  padding: 12px;

  /* box-shadow: 0 10px 30px rgba(0,0,0,0.18); */
}

.spaghetti-game.no-kitchen {
  background: none;
  padding: 96px 0 0;
  box-shadow: none;
}

.intro-actions {
  margin: 12px 0 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 0 6px;
}

.intro-next {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
  background: #16a34a;
  color: #fff;
}

.quest-title {
  margin: 12px 0 10px 0;
  font-size: 1.1rem;
  font-weight: 900;
  background: rgba(255,255,255,0.85);
  padding: 10px 14px;
  border-radius: 12px;
}

/* Pot HUD bleibt "über" dem Hintergrund */
.pot-hud {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px 0;
}

.pot-hud img {
  width: 180px;
  max-width: 45vw;
  height: auto;
  border-radius: 14px;
  background: rgba(255,255,255,0.85);
  padding: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

/* Hand PNG (Step 06) */
.kk-hand{
  position: absolute;
  width: clamp(120px, 22vw, 200px);
  aspect-ratio: 1 / 1;              /* ✅ wichtig: gibt Höhe */
  transform: translate(-50%, -50%);
  z-index: 95;

  background-image: url("/public/images/kids-kitchen/spaghetti/hand.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;

  pointer-events: none;             /* JS setzt beim Unlock auf auto */
}

.kk-hand.is-grabbing{
  transform: translate(-50%, -50%) scale(0.95);
}

/* Content boxes */
.learning-box, .task-box, .info-box {
  margin: 0 0 12px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.task-box {
  background: #fef3c7;
  border-left: 6px solid #f59e0b;
  font-weight: 700;
}

.code-box {
  background: rgba(255,255,255,0.70);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.code-row { display: flex; gap: 10px; align-items: center; }

.code-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.18);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
}

.code-run {
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 900;
  cursor: pointer;
  background: #0ea5e9;
  color: #fff;
}

.code-result { margin-top: 10px; font-weight: 900; }

@media (max-width: 520px) {
  .code-row { flex-direction: column; align-items: stretch; }
}

/* =========================
   SEARCH AREA (INTERACTION)
========================= */
.search-area {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 18px;
  overflow: hidden;

  /* ✅ Fix für WebView/Mobile: pinch-zoom kann Scroll-Gesten “killen” */
  touch-action: auto;                 /* vorher: pinch-zoom */
  overscroll-behavior: contain;

  background-image: url("/public/images/kids-kitchen/spaghetti/kitchen-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.search-locked {
  margin: 8px 0 12px 0;
  display: inline-block;
  background: rgba(255,255,255,0.95);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 900;
  border: 1px solid rgba(0,0,0,0.08);
}

.search-target {
  position: absolute;
  width: 120px;
  transform: translate(-50%,-50%);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
  user-select: none;
}

.search-target.is-revealed { opacity: 1; }

/* Lupe = echtes Glas (global steuerbar) */
.lens{
  position: absolute;

  width: clamp(70px, 16vw, 140px);
  height: clamp(70px, 16vw, 140px);

  transform: translate(-50%, -50%);
  pointer-events: none;

  border-radius: 999px;
  border: 6px solid rgba(0,0,0,0.45);
  box-shadow: 0 10px 20px rgba(0,0,0,0.25);

  background-image: url("/public/images/kids-kitchen/spaghetti/kitchen-bg.jpg");
  background-repeat: no-repeat;

  overflow: hidden;
}

.lens::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%,
    rgba(255,255,255,0.35),
    rgba(255,255,255,0.05) 55%,
    rgba(255,255,255,0) 70%
  );
}

.lens::after {
  content: "";
  position: absolute;
  width: 55%;
  height: 12%;
  left: 55%;
  top: 72%;
  transform: rotate(35deg);
  transform-origin: left center;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.lens img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.25));
}

/* =========================
   Overlays (global)
========================= */
.kk-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0,0,0,0.60) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 18px !important;
  z-index: 999999 !important;
}

.kk-overlay.is-hidden { display: none !important; }

.kk-overlay-card {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  text-align: center;
}

.nav-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  cursor: pointer;
  background: #b91c1c;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.nav-btn.is-hidden { display: none !important; }

.kk-toolbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.kk-left,
.kk-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-btn,
.intro-next {
  height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
}

/* =========================
   POT-ERKLÄRUNG
========================= */
.search-area .kk-bubble-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.18);
  z-index: 80;

  /* ✅ Layer fängt Touch ab, aber darf Scroll-Geste “durchreichen” zur Bubble */
  pointer-events: auto;
  touch-action: pan-y;              /* vorher: auto (pan-y ist stabiler) */
  overscroll-behavior: contain;
}

.search-area .kk-bubble {
  width: min(520px, 92%);
  background: #fff;
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.25);
  position: relative;
  font-weight: 800;

  /* ✅ Scrollbar stabil auf Mobile */
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;

  /* ✅ verhindert “Zurückspringen” / Bounce */
  overscroll-behavior: contain;
  overscroll-behavior-y: contain; /* extra robust in manchen WebViews */

  /* ✅ Scroll-Geste eindeutig vertikal */
  touch-action: pan-y;

  -webkit-user-select: none;
  user-select: none;
}

.search-area .kk-bubble::after {
  content: "";
  position: absolute;
  left: 26px;
  bottom: -10px;
  width: 18px;
  height: 18px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 6px 6px 14px rgba(0,0,0,0.10);
}

.search-area .kk-bubble h4 {
  margin: 0 0 8px 0;
  font-size: 1.05rem;
  font-weight: 900;
}

.search-area .kk-bubble p {
  margin: 8px 0;
  line-height: 1.35;
}

.search-area .kk-bubble .kk-count {
  font-size: 2.2rem;
  font-weight: 900;
  text-align: center;
  margin: 10px 0 4px 0;
}

.search-area .kk-bubble .kk-answer {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.search-area .kk-bubble input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.18);
  font-weight: 800;
}

.search-area .kk-bubble button {
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  cursor: pointer;
  background: #16a34a;
  color: #fff;
}

/* Beweglicher Topf (Step 03) */
.pot {
  position: absolute;
  width: clamp(70px, 16vw, 140px);
  height: clamp(70px, 16vw, 140px);
  transform: translate(-50%, -50%);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 60;
}

/* Loader */
.kk-loader-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.18);
  z-index: 80;
}

.kk-loader {
  width: 54px;
  height: 54px;
  border-radius: 50%;

  border: 6px solid rgba(255,255,255,0.35);
  border-top-color: #3b82f6;

  animation:
    kkspin 0.6s linear infinite,
    kkglow 1.2s ease-in-out infinite,
    kkcolor 2.4s linear infinite;
}

@keyframes kkspin { to { transform: rotate(360deg); } }

@keyframes kkglow {
  0%   { filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  50%  { filter: drop-shadow(0 0 16px rgba(255,255,255,0.6)); }
  100% { filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
}

@keyframes kkcolor {
  0%   { border-top-color: #3b82f6; }
  33%  { border-top-color: #22c55e; }
  66%  { border-top-color: #f59e0b; }
  100% { border-top-color: #a855f7; }
}

/* =========================
   Celebration (Konfetti + Message)
========================= */
.celebrate-stage {
  position: absolute;
  left: 16px;
  top: 70px;
  width: calc(100% - 240px);
  height: 220px;
  pointer-events: none;
  overflow: hidden;
  border-radius: 18px;
  z-index: 70;
}

.confetti {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  opacity: 0.95;
  animation: confetti-fall 3600ms ease-out forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(320px) rotate(360deg); opacity: 0; }
}

.celebrate-msg {
  position: absolute;
  left: 14px;
  top: 12px;
  font-weight: 900;
  font-size: 1.2rem;
  background: rgba(255,255,255,0.92);
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.10);
  animation: pop 2200ms ease-out forwards;
}

@keyframes pop {
  0%   { transform: scale(0.85); opacity: 0; }
  15%  { transform: scale(1.05); opacity: 1; }
  70%  { transform: scale(1.0); opacity: 1; }
  100% { transform: scale(1.0); opacity: 0; }
}

/* Kurze Nachricht in der Spielwiese */
.kk-toast{
  position:absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.92);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 900;
  box-shadow: 0 10px 25px rgba(0,0,0,0.16);
  z-index: 120;
}
.kk-toast.is-hidden{ display:none !important; }

/* =========================
   HUD (Letzter Topf)
========================= */

.kk-hud {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 250;

  display: flex;
  gap: 10px;
  align-items: center;

  margin: 0;
}

.kk-lastpot {
  border: 1px solid #ddd;
  background: #ffffff;
  cursor: pointer;
  font-weight: 600;

  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
}

.kk-lastpot.is-hidden {
  display: none !important; /* passt zu deiner globalen .is-hidden Regel */
}

.kk-blink {
  animation: kkBlink 1.2s ease-in-out;
}

@keyframes kkBlink {
  0% { transform: translateY(0); }
  25% { transform: translateY(-6px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

/* Step 01: Hier wird die Lupe erst gesucht – keine Zoom-Lupe anzeigen */
.quest[data-qid="lupe_find_lens"] .lens {
  display: none !important;
}