/* IdeaForge – ein Schnittplatz fürs Handy. Das Auffälligste ist der Multiplikator auf dem Winner-Thumbnail;
   alles andere bleibt ruhig: kühles Grau, Tinte, ein Kobalt für Aktionen. */
:root {
  --bg: #F2F4F7; --surface: #FFFFFF; --sunk: #E7EBF0; --line: #D5DCE4;
  --ink: #152238; --ink-2: #4A5A70; --ink-3: #7A889B;
  --act: #2445D6; --act-ink: #FFFFFF; --act-soft: #E3E9FF;
  --ok: #18794E; --ok-soft: #DDF3E6; --bad: #B42318; --bad-soft: #FDE5E2; --warn: #94600A; --warn-soft: #FBEFD5;
  /* Heat-Skala für den Score */
  --h1: #6B7A90; --h2: #E08A00; --h3: #E5531A; --h4: #C9184A;
  --r-s: 8px; --r-m: 14px;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --text: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --tabs-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1520; --surface: #162131; --sunk: #1D2A3D; --line: #2A3A50;
    --ink: #E8EEF6; --ink-2: #A9B6C8; --ink-3: #7C8BA0;
    --act: #6F8CFF; --act-ink: #0B1222; --act-soft: #1E2B4F;
    --ok: #4CC38A; --ok-soft: #133528; --bad: #FF7A6B; --bad-soft: #3A1A18; --warn: #F2B34A; --warn-soft: #3A2C12;
    --h1: #8A99AE; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--text); padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 16px); }
a { color: var(--act); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--act); outline-offset: 2px; border-radius: 6px; }
img { display: block; max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Kopf */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.brand { font: 800 22px/1 var(--display); letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand span { color: var(--act); }
.top-status { font-size: 13px; color: var(--ink-3); text-align: right; min-height: 1em; }
.top-status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--act); margin-right: 6px; animation: pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .top-status .dot { animation: none; } }
@keyframes pulse { 50% { opacity: .35; } }

main { max-width: 1120px; margin: 0 auto; padding: 4px 16px 24px; outline: none; }
h1 { font: 700 30px/1.1 var(--display); letter-spacing: -0.02em; margin: 8px 0 4px; }
h2 { font: 700 20px/1.2 var(--display); margin: 28px 0 10px; }
.lead { color: var(--ink-2); margin: 0 0 16px; max-width: 62ch; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }

/* Untere Leiste */
.tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.tabs a { position: relative; flex: 1; max-width: 180px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-3); text-decoration: none; border-radius: 10px; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--act); background: var(--act-soft); }
.tabs b { position: absolute; top: 2px; right: calc(50% - 26px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--act); color: var(--act-ink); font-size: 11px; line-height: 18px; text-align: center; }

/* Kanal-Filter */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 12px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 14px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip.solo { padding-left: 14px; }
.chip[aria-pressed="true"] { border-color: var(--act); background: var(--act-soft); color: var(--ink); }
.chip img, .chip .ph { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--sunk); }
.chip .n { font-variant-numeric: tabular-nums; color: var(--ink-3); }
.ph { display: grid; place-items: center; font: 700 14px var(--display); color: var(--ink-2); }

/* Ideen */
.ideas { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .ideas { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .ideas { grid-template-columns: 1fr 1fr 1fr; } }
.idea { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; display: flex; flex-direction: column; }
.idea .ref { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--sunk); }
.idea .ref img { width: 100%; height: 100%; object-fit: cover; }
.idea .ref::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8, 12, 20, .78), rgba(8, 12, 20, 0) 55%); }
.idea .ref .wt { position: absolute; z-index: 1; left: 12px; right: 96px; bottom: 10px; color: #fff; font-size: 13.5px; line-height: 1.35; }
.idea .ref .wt small { display: block; opacity: .82; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idea .ref .wt span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500; }
.idea .body { padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.idea .ch { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.idea .ch img { width: 18px; height: 18px; border-radius: 50%; }
.idea h3 { font: 700 19px/1.25 var(--display); letter-spacing: -0.01em; margin: 0; overflow-wrap: anywhere; }
.idea h3[contenteditable="true"] { outline: 2px dashed var(--act); outline-offset: 4px; border-radius: 4px; }
.idea .why { font-size: 14px; color: var(--ink-2); margin: 0; }
.idea .pat { font-size: 13px; color: var(--ink-3); margin: 0; }
.idea .acts { display: flex; gap: 8px; padding: 0 14px 14px; align-items: center; }

/* Der Multiplikator: das eine laute Element */
.mult { position: absolute; z-index: 2; right: 10px; bottom: 8px; font: 800 30px/1 var(--display); letter-spacing: -0.03em; color: #fff;
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.mult::before { content: ""; position: absolute; left: -6px; right: -6px; bottom: -4px; height: 5px; border-radius: 3px; background: var(--heat, var(--h2)); }
.mult small { font-size: 18px; font-weight: 700; margin-left: 1px; }
.mult.inline { position: static; color: var(--ink); text-shadow: none; font-size: 22px; display: inline-block; padding-bottom: 6px; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; color: var(--ink); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.go { flex: 1; background: var(--act); border-color: var(--act); color: var(--act-ink); font-size: 16px; min-height: 48px; }
.btn.go.arm { background: var(--ink); border-color: var(--ink); color: var(--bg); position: relative; overflow: hidden; }
.btn.go.arm::after { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--act); transform-origin: left; animation: drain 4s linear forwards; }
@keyframes drain { to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .btn.go.arm::after { animation: none; } }
.btn.icon { width: 48px; padding: 0; flex: none; }
.btn.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn.icon.on { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--act); padding: 0 8px; }
.btn.danger { color: var(--bad); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Hinweise */
.note { border-radius: var(--r-m); padding: 14px 16px; margin: 8px 0 16px; background: var(--surface); border: 1px solid var(--line); }
.note.warn { background: var(--warn-soft); border-color: transparent; }
.note.bad { background: var(--bad-soft); border-color: transparent; }
.note p { margin: 4px 0; }
.empty { text-align: center; padding: 40px 16px; color: var(--ink-2); }
.empty h2 { margin-top: 0; }

/* Kanäle */
.chlist { display: grid; gap: 10px; }
@media (min-width: 760px) { .chlist { grid-template-columns: 1fr 1fr; } }
.chrow { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: var(--ink); }
.chrow img, .chrow .ph { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--sunk); }
.chrow .nm { font: 700 17px/1.2 var(--display); }
.chrow .meta { font-size: 13px; color: var(--ink-3); }
.chrow .stat { text-align: right; font-size: 13px; color: var(--ink-2); }
.chrow .stat b { display: block; font: 800 22px/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.flag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); }
.flag.bad { background: var(--bad-soft); color: var(--bad); }

.head { display: flex; gap: 14px; align-items: center; margin: 8px 0 12px; }
.head img, .head .ph { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--sunk); }
.head h1 { margin: 0; font-size: 26px; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--sunk); border-radius: 12px; overflow-x: auto; margin: 4px 0 16px; }
.seg button { flex: 1 0 auto; min-height: 40px; border: 0; background: none; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; white-space: nowrap; padding: 0 12px; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.vids { display: grid; gap: 10px; }
@media (min-width: 760px) { .vids { grid-template-columns: 1fr 1fr; } }
.vid { display: grid; grid-template-columns: 136px 1fr; gap: 12px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.vid .th { position: relative; aspect-ratio: 16/9; border-radius: var(--r-s); overflow: hidden; background: var(--sunk); }
.vid .th img { width: 100%; height: 100%; object-fit: cover; }
.vid .th .mult { font-size: 20px; right: 6px; bottom: 6px; }
.vid .th .mult small { font-size: 13px; }
.vid .th::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,12,20,.6), transparent 60%); }
.vid .t { font-weight: 600; font-size: 15px; line-height: 1.3; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.vid .m { font-size: 13px; color: var(--ink-3); }
.vid .row { margin-top: 6px; }
.vid .btn { min-height: 36px; font-size: 14px; padding: 0 12px; }

/* Formulare */
label.f { display: block; margin: 0 0 14px; }
label.f > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
label.f > small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 4px; }
input[type="text"], input[type="url"], input[type="password"], input[type="number"], textarea, select {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
textarea { min-height: 150px; resize: vertical; line-height: 1.45; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; }

.refs { display: grid; gap: 8px; margin-bottom: 14px; }
.refrow { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.refrow img, .refrow .ph { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--sunk); }

/* Produktion */
.jobs { display: grid; gap: 10px; }
.job { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px; display: grid; gap: 8px; }
.job .t { font: 700 17px/1.25 var(--display); margin: 0; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.steps i { height: 6px; border-radius: 3px; background: var(--sunk); }
.steps i.done { background: var(--ok); }
.steps i.now { background: var(--act); animation: pulse 1.6s ease-in-out infinite; }
.steps i.fail { background: var(--bad); }
.steplbl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; font-size: 11.5px; color: var(--ink-3); }
.err { font-size: 14px; color: var(--bad); background: var(--bad-soft); padding: 8px 10px; border-radius: 8px; overflow-wrap: anywhere; }

/* Login */
.login { max-width: 380px; margin: 12vh auto 0; }
.login h1 { font-size: 40px; }

.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 14px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 15px; max-width: calc(100vw - 32px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }
details.more summary { cursor: pointer; color: var(--act); font-weight: 600; margin: 8px 0; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .8s linear infinite; vertical-align: -2px; }
@keyframes rot { to { transform: rotate(1turn); } }
