/* extras.css – Aussehen der Spielereien aus extras.js (Quelle: werkstatt/extras/extras.css, site-Fassung mit site-bau.py).
   Alle Ebenen liegen absolut über dem Bild bzw. neben dem Zähler: kein Platzbedarf, kein Verschieben,
   keine abgefangenen Klicks (ausser Spielerei 1 auf der Esel-Silhouette und 4 auf dem Huhn). */

/* Ebenen über/unter dem Esel: gleiche Lage wie die Esel-Ebene aus esel.css */
.esel-buehne .extras-ebene {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  overflow: hidden; pointer-events: none;
  -webkit-clip-path: inset(0 round var(--radius, 10px)); clip-path: inset(0 round var(--radius, 10px));
}

/* 1  I-aah: nur die Formen des Esels nehmen Klicks an, daneben geht der Klick ans Bild */
.esel-buehne .esel-tier.extras-klickbar { pointer-events: visiblePainted; cursor: pointer; }
.esel-buehne .esel-tier.extras-klickbar .extras-zier { pointer-events: none; }
.extras-blase {
  position: absolute; z-index: 1; transform: translate(-50%, -100%);
  padding: 0.12em 0.55em 0.02em; white-space: nowrap; pointer-events: none;
  font: 400 1.35rem/1.15 var(--font-hand, cursive); color: var(--text, #2E2C1D);
  background: #fff; border: 2px solid var(--text, #2E2C1D); border-radius: 1em;
  opacity: 0; transition: opacity 0.18s ease;
}
.extras-blase::after {        /* Zipfel zum Kopf; --zipfel verschiebt ihn, wenn die Blase am Rand anstösst */
  content: ""; position: absolute; left: calc(50% + var(--zipfel, 0px) - 6px); bottom: -9px;
  width: 10px; height: 10px; background: #fff;
  border-right: 2px solid var(--text, #2E2C1D); border-bottom: 2px solid var(--text, #2E2C1D);
  transform: rotate(45deg) skew(8deg, 8deg); border-bottom-right-radius: 2px;
}
.extras-blase.zu-sehen { opacity: 1; }
@media (max-width: 780px) { .extras-blase { font-size: 1.05rem; border-width: 1.5px; } }

/* 3  Rauch aus dem Kamin: beim Hover / Tastaturfokus drei Wölkchen; beim angewählten Menüpunkt
      (aria-current) ruhig alle 2,6 s ein einzelnes Wölkchen. Im zugeklappten Handy-Menü (display: none)
      läuft nichts; bei unsichtbarem Tab hält extras.js die Animation an (Klasse extras-versteckt). */
.extras-rauch-an .menue .wagen { overflow: visible; }
.extras-rauch circle {
  fill: currentColor; fill-opacity: 0.18; stroke: currentColor; stroke-width: 1.1; opacity: 0;
  transform-box: fill-box; transform-origin: center;
}
.extras-rauch-an .menue a:hover .extras-rauch circle,
.extras-rauch-an .menue a:focus-visible .extras-rauch circle,
.extras-rauch-an .menue a.extras-hover .extras-rauch circle { animation: extras-rauch 1.5s ease-out infinite; }
.extras-rauch-an .menue a:hover .extras-rauch circle:nth-child(2),
.extras-rauch-an .menue a:focus-visible .extras-rauch circle:nth-child(2),
.extras-rauch-an .menue a.extras-hover .extras-rauch circle:nth-child(2) { animation-delay: 0.5s; }
.extras-rauch-an .menue a:hover .extras-rauch circle:nth-child(3),
.extras-rauch-an .menue a:focus-visible .extras-rauch circle:nth-child(3),
.extras-rauch-an .menue a.extras-hover .extras-rauch circle:nth-child(3) { animation-delay: 1s; }
/* angewählter Menüpunkt: ein Wölkchen, langsam (nicht beim Hover/Fokus, dort gilt das Obige) */
.extras-rauch-an .menue a[aria-current="page"]:not(:hover):not(:focus-visible):not(.extras-hover) .extras-rauch circle:nth-child(1) {
  animation: extras-rauch-ruhig 2.6s ease-out infinite;
}
@keyframes extras-rauch-ruhig {
  0%   { opacity: 0;    transform: translate(0, 0) scale(0.5); }
  12%  { opacity: 0.75; }
  62%  { opacity: 0;    transform: translate(2.5px, -9px) scale(1.8); }
  100% { opacity: 0;    transform: translate(2.5px, -9px) scale(1.8); }
}
.extras-versteckt .extras-rauch circle { animation-play-state: paused !important; }
@keyframes extras-rauch {
  0%   { opacity: 0;   transform: translate(0, 0) scale(0.5); }
  20%  { opacity: 0.9; }
  100% { opacity: 0;   transform: translate(3px, -10px) scale(1.9); }
}

/* 4  Huhn links neben dem Besucherzähler (absolut, verschiebt nichts) */
.extras-huhn-wirt { position: relative; }
.extras-huhn {
  position: absolute; right: calc(100% + 0.35rem); bottom: -2px;
  width: 26px; height: 22px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* Sprechblase des Huhns: über dem Huhn, Zipfel zum Kopf (rechts) */
.extras-huhn .extras-blase { left: 50%; top: -13px; font-size: 1.1rem; border-width: 1.5px; --zipfel: 5px; }
.extras-huhn svg { display: block; width: 100%; height: 100%; overflow: visible; fill: #000; }
.extras-huhn .huhn-rot { fill: var(--scheunenrot, #9A3F27); }
.extras-huhn .huhn-beine { fill: none; stroke: #000; stroke-width: 0.9; stroke-linecap: round; }
.extras-huhn .huhn-korn { fill: #8A6A2F; transition: opacity 0.3s ease; }


/* 6  Zitronenfalter */
.extras-falter path { fill: #F3DC5A; stroke: #5B5836; stroke-width: 0.6; stroke-linejoin: round; }
.extras-falter .falter-leib { fill: #2E2C1D; stroke: #2E2C1D; stroke-width: 0.5; stroke-linecap: round; }

/* Bewegung reduzieren (System oder Schalter): keine Bewegung, ruhige Verzierungen bleiben */
.extras-still .extras-rauch circle { animation: none !important; opacity: 0 !important; }
.extras-still .extras-blase { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .extras-rauch circle { animation: none !important; opacity: 0 !important; }
  .extras-blase { transition: none; }
}
@media print { .extras-ebene, .extras-blase, .extras-huhn { display: none !important; } }
