:root {
  --panel: #120a20;
  --panel-2: #1a1030;
  --line: #2a1d42;
  --text-2: #b9b0cf;
  --radius: 14px;
}
* { scrollbar-width: thin; scrollbar-color: #ffffff30 transparent; }
body { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; background: radial-gradient(1200px 600px at 70% -10%, #2a0f3d 0%, var(--bg) 60%) fixed; }
button, input { font: inherit; color: inherit; }
input {
  background: #0008; border: 1px solid #ffffff22; padding: 10px 12px; border-radius: 10px; min-width: 0; flex: 1 1 120px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
h2, h3 { margin: 0 0 10px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
h3 { margin-top: 14px; }
h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; }
p { margin: 0 0 8px; color: var(--text-2); line-height: 1.45; }
kbd { font: 12px var(--mono); padding: 1px 6px; border: 1px solid #fff3; border-radius: 4px; color: var(--text-2); }
.hint { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  padding: 10px 16px; border-radius: 10px; font-weight: 700; background: var(--accent); color: #000;
  transition: transform .08s, filter .15s, background .2s; touch-action: manipulation; white-space: nowrap;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .3; cursor: default; filter: none; transform: none; }
.btn.ghost { background: #ffffff0d; color: #fff; box-shadow: inset 0 0 0 1px #ffffff22; }
.btn.ok-ghost { background: transparent; color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.btn.bad-ghost { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.btn.big { padding: 12px 20px; font-size: 16px; }
.btn kbd { border-color: #0004; color: #0009; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* Schalter & Regler */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; user-select: none; }
.switch input { display: none; }
.switch span { width: 42px; height: 24px; border-radius: 99px; background: #ffffff22; position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch.small { font-weight: 500; font-size: 14px; }
.slider-row { display: flex; align-items: center; gap: 10px; }
.slider-row span { color: var(--text-2); min-width: 72px; }
.slider-row b { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
input[type=range] { flex: 1; accent-color: var(--accent); padding: 0; background: none; border: 0; }

/* Login */
.login { max-width: 340px; margin: 16vh auto; display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.login h1 { font-stretch: 125%; font-weight: 900; font-size: 44px; margin: 0; }
.login-mark { width: 54px; height: 54px; border-radius: 14px; background: conic-gradient(from 90deg, var(--accent), var(--accent-2), var(--accent)); }
.login .err { color: var(--bad); min-height: 1em; }

/* Kopfzeile */
.top {
  position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center;
  padding: 12px 20px; background: #07020fd9; backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-stretch: 120%; }
.brand b { font-family: var(--font); font-weight: 900; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
html[data-online='1'] .dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.status { min-width: 0; }
.status-main { display: flex; align-items: center; gap: 10px; }
.scene { font: 900 24px var(--font); font-stretch: 115%; color: #fff; }
.badge { font: 700 11px system-ui; letter-spacing: .1em; padding: 3px 8px; border-radius: 6px; background: var(--bad); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.status-sub { color: var(--text-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-sub b { color: var(--accent); }
.progress { position: relative; height: 6px; margin-top: 8px; border-radius: 99px; background: #ffffff14; overflow: visible; max-width: 560px; }
.progress i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: var(--accent); box-shadow: 0 0 10px var(--accent); transition: width .25s linear; }
.progress span { position: absolute; right: 0; top: -20px; font: 18px var(--mono); color: var(--accent); }
.top-btns { display: flex; gap: 8px; }
#btnPause.paused { background: var(--ok); }

/* Raster */
.grid {
  display: grid; gap: 16px; padding: 16px 20px 40px;
  grid-template-columns: 250px minmax(0, 1fr) 400px;
  grid-template-areas: 'flow live action' 'flow tabs tabs';
  align-items: start;
}
.card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.flow { grid-area: flow; position: sticky; top: 96px; max-height: calc(100vh - 112px); overflow: auto; align-self: start; }
.live { grid-area: live; }
.action { grid-area: action; }
.tabs { grid-area: tabs; padding: 0; overflow: hidden; }
@media (max-width: 1280px) {
  .grid { grid-template-columns: 220px minmax(0, 1fr) 360px; }
}
@media (max-width: 1080px) {
  .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: 'live action' 'flow tabs'; }
  .flow { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .top { grid-template-columns: 1fr auto; padding: 10px 12px; gap: 10px; }
  .status { grid-column: 1 / -1; grid-row: 2; }
  .top-btns .icon { display: none; }
  .grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'action' 'live' 'flow' 'tabs'; padding: 12px; }
}

/* Ablauf */
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.timeline li.group { margin: 12px 0 4px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.timeline li.group i { width: 10px; height: 10px; border-radius: 3px; }
.timeline button {
  width: 100%; text-align: left; background: transparent; border: 0; color: #fff; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; gap: 10px; font-size: 14px;
}
.timeline button::before { content: ''; width: 8px; height: 8px; border-radius: 50%; border: 2px solid #ffffff44; flex: none; }
.timeline button:hover { background: #ffffff0d; }
.timeline li.sub button { padding-left: 28px; color: var(--text-2); font-size: 13px; }
.timeline li.done button { color: var(--muted); }
.timeline li.done button::before { background: #ffffff44; border-color: transparent; }
.timeline li.cur button { background: var(--accent); color: #000; font-weight: 800; }
.timeline li.cur button::before { border-color: #000; background: #000; }

/* Ziehung */
.live-head { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.bignum-wrap { display: flex; flex-direction: column; align-items: center; min-width: 170px; padding: 10px 16px; border-radius: 12px; background: #0006; box-shadow: inset 0 0 0 1px #ffffff12; }
.label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.bignum { font: 900 104px/1 var(--font); font-stretch: 125%; color: #fff; text-shadow: 0 0 30px var(--accent); }
.bignum.empty { font-size: 48px; line-height: 104px; color: var(--muted); text-shadow: none; font-stretch: 100%; }
.bignum.pop { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(1.6); opacity: 0; } }
.live-ctrl { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 12px; }
.stat { display: flex; align-items: baseline; gap: 6px; padding: 8px 12px; border-radius: 10px; background: #0006; font-size: 13px; color: var(--text-2); }
.stat b { font-size: 20px; color: #fff; font-variant-numeric: tabular-nums; }
.stat.hot { background: var(--ok); color: #000; animation: pulse 1.2s infinite; }
.stat.hot b { color: #000; }
.stat.warm { box-shadow: inset 0 0 0 1px #ffb000; }
.stat.warm b { color: #ffb000; }
.board { display: grid; grid-template-columns: repeat(15, 1fr); gap: 4px; }
.board button {
  aspect-ratio: 1; border: 0; border-radius: 8px; background: #ffffff0a; color: #ffffff66; font-weight: 700; font-size: 14px; cursor: pointer;
  font-variant-numeric: tabular-nums; transition: background .2s, color .2s;
}
.board button:hover { background: #ffffff1a; color: #fff; }
.board button.on { background: var(--accent); color: #000; }
.board button.last { background: #fff; color: #000; box-shadow: 0 0 14px var(--accent); }
@media (max-width: 760px) {
  .live-head { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(10, 1fr); }
}

/* Aktion */
.monitor { position: relative; aspect-ratio: 16 / 9; margin-bottom: 14px; border-radius: 10px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px var(--line); }
.monitor iframe { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; }
.act { border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.act-title { font: 900 22px var(--font); font-stretch: 115%; margin-bottom: 4px; }
.act p { margin: 0; }
.act.draw { background: #ffffff08; }
.act.claim, .act.verify { background: #ffb00018; box-shadow: inset 0 0 0 1px #ffb00066; }
.act.winner { background: #2bff8818; box-shadow: inset 0 0 0 1px #2bff8866; }
.act.idle { background: #ffffff08; }
.claim-btn {
  width: 100%; margin-top: 12px; padding: 18px; font: 900 22px var(--font); font-stretch: 115%; letter-spacing: .02em;
  background: linear-gradient(135deg, var(--accent), #ff7a00); box-shadow: 0 8px 30px -8px var(--accent);
}
.scan { display: flex; gap: 8px; }
.scan input { font: 20px var(--mono); letter-spacing: .04em; }
#cam { width: 100%; margin-top: 10px; border-radius: 10px; }
#verifyBox { margin-top: 12px; }
.vres { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 10px; font-weight: 800; }
.vres small { font: 15px var(--mono); font-weight: 400; opacity: .8; }
.vres.ok { background: var(--ok); color: #000; }
.vres.bad { background: var(--bad); color: #fff; }
.vgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 10px 0; }
.vgrid span { aspect-ratio: 1.3; display: grid; place-items: center; background: #fff; color: #000; font-weight: 800; border-radius: 6px; font-size: 18px; }
.vgrid span.m { background: var(--accent); }
.vgrid span.p { box-shadow: inset 0 0 0 4px #000; }
.vgrid span.p:not(.m) { box-shadow: inset 0 0 0 3px var(--bad); background: #ffe1e5; }
#decisionRow { margin-top: 10px; }
#decisionRow[hidden] { display: none; }
.log { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.log li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: #0006; font-size: 13px; }
.log li.empty { display: block; color: var(--muted); background: none; padding: 0; }
.log li time { color: var(--muted); font: 13px var(--mono); }
.log li .who { color: var(--text-2); }
.log li b.ok { color: var(--ok); }
.log li b.bad { color: var(--bad); }
.log li b.warn { color: #ffb000; }
.log li .btn { padding: 4px 10px; font-size: 12px; }

/* Tabs */
.tabbar { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabbar button { border: 0; background: transparent; color: var(--text-2); padding: 10px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.tabbar button:hover { color: #fff; background: #ffffff0a; }
.tabbar button.on { color: #000; background: var(--accent); }
.pill { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: #ffffff22; }
.tabbar button.on .pill { background: #0003; }
.tab { display: none; padding: 16px; }
.tab.on { display: block; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 0; padding: 6px 10px; border-radius: 99px; background: #ffffff12; color: #fff; cursor: pointer; font-size: 13px; }
.chips button:hover { background: var(--accent); color: #000; }
.winners { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.winners li { padding: 12px; border-radius: 10px; background: #0006; border-left: 4px solid var(--accent); }
.winners li b { font-size: 18px; }
.winners li small { display: block; color: var(--muted); margin-top: 4px; }
.urls { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.urls a { color: var(--accent); font: 18px var(--mono); }
.qr { display: flex; gap: 16px; flex-wrap: wrap; }
.qr figure { margin: 0; text-align: center; }
.qr img { width: 180px; height: 180px; border-radius: 10px; background: #fff; padding: 6px; }
.qr figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
.files { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.files li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: #0006; font-size: 14px; }
.files li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files li small { color: var(--muted); }
.files li .btn { padding: 4px 10px; font-size: 12px; }
.files li.empty { background: none; padding: 0; color: var(--muted); }
.upload { align-self: flex-start; cursor: pointer; }
.upbar { position: relative; height: 26px; border-radius: 8px; background: #0006; overflow: hidden; }
.upbar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); }
.upbar span { position: relative; display: block; text-align: center; line-height: 26px; font-size: 13px; font-weight: 700; mix-blend-mode: difference; }
.big-text { font-size: 18px; color: #fff; }
.fixtures { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.fx { text-align: center; font-size: 11px; color: var(--muted); }
.fx i { display: block; height: 32px; border-radius: 8px; margin-bottom: 4px; box-shadow: inset 0 0 0 1px #ffffff22; }
.keys { line-height: 2.2; }

#toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: #000e; border: 1px solid var(--accent);
  padding: 12px 18px; border-radius: 12px; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; max-width: calc(100% - 32px); z-index: 50;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
