/* Mathe-Aquarium: Kopf im Becken (Alex, 21.10.2026, vierte Runde). Logik in kopf-eine-zeile.js.
   Oben mittig ein Schild nur mit Aufgabe bzw. Zahl, mit Ablagerungen; rechts oben die Spielsachen; Vorlesen im
   Einstellungsfenster; Taucher, Taucherin oder Kind wechseln das Schild. */

/* ---------- Keine Zeile oben, kein Spielart-Schalter, keine Sprechblase in der Leiste ---------- */
.aq-eine-zeile .gsr-auftrag-kopfbereich { display: none !important; }
.aq-eine-zeile .modus-schalter { display: none !important; }
.aq-eine-zeile .tk-leiste .vorlesen-btn { display: none !important; }
.aq-eine-zeile .tk-eingabe { display: none; }
.aq-eine-zeile .kopfband .anzeige-fang { display: none !important; }

/* ---------- Kopfband: links frei, Mitte Schild, rechts Spielsachen ---------- */
html.aq-eine-zeile .kopfband { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 10px; }
html.aq-eine-zeile .kopfband .kopf-links { grid-row: 1; grid-column: 1; display: block; visibility: hidden; pointer-events: none; min-width: 0; }
html.aq-eine-zeile .kopfband .aq-schild-halter { grid-row: 1; grid-column: 2; }
html.aq-eine-zeile .kopfband .kopf-rechts {
  grid-row: 1; grid-column: 3; position: relative; z-index: 1;
  display: flex; flex-direction: row; justify-content: flex-end; align-items: flex-start; min-width: 0; justify-self: stretch;
}
/* Rückt das Schild nach links: mittig im freien Platz links der Gruppe */
html.aq-versetzt .kopfband { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; }
html.aq-versetzt .kopfband .kopf-rechts { grid-column: 4; }
/* Gruppe unter dem Schild (schmale Fenster) */
html.aq-stapel .kopfband { grid-template-columns: minmax(0, 1fr); gap: 20px; }
html.aq-stapel .kopfband .kopf-links { display: none; }
html.aq-stapel .kopfband .aq-schild-halter { grid-column: 1; }
html.aq-stapel .kopfband .kopf-rechts { grid-row: 2; grid-column: 1; justify-content: center; }

.aq-schild-halter { position: relative; z-index: 2; display: flex; justify-content: center; min-width: 0; transform-origin: 50% 30%; }

/* ---------- Schild: nur Aufgabe bzw. Zahl, Holz mit Ablagerungen ---------- */
.aq-eine-zeile .schild {
  position: relative; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-width: clamp(150px, 15vw, 330px); max-width: none; margin: .65em .45em 1em; padding: .75em clamp(28px, 2.7vw, 50px) .85em;
  border: 3px solid var(--ink, #1c2230); border-radius: clamp(16px, 1.3vw, 26px);
  font-size: clamp(14px, 1.15vw, 23px);
  background:
    radial-gradient(circle at var(--aq-fleck-x, 18%) 88%, rgba(77, 124, 15, .16), transparent 34%),
    radial-gradient(circle at var(--aq-fleck2-x, 84%) 14%, rgba(120, 113, 108, .13), transparent 30%),
    radial-gradient(ellipse at 50% 112%, rgba(21, 128, 61, .14), transparent 55%),
    repeating-linear-gradient(180deg, transparent 0 15px, rgba(120, 86, 40, .05) 15px 16px),
    #fdf8ea;
  box-shadow: inset -5px -6px 0 rgba(28, 34, 48, .12), inset 0 0 0 2px rgba(255, 255, 255, .6), 0 10px 24px -12px rgba(20, 27, 45, .45);
  text-align: center;
}
/* Frage und Hinweis nur für Bildschirmleser (Rückmeldung zeigt das angetippte Tier) */
.aq-eine-zeile .schild .schild-frage,
.aq-eine-zeile .schild .schild-hinweis {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.aq-eine-zeile .schild .schild-ziel { position: relative; z-index: 1; padding-top: .08em; font-size: clamp(38px, 4.5vw, 92px); line-height: 1.1; }
.aq-wechsel .schild.is-pop { animation: none; }
/* Die Zahlenschrift hat einen sehr hohen Schriftkasten (93 px bei 53 px Schrift); auf Zeilenhöhe begrenzen, damit er
   nicht über Moos und Algenfäden ragt */
.aq-eine-zeile .schild .schild-ziel > span { display: inline-block; line-height: 1.05; }

/* Ablagerungen (kopf-eine-zeile.js malt sie bei jeder Aufgabe neu) */
.aq-belag { position: absolute; inset: 0; pointer-events: none; }
.aq-belag svg { display: block; overflow: visible; }
/* Leichter Schatten: Bewuchs liegt auf dem Schild, nicht flach darauf gemalt (21.10.2026 abends) */
.aq-belag-teil { filter: drop-shadow(0 .05em .05em rgba(15, 30, 45, .28)); }
.aq-moos { filter: drop-shadow(0 .07em .05em rgba(20, 45, 20, .32)); }
/* Maße in em: die Ablagerungen wachsen mit der Schildschrift (14 px bis 23 px) */
.aq-moos { position: absolute; top: -.92em; height: 1.15em; background-repeat: repeat-x; background-size: auto 100%;
  /* Polster läuft an den Enden flach und rund aus statt gerade abgeschnitten */
  border-radius: 1.1em 1.1em .2em .2em / .9em .9em .2em .2em;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%); }
.aq-ecke { position: absolute; display: block; line-height: 0; }
.aq-ecke-o { top: -.95em; }
.aq-ecke-o2 { top: -.72em; }
.aq-ecke-u { bottom: -.85em; }
.aq-ecke-s { bottom: -.65em; }
.aq-seepocken { height: 1.5em; width: auto; }
.aq-ecke-o2 .aq-seepocken { height: 1.15em; }
.aq-seestern { width: 2em; height: 2em; }
.aq-schnecke { width: 1.95em; height: 1.45em; }
.aq-muscheln { width: 1.95em; height: 1.6em; }
.aq-faden-platz { position: absolute; top: 100%; margin-top: -.2em; line-height: 0; }
.aq-faden { width: .72em; transform-origin: 50% 0; animation: aq-faden 2.8s ease-in-out infinite alternate; }
@keyframes aq-faden { from { transform: rotate(-9deg); } to { transform: rotate(10deg); } }
.aq-oese { position: absolute; top: 50%; width: 1.08em; height: 1.08em; margin-top: -.54em; }
.aq-oese-l { left: -.8em; }
.aq-oese-r { right: -.8em; }

/* ---------- Taucher mit Leine (kopf-eine-zeile.js) ---------- */
.aq-taucher-buehne { position: absolute; inset: 0; z-index: 4; overflow: hidden; pointer-events: none; }
.aq-wechsel .aq-taucher-buehne { z-index: 6; }
.aq-taucher { position: absolute; top: 0; left: 0; will-change: transform; }
.aq-taucher-dreh { position: relative; }
.aq-taucher-dreh, .aq-taucher-dreh > svg { display: block; width: 100%; height: 100%; }
.aq-gurt { position: absolute; width: 0; height: 0; }
.aq-taucher .tg-bein { animation-duration: .55s; }
.aq-taucher .tg-arm-zug { animation: aq-arm .9s ease-in-out infinite alternate; }
@keyframes aq-arm { from { transform: rotate(-10deg); } to { transform: rotate(12deg); } }
.aq-alt { position: absolute; display: flex; justify-content: center; will-change: transform; }
.aq-alt .schild-ziel { opacity: .42; }
.aq-leine { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.aq-leine path { fill: none; stroke: #fcd34d; stroke-width: 3.5; stroke-linecap: round; }
.aq-leine path.aq-leine-rand { stroke: #1c2230; stroke-width: 6.5; }
.tg-zopf { animation: aq-zopf 1.1s ease-in-out infinite alternate; }
@keyframes aq-zopf { from { transform: rotate(-4deg); } to { transform: rotate(5deg); } }
@media (prefers-reduced-motion: reduce) { .tg-zopf, .aq-faden, .aq-taucher .tg-arm-zug { animation: none; } }

/* ---------- Spielsachen rechts oben: Symbol und Zahl, darunter klein, was es ist ---------- */
/* Alex, 21.10.2026 abends: „rechts die ganzen Sachen etwas dezenter machen“. Kleiner, heller, durchscheinend,
   ohne dunklen Rahmen; Symbole etwas blasser. Beim Überfahren oder mit Tastatur wieder kräftig. Tippflächen bleiben 44 px. */
.aq-spiel {
  --aq-h: clamp(44px, 3.05vw, 60px); --aq-zahl: clamp(13px, .98vw, 19px); --aq-bild: clamp(18px, 1.35vw, 27px); --aq-unter: clamp(10px, .68vw, 13px);
  display: flex; flex-direction: column; align-items: flex-end; gap: 0;
  box-sizing: border-box; width: max-content; flex: none; padding: 1px 3px;
  border: 1px solid rgba(255, 255, 255, .5); border-radius: 16px; background: rgba(236, 248, 255, .5);
  box-shadow: 0 6px 16px -14px rgba(6, 28, 48, .5);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: background-color .25s ease, box-shadow .25s ease;
}
.aq-spiel:hover, .aq-spiel:focus-within { background: rgba(246, 252, 255, .82); box-shadow: 0 8px 18px -12px rgba(6, 28, 48, .5); }
.aq-eine-zeile .aq-spiel .aq-teil svg, .aq-eine-zeile .aq-spiel .ruhe-blasen, .aq-eine-zeile .aq-spiel .tiefe-skala { filter: saturate(.72); opacity: .88; transition: filter .25s ease, opacity .25s ease; }
.aq-spiel:hover .aq-teil svg, .aq-spiel:focus-within .aq-teil svg, .aq-spiel:hover .ruhe-blasen, .aq-spiel:hover .tiefe-skala { filter: none; opacity: 1; }
.aq-reihe { display: flex; flex-wrap: nowrap; justify-content: flex-end; align-items: center; gap: 2px; }
.aq-reihe > * { flex: none; margin: 0; }
.aq-spiel .buch-name, .aq-spiel .ruhe-titel, .aq-spiel .tiefe-orden, .aq-spiel .rh-knopf-text { display: none; }
.aq-eine-zeile .aq-spiel .aq-teil {
  position: static; display: inline-flex; flex-direction: row; flex-wrap: wrap; align-items: center; align-content: center; justify-content: center;
  gap: 2px 4px; box-sizing: border-box; height: var(--aq-h); min-height: var(--aq-h); min-width: 44px; margin: 0; padding: 2px clamp(6px, .5vw, 10px);
  border: 0; border-radius: 12px; background: transparent; box-shadow: none; color: rgba(28, 34, 48, .82);
  -webkit-backdrop-filter: none; backdrop-filter: none; opacity: 1; transform: none; cursor: default; font: inherit;
}
.aq-eine-zeile .aq-spiel button.aq-teil { cursor: pointer; }
.aq-eine-zeile .aq-spiel button.aq-teil:hover { background: rgba(255, 255, 255, .75); transform: none; }
.aq-eine-zeile .aq-spiel button.aq-teil:focus-visible { outline: 3px solid #2563eb; outline-offset: -2px; }
.aq-spiel .aq-teil[data-aq-unter]::after { content: attr(data-aq-unter); }
.aq-spiel .aq-teil[data-aq-unter]::after,
.aq-spiel .tiefe-werte span {
  order: 9; flex-basis: 100%; text-align: center;
  color: rgba(75, 85, 105, .85); font: 500 var(--aq-unter)/1 var(--font, "Rubik", sans-serif); letter-spacing: .01em; white-space: nowrap;
}
.aq-eine-zeile .aq-spiel .aq-teil svg { flex: none; width: var(--aq-bild); height: var(--aq-bild); }
.aq-eine-zeile .aq-spiel .aq-teil b { padding-top: .12em; font: 700 var(--aq-zahl)/1 var(--font-display, sans-serif); }
.aq-spiel .buch-zahl { color: var(--tone-deep, #155e75); }
.aq-eine-zeile .aq-spiel .aq-fang b { font-size: calc(var(--aq-zahl) * 1.15); }
.aq-spiel .or-wirkt { display: inline-flex; align-items: center; }
.aq-eine-zeile .aq-spiel .or-wirkt svg { width: calc(var(--aq-bild) * .7); height: calc(var(--aq-bild) * .7); }
.aq-eine-zeile .aq-spiel .auftrag-knopf { display: inline-flex !important; }
.aq-eine-zeile .aq-spiel .auftrag-knopf.is-fertig { background: #dcfce7; }
.aq-eine-zeile .aq-spiel .rh-knopf.is-offen { background: #fde68a; }
.aq-eine-zeile .aq-spiel .rh-knopf svg { width: calc(var(--aq-bild) * 1.15); height: calc(var(--aq-bild) * 1.15); }
.aq-eine-zeile .aq-spiel .anzeige-ruhe { flex-direction: row; }
.aq-eine-zeile .aq-spiel .ruhe-blasen { gap: 2px; padding-top: calc(var(--aq-zahl) * .6); }
.aq-eine-zeile .aq-spiel .ruhe-blasen i { width: calc(var(--aq-zahl) * .68); height: calc(var(--aq-zahl) * .68); border-width: 1.5px; }
.aq-eine-zeile .aq-spiel .ruhe-blasen .marke { top: min(-9px, calc(var(--aq-zahl) * -.7)); width: max(9px, calc(var(--aq-zahl) * .6)); height: max(9px, calc(var(--aq-zahl) * .6)); }
.aq-eine-zeile .aq-spiel .aq-teil .ruhe-blasen .marke svg { width: 100%; height: 100%; }
.aq-spiel .tiefe-werte { display: contents; }
.aq-eine-zeile .aq-spiel .tiefe-skala { display: inline-block; width: 6px; height: calc(var(--aq-bild) * .95); border-width: 1.5px; }
.aq-eine-zeile .aq-spiel .tiefe-skala i { right: -4px; left: -4px; height: 4px; margin-top: -2px; border-width: 1px; }
.aq-spiel .anzeige-luft[hidden] { display: none; }
.aq-eine-zeile .aq-spiel [data-restart] { width: auto; padding-inline: 10px; }
.aq-eine-zeile .aq-spiel [data-restart] svg { width: var(--aq-bild); height: var(--aq-bild); }

/* Kompakt (kopf-eine-zeile.js): ohne Beschriftung, das Erklärschild und aria-label nennen sie weiter */
.aq-kompakt .aq-spiel .aq-teil[data-aq-unter]::after, .aq-kompakt .aq-spiel .tiefe-werte span { display: none; }
.aq-kompakt .aq-spiel { --aq-h: clamp(44px, 2.8vw, 54px); }
.aq-eine-zeile.aq-kompakt .aq-spiel .aq-teil { min-width: 44px; padding-inline: clamp(6px, .45vw, 10px); }

/* Vorlesen im Einstellungsfenster */
.aq-vorlesen-bereich .menu-seg button { white-space: nowrap; }

/* ---------- Erklärschild beim Überfahren ---------- */
.aq-tip {
  position: fixed; z-index: 200; max-width: min(300px, calc(100vw - 16px)); padding: 6px 10px 5px; box-sizing: border-box;
  border-radius: 10px; background: #1c2230; color: #fff; pointer-events: none;
  font: 600 13px/1.3 var(--font, "Rubik", sans-serif); box-shadow: 0 8px 20px -10px rgba(10, 20, 40, .6);
}
.aq-tip[hidden] { display: none; }

/* ---------- Handy ---------- */
@media (max-width: 700px) {
  .aq-eine-zeile .schild { margin: 8px 4px 12px; padding-inline: 24px; }
  .aq-eine-zeile .schild .schild-ziel { font-size: clamp(30px, 8.5vw, 44px); }
}

/* Hochformat und Handy: raum.css stellt dort alles untereinander, gibt dem Becken feste 500 px und verteilt die übrige
   Höhe auf Kopf und Bedienung (leere Fläche). Ohne Zeile oben füllt das Becken stattdessen den Rest. */
@media (max-width: 640px), (max-width: 900px) and (orientation: portrait) {
  html.raum-effizient.aq-eine-zeile[data-raum-modul="aquarium"] .app.tk {
    height: 100dvh !important; min-height: 0 !important; grid-template-rows: auto minmax(0, 1fr) auto !important;
  }
  html.raum-effizient.aq-eine-zeile[data-raum-modul="aquarium"] .app.tk > .tk-flaeche { min-height: 0; }
  html.raum-effizient.aq-eine-zeile[data-raum-modul="aquarium"] .app.tk > .tk-flaeche > .becken-platz {
    height: 100% !important; min-height: 320px;
  }
}
