/* Coli · Grundgerüst, Bühne, Eingabebalken, Gespräch.
   Farben: CoLiLab-Seite (Navy, Beere, Creme) + dezent die Facetten des Kolibri-Logos. */

:root {
  --navy: #12214a;
  --beere: #79254b;
  --creme: #f9f4f4;
  --grund: #fbf8f7;
  --flaeche: #ffffff;
  --text: #1f2a4d;
  --text-2: #5d6b88;
  --text-3: #8c97ae;
  --linie: rgba(18, 33, 74, .08);
  --linie-2: rgba(18, 33, 74, .14);

  /* Facetten des Kolibri */
  --tuerkis: #77c0b7;
  --gruen: #57a57c;
  --hellgruen: #9ac77a;
  --blau: #5a74b3;
  --gelb: #f2d34f;
  --orange: #ed8b31;
  --pink: #e2689f;
  --rot: #b72c1e;
  --facetten: linear-gradient(90deg, var(--tuerkis), var(--hellgruen) 18%, var(--gelb) 36%, var(--orange) 54%, var(--pink) 72%, var(--blau) 90%);

  --schatten-1: 0 1px 2px rgba(18, 33, 74, .04), 0 2px 8px rgba(18, 33, 74, .04);
  --schatten-2: 0 1px 2px rgba(18, 33, 74, .05), 0 12px 32px -8px rgba(18, 33, 74, .12);
  --rund: 20px;
  --weich: cubic-bezier(.22, .8, .24, 1);
  --feder: cubic-bezier(.34, 1.36, .64, 1);
  --breite: 760px;
  --rand: max(16px, env(safe-area-inset-left));
  --schrift: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --titel: 'Teko', 'Nunito Sans', sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100dvh;
  font: 400 17px/1.55 var(--schrift); color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(119, 192, 183, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(226, 104, 159, .06), transparent 60%),
    var(--grund);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--beere); text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--blau); outline-offset: 3px; border-radius: 10px; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprung { position: absolute; left: -999px; top: 8px; }
.sprung:focus { left: 16px; z-index: 50; background: var(--flaeche); padding: 8px 14px; border-radius: 12px; box-shadow: var(--schatten-2); }
.leise { color: var(--text-3); font-size: 13.5px; }
.noscript { text-align: center; padding: 40px 16px; }

/* ── Kopf ─────────────────────────────────────────────── */
.kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px var(--rand);
  background: color-mix(in srgb, var(--grund) 72%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--weich);
}
body[data-zustand="arbeit"] .kopf { border-bottom-color: var(--linie); }
.marke { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--navy); flex: 0 0 auto; }
.marke img { flex: 0 0 auto; width: 28px; height: auto; }
.marke span { font: 500 26px/1 var(--titel); letter-spacing: .02em; padding-top: 4px; }
.menue { display: flex; gap: 2px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.menue::-webkit-scrollbar { display: none; }
.menue button {
  border: 0; background: none; cursor: pointer; white-space: nowrap;
  padding: 8px 12px; border-radius: 999px; color: var(--text-2); font-size: 15px;
  transition: background .25s var(--weich), color .25s var(--weich);
}
.menue button:hover { background: rgba(18, 33, 74, .05); color: var(--navy); }
.kopf-rechts { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.zustand {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2);
  padding: 5px 11px; border-radius: 999px; background: rgba(18, 33, 74, .04);
}
.zustand i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); transition: background .4s; }
.zustand[data-ki="an"] i { background: var(--gruen); box-shadow: 0 0 0 4px rgba(87, 165, 124, .16); }
.sprache-wahl {
  border: 1px solid var(--linie-2); background: var(--flaeche); border-radius: 999px;
  padding: 4px 10px; font-size: 13px; font-weight: 700; color: var(--text-2); cursor: pointer;
}
@media (max-width: 820px) {
  .kopf { flex-wrap: wrap; row-gap: 4px; }
  .menue { order: 3; width: 100%; margin: 0 -6px; }
  .kopf-rechts { margin-left: auto; }
}

/* ── Coli (Kolibri mit Facetten-Aura) ─────────────────── */
.coli { position: relative; display: grid; place-items: center; }
.coli img { position: relative; width: 100%; height: auto; flex: 0 0 auto; z-index: 1; }
.coli .aura { position: absolute; inset: 8% 4% 0 10%; z-index: 0; pointer-events: none; }
.coli .aura i {
  position: absolute; border-radius: 50%; filter: blur(26px); opacity: .0;
  transition: opacity .9s var(--weich), transform 1.2s var(--weich);
}
.coli .aura i:nth-child(1) { inset: 30% 30% 10% 18%; background: var(--tuerkis); }
.coli .aura i:nth-child(2) { inset: 45% 20% 0 38%; background: var(--gelb); }
.coli .aura i:nth-child(3) { inset: 52% 34% 0 24%; background: var(--pink); }
.coli .aura i:nth-child(4) { inset: 26% 8% 30% 46%; background: var(--blau); }
.coli[data-zustand="ruhe"] .aura i { opacity: .16; }
.coli[data-zustand="hoert"] .aura i { opacity: calc(.28 + var(--pegel, 0) * .5); transform: scale(calc(1 + var(--pegel, 0) * .25)); }
.coli[data-zustand="denkt"] .aura { animation: drehen 6s linear infinite; }
.coli[data-zustand="denkt"] .aura i { opacity: .34; animation: atmen 2.4s var(--weich) infinite alternate; }
.coli[data-zustand="denkt"] .aura i:nth-child(2n) { animation-delay: -1.2s; }
.coli[data-zustand="spricht"] .aura i { opacity: calc(.26 + var(--pegel, 0) * .6); transform: scale(calc(1 + var(--pegel, 0) * .3)); transition-duration: .12s; }
.coli[data-zustand="ruhe"] img { animation: schweben 7s ease-in-out infinite; }

@keyframes schweben { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-1deg); } }
@keyframes drehen { to { transform: rotate(360deg); } }
@keyframes atmen { from { transform: scale(.9); } to { transform: scale(1.12); } }

/* ── Bühne (Start) ────────────────────────────────────── */
main { width: 100%; max-width: var(--breite); margin: 0 auto; padding: 0 var(--rand); }
.buehne {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(24px, 7vh, 72px) 0 32px;
}
#coli-gross { width: clamp(124px, 22vw, 176px); view-transition-name: coli; margin-bottom: 10px; }
.buehne h1 {
  margin: 0; font: 500 clamp(44px, 8vw, 64px)/.95 var(--titel); color: var(--navy); letter-spacing: .01em;
}
.unterzeile { margin: 10px 0 28px; max-width: 34ch; color: var(--text-2); font-size: clamp(17px, 2.4vw, 19px); }

/* ── Eingabebalken ────────────────────────────────────── */
.balken {
  view-transition-name: balken;
  position: relative; width: 100%; max-width: 640px;
  display: flex; align-items: flex-end; gap: 6px;
  padding: 8px 8px 8px 22px;
  background: var(--flaeche); border-radius: 30px;
  box-shadow: var(--schatten-2), 0 0 0 1px var(--linie);
  transition: box-shadow .35s var(--weich), transform .35s var(--weich);
}
.balken::after {
  content: ''; position: absolute; left: 28px; right: 28px; bottom: -1px; height: 2px; border-radius: 2px;
  background: var(--facetten); opacity: .55; transform: scaleX(.35); transition: transform .6s var(--weich), opacity .6s;
}
.balken:focus-within { box-shadow: 0 1px 2px rgba(18, 33, 74, .05), 0 18px 40px -10px rgba(18, 33, 74, .2), 0 0 0 1px var(--linie-2); }
.balken:focus-within::after { transform: scaleX(1); opacity: .8; }
.balken textarea {
  flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: none;
  padding: 11px 0; max-height: 168px; line-height: 1.45; font-size: 17px;
}
.balken textarea::placeholder { color: var(--text-3); }
.coli-klein { display: none; width: 34px; flex: 0 0 auto; margin: 0 2px 4px -10px; }
body[data-zustand="arbeit"] .coli-klein { display: grid; view-transition-name: coli; }
body[data-zustand="arbeit"] #coli-gross { view-transition-name: none; }
.coli-klein .aura i { filter: blur(8px); }

.knopf {
  flex: 0 0 auto; border: 0; cursor: pointer; display: grid; place-items: center;
  color: var(--text-2); background: transparent;
  transition: background .25s var(--weich), color .25s var(--weich), transform .25s var(--feder), opacity .25s;
}
.knopf.rund { width: 44px; height: 44px; border-radius: 50%; }
.knopf svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.knopf:hover { background: rgba(18, 33, 74, .05); color: var(--navy); }
.knopf:active { transform: scale(.92); }
.knopf[disabled] { opacity: .35; cursor: default; }
.knopf.senden { background: var(--navy); color: #fff; }
.knopf.senden:hover { background: #1c2f63; color: #fff; }
#vorlesen .welle { opacity: .25; transition: opacity .3s; }
#vorlesen[aria-pressed="true"] { color: var(--beere); }
#vorlesen[aria-pressed="true"] .welle { opacity: 1; }
#mikro[aria-pressed="true"] { background: var(--beere); color: #fff; box-shadow: 0 0 0 calc(4px + var(--pegel, 0) * 14px) rgba(121, 37, 75, .14); transition: box-shadow .08s linear; }
.hinweis-daten { margin: 12px 0 0; }

/* ── Vorschläge ───────────────────────────────────────── */
.vorschlaege { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 26px; max-width: 640px; }
.chip {
  --farbe: var(--tuerkis);
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--linie); background: rgba(255, 255, 255, .7); cursor: pointer;
  padding: 9px 15px; border-radius: 999px; font-size: 15px; color: var(--text);
  transition: transform .3s var(--feder), box-shadow .3s var(--weich), border-color .3s, background .3s;
  opacity: 0; animation: auftauchen .7s var(--weich) forwards; animation-delay: calc(var(--i, 0) * 60ms + 120ms);
}
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--farbe); flex: 0 0 auto; }
.chip:hover { transform: translateY(-2px); background: #fff; box-shadow: var(--schatten-1); border-color: var(--linie-2); }
.chip.ohne-punkt::before { display: none; }

@keyframes auftauchen { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* ── Gesprächszüge (Layout der Spalte: arbeit.css) ───── */
.zug { display: flex; flex-direction: column; gap: 10px; animation: auftauchen .55s var(--weich) both; }
.zug.person { align-items: flex-end; }
.zug.person .blase {
  max-width: 85%; padding: 10px 16px; border-radius: 20px 20px 6px 20px;
  background: var(--navy); color: #fff; font-size: 16px;
}
.zug.coli-zug .text { font-size: 17.5px; line-height: 1.6; color: var(--text); white-space: pre-line; }
.zug.coli-zug .text .wort { animation: wort .5s var(--weich) both; }
@keyframes wort { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: none; } }
.spur { display: flex; flex-wrap: wrap; gap: 6px; }
.spur span {
  font-size: 12.5px; color: var(--text-3); padding: 3px 10px; border-radius: 999px; background: rgba(18, 33, 74, .035);
  animation: auftauchen .4s var(--weich) both;
}
.spur span::before { content: '✓ '; color: var(--gruen); }
.denkt-punkte { display: inline-flex; gap: 5px; padding: 8px 0; }
.denkt-punkte i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: punkt 1.2s var(--weich) infinite; }
.denkt-punkte i:nth-child(2) { animation-delay: .15s; background: var(--tuerkis); }
.denkt-punkte i:nth-child(3) { animation-delay: .3s; background: var(--pink); }
@keyframes punkt { 0%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.modus-hinweis { font-size: 12.5px; color: var(--text-3); }
.quellen { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.quellen span { padding: 2px 9px; border: 1px solid var(--linie); border-radius: 999px; }
.folge { display: flex; flex-wrap: wrap; gap: 8px; }
.folge .chip { font-size: 14px; padding: 7px 13px; }

/* ── Fuß ──────────────────────────────────────────────── */
.fuss { max-width: var(--breite); margin: 0 auto; padding: 32px var(--rand) 48px; text-align: center; color: var(--text-3); font-size: 13px; }
.fuss p { margin: 6px 0; }
body[data-zustand="arbeit"] .fuss { display: none; }
.leise-knopf { border: 0; background: none; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; }

/* ── Übergänge ────────────────────────────────────────── */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; animation-timing-function: var(--weich); }
::view-transition-group(coli), ::view-transition-group(balken) { animation-duration: .6s; animation-timing-function: var(--weich); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-group(*) { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
.karten { display: grid; gap: 14px; }
.karten:empty { display: none; }
@media (max-width: 820px) {
  .menue { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
}
@media (max-width: 480px) {
  .balken { gap: 2px; padding-left: 18px; }
  .knopf.rund { width: 42px; height: 42px; }
}
#platz-start { width: 100%; max-width: 640px; display: flex; justify-content: center; }

/* Spielinstanz: dauerhaft sichtbar, dass hier getestet wird */
.testbetrieb {
  font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--navy);
  padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--gelb, #f2c14e) 45%, #fff);
}
