:root {
  --accent: #c8102e;
  --bg: #111;
  --panel: #1b1b1b;
  --line: #262626;
  --text: #eee;
  --muted: #999;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; }
h1 { font-size: 1.3rem; margin: 0 0 12px; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }

/* Kopfzeile */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
          padding: 10px 16px; background: #000; border-bottom: 2px solid var(--accent); }
.brand { font-weight: 700; text-decoration: none; letter-spacing: .02em; }
.topnav { display: flex; align-items: center; gap: 16px; }
.topnav form { margin: 0; }
.linkbutton { background: none; border: 0; color: var(--text); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

main.narrow { max-width: 420px; margin: 40px auto; padding: 0 16px; }
main.wide { max-width: 1400px; margin: 0 auto; padding: 16px; }

/* Formulare */
.stack { display: grid; gap: 12px; }
label { display: grid; gap: 4px; color: #ccc; }
input[type=text], input[type=password], input:not([type]) {
  background: #222; border: 1px solid #333; color: var(--text); padding: 8px 10px; border-radius: 4px; font: inherit; }
button, .button { background: var(--accent); color: #fff; border: 0; border-radius: 4px; padding: 8px 14px;
                  font: inherit; cursor: pointer; text-decoration: none; display: inline-block; }
button.secondary, .button.secondary { background: #333; }
button:disabled { opacity: .5; cursor: default; }

.flash { max-width: 1400px; margin: 12px auto; padding: 10px 14px; border-radius: 4px; background: #183a1f; }
.flash.error { background: #4a1219; }
.hint { color: var(--muted); }

/* Saison-Leiste */
.seasons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; }
.seasons-label { color: var(--muted); margin-right: 4px; }
.seasons a { text-decoration: none; padding: 6px 12px; border-radius: 999px; background: #222; }
.seasons a:hover { background: #333; }
.seasons a.active { background: var(--accent); color: #fff; }

/* Kacheln */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px;
         grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile { display: grid; gap: 4px; text-decoration: none; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: #1e1e1e; border-radius: 6px; overflow: hidden; display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile:hover .thumb { outline: 2px solid var(--accent); }
.duration { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.8); padding: 1px 6px;
            border-radius: 3px; font-size: .85rem; font-variant-numeric: tabular-nums; }
.tile-title { font-weight: 600; }
.tile-meta { color: var(--muted); font-size: .9rem; display: flex; gap: 10px; }

/* Player */
.player-layout { max-width: 1300px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
@media (min-width: 900px) { .player-layout { grid-template-columns: 1fr 340px; } .back { grid-column: 1 / -1; } }
.back { margin: 0; }
.back a { color: #ccc; text-decoration: none; }
video { width: 100%; background: #000; border-radius: 6px; display: block; }
.chapter-bar { display: flex; height: 14px; margin-top: 6px; gap: 2px; cursor: pointer; }
.chapter-bar div { background: #444; position: relative; border-radius: 2px; overflow: hidden; }
.chapter-bar div:hover { background: #666; }
.chapter-bar div span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); }
.current-chapter { margin: 8px 0 0; color: #bbb; min-height: 1.2em; }

.chapter-list { list-style: none; margin: 0; padding: 0; background: var(--panel); border-radius: 6px; overflow: hidden; }
.chapter-list li { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.chapter-list li.active { background: #2a1015; }
.chapter-list li.active .time { color: var(--accent); }
.chapter-list .jump { flex: 1; text-align: left; background: none; color: inherit; padding: 10px 12px;
                      display: flex; gap: 10px; border-radius: 0; }
.chapter-list .jump:hover { background: var(--line); }
.chapter-list .link { background: none; color: #888; padding: 10px; }
.chapter-list .link:hover { color: #fff; }
.time { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 4.5em; }

.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: #333; max-width: 90vw;
         padding: 8px 14px; border-radius: 6px; opacity: 0; transition: opacity .2s; pointer-events: none;
         word-break: break-all; }
.toast.visible { opacity: 1; pointer-events: auto; }

/* Admin */
.admin-season { margin: 24px 0; padding: 16px; background: var(--panel); border-radius: 6px; }
.admin-season form.inline { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
table.list { width: 100%; border-collapse: collapse; margin-top: 12px; }
table.list th, table.list td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.list td.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.editor-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.chapter-editor li { gap: 6px; padding: 6px 8px; }
.chapter-editor input.start { width: 6.5em; font-variant-numeric: tabular-nums; }
.chapter-editor input.title { flex: 1; min-width: 0; }
.chapter-editor button { padding: 6px 8px; }
.thumb-preview { max-width: 320px; border-radius: 6px; display: block; margin: 8px 0; }
kbd { background: #333; border-radius: 3px; padding: 0 5px; font-size: .85em; }
