/* Zählwiese · a storybook maze with gentle finger-guided movement and real cuddles. */
.family-maze-screen {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  padding: 3px clamp(8px, 3vw, 15px) max(16px, env(safe-area-inset-bottom, 0px)) !important;
  color: #735d46;
}
.family-maze-heading { display: flex; justify-content: center; gap: 13px; align-items: center; width: min(100%, 440px); }
.family-maze-heading h1 { font: 900 clamp(22px, 6vw, 31px)/1.15 'Chalkboard SE','Marker Felt',system-ui,sans-serif !important; color: #7c6246; margin: 1px 0 !important; text-shadow: 1px 2px #fff4d6; }
.family-maze-heading > span { font: 800 14px 'Chalkboard SE','Marker Felt',sans-serif; border-radius: 20px; padding: 4px 11px; background: #f5e9c7; border: 2px solid #ccae7f; white-space: nowrap; }
.family-maze-story { display: flex; align-items: center; justify-content: center; width: min(100%, 360px); gap: 16px; background: #fff4d5bb; border: 2px dashed #c6aa80; border-radius: 24px; padding: 4px 16px; min-height: 76px; flex: 0 0 auto; }
.family-maze-story-portrait { width: 66px; height: 68px; display: grid; place-items: center; }
.family-maze-story-portrait svg { width: 63px; height: 67px; filter: drop-shadow(1px 2px 1px #836c5e55); }
.family-maze-story-portrait.other svg { transform: none; }
.family-maze-story-arrow { width: 75px; height: 40px; overflow: visible; }
.family-maze-board { position: relative; width: min(100%, 415px); flex: 0 0 auto; touch-action: none !important; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; border-radius: 28px; filter: drop-shadow(2px 5px 2px #6e7c5b50); isolation: isolate; }
.family-maze-svg { display: block; width: 100%; height: auto; aspect-ratio: 1; touch-action: none !important; }
#mazeMovingFriend { will-change: transform; }
#mazeGuideRing circle { animation: maze-glow 2.3s ease-in-out infinite; }
@keyframes maze-glow { 0%, 100% { opacity: .78; stroke-width: 3.3; } 50% { opacity: .3; stroke-width: 7; } }
.family-maze-instruction { min-height: 24px; text-align: center; color: #689170; font: 900 clamp(15px,4.1vw,19px) 'Chalkboard SE','Marker Felt',sans-serif; text-shadow: 1px 1px #fff8d9; }
.family-maze-progress { display: flex; gap: 5px; align-items: center; justify-content: center; width: 100%; min-height: 17px; }
.family-maze-step { display: block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #ab9877; background: #f7e7c2; flex: 0 0 auto; }
.family-maze-step.complete { background: #84ba87; border-color: #669f78; }
.family-maze-step.current { background: #e2aab3; border-color: #b98197; transform: scale(1.23); box-shadow: 0 0 0 2px #ffefcb; }
.family-maze-controls { display: flex; justify-content: center; align-items: center; min-height: 48px; }
.family-maze-restart,.family-maze-next { border: 3px solid #ad865e; background: linear-gradient(#ffeec6,#ebcda6); color: #875e46; border-radius: 50%; display: grid; place-items: center; box-shadow: 1px 4px 0 #8e715b66; width: 51px; height: 51px; padding: 8px; touch-action: manipulation; }
.family-maze-restart svg,.family-maze-next svg { width: 100%; height: 100%; }
.family-maze-next { width: 66px; height: 66px; background: linear-gradient(#d7efb6,#9dce97); color: #517e53; border-color: #7fa16e; }
.family-maze-restart:active,.family-maze-next:active { transform: translateY(3px); }
.family-maze-victory { position: absolute; z-index: 30; inset: max(86px, 14%) 8% auto; border-radius: 30px; padding: 18px 16px 24px; border: 5px solid #be9b72; background: radial-gradient(ellipse at 50% 5%,#fffbe7,#f8e9c7); box-shadow: 0 10px 0 #7c71565a,0 0 0 100vmax #4f806a52; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.family-maze-victory[hidden] { display: none !important; }
.family-maze-cuddle { display: flex; width: 195px; height: 136px; position: relative; align-items: end; justify-content: center; overflow: visible; }
.family-maze-cuddle-moritz,.family-maze-cuddle-igor { position: absolute; width: 102px; height: 134px; bottom: 0; filter: drop-shadow(2px 4px 2px #a0846b50); transform-origin: 50% 90%; }
.family-maze-cuddle-moritz { left: 4px; animation: zw-maze-moritz-hug 2.6s ease-in-out infinite; }
.family-maze-cuddle-igor { width: 80px; height: 112px; right: 10px; bottom: -2px; animation: zw-maze-igor-hug 2.6s ease-in-out infinite; }
.family-maze-cuddle-moritz svg,.family-maze-cuddle-igor svg { width: 100%; height: 100%; }
.family-maze-cuddle-hearts { width: 130px; height: 70px; position: absolute; top: -27px; left: 50%; transform: translateX(-50%); animation: family-hearts 2.3s ease-in-out infinite; }
.family-maze-victory-title { font: 900 27px 'Chalkboard SE','Marker Felt',sans-serif; color: #62946b; margin: 10px 0 14px; text-shadow: 2px 2px #fff9de; }
@keyframes zw-maze-moritz-hug { 0%,10%,100% { transform: translateX(-20px) rotate(-6deg); } 30%,65% { transform: translateX(12px) rotate(13deg); } 80% { transform: translateX(4px) rotate(8deg); } }
@keyframes zw-maze-igor-hug { 0%,10%,100% { transform: translateX(19px) rotate(9deg); } 30%,65% { transform: translateX(-13px) rotate(-14deg) scale(.97); } 80% { transform: translateX(-5px) rotate(-7deg); } }
@keyframes family-hearts { 0% { opacity: 0; transform: translateX(-50%) translateY(24px) scale(.4); } 25%,70% { opacity: 1; transform: translateX(-50%) translateY(-6px) scale(1); } 100% { opacity: 0; transform: translateX(-50%) translateY(-24px) scale(1.13); } }
@media (max-height: 780px) and (orientation: portrait) {
  .family-maze-screen { gap: 1px !important; }
  .family-maze-story { min-height: 58px; padding: 2px 12px; }
  .family-maze-story-portrait { height: 54px; width: 52px; }
  .family-maze-story-portrait svg { width: 50px; height: 52px; }
  .family-maze-board { width: min(100%, calc(100dvh - 270px)) !important; }
  .family-maze-heading h1 { font-size: 22px !important; }
  .family-maze-restart { width: 43px; height: 43px; }
  .family-maze-step { width: 11px; height: 11px; }
}
@media (orientation: landscape) and (max-height: 530px) {
  .family-maze-screen { display: grid !important; grid-template-columns: minmax(0,1fr) minmax(210px,36%); grid-template-rows: auto auto 1fr auto !important; gap: 2px 10px !important; overflow-y: auto !important; }
  .family-maze-board { grid-column: 1; grid-row: 1/5; width: min(calc(100dvh - 95px),100%) !important; align-self: center; justify-self: end; }
  .family-maze-heading { grid-column: 2; grid-row: 1; }
  .family-maze-story { grid-column: 2; grid-row: 2; min-height: 57px; }
  .family-maze-instruction { grid-column: 2; grid-row: 3; align-self: center; }
  .family-maze-progress { grid-column: 2; grid-row: 4; }
  .family-maze-controls { grid-column: 2; grid-row: 4; justify-self: end; }
  .family-maze-victory { inset: 5% 15% auto; width: 70%; justify-self: center; }
}
.family-maze-screen { position: relative !important; }

/* V43: Moritz and Igor are equally valued characters, not parent and child. */
.family-maze-story-portrait svg { width:65px;height:69px; }
.family-maze-cuddle {width:218px;height:142px}
.family-maze-cuddle-moritz,.family-maze-cuddle-igor {width:112px;height:140px;bottom:0}
.family-maze-cuddle-moritz{left:0;animation:zw-maze-moritz-hug 2.3s cubic-bezier(.45,0,.3,1) infinite}
.family-maze-cuddle-igor{right:0;animation:zw-maze-igor-hug 2.3s cubic-bezier(.45,0,.3,1) infinite}
@keyframes zw-maze-moritz-hug {0%,12%,100%{transform:translateX(-15px) rotate(-5deg)}40%,74%{transform:translateX(22px) rotate(10deg)}84%{transform:translateX(8px) rotate(4deg)}}
@keyframes zw-maze-igor-hug {0%,12%,100%{transform:translateX(15px) rotate(6deg)}40%,74%{transform:translateX(-22px) rotate(-9deg)}84%{transform:translateX(-8px) rotate(-4deg)}}
@media(max-width:350px){.family-maze-story {gap:7px}.family-maze-cuddle {transform:scale(.9)}}
