@font-face { font-family: Inter; src: url(fonts/Inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Plus Jakarta Sans'; src: url(fonts/PlusJakartaSans.woff2) format('woff2'); font-weight: 200 800; font-display: swap; }

:root {
  --bg: #141414;
  --card: #1f1f1f;
  --card2: #292929;
  --line: #333;
  --text: #fff;
  --mut: #a8a8a8;
  --amber: #feb500;
  --ink: #1c1c1c;
  --green: #35d07f;
  --red: #ff6b6b;
  --blue: #6db3ff;
  --radius: 14px;
  --nav: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, sans-serif; overflow-x: hidden; }
h1, h2, h3 { font-family: 'Plus Jakarta Sans', Inter, sans-serif; line-height: 1.25; margin: 0; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: var(--amber); }
img, video { display: block; max-width: 100%; }

.shell { max-width: 1120px; margin: 0 auto; padding: 16px 16px calc(var(--nav) + 28px + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; min-height: 40px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.between { justify-content: space-between; }
.mut { color: var(--mut); }
.small { font-size: 13px; }
.grow { flex: 1 1 auto; min-width: 0; }
.wrap-any { overflow-wrap: anywhere; }

.banner { background: rgba(254, 181, 0, .13); border: 1px solid rgba(254, 181, 0, .4); color: var(--amber); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; }
.card.todo { border-color: rgba(254, 181, 0, .55); }
.card.win { border-color: var(--green); }

.btn { appearance: none; border: 1px solid var(--line); background: var(--card2); color: var(--text); font: 600 14px/1.25 Inter, sans-serif; min-height: 44px; padding: 8px 14px; text-align: center; border-radius: 11px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { border-color: #555; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .nav a:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn.good { background: var(--green); border-color: var(--green); color: #0c2417; }
.btn.danger { color: var(--red); background: transparent; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 36px; font-size: 13px; padding: 0 10px; }
.btn.block { width: 100%; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; line-height: 1; padding: 5px 8px; border-radius: 99px; background: var(--card2); color: var(--mut); white-space: nowrap; }
.chip.on { color: var(--green); background: rgba(53, 208, 127, .13); }
.chip.warn { color: var(--amber); background: rgba(254, 181, 0, .14); }
.chip.bad { color: var(--red); background: rgba(255, 107, 107, .14); }
.chip.info { color: var(--blue); background: rgba(109, 179, 255, .14); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile b { display: block; font: 800 24px/1.15 'Plus Jakarta Sans', sans-serif; font-variant-numeric: tabular-nums; }
.tile span { color: var(--mut); font-size: 13px; }

.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; appearance: none; border: 1px solid var(--line); background: transparent; color: var(--mut); font: 600 13px/1 Inter, sans-serif; min-height: 38px; padding: 0 12px; border-radius: 99px; cursor: pointer; }
.seg button.on { background: var(--amber); border-color: var(--amber); color: var(--ink); }

/* Die 5 Karten eines Tests: am Handy zum Wischen, am großen Bildschirm nebeneinander */
.variants { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(158px, 44%); gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; margin: 0 -14px; padding: 2px 14px 8px; }
.variant { scroll-snap-align: center; background: var(--bg); border: 2px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.variant.winner { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.variant.lead { border-color: var(--amber); }
.thumb { position: relative; display: block; width: 100%; aspect-ratio: 9 / 16; background: #000; border: 0; padding: 0; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .letter { position: absolute; top: 6px; left: 6px; background: var(--ink); color: var(--text); font: 800 13px/24px 'Plus Jakarta Sans', sans-serif; min-width: 24px; height: 24px; border-radius: 7px; text-align: center; padding: 0 5px; }
.thumb .play { position: absolute; inset: auto 6px 6px auto; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, .65); display: grid; place-items: center; font-size: 12px; }
.vbody { padding: 9px; display: grid; gap: 7px; flex: 1; align-content: start; }
.hook { font-weight: 700; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.metrics { display: grid; gap: 2px; font-size: 12.5px; margin: 0; }
.metrics div { display: flex; justify-content: space-between; gap: 6px; }
.metrics dt { color: var(--mut); }
.metrics dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.score { color: var(--amber); font-weight: 800; }

.report { background: var(--bg); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.report ul, .report ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

.progress { height: 6px; background: var(--card2); border-radius: 9px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--amber); border-radius: 9px; transition: width .3s; }

label.field { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--mut); }
input[type=text], input[type=password], textarea, select { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font: 16px/1.35 Inter, sans-serif; }
input[type=file] { width: 100%; color: var(--mut); font-size: 14px; }
input[type=file]::file-selector-button { background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; margin-right: 10px; font: 600 14px Inter, sans-serif; cursor: pointer; }
textarea { min-height: 84px; resize: vertical; }

.switch { display: flex; gap: 12px; align-items: flex-start; }
.switch input { appearance: none; flex: none; width: 44px; height: 26px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); position: relative; cursor: pointer; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--mut); transition: left .15s; }
.switch input:checked { background: var(--green); border-color: var(--green); }
.switch input:checked::after { left: 20px; background: #fff; }

.log { font: 12.5px/1.45 ui-monospace, Consolas, monospace; display: grid; gap: 6px; }
.log div { overflow-wrap: anywhere; }
.log time { color: var(--mut); margin-right: 6px; }
.log .error { color: var(--red); }
.log .warn { color: var(--amber); }

.empty { color: var(--mut); text-align: center; padding: 30px 16px; border: 1px dashed var(--line); border-radius: var(--radius); }

.nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; background: rgba(20, 20, 20, .96); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.nav a { position: relative; height: var(--nav); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--mut); text-decoration: none; font-size: 11px; font-weight: 600; }
.nav a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav a.on { color: var(--amber); }
.nav .count { position: absolute; top: 7px; left: calc(50% + 7px); background: var(--amber); color: var(--ink); font-size: 10px; font-weight: 800; line-height: 16px; min-width: 16px; padding: 0 4px; border-radius: 9px; text-align: center; }

.more { display: grid; gap: 8px; }
.more a { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 600; }
.more a span { color: var(--mut); }

.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login form { width: 100%; max-width: 360px; display: grid; gap: 12px; }

.modal { position: fixed; z-index: 40; inset: 0; background: rgba(0, 0, 0, .85); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 680px; max-height: 92dvh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.sheet.video { background: #000; max-width: 460px; padding: 10px; }
.sheet.video video { width: 100%; max-height: 78dvh; border-radius: 10px; background: #000; }
.sheet.script { max-width: 760px; height: 100dvh; max-height: 100dvh; border-radius: 0; align-content: start; }
.reading { font-size: var(--read, 20px); line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.hookline { border-left: 3px solid var(--amber); padding-left: 10px; display: grid; gap: 3px; }

#toast { position: fixed; z-index: 60; left: 16px; right: 16px; bottom: calc(var(--nav) + 12px + env(safe-area-inset-bottom)); max-width: 480px; margin: 0 auto; background: #fff; color: var(--ink); font-weight: 600; font-size: 14px; border-radius: 11px; padding: 11px 14px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; }
#toast.show { opacity: 1; transform: none; }
#toast.bad { background: var(--red); }

@media (min-width: 620px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .variants { grid-auto-columns: minmax(158px, 28%); }
  .modal { align-items: center; }
  .sheet { border-radius: 18px; }
}
@media (min-width: 900px) {
  .shell { padding-top: 76px; padding-bottom: 40px; }
  .nav { top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); display: flex; justify-content: center; gap: 6px; padding: 0 16px; }
  .nav a { flex-direction: row; height: 56px; padding: 0 16px; font-size: 14px; gap: 8px; }
  .nav .count { position: static; }
  .variants { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-columns: auto; margin: 0; padding: 2px 0 0; overflow: visible; }
  #toast { bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
