/* Kids Village — feed-the-lion play area (no voting). */

/* Soften iOS Safari / mobile browser chrome fighting a toddler on this page. */
html {
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overscroll-behavior: none;
  /* Kills double-tap zoom; pinch still blocked in the play card via touch-action + JS. */
  touch-action: manipulation;
}

body.kv-scroll-lock {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.page-wrap--kids-village {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.page-wrap--kids-village > .hero {
  margin-bottom: 0;
  padding-bottom: 0.15rem;
}

.page-wrap--kids-village > .hero h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.45em;
  row-gap: 0.15em;
}

.kv-soon {
  margin: 0;
  font-family: inherit;
  font-size: calc(1.15rem * var(--font-display-scale));
  font-weight: 700;
  line-height: 1.3;
  color: var(--gold, #ffd100);
}

.kv-feed {
  --kv-ink: #fff8f0;
  --kv-ink-muted: #e8c9b0;
  --kv-gold: #ffd100;
  --kv-red-deep: #8b0a1e;
  --kv-panel: rgba(255, 248, 240, 0.08);

  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  min-height: min(62vh, 560px);
  padding: 1.35rem 0.75rem 2.25rem;
  border-radius: 22px;
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, #6b1c28, transparent 55%),
    radial-gradient(ellipse 80% 50% at 80% 100%, rgba(61, 139, 79, 0.18), transparent 50%),
    linear-gradient(180deg, #3b1018 0%, #1a0a0c 55%, #0d0506 100%);
  color: var(--kv-ink);
  /* Visible so the hungry/chomp scale isn’t clipped; radius still rounds the fill. */
  overflow: visible;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.kv-feed *,
.kv-fly-layer,
.kv-flyer,
.kv-pop {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  touch-action: none;
}

html[data-theme="light"] .kv-feed,
html[data-theme="auto"] .kv-feed {
  /* Keep the play stage warm and dark so the lion art reads on either site theme. */
  color-scheme: dark;
}

.kv-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0;
  min-width: 0;
}

.kv-viewport {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 260px;
  /* Needed for the carousel; vertical room for hungry scale lives on .kv-slide. */
  overflow: hidden;
  cursor: grab;
  /* JS owns swipe; pan-y let pinch/spread fight the track and flicker lions. */
  touch-action: none;
}

.kv-viewport.is-dragging {
  cursor: grabbing;
}

.kv-track {
  display: flex;
  width: 100%;
  height: 100%;
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.kv-track.is-instant {
  transition: none;
}

.kv-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Top/bottom padding keeps hungry scale + bob inside overflow:hidden. */
  padding: 2rem 2.4rem 1.15rem;
  box-sizing: border-box;
}

.kv-lion-wrap {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 1;
  overflow: visible;
}

.kv-chevron {
  position: absolute;
  top: calc(50% - 0.4rem);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: var(--kv-ink);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
  /* Glyph baseline sits low in the em box — lift for optical center. */
  padding-bottom: 0.18em;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.kv-prev {
  left: 0.15rem;
}

.kv-next {
  right: 0.15rem;
}

.kv-chevron:active {
  transform: translateY(-50%) scale(0.92);
}

.kv-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.15rem 0 0.1rem;
}

.kv-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 248, 240, 0.28);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.kv-dot.is-active {
  background: var(--kv-gold);
  transform: scale(1.25);
}

.kv-lion-wrap::before {
  content: "";
  position: absolute;
  inset: 4% 2% 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, rgba(255, 200, 90, 0.42), rgba(255, 140, 60, 0.12) 50%, transparent 70%);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.kv-lion-wrap img {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.45));
  transform-origin: 50% 90%;
  transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.kv-lion-wrap.is-hungry img {
  transform: scale(1.08) translateY(-6px);
}

.kv-lion-wrap.is-hungry::before {
  transform: scale(1.12);
}

.kv-lion-wrap.is-chomp {
  animation: kv-chomp 0.5s ease;
}

.kv-lion-wrap.is-idle {
  animation: kv-idle-bob 2.4s ease-in-out infinite;
}

@keyframes kv-idle-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-6px) rotate(1deg);
  }
}

@keyframes kv-chomp {
  0% {
    transform: scale(1) rotate(0);
  }
  30% {
    transform: scale(1.08) rotate(-4deg);
  }
  55% {
    transform: scale(0.94) rotate(3deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

.kv-treats {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.kv-treats-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(1.25rem, 6vw, 3rem);
}

.kv-treat {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  color: var(--kv-ink);
  font-family: var(--font);
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.kv-treat-art {
  display: block;
  width: min(28vw, 124px);
  height: min(28vw, 124px);
  animation: kv-treat-float 2.6s ease-in-out infinite;
}

.kv-treat[data-treat="cabbage"] .kv-treat-art {
  animation-delay: -1.3s;
}

.kv-treat-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.45));
}

.kv-treat-label {
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--kv-gold);
}

.kv-treat.is-lifted .kv-treat-art {
  opacity: 0.25;
  animation-play-state: paused;
}

.kv-hint {
  margin: 0;
  min-height: 1.1rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--kv-ink-muted);
}

@keyframes kv-treat-float {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateY(-10px) rotate(4deg);
  }
}

.kv-fly-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: visible;
}

.kv-flyer {
  position: fixed;
  left: 0;
  top: 0;
  width: min(28vw, 124px);
  height: min(28vw, 124px);
  pointer-events: none;
  will-change: translate, scale, opacity;
}

.kv-flyer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.kv-pop {
  position: fixed;
  z-index: 41;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 10vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffd100;
  -webkit-text-fill-color: #ffd100;
  /* Comic Bam!/Zap! outline: opaque ink ring under the gold fill. */
  -webkit-text-stroke: 6px #140308;
  paint-order: stroke fill;
  text-shadow:
    4px 0 0 #140308,
    -4px 0 0 #140308,
    0 4px 0 #140308,
    0 -4px 0 #140308,
    3px 3px 0 #140308,
    -3px 3px 0 #140308,
    3px -3px 0 #140308,
    -3px -3px 0 #140308,
    0 6px 0 #8b0a1e;
  pointer-events: none;
  opacity: 0;
}

.kv-pop.is-pop {
  animation: kv-score-fly 0.75s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}

@keyframes kv-score-fly {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) rotate(-12deg) scale(0.4);
  }
  22% {
    opacity: 1;
    transform: translate(-50%, -18px) rotate(-8deg) scale(1.28);
  }
  55% {
    opacity: 1;
    transform: translate(-50%, -36px) rotate(-4deg) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -64px) rotate(2deg) scale(0.95);
  }
}
