:root {
  --cream: #fffaf0;
  --paper: #fffef9;
  --paper-warm: rgba(255, 252, 244, 0.94);
  --sand: #e8d6b9;
  --blue-soft: #e7f5f6;
  --blue: #9fd0d8;
  --green-soft: #dcebd4;
  --ink: #3f352f;
  --muted: #766a60;
  --line: rgba(102, 78, 53, 0.18);
  --line-soft: rgba(102, 78, 53, 0.1);
  --shadow: 0 18px 38px rgba(80, 62, 40, 0.13);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Andika", "Nunito", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,250,240,0.56)),
    url("assets/tueftelhausen-panorama.png") center center / cover fixed no-repeat,
    var(--cream);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 10%, rgba(255,255,255,0.38), transparent 30%),
    radial-gradient(circle at 86% 16%, rgba(255,255,255,0.34), transparent 28%);
}

button,
input { font: inherit; }

/* ==========================================================================
   BROWSERHÖHE / MONITORHÖHE
   --------------------------------------------------------------------------
   Dieser Block sorgt dafür, dass der Browserrahmen immer bis zum unteren
   Rand des sichtbaren Monitorfensters reicht.

   WICHTIG FÜR SPÄTERE ÄNDERUNGEN:
   - Der obere Abstand wird über padding-top gesteuert.
   - Unten gibt es bewusst kein padding, damit kein freier Streifen entsteht.
   - .browser-stage ist ein Flex-Container.
   - .browser-head behält seine natürliche Höhe.
   - .browser-card erhält mit flex: 1 automatisch den gesamten verbleibenden
     Platz bis zum unteren Fensterrand.

   Wenn später wieder ein Abstand unter dem Browser auftaucht, zuerst hier
   nach padding-bottom, margin-bottom oder einer festen Kartenhöhe suchen.
   ========================================================================== */
.browser-stage {
  width: min(1360px, calc(100% - 44px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 0;
  display: flex;
  flex-direction: column;
}


.browser-head {
  position: relative;
  min-height: 248px;
  margin-bottom: 16px;
  border: 1px solid rgba(102, 78, 53, 0.16);
  border-radius: 34px 42px 32px 40px;
  /* Wichtig: Das Tüftelhausen-Dropdown liegt im Kopfbereich und muss über
     den Browserkopf hinausragen dürfen. Die Rundung der Kopf-Grafik wird
     deshalb am Bild selbst erzeugt, nicht durch overflow:hidden am Header. */
  overflow: visible;
  background: var(--paper-warm);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.78);
  z-index: 20;
}

.browser-head::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.08) 42%, rgba(255,255,255,0.18)),
    linear-gradient(180deg, transparent 62%, rgba(255,255,255,0.72));
}

.browser-head-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  border-radius: inherit;
}

.top-nav {
  position: absolute;
  z-index: 8;
  top: 18px;
  right: 22px;
  display: flex;
  justify-content: flex-end;
}

.tueftel-dropdown { position: relative; }

.tueftel-menu-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(105, 80, 54, 0.24);
  border-radius: 999px;
  background: rgba(255, 254, 249, 0.9);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(90, 65, 40, 0.09);
  cursor: pointer;
}

.tueftel-menu-list {
  position: absolute;
  z-index: 1000;
  top: 48px;
  right: 0;
  min-width: 340px;
  max-width: min(92vw, 420px);
  max-height: min(70vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 254, 249, 0.98);
  box-shadow: 0 16px 30px rgba(90, 65, 40, 0.16);
}

.tueftel-menu-list a {
  display: block;
  padding: 10px 12px;
  white-space: nowrap;
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
}

.tueftel-menu-list a:hover,
.tueftel-menu-list a:focus {
  background: var(--blue-soft);
  outline: none;
}

.browser-title-block {
  position: absolute;
  z-index: 4;
  left: 31%;
  top: 55px;
  width: min(520px, 44vw);
  padding: 15px 20px 16px;
  border-radius: 26px 32px 25px 30px;
  background: rgba(255, 254, 249, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.62), 0 9px 20px rgba(90, 65, 40, 0.08);
}

.browser-title-block h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.browser-title-block p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.35;
}

/* Der Browserkörper füllt den restlichen Platz unter dem Browserkopf.
   min-height: 0 ist hier absichtlich gesetzt: Ohne diese Angabe können
   verschachtelte Flex-/Grid-Bereiche den Browser künstlich höher machen. */
.browser-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px 28px 34px 31px;
  background: rgba(255, 254, 249, 0.95);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.72);
}

.browser-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(320px, 1fr) minmax(260px, 0.65fr);
  gap: 11px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(ellipse at 14% 34%, rgba(231, 245, 246, 0.55), transparent 36%),
    linear-gradient(90deg, rgba(255, 250, 240, 0.97), rgba(251, 243, 231, 0.88));
}

.tool-button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(105, 80, 54, 0.23);
  border-radius: 999px;
  background: linear-gradient(180deg, #fffef9, #f7ead8);
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(88, 70, 51, 0.06);
  cursor: pointer;
  white-space: nowrap;
}

.tool-button:hover,
.tool-button:focus {
  outline: none;
  background: linear-gradient(180deg, #ffffff, #eef8f8);
}

.home-button { width: 46px; padding: 0; }

.address-group,
.search-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 4px 5px 4px 12px;
  border: 1px solid rgba(105, 80, 54, 0.18);
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 1px 4px rgba(90, 65, 40, 0.06);
}

.lock-symbol,
.search-symbol { font-size: 1.05rem; }

.address-input,
.search-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: #fff;
  color: var(--ink);
}

.address-input::selection,
.search-input::selection { background: var(--blue-soft); }

.browser-content {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 470px;
  padding: 34px;
  background: rgba(255, 254, 249, 0.88);
}

.content-placeholder,
.suitcase-view {
  width: min(720px, 100%);
  padding: 42px;
  text-align: center;
  border: 1px solid var(--line-soft);
  border-radius: 34px 30px 36px 32px;
  background: rgba(255,255,255,0.88);
  box-shadow: 0 14px 28px rgba(90, 65, 40, 0.08);
}

.placeholder-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.content-placeholder h2,
.suitcase-view h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.3vw, 2rem);
  line-height: 1.2;
}

.suitcase-view p {
  margin: 14px 0 24px;
  color: var(--muted);
  line-height: 1.45;
}

.suitcase-view-symbol {
  margin-bottom: 8px;
  font-size: 3.2rem;
}

.code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
}

.code-row label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.94rem;
}

.code-row input {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(105, 80, 54, 0.2);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


@media (max-width: 980px) {
  .browser-stage { width: min(100% - 24px, 900px); }
  .browser-head { min-height: 220px; }
  .browser-title-block {
    left: 26%;
    top: 70px;
    width: min(520px, 58vw);
  }
  .browser-toolbar {
    grid-template-columns: auto auto 1fr;
  }
  .search-group {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .browser-head { min-height: 200px; }
  .browser-title-block {
    left: 18px;
    right: 18px;
    top: 72px;
    width: auto;
  }
  .top-nav { left: 18px; right: auto; }
  .browser-toolbar {
    grid-template-columns: 1fr 48px;
  }
  .address-group,
  .search-group { grid-column: 1 / -1; }
  .code-row { grid-template-columns: 1fr; }
}

.fullscreen-hint[hidden] { display: none; }

.fullscreen-hint {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(42, 52, 45, 0.28);
  backdrop-filter: blur(4px);
}

.fullscreen-card {
  width: min(520px, 100%);
  padding: 30px 32px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(255, 254, 249, 0.97);
  box-shadow: 0 24px 55px rgba(46, 37, 27, 0.22);
  text-align: center;
}

.fullscreen-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.94rem;
}

.fullscreen-card h2 {
  margin: 0 0 12px;
  font-size: 1.8rem;
}

.primary-button {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid rgba(105, 80, 54, 0.23);
  border-radius: 999px;
  background: linear-gradient(180deg, #fffef9, #e7f5f6);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(90, 65, 40, 0.10);
}

.web-page {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 46px);
  border: 1px solid var(--line-soft);
  border-radius: 34px 30px 36px 32px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 14px 28px rgba(90, 65, 40, 0.08);
}

.web-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

.web-page h2 {
  margin: 0 0 16px;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.1;
}

.web-page p {
  font-size: 1.08rem;
  line-height: 1.55;
}

.web-page code {
  padding: 0.08em 0.35em;
  border-radius: 8px;
  background: var(--blue-soft);
}

.info-box,
.task-box,
.news-card {
  margin: 20px 0;
  padding: 18px 20px;
  border-radius: 22px 24px 20px 23px;
  border: 1px solid var(--line-soft);
  background: rgba(245, 251, 250, 0.88);
}

.task-box {
  background: rgba(255, 248, 229, 0.84);
}

.news-card {
  text-align: left;
  background: rgba(255, 255, 255, 0.9);
}

.task-box h3,
.news-card h3 {
  margin: 0 0 8px;
}

.link-row {
  margin-top: 22px;
}

.text-link {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--blue-soft);
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
}

.text-link:hover,
.text-link:focus {
  outline: 2px solid rgba(159, 208, 216, 0.45);
  background: #fff;
}

.browser-message,
.search-results {
  width: min(760px, 100%);
  padding: 34px;
  border-radius: 30px;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.9);
  box-shadow: 0 14px 28px rgba(90, 65, 40, 0.08);
}

.browser-message h2,
.search-results h2 {
  margin-top: 0;
}

.result-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.result-button {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.94);
  color: var(--ink);
  cursor: pointer;
}

.result-button strong { display: block; }
.result-button span { color: var(--muted); }

.suitcase-view-symbol {
  font-size: 3rem;
  margin-bottom: 8px;
}

.suitcase-view p {
  line-height: 1.55;
}

.code-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}

.code-row input {
  min-height: 42px;
  width: min(220px, 100%);
  padding: 0 14px;
  border: 1px solid rgba(105, 80, 54, 0.2);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
}

.code-hint {
  width: 100%;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

@media (max-width: 960px) {
  .browser-stage {
    width: min(100% - 24px, 1360px);
    padding-top: 12px;
  }

  .browser-head {
    min-height: 210px;
  }

  .browser-title-block {
    left: 28%;
    top: 64px;
    width: min(520px, 56vw);
  }

  .browser-toolbar {
    grid-template-columns: auto auto 1fr;
  }

  .search-group {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .browser-head {
    min-height: 190px;
  }

  .browser-title-block {
    left: 16px;
    right: 16px;
    top: 78px;
    width: auto;
  }

  .top-nav {
    top: 12px;
    right: 12px;
  }

  .browser-toolbar {
    grid-template-columns: 1fr 46px;
  }

  .address-group,
  .search-group {
    grid-column: 1 / -1;
  }

  .browser-content {
    padding: 18px;
  }
}


/* ------------------------------------------------------------
   Schildi-Leiste – Integrationsstand
   Nur die bestätigte Oberfläche wird in den funktionierenden Browser
   übernommen. Frag Schildi und ausfahrende Textkarten folgen separat.
   ------------------------------------------------------------ */
/* Der Arbeitsbereich übernimmt die verbleibende Höhe innerhalb der Karte.
   Die frühere feste Mindesthöhe von 470 px wurde entfernt, damit der Bereich
   exakt bis zum unteren Fensterrand wachsen kann. */
.browser-workspace {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  min-height: 0;
  background: rgba(255, 254, 249, 0.88);
}

.schildi-sidebar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 34px 16px 24px;
  border-right: 1px solid var(--line-soft);
  background:
    radial-gradient(circle at 50% 14%, rgba(231, 245, 246, 0.82), transparent 38%),
    linear-gradient(180deg, rgba(255, 252, 244, 0.95), rgba(246, 239, 247, 0.88));
}

.schildi-sidebar-card {
  width: 100%;
  min-height: 250px;
  padding: 18px 12px 22px;
  text-align: center;
  border: 1px solid rgba(117, 92, 77, 0.13);
  border-radius: 30px 26px 32px 28px;
  background: rgba(255, 254, 249, 0.78);
  box-shadow: 0 12px 26px rgba(90, 65, 40, 0.08), inset 0 0 0 1px rgba(255,255,255,0.66);
}

.schildi-sidebar-avatar {
  display: block;
  width: 94px;
  height: 94px;
  margin: 0 auto 12px;
  object-fit: contain;
  filter: drop-shadow(0 7px 10px rgba(81, 64, 47, 0.12));
}

.schildi-sidebar-title {
  display: grid;
  gap: 1px;
}

.schildi-sidebar-title strong {
  font-size: 1.14rem;
  line-height: 1.2;
}

.schildi-sidebar-title span {
  color: var(--muted);
  font-size: 0.88rem;
}

.schildi-speech-button {
  position: relative;
  width: calc(100% - 6px);
  min-height: 58px;
  margin: 22px 3px 0;
  padding: 10px 12px;
  border: 1px solid rgba(120, 93, 121, 0.20);
  border-radius: 24px 25px 23px 26px;
  background: rgba(242, 233, 245, 0.84);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 5px 12px rgba(90, 65, 40, 0.06);
  cursor: default;
}

.schildi-speech-button::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 50%;
  width: 24px;
  height: 20px;
  transform: translateX(-50%) rotate(45deg);
  border-top: 1px solid rgba(120, 93, 121, 0.20);
  border-left: 1px solid rgba(120, 93, 121, 0.20);
  background: rgba(242, 233, 245, 0.96);
  border-radius: 6px 0 0 0;
}

.browser-workspace > .browser-content {
  min-width: 0;
  background: transparent;
}

@media (max-width: 1080px) {
  .browser-workspace { grid-template-columns: 154px minmax(0, 1fr); }
  .schildi-sidebar { padding-inline: 10px; }
  .schildi-sidebar-card { padding-inline: 8px; }
  .schildi-sidebar-avatar { width: 82px; height: 82px; }
}

@media (max-width: 760px) {
  .browser-workspace { grid-template-columns: 128px minmax(0, 1fr); }
  .schildi-sidebar { padding: 22px 7px 16px; }
  .schildi-sidebar-card { min-height: 220px; border-radius: 24px 21px 26px 23px; }
  .schildi-sidebar-avatar { width: 70px; height: 70px; }
  .schildi-sidebar-title strong { font-size: 1rem; }
  .schildi-sidebar-title span { font-size: 0.76rem; }
  .schildi-speech-button { min-height: 52px; margin-inline: 0; padding-inline: 6px; font-size: 0.83rem; }
}


/* Echte Tüftelhausen-Inhaltsseiten */
/* Inhaltsfläche und iframe nutzen die komplette Höhe des Arbeitsbereichs.
   Die Inhaltsseiten selbst dürfen bei Bedarf innerhalb des iframe scrollen;
   der äußere Browserrahmen bleibt dabei bis unten geschlossen. */
.browser-workspace > .browser-content{
  display:block;
  padding:0;
  overflow:hidden;
  min-height:0;
  height:100%;
}
.site-frame{
  display:block;
  width:100%;
  height:100%;
  min-height:0;
  border:0;
  background:#fdfcf8;
}
.browser-message,.search-results,.content-placeholder{
  box-sizing:border-box;
  width:min(760px,calc(100% - 44px));
  margin:28px auto;
}


/* HTTPS-Anzeige in der Adressleiste */
.security-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: #5e6f62;
  font-weight: 700;
  white-space: nowrap;
}
.security-indicator.is-insecure {
  color: #a24b42;
}
.security-icon { font-size: 1rem; }
.protocol-prefix { letter-spacing: .01em; }
.address-input { padding-left: 2px; }

/* Frag Schildi – Browser-Overlay */
.schildi-speech-button { cursor: pointer; }
.schildi-speech-button:hover,
.schildi-speech-button:focus-visible {
  outline: none;
  background: rgba(235, 220, 241, 0.98);
  box-shadow: 0 8px 16px rgba(90, 65, 40, 0.10);
  transform: translateY(-1px);
}
.schildi-chat-overlay[hidden] { display: none; }
.schildi-chat-overlay {
  position: fixed;
  z-index: 5000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(54, 47, 43, 0.48);
  backdrop-filter: blur(3px);
}
.schildi-chat-window {
  width: min(1120px, calc(100vw - 44px));
  height: min(760px, calc(100vh - 44px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(102, 78, 53, 0.22);
  border-radius: 30px;
  background: #fffef9;
  box-shadow: 0 28px 70px rgba(45, 37, 32, 0.28);
}
.schildi-chat-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px 14px 24px;
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(circle at 8% 22%, rgba(231, 245, 246, .72), transparent 30%),
    linear-gradient(90deg, #fffaf0, #f4edf7);
}
.schildi-chat-kicker {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 700;
}
.schildi-chat-toolbar h2 {
  margin: 0;
  font-size: 1.45rem;
}
.schildi-chat-close {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(105, 80, 54, .22);
  border-radius: 999px;
  background: #fffef9;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.schildi-chat-close:hover,
.schildi-chat-close:focus-visible {
  outline: none;
  background: var(--blue-soft);
}
.schildi-chat-close span {
  margin-left: 6px;
  font-size: 1.35rem;
  line-height: 1;
}
.schildi-chat-body {
  flex: 1 1 auto;
  min-height: 0;
  background: #edf7f6;
}
.schildi-chat-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #edf7f6;
}
body.schildi-chat-open { overflow: hidden; }

@media (max-width: 760px) {
  .security-indicator { gap: 2px; }
  .protocol-prefix { font-size: .84rem; }
  .schildi-chat-overlay { padding: 8px; }
  .schildi-chat-window {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    border-radius: 22px;
  }
  .schildi-chat-toolbar { padding: 10px 10px 10px 16px; }
  .schildi-chat-kicker { display: none; }
  .schildi-chat-toolbar h2 { font-size: 1.15rem; }
  .schildi-chat-close { min-height: 38px; padding-inline: 11px; font-size: .82rem; }
}

/* Schildis ausfahrende Tippkarten */
.schildi-tip-replay {
  width: calc(100% - 12px);
  min-height: 42px;
  margin: 12px 6px 0;
  padding: 8px 10px;
  border: 1px solid rgba(100, 132, 121, 0.22);
  border-radius: 18px;
  background: rgba(226, 240, 232, 0.88);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.schildi-tip-replay:hover,
.schildi-tip-replay:focus-visible { background: rgba(214, 234, 222, 0.98); }
.schildi-tip-replay[hidden] { display: none; }

.browser-workspace { position: relative; }
.schildi-tip-panel[hidden] { display: none; }
.schildi-tip-panel {
  position: absolute;
  z-index: 15;
  left: 126px;
  top: 24px;
  width: min(590px, calc(100% - 156px));
  min-height: 238px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: end;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-48px);
  transition: transform 260ms ease, opacity 220ms ease;
}
.schildi-tip-panel.is-open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.schildi-tip-figure {
  height: 230px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  filter: drop-shadow(0 12px 18px rgba(73, 55, 42, .14));
}
.schildi-tip-figure img {
  width: 185px;
  max-width: none;
  transform: translateY(0);
}
.schildi-tip-card {
  position: relative;
  min-height: 210px;
  margin-left: -14px;
  padding: 26px 28px 22px 32px;
  border: 1px solid rgba(113, 90, 71, .18);
  border-radius: 32px 28px 34px 29px;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,.72), transparent 34%),
    linear-gradient(180deg, rgba(255,254,249,.90), rgba(248,241,249,.88));
  box-shadow: 0 18px 34px rgba(81, 61, 44, .16), inset 0 0 0 1px rgba(255,255,255,.76);
}
.schildi-tip-card::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 48px;
  width: 34px;
  height: 34px;
  background: rgba(253, 249, 250, .98);
  border-left: 1px solid rgba(113, 90, 71, .15);
  border-bottom: 1px solid rgba(113, 90, 71, .15);
  transform: rotate(45deg);
  border-radius: 0 0 0 8px;
}
.schildi-tip-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.64);
  color: var(--muted);
  font-size: 1.35rem;
  cursor: pointer;
}
.schildi-tip-title {
  margin: 0 42px 10px 0;
  font-size: 1.28rem;
  font-weight: 800;
}
.schildi-tip-text {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.55;
}

.schildi-tip-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.schildi-tip-choices[hidden] { display: none; }

.schildi-tip-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}
.schildi-tip-next { min-width: 118px; }

@media (max-width: 900px) {
  .schildi-tip-panel {
    left: 92px;
    width: calc(100% - 112px);
    grid-template-columns: 118px minmax(0, 1fr);
  }
  .schildi-tip-figure { height: 205px; }
  .schildi-tip-figure img { width: 150px; }
  .schildi-tip-card { padding: 22px 22px 18px 26px; }
}

/*
===============================================================================
SCHILDI-TIPP – RUHIGERE DARSTELLUNG / AVATAR WECHSELT IN DIE KARTE
===============================================================================

Ziel dieser Gestaltung:
- Im Ruhezustand ist Schildis runder Kopf in der linken Leiste sichtbar.
- Sobald ein Tipp geöffnet wird, verschwindet dieser Kopf aus der Leiste.
- An seiner Stelle erscheinen nur drei kleine Punkte.
- Derselbe Kopf erscheint klein an der ausgefahrenen Tippkarte.

Dadurch ist Schildi während eines Tipps nicht mehrfach gleichzeitig zu sehen.
Die Browserkopf-Illustration bleibt davon unberührt.

Wichtige Suchbegriffe für spätere Anpassungen:
- SCHILDI-AVATAR-BUEHNE
- DREI PUNKTE
- KOPF AUF DER TIPP-KARTE
===============================================================================
*/

/* SCHILDI-AVATAR-BUEHNE: reserviert immer denselben Platz in der Seitenleiste. */
.schildi-avatar-stage {
  position: relative;
  min-height: 94px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

/* Der bisherige Avatar-Abstand wird nun von .schildi-avatar-stage übernommen. */
.schildi-avatar-stage .schildi-sidebar-avatar {
  margin: 0;
  transition: opacity 150ms ease, transform 180ms ease;
}

/* DREI PUNKTE: erscheinen nur, während die Tippkarte offen ist. */
.schildi-busy-dots {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.schildi-busy-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(105, 89, 109, 0.64);
}

/* Diese Klasse setzt schildi-tipps.js auf die Seitenleiste, solange ein Tipp offen ist. */
.schildi-sidebar.is-tip-open .schildi-sidebar-avatar {
  opacity: 0;
  transform: translateX(10px) scale(0.92);
}

.schildi-sidebar.is-tip-open .schildi-busy-dots {
  opacity: 1;
}

/* KOPF AUF DER TIPP-KARTE: bewusst klein, damit der Text die Hauptrolle behält. */
.schildi-tip-panel {
  grid-template-columns: 84px minmax(0, 1fr);
  min-height: 214px;
}

.schildi-tip-figure {
  height: 118px;
  align-self: start;
  margin-top: 30px;
  overflow: visible;
  align-items: center;
}

.schildi-tip-figure img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  transform: none;
  filter: drop-shadow(0 8px 12px rgba(73, 55, 42, .13));
}

.schildi-tip-card {
  margin-left: -5px;
}

@media (max-width: 900px) {
  .schildi-tip-panel {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .schildi-tip-figure {
    height: 98px;
    margin-top: 26px;
  }

  .schildi-tip-figure img {
    width: 68px;
    height: 68px;
  }
}

/* =============================================================================
   ERMITTLUNGS-OVERLAY
   Eigenständiges System; keine Selektoren des Frag-Schildi-Overlays werden
   wiederverwendet. So können beide Module nebeneinander bestehen.
   ============================================================================= */
.investigation-overlay[hidden] { display: none !important; }

.investigation-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2vw, 28px);
  background: rgba(34, 45, 52, .68);
  backdrop-filter: blur(3px);
}

body.investigation-overlay-open { overflow: hidden; }

.investigation-scene {
  position: relative;
  width: min(1180px, 96vw);
  height: min(760px, 92vh);
  min-height: 560px;
  overflow: hidden;
  border: 7px solid rgba(255,255,255,.92);
  border-radius: 30px;
  background: #efe4d3;
  box-shadow: 0 26px 70px rgba(18, 30, 38, .42);
  isolation: isolate;
}

.investigation-board {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(to bottom, rgba(255,255,255,.06), rgba(33,24,17,.12)),
    url('../seiten/assets/bilder/wand-hinweise.jpg') center / cover no-repeat;
}

.investigation-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(252,248,239,.20), transparent 35%, transparent 70%, rgba(252,248,239,.18));
}

.investigation-close {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 8;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(74,55,43,.3);
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  color: #45382e;
  font: 700 2rem/1 Andika, sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.investigation-character {
  position: absolute;
  z-index: 2;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 10px 12px rgba(45,35,27,.22));
}

.investigation-pixeli {
  left: 1.5%;
  bottom: -2%;
  width: min(25%, 280px);
  max-height: 61%;
}

.investigation-schildi {
  right: 20%;
  bottom: -4%;
  width: min(25%, 275px);
  max-height: 58%;
}

.investigation-walter {
  right: 1%;
  bottom: -3%;
  width: min(25%, 285px);
  max-height: 61%;
}

.investigation-text-card {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 5.5%;
  width: min(610px, 58%);
  transform: translateX(-50%);
  padding: clamp(18px, 2.3vw, 30px);
  border: 1px solid rgba(111,87,65,.25);
  border-radius: 24px;
  background: rgba(255, 253, 247, .96);
  box-shadow: 0 14px 34px rgba(55,42,31,.23);
  color: #3f372f;
}

.investigation-kicker {
  margin: 0 0 3px;
  color: #4a7280;
  font-weight: 700;
  letter-spacing: .02em;
}

.investigation-text-card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
}

.investigation-narrator {
  margin: 0 0 14px;
  font-size: clamp(1rem, 1.45vw, 1.18rem);
  line-height: 1.55;
}

.investigation-conclusion {
  padding: 12px 16px;
  border-left: 6px solid #83aab4;
  border-radius: 10px;
  background: #edf5f6;
}

.investigation-conclusion strong { color: #365e69; }
.investigation-conclusion p { margin: 3px 0 0; font-size: clamp(1.08rem, 1.7vw, 1.3rem); font-weight: 700; }

.investigation-instruction {
  display: grid;
  gap: 2px;
  margin-top: 14px;
  padding: 11px 15px;
  border-radius: 12px;
  background: #f6ead4;
  line-height: 1.4;
}

.investigation-instruction strong { color: #6d4d31; font-size: 1.08rem; }

@media (max-width: 820px), (max-height: 650px) {
  .investigation-scene { min-height: 0; height: 94vh; }
  .investigation-text-card { top: 4%; width: 78%; padding: 16px; }
  .investigation-pixeli { width: 25%; }
  .investigation-schildi { right: 19%; width: 25%; }
  .investigation-walter { width: 25%; }
}
