:root {
  --ink: #f4efe6;
  --muted: #aaa5bd;
  --line: rgba(255, 255, 255, 0.11);
  --card: rgba(16, 15, 30, 0.72);
  --card-hi: rgba(255, 255, 255, 0.06);
  --mafia: #ff4d5e;
  --sheriff: #f5c451;
  --angel: #8fd8ff;
  --civilian: #8be0a4;
  --gold: #f5c451;
  --role-color: var(--gold);
  --radius: 18px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--sans);
  color: var(--ink);
  background: #07070f;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* ============ Sky backdrop ============ */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #07070f;
}

.sky-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.8s ease;
}

.sky-dusk {
  background: linear-gradient(180deg, #0c0a1e 0%, #24143d 42%, #6b2847 78%, #b4533f 100%);
}
.sky-night {
  background: radial-gradient(ellipse 80% 50% at 75% 8%, rgba(60, 80, 160, 0.35), transparent 70%),
    linear-gradient(180deg, #04050d 0%, #0a1030 58%, #161b40 100%);
}
.sky-dawn {
  background: linear-gradient(180deg, #1a2453 0%, #5a3f74 40%, #d97b5f 78%, #ffc58a 100%);
}
.sky-day {
  background: linear-gradient(180deg, #2a64bd 0%, #5d9be0 48%, #a9c9e8 76%, #f0c99a 100%);
}

body[data-theme='dusk'] .sky-dusk,
body[data-theme='night'] .sky-night,
body[data-theme='dawn'] .sky-dawn,
body[data-theme='day'] .sky-day {
  opacity: 1;
}

.stars {
  position: absolute;
  inset: 0 0 30% 0;
  transition: opacity 1.8s ease;
}
.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: twinkle var(--d, 3s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes twinkle {
  50% {
    opacity: 0.2;
    transform: scale(0.7);
  }
}
body[data-theme='dusk'] .stars {
  opacity: 0.55;
}
body[data-theme='dawn'] .stars {
  opacity: 0.12;
}
body[data-theme='day'] .stars {
  opacity: 0;
}

.moon,
.sun {
  position: absolute;
  border-radius: 50%;
  transition: transform 2s cubic-bezier(0.3, 0.7, 0.2, 1), opacity 1.8s ease;
}
.moon {
  top: 7vh;
  right: 10vw;
  width: clamp(64px, 12vw, 104px);
  aspect-ratio: 1;
  background: radial-gradient(circle at 36% 34%, #fffdf0 0%, #ece4c6 55%, #cbc19d 100%);
  box-shadow: 0 0 70px 24px rgba(255, 246, 214, 0.16), inset -10px -8px 0 rgba(0, 0, 0, 0.07);
  opacity: 0;
  transform: translateY(40vh);
}
.moon::before,
.moon::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(150, 140, 110, 0.22);
}
.moon::before {
  width: 22%;
  height: 22%;
  top: 28%;
  left: 52%;
}
.moon::after {
  width: 14%;
  height: 14%;
  top: 60%;
  left: 30%;
}
body[data-theme='night'] .moon {
  opacity: 1;
  transform: none;
}
body[data-theme='dusk'] .moon {
  opacity: 0.9;
  transform: translateY(6vh);
}

.sun {
  top: 9vh;
  left: 12vw;
  width: clamp(80px, 15vw, 130px);
  aspect-ratio: 1;
  background: radial-gradient(circle, #fffbe0 0%, #ffe28a 55%, #ffc65a 100%);
  box-shadow: 0 0 90px 40px rgba(255, 210, 110, 0.35);
  opacity: 0;
  transform: translateY(60vh);
}
body[data-theme='day'] .sun {
  opacity: 1;
  transform: none;
}
body[data-theme='dawn'] .sun {
  opacity: 1;
  transform: translateY(46vh);
}

.skyline {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 34vh;
}
.skyline .bld {
  fill: #08070f;
  transition: fill 1.8s ease;
}
.skyline .bld.back {
  fill: #14122a;
}
body[data-theme='day'] .skyline .bld {
  fill: #1d2741;
}
body[data-theme='day'] .skyline .bld.back {
  fill: #3a4a6e;
}
body[data-theme='dawn'] .skyline .bld.back {
  fill: #3a2a4c;
}
.skyline .win {
  fill: #ffd77a;
  opacity: 0;
  transition: opacity 1.8s ease;
}
body[data-theme='night'] .skyline .win.on {
  opacity: 0.85;
}
body[data-theme='dusk'] .skyline .win.on {
  opacity: 0.6;
}
body[data-theme='dawn'] .skyline .win.on {
  opacity: 0.25;
}

.haze {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(5, 5, 14, 0.55) 100%);
}

/* ============ Layout ============ */

#app {
  max-width: 780px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    calc(20px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.enter > * {
  animation: rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.enter > *:nth-child(2) {
  animation-delay: 0.06s;
}
.enter > *:nth-child(3) {
  animation-delay: 0.12s;
}
.enter > *:nth-child(4) {
  animation-delay: 0.18s;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}

.card-title {
  font-family: var(--display);
  font-size: 1.3rem;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title + .card-title,
.card .card-title:not(:first-child) {
  margin-top: 22px;
}

.count {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--card-hi);
  border: 1px solid var(--line);
  color: var(--muted);
}

.eyebrow {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 700;
}

.sub {
  color: #d8d3e6;
  margin: 0;
  line-height: 1.5;
}

.hint {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0;
  text-align: center;
}
.hint.warn {
  color: #ffb3a8;
}

.waiting {
  color: var(--muted);
  text-align: center;
  margin: 6px 0;
  font-weight: 500;
}

.dots::after {
  content: '';
  animation: dots 1.4s steps(4) infinite;
}
@keyframes dots {
  0% {
    content: '';
  }
  25% {
    content: '.';
  }
  50% {
    content: '..';
  }
  75% {
    content: '...';
  }
}

/* ============ Buttons ============ */

.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 13px 20px;
  min-height: 48px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, filter 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  user-select: none;
}
.btn:active:not([disabled]) {
  transform: scale(0.97);
}
.btn svg {
  width: 18px;
  height: 18px;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #ff6170 0%, #d42c43 100%);
  box-shadow: 0 8px 24px rgba(255, 77, 94, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn-gold {
  color: #241904;
  background: linear-gradient(180deg, #ffd978 0%, #e7aa2f 100%);
  box-shadow: 0 8px 24px rgba(245, 196, 81, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-role {
  color: #0c0b14;
  background: var(--role-color);
  box-shadow: 0 8px 26px color-mix(in srgb, var(--role-color) 40%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-block {
  width: 100%;
}
.btn-lg {
  min-height: 56px;
  font-size: 1.05rem;
  border-radius: 16px;
}
.btn-sm {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.9rem;
  border-radius: 12px;
}

.link {
  background: none;
  border: 0;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 10px;
  cursor: pointer;
  font-size: 0.92rem;
}

.icon-btn {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn svg {
  width: 16px;
  height: 16px;
}

@media (hover: hover) {
  .btn-primary:hover:not([disabled]),
  .btn-gold:hover:not([disabled]),
  .btn-role:hover:not([disabled]) {
    filter: brightness(1.08);
  }
  .btn-ghost:hover:not([disabled]) {
    background: rgba(255, 255, 255, 0.14);
  }
  .icon-btn:hover {
    color: var(--mafia);
    border-color: rgba(255, 77, 94, 0.4);
  }
  .link:hover {
    color: var(--ink);
  }
}

/* ============ Shared bits ============ */

.ic {
  display: block;
  flex: none;
}
.ic-mafia,
.r-mafia {
  --role-color: var(--mafia);
}
.ic-sheriff,
.r-sheriff {
  --role-color: var(--sheriff);
}
.ic-angel,
.r-angel {
  --role-color: var(--angel);
}
.ic-civilian,
.r-civilian {
  --role-color: var(--civilian);
}
.ic.tinted {
  color: var(--role-color);
}

.avatar {
  --h: 0;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  text-transform: uppercase;
  color: #fff;
  background: radial-gradient(circle at 32% 28%, hsl(var(--h) 70% 64%), hsl(var(--h) 55% 38%));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22), 0 0 0 2px rgba(255, 255, 255, 0.1);
  position: relative;
}
.avatar.lg {
  width: 96px;
  height: 96px;
  font-size: 2.4rem;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.22), 0 0 0 3px rgba(255, 255, 255, 0.14), 0 16px 40px rgba(0, 0, 0, 0.5);
}
.avatar.sm {
  width: 22px;
  height: 22px;
  font-size: 0.66rem;
  box-shadow: none;
}
.avatar.dead {
  filter: grayscale(1) brightness(0.7);
}
.avatar .status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #888;
  border: 2px solid #15132a;
}
.avatar .status.on {
  background: #4ade80;
}

.tag {
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 99px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(245, 196, 81, 0.15);
  color: var(--gold);
  white-space: nowrap;
}
.tag.muted {
  background: var(--card-hi);
  color: var(--muted);
}
.tag.role {
  background: color-mix(in srgb, var(--role-color) 18%, transparent);
  color: var(--role-color);
}

/* ============ Home ============ */

.home {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 26px;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.brand .ic {
  width: 120px;
  height: 120px;
  color: #f4efe6;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.7));
  margin-bottom: -14px;
}
.logo {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3.6rem, 16vw, 6.4rem);
  letter-spacing: 0.14em;
  margin: 0 0 0 0.14em;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 30%, #c9bfae 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.6));
}
.logo-rule {
  width: 120px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--mafia), transparent);
  margin: 12px 0 10px;
}
.tagline {
  color: #ddd5e8;
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.1rem;
}

.form-card {
  width: 100%;
  max-width: 430px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.field > span {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}
input[type='text'] {
  width: 100%;
  min-height: 52px;
  padding: 13px 14px;
  font-size: 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.32);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type='text']::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
input[type='text']:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 196, 81, 0.18);
}
.code-input {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-weight: 800;
  text-align: center;
}
.join-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.join-row .btn {
  min-height: 52px;
  padding-inline: 24px;
}
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.or::before,
.or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.fineprint {
  color: var(--muted);
  font-size: 0.86rem;
  max-width: 34ch;
  margin: 0;
  line-height: 1.5;
}

.splash {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--muted);
}

/* ============ Lobby ============ */

.lobby-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.room-code {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.room-code span {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.9rem, 8vw, 2.5rem);
  width: 1.35em;
  height: 1.55em;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(10, 10, 22, 0.6);
  border: 1px solid var(--line);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.grid-2 {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 13px;
  background: var(--card-hi);
  border: 1px solid transparent;
}
.player-row.me {
  border-color: rgba(245, 196, 81, 0.35);
}
.player-row.offline {
  opacity: 0.5;
}
.player-row .name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.counter:last-of-type {
  border-bottom: 0;
}
.counter-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  min-width: 0;
}
.counter-label .ic {
  width: 34px;
  height: 34px;
  color: var(--role-color);
}
.counter-label small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.78rem;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stepper button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.stepper button:active:not([disabled]) {
  transform: scale(0.92);
}
.stepper button[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}
.stepper output {
  min-width: 2.2ch;
  text-align: center;
  font-weight: 800;
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}
@media (hover: hover) {
  .stepper button:hover:not([disabled]) {
    background: rgba(255, 255, 255, 0.15);
  }
}

.setting {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px 0;
}
.setting-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.setting-label svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  min-height: 38px;
  min-width: 48px;
  padding: 7px 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.chip.on {
  background: var(--gold);
  border-color: transparent;
  color: #241904;
}
.chip[disabled] {
  cursor: default;
}
.chip[disabled]:not(.on) {
  opacity: 0.45;
}
@media (hover: hover) {
  .chip:not([disabled]):not(.on):hover {
    background: rgba(255, 255, 255, 0.14);
  }
}

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 2px;
  font-weight: 600;
  cursor: pointer;
}
.switch small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8rem;
}
.switch .track {
  width: 52px;
  height: 30px;
  flex: none;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  position: relative;
  transition: background 0.2s;
  border: 0;
  cursor: pointer;
}
.switch .track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s cubic-bezier(0.3, 0.7, 0.3, 1.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.switch .track.on {
  background: var(--gold);
}
.switch .track.on::after {
  transform: translateX(22px);
}
.switch .track[disabled] {
  cursor: default;
  opacity: 0.6;
}

.cta {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 18px 0 calc(2px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.cta::before {
  content: '';
  position: absolute;
  inset: 0 -16px calc(-20px - env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(6, 6, 14, 0.85) 45%);
  z-index: -1;
  pointer-events: none;
}
.cta > .btn {
  max-width: 460px;
}

/* ============ In-game top bar ============ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  min-height: 38px;
  border-radius: 99px;
  background: rgba(8, 8, 18, 0.55);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.pill b {
  letter-spacing: 0.12em;
}
.pill svg {
  width: 18px;
  height: 18px;
}
button.pill {
  cursor: pointer;
}
button.pill .ic {
  width: 22px;
  height: 22px;
  color: var(--role-color);
}

/* ============ Phase header & timer ============ */

.phase-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding-top: 6px;
}
.phase-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.3rem, 10vw, 3.5rem);
  margin: 0;
  line-height: 1.05;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.55);
}
.phase-head .sub {
  max-width: 38ch;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.timer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.timer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 15px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.timer svg {
  width: 17px;
  height: 17px;
  opacity: 0.8;
}
.timer.low {
  color: #ff7a86;
  border-color: rgba(255, 77, 94, 0.5);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    transform: scale(1.06);
  }
}
.timebar {
  width: min(100%, 320px);
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.timebar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--gold), #ffe7a3);
  border-radius: 4px;
  transition: width 0.3s linear;
}
.timebar i.low {
  background: var(--mafia);
}

/* ============ Night: turn steps ============ */

.turn-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}
.turn-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 7px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(8, 8, 18, 0.5);
  border: 1px solid var(--line);
  transition: all 0.3s;
}
.turn-step .ic {
  width: 18px;
  height: 18px;
  color: currentColor;
}
.turn-step.done {
  opacity: 0.45;
  text-decoration: line-through;
}
.turn-step.now {
  color: #0c0b14;
  background: var(--role-color);
  border-color: transparent;
  box-shadow: 0 0 20px color-mix(in srgb, var(--role-color) 50%, transparent);
}
.turn-sep {
  width: 10px;
  height: 1.5px;
  background: var(--line);
}

/* ============ Night: target grid ============ */

.targets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}
.target {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 124px;
  padding: 16px 10px 14px;
  border-radius: 17px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.15s ease, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.target:active:not([disabled]) {
  transform: scale(0.96);
}
.target .name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.target.sel {
  border-color: var(--role-color);
  background: color-mix(in srgb, var(--role-color) 16%, rgba(16, 15, 30, 0.8));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--role-color) 28%, transparent),
    0 12px 34px color-mix(in srgb, var(--role-color) 25%, transparent);
}
.target.sel .avatar {
  box-shadow: 0 0 0 3px var(--role-color);
}
.target .check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--role-color);
  color: #0c0b14;
  transform: scale(0);
  transition: transform 0.2s cubic-bezier(0.3, 0.7, 0.3, 1.4);
}
.target .check svg {
  width: 14px;
  height: 14px;
}
.target.sel .check {
  transform: scale(1);
}
.target[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}
.target .note {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  min-height: 0;
}
.mini {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(255, 77, 94, 0.2);
  color: #ffbcc3;
}
@media (hover: hover) {
  .target:hover:not([disabled]):not(.sel) {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(28, 26, 48, 0.8);
  }
}

.crew {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.crew-member {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 99px;
  background: rgba(255, 77, 94, 0.12);
  border: 1px solid rgba(255, 77, 94, 0.3);
  font-size: 0.85rem;
  font-weight: 600;
}
.crew-member .avatar {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}
.crew-member em {
  font-style: normal;
  color: #ffbcc3;
}

.sleep {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 26px 18px;
}
.sleep .ic {
  width: 84px;
  height: 84px;
  color: var(--role-color);
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 22px color-mix(in srgb, var(--role-color) 50%, transparent));
}
@keyframes float {
  50% {
    transform: translateY(-8px);
  }
}
.sleep h3 {
  font-family: var(--display);
  font-size: 1.5rem;
  margin: 0;
}

.result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 26px 18px;
  border-radius: var(--radius);
  border: 1.5px solid;
  animation: stamp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1.2) both;
}
.result.guilty {
  border-color: rgba(255, 77, 94, 0.6);
  background: radial-gradient(circle at 50% 0%, rgba(255, 77, 94, 0.28), rgba(16, 15, 30, 0.85) 70%);
}
.result.innocent {
  border-color: rgba(139, 224, 164, 0.5);
  background: radial-gradient(circle at 50% 0%, rgba(139, 224, 164, 0.22), rgba(16, 15, 30, 0.85) 70%);
}
.result .verdict-word {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.8rem, 8vw, 2.6rem);
  line-height: 1.1;
}
.result.guilty .verdict-word {
  color: var(--mafia);
}
.result.innocent .verdict-word {
  color: var(--civilian);
}
@keyframes stamp {
  from {
    opacity: 0;
    transform: scale(1.15);
  }
}

.notebook {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.notebook li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  background: var(--card-hi);
  font-size: 0.92rem;
}
.notebook li .name {
  flex: 1;
  font-weight: 600;
}
.notebook .n {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 4.5em;
}
.is-mafia {
  color: var(--mafia);
  font-weight: 800;
}
.not-mafia {
  color: var(--civilian);
  font-weight: 800;
}

/* ============ Announcements ============ */

.announce {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 20px 0;
}
.announce .phase-title {
  font-size: clamp(2rem, 8.5vw, 3rem);
}
.victim {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  animation: drop 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.35s both;
}
.victim .who {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 900;
}
.victim .stampmark {
  position: absolute;
  inset: auto -18px 34% -18px;
  transform: rotate(-12deg);
  padding: 2px 4px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--mafia);
  border: 2.5px solid var(--mafia);
  border-radius: 6px;
  background: rgba(10, 6, 12, 0.75);
  text-shadow: none;
  animation: stamp 0.45s cubic-bezier(0.2, 0.8, 0.2, 1.4) 1.1s both;
}
.victim .reveal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--role-color) 16%, rgba(10, 10, 20, 0.7));
  border: 1px solid color-mix(in srgb, var(--role-color) 40%, transparent);
  color: var(--role-color);
  font-weight: 800;
}
.victim .reveal .ic {
  width: 24px;
  height: 24px;
}
@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-24px) scale(0.92);
  }
}
.big-icon {
  width: 96px;
  height: 96px;
  color: var(--role-color);
  filter: drop-shadow(0 0 30px color-mix(in srgb, var(--role-color) 55%, transparent));
  animation: drop 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s both;
}

.tally {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

/* ============ Night: private notes ============ */

.note-target .note-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.note-target.suspect {
  border-color: rgba(255, 77, 94, 0.7);
  background: rgba(255, 77, 94, 0.12);
}
.note-target.suspect .note-label {
  color: #ff8a95;
}
.note-target.trust {
  border-color: rgba(139, 224, 164, 0.6);
  background: rgba(139, 224, 164, 0.1);
}
.note-target.trust .note-label {
  color: var(--civilian);
}
.note-tag {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 99px;
  margin-left: 6px;
}
.note-tag.suspect {
  background: rgba(255, 77, 94, 0.2);
  color: #ff9aa4;
}
.note-tag.trust {
  background: rgba(139, 224, 164, 0.18);
  color: var(--civilian);
}

/* ============ Day discussion ============ */

.ready-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ready-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ready-bar {
  height: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.ready-bar i {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--gold), #ffe7a3);
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ready-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ready-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px 4px 4px;
  border-radius: 99px;
  background: var(--card-hi);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.reveal-waiting {
  width: 100%;
  max-width: 440px;
  text-align: left;
  gap: 10px;
}
.ghost-roles {
  gap: 8px;
}
.ready-chip i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
}
.ready-chip i svg {
  width: 12px;
  height: 12px;
}
.ready-chip.on {
  color: var(--ink);
  background: rgba(245, 196, 81, 0.14);
  border-color: rgba(245, 196, 81, 0.4);
}
.ready-chip.on i {
  background: var(--gold);
  border-color: var(--gold);
  color: #241904;
}

/* ============ Day voting ============ */

.vote-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}
.vote-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vote-row {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  text-align: left;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.12s;
}
.vote-row:active:not([disabled]) {
  transform: scale(0.985);
}
.vote-row[disabled] {
  cursor: default;
}
.vote-row > * {
  position: relative;
  z-index: 1;
}
.vote-row .bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 0%);
  background: linear-gradient(90deg, rgba(255, 77, 94, 0.08), rgba(255, 77, 94, 0.24));
  transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 0;
}
.vote-row.skip .bar {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.14));
}
.vote-row.mine {
  border-color: var(--mafia);
  box-shadow: 0 0 0 3px rgba(255, 77, 94, 0.2);
}
.vote-row.skip.mine {
  border-color: #ddd;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}
.vote-row .body {
  flex: 1;
  min-width: 0;
}
.vote-row .name {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.voters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.voter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 2px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.74rem;
  font-weight: 600;
  color: #e5e0ef;
}
.vote-count {
  font-weight: 900;
  font-size: 1.45rem;
  min-width: 1.6ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.vote-cta {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.vote-row.mine .vote-cta {
  color: var(--mafia);
}
@media (hover: hover) {
  .vote-row:hover:not([disabled]):not(.mine) {
    border-color: rgba(255, 255, 255, 0.3);
  }
}

.graveyard {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.grave {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 99px;
  background: rgba(10, 10, 20, 0.6);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 600;
}
.grave .avatar {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}
.grave .name {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  color: var(--muted);
}

/* ============ Role reveal card ============ */

.center-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
}
.flip-card {
  width: min(78vw, 300px);
  aspect-ratio: 5 / 7;
  perspective: 1200px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  flex: none;
}
.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.flip-card.flipped .flip-inner {
  transform: rotateY(180deg);
}
.flip-face {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 26px 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.flip-back {
  background: repeating-linear-gradient(45deg, rgba(245, 196, 81, 0.05) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(-45deg, rgba(245, 196, 81, 0.05) 0 2px, transparent 2px 14px),
    radial-gradient(circle at 50% 40%, #4a1525 0%, #1a0710 75%);
  animation: wobble 3.2s ease-in-out infinite;
}
.flip-card.flipped .flip-back {
  animation: none;
}
.flip-back::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1.5px solid rgba(245, 196, 81, 0.45);
  border-radius: 14px;
}
.flip-back .ic {
  width: 96px;
  height: 96px;
  color: var(--gold);
  opacity: 0.9;
}
.flip-back .back-label {
  font-family: var(--display);
  font-size: 1.15rem;
  font-style: italic;
  color: #f2dfae;
}
@keyframes wobble {
  50% {
    transform: translateY(-4px) rotate(-0.6deg);
  }
}
.flip-front {
  transform: rotateY(180deg);
  background: radial-gradient(circle at 50% 22%, color-mix(in srgb, var(--role-color) 34%, #14121f) 0%, #0c0b14 72%);
}
.flip-front::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1.5px solid color-mix(in srgb, var(--role-color) 50%, transparent);
  border-radius: 14px;
  pointer-events: none;
}
.flip-front .ic {
  width: 104px;
  height: 104px;
  color: var(--role-color);
  filter: drop-shadow(0 0 26px color-mix(in srgb, var(--role-color) 60%, transparent));
}
.role-name {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.7rem, 8vw, 2.1rem);
  color: var(--role-color);
  line-height: 1.1;
}
.role-blurb {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #dcd6e8;
}
.role-team {
  font-size: 0.82rem;
  color: #ffbcc3;
  font-weight: 600;
}

/* ============ Game over ============ */

.banner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
}
.banner .big-icon {
  width: 110px;
  height: 110px;
}
.banner h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.5rem, 11vw, 4.4rem);
  margin: 0;
  line-height: 1;
  color: var(--role-color);
  text-shadow: 0 6px 40px color-mix(in srgb, var(--role-color) 45%, transparent);
}
.you-result {
  font-weight: 800;
  font-size: 1.05rem;
}
.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.roster-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 13px;
  background: var(--card-hi);
  border: 1px solid var(--line);
  min-width: 0;
}
.roster-item .body {
  min-width: 0;
}
.roster-item .name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roster-item .rl {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--role-color);
}
.roster-item.dead .name {
  color: var(--muted);
  text-decoration: line-through;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline li {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 7px 0 7px 18px;
  border-left: 2px solid var(--line);
  font-size: 0.92rem;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 13px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}
.timeline li.k::before {
  background: var(--mafia);
}
.timeline li.v::before {
  background: var(--gold);
}
.timeline li.s::before {
  background: var(--angel);
}
.timeline .when {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 4.4em;
}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}
.confetti i {
  position: absolute;
  top: -20px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: fall var(--t, 3s) linear var(--delay, 0s) forwards;
}
@keyframes fall {
  to {
    transform: translate(var(--x, 0), 110vh) rotate(var(--r, 540deg));
  }
}

/* ============ Modal / toast / connection ============ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 3, 10, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade 0.25s ease;
  overflow-y: auto;
}
.modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 380px;
  animation: rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-body .card {
  width: 100%;
}
.modal-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}
.modal-actions .btn {
  flex: 1;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 30;
  transform: translate(-50%, 30px);
  opacity: 0;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(20, 18, 36, 0.95);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 0.92rem;
  text-align: center;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.conn {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  padding: 7px 16px;
  border-radius: 99px;
  background: rgba(212, 44, 67, 0.92);
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
}

/* ============ Voice chat ============ */

body.voice-on #app {
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
body.voice-on .toast {
  bottom: calc(96px + env(safe-area-inset-bottom));
}

.voice {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 15;
  width: min(748px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 20px;
  background: rgba(14, 13, 28, 0.9);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.voice svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.voice button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}
.voice-join {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  color: #062312;
  background: linear-gradient(180deg, #7cf0a6 0%, #34c26c 100%);
}
.voice-join[disabled] {
  opacity: 0.6;
  cursor: default;
}
.voice-hint {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.3;
}
.voice-mic {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s ease, color 0.2s ease;
}
.voice.live .voice-mic {
  color: #062312;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.22);
}
.voice.forced .voice-mic {
  color: var(--mafia);
  background: rgba(255, 77, 94, 0.14);
  cursor: not-allowed;
}
.voice-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.voice-text b,
.voice-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.voice-text b {
  font-size: 0.92rem;
}
.voice.forced .voice-text b {
  color: #ff9aa4;
}
.voice-text small {
  font-size: 0.76rem;
  color: var(--muted);
}
.voice-speakers {
  flex: none;
  max-width: 34%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 700;
  color: #4ade80;
}
.voice-speakers:empty {
  display: none;
}
.voice-unblock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  color: #241904;
  background: var(--gold);
}
.voice-leave {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}
.voice-leave svg {
  width: 16px;
  height: 16px;
}
.in-voice {
  display: grid;
  place-items: center;
  color: #4ade80;
}
.in-voice svg {
  width: 16px;
  height: 16px;
}
@media (hover: hover) {
  .voice-leave:hover {
    color: var(--mafia);
  }
}
@media (max-width: 480px) {
  .voice-hint {
    display: none;
  }
  .voice-join {
    flex: 1;
    justify-content: center;
  }
  .voice-unblock span {
    display: none;
  }
}

@media (max-width: 380px) {
  .card {
    padding: 14px;
  }
  .targets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .join-row .btn {
    padding-inline: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
