/* Freier Laufmodus im Basislager (assets/js/base-freemove.js) */
.base-free-btn {
  position: absolute; left: 8px; bottom: 8px; z-index: 40; padding: 4px 9px; font: 800 0.66rem/1.1 inherit; color: #fff3d0;
  background: #2f1d0e; border: 0; box-shadow: 0 0 0 2px #8a5a2b, 0 0 0 4px #160f1c; cursor: pointer; opacity: 0.85;
}
.base-free-btn.on { background: #1d4a2a; box-shadow: 0 0 0 2px #52b956, 0 0 0 4px #0a1c10; opacity: 1; }
.base-free-btn:hover { opacity: 1; }
/* Laufzyklus der Spielfigur (nur Hüpfen im Schritttakt; Blickrichtung/Spiegelung kommt aus --flip) */
@keyframes baseFreeStep {
  0%, 100% { transform: translateY(0) scaleX(var(--flip, 1)) scaleY(1); }
  50%      { transform: translateY(-3px) scaleX(var(--flip, 1)) scaleY(0.95); }
}
.base-player-cell.is-moving .dg-avatar-mini { animation: baseFreeStep 0.3s ease-in-out infinite !important; }
.base-slide.base-free { will-change: transform; }
.base-slide.base-free .base-cells { will-change: transform; }

/* Zoom only the scene; conversation text and controls keep their normal size. */
.base-grid, .hi-room {
  transform-origin: 50% 50%;
  transition: transform 520ms cubic-bezier(0.22, 0.68, 0.2, 1);
}
.base-dialog-camera {
  transform: translate(var(--dialog-x, 0%), var(--dialog-y, 0%)) scale(var(--dialog-zoom, 1.85));
  will-change: transform;
  pointer-events: none;
}
.base-dialog-open .quest-bar { visibility: hidden; pointer-events: none; }
.base-dialog-open .base-bubble-layer, .base-dialog-open .base-quest-mark { visibility: hidden; }
.base-dialog-card { height: min(340px, 55vh); overflow-y: auto; }
.base-conversation .base-build-btn, .base-conversation .base-cancelmove-btn,
.base-conversation .hi-editbtn { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .base-grid, .hi-room { transition-duration: 0ms; }
}

/* ── Laufanimation: Beine wechseln sich ab (Schichten .px-l-legL/.px-l-legR des Pixel-Avatars), Körper wippt im selben Takt ── */
@keyframes pxLegA { 0%, 49.9% { translate: 0 -1.2px; } 50%, 100% { translate: 0 0; } }
@keyframes pxLegB { 0%, 49.9% { translate: 0 0; } 50%, 100% { translate: 0 -1.2px; } }
@keyframes pxStrideBob { 0%, 100% { translate: 0 0; } 25%, 75% { translate: 0 -0.8px; } 50% { translate: 0 0; } }
.base-player-cell.is-moving .px-l-legL, .base-npc.is-walking .px-l-legL { animation: pxLegA var(--leg-t, 0.3s) linear infinite; }
.base-player-cell.is-moving .px-l-legR, .base-npc.is-walking .px-l-legR { animation: pxLegB var(--leg-t, 0.3s) linear infinite; }
.base-player-cell.is-moving .px-body, .base-npc.is-walking .px-body { animation: pxStrideBob var(--leg-t, 0.3s) linear infinite; }
@keyframes pxArmSwingA { 0%, 100% { rotate: 9deg; } 50% { rotate: -7deg; } }
@keyframes pxArmSwingB { 0%, 100% { rotate: -6deg; } 50% { rotate: 10deg; } }
.base-player-cell.is-moving .px-arm-left, .base-npc.is-walking .px-arm-left { animation: pxArmSwingA var(--leg-t, 0.3s) ease-in-out infinite; }
.base-player-cell.is-moving .px-arm-right, .base-npc.is-walking .px-arm-right { animation: pxArmSwingB var(--leg-t, 0.3s) ease-in-out infinite; }
/* Bewohner-Hüpfen im Schritttakt statt festem Takt */
.base-npc.is-walking .dg-decor-npc-wrap { animation-duration: var(--leg-t, 0.5s) !important; }
.base-slide.base-free .base-npc { transition: none !important; }

/* Virtueller Stick (Touch): Ring am Startpunkt, Nub folgt dem Finger; grün = Laufen, gelb = Gehen */
.base-stick-ring { position: fixed; z-index: 90; width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; pointer-events: none;
  background: rgba(255, 255, 255, 0.10); box-shadow: 0 0 0 3px rgba(255, 226, 120, 0.55) inset; }
.base-stick-ring i { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(255, 226, 120, 0.9); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }
.base-stick-ring.run { box-shadow: 0 0 0 3px rgba(120, 230, 130, 0.8) inset; }
.base-stick-ring.run i { background: rgba(120, 230, 130, 0.95); }

/* Figuren auf Kachelgröße skalieren (--avs kommt aus baseFitAvatars): Figur ≈ 1 Kachel hoch, Füße auf der Kachelunterkante */
.base-grid .base-player-cell .dg-player-wrap, .base-grid .base-npc .dg-decor-npc-wrap, .base-roof-ghost .dg-player-wrap { position: absolute; inset: 0; display: block; }
.base-grid .base-player-cell .dg-avatar-mini, .base-grid .base-npc .dg-decor-npc-avatar, .base-roof-ghost .dg-avatar-mini {
  position: absolute; left: 50%; bottom: 0; margin-left: -27px; max-width: none; max-height: none;
  scale: var(--avs, 1); transform-origin: 50% 100%;
}
.base-grid .base-player-cell .dg-player-wrap, .base-grid .base-npc .dg-decor-npc-wrap, .base-roof-ghost .dg-player-wrap { transform: none; }

/* Arme: weicher Gang — kleiner Ausschlag um die Schulter, die Arme leicht gegeneinander versetzt und etwas hinter den Beinen */
.base-player-cell.is-moving .px-arm-left, .base-npc.is-walking .px-arm-left, .dg-ent.mv .px-arm-left { animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1); animation-delay: calc(var(--leg-t, 0.3s) * -0.9); }
.base-player-cell.is-moving .px-arm-right, .base-npc.is-walking .px-arm-right, .dg-ent.mv .px-arm-right { animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1); animation-delay: calc(var(--leg-t, 0.3s) * -0.82); }

/* Kleidung beim Seitwärtslaufen nicht spiegeln: die Figur wird per scaleX(var(--flip)) gedreht (Kopf/Haare/Gesicht sollen mit),
   Rumpf, Kragen, Abzeichen und Kleidungs-Overlays (Brusttasche, Knöpfe …) bekommen dieselbe Spiegelung noch einmal → bleiben unverändert.
   --flip erbt in alle Teile (Spieler, Bewohner, Begleiter). */
.pixel-avatar .px-body, .pixel-avatar .px-collar, .pixel-avatar .px-badge,
.pixel-avatar .px-gear:not(.gv-slot-head):not(.gv-slot-shoes):not(.gv-slot-weapon) { transform: scaleX(var(--flip, 1)); transform-origin: 50% 50%; }
