/* KI-Office Demoraum: heller Rahmen um das 3D-Büro, Bedienung in CI Blau (Königsblau, siehe docs/CI-DESIGN.md). */

@font-face {
  font-family: 'Geist';
  src: url('../fonts/geist-variabel.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --stein: #d3dae5;
  --kalk: #eef1f6;
  --kreide: #ffffff;
  --tinte: #141a29;
  --schiefer: #535b6c;
  --haupt: #234caf;
  --haupt-zart: #ebeff8;
  --sand: #f0f3f8;
  --linie: rgba(20, 26, 41, 0.1);
  --schatten: 0 1px 2px rgba(20, 26, 41, 0.12), 0 10px 26px -12px rgba(20, 26, 41, 0.38);
  --schatten-gross: 0 2px 6px rgba(20, 26, 41, 0.08), 0 30px 60px -24px rgba(20, 26, 41, 0.4);
  --weich: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Geist', system-ui, sans-serif;
  color: var(--tinte);
  background: radial-gradient(120% 90% at 50% 42%, #f6f8fb 0%, #e4e9f1 52%, #ced6e2 100%);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.raum-label span,
.blase {
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

button {
  font: inherit;
  color: inherit;
}

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

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

/* Bühne und Schilder */

.buehne {
  position: fixed;
  inset: 0;
}

.buehne canvas {
  display: block;
  touch-action: none;
}

.buehne.ist-zeiger canvas {
  cursor: pointer;
}

.schilder-ebene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Kopf mit Firmenname */

.kopf {
  position: fixed;
  top: 26px;
  left: 30px;
  max-width: min(440px, calc(100vw - 60px));
  pointer-events: none;
}

.kopf h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.kopf p {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--schiefer);
}

/* Impressum und Datenschutz: klein unter dem Untertitel, klickbar trotz pointer-events: none am Kopf. */
.kopf-recht {
  display: flex;
  gap: 14px;
  margin-top: 4px;
  pointer-events: auto;
}

.kopf-recht a {
  padding: 4px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--schiefer);
  text-decoration: none;
}

.kopf-recht a:hover,
.kopf-recht a:focus-visible {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Raum-Labels: weiße Pillen wie in der Vorlage */

.raum-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--kreide);
  box-shadow: var(--schatten);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  transition: box-shadow 0.25s var(--weich), background-color 0.25s var(--weich), opacity 0.3s ease, visibility 0.3s;
}

.raum-label .icon {
  width: 21px;
  height: 21px;
}

.raum-label:hover,
.raum-label.ist-hover {
  background: #ffffff;
  box-shadow: 0 0 0 2px var(--haupt), var(--schatten);
}

.raum-label.ist-verdeckt {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Figuren: Sprechblase und Namensschild */

.figur {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.blase {
  position: relative;
  display: none;
  max-width: 190px;
  margin: 0 0 4px;
  padding: 7px 11px;
  border-radius: 12px;
  background: var(--kreide);
  box-shadow: var(--schatten);
  font-size: 12.5px;
  font-weight: 560;
  line-height: 1.3;
  text-align: center;
}

.blase::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: var(--kreide);
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
}

.figur.mit-blase .blase {
  display: block;
  animation: blase-auf 0.42s var(--weich);
}

.figur.ist-fern .blase {
  max-width: 168px;
  padding: 5px 9px;
  font-size: 11px;
}

@keyframes blase-auf {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.92);
  }
}

.namensschild {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--schatten);
  font-size: 12px;
  font-weight: 620;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
}

.namenspunkt {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--figur-farbe);
}

.figur.mit-name .namensschild,
.figur.ist-hover .namensschild,
.figur.ist-gewaehlt .namensschild {
  display: inline-flex;
}

.figur.ist-gewaehlt .namensschild {
  background: var(--haupt);
  color: #fff;
}

.figur.ist-gewaehlt .namenspunkt {
  box-shadow: 0 0 0 2px #fff;
}

/* Leiste unten */

.leiste {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 6px;
  border-radius: 999px;
  background: var(--kreide);
  box-shadow: var(--schatten-gross);
}

.leiste-liste {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: 999px;
}

.leiste-liste::-webkit-scrollbar {
  display: none;
}

.leiste-knopf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 9px 15px 9px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 560;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.leiste-knopf .icon {
  width: 18px;
  height: 18px;
  color: var(--schiefer);
  transition: color 0.2s ease;
}

.leiste-knopf:hover {
  background: var(--sand);
}

.leiste-knopf.ist-aktiv {
  background: var(--haupt);
  color: #fff;
}

.leiste-knopf.ist-aktiv .icon {
  color: #fff;
}

.leiste-trenner {
  flex: none;
  width: 1px;
  height: 22px;
  margin: 0 6px;
  background: var(--linie);
}

/* Seitenleiste */

.seitenleiste {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 92px;
  width: min(390px, calc(100vw - 36px));
  border-radius: 26px;
  background: var(--kreide);
  box-shadow: var(--schatten-gross);
  transform: translateX(calc(100% + 40px));
  transition: transform 0.5s var(--weich);
  overflow: hidden;
}

.seitenleiste.ist-offen {
  transform: none;
}

.sl-inhalt {
  position: relative;
  height: 100%;
  padding: 30px 28px 32px;
  overflow-y: auto;
}

.sl-schliessen {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--sand);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sl-schliessen:hover {
  background: #dfe5ef;
}

.sl-schliessen .icon {
  width: 16px;
  height: 16px;
}

.sl-kopf {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 44px;
}

.sl-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--haupt-zart);
  color: var(--haupt);
}

.sl-icon .icon {
  width: 24px;
  height: 24px;
}

.sl-kopf h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 680;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.sl-text {
  margin: 18px 0 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: #3a4152;
}

.sl-inhalt h3 {
  margin: 28px 0 10px;
  font-size: 14px;
  font-weight: 650;
  color: var(--schiefer);
}

.sl-personen,
.sl-aufgaben {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sl-person {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sl-person:hover {
  background: var(--sand);
}

.sl-person-text {
  display: grid;
  gap: 2px;
}

.sl-person-text strong {
  font-size: 15px;
  font-weight: 640;
}

.sl-person-text span {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--schiefer);
}

.sl-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--figur-farbe);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.sl-avatar.ist-gross {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.sl-aufgaben li {
  position: relative;
  padding: 9px 0 9px 22px;
  border-top: 1px solid var(--linie);
  font-size: 15px;
  line-height: 1.45;
}

.sl-aufgaben li:first-child {
  border-top: 0;
}

.sl-aufgaben li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--haupt);
}

.sl-gerade {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 16px 0 0;
  padding: 7px 13px 7px 11px;
  border-radius: 999px;
  background: var(--haupt-zart);
  color: #1a3a8a;
  font-size: 13.5px;
  font-weight: 600;
}

.sl-puls {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--haupt);
}

.sl-puls::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--haupt);
  opacity: 0;
  animation: puls 2.2s ease-out infinite;
}

@keyframes puls {
  0% {
    opacity: 0.6;
    transform: scale(0.5);
  }
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

.sl-raum {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 8px 14px 8px 11px;
  border: 1px solid var(--linie);
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 560;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sl-raum:hover {
  background: var(--sand);
}

.sl-raum .icon {
  width: 17px;
  height: 17px;
  color: var(--haupt);
}

/* Bedienhinweis, Ladeschirm, Fehler */

.bedienhinweis {
  position: fixed;
  top: 30px;
  right: 30px;
  display: flex;
  gap: 18px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--schiefer);
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.bedienhinweis.ist-weg,
.mit-seitenleiste .bedienhinweis {
  opacity: 0;
}

.ladeschirm {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: radial-gradient(120% 90% at 50% 42%, #f6f8fb 0%, #e4e9f1 52%, #ced6e2 100%);
  transition: opacity 0.9s ease, visibility 0.9s;
}

.ladeschirm p {
  margin: 0;
  font-size: 15px;
  font-weight: 560;
  color: var(--schiefer);
}

.ladeschirm.ist-fertig {
  opacity: 0;
  visibility: hidden;
}

.lade-ring {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(35, 76, 175, 0.2);
  border-top-color: var(--haupt);
  animation: drehen 0.9s linear infinite;
}

@keyframes drehen {
  to {
    transform: rotate(360deg);
  }
}

.fehlerhinweis {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.fehlerhinweis[hidden] {
  display: none;
}

.fehler-karte {
  max-width: 460px;
  padding: 28px 30px;
  border-radius: 22px;
  background: var(--kreide);
  box-shadow: var(--schatten-gross);
}

.fehler-karte h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.fehler-karte p {
  margin: 0;
  line-height: 1.55;
  color: #3a4152;
}

/* Die Raumnamen liegen als Schrift am Boden, die Pillen erscheinen nur beim Hover.
   Optionale Gestaltungen A und C (?variante=a / c) ändern den Hintergrund. */

.raum-label:not(.ist-hover) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.variante-a,
.variante-a .ladeschirm {
  background: radial-gradient(120% 90% at 50% 42%, #f7f6f3 0%, #e8e6e2 52%, #d4d1cb 100%);
}

.variante-c,
.variante-c .ladeschirm {
  background: radial-gradient(120% 90% at 50% 42%, #6d655d 0%, #4a443f 52%, #2b2825 100%);
}

.variante-c .kopf h1 {
  color: #f6efe6;
}

.variante-c .kopf p,
.variante-c .bedienhinweis,
.variante-c .ladeschirm p {
  color: #d3c8bb;
}

/* Schmale Bildschirme: Seitenleiste als Blatt von unten */

@media (max-width: 760px) {
  .kopf {
    top: 16px;
    left: 18px;
  }

  .kopf h1 {
    font-size: 23px;
  }

  .kopf p {
    font-size: 13.5px;
  }

  .bedienhinweis {
    display: none;
  }

  .raum-label {
    gap: 7px;
    padding: 7px 13px 7px 11px;
    font-size: 13px;
  }

  .raum-label .icon {
    width: 16px;
    height: 16px;
  }

  .leiste {
    bottom: 12px;
  }

  .seitenleiste {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 80px;
    width: auto;
    max-height: 58vh;
    transform: translateY(calc(100% + 100px));
  }

  .sl-inhalt {
    height: auto;
    max-height: 58vh;
    padding: 24px 20px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .seitenleiste,
  .raum-label,
  .ladeschirm,
  .bedienhinweis {
    transition: none;
  }

  .figur.mit-blase .blase,
  .sl-puls::after {
    animation: none;
  }

  .lade-ring {
    animation-duration: 3s;
  }
}
