/* =========================================================================
   DIE GEFÄHRTEN: gemeinsamer Rahmen von Pets und Homunculi (05.10.2026)
   =========================================================================
   Werte aus dem Launcher übernommen, nicht angenähert: `anprobe.css`
   (Reiter `asg-ap-kats`, Bühne `asg-ap-buehne`, Zoom `asg-ap-zoom`),
   `homunculi.css` (Haltung und Steuer in der Bühne) und `konteneinstieg.css`
   (die Anleitung). Die Launcher-Farben heißen hier wie auf der ganzen Seite:
   `--gold` (= `--asg-gold`), `--gold-bright`, `--line` (= `--asg-rand`),
   `--ink`, `--ink-dim`, `--hairline`, `--font-display`.
   Code: assets/js/features/pets/companion-*.js
   ========================================================================= */

/*
  Der Bereich füllt den rollenden Teil des Kastens, gerollt wird INNEN in den
  Spalten (wie im Launcher und bei den Monstern, `.panel__scroll--monster`).
  Die Klasse setzt companion-views.js, solange Pets oder Homunculi stehen.
*/
.panel__scroll--gefaehrten {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel__scroll--gefaehrten > .view:not([hidden]) {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.gf {
  /* Die Kästen schweben über den Spalten; die Schrift darin braucht keinen Schatten. */
  text-shadow: none;
}

/*
  Solange der Block für Suchmaschinen steht (Liste aller Pets), rollt der
  Kasten wie jeder andere Bereich; erst die Anwendung rollt innen.
*/
.panel__scroll--gefaehrten:has(#seo-inhalt:not(.seo--geht)) {
  display: block;
  overflow-y: auto;
}

/* Die Reiter im Kopf sind hier Links; sie sehen aus wie die Knöpfe daneben. */
a.db__reiterBtn {
  display: inline-block;
  text-decoration: none;
}

/* --- Reiter (`.asg-ap-kats`, `.asg-ap-kat`) -------------------------------- */

.gf-kats {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-top: 8px;
}

.gf-kat {
  padding: 4px 10px;
  border: 1px solid rgb(232 195 122 / 28%);
  border-radius: 6px 6px 0 0;
  font-family: inherit;
  font-size: 0.65rem;
  color: #cfc2a4;
  background: rgb(12 10 8 / 75%);
  cursor: pointer;
}

.gf-kat:hover,
.gf-kat.is-active {
  color: var(--gold);
  border-color: rgb(232 195 122 / 60%);
}

.gf-kat.is-active {
  background: rgb(232 195 122 / 8%);
}

/*
  Die Fläche der Ansichten: alle in DERSELBEN Rasterzelle. So blenden alte und
  neue Ansicht wirklich gleichzeitig über, ohne dass der Kasten springt.
*/
.gf-flaeche {
  display: grid;
  flex: 1 1 auto;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  min-height: 0;
  margin-top: 8px;
}

.gf-ansicht {
  display: flex;
  grid-area: 1 / 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.gf-zustand {
  margin: 0.75rem 0 0;
  color: rgb(210 190 150 / 62%);
  font-size: 0.75rem;
}

.gf-ansicht[hidden],
.gf-zustand[hidden],
.gf-stage__ohnebild[hidden] {
  display: none;
}

/* --- Dunkle, schmale Rollbalken in allen rollenden Teilen ---------------- */

.gf
  :is(
    .pt__liste,
    .pt__unten,
    .pt__wege,
    .pt__tipp,
    .hm__liste,
    .hm__wege,
    .hm__tafel,
    .gf-guide__links,
    .gf-guide__lauftext
  ) {
  scrollbar-width: thin;
  scrollbar-color: rgb(232 195 122 / 45%) transparent;
}

.gf ::-webkit-scrollbar {
  width: 6px;
}

.gf ::-webkit-scrollbar-thumb {
  background: rgb(232 195 122 / 45%);
  border-radius: 3px;
}

/* --- Die Bühne ----------------------------------------------------------- */

.gf-stage {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 8px;
}

.gf-stage__box {
  position: relative;
  height: 220px;
}

.gf-stage__canvas {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  cursor: grab;
  background: rgb(0 0 0 / 30%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 9px;
  user-select: none;
  touch-action: none;
}

.gf-stage__canvas:active {
  cursor: grabbing;
}

/* Pets: Still, Laufen, Angriff als Reihe über der Bühne (`.asg-ap-wahl`). */
.gf-stage__posen {
  display: flex;
  gap: 6px;
}

.gf-stage__posen button {
  flex: 1;
  padding: 4px 0;
  cursor: pointer;
  background: rgb(255 255 255 / 3%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 6px;
  color: rgb(238 228 208 / 82%);
  font: inherit;
  font-size: 0.6875rem;
}

.gf-stage__posen button.is-active {
  background: rgb(214 176 106 / 16%);
  border-color: rgb(214 176 106 / 45%);
  color: rgb(238 228 208 / 95%);
}

/* Pets: die Drehreihe unter der Bühne (`.asg-ap-drehreihe`, `.asg-ap-pfeil`). */
.gf-stage__drehreihe {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.gf-stage__drehreihe .gf-stage__pfeil {
  flex: 0 0 auto;
  width: 30px;
  padding: 2px 0 4px;
  cursor: pointer;
  background: rgb(255 255 255 / 4%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 7px;
  color: rgb(238 228 208 / 88%);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
}

.gf-stage__drehreihe .gf-stage__pfeil:hover {
  background: rgb(214 176 106 / 16%);
  border-color: rgb(214 176 106 / 45%);
}

.gf-stage__hinweis {
  min-width: 0;
  overflow: hidden;
  color: rgb(210 190 150 / 55%);
  font-size: 0.625rem;
  line-height: 1.4;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Homunculi: Haltung oben mittig, Drehpfeile unten links, IN der Bühne. */
.gf-stage__haltung,
.gf-stage__steuer,
.gf-stage__zoom {
  position: absolute;
  display: flex;
  gap: 4px;
  align-items: center;
}

.gf-stage__haltung {
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
}

.gf-stage__steuer {
  bottom: 8px;
  left: 8px;
}

.gf-stage__zoom {
  right: 8px;
  bottom: 8px;
}

.gf-stage__haltung button,
.gf-stage__steuer button,
.gf-stage__zoom button {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  cursor: pointer;
  background: rgb(11 20 32 / 75%);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-dim);
  font: inherit;
  font-size: 0.625rem;
  line-height: 1;
}

.gf-stage__zoom button {
  width: 24px;
  padding: 0;
  font-size: 0.8rem;
}

.gf-stage__haltung button:hover,
.gf-stage__steuer button:hover {
  background: rgb(232 195 122 / 18%);
  color: var(--ink);
}

.gf-stage__zoom button:hover {
  background: rgb(94 140 210 / 25%);
  color: var(--ink);
}

.gf-stage__haltung button.is-active {
  border-color: rgb(232 195 122 / 45%);
  color: var(--gold);
}

.gf-stage__ohnebild {
  position: absolute;
  top: 50%;
  right: 14px;
  left: 14px;
  margin: 0;
  transform: translateY(-50%);
  color: rgb(210 190 150 / 62%);
  font-size: 0.6875rem;
  text-align: center;
  pointer-events: none;
}

/* --- Das kleine Gegenstandsbild, 24 Punkte, hart gerastert wie im Spiel --- */

.pt__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.pt__icon img {
  display: block;
  max-width: 24px;
  max-height: 24px;
  image-rendering: pixelated;
}
