:root {
  --bg: #0b0a14;
  --card: rgba(31, 26, 54, 0.66);
  --card-solid: #1d1834;
  --card-2: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f2ff;
  --muted: #a49dc9;
  --faint: #6f688f;
  --accent: #7c5cff;
  --accent-2: #b892ff;
  --accent-3: #5cc8ff;
  --danger: #ff5d7d;
  --good: #45e0b0;
  --gold: #ffd166;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.7);
  --glow: 0 10px 34px -8px rgba(124, 92, 255, 0.6);
}

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

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Inter", Roboto, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* Aurora-Hintergrund */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
}
body::before {
  width: 460px; height: 460px;
  background: radial-gradient(circle, #7c5cff, transparent 70%);
  top: -160px; left: -120px;
  animation: float1 16s ease-in-out infinite;
}
body::after {
  width: 420px; height: 420px;
  background: radial-gradient(circle, #5cc8ff, transparent 70%);
  bottom: -180px; right: -140px;
  animation: float2 20s ease-in-out infinite;
}
@keyframes float1 { 50% { transform: translate(60px, 80px) scale(1.1); } }
@keyframes float2 { 50% { transform: translate(-50px, -60px) scale(1.15); } }

#app {
  max-width: 520px;
  margin: 0 auto;
  padding: 22px 16px 56px;
  position: relative;
}

/* ---------- screens ---------- */
.screen { display: none; }
.screen.active { display: block; animation: rise 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- brand ---------- */
.brand { text-align: center; margin: 16px 0 26px; }
.brand .logo {
  font-size: 52px; display: inline-block;
  filter: drop-shadow(0 6px 16px rgba(124, 92, 255, 0.5));
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.brand h1 {
  font-size: 46px; margin: 6px 0 4px; font-weight: 800; letter-spacing: -1.5px;
  background: linear-gradient(110deg, var(--accent-2) 10%, var(--accent) 55%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { color: var(--muted); margin: 0; font-size: 15px; letter-spacing: 0.2px; }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card.center { text-align: center; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h2 {
  font-size: 13px; margin: 0; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--muted);
}

.pill {
  background: linear-gradient(135deg, var(--accent), #9a6bff);
  color: #fff; font-weight: 700; font-size: 13px;
  min-width: 26px; height: 26px; border-radius: 13px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px -3px rgba(124, 92, 255, 0.7);
}

.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

/* ---------- players ---------- */
.players-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.players-list:empty { display: none; }
.player-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px 14px;
  animation: rise 0.25s ease;
}
.player-row .avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
}
.player-row .pname { font-weight: 600; flex: 1; }
.player-row button {
  background: none; border: none; color: var(--faint);
  font-size: 18px; cursor: pointer; line-height: 1; padding: 4px 6px; border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.player-row button:hover { color: var(--danger); background: rgba(255, 93, 125, 0.12); }

.add-row { display: flex; gap: 10px; }
.add-row input {
  flex: 1; background: var(--card-2); border: 1px solid var(--line);
  color: var(--text); border-radius: var(--radius-sm); padding: 13px 15px; font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.add-row input::placeholder { color: var(--faint); }
.add-row input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.18);
}

/* ---------- buttons ---------- */
.btn-icon {
  background: linear-gradient(135deg, var(--accent), #9a6bff); color: #fff;
  border: none; cursor: pointer; width: 48px; height: 48px; border-radius: var(--radius-sm);
  font-size: 22px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -5px rgba(124, 92, 255, 0.8);
  transition: transform 0.1s, filter 0.15s;
}
.btn-icon:active { transform: scale(0.9); }
.btn-icon:hover { filter: brightness(1.12); }

.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .btn-icon { width: 40px; height: 40px; font-size: 20px; }
.stepper span {
  font-size: 22px; font-weight: 800; min-width: 34px; text-align: center;
  font-variant-numeric: tabular-nums;
}

.btn-primary {
  width: 100%; border: none; border-radius: 16px; padding: 16px;
  font-size: 16px; font-weight: 700; cursor: pointer; color: #fff;
  background: linear-gradient(120deg, #8a63ff, var(--accent) 60%, #6d4bff);
  background-size: 160% 160%;
  box-shadow: var(--glow);
  transition: transform 0.1s, filter 0.15s, background-position 0.4s;
}
.btn-primary:hover { filter: brightness(1.08); background-position: 100% 0; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.big { padding: 18px; font-size: 18px; margin-top: 6px; letter-spacing: 0.2px; }

.btn-ghost {
  width: 100%; background: transparent; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 16px; padding: 14px;
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 10px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); background: rgba(124, 92, 255, 0.08); }

/* ---------- toggle ---------- */
.toggle { display: flex; align-items: center; justify-content: space-between; cursor: pointer; gap: 14px; }
.toggle span:first-child { font-size: 14px; color: var(--text); }
.toggle input { display: none; }
.switch {
  width: 50px; height: 28px; background: var(--line-strong); border-radius: 14px;
  position: relative; flex-shrink: 0; transition: background 0.25s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  background: #fff; border-radius: 50%; transition: transform 0.25s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.toggle input:checked + .switch { background: linear-gradient(135deg, var(--accent), #9a6bff); }
.toggle input:checked + .switch::after { transform: translateX(22px); }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chips.center-chips { justify-content: center; }
.chip {
  background: var(--card-2); border: 1px solid var(--line); color: var(--muted);
  padding: 9px 15px; border-radius: 22px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; user-select: none;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.active {
  background: linear-gradient(135deg, var(--accent), #9a6bff);
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px -6px rgba(124, 92, 255, 0.8);
}
.chip .x { margin-left: 8px; color: var(--danger); font-weight: 700; }
.chips.small .chip { font-size: 13px; padding: 7px 13px; cursor: default; }

/* ---------- pass / reveal ---------- */
#screen-pass { min-height: 78vh; }
#screen-pass.active { display: flex; flex-direction: column; justify-content: center; }

.dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 22px; }
.dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong);
  transition: all 0.3s;
}
.dot.done { background: var(--accent); }
.dot.current { background: var(--accent-2); transform: scale(1.5); box-shadow: 0 0 12px var(--accent-2); }

.flip { perspective: 1400px; }
.flip-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
  min-height: 360px;
}
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 34px 24px;
  border-radius: 26px; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(40, 33, 70, 0.9), rgba(23, 19, 42, 0.9));
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.flip-front .btn-primary,
.flip-back .btn-primary { margin-top: 22px; max-width: 280px; }
.flip-back { transform: rotateY(180deg); }

.pass-hand { font-size: 60px; margin-bottom: 8px; animation: bob 3s ease-in-out infinite; }
.pass-to { color: var(--muted); margin: 0; font-size: 15px; }
#pass-name { font-size: 32px; margin: 6px 0 0; font-weight: 800; letter-spacing: -0.5px; }

.role-for { color: var(--muted); margin: 0 0 20px; font-size: 15px; }
.role-body { display: flex; flex-direction: column; align-items: center; }
.role-word {
  font-size: 38px; font-weight: 800; letter-spacing: -0.8px; word-break: break-word;
  background: linear-gradient(120deg, var(--accent-2), var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.role-cat { color: var(--muted); font-size: 14px; margin-top: 10px; }
.role-impostor { font-size: 30px; font-weight: 800; color: var(--danger); }
.role-impostor .sub {
  display: block; font-size: 14px; color: var(--muted); font-weight: 500; margin-top: 12px;
}

.progress { text-align: center; color: var(--faint); margin-top: 24px; font-size: 14px; font-weight: 600; }

/* ---------- play / solution ---------- */
#screen-play .card h2 { font-size: 22px; text-transform: none; letter-spacing: -0.3px; color: var(--text); }
.starter {
  margin-top: 20px;
  background: linear-gradient(135deg, rgba(69, 224, 176, 0.12), rgba(92, 200, 255, 0.1));
  border: 1px solid rgba(69, 224, 176, 0.3);
  border-radius: 18px; padding: 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.starter span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.starter strong { font-size: 26px; color: var(--good); font-weight: 800; }

.solution-word {
  font-size: 44px; margin: 10px 0; letter-spacing: -1.2px; font-weight: 800;
  background: linear-gradient(120deg, var(--accent-2), var(--good));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes pop { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }
.impostors { margin-top: 24px; }
.impostors .hint { text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; }
.impostors .chip {
  background: rgba(255, 93, 125, 0.14); border-color: rgba(255, 93, 125, 0.45);
  color: #ff92a8; cursor: default;
}

.error { color: var(--danger); text-align: center; min-height: 18px; margin: 12px 0 0; font-size: 14px; font-weight: 600; }

#install-btn { margin-top: 14px; }
