/* inf.zone live — ein Stylesheet für Handy, Beamer und Steuerung */

:root {
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #ebe7dc;
  --text: #1d1b16;
  --muted: #6b665a;
  --line: #d8d2c3;
  --accent: #c2410c;
  --accent-soft: #fde4d4;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --bad: #b91c1c;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --wheel-outer: #ffffff;
  --wheel-inner: #f6e7d8;
  --wheel-hub: #1d1b16;
  --wheel-hub-text: #ffffff;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12110f;
    --surface: #1c1b18;
    --surface-2: #26241f;
    --text: #f1ede4;
    --muted: #a39d8f;
    --line: #34312a;
    --accent: #fb923c;
    --accent-soft: #3b2412;
    --ok: #4ade80;
    --ok-soft: #12301d;
    --warn: #fbbf24;
    --bad: #f87171;
    --wheel-outer: #23211d;
    --wheel-inner: #33281d;
    --wheel-hub: #f1ede4;
    --wheel-hub-text: #12110f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12110f;
  --surface: #1c1b18;
  --surface-2: #26241f;
  --text: #f1ede4;
  --muted: #a39d8f;
  --line: #34312a;
  --accent: #fb923c;
  --accent-soft: #3b2412;
  --ok: #4ade80;
  --ok-soft: #12301d;
  --warn: #fbbf24;
  --bad: #f87171;
  --wheel-outer: #23211d;
  --wheel-inner: #33281d;
  --wheel-hub: #f1ede4;
  --wheel-hub-text: #12110f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.45;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }

/* ------------------------------------------------------------- Kopf */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  max-width: 560px;
  margin: 0 auto;
}
.brand { font-weight: 600; letter-spacing: .01em; color: var(--muted); }
.brand b { color: var(--accent); font-weight: 800; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
}
.pill.live { color: var(--ok); }
.pill.offline { color: var(--warn); }
.pill.closed { color: var(--muted); }

/* --------------------------------------------------------- Handy */

.phone { max-width: 560px; margin: 0 auto; padding: 0 16px 40px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 0 0 14px;
}
.card h1 { font-size: 22px; line-height: 1.2; margin: 0 0 6px; }
.card .sub { color: var(--muted); margin: 0 0 14px; font-size: 15px; }
.lead { font-size: 18px; margin: 0; }
.muted { color: var(--muted); }

.overview {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: .08em;
  line-height: 2.1;
  word-spacing: .2em;
  margin: 6px 0 16px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.overview .w { white-space: nowrap; display: inline-block; margin-right: .5em; }
.overview .ch { display: inline-block; min-width: .7em; text-align: center; border-radius: 4px; }
.overview .mine {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 800;
  padding: 0 .12em;
}
.overview .pl { display: block; font-size: 11px; line-height: 1; color: var(--ok); font-weight: 700; }

.keyline {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border-radius: 10px; padding: 8px 12px; margin: 0 0 14px;
}
.keyline b { font-size: 22px; font-family: var(--mono); }

.slots { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 14px; }
.slot {
  flex: 1 1 0;
  min-width: 92px;
  max-width: 150px;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 10px 8px 12px;
  text-align: center;
  border: 2px solid transparent;
}
.slot.active { border-color: var(--accent); }
.slot .pos { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.slot .c { font-family: var(--mono); font-size: 40px; font-weight: 800; line-height: 1.1; color: var(--accent); }
.slot .arrow { color: var(--muted); font-size: 14px; line-height: 1; margin: 2px 0 6px; }
.slot input {
  width: 64px; height: 64px;
  font-family: var(--mono); font-size: 38px; font-weight: 800; text-align: center;
  text-transform: uppercase;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0;
}
.slot input:focus { outline: none; border-color: var(--accent); }
.slot input:disabled { opacity: .7; }
.slot .ok { color: var(--ok); font-size: 13px; font-weight: 700; margin-top: 6px; min-height: 1.2em; }
.slot .ok.bad { color: var(--bad); }

.bigword {
  font-family: var(--mono);
  font-size: clamp(40px, 13vw, 64px);
  font-weight: 800;
  letter-spacing: .14em;
  text-align: center;
  color: var(--accent);
  margin: 6px 0 4px;
  overflow-wrap: anywhere;
}
.plainword {
  font-family: var(--mono);
  font-size: clamp(28px, 9vw, 44px);
  font-weight: 800;
  letter-spacing: .14em;
  text-align: center;
  color: var(--ok);
  margin: 0 0 8px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 12px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  touch-action: manipulation;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.ok { background: var(--ok); color: var(--bg); }
.btn.wide { width: 100%; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .btn { flex: 1 1 auto; }
.linkbtn {
  background: none; border: 0; padding: 10px 0 0; color: var(--accent);
  font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.status-line { margin: 10px 0 0; min-height: 1.4em; font-size: 15px; color: var(--muted); }
.status-line.ok { color: var(--ok); font-weight: 600; }
.status-line.err { color: var(--bad); font-weight: 600; }

.wordin {
  width: 100%;
  font-family: var(--mono); font-size: 30px; font-weight: 800; letter-spacing: .18em; text-align: center;
  text-transform: uppercase;
  border-radius: 12px; border: 2px solid var(--line);
  background: var(--surface); color: var(--text);
  padding: 10px; margin: 6px 0 12px;
}
.wordin:focus { outline: none; border-color: var(--accent); }

/* ---------------------------------------------------------- Rad */

.wheel-card { padding: 14px 14px 16px; }
.wheel-wrap { width: 100%; max-width: 420px; margin: 0 auto; }
.wheel { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.wheel:active { cursor: grabbing; }
.wheel .disk-outer { fill: var(--wheel-outer); stroke: var(--line); stroke-width: 2; }
.wheel .disk-inner { fill: var(--wheel-inner); stroke: var(--line); stroke-width: 2; }
.wheel .sep { stroke: var(--line); stroke-width: 1; }
.wheel .lo { font-family: var(--mono); font-size: 21px; font-weight: 700; fill: var(--text); text-anchor: middle; dominant-baseline: central; }
.wheel .no { font-family: var(--sans); font-size: 10.5px; fill: var(--muted); text-anchor: middle; dominant-baseline: central; }
.wheel .li { font-family: var(--mono); font-size: 20px; font-weight: 700; fill: var(--accent); text-anchor: middle; dominant-baseline: central; }
.wheel .li.mark { fill: var(--surface); }
.wheel .mark-bg { fill: var(--accent); }
.wheel .lo.sel, .wheel .li.sel { fill: var(--ok); font-size: 25px; }
.wheel .li.mark.sel { fill: var(--surface); }
.wheel .spoke { stroke: var(--ok); stroke-width: 3; stroke-linecap: round; opacity: .85; }
.wheel .pointer { fill: var(--accent); }
.wheel .hub { fill: var(--wheel-hub); }
.wheel .hub-n { font-family: var(--mono); font-size: 40px; font-weight: 800; fill: var(--wheel-hub-text); text-anchor: middle; dominant-baseline: central; }
.wheel .hub-l { font-family: var(--sans); font-size: 10px; fill: var(--wheel-hub-text); opacity: .75; text-anchor: middle; letter-spacing: .08em; }
.wheel .tap { fill: transparent; cursor: pointer; }
.wheel-ctl { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; }
.wheel-ctl .step {
  width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--surface-2); font-size: 28px; font-weight: 700; cursor: pointer; touch-action: manipulation;
}
.wheel-ctl .readout { min-width: 130px; text-align: center; line-height: 1.2; }
.wheel-ctl .readout b { font-family: var(--mono); font-size: 26px; display: block; }
.wheel-ctl .readout span { font-size: 13px; color: var(--muted); }
.wheel-legend { text-align: center; font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.wheel-legend .k1 { color: var(--text); font-weight: 700; }
.wheel-legend .k2 { color: var(--accent); font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-size: 15px; max-width: calc(100% - 32px);
  z-index: 50;
}
.foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; }

/* ------------------------------------------------------- Beamer */

body.beamer {
  --bg: #0d0f14;
  --surface: #161a22;
  --surface-2: #1f2430;
  --text: #f4f1ea;
  --muted: #8d93a3;
  --line: #2a303d;
  --accent: #ffb547;
  --ok: #4ade80;
  --bad: #ff6b6b;
  color-scheme: dark;
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
  font-size: 1.6vh;
}
.b-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21vw;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 2vh 2.2vw;
  height: 100vh;
  padding: 2.6vh 2.4vw 2vh;
}
.b-head { grid-column: 1 / 2; display: flex; align-items: baseline; gap: 2vw; min-width: 0; }
.b-title { font-size: 4.2vh; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-sub { font-size: 2.3vh; color: var(--muted); white-space: nowrap; }
.b-stage { grid-column: 1 / 2; grid-row: 2 / 3; position: relative; min-height: 0; }
.b-side {
  grid-column: 2 / 3; grid-row: 1 / 4;
  display: flex; flex-direction: column; gap: 2vh; min-height: 0;
}
.b-qr { background: #fff; border-radius: 1.4vh; padding: 1vh; }
.b-qr img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.b-url { font-family: var(--mono); font-size: 2.9vh; font-weight: 700; text-align: center; color: var(--text); letter-spacing: .02em; }
.b-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2vh; }
.b-stat { background: var(--surface); border-radius: 1.2vh; padding: 1.2vh 1.2vw; }
.b-stat b { display: block; font-size: 4.6vh; line-height: 1.05; font-variant-numeric: tabular-nums; }
.b-stat span { font-size: 1.7vh; color: var(--muted); }
.b-phase { font-size: 2.2vh; padding: .6vh 1.2vw; align-self: flex-start; }
.b-phase.open { color: var(--ok); }
.b-keys { margin-top: auto; font-size: 1.45vh; color: #5d6474; line-height: 1.7; }
.b-keys kbd {
  font-family: var(--mono); font-size: 1.3vh; border: 1px solid #3a4150; border-radius: 4px;
  padding: 0 .4em; color: #9aa1b1;
}
.b-foot { grid-column: 1 / 2; grid-row: 3 / 4; min-height: 0; }

/* Wörter und Stellen */
.words {
  --w: 70px;
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center;
  column-gap: calc(var(--w) * .55);
  row-gap: calc(var(--w) * .3);
  height: 100%;
}
.word { display: flex; gap: calc(var(--w) * .08); }
.cell { width: var(--w); display: flex; flex-direction: column; align-items: center; }
.rain {
  position: relative;
  width: 100%;
  height: calc(var(--w) * 1.45);
  overflow: hidden;
}
.alts {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column-reverse; align-items: center;
  gap: calc(var(--w) * .02);
}
.alt {
  font-family: var(--mono); font-weight: 700; line-height: 1;
  color: var(--muted);
  transition: font-size .4s ease, opacity .4s ease;
}
.drop {
  position: absolute; top: 0;
  font-family: var(--mono); font-weight: 800; font-size: calc(var(--w) * .42); line-height: 1;
  color: var(--accent);
  animation: fall 1.1s cubic-bezier(.45, 0, .8, .6) forwards;
  pointer-events: none;
}
@keyframes fall {
  0% { transform: translateY(calc(var(--w) * -.5)); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(var(--fall, 80px)); opacity: 0; }
}
.base {
  width: 100%;
  height: calc(var(--w) * 1.08);
  display: flex; align-items: flex-end; justify-content: center;
  border-bottom: max(3px, calc(var(--w) * .05)) solid #3a4150;
  position: relative;
}
.maj {
  font-family: var(--mono); font-weight: 900; line-height: .95;
  font-size: calc(var(--w) * 1);
  color: var(--text);
  transition: opacity .5s ease, color .5s ease;
}
.maj.empty { color: #2d3340; font-weight: 400; }
.cell.firm .base { border-bottom-color: var(--ok); }
.cell.ok .maj { color: var(--ok); }
.cell.ok .base { border-bottom-color: var(--ok); }
.cell.bad .maj { color: var(--accent); }
.cell.bad .base { border-bottom-color: var(--bad); }
.ciph {
  font-family: var(--mono); font-weight: 700;
  font-size: calc(var(--w) * .36);
  color: var(--accent);
  opacity: .8;
  margin-top: calc(var(--w) * .08);
  line-height: 1.1;
}
.conf { width: 84%; margin-top: calc(var(--w) * .07); display: flex; flex-direction: column; align-items: center; gap: calc(var(--w) * .03); }
.bar { width: 100%; height: max(4px, calc(var(--w) * .07)); background: #232835; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--muted); border-radius: 99px; transition: width .5s ease, background .5s ease; }
.conf .cn { white-space: nowrap; font-size: calc(var(--w) * .2); color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1; }

/* Histogramm */
.hist { height: 100%; display: flex; flex-direction: column; background: var(--surface); border-radius: 1.4vh; padding: 1.4vh 1.4vw 1vh; }
.hist-title { font-size: 2vh; color: var(--muted); margin-bottom: .8vh; display: flex; justify-content: space-between; }
.hist-title b { color: var(--text); }
.hist-bars { flex: 1; display: grid; grid-template-columns: repeat(26, 1fr); gap: .45vw; align-items: end; min-height: 0; }
.hb { display: flex; flex-direction: column; align-items: center; height: 100%; min-height: 0; }
.hb .v { font-size: 1.6vh; color: var(--muted); font-variant-numeric: tabular-nums; height: 2.2vh; line-height: 2.2vh; }
.hb .track { flex: 1; width: 100%; position: relative; min-height: 0; }
.hb .b { position: absolute; left: 0; right: 0; bottom: 0; background: #3a4150; border-radius: .5vh .5vh 0 0; min-height: 2px; transition: height .4s ease; }
.hb .l { font-family: var(--mono); font-size: 2.1vh; font-weight: 700; margin-top: .4vh; color: var(--muted); }
.hb.hmax .b { background: var(--accent); }
.hb.hmax .l, .hb.hmax .v { color: var(--accent); }

/* Privat */
.priv { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vh; text-align: center; }
.priv .round { font-size: 2.6vh; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.priv .cw { font-family: var(--mono); font-weight: 900; font-size: 20vh; line-height: 1; letter-spacing: .12em; color: var(--accent); }
.priv .pw { font-family: var(--mono); font-weight: 900; font-size: 13vh; line-height: 1; letter-spacing: .12em; color: var(--ok); }
.priv .note { font-size: 2.6vh; color: var(--muted); max-width: 60vw; }
.priv .hist-line { font-family: var(--mono); font-size: 5vh; font-weight: 800; letter-spacing: .1em; color: var(--ok); }
.priv .hist-line .pending { color: #3a4150; }
.counter { font-size: 3vh; color: var(--muted); }
.counter b { font-size: 8vh; color: var(--text); display: block; line-height: 1; font-variant-numeric: tabular-nums; }

/* Schlüsselsuche */
.keys-head { text-align: center; margin-bottom: 1.6vh; }
.keys-head .cw { font-family: var(--mono); font-weight: 900; font-size: 7vh; letter-spacing: .14em; color: var(--accent); line-height: 1; }
.keys-head .note { color: var(--muted); font-size: 2vh; margin-top: .6vh; }
.keygrid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(13, 1fr); gap: .5vh 2vw; flex: 1; min-height: 0; }
.keys { display: flex; flex-direction: column; height: 100%; }
.krow { display: grid; grid-template-columns: 3.4vw 1fr 8.5vw; align-items: center; gap: 1vw; background: var(--surface); border-radius: .9vh; padding: 0 1vw; min-height: 0; transition: background .5s ease, box-shadow .5s ease; }
.krow .k { font-family: var(--mono); font-size: 2.4vh; color: var(--muted); white-space: nowrap; text-align: right; }
.krow .w { font-family: var(--mono); font-size: 3.1vh; font-weight: 800; letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.krow .w.empty { color: #3a4150; }
.krow .n { font-size: 1.8vh; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.krow.lit { background: #183626; box-shadow: inset 0 0 0 2px var(--ok); }
.krow.lit .w { color: var(--ok); }
.krow.answer { background: #183626; box-shadow: inset 0 0 0 3px var(--ok); }

/* QR groß */
.qr-overlay {
  position: fixed; inset: 0; z-index: 20;
  background: var(--bg);
  display: grid; grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 6vw;
  padding: 6vh 6vw;
}
.qr-overlay .b-qr { width: 70vh; padding: 2vh; border-radius: 2.4vh; }
.qr-overlay .txt { max-width: 38vw; }
.qr-overlay .t1 { font-size: 3vh; color: var(--muted); margin: 0 0 1vh; }
.qr-overlay .t2 { font-family: var(--mono); font-size: 8vh; font-weight: 800; color: var(--text); line-height: 1.05; margin: 0 0 4vh; overflow-wrap: anywhere; }
.qr-overlay .t3 { font-size: 4vh; font-weight: 800; margin: 0 0 1vh; }
.qr-overlay .t4 { font-size: 3vh; color: var(--muted); }
.qr-overlay .t4 b { color: var(--accent); font-size: 6vh; font-variant-numeric: tabular-nums; }

.empty-stage { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 3vh; }

.login { max-width: 420px; margin: 18vh auto; padding: 24px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }
.login input { width: 100%; font: inherit; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); margin: 10px 0 14px; }
body.beamer .login { font-size: 18px; }

/* ------------------------------------------------------- Steuerung */

.admin { max-width: 980px; margin: 0 auto; padding: 0 16px 60px; }
.admin h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.admin .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .admin .grid2 { grid-template-columns: 1fr; } }
.admin .btn { min-height: 44px; font-size: 16px; padding: 0 16px; }
.admin .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.admin .btn.on { box-shadow: inset 0 0 0 2px var(--accent); }
.admin .btn.danger { background: var(--bad); color: #fff; }
.admin label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
.admin input[type=text], .admin input[type=number], .admin select, .admin textarea {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text);
}
.admin textarea { font-family: var(--mono); min-height: 90px; }
.admin .check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 15px; margin: 0 0 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.mini { display: flex; flex-wrap: wrap; gap: 4px; font-family: var(--mono); }
.mini .m { width: 34px; text-align: center; border-radius: 6px; background: var(--surface-2); padding: 3px 0; line-height: 1.15; }
.mini .m b { display: block; font-size: 17px; }
.mini .m small { display: block; font-size: 10px; color: var(--muted); }
.mini .gap { width: 12px; }
.linkbox { font-family: var(--mono); font-size: 14px; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }
.err-box { color: var(--bad); font-weight: 600; min-height: 1.3em; margin: 8px 0 0; }
.keyline .btn { background: var(--surface); min-height: 42px; font-size: 15px; padding: 0 14px; border: 1px solid var(--line); }
a.btn { text-decoration: none; }
