/* ═══════════════════════════════════════════
   NATUTA.DIAMOND — Portrait Kiosk Stylesheet
   1080 × 1920 canvas scaled to viewport
═══════════════════════════════════════════ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000
}

/* ── Portrait canvas ── */
#app {
  width: 1080px;
  height: 1920px;
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  overflow: hidden;
  font-family: 'Nunito', 'Arial Rounded MT Bold', 'Trebuchet MS', sans-serif;
}

/* ═══════════════════════════════════
   NATURE BACKGROUND
═══════════════════════════════════ */
#bg {
  position: absolute;
  inset: 0;
  background: var(--plain-bg, url('/other/plain_bg.png')) no-repeat center center;
  background-size: cover;
  transition: background-image 0.5s ease-in-out;
}

#bg.landing-theme {
  background: var(--ducks-bg, url('/other/ducks_bg.png')) no-repeat center center;
  background-size: cover;
}

#bg.plain-theme {
  background: var(--plain-bg, url('/other/plain_bg.png')) no-repeat center center;
  background-size: cover;
}

#bg.landing-theme>*,
#bg.plain-theme>* {
  display: none !important;
}

/* Sun */
.sun {
  position: absolute;
  top: 55px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFFAD0 25%, #FFE566 55%, #FFD700 100%);
  box-shadow: 0 0 80px 40px rgba(255, 220, 50, .55), 0 0 180px 90px rgba(255, 200, 0, .2);
  animation: sun-pulse 4s ease-in-out infinite;
}

@keyframes sun-pulse {

  0%,
  100% {
    box-shadow: 0 0 80px 40px rgba(255, 220, 50, .55), 0 0 180px 90px rgba(255, 200, 0, .2)
  }

  50% {
    box-shadow: 0 0 110px 60px rgba(255, 220, 50, .75), 0 0 220px 110px rgba(255, 200, 0, .3)
  }
}

/* Clouds */
.cloud {
  position: absolute;
  background: rgba(255, 255, 255, .82);
  border-radius: 60px;
  animation: cloud-drift linear infinite
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%
}

.cloud-a {
  width: 220px;
  height: 65px;
  top: 100px;
  animation-duration: 42s
}

.cloud-a::before {
  width: 110px;
  height: 90px;
  top: -50px;
  left: 25px
}

.cloud-a::after {
  width: 85px;
  height: 70px;
  top: -38px;
  right: 35px
}

.cloud-b {
  width: 170px;
  height: 52px;
  top: 190px;
  opacity: .72;
  animation-duration: 58s;
  animation-delay: -22s
}

.cloud-b::before {
  width: 85px;
  height: 68px;
  top: -38px;
  left: 18px
}

.cloud-b::after {
  width: 65px;
  height: 52px;
  top: -28px;
  right: 28px
}

.cloud-c {
  width: 130px;
  height: 44px;
  top: 150px;
  opacity: .55;
  animation-duration: 48s;
  animation-delay: -38s
}

.cloud-c::before {
  width: 65px;
  height: 58px;
  top: -32px;
  left: 12px
}

.cloud-c::after {
  width: 52px;
  height: 44px;
  top: -22px;
  right: 18px
}

@keyframes cloud-drift {
  0% {
    transform: translateX(-350px)
  }

  100% {
    transform: translateX(1200px)
  }
}

/* Hills */
.hill {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(180deg, #72BC4E 0%, #4A8C2A 100%)
}

.hill-l {
  width: 500px;
  height: 200px;
  bottom: 37%;
  left: -80px
}

.hill-r {
  width: 450px;
  height: 180px;
  bottom: 37%;
  right: -60px
}

/* Meadow */
.meadow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 38%;
  height: 160px;
  background: linear-gradient(180deg, #86CC5E 0%, #5A9C38 55%, #3A7A28 100%);
  border-radius: 120% 120% 0 0/80px 80px 0 0;
}

.blades {
  position: absolute;
  bottom: 38%;
  left: 0;
  right: 0;
  height: 60px;
  pointer-events: none
}

/* Pond */
.pond {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 39%;
  overflow: hidden
}

.water {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(88, 185, 225, .96) 0%, rgba(50, 130, 185, .98) 40%, rgba(20, 80, 130, 1) 100%);
}

.water-shimmer {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0px, rgba(255, 255, 255, .07) 2px, transparent 5px, transparent 65px);
  animation: shimmer 3.5s ease-in-out infinite;
}

@keyframes shimmer {

  0%,
  100% {
    opacity: .5
  }

  50% {
    opacity: 1
  }
}

.water-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, .18);
  border-radius: 2px;
  animation: wldrift 4s ease-in-out infinite
}

.wl1 {
  top: 12%;
  animation-delay: 0s
}

.wl2 {
  top: 28%;
  animation-delay: 1s
}

.wl3 {
  top: 48%;
  animation-delay: .5s
}

.wl4 {
  top: 68%;
  animation-delay: 1.5s
}

@keyframes wldrift {

  0%,
  100% {
    transform: scaleX(1);
    opacity: .6
  }

  50% {
    transform: scaleX(1.04) translateX(-10px);
    opacity: 1
  }
}

.ripple-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .28);
  animation: ripple-expand ease-out infinite
}

@keyframes ripple-expand {
  0% {
    transform: scale(0);
    opacity: .9
  }

  100% {
    transform: scale(4);
    opacity: 0
  }
}

/* Lily pads */
.lily {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #6BBD3E 0%, #4A8C2A 65%, #366820 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}

.lily::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  background: rgba(0, 0, 0, .08);
  border-radius: 0 50% 50% 0
}

.lily-bloom {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px
}

.petal {
  position: absolute;
  width: 14px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #FFC0CB 0%, #FF7BAC 100%);
  transform-origin: bottom center;
  left: calc(50% - 7px);
}

.lily-center-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFE566, #FFD700);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

/* Cattails */
.cattail {
  position: absolute;
  bottom: 39%;
  display: flex;
  flex-direction: column;
  align-items: center
}

.ct-head {
  width: 16px;
  border-radius: 8px;
  background: linear-gradient(180deg, #8B6914, #5C4508)
}

.ct-stem {
  width: 5px;
  background: linear-gradient(180deg, #9B8040, #7A6030);
  border-radius: 3px
}

.reed-stalk {
  position: absolute;
  bottom: 39%;
  border-radius: 3px;
  background: linear-gradient(180deg, #A2D866 0%, #6DAF2A 100%);
  transform-origin: bottom center;
  animation: sway ease-in-out infinite alternate;
}

@keyframes sway {
  0% {
    transform: rotate(-7deg)
  }

  100% {
    transform: rotate(7deg)
  }
}

/* ═══════════════════════════════════
   PARTICLES
═══════════════════════════════════ */
#particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 6
}

.sp {
  position: absolute;
  pointer-events: none;
  animation: sp-float ease-in-out infinite
}

@keyframes sp-float {
  0% {
    transform: translateY(0) rotate(0deg) scale(.4);
    opacity: 0
  }

  15% {
    opacity: 1
  }

  85% {
    opacity: .7
  }

  100% {
    transform: translateY(-280px) rotate(360deg) scale(.2);
    opacity: 0
  }
}

.bub {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .08);
  animation: bub-rise ease-in infinite;
}

@keyframes bub-rise {
  0% {
    transform: translateY(0);
    opacity: .8
  }

  100% {
    transform: translateY(-500px) translateX(15px);
    opacity: 0
  }
}

/* Burst effects */
.efx {
  position: absolute;
  pointer-events: none;
  font-size: 30px;
  z-index: 40;
  animation: efx-float 2.5s ease-out forwards
}

@keyframes efx-float {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1
  }

  100% {
    transform: translate(var(--tx), var(--ty)) scale(.3);
    opacity: 0
  }
}

/* ═══════════════════════════════════
   THEME OVERLAY
═══════════════════════════════════ */
#theme-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  opacity: 0;
  transition: opacity 1.2s, background 1.2s
}

/* ═══════════════════════════════════
   HEADER
═══════════════════════════════════ */
.hdr {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 20;
  background: linear-gradient(180deg, rgba(0, 0, 0, .18) 0%, transparent 100%);
  padding: 20px;
}

.logo {
  font-family: 'Bubblegum Sans', 'Arial Rounded MT Bold', cursive;
  font-size: 78px;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 24px rgba(255, 220, 80, .8), 0 4px 10px rgba(0, 0, 0, .4);
  letter-spacing: 2px
}

.logo-sub {
  font-size: 30px;
  color: rgba(255, 255, 255, .92);
  font-weight: 800;
  letter-spacing: 5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .35)
}

/* ═══════════════════════════════════
   SCREENS
═══════════════════════════════════ */
.scr {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  transition: opacity .5s cubic-bezier(0.25, 1, 0.5, 1), transform .5s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 10
}

.scr.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: all
}

/* ── ATTRACT ── */
#s-attract {
  justify-content: space-between
}

.attract-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 60px;
  gap: 20px
}

.attract-img {
  max-width: 92%;
  max-height: 820px;
  object-fit: contain;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, .35));
  animation: attract-bob 3.2s ease-in-out infinite
}

@keyframes attract-bob {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-22px)
  }
}

.attract-tagline {
  font-family: 'Bubblegum Sans', cursive;
  font-size: 52px;
  color: #fff;
  text-align: center;
  text-shadow: 0 0 18px rgba(255, 210, 80, .7), 0 3px 8px rgba(0, 0, 0, .35);
  line-height: 1.3
}

.attract-cta {
  width: 100%;
  padding: 30px 60px 50px;
  display: flex;
  flex-direction: column;
  align-items: center
}

.tap-btn {
  background: linear-gradient(135deg, #FFD700 0%, #FF8C00 100%);
  color: #fff;
  font-family: 'Bubblegum Sans', cursive;
  font-size: 56px;
  border: none;
  border-radius: 70px;
  padding: 30px 90px;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(255, 140, 0, .55), 0 0 0 6px rgba(255, 215, 0, .28);
  animation: tap-pulse 2.2s ease-in-out infinite;
}

@keyframes tap-pulse {

  0%,
  100% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.06);
    box-shadow: 0 12px 42px rgba(255, 140, 0, .7), 0 0 0 14px rgba(255, 215, 0, .15)
  }
}

.mini-dlg {
  position: absolute;
  background: rgba(255, 255, 255, .96);
  border-radius: 20px;
  padding: 16px 28px;
  font-size: 28px;
  font-weight: 700;
  color: #555;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
  animation: dlg-pop .4s cubic-bezier(.34, 1.56, .64, 1);
  z-index: 30;
  pointer-events: none;
}

.mini-dlg::after {
  content: '';
  position: absolute;
  bottom: -13px;
  left: 50%;
  transform: translateX(-50%);
  border: 13px solid transparent;
  border-top-color: rgba(255, 255, 255, .96);
  border-bottom: 0
}

@keyframes dlg-pop {
  from {
    transform: scale(0) translateY(10px);
    opacity: 0
  }

  to {
    transform: scale(1);
    opacity: 1
  }
}

/* ── INTRO ── */
#s-intro {
  justify-content: flex-start
}

.intro-stage {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  padding-bottom: 30px
}

.intro-duck-wrap {
  position: relative;
  width: 540px;
  height: 650px;
  display: flex;
  align-items: center;
  justify-content: center
}

.intro-duck-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  pointer-events: none;
}

@keyframes intro-enter {
  from {
    transform: scale(.5) translateY(80px);
    opacity: 0
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1
  }
}

.intro-glow {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  filter: blur(50px);
  opacity: .55;
  animation: glow-pulse 2.5s ease-in-out infinite
}

@keyframes glow-pulse {

  0%,
  100% {
    opacity: .45;
    transform: scale(.88)
  }

  50% {
    opacity: .75;
    transform: scale(1.12)
  }
}

.intro-name {
  font-family: 'Bubblegum Sans', cursive;
  font-size: 56px;
  color: #fff;
  text-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  margin-top: 8px
}

.intro-speech {
  background: rgba(255, 255, 255, .96);
  border-radius: 32px;
  padding: 28px 50px;
  margin: 22px 60px 0;
  font-size: 40px;
  font-weight: 800;
  color: #444;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .2);
  line-height: 1.45;
  animation: speech-pop .45s cubic-bezier(.34, 1.56, .64, 1);
  white-space: pre-line;
}

@keyframes speech-pop {
  from {
    transform: scale(.7);
    opacity: 0
  }

  to {
    transform: scale(1);
    opacity: 1
  }
}

.intro-dots {
  display: flex;
  gap: 16px;
  margin-top: 22px
}

.intro-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .38);
  transition: all .3s
}

.intro-dot.on {
  background: #fff;
  transform: scale(1.35)
}

.intro-skip {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, .45);
  border-radius: 40px;
  padding: 16px 52px;
  font-family: 'Nunito', sans-serif;
  font-size: 30px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 18px;
  transition: background .2s;
}

.intro-skip:hover {
  background: rgba(255, 255, 255, .28)
}

/* ── SELECTION ── */
#s-select {
  justify-content: flex-start
}

.select-prompt {
  font-family: 'Bubblegum Sans', cursive;
  font-size: 50px;
  color: #fff;
  text-align: center;
  text-shadow: 0 4px 12px rgba(0, 0, 0, .3);
  padding: 10px 60px 0;
  line-height: 1.35
}

.cards-grid {
  position: absolute;
  left: 0;
  top: 0;
  width: 1080px;
  height: 1920px;
  pointer-events: none;
  z-index: 12;
}

.duck-card {
  position: absolute;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  pointer-events: auto;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
  z-index: 15;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.duck-card:hover,
.duck-card:active {
  transform: scale(1.1) translateY(-10px);
}

.card-pinky {
  left: 340px;
  top: 430px;
  width: 450px;
  height: 500px;
}

.card-sunny {
  left: 0px;
  top: 670px;
  width: 330px;
  height: 330px;
}

.card-pearla {
  left: 680px;
  top: 845px;
  width: 350px;
  height: 350px;
}

.card-glitta {
  left: 400px;
  top: 1250px;
  width: 410px;
  height: 475px;
}

.card-blu {
  left: 20px;
  top: 1130px;
  width: 420px;
  height: 420px;
}

.card-img {
  width: 100%;
  height: 85%;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .4));
  transition: transform .25s;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.card-name {
  font-family: 'Bubblegum Sans', cursive;
  font-size: 45px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px 18px;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  white-space: nowrap;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.duck-card.selected-active {
  animation: duck-select-jump 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
  z-index: 999;
}

.duck-card.selected-active .card-img {
  animation: none !important;
}

@keyframes duck-float {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-16px);
  }
}

@keyframes duck-select-jump {
  0% {
    transform: scale(1) translateY(0);
  }

  30% {
    transform: scale(1.3) translateY(-80px) rotate(-8deg);
    filter: drop-shadow(0 15px 30px rgba(255, 255, 255, 0.8));
    opacity: 1;
  }

  100% {
    transform: scale(1.5) translateY(-120px) rotate(8deg);
    opacity: 0;
  }
}

/* ── CHAT STAGE ── */
#s-chat {
  justify-content: flex-start
}

.stage-area {
  position: absolute;
  inset: 0;
  width: 1080px;
  height: 1920px;
  pointer-events: none;
  z-index: 12;
}

.stage-main {
  position: absolute;
  left: 250px;
  bottom: 700px;
  width: 580px;
  height: 740px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: auto;
  z-index: 15;
  transition: all 0.3s ease;
}

.stage-main::before {
  content: '';
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 680px;
  height: 68px;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  z-index: 10;
  pointer-events: none;
  animation: platform-breathe 3s ease-in-out infinite;
}

@keyframes platform-breathe {

  0%,
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.6;
  }

  50% {
    transform: translateX(-50%) scale(0.9);
    opacity: 0.35;
  }
}

.stage-main-img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 15;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, .35))
}

/* ── IDLE breathe ── */
@keyframes duck-breathe {

  0%,
  100% {
    transform: translateY(0) scale(1)
  }

  50% {
    transform: translateY(-14px) scale(1.025)
  }
}

/* ── SPEAKING hop (walking in place) ── */
@keyframes duck-hop {
  0% {
    transform: translateY(0px) scaleY(1.00) rotate(0deg) scaleX(1.00)
  }

  10% {
    transform: translateY(-24px) scaleY(1.04) rotate(-6deg) scaleX(0.97)
  }

  20% {
    transform: translateY(4px) scaleY(0.90) rotate(0deg) scaleX(1.08)
  }

  30% {
    transform: translateY(0px) scaleY(1.00) rotate(0deg) scaleX(1.00)
  }

  55% {
    transform: translateY(-20px) scaleY(1.04) rotate(6deg) scaleX(0.97)
  }

  65% {
    transform: translateY(4px) scaleY(0.90) rotate(0deg) scaleX(1.08)
  }

  75% {
    transform: translateY(0px) scaleY(1.00) rotate(0deg) scaleX(1.00)
  }

  100% {
    transform: translateY(0px) scaleY(1.00) rotate(0deg) scaleX(1.00)
  }
}

/* ── Eye blink ── */
@keyframes eyelid-close {

  0%,
  100% {
    transform: scaleY(0)
  }

  40%,
  60% {
    transform: scaleY(1)
  }
}

.stage-main-glow {
  position: absolute;
  inset: -28px;
  border-radius: 50%;
  filter: blur(55px);
  opacity: .55;
  z-index: 14;
  animation: glow-pulse 2.5s ease-in-out infinite
}

.speaking-waves {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 8px;
  align-items: flex-end;
  height: 56px;
  z-index: 20
}

.speaking-waves.on {
  display: flex
}

/* ── Duck character rig — stage background loop ── */
.duck-wrap {
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.duck-wrap.quacking {
  /* Stable video */
}

.duck-main {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 24px;
}

/* Specific duck character adjustments on chat screen */
.duck-wrap[data-duck="pearla"] .duck-main {
  transform: scale(0.8) translateY(20px);
  transform-origin: bottom center;
}

.duck-wrap[data-duck="sunny"] .duck-main {
  transform: scale(0.82) translateY(10px);
  transform-origin: bottom center;
}

.duck-main.word-quack {
  animation: none;
}

@keyframes quack-squash {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scaleY(0.85) scaleX(1.1) translateY(12px);
  }

  100% {
    transform: scale(1);
  }
}

/* Eye-lid overlays — coloured to match each duck's face */
.eye-lid {
  position: absolute;
  border-radius: 50% 50% 50% 50% / 20% 20% 80% 80%;
  transform: scaleY(0);
  transform-origin: top center;
  pointer-events: none;
  z-index: 22;
}

.eye-lid.blink {
  animation: eyelid-close 0.22s ease-in-out forwards
}

/* D-ID video overlay (fallback if D-ID ever works) */
.did-video {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 18px;
  z-index: 25;
  filter: drop-shadow(0 22px 44px rgba(0, 0, 0, .45))
}

.wv {
  width: 12px;
  background: rgba(255, 255, 255, .85);
  border-radius: 6px;
  min-height: 8px;
  animation: wv-bar .75s ease-in-out infinite
}

.wv:nth-child(1) {
  animation-delay: 0s
}

.wv:nth-child(2) {
  animation-delay: .08s
}

.wv:nth-child(3) {
  animation-delay: .16s
}

.wv:nth-child(4) {
  animation-delay: .24s
}

.wv:nth-child(5) {
  animation-delay: .32s
}

.wv:nth-child(6) {
  animation-delay: .24s
}

.wv:nth-child(7) {
  animation-delay: .16s
}

@keyframes wv-bar {

  0%,
  100% {
    height: 8px
  }

  50% {
    height: 48px
  }
}

.side-ducks {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 32px;
  pointer-events: all;
  z-index: 30;
}

.sd {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), background-color .25s, border-color .25s;
  animation: sd-float 3.5s ease-in-out infinite alternate;
}

.sd:hover {
  transform: scale(1.15);
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
}

.sd img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .25));
}

.sd-label {
  font-family: 'Bubblegum Sans', cursive;
  font-size: 20px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .4);
  position: absolute;
  bottom: -10px;
  background: rgba(0, 0, 0, .45);
  border-radius: 12px;
  padding: 2px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 5;
  pointer-events: none;
  white-space: nowrap;
}

.sd-0 {
  animation-delay: 0s;
}

.sd-1 {
  animation-delay: .4s;
}

.sd-2 {
  animation-delay: .8s;
}

.sd-3 {
  animation-delay: 1.2s;
}

@keyframes sd-float {
  0% {
    transform: translateY(0)
  }

  100% {
    transform: translateY(-14px)
  }
}

.stage-badge {
  position: relative;
  margin-top: 10px;
  font-family: 'Bubblegum Sans', cursive;
  font-size: 48px;
  color: #fff;
  text-shadow: 0 4px 12px rgba(0, 0, 0, .3);
  background: rgba(0, 0, 0, .25);
  border-radius: 32px;
  padding: 10px 44px;
  backdrop-filter: blur(10px);
  border: 2.5px solid rgba(255, 255, 255, .45);
  z-index: 60;
  display: inline-block;
}

.back-btn {
  position: absolute;
  top: 28px;
  left: 38px;
  z-index: 50;
  background: rgba(255, 255, 255, .25);
  border: 2.5px solid rgba(255, 255, 255, .45);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 28px;
  font-weight: 700;
  border-radius: 40px;
  padding: 14px 34px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background .2s, transform .2s;
}

.back-btn:hover {
  background: rgba(255, 255, 255, .35);
  transform: scale(1.05)
}

.chat-if {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 420px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 44px 44px;
  gap: 20px;
  z-index: 20;
  overflow: visible;
}

.chat-msgs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  overflow: visible;
}

.chat-msgs::-webkit-scrollbar {
  width: 0px;
  display: none
}

.cb {
  max-width: 90%;
  padding: 16px 36px;
  border-radius: 30px;
  font-size: 32px;
  line-height: 1.5;
  font-weight: 700;
  text-align: center;
  animation: cb-in .25s ease-out;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

@keyframes cb-in {
  from {
    transform: translateY(12px) scale(.95);
    opacity: 0
  }

  to {
    transform: none;
    opacity: 1
  }
}

.cb-duck {
  align-self: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.cb-user {
  align-self: center;
  background: rgba(67, 97, 238, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.cb-think {
  align-self: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.95);
  font-style: italic;
  border-radius: 24px;
  padding: 14px 24px;
  font-size: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cb-latency {
  align-self: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 22px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 10px;
  letter-spacing: 0.5px;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Voice waveform bar */
.voice-bar {
  display: none;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(255, 51, 102, .12);
  border-radius: 24px;
  border: 2.5px solid rgba(255, 51, 102, .35)
}

.voice-bar.on {
  display: flex
}

.vb-wave {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 44px
}

.vb-bar {
  width: 8px;
  min-height: 6px;
  background: rgba(255, 80, 120, .9);
  border-radius: 4px;
  animation: vb-anim .6s ease-in-out infinite alternate
}

.vb-bar:nth-child(odd) {
  animation-delay: .15s
}

.vb-bar:nth-child(3n) {
  animation-delay: .3s
}

@keyframes vb-anim {
  0% {
    height: 6px
  }

  100% {
    height: 38px
  }
}

.vb-label {
  color: rgba(255, 255, 255, .9);
  font-size: 26px;
  font-weight: 700
}

/* Input */
.input-row {
  display: flex;
  gap: 16px;
  align-items: center
}

.input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 54px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05), inset 0 2px 4px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.input-wrap:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08), 0 0 0 3px rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 1);
}

.chat-inp {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #333d47;
  font-family: 'Nunito', sans-serif;
  font-size: 30px;
  font-weight: 700;
  padding: 22px 32px;
}

.chat-inp::placeholder {
  color: rgba(0, 0, 0, 0.32)
}

.send-btn {
  background: linear-gradient(135deg, #FFB703 0%, #FB8500 100%);
  border: none;
  color: #fff;
  font-size: 34px;
  padding: 18px 26px;
  cursor: pointer;
  border-radius: 50%;
  margin-right: 10px;
  box-shadow: 0 4px 10px rgba(251, 133, 0, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}

.send-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 14px rgba(251, 133, 0, 0.4);
}

.mic-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #4CC9F0 0%, #4361EE 100%);
  color: #fff;
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(67, 97, 238, 0.3), 0 0 0 3px rgba(255, 255, 255, 0.85);
  transition: transform .2s, box-shadow 0.2s;
}

.mic-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 28px rgba(67, 97, 238, 0.45), 0 0 0 4px rgba(255, 255, 255, 0.95);
}

.mic-btn.on {
  animation: mic-pulse 1s ease-in-out infinite;
  background: linear-gradient(135deg, #FF006E 0%, #FF5A5F 100%);
  box-shadow: 0 8px 24px rgba(255, 0, 110, 0.35);
}

@keyframes mic-pulse {

  0%,
  100% {
    box-shadow: 0 6px 24px rgba(255, 34, 85, .5), 0 0 0 0 rgba(255, 34, 85, .3)
  }

  50% {
    box-shadow: 0 6px 28px rgba(255, 34, 85, .8), 0 0 0 22px rgba(255, 34, 85, 0)
  }
}

.mic-btn.wake-word-idle {
  background: linear-gradient(135deg, #00B4D8 0%, #0077B6 100%);
  animation: wake-pulse 2s ease-in-out infinite;
  box-shadow: 0 8px 24px rgba(0, 180, 216, 0.25), 0 0 0 3px rgba(255, 255, 255, 0.85);
}

@keyframes wake-pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 8px 24px rgba(0, 180, 216, 0.25), 0 0 0 3px rgba(255, 255, 255, 0.85);
  }

  50% {
    transform: scale(1.04);
    box-shadow: 0 8px 28px rgba(0, 180, 216, 0.4), 0 0 0 8px rgba(0, 180, 216, 0.15), 0 0 0 3px rgba(255, 255, 255, 0.85);
  }
}

/* ── API NOTICE ── */
.api-notice {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center
}

.api-notice-box {
  background: #0f1f35;
  border: 2px solid #2A4A7F;
  border-radius: 28px;
  padding: 60px;
  max-width: 780px;
  text-align: center;
  color: #fff;
}

.api-notice-box h3 {
  font-family: 'Bubblegum Sans', cursive;
  font-size: 44px;
  color: #FFD700;
  margin: 16px 0
}

.api-notice-box p {
  font-size: 26px;
  line-height: 1.6;
  color: #99B8D8;
  margin-bottom: 32px
}

.api-notice-box code {
  background: rgba(255, 255, 255, .1);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 24px
}

.api-notice-box button {
  background: linear-gradient(135deg, #FFD700, #FF8C00);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 28px;
  font-weight: 700;
  padding: 20px 60px;
  cursor: pointer;
}

/* ── VOICE SELECT FEEDBACK ── */
#voice-select-toast {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  font-family: 'Bubblegum Sans', cursive;
  font-size: 38px;
  padding: 20px 52px;
  border-radius: 52px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  z-index: 200;
  text-align: center;
  white-space: nowrap;
  animation: toast-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

@keyframes toast-pop {
  from {
    transform: translateX(-50%) scale(0.75);
    opacity: 0;
  }

  to {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}

/* Highlighted card when voice detects duck name */
.duck-card.voice-match {
  transform: scale(1.08);
  /* box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.9), 0 0 60px rgba(255, 215, 0, 0.6); */
  /* border-color: rgba(255, 215, 0, 0.85); */
  animation: card-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes card-pulse {
  from {
    transform: scale(1.08);
  }

  to {
    transform: scale(1.12);
  }
}

/* Summoning spinner overlay on selected card */
.duck-card.summoning::after {
  content: '✨';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  background: transparent;
  backdrop-filter: none;
  /* border-radius: inherit; */
  animation: summoning-spin 1s linear infinite;
  z-index: 10;
}

@keyframes summoning-spin {
  0% {
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }

  50% {
    transform: rotate(180deg) scale(1.2);
    opacity: 0.85;
  }

  100% {
    transform: rotate(360deg) scale(1);
    opacity: 1;
  }
}

/* ── PIPER AUDIO-PREPARING INDICATOR ── */
.cb-piper-wait {
  align-self: center;
  border-radius: 24px;
  padding: 14px 28px;
  font-size: 28px;
  font-weight: 700;
  border: 1.5px solid rgba(0, 210, 200, 0.45);
  box-shadow: 0 0 28px rgba(0, 210, 200, 0.22);
  background: rgba(0, 30, 50, 0.78);
  color: rgba(180, 255, 248, 0.95);
  font-style: normal;
  position: relative;
  overflow: hidden;
  z-index: 2;
}

/* Animated shimmer sweep across the bubble */
.cb-piper-wait::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(0, 210, 200, 0.12) 40%,
      rgba(0, 210, 200, 0.22) 50%,
      rgba(0, 210, 200, 0.12) 60%,
      transparent 100%);
  background-size: 200% 100%;
  animation: piper-shimmer 1.6s ease-in-out infinite;
}

@keyframes piper-shimmer {
  0% {
    background-position: 200% center;
  }

  100% {
    background-position: -200% center;
  }
}

/* Animated ellipsis on the preparing text */
.piper-wait-dots::after {
  content: '';
  display: inline-block;
  animation: piper-dots 1.4s steps(4, end) infinite;
  min-width: 1.5ch;
  text-align: left;
}

@keyframes piper-dots {
  0% {
    content: '';
  }

  25% {
    content: '.';
  }

  50% {
    content: '..';
  }

  75% {
    content: '...';
  }

  100% {
    content: '';
  }
}

/* ═══════════════════════════════════
   SVG CARTOON BACKGROUND ANIMATIONS
═══════════════════════════════════ */

/* Disable old pseudo-element effects — SVG now handles the full scene */
#bg::before,
#bg::after {
  display: none !important;
  content: none !important;
}

/* SVG fills the bg div */
.svg-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Clouds: drift left → right, staggered with negative delay ── */
/* Animation goes -1600px → +1600px (3200px travel).
   Negative delays put each cloud at its natural SVG position at t=0 */
.cloud-drift-1 {
  animation: svg-cloud-move 52s linear infinite;
  animation-delay: -26s;
  /* cloud at cx≈808 → mid-journey */
}

.cloud-drift-2 {
  animation: svg-cloud-move 68s linear infinite;
  animation-delay: -34s;
  /* cloud at cx≈215 → mid-journey */
}

.cloud-drift-3 {
  animation: svg-cloud-move 44s linear infinite;
  animation-delay: -22s;
  /* cloud at cx≈464 → mid-journey */
}

@keyframes svg-cloud-move {
  from {
    transform: translateX(-1600px);
  }

  to {
    transform: translateX(1600px);
  }
}

/* ── Windmill blades spin ── */
.windmill-spin {
  transform-box: fill-box;
  transform-origin: center;
  animation: svg-windmill 3.8s linear infinite;
}

@keyframes svg-windmill {
  to {
    transform: rotate(360deg);
  }
}

/* ── Water sparkle pulse ── */
.sparkle-anim {
  animation: svg-sparkle 2.6s ease-in-out infinite alternate;
}

@keyframes svg-sparkle {
  0% {
    opacity: 0.2;
  }

  100% {
    opacity: 1.0;
  }
}

/* ── Cartoon sun gentle float ── */
.sun-float {
  animation: svg-sun-float 4.8s ease-in-out infinite;
}

@keyframes svg-sun-float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-15px);
  }
}

@keyframes gem-pop {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ── Gemstone on Stage Styles ── */
#stage-gem-container {
  position: absolute;
  top: 280px;
  /* Positioned to sit on/above the duck's head */
  left: 360px;
  /* Centered horizontally over the duck (540px center minus 180px half-width) */
  width: 360px;
  /* Increased size significantly for better visibility */
  height: 360px;
  /* Increased height */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transform: scale(0) rotate(-20deg);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.35));
}

#stage-gem-container.active {
  opacity: 1;
  transform: scale(1) rotate(0deg);
  pointer-events: auto;
}

.stage-gem-glow {
  position: absolute;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  filter: blur(15px);
  animation: gem-glow-pulse 2s ease-in-out infinite alternate;
  z-index: 1;
}

.stage-gem-img-el {
  width: 290px;
  height: 290px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
  animation: gem-float 3s ease-in-out infinite alternate;
  z-index: 2;
}

@keyframes gem-glow-pulse {
  0% {
    transform: scale(0.9);
    opacity: 0.4;
  }

  100% {
    transform: scale(1.15);
    opacity: 0.8;
  }
}

@keyframes gem-float {
  0% {
    transform: translateY(0px) rotate(0deg);
  }

  100% {
    transform: translateY(-20px) rotate(5deg);
  }
}

/* Suggested Questions Section with Marquee */
.suggested-questions {
  width: 100%;
  overflow: visible;
  margin-top: 10px;
  pointer-events: auto;
  position: relative;
  z-index: 50;
}

.suggested-questions marquee {
  width: 100%;
  height: 80px;
  overflow: visible !important;
}

.suggested-marquee-inner {
  display: flex;
  gap: 24px;
  align-items: center;
  height: 100%;
  overflow: visible;
  pointer-events: auto;
}

.suggested-chip {
  position: relative;
  background: #ffffff;
  border: 2.5px solid rgb(252, 252, 252);
  border-radius: 35px;
  padding: 12px 28px;
  font-size: 30px;
  font-weight: 800;
  color: #000;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

.suggested-chip:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: #FFB703;
  color: #0f1f35;
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(255, 183, 3, 0.4);
}

@keyframes tooltip-bounce {
  0% {
    transform: translateX(-50%) translateY(-25px) scale(0.9);
    opacity: 0;
  }

  60% {
    transform: translateX(-50%) translateY(5px) scale(1.05);
    opacity: 1;
  }

  100% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes tooltip-float-loop {
  0% {
    transform: translateX(-50%) translateY(0px);
  }

  50% {
    transform: translateX(-50%) translateY(-8px);
  }

  100% {
    transform: translateX(-50%) translateY(0px);
  }
}

@keyframes magic-bg {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Tooltip Styling - Kids-friendly playful design */
.suggested-chip .tooltip-box {
  position: absolute;
  top: 140%;
  left: 50%;
  transform: translateX(-50%) translateY(-15px);
  background: linear-gradient(135deg, #FF9A9E, #FECFEF, #A1C4FD, #fbc2eb);
  background-size: 300% 300%;
  border: 5px solid #FFD166;
  color: #1D3557;
  font-family: 'Bubblegum Sans', cursive;
  font-size: 34px;
  font-weight: normal;
  padding: 20px 26px;
  border-radius: 40px 40px 40px 10px;
  /* Playful speech bubble shape */
  width: 440px;
  white-space: normal;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 6px rgba(255, 255, 255, 0.4);
  text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.7);
  pointer-events: none;
  opacity: 0;
  z-index: 1000;
}

.tooltip-cta {
  display: block;
  font-size: 26px;
  color: #FF1493;
  text-transform: uppercase;
  margin-bottom: 6px;
  animation: pulse-cta 1.5s infinite;
}

@keyframes pulse-cta {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
    color: #FF4500;
  }

  100% {
    transform: scale(1);
  }
}

/* Small arrow for tooltip */
.suggested-chip .tooltip-box::after {
  content: "";
  position: absolute;
  bottom: 100%;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  border-width: 12px;
  border-style: solid;
  border-color: transparent transparent #FFD166 transparent;
}

.suggested-chip:hover .tooltip-box {
  /* Combine entrance bounce with continuous floating and gradient animation */
  animation: tooltip-bounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, tooltip-float-loop 2.5s ease-in-out 0.45s infinite, magic-bg 3s ease infinite;
}

.chip-gem-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  margin-left: 10px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}