/* Größer, kleiner (Claude, 30.09.2026): Keksmonster Mampf, Huhn Henni, Zeichen setzen.
   Gemeinsame Grundlage: assets/basis.css (nicht hier ändern). */

:root {
  --tone: #d97706;
  --tone-deep: #b45309;
  --tone-tint: #fff7e0;
  --leer: #c3c8d4;
}

/* Eine große Karte statt Karte + Seitenkarte */
.sheet,
.sheet:only-child { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
@media (max-aspect-ratio: 1/1) {
  .sheet { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
}

.card-game { --c: var(--tone-deep); --tint: var(--tone-tint); }
.card-game .card-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- Fortschritt (zehn Punkte) ---------- */

.progress { display: flex; flex: none; align-items: center; gap: 5px; margin-right: 6px; }
.progress .dot { width: 15px; height: 15px; border: 2.5px solid var(--leer); border-radius: 50%; background: #fff; }
.progress .dot.is-done { border-color: var(--ink); background: var(--tone); }
.progress .dot.is-top { border-color: var(--ink); background: #fbbf24; box-shadow: inset -2px -2px 0 rgba(28, 34, 48, .18); animation: pop .3s ease-out; }

/* ---------- Bühne ---------- */

.stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  grid-auto-rows: auto;
  gap: clamp(4px, 1.1vh, 12px);
  min-width: 0;
  min-height: 0;
}

.arena {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  min-width: 0;
  min-height: 0;
  container-type: size;
}

.item {
  display: grid;
  place-items: center;
  width: min(29cqw, 86cqh);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  touch-action: manipulation;
  transition: transform .15s;
}
.item:disabled { cursor: default; }
.item:focus-visible { outline: 4px solid #2563eb; outline-offset: 4px; }
@media (hover: hover) {
  .item:not(:disabled):hover { transform: translateY(-5px) rotate(-2deg); }
}
.item:not(:disabled):active { transform: scale(.96); }
.item.is-no { animation: gk-wackeln .55s; }

.item-art {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  container-type: inline-size;
  transform: scale(var(--s, 1));
  transform-origin: 50% 50%;
}
.item-art svg { width: 100%; height: 100%; overflow: visible; }

.lab {
  position: absolute;
  left: 50%;
  top: calc(var(--y, 50) * 1%);
  padding-top: .16em;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: calc(var(--fs, 40) * 1cqi);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.01em;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.lab-term { letter-spacing: 0; }
.lab-badge { left: 80%; top: 20%; }

/* ---------- Tier in der Mitte ---------- */

.animal { position: relative; width: min(33cqw, 100cqh); aspect-ratio: 1; }
.animal svg { width: 100%; height: 100%; overflow: visible; }
.animal.is-wartet .wippen { animation: gk-wippen 2.4s ease-in-out infinite; }
.animal.is-schuettel { animation: gk-schuettel .55s; }
.animal.is-zeichen [data-m-lippe="rosa"] { animation: gk-lippe .3s ease-in-out 4 alternate; }
.animal.is-zeichen [data-m-lippe="tinte"] { animation: gk-lippe-rand .3s ease-in-out 4 alternate; }
.mampf [data-m-blick] { transition: transform .38s cubic-bezier(.3, .7, .3, 1); }
.animal.is-wartet [data-m-zunge] { animation: gk-zunge 2.2s ease-in-out infinite; }
/* Mampf in 3D (mampf3d.js): Canvas im Fluss wie das SVG, wippt beim Warten genauso (5 von 240 Einheiten) */
.animal canvas.mampf3d { width: 100%; height: 100%; }
.animal.is-wartet canvas.mampf3d { animation: gk-wippen-3d 2.4s ease-in-out infinite; }

.bubble {
  position: absolute;
  z-index: 4;
  left: 70%;
  top: 2%;
  padding: .28em .7em .12em;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 9cqh, 2.3rem);
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 4px 5px 0 rgba(28, 34, 48, .13);
  transform: translate(-30%, -60%);
  pointer-events: none;
}
.bubble::after {
  content: "";
  position: absolute;
  left: 22%;
  bottom: -11px;
  width: 16px;
  height: 16px;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  background: inherit;
  transform: rotate(45deg);
}
.bubble.is-nein { background: var(--warn-soft); }
.bubble.is-ja { background: var(--tone-tint); }
.bubble.is-pop { animation: gk-blase .38s cubic-bezier(.3, 1.6, .5, 1); }

/* ---------- Schreibzeile: 8 > 3 ---------- */

.note {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  min-width: 0;
}

.num {
  display: block;
  padding-top: .14em;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, min(9.5vh, 10.5vw), 5.4rem);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.num.is-term { font-size: clamp(1.1rem, min(6vh, 6vw), 3.4rem); }

.num-leer,
.sign-leer {
  display: inline-grid;
  place-items: center;
  padding-top: .12em;
  color: #b3b9c7;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
}
.num-leer {
  min-width: 1.4em;
  height: 1.2em;
  border: 3px dashed var(--leer);
  border-radius: 16px;
  font-size: clamp(1.8rem, 7vh, 4rem);
}

.note-sign { display: grid; justify-items: center; gap: 2px; }

.sign-box {
  display: grid;
  place-items: center;
  width: clamp(70px, 15vh, 136px);
  aspect-ratio: 1;
  border: 3px dashed var(--leer);
  border-radius: 24px;
  background: rgba(255, 255, 255, .7);
}
.sign-box svg { width: 88%; height: 88%; overflow: visible; filter: drop-shadow(3px 4px 0 rgba(28, 34, 48, .13)); }
.sign-leer { font-size: clamp(2rem, 8vh, 4.4rem); }
.sign-box.is-set { border: 3px solid var(--tone); background: var(--tone-tint); animation: gk-zeichen .5s cubic-bezier(.3, 1.5, .5, 1); }
.sign-box.is-wrong { border: 3px solid var(--warn); background: var(--warn-soft); animation: shake .42s; }

.sign-words {
  min-height: 1.3em;
  color: var(--tone-deep);
  font-size: clamp(.9rem, 2.4vh, 1.3rem);
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- Zeichen-Knöpfe ---------- */

.signs { display: flex; justify-content: center; gap: clamp(10px, 2.2vw, 26px); }
.signs[hidden] { display: none; }

.sign-btn {
  display: grid;
  place-items: center;
  width: clamp(76px, 13vh, 118px);
  height: clamp(62px, 10.5vh, 94px);
  padding: 8px;
  border: 2px solid transparent;
  border-image: var(--frame) 34 fill / 22px / 0 stretch;
  border-radius: 22px;
  background: none;
  box-shadow: var(--shadow);
  touch-action: manipulation;
  transition: transform .12s;
}
.sign-btn svg { width: auto; height: 100%; overflow: visible; }
.sign-btn[hidden] { display: none; }
.sign-btn:disabled { opacity: .45; }
@media (hover: hover) {
  .sign-btn:not(:disabled):hover { transform: translateY(-3px); }
}
.sign-btn:not(:disabled):active { transform: scale(.95); }
.sign-btn.is-no { animation: shake .42s; }

/* ---------- Zahlenstrahl-Hilfe ---------- */

.strahl {
  padding: 4px 16px 6px;
  border: 2px solid transparent;
  border-image: var(--frame-soft) 34 fill / 20px / 0 stretch;
  border-radius: 20px;
  animation: slide .3s ease-out;
}
.strahl[hidden] { display: none; }
.strahl svg { display: block; width: 100%; height: auto; max-height: 19vh; }
.st-zahl { fill: var(--ink); font-family: var(--font-display); font-size: 34px; font-weight: 800; }
.st-marke { font-family: var(--font-display); font-size: 40px; font-weight: 800; paint-order: stroke fill; stroke: var(--ink); stroke-width: 5px; stroke-linejoin: round; }
.st-wort { fill: var(--muted); font-family: var(--font); font-size: 26px; font-weight: 600; }
.st-legende { display: flex; justify-content: space-between; align-items: center; gap: .3em 1em; margin: 0; font-size: clamp(.85rem, 2vh, 1.1rem); font-weight: 600; }
.st-mitte { display: flex; flex-wrap: wrap; justify-content: center; gap: .2em 1.2em; }
.st-mitte b { font-weight: 600; }
.st-mitte span::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .35em; border: 2px solid var(--ink); border-radius: 50%; background: var(--f); vertical-align: -.08em; }
.st-legende em { flex: none; color: var(--tone-deep); font-style: normal; font-weight: 700; }

/* ---------- Merkhilfe ---------- */

.merk {
  position: absolute;
  z-index: 6;
  inset: 1% 2%;
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 2%;
  padding: 2% 3%;
  border: 2px solid transparent;
  border-image: var(--frame) 34 fill / 22px / 0 stretch;
  border-radius: 22px;
  cursor: pointer;
  animation: slide .3s ease-out;
}
.merk[hidden] { display: none; }
.merk-reihe { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 3%; min-height: 0; }
.merk-tier { height: 100%; max-height: 44cqh; aspect-ratio: 1; min-height: 0; }
.merk-tier svg { width: 100%; height: 100%; overflow: visible; }
.merk-text { min-width: 0; }
.merk-text p { margin: 0; font-size: clamp(.95rem, 5.4cqh, 1.6rem); font-weight: 600; line-height: 1.25; }
.merk-bsp { display: flex; align-items: center; gap: .25em; font-family: var(--font-display); font-weight: 800; line-height: 1; }
.merk-text .merk-bsp { font-size: clamp(2rem, 14cqh, 4.6rem); }
.merk-bsp b { padding-top: .14em; }
.merk-z { display: inline-block; width: .95em; height: .95em; }
.merk-z svg { width: 100%; height: 100%; overflow: visible; }
.merk-text .merk-lies { color: var(--tone-deep); }

/* ---------- Fliegendes Zeichen und Krümel ---------- */

.sign-flieger { position: fixed; z-index: 55; top: 0; left: 0; pointer-events: none; }
.sign-flieger svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(4px 5px 0 rgba(28, 34, 48, .15)); }
.kruemel { position: fixed; z-index: 50; width: 10px; height: 10px; border: 2px solid var(--ink); border-radius: 45%; pointer-events: none; }

.feedback .fb-satz { display: inline-block; margin: 0 .2em; padding: 0 .35em; border-radius: 10px; background: var(--tone-tint); color: var(--ink); font-family: var(--font-display); font-size: 1.25em; font-weight: 800; line-height: 1.2; }

/* ---------- Bewegungen ---------- */

@keyframes gk-lippe { to { stroke: #ff3d6e; stroke-width: 18px; } }
@keyframes gk-lippe-rand { to { stroke-width: 30px; } }
@keyframes gk-zunge { 0%, 100% { transform: none; } 50% { transform: translateY(-4px); } }
@keyframes gk-wippen { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes gk-wippen-3d { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.1%); } }
@keyframes gk-schuettel { 0%, 100% { transform: none; } 20% { transform: rotate(-5deg); } 40% { transform: rotate(5deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(3deg); } }
@keyframes gk-wackeln { 0%, 100% { transform: none; } 25% { transform: rotate(-7deg); } 50% { transform: rotate(6deg); } 75% { transform: rotate(-3deg); } }
@keyframes gk-blase { from { opacity: 0; transform: translate(-30%, -60%) scale(.4); } to { opacity: 1; transform: translate(-30%, -60%) scale(1); } }
@keyframes gk-zeichen { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ---------- Hochformat: Kekse und Tier etwas größer ---------- */

@media (max-aspect-ratio: 1/1) {
  .arena, .note { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); }
  .item { width: min(30.5cqw, 86cqh); }
  .animal { width: min(37cqw, 100cqh); }
}

/* ---------- Kleine Bildschirme ---------- */

@media (max-width: 760px) {
  .progress { gap: 3px; }
  .progress .dot { width: 11px; height: 11px; border-width: 2px; }
}
@media (max-width: 520px) {
  .progress { display: none; }
  .card-game .card-title { font-size: 1rem; }
  .actions .btn-ghost .label { display: none; }
  .actions .btn-primary { padding: 0 18px; }
  .feedback { font-size: .9rem; }
  .bubble { font-size: .95rem; }
}

/* ---------- Vorlesen (30.09.2026): Lautsprecher am Auftrag, nur bei „Auf Knopfdruck“ ---------- */

.card-head .sprech-btn { margin-left: 0; }
.card-head .sprech-btn svg { width: 25px; height: 25px; }

/* Kopfleiste mit Vorlesen-Knopf (fünf Knöpfe): „Vorlesen“ behält seine Beschriftung am längsten,
   „Übersicht“ (macht dasselbe wie das Logo) und „Einstellungen“ werden vorher zu runden Knöpfen. */
@media (max-width: 1460px) {
  .tools .back-btn, .tools [data-menu-toggle] { width: 46px; padding: 0; }
  .tools .back-btn .chip-label, .tools [data-menu-toggle] .chip-label { display: none; }
}
/* Bis 1260 px: Titel „Größer, kleiner“ in die zweite Reihe (wie basis.css ab 900 px) */
@media (max-width: 1260px) {
  .topbar { grid-template-rows: auto auto; row-gap: 4px; }
  .left { grid-column: 1 / 3; grid-row: 1; }
  .tools { grid-column: 3; grid-row: 1; }
  .task { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 760px) {
  .tools [data-ton] { width: 46px; padding: 0; }
  .tools [data-ton] .chip-label { display: none; }
}
/* Handy: Logo und Knöpfe oben, darunter die Moduswahl, dann der Titel */
@media (max-width: 605px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto; }
  .left { display: contents; }
  .brand { grid-column: 1; grid-row: 1; }
  .tools { grid-column: 2; grid-row: 1; gap: 6px; }
  .segmented { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .task { grid-column: 1 / -1; grid-row: 3; }
}
