/* BNI Trainingsbeiträge – Oberfläche */

:root {
  --bg:        #131211;
  --bg-soft:   #1a1917;
  --panel:     #1f1e1b;
  --panel-hi:  #262420;
  --line:      #33302a;
  --line-soft: #29261f;
  --text:      #efece5;
  --muted:     #a09b91;
  --muted-dim: #756f66;
  --accent:    #d97757;
  --accent-dim:#a8563b;
  --accent-bg: rgba(217, 119, 87, .14);
  --ok:        #86a95f;
  --ok-bg:     rgba(134, 169, 95, .14);
  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body { overscroll-behavior-y: none; }

.is-hidden { display: none !important; }

/* --------------------------------------------------------------- Layout -- */

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 760px;
  margin: 0 auto;
  border-left: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
}

@media (max-width: 780px) {
  .app { border: 0; }
}

/* --------------------------------------------------------------- Header -- */

.topbar {
  flex: none;
  padding: 14px 18px 0;
  background: linear-gradient(var(--bg) 70%, rgba(19, 18, 17, 0));
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent);
}

.brand-text h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.brand-text p {
  margin: 1px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 20px;
  margin-top: 12px;
}

.tab {
  appearance: none;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 2px 10px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s;
}

@media (max-width: 400px) {
  .tabs { gap: 14px; }
  .tab  { font-size: 12.5px; }
}

.tab:hover { color: var(--text); }

.tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.pill {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  margin-left: 4px;
  border-radius: 20px;
  background: var(--panel-hi);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  vertical-align: 1px;
}

.tab.is-active .pill {
  background: var(--accent-bg);
  color: var(--accent);
}

/* --------------------------------------------------------------- Stream -- */

.stream {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 18px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.stream::-webkit-scrollbar { width: 10px; }
.stream::-webkit-scrollbar-thumb {
  background: var(--line);
  border: 3px solid var(--bg);
  border-radius: 10px;
}

.intro {
  padding: 13px 15px;
  margin-bottom: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 13.5px;
}

.intro p { margin: 0; }
.intro strong { color: var(--text); font-weight: 600; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 11px !important;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-dim);
  font-size: 11.5px;
  line-height: 1.5;
}

.notice-icon {
  flex: none;
  display: block;
  padding-top: 2px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted-dim);
  font-size: 14px;
}

/* ----------------------------------------------------------------- Idee -- */

.idea {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 12px;
  padding: 14px 15px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color .18s, background .18s;
}

.idea:hover { border-color: var(--line); }

.idea.is-new {
  animation: pop .45s cubic-bezier(.2, .9, .3, 1.2);
}

.idea.is-flash {
  animation: flash 1.4s ease-out;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

@keyframes flash {
  0%   { border-color: var(--accent); background: var(--accent-bg); }
  100% { border-color: var(--line-soft); background: var(--panel); }
}

.rank {
  grid-row: 1;
  align-self: start;
  min-width: 26px;
  padding-top: 1px;
  color: var(--muted-dim);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.idea:nth-child(1) .rank,
.idea:nth-child(2) .rank,
.idea:nth-child(3) .rank { color: var(--accent); }

.body { grid-row: 1; min-width: 0; }

.idea-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.idea-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted-dim);
}

.idea-meta .who {
  color: var(--muted);
  font-weight: 600;
}

.idea-meta .sep { opacity: .5; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 11.5px;
  font-weight: 600;
}

.idea-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .15s, background .15s;
}

.idea-link:hover {
  border-color: var(--accent-dim);
  background: var(--accent-bg);
}

.note {
  margin: 8px 0 0;
  padding-left: 10px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

/* --------------------------------------------------------------- Voting -- */

.vote {
  grid-row: 1;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 50px;
  padding: 7px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-soft);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}

.vote:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

.vote:active { transform: scale(.94); }

.vote[aria-pressed="true"] {
  border-color: var(--accent-dim);
  background: var(--accent-bg);
  color: var(--accent);
}

.vote .count {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.vote.is-bumped svg { animation: bump .4s cubic-bezier(.2, .9, .3, 1.4); }

@keyframes bump {
  0%   { transform: none; }
  40%  { transform: translateY(-4px) scale(1.18); }
  100% { transform: none; }
}

/* Balken */

.bar {
  grid-column: 1 / -1;
  height: 4px;
  margin-top: 11px;
  border-radius: 4px;
  background: var(--line-soft);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

.idea.done .bar > span {
  background: linear-gradient(90deg, #5f7a41, var(--ok));
}

/* ------------------------------------------------------------- Composer -- */

.composer {
  flex: none;
  padding: 10px 18px calc(14px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line-soft);
}

.composer-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color .15s, box-shadow .15s;
}

.composer-box:focus-within {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.author {
  display: block;
  width: 100%;
  padding: 9px 14px 3px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  outline: 0;
}

.author::placeholder {
  color: var(--muted-dim);
  font-weight: 500;
}

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 0 8px 8px 14px;
}

.input-row textarea {
  flex: 1;
  max-height: 168px;
  padding: 4px 0 6px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  outline: 0;
}

.input-row textarea::placeholder { color: var(--muted-dim); }

.send {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #1a0f0a;
  cursor: pointer;
  transition: opacity .15s, transform .1s, background .15s;
}

.send:disabled {
  background: var(--panel-hi);
  color: var(--muted-dim);
  cursor: default;
}

.send:not(:disabled):hover { background: #e4835f; }
.send:not(:disabled):active { transform: scale(.92); }

.composer-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 4px 0;
  font-size: 11.5px;
  color: var(--muted-dim);
}

.counter.is-warn { color: var(--accent); }

@media (max-width: 600px) {
  .hint { display: none; }
  .composer-meta { justify-content: flex-end; }
}

/* Honeypot – für Menschen unsichtbar */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---------------------------------------------------------------- Toast -- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 12px);
  max-width: min(440px, calc(100vw - 32px));
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-hi);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  border-color: #8a4a3c;
  background: #2a1a15;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
