/* ═══════════════════════════════════════════════════════════════
   Denk-Rat-Raum — Premium Dark + Gold (ORIA)
   #0A0A0A Hintergrund · #D4AF37 Gold · Editorial, ruhig, präzise
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0A0A0A;
  --bg-soft: #101010;
  --bg-card: #141414;
  --bg-card-2: #1A1A1A;
  --line: rgba(212, 175, 55, 0.16);
  --line-soft: rgba(255, 255, 255, 0.07);
  --gold: #D4AF37;
  --gold-soft: #E8CF7A;
  --gold-dim: rgba(212, 175, 55, 0.12);
  --text: #F2EDE3;
  --text-dim: #A89F8D;
  --text-faint: #6E675A;
  --ok: #7BC96F;
  --err: #E2725B;
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background:
    radial-gradient(1200px 500px at 70% -10%, rgba(212, 175, 55, 0.07), transparent 60%),
    radial-gradient(900px 420px at 10% 110%, rgba(212, 175, 55, 0.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 880px; margin: 0 auto; padding: 0 20px 80px; }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 880px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; color: var(--text);
  font-family: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0.06em;
  cursor: pointer; padding: 4px 0; text-transform: uppercase;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--gold); color: var(--gold);
  font-size: 14px; background: var(--gold-dim);
}
.lang-switch { display: flex; gap: 2px; background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: 999px; padding: 3px; }
.lang-btn {
  border: none; background: none; color: var(--text-dim);
  font-family: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  padding: 5px 12px; border-radius: 999px; cursor: pointer; transition: all .18s;
}
.lang-btn.active { background: var(--gold); color: #141005; }

/* ── Hero ───────────────────────────────────────────────── */
.view { animation: fadeUp .45s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.hero { padding: 56px 0 34px; text-align: center; }
.eyebrow {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; margin-bottom: 22px;
  background: var(--gold-dim);
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(34px, 7.5vw, 58px);
  line-height: 1.12; font-weight: 400; letter-spacing: -0.01em;
  margin-bottom: 20px;
}
.hero-sub { max-width: 560px; margin: 0 auto 18px; color: var(--text-dim); font-size: 16px; }
.hero-meta { font-size: 12.5px; color: var(--text-faint); display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-meta .dot { color: var(--gold); }

/* ── Panels & Felder ────────────────────────────────────── */
.panel {
  background: var(--bg-card); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.field { margin-bottom: 24px; }
.field:last-child { margin-bottom: 0; }
.field > label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 10px;
}
.field > label em { font-style: normal; color: var(--text-dim); text-transform: none; letter-spacing: 0; }

textarea {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding: 14px 16px; font-family: inherit; font-size: 15.5px; line-height: 1.55;
  resize: vertical; min-height: 96px; transition: border-color .2s;
}
textarea:focus { outline: none; border-color: var(--gold); }
textarea::placeholder { color: var(--text-faint); }
.field-hint { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; font-size: 12px; color: var(--text-faint); }

/* ── Persona-Katalog ────────────────────────────────────── */
.katalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.klon-card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding: 14px 12px; cursor: pointer; text-align: left; color: var(--text);
  font-family: inherit; transition: border-color .18s, background .18s, transform .12s;
}
.klon-card:hover { border-color: rgba(212,175,55,.4); transform: translateY(-1px); }
.klon-card.selected { border-color: var(--gold); background: var(--gold-dim); }
.klon-card .klon-top { display: flex; align-items: center; gap: 9px; }
.klon-card .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #0A0A0A;
  border: 1.5px solid rgba(255,255,255,.18);
}
.klon-card .klon-name { font-size: 13.5px; font-weight: 700; line-height: 1.2; }
.klon-card .klon-rolle { font-size: 11px; color: var(--text-dim); line-height: 1.3; }
.klon-card .check {
  position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold); color: #141005; font-size: 11px; font-weight: 900;
  display: none; align-items: center; justify-content: center;
}
.klon-card.selected .check { display: flex; }

/* ── Setup-Row / Segmented ──────────────────────────────── */
.setup-row { display: flex; gap: 24px; align-items: flex-end; flex-wrap: wrap; }
.field-rounds { flex: 1; min-width: 180px; }
.field-cta { flex: 1; min-width: 220px; text-align: right; }
.seg { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 4px; }
.seg-btn {
  flex: 1; border: none; background: none; color: var(--text-dim);
  font-family: inherit; font-size: 14px; font-weight: 700; padding: 9px 0;
  border-radius: 7px; cursor: pointer; transition: all .15s;
}
.seg-btn.active { background: var(--gold); color: #141005; }

.btn-gold {
  display: inline-block; border: none; cursor: pointer;
  background: linear-gradient(135deg, #E8CF7A, #D4AF37 55%, #B8942A);
  color: #141005; font-family: inherit; font-size: 15px; font-weight: 800;
  letter-spacing: 0.03em; padding: 14px 30px; border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(212,175,55,.22);
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.btn-gold:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(212,175,55,.3); }
.btn-gold:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
.cta-hint { justify-content: flex-end; }

/* ── Historie ───────────────────────────────────────────── */
.history { margin-top: 46px; }
.section-title {
  font-family: var(--font-serif); font-weight: 400; font-size: 22px;
  letter-spacing: 0.01em; margin-bottom: 14px; color: var(--text);
  border-bottom: 1px solid var(--line-soft); padding-bottom: 10px;
}
.history-item {
  display: flex; justify-content: space-between; gap: 14px; align-items: center;
  background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding: 13px 16px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s;
}
.history-item:hover { border-color: var(--line); }
.history-item .h-problem { font-size: 14px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item .h-meta { font-size: 11.5px; color: var(--text-faint); text-align: right; flex-shrink: 0; }

/* ── Raum-Ansicht ───────────────────────────────────────── */
.raum-head { padding: 30px 0 8px; }
.raum-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.raum-badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--gold); background: var(--gold-dim);
}
.raum-badge.live { animation: pulse 1.6s ease infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(212,175,55,.28); } 50% { box-shadow: 0 0 0 8px rgba(212,175,55,0); } }
.raum-badge.done { color: var(--ok); border-color: rgba(123,201,111,.4); background: rgba(123,201,111,.08); }
.raum-counter { font-size: 13px; color: var(--text-dim); font-weight: 600; letter-spacing: 0.05em; }
.raum-problem {
  font-family: var(--font-serif); font-weight: 400; font-size: clamp(21px, 4.5vw, 28px);
  line-height: 1.3; margin-bottom: 14px; color: var(--gold-soft);
}
.raum-kloene { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.raum-klon-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: 999px;
  padding: 5px 12px 5px 6px; font-size: 12.5px; font-weight: 600; color: var(--text-dim);
}
.raum-klon-chip .avatar { width: 22px; height: 22px; font-size: 9px; }

/* ── Debatte ────────────────────────────────────────────── */
.debate { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; min-height: 60vh; }

.beitrag {
  display: flex; gap: 13px; background: var(--bg-card);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 16px 18px; animation: fadeUp .4s ease both;
}
.beitrag .avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #0A0A0A; margin-top: 2px;
  border: 1.5px solid rgba(255,255,255,.18);
}
.beitrag-body { flex: 1; min-width: 0; }
.beitrag-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 5px; flex-wrap: wrap; }
.beitrag-name { font-size: 14px; font-weight: 800; }
.beitrag-rolle { font-size: 11.5px; color: var(--text-faint); }
.beitrag-runde { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-left: auto; }
.beitrag-text { font-size: 15px; line-height: 1.62; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.beitrag-text .ki-note { display: block; font-size: 12px; color: var(--text-faint); font-style: italic; margin-bottom: 6px; }
.beitrag-fehler { color: var(--err); font-size: 13.5px; font-style: italic; }
.beitrag.klon-fehler { border-color: rgba(226,114,91,.35); }

.runde-trenner {
  display: flex; align-items: center; gap: 14px; margin: 10px 0 2px;
  color: var(--text-faint); font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
}
.runde-trenner::before, .runde-trenner::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.runde-trenner .r-nr { color: var(--gold); }

/* denkt-Indikator */
.denkt {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 14px 18px;
}
.denkt-avatars { display: flex; }
.denkt-avatars .avatar {
  width: 30px; height: 30px; border-radius: 50%; margin-right: -8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #0A0A0A;
  border: 1.5px solid var(--bg);
  animation: bounce 1.2s ease infinite;
}
.denkt-avatars .avatar:nth-child(2) { animation-delay: .12s; }
.denkt-avatars .avatar:nth-child(3) { animation-delay: .24s; }
.denkt-avatars .avatar:nth-child(4) { animation-delay: .36s; }
.denkt-avatars .avatar:nth-child(5) { animation-delay: .48s; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.denkt-text { font-size: 13.5px; color: var(--text-dim); font-style: italic; }

/* ── Ergebnis-Panel ─────────────────────────────────────── */
.result-panel {
  margin-top: 30px; background: linear-gradient(180deg, rgba(212,175,55,.06), transparent 40%), var(--bg-card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  animation: fadeUp .5s ease both;
}
.result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.result-head .section-title { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.result-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: #141005; background: var(--gold); border-radius: 999px; padding: 5px 12px;
}
.result-body { font-size: 15px; line-height: 1.65; color: var(--text); }
.result-body h2 {
  font-family: var(--font-serif); font-weight: 400; font-size: 19px;
  color: var(--gold); margin: 22px 0 8px; letter-spacing: .01em;
}
.result-body h2:first-child { margin-top: 0; }
.result-body p { margin-bottom: 10px; }
.result-body blockquote { border-left: 2px solid var(--gold); padding: 2px 0 2px 14px; margin: 10px 0; color: var(--text-dim); font-style: italic; }
.result-body ul, .result-body ol { margin: 8px 0 10px 22px; }
.result-body li { margin-bottom: 5px; }
.result-actions { margin-top: 24px; text-align: right; }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card-2); border: 1px solid var(--line); color: var(--text);
  font-size: 13.5px; padding: 12px 20px; border-radius: 999px; z-index: 100;
  box-shadow: 0 16px 40px rgba(0,0,0,.5); max-width: 92vw; text-align: center;
  animation: fadeUp .3s ease both;
}

.foot { margin-top: 60px; text-align: center; font-size: 11.5px; color: var(--text-faint); border-top: 1px solid var(--line-soft); padding-top: 22px; }

.hidden { display: none !important; }

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  #app { padding: 0 14px 60px; }
  .panel { padding: 20px 16px; }
  .hero { padding: 40px 0 26px; }
  .katalog { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 8px; }
  .setup-row { flex-direction: column; gap: 18px; align-items: stretch; }
  .field-cta { text-align: left; }
  .cta-hint { justify-content: flex-start; }
  .beitrag { padding: 13px 13px; gap: 10px; }
  .beitrag .avatar { width: 32px; height: 32px; font-size: 11px; }
  .result-panel { padding: 20px 16px; }
}
