/* Control-Panel. Look „Sendeplan“: tiefes Blauschwarz, Goldgelb als einzige Akzentfarbe,
   Anzeigetafel-Schrift für Überschriften, Mono für Zahlen. Inhalte mittig mit fester Höchstbreite. */
:root {
  --bg: #0e1016; --card: #161923; --card2: #1d2130; --line: #272b39; --line2: #353a4c; --fg: #edeef3; --mute: #8e93a6;
  --accent: #f5b83d; --on-accent: #1a1204; --ok: #52d68a; --bad: #ff4f5e; --gold: #f5b83d; --twitch: #9146ff;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); }
a { color: var(--accent); }
h1, h2 { font-family: var(--display); text-transform: uppercase; letter-spacing: .01em; line-height: .95; margin: 0; text-wrap: balance; }
h1 { font-size: 44px; font-weight: 900; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 11px; margin: 0; color: var(--mute); text-transform: uppercase; letter-spacing: .1em; font: 700 11px var(--mono); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.narrow { width: 100%; max-width: 420px; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--mute); font-size: 13px; min-width: 0; }
input, select, textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; min-height: 40px; min-width: 0; width: 100%; }
input:disabled, select:disabled { opacity: .55; }
textarea { padding: 10px 12px; min-height: 140px; font-family: var(--mono); font-size: 12px; }
input[type=color] { padding: 3px; }
input[type=checkbox] { width: 20px; min-height: 20px; accent-color: var(--accent); }
input[type=range] { accent-color: var(--accent); padding: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245, 184, 61, .22); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { font: 700 13.5px/1 var(--font); min-height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card2); color: var(--fg); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { border-color: var(--line2); background: #232839; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.07); background: var(--accent); }
.btn.outline { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn.big { min-height: 48px; font-size: 15px; padding: 0 20px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.err { color: var(--bad); }
.ok { color: var(--ok); }
.muted { color: var(--mute); }
.num, kbd { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Kopfzeile und Seitenleiste */
.brand { display: flex; align-items: center; gap: 10px; font: 900 22px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; color: var(--fg); text-decoration: none; }
.brand .logo { width: 28px; height: 28px; flex: none; display: block; }
.brand em { font-style: normal; color: var(--accent); }
header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: rgba(14, 16, 22, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 10px 24px; flex-wrap: wrap; }
.spacer { flex: 1; }
.chipline { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 34px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--mute); background: var(--card); }
.chipline b { color: var(--fg); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--ok); display: inline-block; }
.dot.rec { background: var(--bad); }
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 55px); }
.side { padding: 18px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; background: var(--card); }
nav.tabs { display: flex; flex-direction: column; gap: 2px; }
nav.tabs .grp { font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--mute); padding: 12px 10px 6px; }
nav.tabs button { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 10px; border-radius: 8px; background: none; border: 0; color: var(--mute); font: 600 14px var(--font); cursor: pointer; text-align: left; }
nav.tabs button svg { width: 18px; height: 18px; flex: none; }
nav.tabs button:hover { background: var(--card2); color: var(--fg); }
nav.tabs button.on { background: var(--card2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
nav.tabs button.on svg { color: var(--accent); }
nav.tabs .badge { margin-left: auto; font: 600 12px var(--mono); color: var(--mute); }
.remote { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; color: var(--fg); text-decoration: none; font-weight: 600; }
.remote:hover { border-color: var(--accent); }
kbd { font-size: 11px; font-weight: 700; color: var(--fg); border: 1px solid var(--line2); border-bottom-width: 2px; padding: 1px 6px; border-radius: 4px; }
main { width: 100%; max-width: 1160px; margin: 0 auto; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 20px; }

/* Bausteine */
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 120px; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pagehead .muted { font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin-bottom: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stat { padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
.stat b { display: block; font: 700 21px/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.stat span { font: 600 11px var(--mono); color: var(--mute); text-transform: uppercase; letter-spacing: .08em; }
.stat b.warn { color: var(--gold); }
.bar { position: relative; height: 4px; border-radius: 999px; background: var(--card2); }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--accent); }

/* „Jetzt dran“ */
.now { border-color: var(--line2); padding: 0; overflow: hidden; gap: 0; }
.now .info { display: flex; flex-wrap: wrap; gap: 18px; padding: 18px; }
.now .pic { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; flex: none; }
.now .txt { flex: 1 1 240px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.now .name { font: 900 36px/.95 var(--display); text-transform: uppercase; }
.now .facts { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--mute); }
.now .facts b { color: var(--fg); font-family: var(--mono); }
.now .facts b.gold { color: var(--gold); }
.now .entry { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 16px 18px; border-top: 1px solid var(--line); background: var(--bg); }
.now .entry label { flex: 1 1 150px; }
.now .entry input { min-height: 48px; border-color: var(--accent); font: 700 22px var(--mono); }
.now .xout { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--mute); min-width: 70px; }
.now .xout b { min-height: 48px; display: flex; align-items: center; font: 700 18px var(--mono); color: var(--fg); }
.tag { display: inline-flex; align-items: center; font: 700 11px/1 var(--mono); padding: 5px 8px; border-radius: 4px; letter-spacing: .06em; background: var(--accent); color: var(--on-accent); text-transform: uppercase; }

/* Tabellen und Listen */
.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th { text-align: left; font: 600 11px var(--mono); color: var(--mute); text-transform: uppercase; letter-spacing: .08em; padding: 10px; border-bottom: 1px solid var(--line); }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13.5px; }
td.r, th.r { text-align: right; }
td.r, td .num { font-family: var(--mono); }
td input { min-height: 30px; padding: 0 8px; max-width: 110px; text-align: right; font-family: var(--mono); }
tr.cur td { background: rgba(245, 184, 61, .09); }
tr.cur td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.thumb { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; display: block; flex: none;
  background-color: var(--card2); background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 6px, transparent 6px 12px); }
.suggest { position: relative; }
.suggest ul { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin: 6px 0 0; padding: 6px; list-style: none; background: var(--card2); border: 1px solid var(--line2); border-radius: 12px; max-height: 320px; overflow: auto; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.suggest li { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--fg); }
.suggest li:hover, .suggest li.on { background: var(--card); }
.pill { display: inline-block; font: 700 11px/1 var(--mono); padding: 5px 8px; border-radius: 4px; letter-spacing: .04em; background: var(--card2); color: var(--mute); vertical-align: middle; }
.pill.live { background: var(--accent); color: var(--on-accent); }
.url { font: 12px var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; word-break: break-all; margin: 6px 0; }
.preview { color-scheme: dark; width: 100%; border: 1px solid var(--line); border-radius: 10px; background: repeating-conic-gradient(var(--card2) 0 25%, var(--card) 0 50%) 0 0 / 16px 16px; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--card2); border: 1px solid var(--line2); border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: 10px; z-index: 20; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.toast.err { border-left-color: var(--bad); color: var(--fg); }
.list { display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--card2); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.card p { margin: 0; }
td.slotcell { min-width: 180px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: 600 13px var(--font); cursor: pointer; }
.swatches button i { width: 16px; height: 16px; border-radius: 999px; }
.item .grow { flex: 1; min-width: 0; }
details summary { cursor: pointer; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } .shell { grid-template-columns: 1fr; } .side { border-right: 0; border-bottom: 1px solid var(--line); } nav.tabs { flex-direction: row; flex-wrap: wrap; } nav.tabs .grp { display: none; } main { padding: 18px 16px; } header.top { padding-inline: 16px; } h1 { font-size: 36px; } }
.loginwrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.loginwrap .card { gap: 18px; padding: 36px 32px; border-radius: 14px; }
.loginwrap h1 { font-size: 46px; margin-top: 8px; }
.loginwrap .btn { width: 100%; }
.loginwrap .small { font-size: 12.5px; color: var(--mute); border-top: 1px solid var(--line); padding-top: 16px; margin: 0; }

/* Anmeldung mit Twitch */
.btn.twitch { background: var(--twitch); border-color: var(--twitch); color: #fff; justify-content: center; gap: 10px; text-decoration: none; }
.btn.twitch:hover { background: #7c2ff5; }
#pwLogin summary { cursor: pointer; font-size: 13px; }
#pwLogin form { margin-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.switcher { width: auto; min-height: 34px; border-radius: 999px; font-size: 13px; padding: 0 10px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; background: var(--line); }

/* Turnier */
.tbracket { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 6px; }
.tcol { display: flex; flex-direction: column; gap: 10px; min-width: 330px; flex: 1 0 330px; }
.tcol h3 { padding-left: 2px; }
.tms { display: flex; flex-direction: column; justify-content: space-around; gap: 12px; flex: 1; }
.tmatch { border: 1px solid var(--line); border-radius: 10px; background: var(--card2); overflow: hidden; }
.tmatch.next { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245, 184, 61, .15); }
.tside { display: flex; align-items: center; gap: 8px; padding: 7px 8px; min-width: 0; }
.tside + .tside { border-top: 1px solid var(--line); }
.tside .thumb { width: 28px; height: 28px; }
.tside .tname { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tside .tname small { display: block; font-weight: 400; color: var(--mute); font-size: 11px; }
.tside .tshow { width: 32px; padding: 0; flex: none; }
.tside .twin { width: 78px; min-height: 30px; padding: 0 8px; text-align: right; font-family: var(--mono); flex: none; }
.tside .tx { width: 54px; text-align: right; font: 700 12.5px var(--mono); color: var(--mute); flex: none; }
.tside.won { background: rgba(82, 214, 138, .09); box-shadow: inset 3px 0 0 var(--ok); }
.tside.won .tx { color: var(--ok); }
.tside.lost .tname { color: var(--mute); text-decoration: line-through; text-decoration-color: rgba(142, 147, 166, .5); }
.tside.empty { color: var(--mute); }
.ttie { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--gold); }
.tchamp { flex-direction: row; align-items: center; gap: 18px; border-color: var(--accent); }
.tchamp img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; }
.tchamp .name { font: 900 34px/1 var(--display); text-transform: uppercase; margin: 6px 0; }
.pagehead select { width: auto; }

/* Design: Auswahl der Widgets und Umschalter global/eigen */
.swatches button.on { border-color: var(--accent); background: var(--card2); }
.swatches button .pill { padding: 3px 6px; font-size: 10px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { flex-direction: row; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--fg); background: var(--bg); cursor: pointer; }
.seg label:has(input:checked) { border-color: var(--accent); }
.seg input { width: auto; min-height: 0; accent-color: var(--accent); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* Hotword */
.hotlist { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 14px; }
.hotrow { display: grid; grid-template-columns: auto minmax(0, 1fr) 52px 44px; align-items: center; gap: 12px; }
.hotrow .hl { min-width: 0; }
.hotrow.win .hk { background: var(--gold); color: var(--on-accent); }
.hk { font: 800 15px var(--mono); min-width: 38px; height: 38px; padding: 0 8px; display: grid; place-items: center; border-radius: 8px; background: var(--card2); border: 1px solid var(--line); }
.hbar { height: 8px; border-radius: 99px; background: var(--card2); margin-top: 6px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: #ff7a3d; border-radius: 99px; transition: width .6s ease; }
.hotrow .num { min-width: 46px; text-align: right; }
.hotedit { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 10px; }
.hotedit .hrow { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.hotedit input { width: 100%; }
.hotedit .hkey { font: 700 15px var(--mono); text-align: center; }
