/*
 * Gehirn-Reiter (Owner 2026-09-19). Nur was dieser eine Reiter braucht - das
 * Deck bringt Karten, Schrift und Farben schon mit (lwr3d.css, deck-dark.css).
 */
/* Das Deck kippt seine Szene in 3D mit der Maus (rotateX/rotateY in
   lwr3d.css). Auf der Gehirn-Buehne verschiebt das die Leinwand gegen den
   Zeiger - genau der Versatz, den der Owner gemeldet hat: das Bild wandert,
   waehrend die Trefferpruefung auf einer flachen Ebene rechnet. Hier liegt die
   Szene deshalb flach; gedreht wird das Gehirn selbst. */
.l3d-scene:has(.brain-page) {
  transform: none !important;
  transition: none;
}

/* .l3d-page zentriert seine Kinder in einer Reihe - hier ist es eine Spalte
   ueber die volle Breite, sonst faellt die Buehne auf Inhaltsbreite zusammen. */
.brain-page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  /* Seit dem Verlauf (2026-10-06) ist die Seite laenger als der Schirm: sie
     scrollt selbst, der untere Seitenabstand haelt die Nav frei. */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.5) transparent;
}

.brain-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.brain-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e9d5ff;
}
.brain-head .brain-sub {
  font-size: 11.5px;
  color: rgba(196, 181, 253, 0.72);
}

.brain-stage {
  position: relative;
  width: 100%;
  /* Feste Hoehe statt "fuellt den Rest": darunter stehen Kennzahlen und der
     Verlauf, die auf dem ersten Schirm anfangen sollen. */
  flex: 0 0 auto;
  height: min(46vh, 600px);
  min-height: 300px;
  border-radius: 16px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  /* Dunkler Raum mit einem Lichtkegel von oben - das Gitter soll leuchten,
     nicht auf einer Flaeche liegen. */
  background:
    radial-gradient(60% 50% at 50% 42%, rgba(56, 189, 248, 0.1), rgba(0, 0, 0, 0) 70%),
    radial-gradient(120% 95% at 50% 6%, rgba(76, 29, 149, 0.3), rgba(4, 2, 10, 0.94) 66%);
  overflow: hidden;
}
/* canvas ist ein ersetztes Element: `inset:0` allein streckt es NICHT, dann
   gilt die Attributgroesse. Ohne width/height bleibt die Buehne leer. */
.brain-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.brain-hint {
  position: absolute;
  left: 14px;
  bottom: 11px;
  z-index: 3;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: rgba(196, 181, 253, 0.42);
  pointer-events: none;
}

.brain-tip {
  position: absolute;
  z-index: 5;
  display: none;
  max-width: 330px;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1px solid rgba(167, 139, 250, 0.4);
  background: rgba(14, 9, 28, 0.96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  line-height: 1.45;
}
.brain-tip b {
  display: block;
  font-size: 12.5px;
  margin-bottom: 2px;
}
.brain-tip i {
  display: block;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, 0.6);
  margin-bottom: 5px;
}
.brain-tip span {
  font-size: 11.5px;
  color: rgba(237, 233, 254, 0.86);
}

.brain-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brain-controls .brain-stamp {
  font-size: 11.5px;
  color: rgba(196, 181, 253, 0.8);
  min-width: 190px;
  font-variant-numeric: tabular-nums;
}
.brain-slider {
  flex: 1 1 240px;
  accent-color: #a78bfa;
  height: 4px;
}
.brain-play {
  border: 1px solid rgba(167, 139, 250, 0.45);
  background: rgba(124, 58, 237, 0.2);
  color: #ede9fe;
  border-radius: 9px;
  padding: 5px 13px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.brain-play:hover {
  background: rgba(124, 58, 237, 0.34);
}

.brain-legend {
  display: flex;
  gap: 8px 16px;
  flex-wrap: wrap;
  font-size: 11px;
  color: rgba(226, 216, 255, 0.82);
}
.brain-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.brain-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 9px currentColor;
}
.brain-legend b {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.brain-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.brain-fact {
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 12px;
  padding: 8px 11px;
  background: rgba(23, 14, 46, 0.5);
}
.brain-fact b {
  display: block;
  font-size: 17px;
  color: #f5f3ff;
  font-variant-numeric: tabular-nums;
}
.brain-fact span {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, 0.66);
}

/* Lernen (2026-10-06): das Vorhersage-Buch - Trefferquote je Horizont,
   Lernkurve, Stand des Lernmodells, beste und schlechteste Coins. Dieselben
   Bausteine wie Kennzahlen und Verlauf, dazu der Neon-Lichtsaum des Decks
   (inset 0 1px 0 lavendel, siehe deck-dark.css --dk-shadow). */
.brain-learn {
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 14px;
  background: rgba(23, 14, 46, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(216, 180, 254, 0.22),
    0 0 28px rgba(124, 58, 237, 0.08);
  padding: 10px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.brain-learn-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.brain-learn-head h3 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e9d5ff;
}
.brain-learn-head span {
  font-size: 10px;
  color: rgba(196, 181, 253, 0.6);
}
.brain-learn .bj-empty {
  font-size: 11px;
  color: rgba(196, 181, 253, 0.6);
  padding: 4px 2px;
}
.brain-learn-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
/* Kachel als Knopf: waehlt den Horizont fuer die 90-Tage-Zeile. */
.brain-learn-tile {
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  min-width: 0;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.brain-learn-tile:hover {
  background: rgba(124, 58, 237, 0.16);
}
.brain-learn-tile.active {
  border-color: rgba(167, 139, 250, 0.6);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.25), 0 0 18px rgba(124, 58, 237, 0.2);
}
.brain-learn-tile b {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 0 18px rgba(168, 85, 247, 0.45);
}
.brain-learn-tile small {
  display: block;
  margin-top: 3px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  line-height: 1.4;
  color: rgba(226, 216, 255, 0.72);
  overflow-wrap: anywhere;
}
.brain-learn-meter {
  margin-top: 7px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.brain-learn-meter i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #7c3aed, #e879f9);
  box-shadow: 0 0 10px rgba(232, 121, 249, 0.7);
}
.brain-learn-recent {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: rgba(226, 216, 255, 0.8);
  font-variant-numeric: tabular-nums;
}
.brain-learn-recent b {
  color: #f5f3ff;
  font-weight: 700;
}
.brain-learn-chart {
  position: relative;
  height: 128px;
  border-radius: 10px;
  background: rgba(8, 5, 20, 0.45);
  border: 1px solid rgba(139, 92, 246, 0.12);
  overflow: hidden;
}
/* canvas ist ein ersetztes Element - ohne width/height 100% gilt die
   Attributgroesse (siehe .brain-stage canvas). */
.brain-learn-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.brain-learn-model {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(226, 216, 255, 0.84);
}
.brain-learn-model b {
  color: #f5f3ff;
}
.brain-learn-model em {
  font-style: normal;
  color: rgba(196, 181, 253, 0.62);
}
.brain-learn-model i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: rgba(196, 181, 253, 0.35);
}
.brain-learn-model i[data-status="schatten"] {
  background: #fcd34d;
  box-shadow: 0 0 9px #fcd34d;
}
.brain-learn-model i[data-status="aktiv"] {
  background: #6ee7b7;
  box-shadow: 0 0 9px #6ee7b7;
}
.brain-learn-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}
.brain-learn-list h4 {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, 0.66);
}
.brain-learn-list .bl-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: baseline;
  padding: 3px 2px;
  border-top: 1px solid rgba(139, 92, 246, 0.12);
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: rgba(237, 233, 254, 0.9);
}
.brain-learn-list .bl-row:first-of-type {
  border-top: 0;
}
.brain-learn-list .bl-sym {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brain-learn-list .bl-row b {
  font-weight: 700;
  color: #f5f3ff;
}
.brain-learn-list .bl-n {
  color: rgba(196, 181, 253, 0.6);
  font-size: 9.5px;
}
.brain-learn-list .bl-none {
  display: block;
  color: rgba(196, 181, 253, 0.6);
  font-family: inherit;
  font-size: 10.5px;
}

/* Verlauf (Owner 2026-10-06): was der Bot getan und gelernt hat, mit dem
   Warum - ersetzt die Postfach-Nachrichten fuer Abgleich, Stellgroessen,
   Lerner und Regelsuche. Juengste zuerst, jeder Eintrag aufklappbar. */
.brain-journal {
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 14px;
  background: rgba(23, 14, 46, 0.5);
  padding: 10px 12px 8px;
}
.brain-journal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.brain-journal-head h3 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e9d5ff;
}
.brain-journal-head span {
  font-size: 10px;
  color: rgba(196, 181, 253, 0.6);
}
.brain-journal-list {
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.5) transparent;
  padding-right: 4px;
}
.brain-journal details {
  border-top: 1px solid rgba(139, 92, 246, 0.12);
}
.brain-journal details:first-child {
  border-top: 0;
}
.brain-journal summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 78px 92px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 2px;
  font-size: 11.5px;
  color: rgba(237, 233, 254, 0.9);
}
.brain-journal summary::-webkit-details-marker {
  display: none;
}
.brain-journal summary:hover {
  background: rgba(124, 58, 237, 0.1);
}
.brain-journal .bj-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: rgba(196, 181, 253, 0.62);
  white-space: nowrap;
}
.brain-journal .bj-kind {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid currentColor;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brain-journal .bj-kind[data-kind="einstieg"] { color: #6ee7b7; }
.brain-journal .bj-kind[data-kind="ausstieg"] { color: #f0abfc; }
.brain-journal .bj-kind[data-kind="abgleich"] { color: #7dd3fc; }
.brain-journal .bj-kind[data-kind="stellgroesse"] { color: #fca5a5; }
.brain-journal .bj-kind[data-kind="lerner"] { color: #fcd34d; }
.brain-journal .bj-kind[data-kind="regelsuche"] { color: #a78bfa; }
.brain-journal .bj-kind[data-kind="recherche"] { color: #c4b5fd; }
.brain-journal .bj-kind[data-kind="beweger"] { color: #fb923c; }
.brain-journal .bj-kind[data-kind="lernen"] { color: #5eead4; }
.brain-journal .bj-kind[data-kind="hinweis"] { color: #e9d5ff; }
.brain-journal .bj-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brain-journal .bj-pnl {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.brain-journal .bj-text {
  margin: 0 2px 8px 88px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(8, 5, 20, 0.5);
  font-size: 11px;
  line-height: 1.55;
  color: rgba(226, 216, 255, 0.85);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.brain-journal .bj-empty {
  font-size: 11px;
  color: rgba(196, 181, 253, 0.6);
  padding: 8px 2px;
}

@media (max-width: 900px) {
  .brain-stage {
    height: 52vh;
  }
  .brain-journal summary {
    grid-template-columns: 70px 1fr auto;
  }
  .brain-journal .bj-kind {
    display: none;
  }
  .brain-journal .bj-text {
    margin-left: 0;
  }
  .brain-learn-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .brain-learn-lists {
    grid-template-columns: minmax(0, 1fr);
  }
  .brain-learn-chart {
    height: 110px;
  }
}
