:root {
  --bg: #070605;
  --bg-2: #120e0c;
  --panel: rgba(18, 12, 10, 0.78);
  --blood: #9a1f1f;
  --blood-2: #c43333;
  --gold: #c4a35a;
  --gold-dim: #8a7340;
  --cream: #eadcc8;
  --mute: #9a8f82;
  --felt: #152016;
  --line: rgba(196, 163, 90, 0.28);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --ui-top: var(--safe-top);
  --ui-bot: var(--safe-bot);
  --tab-h: calc(78px + var(--ui-bot));
}

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

html,
body {
  height: 100%;
  background: #050403;
  color: var(--cream);
  font-family: Manrope, system-ui, sans-serif;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 430px;
  max-height: 100%;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(154, 31, 31, 0.22), transparent 55%),
    radial-gradient(90% 50% at 50% 110%, rgba(196, 163, 90, 0.08), transparent 50%),
    linear-gradient(180deg, #0c0908 0%, #070605 40%, #050403 100%);
  overflow: hidden;
}

@media (min-width: 480px) {
  #app {
    height: min(900px, 96vh);
    border-radius: 28px;
    box-shadow:
      0 40px 90px rgba(0, 0, 0, 0.75),
      0 0 0 1px #2a2118,
      inset 0 0 80px rgba(0, 0, 0, 0.35);
  }
}

.grain,
.vignette,
.fog {
  pointer-events: none !important;
  position: absolute;
  inset: 0;
  z-index: 1;
}

.grain {
  opacity: 0.14;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.vignette {
  z-index: 9;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.72) 100%);
}

.fog {
  z-index: 2;
  background:
    radial-gradient(50% 30% at 20% 80%, rgba(180, 170, 150, 0.08), transparent 70%),
    radial-gradient(40% 25% at 80% 90%, rgba(180, 170, 150, 0.07), transparent 70%);
  animation: fog 12s ease-in-out infinite alternate;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -1%); }
  100% { transform: translate(0, 2%); }
}

@keyframes fog {
  from { opacity: 0.55; transform: translateX(-4%); }
  to { opacity: 1; transform: translateX(4%); }
}

#screen {
  position: relative;
  z-index: 10;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: calc(12px + var(--ui-top)) 18px calc(16px + var(--ui-bot));
}

#screen.scroll-y {
  overflow-y: auto;
}

#app.has-tabs #screen {
  padding-bottom: calc(12px + var(--tab-h));
}

.skyline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34%;
  z-index: 1;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.5));
}

.skyline svg {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 160px;
}

.moon {
  position: absolute;
  top: 8%;
  right: 14%;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f3e6c4, #c4a35a 55%, #6a5428);
  box-shadow: 0 0 40px rgba(196, 163, 90, 0.35), 0 0 80px rgba(196, 163, 90, 0.12);
  z-index: 1;
  animation: moon 8s ease-in-out infinite;
}

@keyframes moon {
  50% { filter: brightness(1.15); }
}

.brand {
  position: relative;
  z-index: 5;
  text-align: center;
  margin-top: 8vh;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.85;
}

h1 {
  font-family: Unbounded, sans-serif;
  font-weight: 700;
  font-size: 52px;
  letter-spacing: 0.12em;
  line-height: 1;
  margin: 10px 0 8px;
  background: linear-gradient(180deg, #f3e6c4 0%, #c4a35a 55%, #8a5a2a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6));
}

.subtitle {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 20px;
  color: var(--mute);
}

.you {
  margin: 28px auto 0;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  color: var(--mute);
  font-size: 13px;
}

.avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: #1a1410;
  color: var(--gold);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-actions {
  position: relative;
  z-index: 5;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(40, 28, 20, 0.9), rgba(16, 10, 8, 0.95));
  color: var(--cream);
  font-family: Unbounded, sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 16px 18px;
  border-radius: 14px;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: linear-gradient(180deg, #8a1c1c, #5a1010);
  border-color: rgba(196, 51, 51, 0.45);
  box-shadow: 0 10px 24px rgba(154, 31, 31, 0.28);
}

.btn.gold {
  background: linear-gradient(180deg, #c4a35a, #8a7340);
  color: #1a120c;
  border-color: #e6d3a0;
}

.btn.ghost {
  background: transparent;
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.tables-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.tables-page .list {
  flex: 1;
}

.tables-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding: 10px 0 6px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, #070605 28%);
}

.tables-actions .btn {
  flex: 1;
  padding: 14px 10px;
  font-size: 11px;
}

.hint {
  text-align: center;
  font-size: 12px;
  color: var(--mute);
  line-height: 1.45;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
  z-index: 5;
}

.topbar h2 {
  font-family: Unbounded, sans-serif;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.linkish {
  background: none;
  border: 0;
  color: var(--gold);
  font: inherit;
  cursor: pointer;
  font-size: 13px;
}

.list {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  flex: 1;
  padding-bottom: 8px;
}

.card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  padding: 14px;
  backdrop-filter: blur(10px);
}

.table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.table-row .meta {
  font-size: 12px;
  color: var(--mute);
  margin-top: 4px;
}

.input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  color: var(--cream);
  border-radius: 12px;
  padding: 14px 14px;
  font: inherit;
  outline: none;
}

.input:focus {
  border-color: var(--gold);
}

.lobby-people {
  flex: 1 1 auto;
  overflow: auto;
  padding: 8px 0 8px;
  min-height: 140px;
}

.table-set {
  flex: 0 0 auto;
  padding: 4px 0 10px;
}

.table-set .n-title {
  text-align: center;
  margin-bottom: 8px;
}

.size-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.size-chip {
  min-width: 44px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(18, 12, 10, 0.72);
  color: var(--cream);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#screen.view-lobby {
  padding-left: 14px;
  padding-right: 14px;
}

#screen.view-lobby .table-set {
  padding: 0 0 4px;
}

#screen.view-lobby .table-set .n-title {
  margin-bottom: 6px;
  font-size: 11px;
}

#screen.view-lobby .size-row {
  gap: 6px;
  margin-bottom: 4px;
}

#screen.view-lobby .size-chip {
  min-width: 36px;
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

#screen.view-lobby .table-set .hint {
  font-size: 11px;
  margin: 0;
}

#screen.view-lobby .lobby-people {
  min-height: 0;
  padding: 4px 0;
}

#screen.view-lobby .roster {
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 6px;
  padding-top: 4px;
}

#screen.view-lobby .person {
  padding: 3px 3px 4px;
}

#screen.view-lobby .person::before {
  width: 8px;
  height: 8px;
  top: -3px;
}

#screen.view-lobby .person .avatar {
  margin-bottom: 2px;
  font-size: 13px;
}

#screen.view-lobby .person .nm {
  font-size: 11px;
}

#screen.view-lobby .host-tag {
  font-size: 7px;
  margin: 0;
}

#screen.view-lobby .chat.compact {
  max-height: 9vh;
  min-height: 0;
  margin-top: 2px;
  padding: 2px 0 4px;
}

#screen.view-lobby .composer {
  gap: 6px;
}

#screen.view-lobby .composer .input {
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 10px;
}

#screen.view-lobby .composer .btn {
  padding: 8px 12px;
  font-size: 11px;
  border-radius: 10px;
}

.lobby-code {
  text-align: center;
  margin: 4px 0 6px;
}

#screen.view-lobby .code-pill {
  padding: 5px 10px;
  font-size: 11px;
  letter-spacing: 0.16em;
}

.lobby-actions {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding-bottom: 2px;
}

.lobby-actions .btn {
  padding: 9px 8px;
  font-size: 10px;
  letter-spacing: 0.06em;
  border-radius: 10px;
}

.lobby-actions .btn.primary {
  grid-column: 1 / -1;
}

.lobby-actions .hint {
  grid-column: 1 / -1;
}

.size-chip.on {
  border-color: var(--gold);
  background: rgba(196, 163, 90, 0.18);
  color: var(--gold);
}

.roster {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 12px;
  padding-top: 8px;
}

.roster.tight {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 5px;
  padding-top: 4px;
}

.person {
  position: relative;
  text-align: center;
  background: linear-gradient(175deg, #efe4cd 0%, #e2d3b2 70%, #d3c09b 100%);
  border-radius: 3px;
  padding: 5px 5px 6px;
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.5),
    inset 0 0 12px rgba(120, 90, 40, 0.12);
  transform: rotate(-2.2deg);
}

.person:nth-child(2n) {
  transform: rotate(1.8deg);
}

.person:nth-child(3n) {
  transform: rotate(-0.8deg);
}

.person:nth-child(5n) {
  transform: rotate(2.6deg);
}

.person::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0d78a, #9a6a2a 70%, #6a4418);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
  z-index: 3;
}

.person .avatar {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0 0 4px;
  font-size: 18px;
  border-radius: 2px;
  border: 0;
  background: #241a12;
  color: #d9c9a8;
  filter: sepia(0.25) contrast(1.05);
}

.person.is-host::before {
  background: radial-gradient(circle at 35% 30%, #e07777, #9a1f1f 70%, #5a0e0e);
}

.person.dead {
  filter: saturate(0.6);
}

.person.dead .avatar {
  filter: grayscale(1) brightness(0.75) sepia(0.25);
}

.person.dead::after {
  content: "выбыл";
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-family: Unbounded, sans-serif;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a1212;
  border: 3px solid #7a1212;
  border-radius: 4px;
  padding: 7px 10px;
  background: rgba(255, 236, 210, 0.82);
  opacity: 1;
  z-index: 2;
}

.person.won::after,
.person.lost::after {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-family: Unbounded, sans-serif;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 3px solid;
  border-radius: 4px;
  padding: 7px 10px;
  background: rgba(255, 236, 210, 0.82);
  opacity: 1;
  z-index: 2;
}

.person.won::after {
  content: "победа";
  color: #6a5428;
  border-color: #6a5428;
}

.person.lost::after {
  content: "проиграл";
  color: #5a5048;
  border-color: #5a5048;
}

.roster.tight .person {
  padding: 3px 3px 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.roster.tight .person .avatar {
  margin: 0 0 2px;
  font-size: 12px;
}

.roster.tight .person .nm {
  font-size: 11px;
}

.roster.tight .person::before {
  width: 8px;
  height: 8px;
  top: -3px;
}

.roster.tight .person.dead::after,
.roster.tight .person.won::after,
.roster.tight .person.lost::after {
  font-size: 8px;
  padding: 2px 4px;
  border-width: 2px;
  letter-spacing: 0.06em;
}

.roster.tight .role-tag,
.roster.tight .host-tag {
  font-size: 7px;
  margin: 0 0 1px;
}

.role-tag {
  display: block;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4a3018;
  margin: 0 0 3px;
}

.rating-hero {
  text-align: center;
  margin: 16px 0 12px;
  padding: 16px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.rating-hero b {
  display: block;
  font-family: Unbounded, sans-serif;
  font-size: 42px;
  background: linear-gradient(180deg, #f3e6c4, #c4a35a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 4px 0;
}

.rating-hero span {
  color: var(--mute);
  font-size: 12px;
}

.rating-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.board {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.board-foot {
  margin-top: auto;
  padding-top: 14px;
  padding-bottom: 6px;
}

.board-foot .hint {
  margin: 0 0 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
}

.board-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 12, 10, 0.7);
}

.board-row .avatar {
  width: 28px;
  height: 28px;
  font-size: 10px;
}

.board-row.me {
  border-color: var(--gold);
}

.board-n {
  font-family: Unbounded, sans-serif;
  color: var(--gold);
  width: 22px;
}

.board-name {
  flex: 1;
}

.board-pts {
  font-family: Unbounded, sans-serif;
  font-size: 14px;
}

.family-strip {
  margin-bottom: 10px;
  pointer-events: auto;
}

.family-strip .roster {
  grid-template-columns: repeat(3, 1fr);
}

.win {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

#app.night-on #screen .family-strip {
  pointer-events: auto;
}

.person .nm {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 15px;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.host-tag {
  display: block;
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8f1d1d;
  margin: -1px 0 2px;
}

.lobby-people.compact .roster {
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 10px;
}

.lobby-people.compact .person .nm {
  font-size: 14px;
}

.felt,
.table-board {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 88%;
  aspect-ratio: 1.7 / 1;
  height: auto;
  max-height: 78%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.table-board {
  background:
    radial-gradient(ellipse at 50% 40%, #3d6b45 0%, #1f4a2a 42%, #12321c 78%);
  border: 4px solid #d4b36a;
  box-shadow:
    0 0 0 10px #4a2e18,
    0 0 0 12px #c4a35a,
    0 22px 36px rgba(0, 0, 0, 0.55),
    inset 0 8px 28px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.table-board img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
}

.table-board .mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: Unbounded, sans-serif;
  letter-spacing: 0.32em;
  font-size: 12px;
  color: rgba(232, 210, 150, 0.55);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  z-index: 1;
}

.felt {
  background:
    radial-gradient(ellipse at 50% 40%, #3d6b45 0%, #1f4a2a 45%, #12321c 80%);
  border: 4px solid #d4b36a;
  box-shadow:
    0 0 0 10px #4a2e18,
    0 0 0 12px #c4a35a,
    0 22px 36px rgba(0, 0, 0, 0.55),
    inset 0 8px 24px rgba(0, 0, 0, 0.25);
}

.felt::after {
  content: "МАФИЯ";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: Unbounded, sans-serif;
  letter-spacing: 0.28em;
  font-size: 12px;
  color: rgba(232, 210, 150, 0.5);
}

.seat {
  position: absolute;
  width: 58px;
  transform: translate(-50%, -50%);
  text-align: center;
}

.seat .avatar {
  width: 46px;
  height: 46px;
  margin: 0 auto 4px;
}

.seat.dead .avatar {
  filter: grayscale(1) brightness(0.55);
  border-color: #5a4030;
}

.seat .nm {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70px;
  margin: 0 auto;
}

.seat.host .avatar {
  box-shadow: 0 0 0 2px var(--gold);
}

.code-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px dashed var(--gold-dim);
  padding: 8px 12px;
  border-radius: 999px;
  font-family: Unbounded, sans-serif;
  letter-spacing: 0.2em;
  font-size: 13px;
  color: var(--gold);
}

.narrator-box {
  position: relative;
  z-index: 5;
  margin-top: auto;
  background: linear-gradient(180deg, rgba(10, 8, 7, 0.2), rgba(10, 8, 7, 0.88));
  border-top: 1px solid var(--line);
  padding: 16px 4px 8px;
}

.narrator-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.maestro {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid var(--gold-dim);
  background: #120e0c;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.n-title {
  font-family: Unbounded, sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.n-text {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  line-height: 1.35;
  font-style: italic;
  min-height: 2.7em;
}

.timer {
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.phase-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5;
  min-height: 0;
  overflow: hidden;
}

.role-card {
  margin: auto;
  width: min(280px, 86%);
  aspect-ratio: 3 / 4.2;
  border-radius: 18px;
  border: 1px solid var(--gold);
  background:
    radial-gradient(80% 50% at 50% 0%, rgba(196, 163, 90, 0.18), transparent 50%),
    linear-gradient(180deg, #1a120e, #0c0908);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
  animation: deal 0.8s ease;
}

.role-card.mafia {
  border-color: #c43333;
  background:
    radial-gradient(80% 50% at 50% 0%, rgba(196, 51, 51, 0.25), transparent 50%),
    linear-gradient(180deg, #1a0a0a, #0c0707);
}

@keyframes deal {
  from { transform: rotateY(80deg) scale(0.8); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.role-card h3 {
  font-family: Unbounded, sans-serif;
  font-size: 28px;
  margin: 12px 0 8px;
}

.role-card p {
  color: var(--mute);
  font-size: 14px;
  line-height: 1.45;
}

.mates {
  margin-top: 14px;
  font-size: 12px;
  color: var(--gold);
}

.sheet {
  position: relative;
  z-index: 6;
  background: rgba(10, 8, 7, 0.92);
  border: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  padding: 14px 4px 8px;
  margin: 0 -18px 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.targets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 1;
  min-height: 140px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 4px 14px 10px;
}

.target {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.target:active {
  border-color: var(--gold);
}

.chat {
  flex: 0 0 auto;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0 8px;
  max-height: 22vh;
}

.chat.compact {
  max-height: 16vh;
  min-height: 44px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

.msg {
  font-size: 13px;
  line-height: 1.4;
}

.msg b {
  color: var(--gold);
  font-weight: 600;
}

.composer {
  display: flex;
  gap: 8px;
}

.composer .input {
  flex: 1;
}

.composer .btn {
  padding: 12px 14px;
  border-radius: 12px;
}

.badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--gold);
}

.win {
  text-align: center;
  margin: auto 0;
}

.win h2 {
  font-family: Unbounded, sans-serif;
  font-size: 28px;
  margin: 12px 0;
}

.roles-end {
  margin-top: 16px;
  text-align: left;
  font-size: 13px;
  color: var(--mute);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(24px + var(--ui-bot));
  z-index: 20;
  background: #1a120c;
  border: 1px solid var(--gold-dim);
  color: var(--cream);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  text-align: center;
}

.hidden {
  display: none !important;
}

.check {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--gold-dim);
  font-size: 13px;
  color: var(--gold);
  background: rgba(10, 8, 7, 0.92);
}

.night-bg .moon {
  top: 6%;
}

.pulse {
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.55; }
}

.empty {
  color: var(--mute);
  text-align: center;
  padding: 40px 10px;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 20px;
}

.boot-splash {
  color: var(--mute);
  text-align: center;
  padding: 80px 20px 40px;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 22px;
}

#maestro-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  background:
    radial-gradient(70% 50% at 50% 30%, rgba(80, 30, 20, 0.25), transparent 70%),
    #070605;
}

#maestro-layer.hidden {
  display: none !important;
}

#app.night-on #screen {
  background: transparent;
  pointer-events: none;
  overflow: hidden;
}

#app.night-on #screen .topbar,
#app.night-on #screen .sheet,
#app.night-on #screen .targets,
#app.night-on #screen .check,
#app.night-on #screen .icon-btn,
#app.night-on #screen button,
#app.night-on #screen .night-meta,
#app.night-on #screen .phase-screen,
#app.night-on #screen .family-strip,
#app.night-on #screen .dead-screen,
#app.night-on #screen .dead-leave {
  pointer-events: auto;
}

#app.night-on .fog {
  opacity: 0.4;
}

.maestro-hit {
  position: absolute;
  left: 0;
  top: 0;
  transform: none;
  width: 100%;
  height: 72%;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}

.host {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  background: #070605;
  box-shadow: none;
}

.host-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  opacity: 0;
  pointer-events: none;
}

.host-frame.on {
  opacity: 1;
}

.subtitles {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 20px 18px calc(18px + var(--ui-bot));
  background: linear-gradient(180deg, transparent, rgba(5, 4, 3, 0.94) 38%);
}

.subtitles .n-title {
  margin-bottom: 8px;
}

.subtitles .n-text {
  min-height: 3.2em;
  font-size: 21px;
}

.icon-btns {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: auto;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(10, 8, 7, 0.7);
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: Unbounded, sans-serif;
}

.icon-btn.off {
  opacity: 0.4;
  color: var(--mute);
}

.night-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-top: 4px;
}

.night-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.night-card b {
  font-family: Unbounded, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--gold);
}

#sky {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1.4s ease;
}

#app.night-on #sky,
#app[data-mood="dawn"] #sky {
  opacity: 1;
}

.sky-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #02010c 0%, #0a1020 42%, #140c14 100%);
  transition: background 4.5s ease;
}

#app[data-mood="night_falls"] .sky-grad {
  background: linear-gradient(180deg, #01010a 0%, #070b16 50%, #120810 100%);
}

#app[data-mood="night_courtesan"] .sky-grad,
#app[data-mood="night_mafia"] .sky-grad {
  background: linear-gradient(180deg, #050312 0%, #12081a 48%, #2a1018 100%);
}

#app[data-mood="night_sheriff"] .sky-grad,
#app[data-mood="night_doctor"] .sky-grad {
  background: linear-gradient(180deg, #0a1428 0%, #1a2038 45%, #3a2418 100%);
}

#app[data-mood="dawn"] .sky-grad {
  background: linear-gradient(180deg, #1a2848 0%, #c45a32 52%, #f0c48a 100%);
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 28% 32%, rgba(255,255,255,.8), transparent),
    radial-gradient(1px 1px at 46% 12%, #fff, transparent),
    radial-gradient(1px 1px at 63% 24%, rgba(255,255,255,.7), transparent),
    radial-gradient(2px 2px at 78% 16%, #f3e6c4, transparent),
    radial-gradient(1px 1px at 88% 38%, #fff, transparent),
    radial-gradient(1px 1px at 18% 48%, rgba(255,255,255,.6), transparent),
    radial-gradient(1.5px 1.5px at 52% 42%, #fff, transparent),
    radial-gradient(1px 1px at 71% 52%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 34% 8%, #fff, transparent);
  animation: twinkle 3.6s ease-in-out infinite alternate;
  opacity: 0.85;
  transition: opacity 4s ease;
}

#app[data-mood="dawn"] .stars {
  opacity: 0.12;
}

@keyframes twinkle {
  from { opacity: 0.45; }
  to { opacity: 0.95; }
}

.sky-moon {
  position: absolute;
  top: 14%;
  left: 68%;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #f7ecd0, #c4a35a 62%, #6a5428);
  box-shadow: 0 0 40px rgba(243, 230, 196, 0.35), 0 0 80px rgba(196, 163, 90, 0.18);
  transition: top 5s ease, left 5s ease, opacity 4s ease, transform 5s ease;
}

#app[data-mood="night_mafia"] .sky-moon {
  top: 22%;
  left: 58%;
}

#app[data-mood="night_sheriff"] .sky-moon,
#app[data-mood="night_doctor"] .sky-moon {
  top: 38%;
  left: 36%;
}

#app[data-mood="dawn"] .sky-moon {
  top: 62%;
  left: 14%;
  opacity: 0.25;
  transform: scale(0.7);
}

.dawn-band {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38%;
  background: linear-gradient(180deg, transparent, rgba(196, 90, 40, 0));
  transition: background 4.5s ease, height 4.5s ease;
}

#app[data-mood="dawn"] .dawn-band {
  height: 55%;
  background: linear-gradient(180deg, transparent, rgba(240, 180, 90, 0.45) 70%);
}

#app.night-on .host {
  opacity: 0.18;
  filter: saturate(0.4) brightness(0.5);
  transition: opacity 1.6s ease;
}

#app[data-mood="dawn"] .host {
  opacity: 0.08;
}

#app[data-mood="night_sheriff"] {
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(196, 163, 90, 0.22), transparent 55%),
    #070605;
}

#app[data-mood="night_doctor"] {
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(40, 110, 70, 0.28), transparent 55%),
    #070605;
}

#app[data-mood="dawn"] {
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(180, 90, 50, 0.28), transparent 55%),
    #120c08;
}

#app.night-on .phase-screen {
  justify-content: flex-start;
  padding-bottom: 96px;
}

#app.night-on .topbar {
  position: relative;
  z-index: 6;
}

#app.night-on .sheet {
  margin-top: auto;
  margin-bottom: 0;
  background: rgba(10, 8, 7, 0.94);
}

#app.night-on .check,
#app.night-on .notes-pad {
  position: relative;
  z-index: 8;
  background: rgba(10, 8, 7, 0.94);
}

.notes-pad {
  font-size: 12px;
  line-height: 1.4;
  color: var(--gold);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  margin: 6px 0;
  max-height: 22vh;
  overflow: auto;
  background: rgba(10, 8, 7, 0.78);
}

.notes-pad .n-title {
  margin-bottom: 4px;
}

.notes-pad div + div {
  color: var(--cream);
  opacity: 0.92;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  background: var(--gold);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: pulse 0.9s steps(1) infinite;
}

.host::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, #070605 92%);
  pointer-events: none;
}

#screen.flush {
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}

.tabbar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(10px + var(--ui-bot));
  z-index: 40;
  padding: 0;
  background: none;
  border: 0;
  pointer-events: auto;
}

.tabbar-dock {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 7px 6px;
  border-radius: 24px;
  background: rgba(12, 9, 8, 0.88);
  border: 1px solid rgba(196, 163, 90, 0.38);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 220, 170, 0.1);
  backdrop-filter: blur(22px);
}

.tabbar.hidden {
  display: none !important;
}

.tab {
  appearance: none;
  border: 0;
  background: none;
  color: #8a8074;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 2px 0 1px;
}

.tab-ico {
  width: 42px;
  height: 32px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  transition: 0.18s ease;
}

.tab-ico svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.tab-lbl {
  font-family: Manrope, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tab.on {
  color: #1a120c;
}

.tab.on .tab-ico {
  background: linear-gradient(180deg, #f0d78a, #c4a35a);
  box-shadow: 0 8px 16px rgba(196, 163, 90, 0.32);
}

.tab.on .tab-lbl {
  color: #e6c97a;
}

.home {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.home-hero {
  position: relative;
  flex: 1;
  min-height: 38%;
  overflow: hidden;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #120e0c url("/img/club-hero.jpg?v=0813m") center 40% / cover no-repeat;
  animation: kenburns 22s ease-in-out infinite alternate;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 6, 5, 0.2) 0%, rgba(7, 6, 5, 0.15) 45%, #070605 100%);
}

.home-top {
  position: absolute;
  top: calc(10px + var(--ui-top));
  left: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: rgba(10, 8, 7, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  font-size: 12px;
}

.profile-chip .avatar {
  width: 26px;
  height: 26px;
  font-size: 10px;
}

.home-logo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 2;
  text-align: center;
  padding: 0 16px;
}

.home-logo h1 {
  font-size: 44px;
  margin: 4px 0;
}

.home-sheet {
  position: relative;
  z-index: 3;
  padding: 14px 16px 8px;
  background: #0c0908;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tile-wide {
  width: 100%;
  min-height: 72px;
}

.home-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.home-sheet .input {
  margin-bottom: 10px;
}

.cta {
  width: 100%;
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: Unbounded, sans-serif;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f3e6c4;
  padding: 17px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #c43333 0%, #7a1414 100%);
  box-shadow: 0 12px 28px rgba(154, 31, 31, 0.38);
  margin-bottom: 0;
}

.cta small {
  display: block;
  margin-top: 4px;
  font-family: Manrope, sans-serif;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.85;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tile {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(40, 30, 22, 0.95), rgba(14, 10, 8, 0.95));
  color: var(--cream);
  border-radius: 16px;
  padding: 14px 12px;
  cursor: pointer;
  min-height: 84px;
}

.tile b {
  display: block;
  font-family: Unbounded, sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.tile span {
  font-size: 12px;
  color: var(--mute);
  line-height: 1.35;
}

.soon {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.7;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 14px;
  background: var(--panel);
}

.stat-card b {
  display: block;
  font-family: Unbounded, sans-serif;
  font-size: 22px;
  color: var(--gold);
  margin-bottom: 4px;
}

.stat-card span {
  font-size: 12px;
  color: var(--mute);
}

.page-pad {
  padding: 0 18px 0;
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.deal {
  align-items: center;
}

.deal-card {
  width: min(300px, 88%);
  margin: 12px auto 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--gold);
  background: #120e0c;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55);
  animation: deal 0.8s ease;
}

.deal-card.mafia {
  border-color: #c43333;
}

.deal-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: 50% 20%;
  display: block;
}

.deal-meta {
  padding: 14px 16px 18px;
}

.deal-meta h3 {
  font-family: Unbounded, sans-serif;
  font-size: 24px;
  margin: 8px 0 6px;
}

.deal-meta p {
  color: var(--mute);
  font-size: 14px;
  line-height: 1.45;
}

.mic-now {
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 12, 10, 0.72);
  margin-bottom: 10px;
  position: relative;
}

.mic-now.slim {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mic-now.slim .mic-switch {
  margin-top: 0;
  grid-template-columns: 1fr 1fr;
  min-width: 118px;
}

.mic-now.slim .mic-btn {
  padding: 8px 6px;
  font-size: 10px;
}

.mic-meta {
  flex: 1;
  min-width: 0;
}

.mic-meta b {
  display: block;
  font-size: 14px;
}

.mic-meta span {
  font-size: 11px;
  color: var(--mute);
}

.mic-now.live {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(196, 163, 90, 0.18);
}

.mic-ring {
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.mic-now.live .mic-ring .avatar {
  width: 40px;
  height: 40px;
  box-shadow: 0 0 0 2px var(--gold);
}

.mic-now .avatar {
  width: 40px;
  height: 40px;
  margin: 0;
}

.mic-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c43333;
  margin: 6px auto 8px;
  box-shadow: 0 0 10px #c43333;
}

.mic-now.live .mic-dot {
  animation: pulse 1s ease-in-out infinite;
}

.quit-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(10, 8, 7, 0.72);
  color: var(--cream);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: Unbounded, sans-serif;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

button,
.tab,
.tile,
.cta,
[data-act] {
  touch-action: manipulation;
  cursor: pointer;
}

.titlecard {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  pointer-events: none !important;
  background:
    radial-gradient(80% 55% at 50% 50%, rgba(20, 12, 8, 0.6), rgba(5, 4, 3, 0.97) 78%);
  opacity: 0;
}

.titlecard.play {
  animation: title-io 1.9s ease forwards;
}

@keyframes title-io {
  0% { opacity: 0; }
  14% { opacity: 1; }
  78% { opacity: 1; }
  100% { opacity: 0; }
}

.tc-inner {
  position: relative;
  text-align: center;
  padding: 22px 16px;
  max-width: calc(100% - 28px);
  box-sizing: border-box;
  border: 1px solid var(--gold-dim);
  background: rgba(8, 6, 5, 0.6);
}

.tc-inner::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(196, 163, 90, 0.35);
  pointer-events: none;
}

.tc-inner h2 {
  font-family: Unbounded, sans-serif;
  font-size: clamp(18px, 6.2vw, 26px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 10px 0 6px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  background: linear-gradient(180deg, #f3e6c4 0%, #c4a35a 60%, #8a5a2a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tc-sub {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 19px;
  color: var(--mute);
  margin-bottom: 10px;
}

.tc-orn {
  font-size: 8px;
  letter-spacing: 0.6em;
  color: var(--gold);
  opacity: 0.75;
}

.home-hero::before {
  animation: kenburns 22s ease-in-out infinite alternate;
}

@keyframes kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.09) translateY(-2%); }
}

.home-logo .eyebrow,
.win .eyebrow,
.role-home .eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.home-logo .eyebrow::before,
.win .eyebrow::before,
.role-home .eyebrow::before {
  content: "";
  height: 1px;
  width: 36px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.home-logo .eyebrow::after,
.win .eyebrow::after,
.role-home .eyebrow::after {
  content: "";
  height: 1px;
  width: 36px;
  background: linear-gradient(270deg, transparent, var(--gold));
}

.cta {
  position: relative;
  overflow: hidden;
}

.cta::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -70%;
  width: 42%;
  background: linear-gradient(100deg, transparent, rgba(255, 235, 190, 0.2), transparent);
  transform: skewX(-18deg);
  animation: sheen 4.6s ease-in-out infinite;
}

@keyframes sheen {
  0%, 55% { left: -70%; }
  100% { left: 140%; }
}

.tile {
  position: relative;
}

.tile::before,
.tile::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  opacity: 0.65;
  pointer-events: none;
}

.tile::before {
  top: 7px;
  left: 7px;
  border-top: 1px solid var(--gold-dim);
  border-left: 1px solid var(--gold-dim);
}

.tile::after {
  bottom: 7px;
  right: 7px;
  border-bottom: 1px solid var(--gold-dim);
  border-right: 1px solid var(--gold-dim);
}

#screen.no-pad {
  padding: 0;
}

.role-full {
  position: relative;
  height: 100%;
  overflow: hidden;
  animation: role-in 0.9s ease;
}

@keyframes role-in {
  from { opacity: 0; transform: scale(1.05); }
  to { opacity: 1; transform: none; }
}

.role-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
}

.role-full::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 4, 3, 0.55) 0%, transparent 22%),
    linear-gradient(180deg, transparent 44%, rgba(5, 4, 3, 0.72) 74%, #050403 100%);
}

.role-top {
  position: absolute;
  top: calc(10px + var(--ui-top));
  right: 14px;
  z-index: 3;
}

.role-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  text-align: center;
  padding: 0 22px calc(30px + var(--ui-bot));
}

.role-cap .eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.role-cap .eyebrow::before,
.role-cap .eyebrow::after {
  content: "";
  height: 1px;
  width: 34px;
}

.role-cap .eyebrow::before {
  background: linear-gradient(90deg, transparent, var(--gold));
}

.role-cap .eyebrow::after {
  background: linear-gradient(270deg, transparent, var(--gold));
}

.role-cap h1 {
  font-size: 46px;
  margin: 8px 0 10px;
}

.role-full.mafia .role-cap h1 {
  background: linear-gradient(180deg, #f0c9b0 0%, #c46033 55%, #7a2214 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.role-blurb {
  font-size: 15px;
  line-height: 1.5;
  color: var(--cream);
  opacity: 0.92;
  max-width: 320px;
  margin: 0 auto;
}

.role-cap .mates {
  margin-top: 12px;
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid rgba(196, 51, 51, 0.5);
  border-radius: 999px;
  background: rgba(20, 8, 6, 0.72);
  color: #e6a08a;
  font-size: 13px;
}

#app[data-mood="night_courtesan"] {
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(160, 50, 90, 0.3), transparent 55%),
    #070605;
}

.mic-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.mic-btn {
  appearance: none;
  margin: 0;
  width: 100%;
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: Unbounded, sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 10px;
  border-radius: 14px;
  color: #f3e6c4;
  background: linear-gradient(180deg, #3a2a20, #1a120c);
}

.mic-btn.on {
  background: linear-gradient(180deg, #c43333, #7a1414);
  border-color: rgba(196, 51, 51, 0.5);
  box-shadow: 0 10px 24px rgba(154, 31, 31, 0.35);
}

.mic-btn.off.active {
  border-color: var(--gold);
  color: var(--mute);
}

html.in-tg {
  --ui-top: var(--tg-safe-top, 0px);
  --ui-bot: var(--tg-safe-bot, env(safe-area-inset-bottom, 0px));
}

html.in-tg.tg-desktop {
  --ui-top: var(--tg-safe-top, 10px);
}

html.in-tg,
html.in-tg body,
html.in-tg #app {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
}

.vote-screen {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vote-board {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding: 2px 0 8px;
  -webkit-overflow-scrolling: touch;
}

.vote-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(18, 12, 10, 0.86);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  flex-shrink: 0;
}

.vote-row .avatar {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.vote-row.picked {
  border-color: var(--gold);
  background: rgba(196, 163, 90, 0.14);
}

.vote-name {
  flex: 1;
  font-size: 15px;
}

.vote-n {
  font-family: Unbounded, sans-serif;
  color: var(--gold);
  min-width: 1.4em;
  text-align: right;
  font-size: 16px;
}

.vote-log {
  flex: 0 0 auto;
  max-height: 28%;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding: 8px 0 4px;
  -webkit-overflow-scrolling: touch;
}

.vote-line {
  font-size: 13px;
  line-height: 1.45;
  padding: 2px 0;
}

.vote-line.mute {
  color: var(--mute);
  font-size: 12px;
}

.confirm {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(5, 4, 3, 0.78);
  padding: 24px;
}

.confirm-card {
  width: 100%;
  max-width: 320px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #120e0c;
  padding: 22px 18px 16px;
  text-align: center;
}

.confirm-card h3 {
  font-family: Unbounded, sans-serif;
  font-size: 18px;
  margin: 8px 0 10px;
}

.confirm-card p {
  color: var(--mute);
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 14px;
}

.confirm-card .btn {
  width: 100%;
  margin-top: 8px;
}

.next-game {
  flex: 0 0 auto;
  margin-top: 12px;
  padding-top: 10px;
}

.next-game .hint {
  margin-bottom: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
}

.next-ready {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.next-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--mute);
}

.next-pill.on {
  border-color: var(--gold);
  color: var(--gold);
}

.next-game .btn {
  width: 100%;
  margin-top: 8px;
}

.mic-now.live .mic-ring {
  border-radius: 50%;
  box-shadow: 0 0 0 calc(8px * var(--lvl, 0.4)) rgba(196, 51, 51, 0.32);
}

.you {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rating-hero {
  margin: 16px 0 4px;
  padding: 18px 16px;
  border-radius: 18px;
  border: 1px solid rgba(196, 163, 90, 0.4);
  background:
    radial-gradient(80% 80% at 50% 0%, rgba(196, 163, 90, 0.18), transparent 70%),
    linear-gradient(180deg, rgba(40, 28, 16, 0.95), rgba(12, 9, 8, 0.95));
  text-align: center;
}

.rating-hero b {
  display: block;
  font-family: Unbounded, sans-serif;
  font-size: 36px;
  color: var(--gold);
  margin: 4px 0 2px;
}

.rating-hero span {
  color: var(--mute);
  font-size: 12px;
}

.board {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.board-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(18, 12, 10, 0.72);
  cursor: pointer;
}

.board-row.me {
  border-color: rgba(196, 163, 90, 0.45);
  background: rgba(196, 163, 90, 0.1);
}

.board-n {
  width: 22px;
  font-family: Unbounded, sans-serif;
  font-size: 12px;
  color: var(--gold);
}

.board-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-pts {
  font-family: Unbounded, sans-serif;
  color: var(--gold);
}

.board-foot {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.board-hint {
  margin: 10px 0 0;
}

.resume-banner {
  width: 100%;
  appearance: none;
  border: 1px solid rgba(196, 163, 90, 0.55);
  background: linear-gradient(180deg, rgba(50, 36, 18, 0.98), rgba(18, 12, 8, 0.98));
  color: var(--cream);
  border-radius: 16px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(196, 163, 90, 0.12);
}

.resume-banner b {
  display: block;
  font-family: Unbounded, sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.resume-banner span {
  font-size: 12px;
  color: var(--mute);
  line-height: 1.35;
}

.ach-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 22px 0 10px;
}

.ach-head span {
  font-size: 12px;
  color: var(--gold);
}

.ach-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-bottom: 18px;
}

.ach {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 12px 14px;
  background: linear-gradient(180deg, rgba(40, 30, 22, 0.92), rgba(12, 9, 8, 0.96));
  text-align: center;
  min-height: 124px;
}

.ach.on {
  border-color: rgba(196, 163, 90, 0.55);
  box-shadow:
    0 8px 22px rgba(196, 163, 90, 0.12),
    inset 0 1px 0 rgba(243, 230, 196, 0.16);
}

.ach.off {
  opacity: 0.4;
  filter: grayscale(0.55);
}

.ach-ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 10px;
  border-radius: 50%;
  font-size: 18px;
  border: 1px solid var(--gold-dim);
  background: radial-gradient(circle at 35% 30%, #3a2a18, #120e0c);
  color: var(--gold);
}

.ach.on .ach-ico {
  background: radial-gradient(circle at 35% 30%, #f3e6c4, #c4a35a 55%, #6a4a18);
  color: #1a120c;
  border-color: #e6d3a0;
  box-shadow: 0 0 16px rgba(196, 163, 90, 0.38);
}

.ach b {
  display: block;
  font-family: Unbounded, sans-serif;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 4px;
  line-height: 1.3;
}

.ach span:last-child {
  font-size: 11px;
  color: var(--mute);
  line-height: 1.3;
}

.support-link {
  appearance: none;
  border: 0;
  background: none;
  color: var(--mute);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 4px 2px;
  cursor: pointer;
  text-align: center;
}

.support-link:active {
  color: var(--gold);
}

textarea.support-in {
  min-height: 140px;
  resize: none;
  line-height: 1.45;
  text-align: left;
  letter-spacing: 0;
  text-transform: none;
  font-family: Manrope, system-ui, sans-serif;
}

.person.is-host {
  background: linear-gradient(175deg, #efe4cd 0%, #e2d3b2 70%, #d3c09b 100%);
}

.family-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.family-chip {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(196, 51, 51, 0.45);
  background: rgba(20, 8, 6, 0.72);
  color: #e6a08a;
}

.dead-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 20px 24px;
  gap: 8px;
}

#app.night-on #screen .dead-screen {
  justify-content: flex-end;
  padding: 12px 8px calc(18px + var(--ui-bot));
}

.dead-leave {
  margin-top: 12px;
  width: min(100%, 280px);
  position: relative;
  z-index: 6;
}

.dead-stamp {
  display: inline-block;
  font-family: Unbounded, sans-serif;
  font-size: clamp(28px, 9vw, 42px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9a1f1f;
  border: 4px solid #9a1f1f;
  border-radius: 6px;
  padding: 14px 18px;
  transform: rotate(-8deg);
  background: rgba(255, 236, 210, 0.88);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.dead-screen p {
  margin-top: 28px;
  color: var(--mute);
  font-size: 15px;
  line-height: 1.45;
}

.grave-list {
  width: min(100%, 340px);
  margin: 22px auto 0;
  text-align: left;
}

.grave-list .n-title {
  margin-bottom: 8px;
  text-align: center;
}

.grave-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.grave-row b {
  font-weight: 600;
}

.grave-row span {
  color: var(--gold);
  font-family: Unbounded, sans-serif;
  font-size: 12px;
}

.shop-inv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.shop-inv div {
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 6px;
  background: rgba(18, 12, 10, 0.72);
}

.shop-inv b {
  display: block;
  font-family: Unbounded, sans-serif;
  font-size: 20px;
  color: var(--gold);
}

.shop-inv span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--mute);
}

.shop-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(18, 12, 10, 0.72);
}

.shop-card b {
  display: block;
  font-family: Unbounded, sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.shop-card p {
  margin: 6px 0 10px;
  font-size: 13px;
  color: var(--mute);
  line-height: 1.4;
}

.shop-card .btn {
  width: 100%;
  padding: 10px 12px;
  font-size: 12px;
}

.gear-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.gear-tags span {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--gold);
}


