:root {
  --bg: #0f1020;
  --bg-2: #181a32;
  --card: #1f2147;
  --card-2: #272a59;
  --line: #34376e;
  --text: #eceeffe6;
  --muted: #9aa0d4;
  --accent: #7c5cff;
  --accent-2: #00d4b1;
  --danger: #ff5c7c;
  --warn: #ffb347;
  --radius: 18px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

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

html, body { height: 100%; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background:
    radial-gradient(1100px 700px at 15% -10%, #2a2470 0%, transparent 55%),
    radial-gradient(900px 600px at 110% 10%, #0c4a52 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100%;
  overflow-x: hidden;
}

#app { max-width: 560px; margin: 0 auto; padding: 22px 18px 60px; min-height: 100dvh; }

/* ---------- Typo / Bausteine ---------- */
h1 { font-size: 1.9rem; letter-spacing: -0.5px; }
h2 { font-size: 1.35rem; margin-bottom: 4px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.spacer { height: 16px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.brand .logo {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 1.5rem; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
}
.tagline { color: var(--muted); margin-bottom: 22px; }

.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

button, .btn {
  font: inherit; font-weight: 650; cursor: pointer; border: none;
  border-radius: 14px; padding: 15px 18px; width: 100%;
  background: var(--card-2); color: var(--text); border: 1px solid var(--line);
  transition: transform 0.06s ease, filter 0.15s ease, background 0.15s ease;
}
button:active, .btn:active { transform: scale(0.985); }
button.primary { background: linear-gradient(135deg, var(--accent), #9a7bff); border: none; }
button.accent { background: linear-gradient(135deg, var(--accent-2), #25e6c0); border: none; color: #06231f; }
button.ghost { background: transparent; }
button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
button.small { width: auto; padding: 9px 13px; font-size: 0.88rem; border-radius: 11px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; }
.btn-row > * { flex: 1; }

input, select {
  font: inherit; width: 100%; padding: 14px; border-radius: 13px;
  background: #14152e; border: 1px solid var(--line); color: var(--text);
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; color: var(--muted); font-size: 0.85rem; margin-bottom: 6px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: 999px; background: #ffffff14; font-size: 0.8rem; color: var(--muted);
}

/* ---------- Spielerliste ---------- */
.players { display: flex; flex-direction: column; gap: 9px; }
.player {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px;
  background: #ffffff0c; border-radius: 13px; border: 1px solid transparent;
}
.player .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-2); flex: none; }
.player .dot.off { background: #5a5f8f; }
.player .nm { font-weight: 600; }
.player .tag { margin-left: auto; font-size: 0.78rem; color: var(--muted); }
.player.you { border-color: var(--accent); }

/* ---------- QR ---------- */
.qrbox { display: grid; place-items: center; gap: 14px; }
.qrbox img { width: 230px; height: 230px; border-radius: 16px; background: #fff; padding: 10px; }
.code {
  font-size: 2.3rem; font-weight: 800; letter-spacing: 7px;
  background: #ffffff10; padding: 10px 18px; border-radius: 14px; display: inline-block;
}

/* ---------- Segmented Toggle ---------- */
.seg { display: flex; gap: 6px; background: #14152e; padding: 6px; border-radius: 14px; border: 1px solid var(--line); }
.seg button { background: transparent; border: none; padding: 11px; border-radius: 10px; }
.seg button.on { background: var(--accent); }

/* ---------- Rollenkarte ---------- */
.rolecard {
  border-radius: 24px; padding: 34px 24px; text-align: center; min-height: 340px;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  box-shadow: var(--shadow); border: 1px solid var(--line); position: relative; overflow: hidden;
}
.rolecard.word { background: linear-gradient(160deg, #1d2a55, #213a6e); }
.rolecard.imposter { background: linear-gradient(160deg, #4a1d3a, #6e2138); }
.rolecard .kicker { text-transform: uppercase; letter-spacing: 3px; font-size: 0.8rem; color: #ffffffb0; }
.rolecard .big { font-size: 2.6rem; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.rolecard .sub { color: #ffffffcc; font-size: 1rem; }
.rolecard .emoji { font-size: 3rem; }

/* Peek-Karte: nach oben wischen & halten zum Aufdecken, loslassen schließt */
.peek {
  position: relative; min-height: 360px; border-radius: 24px; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line); margin-bottom: 16px;
  touch-action: pan-x;
}
.peek-inner { position: absolute; inset: 0; }
.peek-inner .rolecard { height: 100%; min-height: 100%; margin: 0; border: none; box-shadow: none; border-radius: 24px; }
.peek-cover {
  position: absolute; inset: 0; z-index: 2; transform: translateY(0);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 28px; text-align: center; border-radius: 24px; cursor: grab; user-select: none;
  touch-action: none; will-change: transform;
  background: linear-gradient(160deg, #20274f, #2a2f63);
}
.peek-cover:active { cursor: grabbing; }
.peek-cover.closing { transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1); }
.peek-cover .grab { position: absolute; top: 12px; width: 46px; height: 5px; border-radius: 99px; background: #ffffff40; }
.peek-cover .emoji { font-size: 3.2rem; animation: bob 1.6s ease-in-out infinite; }
.peek-cover .peek-title { font-size: 1.6rem; font-weight: 800; }
.peek-cover .peek-hint {
  margin-top: 6px; font-size: 0.85rem; color: var(--accent-2); font-weight: 650;
  padding: 7px 14px; border-radius: 99px; background: #00d4b118;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Verdeckte Karte (Pass-and-Play) */
.cover {
  border-radius: 24px; padding: 40px 24px; text-align: center; min-height: 340px;
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
  background: linear-gradient(160deg, var(--card), var(--card-2)); border: 1px dashed var(--line);
}
.cover .emoji { font-size: 3.4rem; }

.notice { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 6px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(40px);
  background: #000000cc; backdrop-filter: blur(6px); color: #fff; padding: 12px 18px;
  border-radius: 12px; font-size: 0.9rem; opacity: 0; pointer-events: none;
  transition: all 0.25s ease; max-width: 90%; z-index: 50; border: 1px solid var(--line);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.fade-in { animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.list-num { display: flex; gap: 12px; margin-bottom: 12px; }
.list-num .n { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 0.85rem; font-weight: 700; flex: none; }
.link { color: var(--accent-2); cursor: pointer; text-decoration: underline; }
.back { width: auto; padding: 8px 0; background: transparent; border: none; color: var(--muted); margin-bottom: 8px; }
