/* ── Imposter — Dark Party ───────────────────────────────────────────────── */
:root {
  --bg: #0B0A1A;
  --surface: #17162E;
  --surface-2: #211F3D;
  --brd: rgba(255, 255, 255, 0.08);
  --brd-hi: rgba(255, 255, 255, 0.18);
  --txt: #F3F1FF;
  --dim: #A6A2C7;
  --faint: #6F6B94;
  --accent: #FFC53D;
  --accent-ink: #1A1405;
  --crew: #2DE1C2;
  --imp: #FF6B4A;
  --safe-b: env(safe-area-inset-bottom);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--txt);
  font-family: 'Outfit', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.hidden { display: none !important; }

/* ── Login ── */
.login { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.logo-big { font-size: 72px; line-height: 1; margin-bottom: 10px; }
.brand {
  margin: 0; font-family: 'Bricolage Grotesque', 'Outfit', sans-serif; font-weight: 800;
  font-size: 46px; line-height: 1; letter-spacing: -1.5px;
}
.brand-sub { color: var(--dim); font-size: 15px; margin: 10px 0 26px; }
.field {
  width: 100%; height: 54px; padding: 0 18px; margin-bottom: 12px;
  border-radius: 16px; border: 1px solid var(--brd); background: var(--surface);
  color: var(--txt); font-family: inherit; font-size: 16px; outline: none;
}
.field:focus { border-color: var(--accent); }
.login-err { color: #FF8FA3; font-size: 14px; min-height: 20px; margin-top: 12px; }

/* ── Buttons ── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; height: 54px; border: none; border-radius: 17px;
  font-family: inherit; font-size: 17px; font-weight: 700; cursor: pointer;
  transition: transform .12s;
}
.btn:active { transform: scale(.97); }
.btn.big { height: 58px; font-size: 18px; border-radius: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 28px -10px rgba(255,197,61,.7); }
.btn-primary:disabled { opacity: .45; box-shadow: none; cursor: default; }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--brd-hi); color: var(--txt); }
.btn-good { background: var(--crew); color: #06211C; }
.btn-bad { background: var(--imp); color: #2A0B04; }
.btn-link { width: 100%; background: none; border: none; color: var(--dim); font-family: inherit; font-size: 13.5px; padding: 10px; cursor: pointer; }

.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--brd);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: var(--txt); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.big-icon { width: 58px; height: 54px; border-radius: 17px; background: var(--surface-2); border-color: var(--brd-hi); }
.chip-btn {
  height: 36px; padding: 0 14px; flex: none; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--brd-hi); color: var(--txt);
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip-btn.danger { color: #FF8FA3; border-color: rgba(255,143,163,.35); }

/* ── App-Gerüst ── */
.app { position: relative; height: 100%; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; overflow: hidden; }
.screen.active { display: flex; }

.orb { position: absolute; border-radius: 50%; pointer-events: none; opacity: .5; }
.orb-a { top: -90px; right: -70px; width: 260px; height: 260px; background: #241F4D; }
.orb-b { top: 120px; left: -80px; width: 200px; height: 200px; background: #3A1D3F; }
.orb-c { top: 190px; left: 50%; margin-left: -170px; width: 340px; height: 340px; background: #241F4D; opacity: .45; }

.head { position: relative; padding: calc(44px + env(safe-area-inset-top)) 24px 14px; }
.head-top { position: relative; padding: calc(44px + env(safe-area-inset-top)) 24px 0; display: flex; align-items: center; justify-content: space-between; }
.head-bar {
  padding: calc(44px + env(safe-area-inset-top)) 20px 14px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.head-bar-main { flex: 1; min-width: 0; }
.head-bar h2 { margin: 0; font-family: 'Bricolage Grotesque', 'Outfit', sans-serif; font-weight: 800; font-size: 25px; letter-spacing: -.6px; }
.head-bar-sub { font-size: 12.5px; color: var(--dim); }

.kicker { font-size: 12.5px; font-weight: 600; letter-spacing: 1.8px; color: var(--dim); }
.center-kicker { margin-bottom: 8px; }
.center-text { text-align: center; }
.brand-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.brand-emoji { font-size: 38px; }
.lead { font-size: 14.5px; color: var(--dim); line-height: 1.5; margin: 8px 0 0; }
.center-lead { max-width: 285px; }
.big-title { margin: 6px 0 0; font-family: 'Bricolage Grotesque', 'Outfit', sans-serif; font-weight: 800; font-size: 34px; line-height: 1.1; letter-spacing: -1px; }
.huge { margin: 0; font-family: 'Bricolage Grotesque', 'Outfit', sans-serif; font-weight: 800; font-size: 46px; line-height: 1.05; letter-spacing: -1.4px; }

.scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 16px 24px 8px; display: flex; flex-direction: column; gap: 10px; }
.center { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 22px; padding: 0 28px; }
.foot { position: relative; padding: 10px 24px calc(26px + var(--safe-b)); background: linear-gradient(to top, var(--bg) 62%, rgba(11,10,26,0)); }
.foot-row { display: flex; gap: 10px; align-items: center; }
.foot-row .btn { flex: 1; }
.foot-note { text-align: center; font-size: 12.5px; color: var(--dim); margin-top: 10px; }

/* ── Zeilen / Einstellungen ── */
.row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--brd); border-radius: 18px;
  padding: 15px 16px; color: var(--txt); font-family: inherit; cursor: pointer;
}
.row:not(button) { cursor: default; }
.row.off { opacity: .4; }
.row-ico { font-size: 22px; flex: none; }
.row-main { flex: 1; min-width: 0; display: block; }
.row-title { display: block; font-size: 15.5px; font-weight: 600; }
.row-sub { display: block; font-size: 12.5px; color: var(--dim); margin-top: 2px; }
.chev { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--dim); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pill { font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 4px 9px; flex: none; }

.stepper { display: flex; align-items: center; gap: 12px; flex: none; }
.step {
  width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--brd-hi);
  background: var(--surface-2); color: var(--txt); font-size: 20px; line-height: 1; cursor: pointer;
}
.step:disabled { opacity: .35; cursor: default; }
.step-val { min-width: 26px; text-align: center; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.accent-imp { color: var(--imp); }

.switch {
  width: 50px; height: 30px; flex: none; border-radius: 999px; border: none; padding: 3px;
  display: flex; align-items: center; justify-content: flex-start;
  background: #2E2B4F; cursor: pointer; transition: background .15s;
}
.switch[aria-checked="true"] { background: var(--accent); justify-content: flex-end; }
.knob { width: 24px; height: 24px; border-radius: 50%; background: var(--bg); display: block; }

/* ── Kategorien ── */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.cat {
  display: flex; align-items: center; gap: 9px; min-height: 56px; padding: 13px 12px;
  border-radius: 15px; background: var(--surface); border: 1px solid var(--brd);
  color: #D8D4F0; font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left;
}
.cat.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cat-emoji { font-size: 20px; flex: none; }
.cat-name { flex: 1; min-width: 0; line-height: 1.25; }
.cat .tick { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--accent-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; display: none; }
.cat.on .tick { display: block; }

.own-box {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; margin-top: 6px;
  background: var(--surface); border: 1px dashed rgba(255,197,61,.45); border-radius: 18px;
  padding: 16px; color: var(--txt); font-family: inherit; cursor: pointer;
}
.own-edit { font-size: 13px; font-weight: 600; color: var(--accent); flex: none; }
.area {
  width: 100%; min-height: 320px; padding: 16px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--brd); color: var(--txt);
  font-family: inherit; font-size: 16px; line-height: 1.6; resize: vertical; outline: none;
}
.area:focus { border-color: var(--accent); }
.hint-text { font-size: 13px; color: var(--dim); margin: 2px 0 0; }

/* ── Spielerliste ── */
.pl { display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--brd); border-radius: 16px; padding: 10px 12px; }
.pl.off { opacity: .45; }
.pl-check { width: 34px; height: 34px; flex: none; border-radius: 11px; border: 1px solid var(--brd-hi); background: var(--surface-2); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pl.on .pl-check { background: var(--crew); border-color: var(--crew); }
.pl-check svg { width: 16px; height: 16px; fill: none; stroke: #06211C; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; display: none; }
.pl.on .pl-check svg { display: block; }
.pl-name { flex: 1; min-width: 0; background: none; border: none; color: var(--txt); font-family: inherit; font-size: 16px; font-weight: 600; outline: none; padding: 6px 0; }
.pl-del { width: 32px; height: 32px; flex: none; border-radius: 10px; background: none; border: none; color: var(--faint); font-size: 18px; cursor: pointer; }

/* ── Übergabe / Karte ── */
.dots { display: flex; gap: 5px; }
.dot { width: 20px; height: 4px; border-radius: 99px; background: #2E2B4F; display: block; }
.dot.on { background: var(--accent); }
.big-ico {
  width: 118px; height: 118px; border-radius: 36px; background: var(--surface);
  border: 1px solid var(--brd); display: flex; align-items: center; justify-content: center; font-size: 56px;
}
.warn {
  display: flex; align-items: center; gap: 9px; padding: 9px 16px; border-radius: 999px;
  background: rgba(255,108,74,.12); border: 1px solid rgba(255,108,74,.3);
  font-size: 13.5px; font-weight: 600; color: #FFA78F;
}
.card-center { padding: 0 26px; }
.card {
  width: 100%; height: 420px; border-radius: 32px; padding: 26px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; font-family: inherit;
}
.card-back { background: var(--surface); border: 1px solid rgba(255,255,255,.12); color: var(--txt); cursor: pointer; }
.card-ico { font-size: 62px; }
.card-title { font-size: 21px; font-weight: 700; }
.card-note { font-size: 14px; color: var(--dim); max-width: 210px; line-height: 1.5; }
.card.crew { background: #11231F; border: 1px solid rgba(45,225,194,.45); }
.card.imp { background: #25120E; border: 1px solid rgba(255,107,74,.5); }
.role-tag { display: flex; align-items: center; gap: 8px; border-radius: 999px; padding: 7px 15px; font-size: 13px; font-weight: 700; letter-spacing: 1px; }
.role-tag.crew { background: rgba(45,225,194,.16); color: var(--crew); }
.role-tag.imp { background: rgba(255,107,74,.18); color: var(--imp); }
.card-label { font-size: 13.5px; letter-spacing: 1.4px; font-weight: 600; margin-top: 8px; }
.card.crew .card-label { color: #8FB8AF; }
.card-word { font-family: 'Bricolage Grotesque', 'Outfit', sans-serif; font-weight: 800; font-size: 44px; line-height: 1.05; letter-spacing: -1.4px; }
.card-cat { font-size: 13px; }
.card.crew .card-cat { color: #8FB8AF; }
.card-tip { margin: 10px 0 0; font-size: 14.5px; line-height: 1.5; max-width: 255px; }
.card.crew .card-tip { color: #A6C9C2; }
.card.imp .card-tip { color: #D4A99C; }
.imp-hint {
  display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12); border-radius: 13px; padding: 10px 14px;
  font-size: 13.5px; color: #E8C9BE; margin-top: 4px;
}

/* ── Runde ── */
.timer-wrap { position: relative; width: 206px; height: 206px; margin: 20px auto 0; display: flex; align-items: center; justify-content: center; flex: none; }
.timer-ring { position: absolute; width: 206px; height: 206px; transform: rotate(-90deg); }
.timer-txt { position: relative; text-align: center; }
.timer-val { font-family: 'Bricolage Grotesque', 'Outfit', sans-serif; font-weight: 800; font-size: 50px; line-height: 1; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.timer-sub { font-size: 12.5px; color: var(--dim); margin-top: 6px; letter-spacing: 1.2px; }
.timer-wrap.urgent .timer-val { color: var(--imp); }
.turn { padding: 18px 24px 0; text-align: center; flex: none; }
.tag { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--brd); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--dim); }
.ord { display: flex; align-items: center; gap: 12px; background: rgba(23,22,46,.6); border: 1px solid rgba(255,255,255,.07); border-radius: 15px; padding: 12px 14px; }
.ord-no { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--surface-2); color: var(--dim); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.ord-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; color: #D8D4F0; }

/* ── Abstimmung ── */
.vote { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 14px; border-radius: 17px; background: var(--surface); border: 1px solid var(--brd); color: var(--txt); font-family: inherit; cursor: pointer; }
.vote.on { background: #2B1B3F; border-color: #C792FF; }
.vote-ico { font-size: 24px; flex: none; }
.vote-main { flex: 1; min-width: 0; }
.vote-name { display: block; font-size: 16px; font-weight: 600; }
.vote-mark { width: 30px; height: 30px; flex: none; border-radius: 999px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.vote.on .vote-mark { background: #C792FF; }
.vote-mark svg { width: 16px; height: 16px; fill: none; stroke: #190B26; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; display: none; }
.vote.on .vote-mark svg { display: block; }

/* ── Raten / Ergebnis ── */
.reveal-box { min-height: 86px; display: flex; align-items: center; justify-content: center; width: 100%; max-width: 300px; }
.reveal-word { font-family: 'Bricolage Grotesque', 'Outfit', sans-serif; font-weight: 800; font-size: 40px; letter-spacing: -1.2px; }
.result-scroll { align-items: center; }
.result-emoji { font-size: 72px; line-height: 1; }
.info-card { width: 100%; border-radius: 22px; padding: 18px; display: flex; align-items: center; gap: 14px; }
.info-card.imp { background: var(--surface); border: 1px solid rgba(255,107,74,.4); }
.info-card.crew { background: #11231F; border: 1px solid rgba(45,225,194,.4); }
.info-ico { width: 54px; height: 54px; flex: none; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.info-card.imp .info-ico { background: rgba(255,107,74,.16); }
.info-card.crew .info-ico { background: rgba(45,225,194,.16); }
.info-main { flex: 1; min-width: 0; }
.info-label { font-size: 12.5px; letter-spacing: 1.2px; font-weight: 600; color: var(--dim); }
.info-card.crew .info-label { color: #8FB8AF; }
.info-val { font-size: 22px; font-weight: 700; margin-top: 2px; }
.list-kicker { align-self: flex-start; margin: 6px 0 -2px; }

.sc { display: flex; align-items: center; gap: 11px; width: 100%; background: var(--surface); border: 1px solid var(--brd); border-radius: 14px; padding: 11px 14px; }
.sc-ico { font-size: 19px; flex: none; }
.sc-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; }
.sc-pts { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sc-pts.plus { color: var(--crew); }
.sc-pts.zero { color: var(--dim); }
#result-score { width: 100%; display: flex; flex-direction: column; gap: 7px; }

.rules { background: var(--surface); border: 1px solid var(--brd); border-radius: 18px; padding: 16px; }
.rules-title { font-size: 13px; font-weight: 700; letter-spacing: 1.2px; color: var(--dim); margin-bottom: 10px; }
.rule { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: #D8D4F0; padding: 4px 0; line-height: 1.4; }
.rule-pts { flex: none; min-width: 32px; text-align: center; border-radius: 8px; padding: 3px 6px; font-size: 12.5px; font-weight: 700; }
.rule-pts.crew { background: rgba(45,225,194,.16); color: var(--crew); }
.rule-pts.imp { background: rgba(255,107,74,.18); color: var(--imp); }

/* ── Nachschlagen (Bottom Sheet) ── */
.card-help {
  margin-top: 4px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  color: #CFE6E0; border-radius: 999px; padding: 8px 15px; font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.card-help:active { transform: scale(.96); }

.sheet-bg {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end;
  background: rgba(4,4,12,.6); backdrop-filter: blur(4px); animation: fade .18s;
}
.sheet-bg[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(26px); } }
.sheet {
  width: 100%; max-height: 72vh; overflow-y: auto; background: #17162E;
  border-top: 1px solid var(--brd-hi); border-radius: 26px 26px 0 0;
  padding: 10px 22px calc(24px + var(--safe-b)); animation: rise .22s cubic-bezier(.2,.9,.3,1.2);
}
.sheet-grip { width: 42px; height: 4px; border-radius: 99px; background: #3A3860; margin: 2px auto 14px; }
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-head h3 {
  flex: 1; min-width: 0; margin: 0; font-family: 'Bricolage Grotesque', 'Outfit', sans-serif;
  font-weight: 800; font-size: 26px; letter-spacing: -.6px;
}
.sheet-body { font-size: 15px; line-height: 1.6; color: #D8D4F0; margin: 14px 0 0; }
.sheet-body.muted { color: var(--dim); font-size: 14.5px; }
.sheet-link { display: inline-block; margin-top: 14px; color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: none; }
.sheet-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--brd); font-size: 12.5px; color: var(--dim); line-height: 1.5; }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%) translateY(16px);
  z-index: 60; background: #1B1A33; border: 1px solid var(--brd-hi); border-radius: 14px;
  padding: 12px 18px; font-size: 14px; font-weight: 600; opacity: 0;
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(255,143,163,.55); color: #FF8FA3; }
.toast[hidden] { display: none; }
