/* Werwolf-Erzähler, Stil „Wolfsblut“ wie Pult und Prototyp (docs/superpowers/prototypes/ablauf.html):
   Kohle und Asche, Dunkelrot als einziger Akzent, Serifen. Dunkle Räume, eine Hand, Hochformat. */
@font-face {
  font-family: 'UnifrakturMaguntia';
  src: url('fonts/UnifrakturMaguntia-Book.ttf') format('truetype');
  font-display: swap;
}
:root {
  --bg: #0a0909; --bar: #0e0c0c; --panel: #141111; --panel-2: #1a1515;
  --text: #d9d4cc; --bright: #ece6dc; --muted: #8a8580; --dim: #5a5550; --line: #2a2222;
  --red: #8f1d1d; --red-on: #a82422; --red-text: #c9473f; --gold: #b8a27a;
  --paper: #e6dcc6; --ink: #241a12;
  --serif: 'Palatino Linotype', 'Book Antiqua', 'URW Palladio L', 'P052', Georgia, 'Noto Serif', 'DejaVu Serif', serif;
  --black: 'UnifrakturMaguntia', 'Old English Text MT', 'Palatino Linotype', Georgia, serif;
  --fs: 1;
  --tap: 56px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  height: 100dvh; overflow: hidden; color: var(--text); background: #050404;
  font: 16px/1.4 var(--serif); -webkit-text-size-adjust: 100%; overscroll-behavior: none;
  user-select: none; -webkit-user-select: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }

.setup { height: 100dvh; overflow: auto; display: grid; place-items: safe center; padding: 24px 16px; background: #100d0c; }
.setup-card { width: min(100%, 390px); overflow: hidden; border: 1px solid #514034; background: #181413; }
.setup-portrait { display: block; width: 100%; height: clamp(100px, 24vh, 200px); object-fit: cover; object-position: 50% 30%; }
.setup-body { padding: 24px; }
.setup-series { margin: 0; color: var(--gold); letter-spacing: .14em; text-transform: uppercase; font-size: .85rem; }
.setup-body h1 { margin: 3px 0 10px; font: 2.8rem/1.2 var(--black); color: var(--bright); }
.setup-body p { line-height: 1.45; }
.setup-body button { display: block; width: 100%; margin: 10px 0; border: 1px solid #976954; border-radius: 4px; background: #762320; color: #fff2db; min-height: 48px; }
.setup-body button[hidden] { display: none; }
.setup-body details { margin-top: 20px; border-top: 1px solid #554337; }
.setup-body summary { padding: 14px 0 4px; cursor: pointer; color: var(--paper); }

/* ------------------------------------------------------------------ frame */
#app {
  position: relative; height: 100dvh; max-width: 640px; margin: 0 auto; overflow: hidden;
  display: flex; flex-direction: column; background: var(--bg); color: var(--text);
}
.n-top {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 6px) 10px 8px 16px; border-bottom: 1px solid var(--line); background: var(--bar);
}
.phase { font-size: 19px; color: var(--bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.phase small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .14em; font-variant: small-caps; }
.chip {
  margin-left: auto; min-height: 44px; display: inline-flex; align-items: center; padding: 2px 12px;
  border: 1px solid var(--line); border-radius: 22px; background: #161010; font-size: 20px; color: var(--bright);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip small { font-size: 11px; color: var(--muted); margin-right: 6px; letter-spacing: .1em; font-variant: small-caps; }
.chip.warn { color: var(--gold); }
.chip.up { color: var(--red-text); border-color: var(--red-on); }
.chip.paused { color: var(--muted); }
.cdot { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: none; }
.chip:not([hidden]) + .cdot { margin-left: 0; }
.cdot i { width: 11px; height: 11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 7px var(--gold); }
.cdot.warn i { background: var(--red-text); box-shadow: 0 0 7px var(--red-text); }
.cdot.off i { background: var(--dim); box-shadow: none; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.banner { flex: none; margin: 0; padding: 8px 16px; background: #2a1010; border-bottom: 1px solid var(--red); color: var(--bright); font-size: 15px; text-align: center; }

.rstrip { flex: none; display: flex; gap: 6px; padding: 7px 12px; overflow-x: auto; scrollbar-width: none; background: #0f0b0b; border-bottom: 1px solid #1c1717; font-size: 13.5px; white-space: nowrap; }
.rstrip::-webkit-scrollbar { display: none; }
.rstrip.muted { color: var(--dim); font-style: italic; }
.rc { flex: none; padding: 4px 10px; border: 1px solid #2a2222; border-radius: 13px; color: var(--text); transition: font-size .2s; }
.rc b { font-weight: 400; color: var(--gold); font-variant: small-caps; letter-spacing: .06em; }
.rc.w b { color: var(--red-text); }
.rc i { font-style: normal; }
.rc i.x { color: var(--dim); text-decoration: line-through; }
.rc.call { order: -1; border-color: var(--red-on); background: #2a1212; color: var(--bright); font-size: 17px; padding: 5px 12px; }
.tl { flex: none; display: flex; gap: 6px; padding: 7px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid #1c1717; background: #0c0a0a; }
.tl::-webkit-scrollbar { display: none; }
.tlc { flex: none; min-height: 34px; padding: 4px 11px; border: 1px solid #241d1d; border-radius: 17px; background: none; color: var(--dim); font-size: 13px; white-space: nowrap; }
.tlc.d { color: #8d8274; border-color: #2a2420; }
.tlc.d::before { content: '✓ '; color: var(--gold); }
.tlc.c { color: var(--bright); border-color: var(--red-on); background: #2a1212; }

.scroll {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding: 14px calc(env(safe-area-inset-right) + 16px) 22px calc(env(safe-area-inset-left) + 16px);
  scrollbar-width: thin; scrollbar-color: #2a2222 transparent;
}
body.stale .scroll { opacity: .6; }
.kick { margin: 0; color: var(--red-text); font-size: 12px; letter-spacing: .2em; font-variant: small-caps; }
h1 { margin: 2px 0 12px; font-family: var(--black); font-size: calc(31px * var(--fs)); font-weight: 400; line-height: 1.12; color: var(--bright); letter-spacing: .01em; }

/* ---------------------------------------------------------------- blocks */
.read {
  margin: 0 0 12px; padding: 14px 16px; border-left: 3px solid var(--red); background: #120e0e; border-radius: 0 8px 8px 0;
  font-size: calc(20px * var(--fs)); line-height: 1.45; color: var(--bright); user-select: text; -webkit-user-select: text;
}
.read::before { content: 'Vorlesen'; display: block; margin-bottom: 4px; font-size: 11px; color: var(--red-text); letter-spacing: .2em; font-variant: small-caps; }
.du { margin: 12px 0; padding: 10px 12px; border: 1px dashed #3a3026; border-radius: 8px; color: var(--text); font-size: calc(15px * var(--fs)); }
.du b { font-weight: 400; color: var(--gold); font-variant: small-caps; letter-spacing: .14em; margin-right: 4px; }
.line { display: grid; grid-template-columns: 40px 1fr 52px; gap: 10px; align-items: center; margin: 8px 0; padding: 8px 6px 8px 8px; border: 1px solid #221b1b; border-radius: 10px; background: #100d0d; }
.line img, .line .ph { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid #3a2a20; background: #2a2018; }
.line .lt { font-size: calc(14.5px * var(--fs)); line-height: 1.35; color: var(--text); min-width: 0; }
.line .lt b { display: block; font-weight: 400; font-size: 11px; color: var(--gold); letter-spacing: .14em; font-variant: small-caps; }
.line .lt i { color: var(--bright); }
.line .lt em { display: block; margin-top: 3px; font-style: normal; font-size: 12.5px; color: var(--muted); }
.play { width: 52px; height: 52px; border-radius: 50%; border: 1px solid #3a2626; background: #1a1212; color: var(--bright); font-size: 17px; display: grid; place-items: center; padding: 0; }
.line.on { border-color: var(--red-on); background: #1d1010; }
.line.on .play { background: var(--red); }
.gapw { display: inline-block; min-width: 50px; padding: 0 6px; border-bottom: 2px solid var(--red-text); color: var(--red-text); font-style: normal; }
.h3 { margin: 16px 0 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12px; color: var(--muted); letter-spacing: .18em; font-variant: small-caps; }
.h3 em { font-style: normal; letter-spacing: .06em; font-variant: normal; color: var(--dim); font-size: 12px; }
.res { margin: 12px 0 0; padding: 12px 14px; border-radius: 8px; background: #15110b; border-left: 3px solid var(--gold); color: var(--bright); font-size: 16px; }
.res.bad { border-left-color: var(--red-text); background: #1a0e0e; }
.res small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.calc { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px; padding: 12px 14px; border: 1px solid #2a2222; border-radius: 8px; background: #0f0c0c; font-size: 15px; }
.calc span { color: var(--muted); }
.calc b { font-weight: 400; color: var(--bright); }
.calc .sum { border-top: 1px solid #2a2222; padding-top: 6px; margin-top: 2px; }
.calc b.sum { color: var(--red-text); font-size: 18px; }
.media { margin: 0 0 12px; border: 1px solid #2a2222; border-radius: 10px; overflow: hidden; background: #0f0c0c; }
.media .mi { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; font-size: 16px; }
.media img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.media span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.prog { height: 4px; background: #2a2222; }
.prog i { display: block; height: 100%; width: 0; background: var(--red-text); }
.prog i.run { animation: prog 40s linear forwards; }
@keyframes prog { to { width: 100%; } }
.checkl { list-style: none; margin: 0 0 10px; padding: 0; }
.checkl li { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 46px; padding: 6px 0; border-bottom: 1px solid #1d1818; font-size: 16px; }
.checkl li span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.checkl li span.ok { color: var(--gold); }
.checkl li span.ok::before { content: '●  '; font-size: 10px; vertical-align: 2px; }
.checkl li span.no { color: var(--red-text); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 5px 11px; border-radius: 15px; border: 1px solid #2c2424; color: var(--text); font-size: 15px; background: #110e0e; }
.pill.dead { color: var(--dim); text-decoration: line-through; }
.pill.off { color: var(--muted); border-style: dashed; }
.pill.new { animation: pop .5s ease; border-color: var(--gold); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.acc { margin: 10px 0; border: 1px solid #261f1f; border-radius: 10px; background: #0f0c0c; overflow: hidden; }
.acc > button { width: 100%; min-height: 56px; padding: 8px 14px; border: 0; background: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; font-size: 17px; color: var(--bright); }
.acc > button small { display: block; color: var(--muted); font-size: 12px; }
.acc > button::after { content: '▾'; color: var(--muted); }
.acc.open > button::after { content: '▴'; }
.acc .in { padding: 0 12px 12px; }
.acc.off > button { color: var(--dim); cursor: default; }
.acc.off > button::after { content: ''; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chipbtn { min-height: 46px; padding: 4px 12px 4px 6px; border: 1px solid var(--line); border-radius: 23px; background: var(--panel); color: var(--text); font-size: 15px; display: inline-flex; gap: 8px; align-items: center; }
.chipbtn.np { padding-left: 14px; }
.chipbtn img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.chipbtn.on { background: var(--red); border-color: var(--red-on); color: var(--bright); }
.chipbtn.done { border-color: #4a3d22; }
.chipbtn small { color: var(--muted); font-size: 12px; }
.chipbtn.on small { color: #f0c8c0; }
.hstep { margin: 8px 0; padding: 12px; border: 1px solid #3a2626; border-radius: 10px; background: #160f0f; }
.hstep .who { font-size: 11px; color: var(--gold); letter-spacing: .14em; font-variant: small-caps; }
.hstep .tx { font-size: calc(18px * var(--fs)); color: var(--bright); margin: 4px 0 8px; line-height: 1.35; }
.hstep .up { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.hnav { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 8px; }
.hnav button { min-height: 52px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.hnav button.pr { background: #2a1414; border-color: var(--red-on); color: var(--bright); }
.hnav button:disabled { opacity: .35; }
.hdots { display: flex; gap: 5px; margin: 6px 0; }
.hdots i { flex: 1; height: 3px; background: #2a2222; border-radius: 2px; }
.hdots i.d { background: var(--red-text); }
.tally { display: grid; gap: 6px; }
.tally .tr { display: grid; grid-template-columns: 82px 1fr 28px; gap: 8px; align-items: center; font-size: 16px; }
.tally .tr span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tally .tr i { display: block; height: 16px; border-radius: 3px; background: var(--red); transition: width .4s; }
.tally .tr b { font-weight: 400; text-align: right; font-variant-numeric: tabular-nums; }
.tally .tr.lead i { background: var(--red-text); }
.tally .vn { margin: -3px 0 3px; font-size: 12.5px; color: var(--muted); }
.reveal { display: flex; align-items: center; gap: 14px; margin: 12px 0; padding: 14px; border-radius: 10px; background: radial-gradient(ellipse at 40% 30%, #efe6d2, var(--paper) 60%, #cdbf9f); color: var(--ink); }
.reveal svg { width: 52px; height: 52px; fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.reveal.wolf svg { stroke: #7a1414; }
.reveal b { display: block; font-weight: 400; font-size: 23px; font-variant: small-caps; letter-spacing: .08em; }
.reveal small { font-size: 14px; color: #5a4632; }
.reveal.hid { background: #161212; color: var(--muted); }
.reveal.hid svg { stroke: var(--dim); }
.called { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: linear-gradient(#2a1212, #1a0e0e); border: 1px solid var(--red-on); }
.called small { display: block; font-size: 11px; color: var(--red-text); letter-spacing: .2em; font-variant: small-caps; }
.called b { font-weight: 400; font-size: calc(23px * var(--fs)); color: var(--bright); }
.called .x { color: var(--dim); text-decoration: line-through; }
.todo { position: relative; margin: 0 0 12px; padding: 12px 14px; border-radius: 10px; background: #15110b; border: 1px solid #4a3d22; border-left: 4px solid var(--gold); color: var(--bright); font-size: calc(18px * var(--fs)); line-height: 1.35; }
.todo small { display: block; font-size: 11px; color: var(--gold); letter-spacing: .2em; font-variant: small-caps; margin-bottom: 2px; }
.todo b { font-weight: 400; color: #fff3dc; border-bottom: 1px solid var(--gold); }
.todo b.bad { color: var(--red-text); border-color: var(--red-text); }
.todo.sk { border-left-color: var(--dim); background: #121010; }
.todo.has-chg { padding-right: 92px; }
.todo .chg { position: absolute; right: 8px; top: 8px; min-height: 40px; padding: 2px 12px; border: 1px solid #3a3226; border-radius: 20px; background: none; color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.sbtn { min-height: 56px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font-size: 15px; line-height: 1.15; overflow-wrap: anywhere; }
.sbtn small { display: block; font-size: 11.5px; color: var(--muted); }
.sbtn.on { background: var(--red); border-color: var(--red-on); color: var(--bright); }
.sbtn.on small { color: #e8b9b2; }
.sbtn:disabled { opacity: .35; }
.sbtn.danger { border-color: #5a1a1a; color: var(--red-text); }
.sbtn.armed { background: var(--red-on); color: var(--bright); }
.sbtn.wide { width: 100%; margin-top: 8px; text-align: left; padding-left: 14px; }
.sbtn.big2 { min-height: 96px; text-align: left; padding: 10px 12px; }
.sbtn.big2 b { display: block; font-weight: 400; font-size: 19px; margin-bottom: 4px; }
.ptab { width: 100%; border-collapse: collapse; font-size: 15px; }
.ptab td { padding: 9px 4px; border-bottom: 1px solid #1f1919; }
.ptab td:last-child { text-align: right; color: var(--muted); }
.ptab tr.dead td:first-child { color: var(--dim); text-decoration: line-through; }
.ptab .w { color: var(--red-text); }
.form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 8px; }
.form input, .stepper output { min-width: 0; min-height: 52px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #0f0c0c; color: var(--bright); font-size: 18px; user-select: text; -webkit-user-select: text; }
.form input:focus { outline: none; border-color: var(--red-on); }
.form button { min-width: 92px; border: 1px solid var(--red-on); border-radius: 8px; background: var(--red); color: var(--bright); }
.stepper { display: grid; grid-template-columns: 1fr 56px 64px 56px; gap: 8px; align-items: center; margin-top: 8px; font-size: 16px; }
.stepper button { min-height: 52px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 22px; }
.stepper output { display: grid; place-items: center; padding: 0; font-variant-numeric: tabular-nums; }
.codebox { display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; color: var(--muted); font-size: 13px; letter-spacing: .12em; font-variant: small-caps; }
.codebox b { font-weight: 400; font-size: 30px; letter-spacing: .18em; color: var(--bright); font-variant: normal; }

/* ------------------------------------------------------------ main action */
.act { flex: none; display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--bar); }
.act button { min-height: 68px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 22px; line-height: 1; }
.act button small { display: block; margin-top: 4px; font-size: 11px; }
.act .main { background: var(--red); border-color: var(--red-on); color: var(--bright); font-size: calc(21px * var(--fs)); letter-spacing: .02em; line-height: 1.12; padding: 6px 10px; }
.act .main small { display: block; font-size: 12.5px; color: #e8b9b2; letter-spacing: .04em; margin-top: 3px; }
.act .main small:empty { display: none; }
.act .main:active:not(:disabled) { background: var(--red-on); }
.act .main:disabled { opacity: .45; }
.act button:disabled { opacity: .35; }
.drw { flex: none; display: grid; grid-template-columns: repeat(5, 1fr) 62px; border-top: 1px solid var(--line); background: #0c0a0a; padding-bottom: env(safe-area-inset-bottom); }
.drw button { min-height: 60px; padding: 4px 2px; border: 0; background: none; color: var(--muted); font-size: 11.5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; white-space: nowrap; }
.drw button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.drw button.on { color: var(--bright); background: #1a1212; }
.drw .stop { color: var(--red-text); font-variant: small-caps; letter-spacing: .1em; font-size: 15px; border-left: 1px solid var(--line); }
.drw .stop.on { background: var(--red); color: var(--bright); }

/* night: dimmed, only text and one key */
#app.night { --text: #b3aca3; --bright: #cfc8bd; }
#app.night .read { background: #0d0b0e; }
#app.night .act .main { background: #5e1515; }

/* ---------------------------------------------------------------- drawer */
.sheet {
  position: absolute; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 20; max-height: 78%;
  display: flex; flex-direction: column; background: #110e0e; border-top: 1px solid #3a2a2a; border-radius: 18px 18px 0 0;
  box-shadow: 0 -20px 50px rgba(0,0,0,.85); animation: up .2s ease;
}
@keyframes up { from { transform: translateY(24px); } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: #3a3030; margin: 8px auto 2px; flex: none; }
.sheet .sh { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 6px 16px; }
.sheet .sh b { font-weight: 400; color: var(--red-text); font-variant: small-caps; letter-spacing: .2em; font-size: 14px; }
.sheet .sh button { width: 52px; height: 52px; border: 0; background: none; color: var(--muted); font-size: 26px; }
.sheet .sbody { overflow-y: auto; padding: 0 16px 18px; min-height: 0; }
.figrow { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #1f1919; }
.figrow img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.figrow b { font-weight: 400; color: var(--bright); }
.figrow small { display: block; color: var(--muted); font-size: 13px; }
.note { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.note.bad { color: var(--red-text); }
.note.good { color: var(--gold); }
.answer { margin-top: 10px; padding: 10px 14px; border-left: 3px solid var(--red); background: #110d0d; }
.answer b { font-weight: 400; font-variant: small-caps; letter-spacing: .12em; color: var(--gold); }
.answer p { margin: 6px 0 0; font-size: calc(19px * var(--fs)); line-height: 1.35; color: var(--bright); }
.slider { display: grid; grid-template-columns: 4.5em 1fr 3em; align-items: center; gap: 10px; min-height: var(--tap); margin-top: 6px; color: var(--muted); font-size: 14px; }
.slider.db { grid-template-columns: 7.6em 1fr 4.2em; }
.slider output { text-align: right; font-variant-numeric: tabular-nums; }
input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: none; touch-action: pan-y; }
input[type='range']::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--line); }
input[type='range']::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 32px; height: 32px; margin-top: -13px; border-radius: 50%; background: var(--red); border: 2px solid var(--red-on); }
input[type='range']::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: var(--red); border: 2px solid var(--red-on); }
details.group { border-top: 1px solid var(--line); }
details.group summary { display: flex; align-items: center; min-height: var(--tap); list-style: none; cursor: pointer; font-size: 16px; }
details.group summary::-webkit-details-marker { display: none; }
details.group summary::before { content: '▸'; width: 1.3em; color: var(--red-text); }
details.group[open] summary::before { content: '▾'; }
details.group summary .count { margin-left: auto; color: var(--dim); font-size: 13px; }
details.group summary .count.live { color: var(--red-text); }
details.group > .grid2, details.group > .grid3, details.group > div { padding-bottom: 12px; }
.sbtn.playing { border-color: var(--red-on); color: var(--bright); background: #2a1313; }
.sbtn.loop::after { content: ' ↻'; color: var(--muted); }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 8px 0 0; font-size: 14px; }
.summary dt { color: var(--muted); font-variant: small-caps; letter-spacing: .08em; }
.summary dd { margin: 0; overflow-wrap: anywhere; }
.summary dd.off { color: var(--dim); }
.summary dd.alert { color: var(--red-text); }
.toggle { display: flex; align-items: center; gap: 12px; min-height: var(--tap); font-size: 16px; }
.toggle input { width: 26px; height: 26px; accent-color: var(--red); }
.gchat { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; max-height: 30vh; overflow-y: auto; font-size: 15px; }
.gchat li b { font-weight: 400; color: var(--gold); margin-right: 6px; }
.gchat li.narrator b { color: var(--red-text); }
.gchat li.empty { color: var(--muted); font-style: italic; }
.prow { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; width: 100%; min-height: 56px; padding: 6px 4px; border: 0; border-bottom: 1px solid #1f1919; background: none; text-align: left; }
.prow img { width: 34px; height: 42px; border-radius: 50%; object-fit: cover; }
.prow .pn { font-size: 17px; color: var(--bright); overflow-wrap: anywhere; }
.prow .pn small { display: block; font-size: 12px; color: var(--muted); }
.prow .pr { font-size: 13.5px; color: var(--gold); text-align: right; }
.prow .pr.w { color: var(--red-text); }
.prow.dead .pn { color: var(--dim); text-decoration: line-through; }
.pact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 8px 0 10px; }
.pact .sbtn { min-height: 48px; font-size: 14px; padding: 4px; }
.deckrow { display: grid; grid-template-columns: 1fr 48px 2.2em 48px; align-items: center; gap: 6px; margin-top: 6px; }
.deckrow b { font-weight: 400; text-align: center; font-size: 19px; color: var(--bright); font-variant-numeric: tabular-nums; }
.deckrow button { min-height: 46px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 22px; padding: 0; }
.deckrow.fill span { color: var(--muted); }

/* ------------------------------------------------------------- Steckbrief */
.sb {
  --w: 200px; position: relative; width: var(--w); font-size: calc(var(--w) / 10); padding: .45em .5em .55em; text-align: center; color: #2a1c10;
  background: radial-gradient(ellipse at 30% 20%, #f1e6cc, #e2d2ad 55%, #c9b27f 100%);
  box-shadow: inset 0 0 1.2em rgba(90,50,15,.45), inset 0 0 0 .12em rgba(80,50,20,.35);
  clip-path: polygon(0 1%, 8% 0, 22% 1.2%, 40% .2%, 61% 1%, 79% 0, 100% 1.3%, 99.2% 22%, 100% 47%, 99% 74%, 100% 99%, 77% 100%, 52% 98.8%, 28% 100%, 6% 99%, 0 100%, .8% 70%, 0 41%, 1% 18%);
}
.sb .pin { position: absolute; left: 50%; top: .18em; width: .5em; height: .5em; margin-left: -.25em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #d9a35a, #6b4416); z-index: 3; }
.sb .hd { font-family: var(--black); font-weight: 400; font-size: 1.5em; line-height: .95; margin-top: .22em; color: #140a04; }
.sb .hd.g { color: #6e0a08; }
.sb .sub { font-size: .52em; font-weight: 700; letter-spacing: .07em; white-space: nowrap; text-transform: uppercase; color: #24140a; margin: .2em 0 .4em; }
.sb .pic { position: relative; width: 74%; margin: 0 auto; aspect-ratio: 4 / 5; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 .07em #3a2410, 0 0 0 .2em rgba(226,210,173,.9), 0 0 0 .27em #3a2410; background: #d8c69c; }
.sb .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb .nm2 { position: relative; z-index: 2; margin: .38em -.25em 0; padding: .1em .5em .14em; font-size: 1.42em; font-weight: 700; line-height: 1.05; color: #120802; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: linear-gradient(#e8d6ab, #cdb27a 55%, #b89a60); border-top: .05em solid #4a2e12; border-bottom: .05em solid #4a2e12; clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%); }
.sb.dead .pic { filter: grayscale(.6) brightness(.8); }
.sb .x { position: absolute; inset: 5% 3% 5%; width: 94%; height: 90%; z-index: 5; overflow: visible; pointer-events: none; }
.sb .x path { fill: none; stroke: #a8120c; stroke-width: 7; stroke-linecap: round; opacity: .88; }
.sb .seal { position: absolute; right: 4%; bottom: 4%; z-index: 6; width: 2.4em; height: 2.4em; border-radius: 50%; display: grid; place-items: center; color: #f0cfa0; font-size: .7em; background: radial-gradient(circle at 38% 32%, #c4302a, #7a0f0c 70%); transform: rotate(-12deg); }

/* --------------------------------------------------------- full-screen picker */
.pk { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #0c0a0a; animation: up .22s ease; }
.pk-h { flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: calc(env(safe-area-inset-top) + 16px) 16px 12px; background: linear-gradient(#1a1010, #0c0a0a); border-bottom: 1px solid var(--line); }
.pk-h small { display: block; font-size: 12px; color: var(--red-text); letter-spacing: .2em; font-variant: small-caps; }
.pk-h b { font-family: var(--black); font-weight: 400; font-size: 25px; color: var(--bright); line-height: 1.15; }
.pk-n { flex: none; min-width: 64px; padding: 6px 12px; border-radius: 18px; border: 1px solid #3a2626; text-align: center; font-size: 20px; font-variant-numeric: tabular-nums; color: var(--bright); }
.pk-n.full { background: var(--red); border-color: var(--red-on); }
.pk-g { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; padding: 14px 10px 18px; align-content: start; justify-items: center; scrollbar-width: thin; scrollbar-color: #2a2222 transparent; }
.pk-empty { grid-column: 1 / -1; margin: 30px 10px; text-align: center; color: var(--muted); font-style: italic; }
.pk-c { min-width: 0; max-width: 100%; position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 2px 4px; border: 2px solid transparent; border-radius: 12px; background: none; transition: transform .12s, border-color .12s, background .12s; }
.pk-c:active:not(:disabled) { transform: scale(.96); }
.pk-c.on { border-color: #e0402c; background: rgba(160,24,14,.22); box-shadow: 0 0 0 3px rgba(224,64,44,.25), 0 0 22px rgba(224,64,44,.35); }
.pk-c.off { opacity: .38; cursor: not-allowed; }
.pk-c.off .sb { filter: grayscale(1); }
.pk-c.shake { animation: shake .3s linear 2; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.pk-b { position: absolute; right: 2px; top: 0; z-index: 9; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 20px; color: #fff; background: radial-gradient(circle at 38% 32%, #e0402c, #8f1010 70%); box-shadow: 0 0 0 3px #0c0a0a, 0 3px 8px rgba(0,0,0,.7); animation: pop .2s ease; }
/* long roles (Apothekerin, Stadtknecht, Nachtwächter) wrap under the number instead of "Apotheke…" */
.pk-r { max-width: 100%; display: flex; flex-wrap: wrap; justify-content: center; column-gap: 4px; font-size: 12.5px; color: var(--muted); letter-spacing: .02em; font-variant: small-caps; min-height: 16px; text-align: center; line-height: 1.2; overflow-wrap: anywhere; }
.pk-r i { font-style: normal; color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pk-r.w { color: var(--red-text); }
.pk-c.on .pk-r { color: var(--bright); }
.pk-f { flex: none; padding: 8px 12px calc(env(safe-area-inset-bottom) + 14px); border-top: 1px solid var(--line); background: var(--bar); }
.pk-none { width: 100%; min-height: 52px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font-size: 16px; }
.pk-none.on { background: var(--red); border-color: var(--red-on); color: var(--bright); }
.pk-skip { display: block; margin: 0 auto 8px; min-height: 44px; padding: 2px 14px; border: 0; background: none; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.pk-bar { display: grid; grid-template-columns: 1fr 1.8fr; gap: 8px; }
.pk-bar button { min-height: 62px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 17px; }
.pk-bar .main { background: var(--red); border-color: var(--red-on); color: var(--bright); font-size: 19px; }
.pk-bar .main:disabled { background: #2a1818; border-color: #3a2222; color: #7a6a64; }
.dlg-bg { position: absolute; inset: 0; z-index: 70; display: grid; place-items: center; padding: 22px; background: rgba(0,0,0,.72); }
@keyframes fade { from { opacity: 0; } }
.dlg { width: 100%; max-width: 420px; padding: 20px 18px 18px; border-radius: 16px; background: #171111; border: 1px solid #4a2a2a; box-shadow: 0 20px 60px #000; animation: up .2s; }
.dlg small { font-size: 12px; color: var(--red-text); letter-spacing: .2em; font-variant: small-caps; }
.dlg p { margin: 6px 0 18px; font-size: 22px; line-height: 1.3; color: var(--bright); }
.dlg .sbtn { min-height: 62px; font-size: 18px; }
.toast { position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 160px); z-index: 80; padding: 12px 14px; border-radius: 10px; background: #231616; border: 1px solid var(--red); color: var(--bright); font-size: 15px; text-align: center; animation: up .2s; pointer-events: none; }

/* --------------------------------------------------------------- settings */
dialog.settings { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 640px; max-height: 88dvh; margin: 0 auto; padding: 0; border: 1px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0; background: var(--bar); color: var(--text); overflow: hidden; }
dialog.settings[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(0,0,0,.6); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 6px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2, .sheet-body h3 { margin: 0; font-size: 13px; font-weight: 400; font-variant: small-caps; letter-spacing: .2em; color: var(--red-text); }
.sheet-body h3 { margin: 22px 0 8px; color: var(--muted); }
.sheet-head button { min-height: var(--tap); padding: 10px 14px; background: none; border: 0; color: var(--muted); }
.sheet-body { overflow-y: auto; padding: 4px calc(env(safe-area-inset-right) + 18px) calc(env(safe-area-inset-bottom) + 20px) calc(env(safe-area-inset-left) + 18px); }
.field { display: grid; gap: 6px; margin-top: 14px; color: var(--muted); font-size: 15px; }
.field input { min-height: var(--tap); padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--bright); font-size: 17px; user-select: text; -webkit-user-select: text; }
.field input:focus { outline: none; border-color: var(--red-on); }
.row { display: flex; gap: 10px; margin-top: 10px; }
.row button { flex: 1; min-height: var(--tap); padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.row button.primary { background: var(--red); border-color: var(--red-on); color: var(--bright); }
.result:empty { display: none; }
.result.good { color: var(--gold); }
.result.bad { color: var(--red-text); }

/* automatic line queue */
.line { position: relative; overflow: hidden; }
.line.queued { grid-template-columns: 40px 1fr auto; }
.line.q-played { opacity: .55; }
.line.q-next { border-color: #3a3020; }
.qst { white-space: nowrap; letter-spacing: .04em; font-variant: normal; font-size: 11.5px; color: var(--muted); }
.qst.playing { color: var(--red-text); }
.qst.next, .qst.waiting { color: var(--gold); }
.qctl { display: grid; gap: 6px; justify-items: end; }
.mini { min-height: 40px; padding: 2px 10px; border: 1px solid #3a2a2a; border-radius: 20px; background: #161010; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.mini.on { background: var(--red); border-color: var(--red-on); color: var(--bright); }
.qbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #2a1c1c; }
.qprog { display: block; height: 100%; width: 0; background: var(--red-text); animation-name: qprog; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes qprog { to { width: 100%; } }
.qhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 -2px; font-size: 12px; color: var(--muted); letter-spacing: .12em; font-variant: small-caps; }

/* held main action: fills with ember red from the left */
.act .main { position: relative; overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
.act .main > span, .act .main > small { position: relative; z-index: 1; }
.act .main::before { content: ''; position: absolute; inset: 0; transform-origin: left center; transform: scaleX(var(--fill, 0)); background: linear-gradient(90deg, #c4302a, #e3592c); opacity: .85; }
.act .main.hold:not(.holding)::after { content: 'halten'; position: absolute; right: 10px; top: 6px; font-size: 10.5px; letter-spacing: .12em; font-variant: small-caps; color: #e8b9b2; opacity: .85; }
.act .main.holding { border-color: #e3592c; }
/* room for the "halten" mark above the label (a long label ran into it, E2E 26.11.) */
.act .main.hold { padding-top: 18px; }
.act .main.flash { animation: flash .35s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(227,89,44,.9); background: #e3592c; } 100% { box-shadow: 0 0 0 14px rgba(227,89,44,0); } }
#app .act .main.locked { background: #2a1616; border-color: #4a2a2a; color: #b89a94; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .act .main.flash { animation: none; background: #e3592c; } .choice.need { animation: none; } }

/* night choice card */
.choice { margin: 0 0 12px; padding: 12px 14px; border-radius: 10px; background: #15110b; border: 1px solid #4a3d22; border-left: 4px solid var(--gold); display: grid; gap: 8px; }
.choice small { font-size: 11px; color: var(--gold); letter-spacing: .2em; font-variant: small-caps; }
.choice b { font-weight: 400; font-size: calc(19px * var(--fs)); color: var(--bright); }
.choice .val { margin: 0; font-size: 18px; color: #fff3dc; }
.choice .val.sk { color: var(--muted); font-style: italic; }
.choice .pk-skip { margin: 0; justify-self: start; padding-left: 0; }
.choice.need { border-color: var(--red-on); border-left-color: var(--red-text); background: #1d0f0f; animation: need 1.4s ease-in-out infinite; }
.choice.need small { color: var(--red-text); }
@keyframes need { 50% { box-shadow: 0 0 0 3px rgba(201,71,63,.35), 0 0 18px rgba(201,71,63,.35); } }
/* night overview */
.nsum { list-style: none; margin: 0 0 12px; padding: 0; }
.nsum li { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 54px; padding: 8px 4px; border-bottom: 1px solid #1f1919; font-size: 16px; cursor: pointer; }
.nsum li b { font-weight: 400; color: var(--bright); text-align: right; }
.nsum li.sk b { color: var(--muted); font-style: italic; }
.nsum li.miss, .nsum li.miss b { color: var(--red-text); }

.choice.nudge, .nsum li.nudge { animation: shake .3s linear 2; }

/* vote closing countdown (the hub closes by itself) */
.closing { margin: 12px 0; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--red-on); background: #1d0f0f; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; }
.closing small { font-size: 11px; color: var(--red-text); letter-spacing: .2em; font-variant: small-caps; }
.closing b { grid-row: 1 / 3; grid-column: 2; font-weight: 400; font-size: 40px; color: var(--bright); font-variant-numeric: tabular-nums; }
.closing .cbar { height: 6px; border-radius: 3px; background: #2a1c1c; overflow: hidden; }
.closing .cbar i { display: block; height: 100%; background: var(--red-text); transition: width .45s linear; }
.tlc.m { color: var(--red-text); border-color: #5a1a1a; }
.tlc.m::before { content: '! '; }

/* death scene: who dies, which story, the spoken text */
.scene { margin: 8px 0 12px; border: 1px solid #3a1414; border-radius: 10px; background: radial-gradient(ellipse at 30% 0%, #2a0c0b, #140c0c 70%); overflow: hidden; }
.srow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 14px; border-top: 1px solid #2a1515; }
.srow:first-child { border-top: 0; }
.srow b { font-weight: 400; font-size: 20px; color: var(--bright); }
.srow span { font-size: 14px; color: var(--muted); text-align: right; }
.srow.cur { background: rgba(143, 29, 29, .28); box-shadow: inset 3px 0 0 var(--red-on); }
.srow.cur span { color: var(--red-text); }
.srow.dead b { color: var(--red-text); }
.sline { padding: 10px 14px 14px; border-top: 1px solid #2a1515; }
.sline small { display: block; font-size: 12px; letter-spacing: .12em; font-variant: small-caps; color: var(--muted); }
.sline.on small { color: var(--red-text); }
.sline i { display: block; margin-top: 4px; font-size: 16px; color: var(--text); }
/* the day's story lines that run by themselves, each with its moment (flow.js block "sched") */
.sched { margin: 10px 0 4px; }
.sched .si .line { margin-bottom: 2px; }
.sched .si .when { display: block; margin: 0 0 8px 58px; font-size: 12.5px; color: var(--muted); }
.tutorial-link { display: block; padding: 13px 12px; text-align: center; color: #f2dfbf; text-underline-offset: 4px; }


#app:not(.tools-open) :is(#tl,#rstrip,#tools) { display:none; }
#moreControls { margin-left:auto; background:transparent; color:var(--paper,#eadbc9); border:1px solid var(--line); border-radius:8px; min-height:40px; padding:0 10px; font:inherit; }
#moreControls[aria-expanded="true"] { background:#462a22; }
#app:not(.tools-open) .act { padding-bottom:max(12px,env(safe-area-inset-bottom)); }
.spoken { margin:14px 0; color:#dbc9af; } .spoken summary { cursor:pointer; padding:8px 0; }
.spoken button,.night-choice button,.vote-method button { min-height:44px; border:1px solid #715142; border-radius:8px; background:#261e1c; color:#f5e6cf; padding:8px 12px; font:inherit; }
.night-choice h2,.vote-method legend { font-size:1.1rem; }
.name-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(92px,1fr)); gap:6px; }
.name-grid button { overflow-wrap:anywhere; }
.night-choice .pk-skip { margin-top:8px; border:none; background:transparent; color:#cbbda9; }
.vote-method { margin:16px 0; padding:12px; border:1px solid #675343; border-radius:8px; }
.vote-method button { margin:0 6px 0 0; }
.vote-method [aria-pressed="true"] { color:#fff1cd; background:#71382d; border-color:#e2b97c; }

/* Camera pairing and local photo import */
.setup-body .scan-button, .sheet-body .scan-button { display: flex; align-items: center; justify-content: center; gap: .65em; width: 100%; min-height: 48px; font-weight: 600; }
.setup-body #setupPair { background: transparent; border-color: var(--line); color: var(--text); }
#qrPreview { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #100f0d; border-radius: 8px; }
#qrVideo { display: block; width: 100%; height: 100%; object-fit: cover; }
#qrPreview span { position: absolute; width: 58%; max-height: 88%; aspect-ratio: 1; inset: 50% auto auto 50%; transform: translate(-50%, -50%); border: 2px dashed #ffe3a8; border-radius: 8px; box-shadow: 0 0 0 100vmax #0005; pointer-events: none; }
#qrNote { color: var(--bright); margin: 0; line-height: 1.45; }
#qrLan { color: var(--paper); text-decoration: underline; padding: 12px 0; }
.qr-sheet [hidden] { display: none !important; }
.qr-sheet .sheet-body { display: grid; gap: 12px; padding-top: 16px; }
#settingsScan { margin: 12px 0 4px; }
#qrPhoto, #qrCamera { width: 100%; min-height: 46px; }
#settingsScan, #qrCamera { background: var(--red); color: var(--bright); border: 1px solid var(--red-on); border-radius: 6px; }
#qrPhoto { background: #1b1715; color: var(--bright); border: 1px solid var(--line); border-radius: 6px; }
.otp-row { display:flex; align-items:stretch; gap:8px; margin:7px 0; }
#otpInput { min-width:0; flex:1; background:#100e0d; color:var(--bright); border:1px solid #766457; border-radius:6px; padding:8px 12px; font:600 25px/1.2 ui-monospace,monospace; letter-spacing:.14em; }
#otpConnect { min-height:48px; padding:8px 14px; background:var(--red); color:var(--bright); border:1px solid var(--red-on); border-radius:6px; }
.pair-advanced { margin:14px 0; }
.pair-advanced summary { cursor:pointer; color:var(--muted); padding:9px 0; }
