/* Secret Hitler - Tisch- und Handy-Ansicht.
   Blutrot auf Schwarz, Knochenweiss fuer Text, Stahlblau fuer die Liberalen.
   Der Totenkopf ist das einzige Ornament: Emblem, Wasserzeichen, Hintergrund. */
:root {
  --ink: #0c0607;
  --ink-2: #150b0d;
  --ink-3: #1f1113;
  --bone: #e8dfcf;
  --bone-dim: #b9ad9a;
  --muted: #8d7f74;
  --blood: #a3111c;
  --blood-bright: #d3202d;
  --blood-deep: #5e0910;
  --steel: #5b7f95;
  --steel-dark: #3b5a6c;
  --line: rgba(232, 223, 207, .14);
  --shadow: 0 12px 34px rgba(0, 0, 0, .55);
  --radius: 6px;
  --f-display: "Avenir Next Condensed", "Impact", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --f-mono: "Courier New", ui-monospace, monospace;
  --skull-bone: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 64 64%22%3E%3Cpath fill=%22%23e8dfcf%22 d=%22M32 3C17.6 3 7 13.6 7 27.4c0 8 3.9 14.6 9.5 19v8.4c0 2 1.5 3.6 3.4 3.6H24v-7h4v7h8v-7h4v7h4.1c1.9 0 3.4-1.6 3.4-3.6v-8.4C53.1 42 57 35.4 57 27.4 57 13.6 46.4 3 32 3z%22/%3E%3Cellipse cx=%2222.5%22 cy=%2228%22 rx=%226%22 ry=%226.6%22 fill=%22%230c0607%22/%3E%3Cellipse cx=%2241.5%22 cy=%2228%22 rx=%226%22 ry=%226.6%22 fill=%22%230c0607%22/%3E%3Cpath fill=%22%230c0607%22 d=%22M32 33.5 27.5 42h9z%22/%3E%3C/svg%3E");
  --skull-blood: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 64 64%22%3E%3Cpath fill=%22%23a3111c%22 d=%22M32 3C17.6 3 7 13.6 7 27.4c0 8 3.9 14.6 9.5 19v8.4c0 2 1.5 3.6 3.4 3.6H24v-7h4v7h8v-7h4v7h4.1c1.9 0 3.4-1.6 3.4-3.6v-8.4C53.1 42 57 35.4 57 27.4 57 13.6 46.4 3 32 3z%22/%3E%3Cellipse cx=%2222.5%22 cy=%2228%22 rx=%226%22 ry=%226.6%22 fill=%22%230c0607%22/%3E%3Cellipse cx=%2241.5%22 cy=%2228%22 rx=%226%22 ry=%226.6%22 fill=%22%230c0607%22/%3E%3Cpath fill=%22%230c0607%22 d=%22M32 33.5 27.5 42h9z%22/%3E%3C/svg%3E");
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(163, 17, 28, .38) 0%, transparent 55%),
    var(--skull-blood) 0 0 / 132px 132px repeat,
    var(--ink);
  background-blend-mode: normal, soft-light, normal;
  color: var(--bone);
  font-family: var(--f-body);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
/* Das Muster darf nur ahnbar sein - Lesbarkeit geht vor. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--ink);
  opacity: .93;
  z-index: -1;
  pointer-events: none;
}

h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1;
  margin: 0 0 .45em;
}
h1 { font-size: clamp(2rem, 7vw, 3.4rem); color: var(--bone); }
h2 { font-size: clamp(1.15rem, 3.6vw, 1.5rem); color: var(--bone-dim); }
a { color: var(--blood-bright); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 18px; }
.wrap--narrow { max-width: 620px; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 240px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- Kopf */
.skull { width: 1em; height: 1em; vertical-align: -.12em; color: var(--blood-bright); }
h1 .skull { width: .95em; height: .95em; margin-right: .18em; filter: drop-shadow(0 0 10px rgba(211, 32, 45, .55)); }
.emblem { display: inline-flex; align-items: center; justify-content: center; gap: .3em; }
.emblem .skull { width: 3.2rem; height: 3.2rem; }

.card {
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line);
  border-top: 2px solid var(--blood);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.banner {
  border-radius: var(--radius);
  padding: 14px 18px;
  font-family: var(--f-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: clamp(1.05rem, 3vw, 1.5rem);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(0, 0, 0, .12) 14px 16px),
    linear-gradient(135deg, var(--blood-bright), var(--blood-deep));
  color: var(--bone);
  text-align: center;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .4);
}
.banner--liberal { background: linear-gradient(135deg, var(--steel), var(--steel-dark)); }
.banner--fascist { background: linear-gradient(135deg, var(--blood), #3a0509); }
.banner--quiet { background: var(--ink-3); color: var(--bone-dim); font-weight: 600; text-shadow: none; border: 1px solid var(--line); }

/* ------------------------------------------------------------- Buttons */
button, .btn {
  font: inherit;
  font-family: var(--f-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 1.02rem;
  padding: 14px 20px;
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--blood-bright), var(--blood));
  color: var(--bone);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 3px 0 var(--blood-deep);
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease, box-shadow .08s ease;
}
button:hover:not(:disabled) { filter: brightness(1.1); }
button:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 1px 0 var(--blood-deep); }
button:disabled { opacity: .35; cursor: not-allowed; filter: grayscale(.6); }
button:focus-visible { outline: 3px solid var(--bone); outline-offset: 2px; }
.btn-ja { background: linear-gradient(180deg, var(--steel), var(--steel-dark)); box-shadow: 0 3px 0 #27404e; }
.btn-nein { background: linear-gradient(180deg, var(--blood-bright), var(--blood)); }
.btn-ghost { background: transparent; color: var(--bone); border: 1px solid rgba(232, 223, 207, .35); box-shadow: none; }
.btn-ghost:hover:not(:disabled) { border-color: var(--blood-bright); color: var(--blood-bright); filter: none; }
.btn-block { width: 100%; }
.btn-danger { background: linear-gradient(180deg, var(--blood), var(--blood-deep)); box-shadow: 0 3px 0 #2a0306; }

input, select {
  font: inherit;
  padding: 13px 14px;
  min-height: 48px;
  border-radius: var(--radius);
  border: 1px solid rgba(232, 223, 207, .28);
  background: rgba(0, 0, 0, .45);
  color: var(--bone);
  width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--blood-bright); outline-offset: 1px; }
label { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }

/* --------------------------------------------------------- Spielleisten */
.track { margin-bottom: 14px; }
.track__head { display: flex; justify-content: space-between; font-family: var(--f-display); font-size: .95rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.track--liberal .track__head { color: var(--steel); }
.track--fascist .track__head { color: var(--blood-bright); }
.track__slots { display: grid; gap: 6px; min-width: 0; }
.track--liberal .track__slots { grid-template-columns: repeat(5, 1fr); }
.track--fascist .track__slots { grid-template-columns: repeat(6, 1fr); }

.slot {
  aspect-ratio: 2 / 3;
  min-width: 0;
  overflow: hidden;
  hyphens: auto;
  word-break: normal;
  overflow-wrap: break-word;
  border-radius: 4px;
  border: 1px dashed rgba(232, 223, 207, .25);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 4px;
  font-size: clamp(.5rem, 2.4vw, .62rem);
  line-height: 1.1;
  text-align: center;
  color: var(--muted);
}
.slot--filled { border-style: solid; border-color: transparent; color: var(--bone); justify-content: center; font-weight: bold; font-size: .8rem; }
.track--liberal .slot--filled { background: linear-gradient(160deg, var(--steel), var(--steel-dark)); }
/* Faschistische Gesetze: kein Haken, ein Schaedel. */
.track--fascist .slot--filled {
  background: var(--skull-bone) center / 62% no-repeat, linear-gradient(160deg, var(--blood-bright), var(--blood-deep));
  color: transparent;
}
.slot--next { border-color: var(--blood-bright); border-style: solid; box-shadow: 0 0 0 1px rgba(211, 32, 45, .35) inset; }

/* ------------------------------------------------------------- Spieler */
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.player {
  border-radius: var(--radius);
  padding: 10px 12px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line);
}
.player--done { border-color: var(--steel); }
.player__name { font-weight: bold; word-break: break-word; }
.player__tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }

.tag {
  font-family: var(--f-display);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(232, 223, 207, .14);
  color: var(--bone-dim);
}
.tag--liberal { background: var(--steel); color: #fff; }
.tag--fascist { background: var(--blood); color: var(--bone); }
.tag--off { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* ----------------------------------------------------------- Spielkarten */
.hand { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; }
.policy {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-family: var(--f-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: clamp(.8rem, 3.6vw, 1.05rem);
  hyphens: auto;
  word-break: normal;
  overflow-wrap: break-word;
  min-width: 0;
  color: var(--bone);
  border: 2px solid rgba(232, 223, 207, .25);
  padding: 10px 6px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.policy--liberal { background: linear-gradient(170deg, var(--steel), var(--steel-dark)); }
.policy--fascist { background: var(--skull-bone) center 32% / 58% no-repeat, linear-gradient(170deg, var(--blood-bright), var(--blood-deep)); }
.policy--liberal::before {
  content: "";
  position: absolute; inset: 8px;
  border: 1px solid rgba(232, 223, 207, .35);
  border-radius: 5px;
}
.policy--btn { cursor: pointer; }
.policy--btn:hover { filter: brightness(1.12); transform: translateY(-2px); }
.policy--btn:focus-visible { outline: 3px solid var(--bone); outline-offset: 2px; }
.policy__hint { font-family: var(--f-body); font-size: .62rem; font-weight: normal; text-transform: none; letter-spacing: 0; opacity: .85; }

/* ---------------------------------------------------------- Rollenkarte */
.role {
  position: relative;
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
  border: 2px solid;
  overflow: hidden;
}
.role--liberal { background: linear-gradient(160deg, rgba(91,127,149,.3), rgba(59,90,108,.5)); border-color: var(--steel); }
.role--fascist {
  background: var(--skull-blood) right -16px bottom -42px / 46% no-repeat, linear-gradient(160deg, rgba(163,17,28,.35), rgba(94,9,16,.6));
  border-color: var(--blood-bright);
}
.role__title { font-family: var(--f-display); font-weight: 800; font-size: 2.4rem; text-transform: uppercase; letter-spacing: .06em; line-height: 1; }
.role--fascist .role__title { color: var(--blood-bright); text-shadow: 0 0 18px rgba(211, 32, 45, .45); }
.role--liberal .role__title { color: #cfe3ee; }
.role__sub { color: var(--bone-dim); font-size: .9rem; margin-top: 8px; }

/* -------------------------------------------------------------- QR-Code */
.qr { background: var(--bone); padding: 12px; border-radius: var(--radius); display: inline-block; line-height: 0; border: 3px solid var(--blood); }
.qr img { width: min(320px, 70vw); height: auto; }
.code {
  font-family: var(--f-mono);
  font-size: clamp(1.8rem, 7vw, 3.2rem);
  letter-spacing: .35em;
  color: var(--bone);
  font-weight: bold;
  padding-left: .35em;
  text-decoration: underline;
  text-decoration-color: var(--blood-bright);
  text-decoration-thickness: 3px;
  text-underline-offset: .18em;
}

/* ---------------------------------------------------------------- Log */
.log { max-height: 260px; overflow-y: auto; overscroll-behavior: contain;
       font-size: .84rem; line-height: 1.5; padding-bottom: 4px; }
.log div { padding: 3px 0; border-bottom: 1px solid var(--line); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: var(--blood-bright);
  color: var(--bone);
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 50;
  max-width: 92vw;
  text-align: center;
}

/* ------------------------------------------------ Hilfsklassen
   Bewusst als Klassen statt style="..." - die Content-Security-Policy
   erlaubt keine Inline-Styles. */
.m0 { margin: 0; }
.mt14 { margin-top: 14px; }
.mt-sm { margin: .6em 0 0; }
.lead { font-size: 1.1rem; margin: 0; }
.steps { line-height: 1.7; padding-left: 1.2em; margin: 0; }
.btn-mini { min-height: 38px; padding: 8px 14px; }

/* --------------------------------------------- Ein-Geräte-Ablauf (mobil) */
.h1-sm { font-size: clamp(1.3rem, 5.5vw, 1.8rem); }
.code--sm { font-size: clamp(1.1rem, 5.5vw, 1.7rem); letter-spacing: .22em; padding-left: .22em; text-decoration-thickness: 2px; }
.row--tight { gap: 8px; }

/* Übergabe-Sperre vor geheimen Schritten */
.gate-name {
  font-family: var(--f-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: clamp(2rem, 10vw, 3.4rem);
  color: var(--blood-bright);
  text-shadow: 0 0 24px rgba(211, 32, 45, .4);
  line-height: 1;
  word-break: break-word;
}

.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--bone); margin: 0; }
.check input { width: 22px; height: 22px; min-height: 22px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--blood-bright); }

details.card > summary {
  cursor: pointer;
  font-family: var(--f-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 1.05rem;
  color: var(--bone-dim);
  list-style: none;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: '▸ '; color: var(--blood-bright); }
details.card[open] > summary::before { content: '▾ '; }
details.card > summary + * { margin-top: 12px; }

/* Auf kleinen Displays: mehr Luft, größere Tippflächen */
@media (max-width: 480px) {
  .wrap { padding: 12px; }
  .card { padding: 14px; }
  .players { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
  .hand { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; }
  button, .btn { padding: 15px 18px; min-height: 52px; }
}

/* Der Satz, den man bei der Auslosung liest - das Wichtigste auf der Seite. */
.role-sentence {
  margin: 0;
  font-size: clamp(1rem, 4.4vw, 1.25rem);
  line-height: 1.45;
}

/* Spieler aus der Lobby werfen (nur beim Spielleiter sichtbar). */
.btn-kick {
  min-height: 30px;
  width: 30px;
  padding: 0;
  line-height: 1;
  font-size: 1.2rem;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: none;
  flex: 0 0 auto;
}
.btn-kick:hover { background: var(--blood); color: var(--bone); border-color: var(--blood); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Pflichtangabe zur Lizenz des Originalspiels. */
footer { padding: 8px 4px 20px; line-height: 1.55; }

/* Rueckfrage vor dem Ablegen - die angetippte Karte hebt sich ab, die anderen treten zurueck. */
.policy--selected { outline: 3px solid var(--bone); outline-offset: 3px; transform: translateY(-6px); filter: brightness(1.12); }
.policy--dim { opacity: .38; }
.confirm-ask { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 1.15rem; text-align: center; }
.confirm-ask__card { font-family: var(--f-display); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 4px; }
.confirm-ask__card--liberal { background: var(--steel); color: #fff; }
.confirm-ask__card--fascist { background: var(--blood); color: var(--bone); }
