/* ==========================================================================
   style.css – Webseite Sebastian Wolf

   Inhalt
     1  Basis & Variablen
     2  Navigation (Burger, Menü, Seitenpunkte)
     3  Sektion 1  Erinnerung (Memory-Spiel)
     4  Sektion 2  Einblick (Profil)
     5  Sektion 3  Erfahrung (Lebenslauf)
     6  Sektion 4  Erreichbarkeit (Kontakt)
     7  Overlays (Impressum, Gewinn-Popup, Chat)
     8  Barrierefreiheit (reduzierte Bewegung)
   ========================================================================== */


/* ==========================================================================
   1  BASIS & VARIABLEN
   ========================================================================== */

:root {
  /* Farben */
  --bg: #0b1220;                        /* Seitenhintergrund */
  --txt: #e8f1fa;                       /* Standard-Textfarbe */
  --acc: #29b6f6;                       /* Akzent hell */
  --acc2: #4dd0e1;                      /* Akzent, zweite Farbe für Verläufe */
  --acc-dark: #0277bd;                  /* Akzent für helle Flächen (guter Kontrast auf Weiß) */
  --ink: #04202c;                       /* Text auf Akzent-Flächen */
  --headline-blue: #009ee0;             /* Das Blau aus der Spiel-Überschrift */
  --cv-heading: #7dd6fc;                /* Überschriften im Lebenslauf (Kontrast 5:1 auf dem Verlauf) */
  --cv-meta: #9aebf5;                   /* Zeiträume im Lebenslauf (Kontrast 4,8:1 auf den Karten) */
  --glass: rgba(255, 255, 255, .08);    /* Milchglas-Fläche */
  --line: rgba(255, 255, 255, .18);     /* feine Linien und Rahmen */

  /* Spielfeld: Anzahl der Spalten und Zeilen (wird per Media Query angepasst) */
  --cols: 6;
  --rows: 5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

/* Die Seite selbst scrollt nie. Gescrollt wird nur im Container #pages. */
html,
body {
  height: 100%;
  overflow: hidden;
}

/* Scroll-Container über den ganzen Bildschirm. Jede Sektion rastet beim Scrollen ein (Scroll-Snapping).
   position: fixed hält die Höhe auf dem Handy stabil, auch wenn die Browserleiste ein- und ausfährt. */
#pages {
  position: fixed;
  inset: 0;
  overflow-y: scroll;
  overscroll-behavior-y: none;          /* kein Gummiband-Effekt am Anfang und Ende */
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

body {
  background: var(--bg);
  color: var(--txt);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--acc2);
  outline-offset: 2px;
}

/* Jede Sektion füllt genau einen Bildschirm */
section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;                         /* genau so hoch wie der Scroll-Container */
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Einblend-Effekt: Inhalte erscheinen, sobald die Sektion aktiv wird (Klasse .act).
   Hintergrund-Ebenen (.bgl) sind davon ausgenommen. */
section > :not(.bgl) {
  transition: opacity .8s ease, transform .8s ease;
}

section:not(.act) > :not(.bgl) {
  opacity: 0;
  transform: translateY(40px) scale(.97);
}

/* Milchglas-Karte (Profil und Lebenslauf-Einträge) */
.glass {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 24px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

/* Buttons mit Farbverlauf */
.pill,
.btn {
  display: inline-block;
  background: linear-gradient(90deg, var(--acc), var(--acc2));
  border: 0;
  border-radius: 99px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.pill {
  padding: 12px 30px;
}

.btn {
  padding: 8px 20px;
}

/* Schlichter Text-Link als Button (z. B. "Impressum") */
.linkbtn {
  background: none;
  border: 0;
  color: var(--txt);
  font-size: .8rem;
  opacity: .85;
  text-decoration: underline;
}


/* ==========================================================================
   2  NAVIGATION
   ========================================================================== */

/* Burger-Button: erscheint erst nach dem Scrollen (Klasse .vis, siehe Skript) */
#burger {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 16px;
  z-index: 65;
  width: 48px;
  height: 48px;
  background: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .35), 0 0 0 4px rgba(41, 182, 246, .28);
  opacity: 0;
  visibility: hidden;
  transition: transform .3s, box-shadow .3s, opacity .5s, visibility .5s;
}

#burger.vis {
  opacity: 1;
  visibility: visible;
}

#burger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .4), 0 0 0 6px rgba(77, 208, 225, .4);
}

/* Die drei Striche des Burger-Symbols */
#burger span {
  position: absolute;
  left: 13px;
  width: 22px;
  height: 2.5px;
  background: var(--acc-dark);
  border-radius: 2px;
  transition: .35s;
}

#burger span:nth-child(1) { top: 16px; }
#burger span:nth-child(2) { top: 23px; width: 15px; }
#burger span:nth-child(3) { top: 30px; }

/* Geöffnet: Striche bilden ein Kreuz */
#burger.open span:nth-child(1) { top: 23px; transform: rotate(45deg); }
#burger.open span:nth-child(2) { opacity: 0; transform: translateX(10px); }
#burger.open span:nth-child(3) { top: 23px; transform: rotate(-45deg); }

/* Vollbild-Menü */
#menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  overflow-y: auto;
  background:
    radial-gradient(circle at 20% 15%, rgba(41, 182, 246, .22), transparent 55%),
    rgba(8, 14, 26, .92);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s, visibility .4s;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

#menu.open {
  opacity: 1;
  visibility: visible;
}

.mwrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  margin: auto;
  padding: 70px 20px;
}

/* Kopfbereich mit Logo */
.mhead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 600;
}

.mhead img {
  width: 132px;
  height: 132px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(77, 208, 225, .45));
}

/* Menüpunkte: gleiten nacheinander ein */
.mlist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: max-content;
  max-width: 100%;
}

.mlist a {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 1.6rem;
  font-weight: 700;
  text-decoration: none;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s, transform .5s, color .3s;
}

#menu.open .mlist a {
  opacity: 1;
  transform: none;
}

#menu.open .mlist a:nth-child(2) { transition-delay: .08s; }
#menu.open .mlist a:nth-child(3) { transition-delay: .16s; }
#menu.open .mlist a:nth-child(4) { transition-delay: .24s; }

.mlist a.on {
  color: var(--acc);
}

/* Runde Symbole vor den Menüpunkten */
.ic {
  display: grid;
  flex: none;
  place-items: center;
  width: 46px;
  height: 46px;
  background: rgba(77, 208, 225, .12);
  border: 1px solid rgba(77, 208, 225, .35);
  border-radius: 50%;
  transition: .3s;
}

.ic svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--acc2);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mlist a.on .ic {
  background: var(--acc);
}

.mlist a.on .ic svg {
  stroke: var(--ink);
}

/* Seitenpunkte am rechten Rand */
#dots {
  position: fixed;
  top: 50%;
  right: 14px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: translateY(-50%);
  transition: opacity .4s;
}

#dots a {
  position: relative;
  width: 11px;
  height: 11px;
  background: rgba(255, 255, 255, .35);
  border-radius: 50%;
  transition: .3s;
}

#dots a.on {
  background: var(--acc);
  transform: scale(1.5);
}

/* Unsichtbare, größere Trefferfläche (29 px), damit die Punkte auf dem Handy leicht zu treffen sind */
#dots a::after {
  content: "";
  position: absolute;
  inset: -9px;
}

/* Auf dem Handy (schmal oder Touch) sind die Punkte meist ausgeblendet und erscheinen nur kurz nach dem Scrollen
   (Klasse .show, siehe script.js) */
@media (max-width: 900px), (pointer: coarse) {
  #dots {
    opacity: 0;
    pointer-events: none;
  }

  #dots.show {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Auf der weißen Profil-Sektion (body.light) brauchen Burger und Punkte dunklere Farben */
body.light #dots a {
  background: rgba(0, 0, 0, .25);
}

body.light #dots a.on {
  background: var(--acc-dark);
}

body.light #burger {
  box-shadow: 0 2px 12px rgba(0, 0, 0, .3);
}


/* ==========================================================================
   3  SEKTION 1: ERINNERUNG (Memory-Spiel)
   ========================================================================== */

#s1 {
  gap: 8px;
  padding:
    calc(14px + env(safe-area-inset-top))
    12px
    calc(12px + env(safe-area-inset-bottom));
}

/* Spielfeld: Spalten und Zeilen kommen aus --cols und --rows */
#grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: repeat(var(--rows), 1fr);
  gap: 8px;
  width: min(100%, 900px);
  min-height: 0;
}

/* Eine Karte besteht aus .inner (dreht sich) mit Rückseite (.back) und Vorderseite (.front) */
.card {
  min-width: 0;
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  perspective: 800px;
}

.inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  transform-style: preserve-3d;
  transition: transform .6s;
}

.card.open .inner {
  transform: rotateY(180deg);
}

.face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 10px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Rückseite: Blauton aus der Variablen --tile (setzt das Skript) plus leichter Glanzverlauf */
.back {
  background-color: var(--tile, #223);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(0, 0, 0, .18));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

/* Vorderseite: Foto mit Beschriftung */
.front {
  display: flex;
  flex-direction: column;
  background: #16233a;
  border: 1px solid var(--line);
  transform: rotateY(180deg);
}

.front img {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: cover;
}

/* Platzhalter mit Initialen, falls ein Foto fehlt */
.ph {
  display: grid;
  flex: 1;
  place-items: center;
  color: var(--acc);
  font-size: 1.6rem;
}

.front p {
  padding: 4px 4px 5px;
  background: rgba(8, 14, 26, .85);
  color: #fff;
  font-size: .68rem;
  line-height: 1.25;
  text-align: center;
}

.front b {
  display: block;
  color: #fff;
  font-size: .8rem;
}

/* Treffer leuchten kurz auf */
.card.match .inner {
  animation: glow 1s;
}

@keyframes glow {
  50% { box-shadow: 0 0 22px 6px var(--acc2); }
}

/* Fußzeile unter dem Spielfeld: Museumsschild und Spielstand teilen sich denselben Platz */
#foot {
  display: grid;
  flex: none;
  align-items: center;
  width: min(100%, 900px);
  min-height: 34px;
}

#foot > * {
  grid-area: 1 / 1;
}

/* Museumsschild: kleine Beschriftung rechts unter dem Kunstwerk.
   Verschwindet, sobald das Spiel startet (Klasse .hide). */
#plaque {
  justify-self: end;
  padding: 7px 2px 0 18px;
  border-top: 1px solid rgba(232, 241, 250, .35);
  color: rgba(232, 241, 250, .9);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(.82rem, 1.6vw, 1.05rem);
  font-style: italic;
  letter-spacing: .05em;
  text-align: right;
  transition: opacity .6s;
}

#plaque .hex {
  color: var(--headline-blue);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-style: normal;
}

#plaque.hide {
  opacity: 0;
}

/* Spielstand (Züge, Zeit, Bestzeit): erscheint mit dem ersten Zug (Klasse .show) */
#stats {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 18px;
  min-height: 30px;
  font-size: .9rem;
  opacity: 0;
  visibility: hidden;                   /* vor dem Start auch nicht anklickbar oder per Tab erreichbar */
  transition: opacity .6s, visibility .6s;
}

#stats.show {
  opacity: 1;
  visibility: visible;
}

#stats .btn {
  padding: 4px 14px;
  font-size: .85rem;
}

/* Schmale Bildschirme: 5 Spalten, 6 Zeilen, Zusatzinfo ausblenden */
@media (max-width: 900px) {
  :root { --cols: 5; --rows: 6; }
  #grid { gap: 6px; }
  .front span { display: none; }
  .front p { font-size: .58rem; }
  .front b { font-size: .6rem; }
}

/* Handy quer: 10 Spalten, 3 Zeilen */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --cols: 10; --rows: 3; }
  #s1 { gap: 3px; padding-top: 8px; }
  #plaque { padding-top: 3px; font-size: .8rem; }
}


/* ==========================================================================
   4  SEKTION 2: EINBLICK (Profil, weißer Hintergrund)
   ========================================================================== */

#s2 {
  justify-content: center;
  background: #fff;
  color: var(--bg);
}

#prof {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(92%, 560px);
  padding: 36px 28px;
  background: linear-gradient(135deg, #f1faff, #fff);
  border: 1px solid #cfe3ee;
  box-shadow: 0 20px 60px rgba(2, 60, 90, .18);
  color: var(--bg);
  text-align: center;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

#prof img {
  width: 140px;
  height: 140px;
  background: #16233a;
  border: 3px solid var(--acc2);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(77, 208, 225, .7);
  object-fit: cover;
}

#prof h1 {
  font-size: clamp(1.3rem, 4vw, 2rem);
}

#prof .hl,
#type {
  color: var(--acc-dark);
}

/* Schreibmaschinen-Text mit blinkendem Cursor */
#type {
  min-height: 1.6em;
  font-size: 1.1rem;
}

#type::after {
  content: "|";
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

@media (max-height: 560px) {
  #prof { gap: 8px; padding: 16px; }
  #prof img { width: 80px; height: 80px; }
}


/* ==========================================================================
   5  SEKTION 3: ERFAHRUNG (Lebenslauf)

   Der Lebenslauf muss ohne Scrollen auf den Bildschirm passen. Dafür gibt es
   drei Stufen:  1) Grundlayout,  2) kompakte Varianten per Media Query,
   3) automatische Verkleinerung per Skript (fitCV), falls es immer noch nicht reicht.
   ========================================================================== */

#s3 {
  padding-top: 70px;                    /* Platz für den Burger-Button */
  background: linear-gradient(160deg, #10304a, #16566f 55%, #0f3d56);
}

#cv {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  width: min(100%, 1100px);
  padding: 10px 24px;
  overflow: hidden;
}

/* Innerer Container, den fitCV bei Bedarf verkleinert */
#cvin {
  width: 100%;
  transform-origin: top center;
}

#cv h2 {
  margin: 14px 0 10px;
  color: var(--cv-heading);
}

/* Erfahrung und Ausbildung nebeneinander */
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
}

/* Zeitleiste mit Linie links */
.tl {
  padding-left: 18px;
  border-left: 2px solid var(--acc2);
}

/* Einzelner Eintrag: blendet ein, sobald er sichtbar ist (Klasse .in) */
.item {
  margin: 0 0 12px;
  padding: 12px 16px;
  opacity: 0;
  transform: translateY(20px);
  transition: .6s;
}

.item.in {
  opacity: 1;
  transform: none;
}

.item small {
  color: var(--cv-meta);
}

.item p {
  font-size: .9rem;
  opacity: .85;
}

/* Fähigkeiten als Chips */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags span {
  padding: 5px 14px;
  border: 1px solid var(--acc2);
  border-radius: 99px;
  font-size: .85rem;
}

/* Stufe 2a: kompakt bei schmalem oder niedrigem Fenster (Beschreibungstexte entfallen) */
@media (max-width: 900px), (max-height: 680px) {
  #s3 { padding-top: 60px; }
  #cv { padding: 4px 14px; }
  #cv h2 { margin: 6px 0 4px; font-size: 1.05rem; }
  .tl { padding-left: 12px; }
  .item { margin: 0 0 6px; padding: 6px 10px; border-radius: 14px; }
  .item p { display: none; }
  .item small { font-size: .7rem; }
  .item h3 { font-size: .88rem; line-height: 1.2; }
  .item div { font-size: .76rem; line-height: 1.25; opacity: .85; }
  .tags { gap: 5px; }
  .tags span { padding: 3px 10px; font-size: .74rem; }
}

/* Stufe 2b: auf schmalen Bildschirmen untereinander statt nebeneinander */
@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
}

/* Stufe 2c: kleine Handys im Hochformat, noch kompakter */
@media (max-width: 900px) and (max-height: 700px) {
  #s3 { padding-top: 54px; }
  #cv h2 { margin: 4px 0 3px; font-size: .95rem; }
  .item { margin: 0 0 4px; padding: 4px 9px; }
  .item small { font-size: .66rem; }
  .item h3 { font-size: .8rem; }
  .item div { font-size: .7rem; }
  .tags { gap: 4px; }
  .tags span { padding: 2px 8px; font-size: .68rem; }
}

/* Stufe 2d: Handy quer, zwei Spalten nebeneinander und sehr kompakt */
@media (max-height: 520px) and (orientation: landscape) {
  #s3 { padding-top: 12px; }
  #cv { padding: 2px 64px; }
  #cv h2 { margin: 4px 0 3px; font-size: .95rem; }
  .cols { grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .item { margin: 0 0 4px; padding: 4px 9px; }
  .item small { font-size: .65rem; }
  .item h3 { font-size: .8rem; }
  .item div { font-size: .68rem; }
  .tags span { padding: 2px 8px; font-size: .68rem; }
}


/* ==========================================================================
   6  SEKTION 4: ERREICHBARKEIT (Kontakt)
   ========================================================================== */

#s4 {
  justify-content: center;
  gap: 28px;
  text-align: center;
  isolation: isolate;                   /* eigener Stapelkontext: Hintergrund bleibt in dieser Sektion */
}

/* Hintergrundbild (Skript wählt zufällig eines aus img/):
   leicht weichgezeichnet, teilweise entsättigt und abgedunkelt */
#s4bg {
  position: absolute;
  inset: -14px;                         /* überlappt den Rand, damit die Unschärfe nicht ausfranst */
  z-index: -1;
  background: var(--bg) center / cover no-repeat;
  filter: blur(3px) grayscale(.5) brightness(.55);
}

/* Dunkler Verlauf darüber: sanfter Übergang zur Lebenslauf-Sektion, Text bleibt lesbar */
#s4::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(11, 18, 32, .7), rgba(11, 18, 32, .25) 45%, rgba(11, 18, 32, .55));
}

/* Kontakt-Symbole: weiße Kreise, damit sie vor dem Foto gut sichtbar sind */
#ct {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
}

#ct a {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  transition: transform .25s, box-shadow .25s;
}

#ct a:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
  transform: translateY(-3px);
}

#ct svg {
  width: 28px;
  height: 28px;
  fill: var(--acc-dark);
}

footer {
  position: absolute;
  bottom: calc(14px + env(safe-area-inset-bottom));
}

@media (max-height: 560px) {
  #s4 { gap: 14px; }
  #ct a { width: 48px; height: 48px; }
}


/* ==========================================================================
   7  OVERLAYS
   ========================================================================== */

/* Modale Fenster (Impressum, Gewinn-Popup) */
.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .75);
}

.modal.open {
  display: flex;
}

/* Fenster-Box: hält den Schließen-Button fest, der Inhalt (.modal-body) scrollt darunter */
.modal-box {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: #101a2e;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.modal-body {
  max-height: 85vh;
  padding: 24px;
  overflow: auto;
  overscroll-behavior: contain;         /* Scrollen im Fenster bewegt nie die Seite dahinter */
  border-radius: 16px;
}

/* Schließen-Button oben rechts: weißer Kreis mit blauem X, wie beim Burger-Menü.
   Bleibt beim Scrollen im Fenster sichtbar. */
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
  transition: transform .3s;
}

.modal-close:hover {
  transform: scale(1.1);
}

.modal-close::before,
.modal-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2.5px;
  background: var(--acc-dark);
  border-radius: 2px;
}

.modal-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.modal-close::after  { transform: translate(-50%, -50%) rotate(-45deg); }

.modal h2 {
  margin-bottom: 10px;
}

/* Impressum: Platz lassen, damit die Überschrift nicht unter dem X liegt */
#imp h2 {
  padding-right: 48px;
}

.modal h3 {
  margin: 14px 0 4px;
  color: var(--acc);
  font-size: 1rem;
}

.modal p {
  font-size: .9rem;
  line-height: 1.5;
}

.modal a {
  color: var(--acc);
}

/* Gewinn-Popup */
#win .modal-body {
  text-align: center;
}

#win img {
  width: 120px;
  height: 120px;
  margin-bottom: 12px;
  border: 3px solid var(--acc2);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(77, 208, 225, .6);
  object-fit: cover;
}

#win .small {
  margin-top: 8px;
  opacity: .8;
}

/* Chat-Fenster (unten rechts) */
#cw {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 55;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100dvh - 40px));
  overflow: hidden;
  background: rgba(12, 22, 38, .97);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(.97);
  transition: .35s;
}

#cw.open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

#cw header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(90deg, var(--acc), var(--acc2));
  color: var(--ink);
}

#cw header small {
  display: block;
  opacity: .75;
}

#cw header button {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--ink);
  font-size: 1.6rem;
}

#msgs {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  overflow-y: auto;
}

/* Sprechblasen */
.m {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: .92rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.m.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, .1);
  border-bottom-left-radius: 4px;
}

.m.me {
  align-self: flex-end;
  background: linear-gradient(90deg, var(--acc), var(--acc2));
  border-bottom-right-radius: 4px;
  color: var(--ink);
}

/* "Tippt …"-Anzeige des Assistenten */
.m.typing {
  letter-spacing: .25em;
  opacity: .7;
}

/* Eingabezeile */
#cf {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

#cf input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--txt);
  font: inherit;
}

#cf button {
  padding: 0 18px;
  background: linear-gradient(90deg, var(--acc), var(--acc2));
  border: 0;
  border-radius: 99px;
  color: var(--ink);
  font-weight: 700;
}


/* ==========================================================================
   8  BARRIEREFREIHEIT
   ========================================================================== */

/* Wer reduzierte Bewegung eingestellt hat, bekommt keine Animationen und alle Inhalte sofort */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }

  section:not(.act) > :not(.bgl) {
    opacity: 1;
    transform: none;
  }

  .item {
    opacity: 1;
    transform: none;
  }
}
