/* ═══════════════════════════ Tokens ═══════════════════════════ */
:root {
  --bg: #06050d;
  --bg-2: #0c0a1a;
  --panel: rgba(22, 19, 44, 0.55);
  --panel-solid: #14112a;
  --panel-hi: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-hi: rgba(255, 255, 255, 0.18);
  --text: #f3f1ff;
  --muted: #9c98bd;
  --dim: #6c6890;

  --cyan: #7df9ff;
  --violet: #a78bfa;
  --pink: #ff7ad9;
  --iri: linear-gradient(115deg, #7df9ff 0%, #a78bfa 45%, #ff7ad9 100%);
  --metal: linear-gradient(180deg, #f4f6fb 0%, #a9b0c2 45%, #5d6479 55%, #d7dbe6 100%);

  --mafia: #ff3d6e;
  --doctor: #2ef0b0;
  --detective: #ffc857;
  --citizen: #4fb8ff;
  --danger: #ff4d6d;
  --ok: #2ef0b0;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--line);
  --blur: saturate(160%) blur(18px);

  --font: 'Readex Pro', system-ui, sans-serif;
  --display: 'Lalezar', 'Readex Pro', sans-serif;

  --phase-tint: 167, 139, 250;
  color-scheme: dark;
}

body[data-phase='doctor'] { --phase-tint: 46, 240, 176; }
body[data-phase='detective'] { --phase-tint: 255, 200, 87; }
body[data-phase='mafia'] { --phase-tint: 255, 61, 110; }
body[data-phase='voting'],
body[data-phase='night_result'],
body[data-phase='vote_result'] { --phase-tint: 125, 249, 255; }

/* ═══════════════════════════ Base ═══════════════════════════ */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }

::selection { background: rgba(167, 139, 250, 0.45); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.muted { color: var(--muted); }

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: -2;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(var(--phase-tint), 0.14), transparent 60%),
    radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.75) 100%);
  transition: background 1.2s ease;
}

.view {
  position: relative;
  min-height: 100dvh;
  animation: view-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ═══════════════════════════ Components ═══════════════════════════ */
.card {
  position: relative;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  padding: 22px;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), transparent 35%, transparent 70%, rgba(167, 139, 250, 0.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
}

.card-title .i { color: var(--violet); }

.btn {
  --h: 44px;
  /* A link styled as a button is still a link: keep the underline off. */
  text-decoration: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h);
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.25s ease, opacity 0.2s;
  isolation: isolate;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  color: #0b0820;
  background: var(--iri);
  background-size: 200% 100%;
  box-shadow: 0 10px 30px -10px rgba(167, 139, 250, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: iri-shift 6s ease-in-out infinite;
}

.btn-primary:not(:disabled):hover {
  box-shadow: 0 14px 40px -8px rgba(255, 122, 217, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

@keyframes iri-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn-soft {
  background: var(--panel-hi);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn-soft:hover { background: rgba(255, 255, 255, 0.1); }

.btn-ghost {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
}

.btn-ghost:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-hi); }

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #ff4d6d, #c9184a);
  box-shadow: 0 10px 30px -10px rgba(255, 77, 109, 0.8);
}

.btn-sm { --h: 36px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn-lg { --h: 52px; font-size: 16px; width: 100%; }
.btn-xl { --h: 60px; font-size: 18px; padding: 0 36px; border-radius: 18px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 11px;
  background: var(--panel-hi);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}

.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.icon-btn .i { width: 18px; height: 18px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.field input,
.chat-form input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px var(--line);
  outline: none;
  transition: box-shadow 0.2s, background 0.2s;
}

.field input:focus,
.chat-form input:focus {
  background: rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.7), 0 0 0 4px rgba(167, 139, 250, 0.15);
}

.field input::placeholder { color: var(--dim); }

#in-code {
  text-align: center;
  letter-spacing: 0.5em;
  font-weight: 700;
  font-size: 20px;
  text-transform: uppercase;
}

.avatar {
  --a1: #7df9ff;
  --a2: #a78bfa;
  position: relative;
  display: grid;
  place-items: center;
  width: var(--size, 48px);
  height: var(--size, 48px);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  color: #0b0820;
  font-weight: 700;
  font-size: calc(var(--size, 48px) * 0.42);
  box-shadow: inset 0 -6px 14px rgba(0, 0, 0, 0.25), inset 0 2px 6px rgba(255, 255, 255, 0.45);
  flex: none;
  user-select: none;
}

.avatar.has-pic { overflow: hidden; box-shadow: none; }
.avatar > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  pointer-events: none;
}

.avatar[data-a='0'] { --a1: #7df9ff; --a2: #a78bfa; }
.avatar[data-a='1'] { --a1: #ff9a8b; --a2: #ff6a88; }
.avatar[data-a='2'] { --a1: #f6d365; --a2: #fda085; }
.avatar[data-a='3'] { --a1: #84fab0; --a2: #8fd3f4; }
.avatar[data-a='4'] { --a1: #a18cd1; --a2: #fbc2eb; }
.avatar[data-a='5'] { --a1: #fccb90; --a2: #d57eeb; }
.avatar[data-a='6'] { --a1: #43e97b; --a2: #38f9d7; }
.avatar[data-a='7'] { --a1: #fa709a; --a2: #fee140; }
.avatar[data-a='8'] { --a1: #4facfe; --a2: #00f2fe; }
.avatar[data-a='9'] { --a1: #c471f5; --a2: #fa71cd; }
.avatar[data-a='10'] { --a1: #e0c3fc; --a2: #8ec5fc; }
.avatar[data-a='11'] { --a1: #ffecd2; --a2: #fcb69f; }

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--rc);
  background: color-mix(in srgb, var(--rc) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 40%, transparent);
}

.role-badge svg { width: 16px; height: 16px; }

html [data-role='mafia'] { --rc: var(--mafia); }
html [data-role='doctor'] { --rc: var(--doctor); }
html [data-role='detective'] { --rc: var(--detective); }
html [data-role='citizen'] { --rc: var(--citizen); }

/* ═══════════════════════════ Home ═══════════════════════════ */
@property --ang {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

#view-home {
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1260px;
  overflow-x: clip;
}

#view-home em {
  font-style: normal;
  background: linear-gradient(100deg, #ff3d6e, #ff7ad9 55%, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Scroll reveal */
.sr {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0s), transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0s);
}

.sr.in { opacity: 1; transform: none; }

.reveal-up { animation: rise 1s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0s) backwards; }

@keyframes rise {
  from { opacity: 0; transform: translateY(28px); filter: blur(6px); }
}

/* Nav */
.nav {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--maxw);
  margin: 12px auto 0;
  padding: 8px 10px 8px 14px;
  border-radius: 22px;
  transition: background 0.4s, box-shadow 0.4s, backdrop-filter 0.4s;
}

.nav.is-stuck {
  background: rgba(10, 8, 22, 0.7);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.8), inset 0 0 0 1px var(--line);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.nav-brand img { width: 52px; height: 52px; filter: drop-shadow(0 0 12px rgba(125, 249, 255, 0.35)); }

.nav-brand-txt {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  direction: ltr;
  letter-spacing: 0.02em;
}

.nav-brand-txt small {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.42em;
  color: var(--muted);
  margin-top: 4px;
}

.nav-links { display: flex; gap: 4px; }

.nav-links a {
  padding: 8px 16px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.nav-end { display: flex; align-items: center; gap: 14px; }

.nav-em {
  width: auto;
  height: 34px;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 14px rgba(200, 210, 255, 0.18));
}

/* Hero */
.hero {
  position: relative;
  max-width: var(--maxw);
  min-height: calc(100dvh - 90px);
  margin: 0 auto;
  padding: 30px var(--gutter) 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(20px, 4vw, 60px);
}

.hero-copy { position: relative; z-index: 2; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: #d9d6f5;
  background: linear-gradient(90deg, rgba(46, 240, 176, 0.12), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 0 0 1px rgba(46, 240, 176, 0.3);
}

.eyebrow .dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

.eyebrow .dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--ok);
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }

.title {
  position: relative;
  margin: 14px 0 0;
  line-height: 0.95;
}

.title-word {
  position: relative;
  display: inline-block;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(120px, 15.5vw, 228px);
  padding-top: 0.12em;
  background: linear-gradient(175deg, #ffffff 0%, #eef0fb 30%, #a4a8c4 48%, #5b5f7c 52%, #d8dbee 68%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.25)) drop-shadow(0 12px 0 rgba(0, 0, 0, 0.55)) drop-shadow(0 24px 40px rgba(0, 0, 0, 0.6));
}

/* Iridescent sheen sweeping across the letters */
.title-word::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  padding-top: inherit;
  background: linear-gradient(100deg, transparent 20%, rgba(125, 249, 255, 0.9) 35%, rgba(167, 139, 250, 0.9) 45%, rgba(255, 122, 217, 0.9) 55%, transparent 70%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  mix-blend-mode: overlay;
  animation: sheen 5s ease-in-out infinite;
}

/* Blood-red slash */
.title-word::after {
  content: '';
  position: absolute;
  inset-inline: 4% 10%;
  bottom: 18%;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, #ff3d6e 20%, #ff3d6e 70%, transparent);
  box-shadow: 0 0 22px #ff3d6e, 0 0 60px rgba(255, 61, 110, 0.6);
  transform: rotate(-6deg) scaleX(0);
  transform-origin: right;
  animation: slash 0.9s 0.9s cubic-bezier(0.7, 0, 0.2, 1) forwards;
  mix-blend-mode: screen;
}

@keyframes sheen {
  0% { background-position: 120% 0; }
  60%, 100% { background-position: -30% 0; }
}

@keyframes slash { to { transform: rotate(-6deg) scaleX(1); } }

.tagline {
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 700;
  margin-top: 4px;
}

.lead {
  font-size: 17px;
  color: var(--muted);
  max-width: 480px;
  margin: 10px 0 28px;
}

/* Entry card with animated gradient border */
.entry-card {
  position: relative;
  max-width: 480px;
  padding: 22px;
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(30, 26, 60, 0.75), rgba(12, 10, 26, 0.85));
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9), 0 0 80px -40px rgba(167, 139, 250, 0.7);
  isolation: isolate;
}

.entry-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--ang), rgba(255, 255, 255, 0.08) 0deg, #7df9ff 60deg, #a78bfa 110deg, #ff7ad9 160deg, rgba(255, 255, 255, 0.08) 220deg, rgba(255, 255, 255, 0.08) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: ang 6s linear infinite;
}

@keyframes ang { to { --ang: 360deg; } }

.tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 5px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 0 0 1px var(--line);
}

.tab {
  position: relative;
  z-index: 1;
  height: 42px;
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 600;
  transition: color 0.25s;
}

.tab.is-active { color: var(--text); }

.tab-indicator {
  position: absolute;
  top: 5px;
  bottom: 5px;
  right: 5px;
  width: calc(50% - 5px);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(125, 249, 255, 0.2), rgba(255, 122, 217, 0.2));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 6px 20px -6px rgba(167, 139, 250, 0.6);
  transition: transform 0.35s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.tabs[data-active='join'] .tab-indicator { transform: translateX(-100%); }

.hero-stats {
  list-style: none;
  display: flex;
  gap: 0;
  margin: 26px 0 0;
  padding: 0;
}

.hero-stats li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 22px;
  border-inline-start: 1px solid var(--line-hi);
}

.hero-stats li:first-child { padding-inline-start: 4px; border: 0; }

.hero-stats b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1;
  background: var(--iri);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-stats span { color: var(--muted); font-size: 14px; }

/* Stage */
.hero-stage {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  max-width: 640px;
  justify-self: center;
  perspective: 1200px;
}

.stage-spot {
  position: absolute;
  inset: -14% 8% 22%;
  background: linear-gradient(180deg, rgba(210, 200, 255, 0.22), rgba(167, 139, 250, 0.07) 55%, transparent 90%);
  -webkit-mask: conic-gradient(from 158deg at 50% -4%, transparent 0deg, #000 14deg, #000 30deg, transparent 44deg);
  mask: conic-gradient(from 158deg at 50% -4%, transparent 0deg, #000 14deg, #000 30deg, transparent 44deg);
  filter: blur(6px);
  animation: flicker 7s infinite;
  pointer-events: none;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  47% { opacity: 1; }
  48% { opacity: 0.55; }
  49% { opacity: 1; }
  51% { opacity: 0.7; }
  52% { opacity: 1; }
}

.stage-rings {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}

.stage-rings i {
  position: absolute;
  left: 50%;
  top: 72%;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  translate: -50% -50%;
  transform: rotateX(76deg);
  border: 1px solid rgba(167, 139, 250, 0.25);
  box-shadow: 0 0 40px rgba(167, 139, 250, 0.15), inset 0 0 40px rgba(125, 249, 255, 0.1);
}

.stage-rings i:nth-child(2) {
  width: 66%;
  border-color: rgba(125, 249, 255, 0.35);
  border-style: dashed;
  animation: ring-spin 30s linear infinite;
}

.stage-rings i:nth-child(3) {
  width: 44%;
  border: 2px solid transparent;
  background: conic-gradient(from 0deg, transparent, rgba(255, 122, 217, 0.8), transparent 40%) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: ring-spin 6s linear infinite;
}

@keyframes ring-spin { to { transform: rotateX(76deg) rotateZ(360deg); } }

.stage-tilt {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--ry)) rotateY(var(--rx));
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.stage-logo {
  position: absolute;
  left: 14%;
  top: 6%;
  width: 72%;
  height: auto;
  transform: translateZ(40px);
  filter: drop-shadow(0 40px 50px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 50px rgba(125, 249, 255, 0.22));
  animation: bob 7s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -18px; }
}

.float-card {
  --rc: var(--violet);
  position: absolute;
  width: 21%;
  aspect-ratio: 5 / 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8%;
  border-radius: 14px;
  color: var(--rc);
  background:
    radial-gradient(90% 60% at 50% 30%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 70%),
    linear-gradient(165deg, #1d1838, #0a0816);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 55%, transparent), 0 20px 40px -10px rgba(0, 0, 0, 0.8), 0 0 40px -10px color-mix(in srgb, var(--rc) 70%, transparent);
  animation: card-float 6s ease-in-out infinite;
}

.float-card::before {
  content: '';
  position: absolute;
  inset: 6%;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--rc) 30%, transparent);
}

.float-card svg { width: 52%; filter: drop-shadow(0 0 12px color-mix(in srgb, var(--rc) 80%, transparent)); }

.float-card span {
  font-family: var(--display);
  font-size: clamp(14px, 1.7vw, 22px);
  line-height: 1;
}

.fc-mafia { left: 3%; top: 18%; --r: -16deg; --z: 90px; animation-delay: -1s; }
.fc-doctor { right: 2%; top: 10%; --r: 12deg; --z: 20px; animation-delay: -3s; }
.fc-detective { right: -2%; top: 56%; --r: 8deg; --z: 110px; animation-delay: -2s; }
.fc-citizen { left: 6%; top: 62%; --r: -6deg; --z: 10px; animation-delay: -4.5s; }

@keyframes card-float {
  0%, 100% { transform: translateZ(var(--z)) rotate(var(--r)) translateY(0); }
  50% { transform: translateZ(var(--z)) rotate(calc(var(--r) * 0.6)) translateY(-14px); }
}

.stage-floor {
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: 4%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(167, 139, 250, 0.45), rgba(125, 249, 255, 0.12) 45%, transparent 70%);
  filter: blur(14px);
  animation: floor 7s ease-in-out infinite;
}

@keyframes floor { 50% { transform: scale(0.85); opacity: 0.7; } }

/* Marquee */
.marquee {
  position: relative;
  overflow: hidden;
  padding: 18px 0;
  margin: 10px 0 40px;
  transform: rotate(-2deg);
  background: linear-gradient(90deg, rgba(255, 61, 110, 0.14), rgba(167, 139, 250, 0.14), rgba(125, 249, 255, 0.14));
  border-block: 1px solid var(--line-hi);
  -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 34px;
  width: max-content;
  animation: marquee 36s linear infinite;
}

.marquee span {
  font-family: var(--display);
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.2;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.55);
}

.marquee span:nth-of-type(2n) { color: var(--text); -webkit-text-stroke: 0; }
.marquee i { font-style: normal; color: var(--pink); font-size: 22px; }

@keyframes marquee { to { transform: translateX(50%); } }

/* Sections */
.block {
  scroll-margin-top: 40px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(60px, 9vw, 120px) var(--gutter);
}

.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }

.sec-kicker {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--violet);
  background: rgba(167, 139, 250, 0.1);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.3);
}

.section-head h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.15;
  margin-top: 14px;
}

.section-head p { color: var(--muted); font-size: 17px; margin-top: 10px; }

/* Role cards - playing-card style with holographic sheen */
.role-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 26px);
  perspective: 1400px;
}

.role-card {
  --rc: var(--violet);
  --mx: 50%;
  --my: 50%;
  --tx: 0deg;
  --ty: 0deg;
  position: relative;
  aspect-ratio: 5 / 7.4;
  border-radius: 24px;
  padding: 10px;
  background: linear-gradient(165deg, #1e1a3a, #0a0816 70%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 40%, transparent), 0 30px 60px -30px rgba(0, 0, 0, 0.9);
  transform: rotateX(var(--ty)) rotateY(var(--tx));
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s, opacity 0.9s var(--d, 0s);
  overflow: hidden;
  cursor: default;
}

.role-card.sr { transform: translateY(40px) rotateX(20deg); }
.role-card.sr.in { transform: rotateX(var(--ty)) rotateY(var(--tx)); }

.role-card:hover {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 80%, transparent), 0 40px 80px -30px color-mix(in srgb, var(--rc) 60%, transparent);
}

.role-card .rc-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px 18px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--rc) 25%, transparent);
  background:
    radial-gradient(80% 50% at 50% 34%, color-mix(in srgb, var(--rc) 26%, transparent), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.018) 0 8px, transparent 8px 16px);
  text-align: center;
}

.rc-index {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--rc);
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
}

.rc-index svg { width: 24px; height: 24px; }
.rc-index.bottom { top: auto; right: auto; bottom: 14px; left: 14px; transform: rotate(180deg); }

.rc-emblem {
  width: 46%;
  aspect-ratio: 1;
  color: var(--rc);
  filter: drop-shadow(0 0 22px color-mix(in srgb, var(--rc) 70%, transparent));
  transform: translateZ(40px);
  transition: transform 0.5s;
}

.role-card:hover .rc-emblem { transform: translateZ(60px) scale(1.06); }

.role-card h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 3vw, 44px);
  color: var(--rc);
  margin-top: 12px;
  text-shadow: 0 0 24px color-mix(in srgb, var(--rc) 50%, transparent);
}

.role-card .team {
  display: inline-block;
  margin: 4px 0 12px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

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

.role-card .holo {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.22), transparent 40%),
    linear-gradient(115deg, transparent 20%, rgba(125, 249, 255, 0.25) 36%, rgba(167, 139, 250, 0.25) 46%, rgba(255, 122, 217, 0.25) 56%, transparent 72%);
  background-size: 100% 100%, 250% 250%;
  background-position: 0 0, var(--mx) var(--my);
  mix-blend-mode: color-dodge;
  transition: opacity 0.4s;
}

.role-card:hover .holo { opacity: 1; }

/* Timeline */
.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 44px;
  right: 12%;
  left: 12%;
  height: 2px;
  background: linear-gradient(270deg, var(--doctor), var(--detective), var(--mafia), var(--cyan));
  opacity: 0.5;
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
}

html [data-role='vote'] { --rc: var(--cyan); }

.timeline li { position: relative; text-align: center; padding: 0 8px; }

.tl-node {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--rc);
  background: radial-gradient(circle, color-mix(in srgb, var(--rc) 22%, #0b0918), #0b0918 70%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rc) 55%, transparent), 0 0 0 8px var(--bg), 0 0 50px -6px color-mix(in srgb, var(--rc) 70%, transparent);
  transition: transform 0.4s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.timeline li:hover .tl-node { transform: scale(1.1) rotate(-6deg); }
.tl-node svg { width: 50%; height: 50%; filter: drop-shadow(0 0 10px var(--rc)); }

.tl-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--rc);
  background: color-mix(in srgb, var(--rc) 10%, transparent);
}

.timeline h3 { font-size: 20px; margin: 12px 0 6px; }
.timeline p { color: var(--muted); font-size: 14px; }

/* Partner brands */
.brands {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 56px);
}

.brand-plate {
  position: relative;
  width: min(360px, 40vw);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-radius: 32px;
  background:
    radial-gradient(70% 60% at 50% 40%, rgba(125, 249, 255, 0.12), transparent 70%),
    linear-gradient(160deg, rgba(34, 30, 64, 0.7), rgba(10, 8, 22, 0.85));
  box-shadow: inset 0 0 0 1px var(--line-hi), 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.brand-plate:hover { transform: translateY(-8px); }

.brand-plate::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.1) 50%, transparent 65%);
  transform: translateX(100%);
  animation: plate-shine 5s ease-in-out infinite;
}

.brand-plate.is-em::after { animation-delay: 2.5s; }

@keyframes plate-shine {
  0%, 60% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.brand-plate img { width: 76%; height: auto; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.6)); }

.brand-plate.is-em {
  background:
    radial-gradient(70% 60% at 50% 40%, rgba(200, 210, 255, 0.14), transparent 70%),
    linear-gradient(160deg, rgba(40, 42, 64, 0.75), rgba(10, 10, 20, 0.9));
}

.brand-plate.is-em img { width: 72%; margin: 12% 0 8%; }



.brands-x {
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 64px);
  color: var(--dim);
}

/* Final CTA */
.final-cta {
  position: relative;
  text-align: center;
  margin-bottom: 40px;
  border-radius: 40px;
  background:
    radial-gradient(60% 80% at 50% 110%, rgba(255, 61, 110, 0.3), transparent 70%),
    radial-gradient(60% 80% at 50% -10%, rgba(125, 249, 255, 0.18), transparent 70%),
    rgba(18, 15, 38, 0.6);
  box-shadow: inset 0 0 0 1px var(--line);
  max-width: calc(var(--maxw) - 2 * var(--gutter));
  width: calc(100% - 2 * var(--gutter));
}

.final-cta h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 1.15;
}

.final-cta p { color: var(--muted); font-size: 17px; margin: 8px 0 28px; }
.final-cta .btn { text-decoration: none; }

.site-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 30px 0 50px;
  color: var(--dim);
  font-size: 13px;
}

.foot-logos { display: flex; align-items: center; gap: 22px; }
.foot-logos img { width: 64px; height: auto; }
.foot-logos .foot-em { width: 72px; }

@media (max-width: 1000px) {
  .role-grid,
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline { row-gap: 48px; }
  .timeline::before { display: none; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 10px;
    gap: 0;
  }

  .hero-stage { order: -1; width: min(460px, 92vw); margin-bottom: -20px; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .lead { margin-inline: auto; }
  .entry-card { width: 100%; text-align: start; }
  .hero-stats { justify-content: center; }
}

@media (max-width: 600px) {
  .nav { top: 8px; margin-inline: 10px; }
  .nav-brand img { width: 44px; height: 44px; }
  /* The bar has little room on a phone: the EM plate goes everywhere, and
     the sound toggle goes from the front page - the lobby and the game keep
     theirs, where it matters. */
  .nav-em { display: none; }
  #view-home .nav-end [data-action='sound'] { display: none; }
  .fc-joker { left: 39%; top: 76%; width: 22%; }
  .title-word { font-size: 118px; }
  .lead { font-size: 15px; }
  .hero-stats li { padding: 0 14px; }
  .role-grid { grid-template-columns: minmax(0, 290px); justify-content: center; }
  .hero-stage { width: 84vw; }
  .float-card { width: 23%; border-radius: 10px; }
  .fc-mafia { left: 1%; }
  .fc-doctor { right: 3%; }
  .fc-detective { right: 1%; }
  .timeline { grid-template-columns: 1fr; }
  .brands { flex-direction: column; }
  .brand-plate { width: min(300px, 80vw); }
  .final-cta { border-radius: 28px; }
}

/* ═══════════════════════════ App shell (lobby + game) ═══════════════════════════ */
.app-view {
  --maxw: 1320px;
  --gutter: clamp(14px, 3vw, 32px);
  overflow-x: clip;
}

.view em,
.overlay em {
  font-style: normal;
  background: linear-gradient(100deg, #ff3d6e, #ff7ad9 55%, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-app {
  width: min(var(--maxw) - 2 * var(--gutter), 100% - 2 * var(--gutter));
  max-width: none;
  margin-inline: auto;
}

#view-game { --maxw: 1600px; }

.nav-center { display: flex; justify-content: center; flex: 1; min-width: 0; }

.nav-pill {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #d9d6f5;
  background: linear-gradient(90deg, rgba(46, 240, 176, 0.12), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 0 0 1px rgba(46, 240, 176, 0.3);
}

.live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

.live-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--ok);
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.icon-btn.danger:hover { color: var(--danger); }

/* Glass panels: same material as the home entry card */
.glass {
  position: relative;
  padding: 22px;
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(30, 26, 60, 0.72), rgba(12, 10, 26, 0.85));
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9), inset 0 0 0 1px var(--line);
  isolation: isolate;
}

.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), transparent 35%, transparent 70%, rgba(167, 139, 250, 0.28));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Animated iridescent border for the hero panel */
.glass.is-live::before,
.lobby-main::before {
  padding: 1.5px;
  background: conic-gradient(from var(--ang), rgba(255, 255, 255, 0.08) 0deg, #7df9ff 60deg, #a78bfa 110deg, #ff7ad9 160deg, rgba(255, 255, 255, 0.08) 220deg, rgba(255, 255, 255, 0.08) 360deg);
  animation: ang 8s linear infinite;
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-head h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.1;
  margin-top: 6px;
}

.panel-head h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.1;
  margin-top: 6px;
}

.panel-head.sm { margin-bottom: 14px; }

.panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--violet);
}

.panel-kicker::before {
  content: '';
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--iri);
}

.count {
  display: inline-block;
  vertical-align: middle;
  margin-inline-start: 6px;
  padding: 2px 12px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  background: var(--panel-hi);
  box-shadow: inset 0 0 0 1px var(--line);
}

.host-only-tag {
  flex: none;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--dim);
  background: var(--panel-hi);
  box-shadow: inset 0 0 0 1px var(--line);
}

.app-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(46px, 6vw, 80px);
  line-height: 1.1;
  background: linear-gradient(175deg, #ffffff 0%, #eef0fb 35%, #a4a8c4 50%, #d8dbee 70%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.5));
}

.app-title em { filter: none; }

.app-lead { color: var(--muted); font-size: 16px; margin-top: 4px; }

/* ═══════════════════════════ Lobby ═══════════════════════════ */
.lobby-hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px var(--gutter) 30px;
  text-align: center;
}

.lobby-spot {
  position: absolute;
  inset: -80px 20% 0;
  background: linear-gradient(180deg, rgba(210, 200, 255, 0.16), rgba(167, 139, 250, 0.05) 60%, transparent 90%);
  -webkit-mask: conic-gradient(from 150deg at 50% -10%, transparent 0deg, #000 18deg, #000 42deg, transparent 60deg);
  mask: conic-gradient(from 150deg at 50% -10%, transparent 0deg, #000 18deg, #000 42deg, transparent 60deg);
  filter: blur(6px);
  pointer-events: none;
  animation: flicker 7s infinite;
}

.room-code {
  position: relative;
  display: flex;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 16px);
  margin: 16px 0 18px;
  direction: ltr;
  perspective: 800px;
}

.room-code span {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(54px, 9vw, 96px);
  aspect-ratio: 5 / 6.6;
  border-radius: 16px;
  font-family: var(--display);
  font-size: clamp(38px, 6.4vw, 70px);
  background:
    radial-gradient(90% 60% at 50% 20%, rgba(167, 139, 250, 0.28), transparent 70%),
    linear-gradient(165deg, #211c40, #0a0816);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.45), 0 20px 40px -14px rgba(0, 0, 0, 0.9), 0 0 40px -14px rgba(167, 139, 250, 0.7);
  animation: tile-in 0.7s cubic-bezier(0.3, 1.4, 0.5, 1) backwards;
}

.room-code span::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 11px;
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.room-code span::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.14) 50%, transparent 65%);
  background-size: 300% 100%;
  animation: tile-shine 4s ease-in-out infinite;
  animation-delay: inherit;
}

@keyframes tile-shine {
  0%, 55% { background-position: 150% 0; }
  100% { background-position: -50% 0; }
}

.room-code span b {
  position: relative;
  font-weight: 400;
  line-height: 1;
  padding-top: 0.12em;
  background: linear-gradient(175deg, #ffffff 0%, #eef0fb 35%, #9ea3c0 50%, #5b5f7c 53%, #d8dbee 72%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.6));
}

@keyframes tile-in {
  from { opacity: 0; transform: translateY(-30px) rotateX(80deg); }
}

.share-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

.lobby-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px var(--gutter) 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 22px;
  align-items: start;
}

.lobby-main { padding: 28px; }

.need-pill {
  flex: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--detective);
  background: rgba(255, 200, 87, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 200, 87, 0.35);
}

.need-pill.is-ready {
  color: var(--ok);
  background: rgba(46, 240, 176, 0.1);
  box-shadow: inset 0 0 0 1px rgba(46, 240, 176, 0.4), 0 0 24px -6px rgba(46, 240, 176, 0.6);
}

/* Player cards - playing-card backs */
.lobby-players {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 14px;
}

.lp {
  --rc: var(--violet);
  position: relative;
  aspect-ratio: 5 / 6.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  border-radius: 18px;
  background:
    radial-gradient(90% 55% at 50% 30%, rgba(167, 139, 250, 0.2), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.018) 0 8px, transparent 8px 16px),
    linear-gradient(165deg, #1e1a3a, #0a0816 75%);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.3), 0 20px 40px -24px rgba(0, 0, 0, 0.9);
  animation: deal 0.6s cubic-bezier(0.3, 1.3, 0.5, 1) backwards;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s;
}

.lp::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 13px;
  border: 1px solid rgba(167, 139, 250, 0.16);
  pointer-events: none;
}

.lp:not(.empty):hover {
  transform: translateY(-6px) rotate(-1.5deg);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.7), 0 30px 50px -24px rgba(167, 139, 250, 0.6);
}

@keyframes deal {
  from { opacity: 0; transform: translateY(-40px) rotate(-12deg) scale(0.8); }
}

.lp.is-me {
  background:
    radial-gradient(90% 55% at 50% 30%, rgba(125, 249, 255, 0.22), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0 8px, transparent 8px 16px),
    linear-gradient(165deg, #1c2340, #0a0816 75%);
  box-shadow: inset 0 0 0 1.5px rgba(125, 249, 255, 0.6), 0 0 40px -14px var(--cyan);
}

.lp.is-off { opacity: 0.45; filter: grayscale(0.6); }

.lp .avatar { --size: 62px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22); }

.lp .name {
  max-width: 100%;
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lp .tag {
  margin-top: -6px;
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.lp.is-me .tag { color: var(--cyan); background: rgba(125, 249, 255, 0.1); }

.lp-num {
  position: absolute;
  top: 12px;
  left: 14px;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1;
  color: var(--dim);
}

.lp .crown {
  position: absolute;
  top: 10px;
  right: 12px;
  color: #ffd166;
  filter: drop-shadow(0 0 8px rgba(255, 209, 102, 0.8));
}

.lp-tools {
  position: absolute;
  bottom: 10px;
  left: 50%;
  translate: -50% 0;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
}

.lp-tools .icon-btn { width: 30px; height: 30px; border-radius: 9px; background: rgba(10, 8, 22, 0.9); }
.lp-tools .icon-btn .i { width: 15px; height: 15px; }

.lp:hover .lp-tools,
.lp:focus-within .lp-tools { opacity: 1; transform: none; }

@media (hover: none) {
  .lp-tools { opacity: 1; transform: none; bottom: 8px; }
  .lp:has(.lp-tools) .tag { display: none; }
}

.lp.empty {
  background: transparent;
  box-shadow: none;
  border: 1.5px dashed rgba(255, 255, 255, 0.12);
  color: var(--dim);
  font-size: 12px;
  animation: none;
}

.lp.empty::before { display: none; }

.lp.empty .q {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  font-family: var(--display);
  font-size: 30px;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: breathe 2.4s ease-in-out infinite;
}

@keyframes breathe { 50% { opacity: 0.4; transform: scale(0.94); } }

.lobby-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.lobby-cta .btn-xl { min-width: 280px; }

.wait-host {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--line);
}

.lobby-side { display: grid; gap: 18px; }

/* Role distribution - mini cards */
.dist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.dist-row {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 4px 10px;
  border-radius: 14px;
  aspect-ratio: 5 / 7;
  justify-content: center;
  background:
    radial-gradient(90% 60% at 50% 25%, color-mix(in srgb, var(--rc) 24%, transparent), transparent 70%),
    linear-gradient(165deg, #1d1838, #0a0816);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 45%, transparent), 0 0 24px -12px color-mix(in srgb, var(--rc) 80%, transparent);
  transition: transform 0.3s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.dist-row:hover { transform: translateY(-4px) rotate(-2deg); }

.dist-ic { width: 34px; height: 34px; color: var(--rc); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--rc) 80%, transparent)); }
.dist-ic svg { width: 100%; height: 100%; }

.dist-row b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  color: var(--rc);
}

.dist-row .n { font-size: 12px; font-weight: 600; color: var(--muted); }

/* Timer settings */
.settings { display: grid; gap: 16px; }

.setting-row { display: flex; align-items: center; gap: 12px; }

.setting-row > svg {
  flex: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 50%;
  color: var(--rc);
  background: radial-gradient(circle, color-mix(in srgb, var(--rc) 20%, #0b0918), #0b0918 70%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rc) 50%, transparent), 0 0 20px -6px color-mix(in srgb, var(--rc) 80%, transparent);
}

.setting-body { flex: 1; min-width: 0; display: grid; gap: 9px; }

.setting-row .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}

.setting-row output {
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--rc);
  background: color-mix(in srgb, var(--rc) 12%, transparent);
}

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(to left, var(--rc) var(--p, 50%), rgba(255, 255, 255, 0.08) var(--p, 50%));
  box-shadow: 0 0 12px -2px color-mix(in srgb, var(--rc) 50%, transparent);
  outline: none;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--rc) 45%, transparent), 0 2px 10px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

input[type='range']::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--rc) 45%, transparent);
}

input[type='range']:disabled { opacity: 0.6; }
input[type='range']:disabled::-webkit-slider-thumb { cursor: default; }

/* ═══════════════════════════ Chat ═══════════════════════════ */
.chat-card { padding: 0; overflow: hidden; }
.chat { display: flex; flex-direction: column; height: 400px; }

.chat-tabs {
  display: flex;
  gap: 6px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}

.chat-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.chat-tab svg { width: 16px; height: 16px; }
.chat-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }

.chat-tab.is-active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(var(--tc), 0.22), rgba(var(--tc), 0.06));
  box-shadow: inset 0 0 0 1px rgba(var(--tc), 0.45), 0 6px 20px -8px rgba(var(--tc), 0.7);
}

.chat-tab[data-ch='public'] { --tc: 167, 139, 250; }
.chat-tab[data-ch='mafia'] { --tc: 255, 61, 110; }
.chat-tab[data-ch='dead'] { --tc: 156, 152, 189; }

.chat-tab .unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  color: #fff;
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

.chat-log {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 14px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
}

.msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  animation: msg-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

.msg .avatar { --size: 30px; }

.msg .bubble {
  min-width: 0;
  max-width: 80%;
  padding: 7px 13px 8px;
  border-radius: 16px 16px 16px 4px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 0 0 1px var(--line);
}

.msg .who { font-size: 12px; font-weight: 700; color: var(--violet); }
.msg .txt { font-size: 14px; overflow-wrap: anywhere; }

.msg.mine { flex-direction: row-reverse; }

.msg.mine .bubble {
  border-radius: 16px 16px 4px 16px;
  color: #0b0820;
  background: linear-gradient(135deg, #9fe9ff, #c3b1ff 55%, #ffa6e6);
  box-shadow: 0 8px 20px -10px rgba(167, 139, 250, 0.8);
  font-weight: 500;
}

.msg.ch-mafia .bubble { background: linear-gradient(160deg, rgba(255, 61, 110, 0.16), rgba(255, 61, 110, 0.05)); box-shadow: inset 0 0 0 1px rgba(255, 61, 110, 0.3); }
.msg.ch-mafia.mine .bubble { color: #fff; background: linear-gradient(135deg, #ff3d6e, #b3124a); }
.msg.ch-mafia .who { color: var(--mafia); }
.msg.ch-dead .bubble { background: rgba(156, 152, 189, 0.08); }
.msg.ch-dead.mine .bubble { color: var(--text); background: linear-gradient(135deg, #4a4766, #2d2a44); }
.msg.ch-dead .who { color: var(--muted); }

.msg.system { justify-content: center; font-size: 12px; color: var(--dim); text-align: center; }

.msg.system span {
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.chat-empty { margin: auto; color: var(--dim); font-size: 13px; text-align: center; }

.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.chat-form input { height: 44px; font-size: 14px; border-radius: 14px; }

.chat-form .send {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 14px;
  color: #0b0820;
  background: var(--iri);
  box-shadow: 0 8px 20px -8px rgba(167, 139, 250, 0.9);
}

.chat-form.is-locked input { opacity: 0.55; }
.chat-form.is-locked .send { filter: grayscale(1); opacity: 0.4; box-shadow: none; }

/* ═══════════════════════════ Game ═══════════════════════════ */
#view-game:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 680px;
}

.game-grid {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  padding: 16px var(--gutter) 20px;
}

.round-chip {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1;
  color: rgb(var(--phase-tint));
  background: linear-gradient(90deg, rgba(var(--phase-tint), 0.16), rgba(var(--phase-tint), 0.04));
  box-shadow: inset 0 0 0 1px rgba(var(--phase-tint), 0.4), 0 0 30px -10px rgba(var(--phase-tint), 0.8);
  transition: color 0.6s, background 0.6s, box-shadow 0.6s;
}

.round-chip .i { width: 16px; height: 16px; }

.code-chip {
  padding: 8px 14px;
  border-radius: 11px;
  font-weight: 700;
  letter-spacing: 0.25em;
  font-size: 13px;
  background: var(--panel-hi);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: background 0.2s;
}

.code-chip:hover { background: rgba(255, 255, 255, 0.1); }

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.table {
  position: relative;
  flex: 1;
  min-height: 0;
  container-type: size;
}

.table-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(64cqw, 64cqh);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(var(--phase-tint), 0.24), rgba(var(--phase-tint), 0.05) 45%, transparent 64%),
    repeating-radial-gradient(circle, transparent 0 22px, rgba(255, 255, 255, 0.022) 22px 23px);
  box-shadow: inset 0 0 0 1px rgba(var(--phase-tint), 0.22), 0 0 140px -20px rgba(var(--phase-tint), 0.45);
  transition: background 1s ease, box-shadow 1s ease;
}

.table-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(var(--phase-tint), 0.9), transparent);
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 2px), #000 calc(50% - 1px));
  mask: radial-gradient(circle, transparent calc(50% - 2px), #000 calc(50% - 1px));
  animation: spin 6s linear infinite;
}

.table-rings i {
  position: absolute;
  left: 50%;
  top: 50%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  pointer-events: none;
}

.table-rings i:nth-child(1) {
  width: min(46cqw, 46cqh);
  border: 1px dashed rgba(var(--phase-tint), 0.3);
  animation: spin 40s linear infinite;
}

.table-rings i:nth-child(2) {
  width: min(84cqw, 84cqh);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 60px rgba(var(--phase-tint), 0.06);
}

@keyframes spin { to { transform: rotate(360deg); } }

.table-center {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: min(40cqw, 40cqh, 300px);
  text-align: center;
  z-index: 2;
}

.timer {
  position: relative;
  width: min(156px, 23cqh);
  aspect-ratio: 1;
  margin: 0 auto 10px;
}

.timer::before {
  content: '';
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #231e45, #0a0816 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 40px -10px rgba(0, 0, 0, 0.8);
}

.timer svg { position: relative; width: 100%; height: 100%; transform: rotate(-90deg); }
.t-track { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 5; }

.t-bar {
  fill: none;
  stroke: rgb(var(--phase-tint));
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 339.3;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 6px rgba(var(--phase-tint), 0.9));
  transition: stroke-dashoffset 0.25s linear, stroke 0.6s;
}

.timer.is-urgent .t-bar { stroke: var(--danger); }
.timer.is-urgent .t-num { animation: beat 1s infinite; }
.timer.is-urgent .t-num { background: linear-gradient(180deg, #fff, var(--danger)); -webkit-background-clip: text; background-clip: text; }

@keyframes beat { 50% { transform: scale(1.12); } }

.t-inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
}

.phase-icon { color: rgb(var(--phase-tint)); width: min(30px, 4.6cqh); height: min(30px, 4.6cqh); margin-bottom: 2px; }
.phase-icon svg { width: 100%; height: 100%; filter: drop-shadow(0 0 10px rgba(var(--phase-tint), 0.8)); }

.t-num {
  font-family: var(--display);
  font-size: min(48px, 7.4cqh);
  line-height: 1;
  padding-top: 0.1em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(175deg, #ffffff 0%, #eef0fb 40%, #9ea3c0 52%, #e3e6f3 70%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.phase-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: min(40px, 6.4cqh);
  line-height: 1.15;
  background: linear-gradient(180deg, #ffffff 10%, rgb(var(--phase-tint)) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(var(--phase-tint), 0.5));
}

.phase-sub { color: var(--muted); font-size: min(14px, 2.6cqh); margin-top: 2px; }

/* Seats - mini playing cards around the table */
.seats { list-style: none; margin: 0; padding: 0; }

.seat {
  --size: clamp(40px, 7.6cqmin, 64px);
  position: absolute;
  left: var(--x);
  top: var(--y);
  translate: -50% -50%;
  width: calc(var(--size) + 38px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 3;
  transition: left 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s;
  animation: deal 0.6s cubic-bezier(0.3, 1.3, 0.5, 1) backwards;
}

.seat-card {
  --rc: var(--violet);
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border-radius: 16px;
  background:
    radial-gradient(90% 55% at 50% 30%, rgba(167, 139, 250, 0.18), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.018) 0 6px, transparent 6px 12px),
    linear-gradient(165deg, #1e1a3a, #0a0816 75%);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.28), 0 16px 30px -16px rgba(0, 0, 0, 0.9);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s, filter 0.4s;
}

.seat-card[data-role] {
  background:
    radial-gradient(90% 55% at 50% 30%, color-mix(in srgb, var(--rc) 24%, transparent), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.018) 0 6px, transparent 6px 12px),
    linear-gradient(165deg, #1e1a3a, #0a0816 75%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 50%, transparent), 0 16px 30px -16px rgba(0, 0, 0, 0.9);
}

.seat.is-me .seat-card { box-shadow: inset 0 0 0 1.5px rgba(125, 249, 255, 0.65), 0 0 30px -10px var(--cyan); }

.seat-av { position: relative; width: var(--size); height: var(--size); }
.seat-av > .avatar { --size: inherit; width: 100%; height: 100%; transition: filter 0.4s; }

.seat .nm {
  max-width: 100%;
  padding: 0 4px;
  font-size: clamp(10px, 1.8cqmin, 13px);
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat.is-me .nm { color: var(--cyan); }
.seat.is-off .seat-av > .avatar { filter: grayscale(0.7) brightness(0.7); }

.seat-crown {
  position: absolute;
  top: 5px;
  right: 7px;
  color: #ffd166;
  line-height: 0;
  filter: drop-shadow(0 0 6px rgba(255, 209, 102, 0.8));
}

.seat-crown .i { width: 13px; height: 13px; }

.seat .rb {
  position: absolute;
  bottom: -6px;
  left: -8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--rc);
  background: #0b0918;
  box-shadow: 0 0 0 1.5px var(--rc), 0 0 14px color-mix(in srgb, var(--rc) 70%, transparent);
  z-index: 2;
}

.seat .rb svg { width: 17px; height: 17px; }

.seat .vc {
  position: absolute;
  top: -10px;
  left: -8px;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: #0b0820;
  background: var(--cyan);
  box-shadow: 0 0 16px rgba(125, 249, 255, 0.8);
  z-index: 4;
  animation: pop-in 0.3s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes pop-in { from { opacity: 0; transform: scale(0.6); } }

.seat .voters,
.seat .pick-flag {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
  max-width: 120px;
}

.seat .voters .avatar { --size: 16px; width: 16px; height: 16px; font-size: 8px; box-shadow: 0 0 0 1px #0b0918; }
.seat .pick-flag .avatar { --size: 18px; width: 18px; height: 18px; font-size: 9px; box-shadow: 0 0 0 1.5px var(--mafia); }

.seat.is-dead .seat-card {
  transform: rotate(-3deg) scale(0.95);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 5px, transparent 5px 10px),
    linear-gradient(165deg, #15121f, #07060c 80%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 16px 30px -16px rgba(0, 0, 0, 0.9);
}

.seat.is-dead .seat-card[data-role] {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--rc) 55%, transparent), 0 0 26px -10px var(--rc);
}

.seat.is-dead .seat-av > .avatar { filter: grayscale(1) brightness(0.45); }

.seat.is-dead .nm { text-decoration: line-through; color: var(--dim); }

.seat .skull {
  position: absolute;
  inset: 18%;
  width: 64%;
  height: 64%;
  color: #f1efff;
  filter: drop-shadow(0 2px 6px #000);
  z-index: 1;
}

.seat.is-pickable { cursor: pointer; }
.seat.is-pickable:hover .seat-card { transform: translateY(-6px); box-shadow: inset 0 0 0 1.5px rgba(var(--phase-tint), 0.7), 0 20px 40px -16px rgba(var(--phase-tint), 0.7); }
.seat.is-disabled { cursor: not-allowed; }
.seat.is-disabled .seat-card { opacity: 0.55; }

.seat.is-picked .seat-card {
  transform: translateY(-8px) scale(1.06);
  box-shadow: inset 0 0 0 2px rgb(var(--phase-tint)), 0 0 40px -4px rgba(var(--phase-tint), 0.9);
}

.seat.is-picked .seat-card::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 19px;
  border: 2px solid rgba(var(--phase-tint), 0.6);
  animation: ring 1.4s ease-out infinite;
  pointer-events: none;
}

@keyframes ring {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(1.18); opacity: 0; }
}

.seat.is-hot .seat-card { box-shadow: inset 0 0 0 2px var(--cyan), 0 0 34px -6px rgba(125, 249, 255, 0.8); }

/* Action bar */
.action-bar {
  position: relative;
  flex: none;
  min-height: 76px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-radius: 22px;
  text-align: center;
  background: linear-gradient(160deg, rgba(var(--phase-tint), 0.12), rgba(12, 10, 26, 0.85) 60%);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
  isolation: isolate;
  transition: background 0.6s;
}

.action-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--ang), rgba(var(--phase-tint), 0.15) 0deg, rgba(var(--phase-tint), 0.9) 70deg, rgba(var(--phase-tint), 0.15) 160deg, rgba(var(--phase-tint), 0.15) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: ang 5s linear infinite;
}

.action-bar .hint { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px; }

.action-bar .hint > svg {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 50%;
  color: rgb(var(--phase-tint));
  background: radial-gradient(circle, rgba(var(--phase-tint), 0.22), #0b0918 70%);
  box-shadow: 0 0 0 1px rgba(var(--phase-tint), 0.5), 0 0 20px -4px rgba(var(--phase-tint), 0.8);
}

.action-bar .hint b { color: rgb(var(--phase-tint)); }
.action-bar .sleep { color: var(--muted); display: flex; align-items: center; gap: 10px; }
.action-bar .sleep > .i { width: 22px; height: 22px; }

.zzz { display: inline-flex; gap: 3px; font-weight: 700; color: var(--violet); }
.zzz i { font-style: normal; animation: zz 1.8s infinite; }
.zzz i:nth-child(2) { animation-delay: 0.3s; }
.zzz i:nth-child(3) { animation-delay: 0.6s; }

@keyframes zz {
  0%, 100% { opacity: 0.2; transform: translateY(2px); }
  50% { opacity: 1; transform: translateY(-3px); }
}

/* Side column */
.side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.side .chat-card { flex: 1.4; min-height: 0; display: flex; flex-direction: column; }
.side .chat-card .chat { flex: 1; height: auto; min-height: 0; }

.feed-card { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 18px; }
.feed-card .panel-head { margin-bottom: 10px; }
.feed-card .panel-head h3 { font-size: 22px; }

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fe {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--fc, #fff) 10%, transparent), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fc, #fff) 18%, transparent);
  animation: msg-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fe > svg {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 50%;
  color: var(--fc, var(--muted));
  background: #0b0918;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--fc, #fff) 45%, transparent);
}

.fe b { color: var(--text); }

.fe.round-sep {
  justify-content: center;
  background: none;
  box-shadow: none;
  padding: 4px 2px;
  font-family: var(--display);
  font-size: 16px;
  color: var(--violet);
}

.fe.round-sep::before,
.fe.round-sep::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.4), transparent); }

/* My role - a mini playing card + label */
.my-role {
  --rc: var(--violet);
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 24px;
  text-align: start;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--rc) 26%, transparent), transparent 60%),
    linear-gradient(160deg, rgba(30, 26, 60, 0.75), rgba(12, 10, 26, 0.88));
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9), inset 0 0 0 1px color-mix(in srgb, var(--rc) 45%, transparent);
  backdrop-filter: var(--blur);
  transition: box-shadow 0.4s;
}

.my-role::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.08) 50%, transparent 65%);
  transform: translateX(100%);
  animation: plate-shine 6s ease-in-out infinite;
  pointer-events: none;
}

.my-role .em {
  position: relative;
  flex: none;
  width: 62px;
  aspect-ratio: 5 / 7;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--rc);
  background:
    radial-gradient(90% 60% at 50% 35%, color-mix(in srgb, var(--rc) 32%, transparent), transparent 70%),
    linear-gradient(165deg, #1d1838, #0a0816);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 60%, transparent), 0 0 26px -6px color-mix(in srgb, var(--rc) 80%, transparent);
  transform: rotate(-5deg);
}

.my-role .em > svg { width: 60%; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--rc) 80%, transparent)); }

.my-role .em-idx {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 11px;
  height: 11px;
  line-height: 0;
}

.my-role .em-idx svg { width: 100%; height: 100%; }
.my-role small { display: block; color: var(--muted); font-size: 12px; }

.my-role strong {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.15;
  color: var(--rc);
  text-shadow: 0 0 24px color-mix(in srgb, var(--rc) 50%, transparent);
}

.my-role .mates { font-size: 12px; color: var(--muted); }
.my-role-txt { min-width: 0; }

.my-role .peek {
  margin-inline-start: auto;
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--dim);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
}

.my-role.is-hidden .em > svg,
.my-role.is-hidden strong,
.my-role.is-hidden .mates,
.my-role.is-hidden .em-idx { filter: blur(10px); }
.my-role.is-dead { --rc: var(--dim); }

/* ═══════════════════════════ Overlays ═══════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  padding: 20px;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(210, 200, 255, 0.1), transparent 70%),
    radial-gradient(circle at 50% 40%, rgba(12, 10, 26, 0.8), rgba(3, 2, 8, 0.95));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fade-in 0.4s ease;
  overflow-y: auto;
}

.overlay > * { margin: auto; }
.overlay.is-leaving { animation: fade-out 0.35s ease forwards; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.overlay .sec-kicker { margin-bottom: 18px; }

/* Role reveal */
.reveal { text-align: center; perspective: 1400px; }

.flip {
  --rc: var(--violet);
  position: relative;
  width: min(320px, 76vw);
  aspect-ratio: 5 / 7.4;
  margin: 0 auto;
  transform-style: preserve-3d;
  animation: flip 1.4s 0.5s cubic-bezier(0.5, -0.2, 0.2, 1.3) forwards;
}

@keyframes flip {
  0% { transform: rotateY(0) scale(0.9); }
  60% { transform: rotateY(200deg) scale(1.05); }
  100% { transform: rotateY(180deg) scale(1); }
}

.flip-face {
  position: absolute;
  inset: 0;
  padding: 10px;
  border-radius: 24px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.flip-back {
  background: linear-gradient(165deg, #1e1a3a, #0a0816 70%);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.5), 0 40px 80px -20px rgba(0, 0, 0, 0.8), 0 0 60px -20px rgba(167, 139, 250, 0.6);
}

.back-frame {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-radius: 16px;
  border: 1px solid rgba(167, 139, 250, 0.25);
  background:
    radial-gradient(70% 50% at 50% 45%, rgba(125, 249, 255, 0.16), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 8px, transparent 8px 16px);
}

.back-logo { width: 72%; filter: drop-shadow(0 0 30px rgba(167, 139, 250, 0.5)); }
.back-em { width: 30%; opacity: 0.9; }

.flip-front {
  transform: rotateY(180deg);
  background: linear-gradient(165deg, #1e1a3a, #0a0816 70%);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--rc) 70%, transparent), 0 0 90px -10px color-mix(in srgb, var(--rc) 70%, transparent);
}

.flip-front .rc-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px 18px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--rc) 30%, transparent);
  background:
    radial-gradient(80% 50% at 50% 32%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.018) 0 8px, transparent 8px 16px);
}

.flip-front .rc-index {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 24px;
  height: 24px;
  color: var(--rc);
}

.flip-front .rc-index svg { width: 100%; height: 100%; }
.flip-front .rc-index.bottom { top: auto; right: auto; bottom: 14px; left: 14px; transform: rotate(180deg); }

.flip-front .big {
  width: 46%;
  color: var(--rc);
  filter: drop-shadow(0 0 24px color-mix(in srgb, var(--rc) 80%, transparent));
  animation: bob 5s ease-in-out infinite;
}

.flip-front h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 60px;
  line-height: 1.15;
  color: var(--rc);
  margin-top: 6px;
  text-shadow: 0 0 30px color-mix(in srgb, var(--rc) 60%, transparent);
}

.flip-front .team {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.flip-front p { font-size: 14px; color: var(--muted); margin-top: 12px; max-width: 250px; line-height: 1.7; }

.flip-front .mates {
  margin-top: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mafia);
  background: rgba(255, 61, 110, 0.1);
}

.holo.auto {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.1) 46%, rgba(125, 249, 255, 0.12) 50%, rgba(255, 122, 217, 0.1) 54%, transparent 62%);
  background-size: 300% 100%;
  mix-blend-mode: screen;
  animation: holo-sweep 3.5s 1.6s ease-in-out infinite;
}

@keyframes holo-sweep {
  0% { background-position: 120% 0; }
  70%, 100% { background-position: -20% 0; }
}

.reveal .hint { color: var(--dim); font-size: 13px; margin-top: 22px; }

/* Announcement */
.announce {
  --ac: var(--violet);
  text-align: center;
  max-width: 600px;
  animation: announce-in 0.7s cubic-bezier(0.2, 1.2, 0.3, 1);
}

@keyframes announce-in {
  from { opacity: 0; transform: scale(0.8) translateY(20px); filter: blur(8px); }
}

.announce .glyph {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ac);
  background: radial-gradient(circle, color-mix(in srgb, var(--ac) 22%, #0b0918), #0b0918 70%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ac) 55%, transparent), 0 0 0 12px rgba(6, 5, 13, 0.6), 0 0 0 13px color-mix(in srgb, var(--ac) 20%, transparent), 0 0 90px -10px var(--ac);
}

.announce .glyph::before {
  content: '';
  position: absolute;
  inset: -26px;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--ac) 40%, transparent);
  animation: spin 20s linear infinite;
}

.announce .glyph > svg { position: relative; width: 56%; height: 56%; filter: drop-shadow(0 0 20px var(--ac)); }
.announce .glyph .avatar { --size: 116px; position: relative; }

.announce .glyph .avatar + svg {
  position: absolute;
  width: 52px;
  height: 52px;
  bottom: 0;
  left: 0;
  padding: 9px;
  border-radius: 50%;
  background: #0b0918;
  box-shadow: 0 0 0 2px var(--ac), 0 0 20px var(--ac);
}

.announce .glyph.is-dead .avatar { filter: grayscale(1) brightness(0.55); }

.announce .over {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ac);
  background: color-mix(in srgb, var(--ac) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ac) 35%, transparent);
}

.announce h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 84px);
  line-height: 1.15;
  margin: 10px 0 8px;
  background: linear-gradient(180deg, #ffffff 15%, var(--ac) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.5)) drop-shadow(0 0 40px color-mix(in srgb, var(--ac) 45%, transparent));
}

.announce p { font-size: 17px; color: var(--muted); }
.announce p b { color: var(--text); }
.announce .role-badge { font-size: 15px; padding: 6px 16px 6px 12px; margin-top: 16px; }
.announce .role-badge svg { width: 22px; height: 22px; }

.overlay-bar {
  width: 240px;
  height: 3px;
  margin: 30px auto 0;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.overlay-bar i {
  display: block;
  height: 100%;
  background: var(--ac, var(--iri));
  box-shadow: 0 0 10px var(--ac, var(--violet));
  transform-origin: right;
  animation: drain linear forwards;
}

.reveal .overlay-bar i { background: var(--iri); }

@keyframes drain { to { transform: scaleX(0); } }

.shake { animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

.blood-flash {
  position: fixed;
  inset: 0;
  z-index: 49;
  pointer-events: none;
  background: radial-gradient(circle, transparent 30%, rgba(255, 30, 70, 0.55));
  animation: fade-out 1.4s ease forwards;
}

/* End screen */
.endgame {
  --ac: var(--citizen);
  width: min(940px, 100%);
  text-align: center;
  animation: announce-in 0.8s cubic-bezier(0.2, 1.2, 0.3, 1);
}

.endgame.mafia-win { --ac: var(--mafia); }

.trophy-node {
  width: 120px;
  height: 120px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ac);
  background: radial-gradient(circle, color-mix(in srgb, var(--ac) 24%, #0b0918), #0b0918 70%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ac) 60%, transparent), 0 0 0 10px rgba(6, 5, 13, 0.6), 0 0 90px -10px var(--ac);
  animation: bob 4s ease-in-out infinite;
}

.trophy { width: 60%; height: 60%; filter: drop-shadow(0 0 16px var(--ac)); }

.endgame .sec-kicker { margin-bottom: 0; }

.endgame h2 { margin: 6px 0 2px; line-height: 1; }

.end-word {
  position: relative;
  display: inline-block;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(56px, 10vw, 112px);
  padding: 0.12em 0.1em 0.1em;
  background: linear-gradient(175deg, #ffffff 0%, #eef0fb 32%, #a4a8c4 48%, #5b5f7c 52%, #d8dbee 70%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 0 rgba(0, 0, 0, 0.55)) drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6));
}

.end-word::after {
  content: '';
  position: absolute;
  inset-inline: 8%;
  bottom: 14%;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, var(--ac) 20%, var(--ac) 70%, transparent);
  box-shadow: 0 0 22px var(--ac), 0 0 60px var(--ac);
  transform: rotate(-4deg) scaleX(0);
  transform-origin: right;
  animation: slash 0.9s 0.6s cubic-bezier(0.7, 0, 0.2, 1) forwards;
  mix-blend-mode: screen;
}

@keyframes slash-end { to { transform: rotate(-4deg) scaleX(1); } }
.end-word::after { animation-name: slash-end; }

.endgame .sub { color: var(--muted); margin: 6px 0 28px; font-size: 16px; }

.teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  text-align: start;
}

.team-col {
  position: relative;
  padding: 20px;
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(30, 26, 60, 0.72), rgba(12, 10, 26, 0.88));
  box-shadow: inset 0 0 0 1px var(--line);
  isolation: isolate;
}

.team-col.is-winner::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--ang), transparent 0deg, var(--ac) 80deg, transparent 170deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: ang 4s linear infinite;
}

.team-col.is-winner { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ac) 35%, transparent), 0 0 60px -20px var(--ac); }

.team-col h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 28px;
  margin-bottom: 14px;
}

.team-col h3 .win {
  margin-inline-start: auto;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  color: #0b0820;
  background: var(--ac);
  box-shadow: 0 0 20px -2px var(--ac);
}

.team-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.team-col li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: deal 0.5s cubic-bezier(0.3, 1.3, 0.5, 1) backwards;
}

.team-col li .avatar { --size: 36px; }
.team-col li .nm { flex: 1; font-weight: 700; }
.team-col li.dead .avatar { filter: grayscale(1) brightness(0.6); }
.team-col li.dead .nm { color: var(--dim); text-decoration: line-through; }
.team-col li .st { font-size: 11px; color: var(--dim); }

.end-actions { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 51; }

/* Confirm dialog */
.dialog {
  width: min(420px, 100%);
  padding: 30px 26px 26px;
  text-align: center;
  animation: announce-in 0.4s cubic-bezier(0.2, 1.2, 0.3, 1);
}

.dialog::before {
  padding: 1.5px;
  background: conic-gradient(from var(--ang), rgba(255, 255, 255, 0.08) 0deg, #7df9ff 60deg, #a78bfa 110deg, #ff7ad9 160deg, rgba(255, 255, 255, 0.08) 220deg, rgba(255, 255, 255, 0.08) 360deg);
  animation: ang 6s linear infinite;
}

.dialog h3 { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.2; margin-bottom: 8px; }
.dialog p { color: var(--muted); margin-bottom: 24px; }
.dialog .row { display: flex; gap: 10px; justify-content: center; }
.dialog .row .btn { min-width: 110px; }

/* Toasts */
.toasts {
  position: fixed;
  top: 96px;
  left: 50%;
  translate: -50% 0;
  z-index: 100;
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
  width: min(420px, calc(100% - 32px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(160deg, rgba(30, 26, 60, 0.95), rgba(12, 10, 26, 0.95));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 0 0 1px var(--line-hi);
  backdrop-filter: var(--blur);
  animation: toast-in 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.toast.error { box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 77, 109, 0.6); }
.toast.error::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.toast.ok::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.toast.is-leaving { animation: fade-out 0.3s forwards; }

@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(0.9); } }

.conn-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  translate: -50% 0;
  z-index: 90;
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 77, 109, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.5);
  backdrop-filter: var(--blur);
}

/* ═══════════════════════════ Responsive (app) ═══════════════════════════ */
@media (max-width: 1100px) {
  .game-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  .lobby-grid { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 900px) {
  .lobby-grid { grid-template-columns: 1fr; }

  #view-game:not([hidden]) { display: block; height: auto; min-height: 0; }

  .game-grid {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .stage { min-height: 0; }
  .table { height: min(118vw, 640px); flex: none; }
  .side .chat-card { min-height: 440px; }
  .feed-card { max-height: 320px; }
}

@media (max-width: 600px) {
  body { font-size: 14px; }
  .hide-sm { display: none !important; }
  .nav-app { padding: 6px 8px; }
  .nav-app .nav-brand img { width: 40px; height: 40px; }
  .nav-app .nav-brand-txt { font-size: 15px; }
  .nav-app .nav-em { height: 22px; }
  .nav-app .nav-end { gap: 6px; }
  .nav-app .icon-btn { width: 34px; height: 34px; }
  .nav-pill { display: none; }
  .code-chip { display: none; }
  .round-chip { padding: 7px 12px; font-size: 15px; }
  .lobby-hero { padding-top: 22px; }
  .lobby-main { padding: 18px 14px; }
  .panel-head { flex-direction: column; align-items: flex-start; }
  .lobby-players { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .lp { border-radius: 14px; padding: 10px 6px; gap: 6px; }
  .lp .avatar { --size: 44px; }
  .lp .name { font-size: 13px; }
  .lp-num { top: 8px; left: 9px; font-size: 14px; }
  .lp .crown { top: 6px; right: 8px; }
  .lp.empty .q { width: 40px; height: 40px; font-size: 22px; }
  .lobby-cta .btn-xl { width: 100%; min-width: 0; }
  .teams { grid-template-columns: 1fr; }
  .table { height: 132vw; }
  .seat { width: calc(var(--size) + 22px); }
  .seat-card { padding: 7px 2px 6px; border-radius: 12px; }
  .table-center { width: 44cqw; }
  .btn-xl { width: 100%; }
  .my-role strong { font-size: 28px; }
  .dist { gap: 6px; }
  .dist-ic { width: 26px; height: 26px; }
  .dist-row b { font-size: 24px; }
}

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

/* ═══════════════════════════ AFK, charges & host tools ═══════════════════════════ */
.bot-chip {
  display: inline-grid;
  place-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(125, 249, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(125, 249, 255, 0.4);
}

.seat-card .bot-chip {
  position: absolute;
  top: -9px;
  right: 50%;
  translate: 50% 0;
  z-index: 4;
}

/* Big rooms: smaller seat cards so 11–20 players fit without overlapping. */
.seats.is-crowded .seat { --size: clamp(34px, 6.2cqmin, 52px); width: calc(var(--size) + 26px); gap: 3px; }
.seats.is-crowded .seat-card { gap: 4px; padding: 8px 3px 6px; border-radius: 13px; }
.seats.is-crowded .seat .nm { font-size: clamp(9px, 1.6cqmin, 12px); }
.seats.is-crowded .bot-chip { padding: 0 6px; font-size: 9px; top: -8px; }
.seats.is-packed .seat { --size: clamp(30px, 5.2cqmin, 44px); width: calc(var(--size) + 20px); }
.seats.is-packed .seat-card { padding: 7px 2px 5px; border-radius: 11px; }
.seats.is-packed .seat .nm { font-size: clamp(9px, 1.45cqmin, 11px); }
/* The role word matters more than its icon when space is short. */
.seats.is-crowded .seat-role { padding: 1px 6px; font-size: 9.5px; letter-spacing: -0.2px; }
.seats.is-crowded .seat-role svg { display: none; }
.seats.is-packed .seat-role { padding: 1px 4px; font-size: 9px; }

.lp .tag.is-bot { color: var(--cyan); background: rgba(125, 249, 255, 0.1); }

.head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.action-bar .charges {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 200, 87, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 200, 87, 0.3);
}

.action-bar .charges b { color: var(--detective); font-size: 15px; }

.fe small.left {
  margin-inline-start: 6px;
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
}

.flip-front .mates.is-det {
  color: var(--detective);
  background: rgba(255, 200, 87, 0.1);
}

.toast.auto {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 200, 87, 0.55);
}

.toast.auto::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--detective); box-shadow: 0 0 10px var(--detective); }

.dialog.manage {
  position: relative;
  width: min(520px, 100%);
  text-align: start;
}

.dialog.manage h3 { margin-top: 12px; }
.dialog.manage p { font-size: 14px; margin-bottom: 18px; }

.mg-close {
  position: absolute;
  top: 16px;
  left: 16px;
}

.mg-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: min(56vh, 460px);
  overflow-y: auto;
}

.mg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.mg-row .avatar { --size: 36px; }
.mg-row .nm { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-row .st { font-size: 11px; color: var(--dim); }
.mg-row.is-dead .avatar { filter: grayscale(1) brightness(0.6); }
.mg-row.is-dead .nm { color: var(--dim); }
.mg-row .kick-btn:hover { color: var(--danger); box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.5); }

/* Discord links on the partner logos */
.brand-plate { text-decoration: none; cursor: pointer; }

.plate-cta {
  position: absolute;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: rgba(88, 101, 242, 0.22);
  box-shadow: inset 0 0 0 1px rgba(138, 148, 255, 0.5);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s, transform 0.35s;
}

.brand-plate:hover .plate-cta,
.brand-plate:focus-visible .plate-cta { opacity: 1; transform: none; }
.plate-cta .i { width: 14px; height: 14px; }
.foot-logos a { display: block; transition: transform 0.3s, filter 0.3s; }
.foot-logos a:hover { transform: translateY(-3px); filter: brightness(1.15); }

/* ═══════════════════════════ Joker (rare special card) ═══════════════════════════ */
html [data-role='joker'] { --rc: #ff7ad9; }

.role-badge[data-role='joker'],
.rb[data-role='joker'] {
  background: linear-gradient(115deg, rgba(125, 249, 255, 0.2), rgba(167, 139, 250, 0.2), rgba(255, 122, 217, 0.2));
  box-shadow: inset 0 0 0 1px rgba(255, 122, 217, 0.55);
}

/* Holographic treatment for the joker's own card */
.flip[data-role='joker'] .flip-front,
.my-role[data-role='joker'] {
  background:
    radial-gradient(90% 60% at 20% 10%, rgba(125, 249, 255, 0.25), transparent 60%),
    radial-gradient(90% 60% at 80% 90%, rgba(255, 122, 217, 0.28), transparent 60%),
    linear-gradient(165deg, #241a3c, #0a0816 75%);
}

.flip[data-role='joker'] .rc-inner {
  background:
    radial-gradient(80% 50% at 50% 30%, rgba(255, 122, 217, 0.22), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 6px, transparent 6px 12px);
  border-color: rgba(255, 122, 217, 0.45);
}

.flip[data-role='joker'] h2 {
  background: linear-gradient(100deg, #7df9ff, #a78bfa 45%, #ff7ad9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

.flip[data-role='joker'] .big { animation: joker-spin 7s ease-in-out infinite; }

@keyframes joker-spin {
  0%, 100% { transform: rotateY(0) translateY(0); }
  50% { transform: rotateY(180deg) translateY(-10px); }
}

.mates.is-joker {
  color: #ffd1f3;
  background: linear-gradient(100deg, rgba(125, 249, 255, 0.16), rgba(255, 122, 217, 0.16));
  box-shadow: inset 0 0 0 1px rgba(255, 122, 217, 0.4);
  border-radius: 999px;
  padding: 2px 10px;
  display: inline-block;
}

/* Secret role picker on the joker's card */
.joker-pick { width: 100%; margin-top: 14px; }

.jp-title {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.jp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

.jp-card {
  --rc: var(--violet);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px 6px;
  border: 0;
  border-radius: 12px;
  color: var(--rc);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 35%, transparent);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.jp-card svg { width: 26px; height: 26px; }
.jp-card span { font-size: 11px; font-weight: 700; color: var(--text); }
.jp-card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--rc), 0 0 20px -6px var(--rc); }

.jp-card.is-on {
  background: color-mix(in srgb, var(--rc) 18%, rgba(0, 0, 0, 0.4));
  box-shadow: inset 0 0 0 1.5px var(--rc), 0 0 24px -6px var(--rc);
}

.jp-note { font-size: 12px; color: var(--muted); margin-top: 10px; min-height: 2.6em; }

/* Private findings in the event log */
.fe.is-private {
  background: linear-gradient(90deg, rgba(255, 122, 217, 0.14), rgba(125, 249, 255, 0.06));
  box-shadow: inset 0 0 0 1px rgba(255, 122, 217, 0.35);
}

.fe.is-private > svg { color: var(--pink); }

.team-col li .played-as {
  font-size: 11px;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 600px) {
  .jp-card span { font-size: 10px; }
  .jp-card svg { width: 22px; height: 22px; }
}

/* The joker card carries the picker, so it needs a little more room */
.flip[data-role='joker'] { aspect-ratio: 5 / 8.6; }
.flip[data-role='joker'] .rc-inner { justify-content: flex-start; padding: 22px 16px 16px; }
.flip[data-role='joker'] .big { width: 34%; }
.flip[data-role='joker'] h2 { font-size: 46px; margin-top: 2px; }
.flip[data-role='joker'] p { font-size: 13px; margin-top: 8px; line-height: 1.6; }
.flip[data-role='joker'] .joker-pick { margin-top: auto; }
.jp-note { min-height: 0; }

/* ── Joker in the card line-ups ── */
.role-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.role-card.is-rare {
  background:
    radial-gradient(90% 60% at 20% 8%, rgba(125, 249, 255, 0.16), transparent 60%),
    radial-gradient(90% 60% at 85% 92%, rgba(255, 122, 217, 0.2), transparent 60%),
    linear-gradient(165deg, #241a3c, #0a0816 72%);
}

.rare-tag {
  position: absolute;
  top: 14px;
  left: -34px;
  z-index: 2;
  transform: rotate(-38deg);
  padding: 4px 34px;
  font-size: 10px;
  font-weight: 700;
  color: #1a0d1a;
  background: linear-gradient(100deg, #7df9ff, #ff7ad9);
  box-shadow: 0 6px 18px -6px rgba(255, 122, 217, 0.8);
}

.fc-joker {
  left: 41%;
  top: 72%;
  width: 18%;
  --r: 0deg;
  --z: 140px;
  animation-delay: -5.5s;
}

.dist { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.dist-row.is-rare {
  background:
    radial-gradient(90% 60% at 50% 25%, rgba(255, 122, 217, 0.18), transparent 70%),
    linear-gradient(165deg, #241a3c, #0a0816);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 217, 0.45);
}

.dist-row.is-rare b { font-size: 26px; opacity: 0.9; }

/* ── The joker's private action panel ── */
.joker-btn {
  color: var(--pink);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 217, 0.5);
  background: linear-gradient(135deg, rgba(125, 249, 255, 0.14), rgba(255, 122, 217, 0.16));
  animation: joker-glow 3s ease-in-out infinite;
}

@keyframes joker-glow {
  50% { box-shadow: inset 0 0 0 1px rgba(255, 122, 217, 0.9), 0 0 22px -6px var(--pink); }
}

.joker-panel { width: min(460px, 100%); text-align: start; }
.joker-panel h3 { margin-top: 10px; }
.joker-panel > p { font-size: 14px; margin-bottom: 14px; }

.jk-late {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--detective);
  background: rgba(255, 200, 87, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 200, 87, 0.3);
  margin-bottom: 12px;
}

.jk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: min(50vh, 420px);
  overflow-y: auto;
}

.jk-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 14px;
  text-align: start;
  color: var(--text);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.jk-row:hover { transform: translateX(-4px); box-shadow: inset 0 0 0 1px rgba(255, 122, 217, 0.5); }
.jk-row .avatar { --size: 34px; }
.jk-row .nm { flex: 1; font-weight: 700; }

.jk-row.is-on {
  background: linear-gradient(90deg, rgba(255, 122, 217, 0.22), rgba(125, 249, 255, 0.1));
  box-shadow: inset 0 0 0 1.5px rgba(255, 122, 217, 0.8), 0 0 26px -10px var(--pink);
}

.jk-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  color: #1a0d1a;
  background: linear-gradient(100deg, #7df9ff, #ff7ad9);
}

@media (max-width: 1100px) {
  .role-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dist { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .role-grid { grid-template-columns: minmax(0, 290px); justify-content: center; }
}

/* ═══════════════════════════ Seat role labels ═══════════════════════════ */
.seat-role {
  --rc: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin-top: -2px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  font-size: clamp(9px, 1.6cqmin, 11px);
  font-weight: 800;
  line-height: 1.4;
  color: var(--rc);
  background: color-mix(in srgb, var(--rc) 16%, rgba(6, 5, 13, 0.85));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 55%, transparent);
  white-space: nowrap;
}

.seat-role svg { width: 13px; height: 13px; flex: none; }
.seat-role b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; }

.seat.is-dead .seat-role:not(.is-unknown) {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 70%, transparent), 0 0 14px -4px var(--rc);
}

.seat-role.is-unknown {
  color: var(--dim);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.seat .rb { display: none; }

/* ═══════════════════════════ Privacy mode ═══════════════════════════ */
.my-role.is-hidden {
  --rc: #6c6890;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 8px, transparent 8px 16px),
    linear-gradient(160deg, rgba(30, 28, 44, 0.9), rgba(12, 11, 20, 0.95));
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.my-role.is-hidden .em-back {
  color: var(--muted);
  background: linear-gradient(165deg, #1b1a26, #0b0a12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.my-role.is-hidden .em-back > svg,
.my-role.is-hidden .hidden-title,
.my-role.is-hidden .mates { filter: none; }
.my-role.is-hidden .em-back > svg { width: 26px; height: 26px; }
.my-role.is-hidden .hidden-title { color: var(--text); text-shadow: none; font-size: 28px; }

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px var(--line);
}

.flip.is-held { animation: none; transition: transform 0.9s cubic-bezier(0.5, -0.2, 0.2, 1.3); }
.flip.is-held.is-open { transform: rotateY(180deg); }
.reveal-peek { margin-top: 18px; }

/* ═══════════════════════════ Last words ═══════════════════════════ */
.last-words {
  position: relative;
  width: min(620px, 100%);
  text-align: center;
  animation: announce-in 0.8s cubic-bezier(0.2, 1.2, 0.3, 1);
}

.lw-beam {
  position: absolute;
  left: 50%;
  top: -40vh;
  width: 360px;
  height: calc(40vh + 190px);
  translate: -50% 0;
  background: linear-gradient(180deg, rgba(255, 240, 220, 0.2), rgba(255, 200, 150, 0.08) 70%, transparent);
  -webkit-mask: conic-gradient(from 160deg at 50% 0%, transparent 0deg, #000 14deg, #000 26deg, transparent 40deg);
  mask: conic-gradient(from 160deg at 50% 0%, transparent 0deg, #000 14deg, #000 26deg, transparent 40deg);
  filter: blur(4px);
  pointer-events: none;
  animation: flicker 6s infinite;
}

.lw-avatar {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(6, 5, 13, 0.9), 0 0 0 5px rgba(255, 220, 190, 0.5), 0 30px 60px -10px rgba(0, 0, 0, 0.9), 0 0 80px -10px rgba(255, 200, 150, 0.45);
}

.lw-avatar .avatar { --size: 132px; filter: saturate(0.6); }

.last-words h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(44px, 8vw, 72px);
  line-height: 1.1;
  margin: 10px 0 4px;
  background: linear-gradient(180deg, #fff 20%, #ffd9b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.5));
}

.lw-sub { color: var(--muted); font-size: 15px; margin-bottom: 22px; }
.lw-slot { min-height: 150px; display: grid; place-items: center; }

.lw-quote {
  position: relative;
  margin: 0;
  width: 100%;
  padding: 28px 30px 26px;
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 210, 170, 0.12), transparent 70%),
    linear-gradient(160deg, rgba(36, 30, 48, 0.85), rgba(14, 11, 20, 0.92));
  box-shadow: inset 0 0 0 1px rgba(255, 220, 190, 0.28), 0 30px 60px -24px rgba(0, 0, 0, 0.9);
  animation: announce-in 0.6s cubic-bezier(0.2, 1.2, 0.3, 1);
}

.lw-mark {
  position: absolute;
  top: -20px;
  right: 24px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #1b1208;
  background: linear-gradient(135deg, #ffe2c4, #ffb77a);
  box-shadow: 0 8px 24px -6px rgba(255, 183, 122, 0.8);
}

.lw-mark svg { width: 22px; height: 22px; }

.lw-text {
  font-family: var(--display);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.5;
  color: #fff4e8;
  min-height: 1.5em;
}

.lw-text::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 0.9em;
  margin-inline-start: 4px;
  vertical-align: -0.1em;
  background: #ffd9b8;
  animation: blink 1s steps(1) infinite;
}

.lw-form { width: 100%; display: grid; gap: 10px; }

.lw-form textarea {
  width: 100%;
  resize: none;
  padding: 16px 18px;
  border: 0;
  border-radius: 18px;
  font: inherit;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 190, 0.3);
  outline: none;
}

.lw-form textarea:focus { box-shadow: inset 0 0 0 1px rgba(255, 220, 190, 0.7), 0 0 0 4px rgba(255, 200, 150, 0.12); }
.lw-row { display: flex; align-items: center; justify-content: space-between; }
.lw-count { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.lw-waiting { display: inline-flex; gap: 10px; align-items: center; font-size: 17px; color: var(--muted); }

.vr-lw {
  margin-top: 10px;
  font-family: var(--display);
  font-size: 22px;
  color: #ffe2c4 !important;
}

/* Last words inside the chat log */
.msg.last-words {
  display: block;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 210, 170, 0.12), rgba(255, 210, 170, 0.03));
  box-shadow: inset 0 0 0 1px rgba(255, 220, 190, 0.3);
}

.lw-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: #ffc896; }
.lw-tag .i { width: 13px; height: 13px; }
.lw-body { display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; }
.lw-body .avatar { --size: 30px; filter: grayscale(0.6); }
.lw-body b { font-size: 12px; color: var(--muted); }
.lw-body p { font-size: 15px; color: #fff1e2; }

/* ═══════════════════════════ End screen tabs + recap ═══════════════════════════ */
.end-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px var(--line);
}

.end-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  color: var(--muted);
  background: none;
  transition: color 0.2s, background 0.2s;
}

.end-tab.is-active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(125, 249, 255, 0.18), rgba(255, 122, 217, 0.18));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.recap {
  display: grid;
  gap: 14px;
  max-height: min(58vh, 620px);
  overflow-y: auto;
  padding: 2px 4px 4px;
  text-align: start;
}

.rc-round {
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(30, 26, 60, 0.72), rgba(12, 10, 26, 0.88));
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
  animation: deal 0.5s cubic-bezier(0.3, 1.3, 0.5, 1) backwards;
}

.rc-round > header {
  padding: 10px 18px;
  font-family: var(--display);
  font-size: 20px;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.16), transparent);
  border-bottom: 1px solid var(--line);
}

.rc-grid { display: grid; grid-template-columns: 1fr 1fr; }
.rc-half { padding: 14px 16px; }
.rc-night { background: linear-gradient(180deg, rgba(40, 32, 90, 0.18), transparent); }
.rc-day { border-inline-start: 1px solid var(--line); background: linear-gradient(180deg, rgba(125, 249, 255, 0.05), transparent); }

.rc-half h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
}

.rc-half ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.rc-half li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.6;
}

.rc-half li > svg { flex: none; width: 20px; height: 20px; color: var(--rc, var(--muted)); }
.rc-half li b { color: var(--text); }
.rc-half .role-badge { font-size: 11px; padding: 1px 8px 1px 6px; vertical-align: middle; }
.rc-half .role-badge svg { width: 13px; height: 13px; }

.rc-tag {
  display: inline-block;
  margin-inline-start: 4px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: #ffd1f3;
  background: rgba(255, 122, 217, 0.14);
}

.rc-out {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.rc-out.is-dead { color: #fff; background: rgba(255, 61, 110, 0.35); }
.rc-out.is-saved { color: #062a1e; background: var(--doctor); }

.rc-vote { justify-content: space-between; padding: 4px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); }
.rc-target { font-weight: 700; min-width: 0; flex: 1; }
.rc-count { font-family: var(--display); font-size: 17px; color: var(--cyan); }
.rc-voters { display: flex; gap: 2px; }
.rc-voters .avatar { --size: 20px; font-size: 9px; }
.rc-result { margin-top: 2px; padding-top: 8px; border-top: 1px dashed var(--line); }
.rc-result > svg { color: var(--cyan); }

.rc-lw {
  display: flex;
  gap: 8px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  color: #ffe6cf;
  background: rgba(255, 210, 170, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 190, 0.2);
}

.rc-lw svg { flex: none; width: 16px; height: 16px; color: #ffc896; }

/* ═══════════════════════════ Voice (Discord) ═══════════════════════════ */
.voice-btn {
  width: auto;
  padding: 0 12px;
  gap: 6px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #c9ceff;
  background: rgba(88, 101, 242, 0.18);
  box-shadow: inset 0 0 0 1px rgba(138, 148, 255, 0.45);
  text-decoration: none;
}

.voice-btn:hover { color: #fff; background: rgba(88, 101, 242, 0.32); }
.voice-note { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.voice-join { width: 100%; text-decoration: none; color: #dfe2ff; background: rgba(88, 101, 242, 0.22); box-shadow: inset 0 0 0 1px rgba(138, 148, 255, 0.45); }
.voice-form { display: flex; gap: 8px; margin-top: 10px; }

.voice-form input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  font-size: 13px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px var(--line);
  outline: none;
}

html [data-role='discuss'] { --rc: #9ea8ff; }

@media (max-width: 760px) {
  .rc-grid { grid-template-columns: 1fr; }
  .rc-day { border-inline-start: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 600px) {
  .voice-label { display: none; }
  .voice-btn { padding: 0; width: 34px; justify-content: center; }
}

/* ═══════════════════════════ Account (sign-in) ═══════════════════════════ */
.account { position: relative; display: flex; align-items: center; }

/* Nav: signed out */
.acc-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px 0 14px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(255, 122, 217, 0.12));
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.45);
  cursor: pointer;
  transition: box-shadow 0.25s, transform 0.25s, background 0.25s;
}
.acc-login .i { width: 18px; height: 18px; color: var(--violet); }
.acc-login:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.3), rgba(255, 122, 217, 0.2));
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.8), 0 10px 30px -12px rgba(167, 139, 250, 0.8);
}

/* Nav: signed in */
.acc-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding-inline: 5px 10px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--panel-hi);
  box-shadow: inset 0 0 0 1px var(--line-hi);
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s;
}
.acc-chip:hover,
.acc-chip[aria-expanded='true'] { background: rgba(167, 139, 250, 0.12); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.55); }
.acc-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-caret { width: 14px; height: 14px; color: var(--muted); transition: rotate 0.2s; }
.acc-chip[aria-expanded='true'] .acc-caret { rotate: 180deg; }

.acc-av {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 800;
  color: #0b0918;
  background: var(--iri);
  box-shadow: 0 0 16px -4px rgba(167, 139, 250, 0.8);
}
.acc-av.is-lg { width: 42px; height: 42px; border-radius: 12px; font-size: 18px; }

.acc-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 60;
  width: 260px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(16, 13, 34, 0.96);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(167, 139, 250, 0.25);
  animation: acc-in 0.18s ease-out;
}
@keyframes acc-in { from { opacity: 0; transform: translateY(-6px); } }
.acc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.acc-head > div { display: grid; gap: 2px; min-width: 0; }
.acc-head b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-head small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; text-align: right; }
.acc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  background: none;
  cursor: pointer;
}
.acc-item:hover { background: var(--panel-hi); }
.acc-item .i { width: 18px; height: 18px; color: var(--violet); }
.acc-item.is-danger:hover { color: var(--danger); background: rgba(255, 77, 109, 0.1); }
.acc-item.is-danger:hover .i { color: var(--danger); }

/* Home: note under the join form */
.entry-note {
  margin: 14px 2px 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}
.link-btn {
  padding: 0;
  border: 0;
  font: inherit;
  font-weight: 700;
  color: var(--violet);
  background: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--cyan); }

/* Sign-in popup */
.auth-layer { z-index: 70; }
.dialog.auth { --auth-pad: 28px; position: relative; width: min(420px, 100%); padding: 34px var(--auth-pad) 26px; }
.auth-close { position: absolute; top: 14px; left: var(--auth-pad); }
.auth-logo {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 8px;
  filter: drop-shadow(0 8px 24px rgba(167, 139, 250, 0.55));
}
.dialog.auth h3 { margin-bottom: 6px; }
.dialog.auth .auth-sub { margin-bottom: 22px; font-size: 14px; }

.gsi-wrap { display: flex; justify-content: center; min-height: 44px; color-scheme: light; }
.gsi-btn { display: flex; justify-content: center; width: 100%; max-width: 360px; }

.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  font-size: 12px;
  color: var(--dim);
}
.auth-or::before,
.auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.auth-form { display: grid; gap: 12px; }
.auth-form .btn { width: 100%; }
.auth-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  text-align: left;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px var(--line);
  outline: none;
  transition: box-shadow 0.2s, background 0.2s;
}
.auth-input::placeholder { color: var(--dim); }
.auth-input:focus { background: rgba(0, 0, 0, 0.5); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.7), 0 0 0 4px rgba(167, 139, 250, 0.15); }

.auth-sent { margin-bottom: 18px; font-size: 14px; line-height: 1.8; color: var(--muted); }
.auth-sent b { color: var(--text); font-weight: 600; word-break: break-all; }

/* One-time code: one real input under six painted boxes */
.otp { position: relative; display: block; cursor: text; }
.otp-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  font-size: 16px;
  color: transparent;
  caret-color: transparent;
  background: transparent;
  opacity: 0;
  outline: none;
}
.otp-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-boxes i {
  position: relative;
  display: grid;
  place-items: center;
  height: 58px;
  border-radius: 14px;
  font-family: var(--display);
  font-size: 30px;
  font-style: normal;
  line-height: 1;
  padding-top: 0.12em;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.15s, background 0.15s;
}
.otp-boxes i.is-filled { box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.5); }
.otp-boxes i.is-active {
  background: rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 0 0 1.5px var(--violet), 0 0 0 4px rgba(167, 139, 250, 0.15);
}
.otp-boxes i.is-active:empty::after {
  content: '';
  width: 2px;
  height: 26px;
  border-radius: 2px;
  background: var(--violet);
  animation: otp-caret 1s steps(1) infinite;
}
@keyframes otp-caret { 50% { opacity: 0; } }

.auth-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--dim);
}
.auth-links button {
  padding: 4px 2px;
  border: 0;
  font: inherit;
  font-weight: 600;
  color: var(--violet);
  background: none;
  cursor: pointer;
}
.auth-links button:hover:not(:disabled) { color: var(--cyan); }
.auth-links button:disabled { color: var(--dim); cursor: default; font-variant-numeric: tabular-nums; }

.auth-note { margin: 0; font-size: 13px; color: var(--muted); }
.auth-err {
  margin: 14px 0 0 !important;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  color: #ffb3c1 !important;
  background: rgba(255, 77, 109, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.3);
}

/* Busy button: keep its size, show a spinner */
.btn.is-busy { cursor: wait; }
.btn.is-busy > * { visibility: hidden; }
.btn.is-busy::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

@media (max-width: 600px) {
  .acc-login { height: 36px; padding: 0 12px 0 10px; font-size: 13px; gap: 6px; }
  .acc-name,
  .acc-caret { display: none; }
  .acc-chip { padding: 5px; }
  .dialog.auth { --auth-pad: 18px; padding: 30px var(--auth-pad) 22px; }
  .otp-boxes { gap: 6px; }
  .otp-boxes i { height: 52px; font-size: 26px; }
}

/* Our own Google button (Google's colours only on the "G") */
.btn-google {
  width: 100%;
  height: 52px;
  gap: 12px;
  font-size: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px var(--line-hi);
}
.btn-google:hover { background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); }
.btn-google .g-logo {
  width: 26px;
  height: 26px;
  padding: 4px;
  border-radius: 50%;
  background: #fff;
  flex: none;
}

/* Nav chip with the player's avatar */
.acc-chip .avatar { box-shadow: 0 0 16px -4px rgba(167, 139, 250, 0.8); font-size: 14px; }
.acc-head .avatar { font-size: 18px; }

/* Home: the name comes from the profile when signed in */
.field-head { display: flex !important; align-items: baseline; justify-content: space-between; gap: 8px; }
.field-head .link-btn { font-size: 12px; }

/* Profile window */
.dialog.profile { position: relative; width: min(560px, 100%); padding: 30px 26px 24px; text-align: start; }
.pf-hero { display: grid; justify-items: center; gap: 4px; margin-bottom: 20px; text-align: center; }
.pf-preview { position: relative; margin-bottom: 8px; }
.pf-preview::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(from var(--ang, 0deg), #7df9ff, #a78bfa, #ff7ad9, #7df9ff);
  filter: blur(10px);
  opacity: 0.55;
  animation: ang 6s linear infinite;
}
.pf-preview .avatar { position: relative; font-size: 42px; box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.55); }
.dialog.profile .pf-title { margin: 0; font-size: 30px; }
.pf-email { color: var(--muted); font-size: 13px; }

.pf-label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pf-name-row { position: relative; }
.pf-name { text-align: right; padding-left: 64px; }
.pf-count { position: absolute; left: 14px; top: 50%; translate: 0 -50%; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.pf-hint { margin: 8px 2px 20px !important; font-size: 12px !important; line-height: 1.6; color: var(--dim) !important; }

/* Character picker */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
  max-height: 330px;
  overflow-y: auto;
  padding: 4px;
  margin: 0 -4px 18px;
  scrollbar-width: thin;
  overscroll-behavior-y: contain;
}
.pf-tile {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.3);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, color 0.2s;
}
/* The drawing fills the round tile; the grid only centres the labels. */
.pf-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pf-tile:hover { transform: translateY(-3px); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-hi); }
.pf-tile.is-on { box-shadow: inset 0 0 0 3px var(--violet), 0 8px 22px -8px var(--violet); }
.pf-upload { border: 1.5px dashed rgba(167, 139, 250, 0.5); box-shadow: none; }
.pf-upload .i { width: 22px; height: 22px; color: var(--violet); }
.pf-upload.has-img { border-style: solid; color: #fff; }
.pf-upload.has-img::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(6, 5, 13, 0.85), rgba(6, 5, 13, 0.1)); }
.pf-upload.has-img > * { position: relative; }
.pf-letter .avatar { position: absolute; inset: 0; --size: 100% !important; width: 100%; height: 100%; border-radius: 50%; font-size: 24px; }
.pf-letter span { position: absolute; bottom: 6px; font-size: 10px; color: #0b0918; font-weight: 700; }

/* Profile tabs: edit / my stats */
.pf-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 auto 18px; width: fit-content; border-radius: 999px; background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 1px var(--line); }
.pf-tabs button { height: 34px; padding: 0 18px; border: 0; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); background: none; cursor: pointer; }
.pf-tabs button.is-on { color: #0b0918; background: var(--iri); }
.pf-stats .lb-roles li svg,
.pf-stats .lb-recent li svg { color: var(--rc); }
.pf-h4 { margin: 18px 0 8px; font-size: 14px; color: var(--muted); }
.pf-lb-link { width: 100%; margin-top: 16px; }
.pf-lb-link .i { color: var(--detective); }
.pf-empty { display: grid; justify-items: center; gap: 8px; padding: 26px 10px; text-align: center; }
.pf-empty .i { width: 38px; height: 38px; color: var(--detective); }
.pf-empty b { font-size: 17px; }
.pf-empty p { margin: 0 0 6px !important; max-width: 360px; font-size: 13px !important; color: var(--muted) !important; line-height: 1.7; }

.pf-actions { display: flex; gap: 10px; }
.pf-actions .btn { flex: 1; }
.dialog.profile .auth-err { margin: 0 0 14px !important; }

@media (max-width: 600px) {
  .dialog.profile { padding: 26px 16px 18px; }
  .pf-grid { grid-template-columns: repeat(4, 1fr); max-height: 250px; }
  .pf-tile { min-height: 84px; }
  .pf-tile .avatar { --size: 44px; }
}

/* Rankings shortcut: a trophy button where the nav links are hidden (phones, tablets) */
.nav-lb { display: none; color: var(--detective); }
@media (max-width: 900px) {
  .nav-lb { display: inline-grid; }
}

/* ─── The owner's note on the front page ─── */
.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(1180px, 100% - 32px);
  margin: 14px auto 0;
  padding: 13px 16px;
  border-radius: 18px;
  color: var(--text);
  background: rgba(167, 139, 250, 0.12);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.4);
  animation: notice-in 0.5s both;
}
.notice[data-tone='warn'] { background: rgba(255, 200, 87, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 200, 87, 0.45); }
.notice[data-tone='party'] { background: rgba(46, 240, 176, 0.12); box-shadow: inset 0 0 0 1px rgba(46, 240, 176, 0.42); }
.notice .i { width: 22px; height: 22px; flex: none; color: var(--violet); }
.notice[data-tone='warn'] .i { color: var(--detective); }
.notice[data-tone='party'] .i { color: var(--doctor); }
.notice p { margin: 0; font-size: 15px; line-height: 1.5; }
.notice-x { margin-inline-start: auto; flex: none; }
@keyframes notice-in {
  from { opacity: 0; translate: 0 -8px; }
  to { opacity: 1; translate: 0 0; }
}
@media (max-width: 700px) {
  .notice { width: calc(100% - 24px); padding: 11px 13px; }
  .notice p { font-size: 14px; }
}

/* ─── Choosing the room type ─── */
.field-kind > span { display: block; margin-bottom: 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 14px;
  text-align: start;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.seg button small { font-size: 11px; opacity: 0.85; }
.seg button .i { width: 15px; height: 15px; vertical-align: -2px; }
.seg button:hover { color: var(--text); }
.seg button.is-on {
  color: var(--text);
  background: rgba(167, 139, 250, 0.16);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.5);
}

/* ─── The open rooms on the front page ─── */
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.browse-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 0.2s, box-shadow 0.2s, translate 0.2s;
}
.browse-card:hover { translate: 0 -2px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.4); }
.browse-card.is-shut { opacity: 0.68; }
.browse-card.is-shut:hover { translate: 0; }
.browse-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.browse-code {
  padding: 5px 12px;
  border-radius: 12px;
  font-family: 'Lalezar', system-ui;
  font-size: 20px;
  letter-spacing: 4px;
  color: var(--text);
  background: rgba(167, 139, 250, 0.14);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.35);
}
.browse-state {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--doctor);
  background: rgba(46, 240, 176, 0.1);
  box-shadow: inset 0 0 0 1px rgba(46, 240, 176, 0.28);
}
.browse-state.is-live { color: #9db4ff; background: rgba(120, 150, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(120, 150, 255, 0.3); }
.browse-host { margin: 0; font-size: 14px; color: var(--muted); }
.browse-host b { color: var(--text); }
.browse-faces { display: flex; align-items: center; gap: 6px; }
.browse-faces .avatar { flex: none; }
.browse-more {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px var(--line);
}
.browse-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.browse-count { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.browse-count .i { width: 15px; height: 15px; }
.browse-why { font-size: 12px; color: var(--muted); }

/* ─── The lobby's public/private pill ─── */
.kind-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
}
.kind-pill[disabled] { cursor: default; }
.kind-pill.is-public { color: var(--doctor); background: rgba(46, 240, 176, 0.1); box-shadow: inset 0 0 0 1px rgba(46, 240, 176, 0.3); }
.kind-pill .i { width: 16px; height: 16px; }
.kind-pill b {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}
.kind-pill:hover:not([disabled]) b { background: rgba(167, 139, 250, 0.3); }

@media (max-width: 560px) {
  .seg { grid-template-columns: 1fr; }
  .browse-grid { grid-template-columns: 1fr; }
}

/* The language switch sits with the other round buttons in the bar. */
.lang-btn span { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; }
.lb-nav-end { display: inline-flex; align-items: center; gap: 8px; }

/* Closing an account, at the foot of the profile. */
.pf-danger { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; }
.pf-danger .link-btn { color: #ff9fb3; }
.pf-danger .link-btn:hover { color: #ff6e8c; }
.pf-del { text-align: start; }
.pf-del p { margin: 0 0 12px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.pf-del p b { color: #ffd3dc; }
.pf-del .pf-label { margin-bottom: 6px; }
.pf-del .auth-input { margin-bottom: 12px; }

/* Asking for a name on the way into an open room. */
.name-ask { width: min(380px, 100%); text-align: center; }
.name-ask h3 { margin: 0 0 6px; }
.name-ask p { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.name-ask .auth-input { width: 100%; margin-bottom: 14px; text-align: center; }
.name-ask .row { display: flex; gap: 10px; }
.name-ask .row .btn { flex: 1; }
