/* Shared Andělka / Hvězdulka dialogue + soft character motion */

.jv2-char-stage {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 4%;
  padding: 0 4% 2%;
  pointer-events: none;
  z-index: 2;
  height: 42%;
}
.jv2-char {
  position: relative;
  height: 100%;
  max-height: 160px;
  transition: filter 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
  transform-origin: 50% 100%;
}
.jv2-char img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}
.jv2-char--andelka { height: 100%; }
.jv2-char--hvezdulka { height: 42%; margin-bottom: 4%; }
.jv2-char.is-dimmed { opacity: 0.55; filter: saturate(0.85); }
.jv2-char.is-glow img {
  filter: drop-shadow(0 0 10px rgba(255, 220, 140, 0.55)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}
.jv2-char.is-active-static {
  opacity: 1;
  outline: 2px solid rgba(230, 195, 106, 0.55);
  outline-offset: 2px;
  border-radius: 8px;
}

.jv2-char.is-idle.jv2-char--andelka {
  animation: jv2-andelka-idle 5.5s ease-in-out infinite;
}
.jv2-char.is-speaking.jv2-char--andelka {
  animation: jv2-andelka-speak 2.8s ease-in-out infinite;
}
.jv2-char.is-idle.jv2-char--hvezdulka {
  animation: jv2-hvezd-float 3.6s ease-in-out infinite;
}
.jv2-char.is-speaking.jv2-char--hvezdulka {
  animation: jv2-hvezd-speak 1.8s ease-in-out infinite;
}
.jv2-char.is-celebrate {
  animation: jv2-char-celebrate 1.2s ease-in-out 2;
}

.jv2-char__sparkles {
  position: absolute;
  inset: -8% -12% auto -12%;
  height: 40%;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 20% 40%, rgba(255, 230, 150, 0.95) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 20%, rgba(255, 245, 200, 0.9) 0 1.5px, transparent 3px),
    radial-gradient(circle at 45% 70%, rgba(255, 210, 120, 0.85) 0 2px, transparent 3px);
}
.jv2-char.is-sparkle .jv2-char__sparkles {
  opacity: 1;
  animation: jv2-sparkle 1.4s ease-in-out infinite;
}

@keyframes jv2-andelka-idle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(-0.4deg); }
}
@keyframes jv2-andelka-speak {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  30% { transform: translateY(-3px) rotate(0.6deg) scale(1.015); }
  70% { transform: translateY(-1px) rotate(-0.5deg) scale(1.01); }
}
@keyframes jv2-hvezd-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes jv2-hvezd-speak {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-8px) scale(1.06); }
  70% { transform: translateY(-3px) scale(1.03); }
}
@keyframes jv2-char-celebrate {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.05); }
}
@keyframes jv2-sparkle {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

.jv2-dialogue { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.jv2-dialogue__toolbar { display: flex; justify-content: flex-end; }
.jv2-dialogue__list { display: flex; flex-direction: column; gap: 8px; }
.jv2-dialogue__line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(8, 20, 40, 0.45);
  border: 1px solid transparent;
  cursor: pointer;
}
.jv2-dialogue__line.is-active {
  border-color: rgba(230, 195, 106, 0.55);
  background: rgba(20, 36, 64, 0.72);
  box-shadow: 0 0 0 1px rgba(230, 195, 106, 0.15);
}
.jv2-dialogue__speaker {
  grid-column: 1;
  color: var(--jv2-gold, #e6c36a);
  font-size: 0.8rem;
}
.jv2-dialogue__line[data-speaker="hvezdulka"] .jv2-dialogue__speaker {
  color: #f0d78a;
}
.jv2-dialogue__text {
  grid-column: 1;
  margin: 0;
  font-size: 0.92rem;
}
.jv2-dialogue__play {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}
.jv2-dialogue__nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.jv2-dialogue__skip { font-size: 0.8rem; }

/* Keep game perf: no character stage during gameplay */
.jv2-day.is-playing .jv2-char-stage { display: none !important; }

@media (orientation: landscape) and (max-height: 430px) {
  .jv2-char-stage { height: 48%; }
  .jv2-char { max-height: 110px; }
  .jv2-dialogue__text { font-size: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .jv2-char,
  .jv2-char__sparkles {
    animation: none !important;
  }
}
