/* Graskind-Welt – Kapitel quartett: Regeln für den Welt-Modus (.has-world [data-world="ready"] …) und Szenen-Ergänzungen. */

/* ---------- DOM-Fassung: Fächer mittig und so groß, dass nichts abgeschnitten wird ---------- */
.chapter--quartett .qcard {
  --ch: min(44cqh, 41cqw);
  --a: calc((var(--s) - 3) * 8deg);
  left: 50%;
}
.chapter--quartett .qt__fan { transform: rotateX(calc(var(--tilt) * 7deg)) rotateY(calc(var(--tilt) * -6deg)); }
/* Schachtel mit Abstand zur Bühnenkante – ihre Schräglage darf links nichts abschneiden */
.chapter--quartett .qt__box { left: 5cqw; }
@media (max-width: 900px) { .chapter--quartett .qt__box { left: 6cqw; } }
/* Große „32“ vollständig innerhalb der Bühne (keine harte Schnittkante mitten im Bild) */
@media (min-width: 901px) {
  .chapter--quartett .qt__num { right: 6cqw; bottom: 4cqh; font-size: min(46cqh, 40cqw); }
}
@media (max-width: 900px) {
  .chapter--quartett .qcard { --ch: min(33cqh, 40cqw); --a: calc((var(--s) - 3) * 7.5deg); }
  .chapter--quartett .qt__scene { inset: 19cqh 0 38cqh; }
}

/* ---------- Welt-Modus: Bühnenbilder ausblenden, Bedienelemente bleiben ---------- */
.has-world #quartett[data-world="ready"] .qt__num,
.has-world #quartett[data-world="ready"] .qt__box { opacity: 0; visibility: hidden; }
.has-world #quartett[data-world="ready"] .qt { overflow: visible; }

/* Kartenlinks: unsichtbar, bei Tastaturfokus als Papier-Schild über den Deck-Chips (3D-Karte wird hervorgehoben) */
.has-world #quartett[data-world="ready"] .qt__scene {
  inset: auto 0 calc(3.5cqh + 7.2rem); perspective: none; pointer-events: none; z-index: 4;
}
.has-world #quartett[data-world="ready"] .qt__fan {
  position: static; transform: none; display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem;
}
.has-world #quartett[data-world="ready"] .qcard {
  position: relative; left: auto; top: auto; width: auto; height: auto; margin: 0; transform: none;
  opacity: 0; transition: opacity .2s linear;
}
.has-world #quartett[data-world="ready"] .qcard:not(.is-open) { display: none; }
.has-world #quartett[data-world="ready"] .qcard__body { display: none; }
.has-world #quartett[data-world="ready"] .qcard::after {
  content: attr(aria-label); display: block; padding: .45rem .9rem; border-radius: 999px;
  font-weight: 700; font-size: .9rem; white-space: nowrap; color: var(--ink);
  background: rgba(251, 247, 238, .96); box-shadow: 0 0 0 3px var(--paper-white, #fff), 0 0 0 6px var(--gk-green-deep, #04785C), 0 10px 24px rgba(20, 30, 20, .2);
}
.has-world #quartett[data-world="ready"] .qcard:focus-visible { opacity: 1; outline: none; }

/* Beschriftungen im Raum */
.world-label.qt-wlabel {
  font-size: .95rem; padding: .36rem .85rem; letter-spacing: .005em;
  background: rgba(251, 247, 238, .94); box-shadow: 0 6px 18px rgba(40, 26, 6, .18), inset 0 0 0 1px rgba(80, 60, 20, .08);
}
.world-label.qt-wlabel--hint {
  font-size: .8rem; font-weight: 600; padding: .3rem .75rem; color: var(--ink-soft, #3b3a30);
  background: rgba(251, 247, 238, .82);
}

@media (max-width: 900px) {
  .has-world #quartett[data-world="ready"] .qt__scene { inset: calc(var(--header-h, 64px) + 3.6rem) 0 auto; }
  .world-label.qt-wlabel { font-size: .85rem; }
}

/* Mittlere Breiten (Tablet quer, kleine Laptops): Deck-Chips als waagerecht wischbare Leiste,
   damit sie Schachtel und Fächer nicht überdecken */
@media (min-width: 901px) and (max-width: 1279px) {
  .qt__decks {
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; padding: 4px 1rem 8px;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .qt__decks::-webkit-scrollbar { display: none; }
  .qt__chip { flex: none; }
  .chapter--quartett .qt__box { bottom: calc(3.5cqh + 3.4rem); }
  .chapter--quartett .qt__scene { inset: 12cqh 0 calc(19cqh + 2.2rem); }
}
