:root {
  /* CI — WEREWOLVES Ice Moon (logo / banner) */
  --night-deep: #02050a;
  --night-mid: #061018;
  --night-fog: #0a1824;
  --discord: #1a9ec4;
  --discord-hot: #5ee7ff;
  --cyan: #5ee7ff;
  --cyan-dim: #2ab8d4;
  --moon: #e8f7ff;
  --moon-glow: rgba(94, 231, 255, 0.42);
  --ember: #3dcae8;
  --ember-hot: #7df9ff;
  --blood: #e03e4a;
  --moss: #3ba55d;
  --fog: rgba(94, 231, 255, 0.1);
  --text: #e8f4fc;
  --text-dim: #7a9bb0;
  --panel: rgba(6, 12, 20, 0.9);
  --panel-border: rgba(94, 231, 255, 0.22);
  --font-display: 'Protest Strike', Impact, sans-serif;
  --font-body: 'Figtree', 'gg sans', system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  --glow: 0 0 28px rgba(94, 231, 255, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--night-deep);
}

body {
  overflow-x: hidden;
}

/* —— Atmosphere —— */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #010308;
  pointer-events: none;
}

.sky-photo {
  position: absolute;
  inset: 0;
  background:
    url('/img/background-night.png') center 42% / cover no-repeat;
  transform: scale(1.02);
  filter: saturate(1.05) contrast(1.04);
}

.sky-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 40% at 72% 8%, rgba(255, 248, 230, 0.1), transparent 55%),
    linear-gradient(180deg, rgba(1, 3, 8, 0.15) 0%, transparent 28%, rgba(1, 3, 8, 0.35) 62%, rgba(1, 3, 8, 0.82) 100%),
    radial-gradient(ellipse 90% 55% at 50% 100%, rgba(0, 0, 0, 0.55), transparent 70%);
}

/* Photoreal moon texture (img/moon.png) + soft atmospheric scatter */
.moon {
  position: absolute;
  top: 4.5vh;
  right: 7vw;
  left: auto;
  width: min(14vw, 118px);
  height: min(14vw, 118px);
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  filter: drop-shadow(0 0 14px rgba(255, 245, 220, 0.35))
    drop-shadow(0 0 36px rgba(190, 205, 235, 0.22));
  animation: moon-float 32s ease-in-out infinite;
  will-change: transform;
  isolation: isolate;
}

.moon::before {
  content: '';
  position: absolute;
  inset: -70%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 248, 230, 0.14) 0%,
    rgba(200, 215, 240, 0.05) 38%,
    transparent 70%
  );
  z-index: -1;
  animation: moon-halo 18s ease-in-out infinite;
}

.moon-disk {
  display: block;
  width: 106%;
  height: 106%;
  margin: -3%;
  border-radius: 0;
  object-fit: cover;
  background: transparent;
  user-select: none;
  pointer-events: none;
}

@keyframes moon-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-0.35vw, 0.55vh); }
}

@keyframes moon-halo {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

.stars {
  position: absolute;
  inset: 0 0 38%;
  opacity: 1;
  z-index: 1;
}

.stars span {
  position: absolute;
  width: var(--size, 2px);
  height: var(--size, 2px);
  background: var(--star-color, #f5f7ff);
  border-radius: 50%;
  opacity: var(--base-opacity, 0.7);
  box-shadow: 0 0 var(--glow-size, 2px) rgba(255, 255, 255, 0.65);
  animation: twinkle var(--d, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  will-change: opacity, transform;
}

.stars span.star-bright {
  background: var(--star-color, #fff8f0);
  box-shadow:
    0 0 3px rgba(255, 255, 255, 0.95),
    0 0 8px rgba(200, 220, 255, 0.55);
}

.stars span.star-bright::before,
.stars span.star-bright::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.55), transparent);
  pointer-events: none;
  opacity: 0.5;
}

.stars span.star-bright::before {
  width: calc(var(--size, 2px) * 8);
  height: 1px;
  transform: translate(-50%, -50%);
}

.stars span.star-bright::after {
  width: 1px;
  height: calc(var(--size, 2px) * 8);
  transform: translate(-50%, -50%);
}

@keyframes twinkle {
  0%, 100% {
    opacity: calc(var(--base-opacity, 0.7) * 0.25);
    transform: scale(0.85);
  }
  40% {
    opacity: var(--base-opacity, 0.95);
    transform: scale(1.2);
  }
  65% {
    opacity: calc(var(--base-opacity, 0.95) * 0.55);
    transform: scale(1);
  }
}

.shooting-stars {
  position: absolute;
  inset: 0 0 45%;
  overflow: hidden;
}

.shooting-stars span {
  position: absolute;
  top: var(--top, 10%);
  left: var(--left, 20%);
  width: 90px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(255, 252, 245, 0.9));
  border-radius: 2px;
  opacity: 0;
  transform: rotate(28deg);
  filter: drop-shadow(0 0 3px rgba(220, 230, 255, 0.45));
  animation: shoot var(--cycle, 14s) linear var(--delay, 0s) infinite;
}

@keyframes shoot {
  0%, 90% {
    opacity: 0;
    transform: rotate(28deg) translateX(0) scaleX(0.15);
  }
  92% { opacity: 0.9; }
  98%, 100% {
    opacity: 0;
    transform: rotate(28deg) translateX(38vw) scaleX(1);
  }
}

.ground-mist {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background:
    linear-gradient(180deg, transparent 0%, rgba(2, 5, 12, 0.25) 40%, rgba(1, 3, 8, 0.78) 100%);
  animation: mist-breathe 14s ease-in-out infinite;
  pointer-events: none;
}

@keyframes mist-breathe {
  0%, 100% { opacity: 0.88; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .moon,
  .moon::before,
  .stars span,
  .shooting-stars span,
  .ground-mist {
    animation: none !important;
  }
}

#app {
  position: relative;
  z-index: 1;
  max-width: 1480px;
  margin: 0 auto;
  padding: 1rem 1.25rem 1.5rem;
  min-height: 100dvh;
  width: 100%;
}

/* Discord Activity iframe — use full frame width */
body.is-discord-activity #app {
  max-width: none;
  padding: 0.65rem 0.85rem 0.85rem;
}

body.is-discord-activity .screen-fit.active {
  height: calc(100dvh - 1.5rem);
  max-height: calc(100dvh - 1.5rem);
}

/* Discord Activity iframe — compact chrome */
body.is-discord-activity #screen-login .brand-sub,
body.is-discord-activity #btn-discord-login {
  display: none !important;
}

body.is-discord-activity #screen-entry .lobby-browser {
  opacity: 0.85;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.screen.active.screen-enter {
  animation: fade-in 0.55s ease;
}

.screen-fit.active {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 2.5rem);
  max-height: calc(100dvh - 2.5rem);
  overflow: hidden;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* —— Brand (Logo CI) —— */
.hero-brand {
  position: relative;
  text-align: center;
  padding: 4vh 0 1.75rem;
}

.brand-logo {
  display: block;
  width: min(280px, 72vw);
  height: min(280px, 72vw);
  margin: 0 auto 1rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 28%;
  box-shadow:
    0 0 0 3px rgba(94, 231, 255, 0.55),
    0 0 40px rgba(94, 231, 255, 0.35),
    0 0 80px rgba(94, 231, 255, 0.25);
  animation: logo-in 0.9s ease, logo-glow 5s ease-in-out infinite;
}

.brand-logo-sm {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(94, 231, 255, 0.5), 0 0 16px rgba(94, 231, 255, 0.25);
  flex-shrink: 0;
}

@keyframes logo-in {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: none; }
}

@keyframes logo-glow {
  0%, 100% {
    box-shadow:
      0 0 0 3px rgba(94, 231, 255, 0.5),
      0 0 36px rgba(94, 231, 255, 0.3),
      0 0 70px rgba(94, 231, 255, 0.2);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(94, 231, 255, 0.65),
      0 0 50px rgba(94, 231, 255, 0.45),
      0 0 100px rgba(94, 231, 255, 0.35);
  }
}

.brand-eyebrow {
  font-family: var(--font-body);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cyan);
  margin: 0 0 0.5rem;
  opacity: 0.9;
}

.brand {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 0 12px rgba(94, 231, 255, 0.55),
    0 0 28px rgba(94, 231, 255, 0.4);
}

.brand-sub {
  margin: 0.65rem auto 0;
  max-width: 28rem;
  color: var(--text-dim);
  font-size: 1.02rem;
}

.brand-sm {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
  text-shadow: 0 0 12px rgba(94, 231, 255, 0.4);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-compact .brand-logo {
  width: min(180px, 42vw);
  margin-bottom: 0.65rem;
}

/* —— Panels & buttons —— */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.panel h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  color: var(--cyan);
  font-weight: 400;
}

.panel h3 {
  font-size: 0.95rem;
  margin: 1rem 0 0.5rem;
  color: var(--text);
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.9rem;
}

label.inline {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

input,
select {
  font: inherit;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(240, 230, 200, 0.2);
  background: rgba(8, 14, 24, 0.7);
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid var(--ember);
  outline-offset: 1px;
}

.code-input {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-weight: 700;
  font-size: 1.15rem;
}

.btn {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--discord));
  color: #041018;
  box-shadow: var(--glow);
}

.btn-primary:hover {
  box-shadow: 0 0 32px rgba(94, 231, 255, 0.45);
}

.btn-secondary {
  background: rgba(94, 231, 255, 0.14);
  color: var(--cyan);
  border: 1px solid rgba(94, 231, 255, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  border-color: var(--panel-border);
  color: var(--text);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.error {
  color: #ff8a8a;
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

.hint {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.lede {
  color: var(--text-dim);
  max-width: 36rem;
}

/* —— Entry / lobby browser —— */
.entry-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.entry-top-spacer {
  flex: 1;
  min-width: 0;
}

.entry-user-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.lang-switch button {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(220, 230, 255, 0.55);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  line-height: 1;
}

.lang-switch button.is-active,
.lang-switch button[aria-pressed='true'] {
  background: rgba(94, 231, 255, 0.35);
  color: #fff;
}

.lang-switch button:hover {
  color: #fff;
}

.lang-switch--login {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
}

.lang-switch--compact button {
  padding: 0.35rem 0.55rem;
  font-size: 0.68rem;
}

.topbar--compact {
  gap: 0.5rem;
}

.topbar--compact .lang-switch {
  margin-left: auto;
}

.friends-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 42px;
  padding: 0 0.9rem 0 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.friends-chip-icon {
  flex-shrink: 0;
  color: rgba(170, 190, 255, 0.85);
}

.friends-chip:hover {
  border-color: rgba(94, 231, 255, 0.45);
  background: rgba(94, 231, 255, 0.12);
  color: #fff;
}

.friends-chip:hover .friends-chip-icon {
  color: #c5ceff;
}

.profile-menu {
  position: relative;
  flex-shrink: 0;
}

.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  height: 42px;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-trigger:hover,
.profile-menu.is-open .profile-trigger {
  border-color: rgba(94, 231, 255, 0.45);
  background: rgba(94, 231, 255, 0.12);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a2030;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  text-align: left;
  min-width: 0;
}

.profile-meta strong {
  font-size: 0.9rem;
  line-height: 1.2;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-meta .hint {
  font-size: 0.72rem;
}

.profile-caret {
  color: var(--text-dim);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.profile-menu.is-open .profile-caret {
  transform: rotate(180deg);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 40;
  width: min(260px, 78vw);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: modal-in 0.18s ease;
}

.profile-dropdown[hidden] {
  display: none !important;
}

.profile-dropdown-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.profile-dropdown-head img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a2030;
}

.profile-dropdown-head strong {
  display: block;
  font-size: 0.95rem;
}

.profile-logout {
  width: 100%;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.room-list-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.room-list-watermark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(240px, 58%);
  height: min(240px, 58%);
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 28%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
  filter: saturate(0.9);
  box-shadow: 0 0 40px rgba(94, 231, 255, 0.15);
}

.room-list-wrap .room-list {
  position: relative;
  z-index: 1;
}

.lobby-browser {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.85fr);
  flex: 1;
  min-height: 0;
  align-items: stretch;
  margin-top: 0.5rem;
}

.lobby-main {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
  min-width: 0;
}

@media (max-width: 960px) {
  .lobby-browser {
    grid-template-columns: 1fr;
  }

  .hub-chat-panel {
    max-height: 280px;
  }
}

.room-list-panel,
.hub-chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
}

.room-list-panel {
  flex: 1 1 auto;
}

/* Create sits above open games — same panel chrome as room list / chat */
.create-panel {
  --create-control-h: 2.55rem;
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  margin: 0;
  overflow: visible;
}

.create-panel-head {
  margin-bottom: 0.6rem;
  flex-shrink: 0;
}

.create-panel-head h2,
.room-list-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.create-panel-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) auto;
  gap: 0.75rem 1rem;
  align-items: end;
}

.create-name-label {
  margin: 0;
  min-width: 0;
}

.create-name-label input,
.create-password-wrap input,
.create-panel-body .btn-primary {
  box-sizing: border-box;
  height: var(--create-control-h);
  min-height: var(--create-control-h);
  padding-top: 0;
  padding-bottom: 0;
}

.create-visibility-row {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  min-width: 0;
}

.create-visibility-row .visibility-fieldset {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.create-visibility-row .visibility-fieldset legend {
  padding: 0;
  margin: 0 0 0.35rem;
  float: none;
  width: auto;
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
}

.create-visibility-row .visibility-options {
  gap: 0.45rem;
}

.create-visibility-row .visibility-option-card {
  box-sizing: border-box;
  height: var(--create-control-h);
  min-height: var(--create-control-h);
  padding: 0 0.7rem;
  justify-content: center;
  gap: 0;
}

.create-visibility-row .visibility-option-desc {
  display: none;
}

.create-visibility-row .visibility-option-title {
  font-size: 0.88rem;
  line-height: 1;
}

.create-panel-body .btn-primary {
  margin: 0;
  align-self: end;
  white-space: nowrap;
  padding-inline: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 720px) {
  .create-panel-body {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .create-visibility-row {
    flex-wrap: wrap;
  }

  .create-password-wrap {
    flex: 1 1 100%;
  }

  .create-panel-body .btn-primary {
    width: 100%;
  }
}

.hub-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-shrink: 0;
}

.hub-chat-head-titles {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.hub-chat-head-titles > h2 {
  margin: 0;
  font-size: 1.05rem;
}

.hub-admin-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

/* display:flex above would otherwise override the hidden attribute */
.hub-admin-tools[hidden] {
  display: none !important;
}

.hub-chat-panel .chat-log {
  flex: 1 1 auto;
  min-height: 140px;
}

.online-count {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.78rem;
}

.online-count-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #3dd68c;
  box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.18);
  flex-shrink: 0;
}

.chat-msg .chat-admin-del {
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 80, 80, 0.12);
  color: rgba(255, 160, 160, 0.9);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  vertical-align: baseline;
}

.chat-msg .chat-admin-del:hover,
.chat-msg .chat-admin-del:focus-visible {
  background: rgba(255, 80, 80, 0.22);
  outline: none;
}

.chat-msg--admin {
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: rgba(255, 180, 70, 0.08);
  border: 1px solid rgba(255, 180, 70, 0.2);
}

.chat-msg--admin .chat-name,
.chat-msg--admin .chat-name-btn {
  color: #ffc56a;
}

.room-list-panel {
  overflow: hidden;
  position: relative;
}

.room-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  flex-shrink: 0;
}


button.icon-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(94, 231, 255, 0.45);
  cursor: pointer;
  flex-shrink: 0;
  font: inherit;
  line-height: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

button.icon-btn:hover {
  color: var(--cyan);
  background: rgba(94, 231, 255, 0.08);
}

button.icon-btn:focus-visible {
  outline: 2px solid rgba(94, 231, 255, 0.45);
  outline-offset: 2px;
}

button.icon-btn.is-spinning svg {
  animation: icon-spin 0.55s ease;
}

@keyframes icon-spin {
  to {
    transform: rotate(360deg);
  }
}


.room-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  flex-shrink: 0;
}

.room-row--closed {
  opacity: 0.55;
}

.room-row-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.room-row-main strong {
  font-size: 0.95rem;
}

.seat-ok {
  color: var(--cyan);
  font-size: 0.78rem;
}

.seat-full {
  color: #ff8a8a;
  font-size: 0.78rem;
}

.visibility-fieldset {
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  min-inline-size: 0;
}

.visibility-fieldset legend {
  padding: 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.visibility-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

label.visibility-option {
  display: block;
  margin: 0;
  cursor: pointer;
  color: inherit;
}

.visibility-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.visibility-option-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-height: 0;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.visibility-option-title {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: 0.01em;
}

.visibility-option-desc {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-dim);
}

.visibility-option:hover .visibility-option-card {
  border-color: rgba(94, 231, 255, 0.4);
  background: rgba(94, 231, 255, 0.08);
}

.visibility-option input:checked + .visibility-option-card {
  border-color: rgba(94, 231, 255, 0.75);
  background: rgba(94, 231, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(94, 231, 255, 0.12), 0 0 18px rgba(94, 231, 255, 0.18);
}

.visibility-option input:checked + .visibility-option-card .visibility-option-title {
  color: var(--cyan);
}

.visibility-option input:focus-visible + .visibility-option-card {
  outline: 2px solid rgba(94, 231, 255, 0.45);
  outline-offset: 2px;
}

.create-password-wrap {
  flex: 0 1 10.5rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 8.5rem;
  animation: create-pw-in 0.2s ease;
}

.create-password-wrap[hidden] {
  display: none !important;
}

.create-password-wrap label {
  margin: 0;
}

@keyframes create-pw-in {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 420px) {
  .visibility-options {
    grid-template-columns: 1fr;
  }
}


.room-meta {
  margin: 0.15rem 0 0;
}

.phase-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.phase-topbar .btn-leave-game {
  min-height: 2.25rem;
}

.lobby-players-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.45rem;
  flex-shrink: 0;
}

.lobby-players-foot .hint {
  margin: 0;
}

.btn-settings {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(94, 231, 255, 0.35);
  background: rgba(94, 231, 255, 0.12);
  color: var(--cyan);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.btn-settings:hover {
  background: rgba(94, 231, 255, 0.22);
  border-color: rgba(94, 231, 255, 0.45);
  color: #fff;
  transform: rotate(28deg);
}

.btn-settings--bar {
  width: 2.25rem;
  height: 2.25rem;
}

.settings-modal .settings-card {
  width: min(100%, 420px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(94, 231, 255, 0.35);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(94, 231, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(94, 231, 255, 0.08), transparent 50%),
    rgba(10, 14, 28, 0.96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}

.settings-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-close {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.settings-close:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.settings-section {
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-section-label {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.settings-section-label h3 {
  margin: 0 0 0.15rem;
  font-size: 1rem;
}

.settings-section-label p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.settings-icon-badge {
  width: 2.1rem;
  height: 2.1rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(94, 231, 255, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(94, 231, 255, 0.22);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(94, 231, 255, 0.12);
}

.settings-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.settings-row-text strong {
  font-size: 0.92rem;
}

.settings-toggle {
  position: relative;
  width: 3.1rem;
  height: 1.75rem;
  min-width: 3.1rem;
  min-height: 1.75rem;
  border-radius: 999px;
  border: none;
  padding: 0.18rem;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
  transition: background 0.18s ease;
}

/* Expand hit target without changing visual size much */
.settings-toggle::before {
  content: '';
  position: absolute;
  inset: -12px -10px;
}

.settings-toggle[aria-pressed='true'] {
  background: linear-gradient(135deg, var(--cyan), var(--discord));
}

.settings-toggle-knob {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transform: translateX(0);
  transition: transform 0.18s ease;
}

.settings-toggle[aria-pressed='true'] .settings-toggle-knob {
  transform: translateX(1.4rem);
}

.settings-volume {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-volume-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.settings-volume-top #settings-volume-value {
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.settings-volume-slider {
  width: 100%;
  height: 6px;
  padding: 0;
  margin: 0;
  accent-color: var(--discord);
  cursor: pointer;
  background: transparent;
  border: none;
}

.settings-volume-slider:focus {
  outline: none;
}

.settings-foot {
  padding: 0 1.35rem 1.25rem;
  display: flex;
  justify-content: flex-end;
}

.settings-foot .btn {
  min-width: 7rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 4, 12, 0.72);
  backdrop-filter: blur(6px);
}

.modal[hidden] {
  display: none !important;
}

.modal-card {
  width: min(100%, 380px);
  animation: modal-in 0.22s ease;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* —— Night-begin countdown (host started the game) —— */
.night-intro {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.55rem;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 70% 55% at 50% 35%, rgba(94, 231, 255, 0.16), transparent 58%),
    radial-gradient(ellipse 90% 80% at 50% 100%, rgba(2, 5, 10, 0.95), transparent 55%),
    rgba(2, 5, 10, 0.92);
  backdrop-filter: blur(10px);
  animation: night-intro-fade-in 0.35s ease;
}

.night-intro[hidden] {
  display: none !important;
}

.night-intro.is-leaving {
  animation: night-intro-fade-out 0.45s ease forwards;
  pointer-events: none;
}

.night-intro-glow {
  position: absolute;
  inset: 18% 10% auto;
  height: 42%;
  background: radial-gradient(circle, rgba(94, 231, 255, 0.2), transparent 68%);
  filter: blur(28px);
  pointer-events: none;
}

.night-intro-moon {
  position: absolute;
  top: 14%;
  width: min(28vw, 140px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #f4fbff 0%, #cfefff 38%, #5ee7ff 72%, transparent 78%);
  box-shadow:
    0 0 40px rgba(94, 231, 255, 0.55),
    0 0 90px rgba(94, 231, 255, 0.28);
  opacity: 0.85;
  animation: night-intro-moon 2.8s ease-in-out infinite;
  pointer-events: none;
}

.night-intro-eyebrow {
  position: relative;
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(158, 236, 255, 0.78);
}

.night-intro-count {
  position: relative;
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(5.5rem, 22vw, 9rem);
  line-height: 0.9;
  color: var(--moon);
  text-shadow:
    0 0 24px rgba(94, 231, 255, 0.65),
    0 0 60px rgba(94, 231, 255, 0.35);
  animation: night-intro-tick 0.9s ease;
}

.night-intro-count.is-pop {
  animation: none;
}
.night-intro-count.is-pop {
  animation: night-intro-tick 0.9s ease;
}

.night-intro-title {
  position: relative;
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 9vw, 3.4rem);
  letter-spacing: 0.04em;
  color: var(--moon);
  text-shadow: 0 0 28px rgba(94, 231, 255, 0.5);
  animation: night-intro-title-in 0.5s ease;
}

.night-intro-sub {
  position: relative;
  margin: 0;
  max-width: 22rem;
  text-align: center;
  font-size: 0.98rem;
  color: rgba(200, 230, 245, 0.78);
}

.night-intro.is-title .night-intro-count {
  display: none;
}

@keyframes night-intro-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes night-intro-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes night-intro-tick {
  0% {
    opacity: 0;
    transform: scale(1.35);
  }
  25% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(0.94);
  }
}

@keyframes night-intro-title-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes night-intro-moon {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

/* —— Lobby —— */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}

.topbar--compact {
  align-items: center;
  margin-bottom: 0.75rem;
}

.lobby-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(300px, 420px);
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

@media (max-width: 1100px) {
  .lobby-grid {
    grid-template-columns: minmax(200px, 250px) minmax(0, 1fr) minmax(260px, 360px);
  }
}

/* Keep 3 columns longer; only stack chat when truly narrow */
@media (max-width: 820px) {
  .lobby-grid {
    grid-template-columns: minmax(180px, 240px) 1fr;
  }

  .lobby-chat {
    grid-column: 1 / -1;
    max-height: min(280px, 36dvh);
  }
}

@media (max-width: 720px) {
  .lobby-grid {
    grid-template-columns: 1fr;
  }
}

.lobby-players,
.lobby-setup,
.lobby-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  margin: 0;
}

.lobby-chat {
  min-width: 0;
}

.lobby-chat h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.lobby-chat .chat-log {
  flex: 1;
  min-height: 0;
}

.lobby-players h2,
.lobby-setup h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.lobby-setup-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  flex-shrink: 0;
}

.lobby-setup-head h2 {
  margin: 0;
}

.hint--tight {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
}

.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.player-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0.4rem 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-size: 0.9rem;
}

.player-list .player-list-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  line-height: 1.25;
}

.player-list .player-points {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cyan);
  opacity: 0.9;
}

.player-list .host-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ember);
  flex-shrink: 0;
}

.player-list .host-badge:not(:first-child) {
  margin-left: 0.35rem;
}

.player-list .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--moss);
}

.player-list .dot.off {
  background: #555;
}

.scenario-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 0.35rem;
}

.scenario-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.scenario-item.is-open {
  overflow: visible;
}

.scenario-item.is-active {
  border-color: rgba(94, 231, 255, 0.45);
  background: rgba(94, 231, 255, 0.14);
  box-shadow: 0 0 0 1px rgba(94, 231, 255, 0.2);
}

.scenario-item.is-warn:not(.is-active) {
  opacity: 0.72;
}

.scenario-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  font: inherit;
}

.scenario-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
}

.scenario-toggle-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.scenario-toggle-main strong {
  font-size: 0.92rem;
}

.scenario-toggle .diff {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.scenario-chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  flex-shrink: 0;
  margin-bottom: 0.2rem;
}

.scenario-item.is-open .scenario-chevron {
  transform: rotate(-135deg);
  margin-bottom: -0.15rem;
}

.scenario-body {
  padding: 0 0.7rem 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  overflow: visible;
}

.scenario-body[hidden] {
  display: none !important;
}

.mini-card-row,
.mini-card-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
  overflow: visible;
}

.mini-card-row--selected {
  padding: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
}

.mini-card {
  position: relative;
  width: 102px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(8, 12, 22, 0.9);
  color: var(--text);
  overflow: hidden;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--card-color) 35%, transparent);
  font: inherit;
  cursor: default;
}

.role-float-tip {
  position: fixed;
  z-index: 200;
  width: min(240px, calc(100vw - 1.5rem));
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(10, 14, 28, 0.97);
  border: 1px solid rgba(94, 231, 255, 0.45);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.6);
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1.35;
  text-align: left;
  pointer-events: none;
  transform: translateY(-4px);
  opacity: 0;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.role-float-tip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.role-float-tip[hidden] {
  display: none !important;
}

.role-float-tip strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #fff;
  font-size: 0.8rem;
}

button.mini-card {
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

button.mini-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(94, 231, 255, 0.45);
}

button.mini-card:disabled {
  cursor: default;
  opacity: 0.85;
}

.mini-card--selected {
  border-color: var(--cyan);
  box-shadow:
    0 0 0 1px rgba(94, 231, 255, 0.5),
    0 6px 16px rgba(94, 231, 255, 0.25);
}

.mini-card-art {
  display: block;
  aspect-ratio: 2.5 / 3.2;
  overflow: hidden;
  border-radius: 7px 7px 0 0;
  background: #0a101c;
}

.mini-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mini-card-name {
  display: block;
  padding: 0.28rem 0.3rem 0.35rem;
  min-height: 2.1em;
  font-size: 0.68rem;
  line-height: 1.2;
  text-align: center;
  color: var(--text-dim);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.mini-card-count {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 1.1rem;
  padding: 0.05rem 0.25rem;
  border-radius: 999px;
  background: rgba(94, 231, 255, 0.92);
  color: #061018;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.role-chip .swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.role-picker .role-chip {
  cursor: pointer;
  user-select: none;
}

.role-picker .role-chip.selected {
  border-color: var(--ember);
  box-shadow: 0 0 0 1px var(--ember);
}

.host-only {
  margin-top: 0.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.host-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.5rem;
  flex-shrink: 0;
}

.host-bar label.inline {
  margin-bottom: 0;
  gap: 0.55rem;
}

.host-bar select,
.host-bar .btn {
  height: 2.5rem;
  padding: 0 0.95rem;
  box-sizing: border-box;
  font-size: 0.9rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.host-bar select {
  min-width: 6.5rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) calc(50% - 2px),
    calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 1.75rem;
}

.host-only:not([hidden]) {
  display: flex;
}

.host-only[hidden] {
  display: none !important;
}

/* —— Scrollbars (CI) —— */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 231, 255, 0.55) rgba(8, 12, 22, 0.55);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: rgba(8, 12, 22, 0.55);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(61, 202, 232, 0.75), rgba(94, 231, 255, 0.55));
  border-radius: 999px;
  border: 2px solid rgba(8, 12, 22, 0.65);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(94, 231, 255, 0.7), rgba(94, 231, 255, 0.85));
  border: 2px solid rgba(8, 12, 22, 0.65);
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

/* —— Role cards —— */
.role-card {
  width: min(288px, 80vw);
  aspect-ratio: 2.5 / 3.5;
  border-radius: 16px;
  position: relative;
  perspective: 1000px;
  filter: drop-shadow(0 16px 36px rgba(0, 0, 0, 0.55));
}

.role-card--sm {
  width: min(196px, 52vw);
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  border-radius: 16px;
}

.role-card--flip .card-inner {
  animation: card-deal 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.role-card--reveal .card-inner {
  animation: card-reveal-pop 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes card-deal {
  0% { transform: rotateY(180deg) translateY(-28px) scale(0.85); opacity: 0; }
  55% { transform: rotateY(-12deg) translateY(4px) scale(1.02); opacity: 1; }
  100% { transform: none; opacity: 1; }
}

@keyframes card-reveal-pop {
  0% { transform: rotateY(90deg) scale(0.7); opacity: 0; filter: brightness(2); }
  60% { transform: rotateY(-8deg) scale(1.06); opacity: 1; }
  100% { transform: none; scale: 1; }
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  backface-visibility: hidden;
  box-shadow:
    inset 0 0 0 2px rgba(94, 231, 255, 0.35),
    0 0 24px rgba(94, 231, 255, 0.25);
}

.card-face--back {
  transform: rotateY(180deg);
}

.card-face--back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.role-card .card-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(94, 231, 255, 0.15), transparent 55%),
    linear-gradient(165deg, var(--card-color, #5a4a3a) 0%, #0a0e18 72%);
}

.role-card .card-art {
  position: absolute;
  inset: 0;
}

.role-card .card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: art-breathe 6s ease-in-out infinite;
}

@keyframes art-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.role-card .card-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.6rem 0.65rem 0.95rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.92) 45%);
  color: #fff;
  text-shadow: 0 0 12px rgba(94, 231, 255, 0.5);
  z-index: 2;
}

.role-card .card-order {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(5, 8, 18, 0.7);
  border: 1px solid rgba(94, 231, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cyan);
  z-index: 3;
  box-shadow: 0 0 12px rgba(94, 231, 255, 0.35);
}

.card-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.18) 48%,
    transparent 62%
  );
  transform: translateX(-120%);
  animation: shine-sweep 3.8s ease-in-out 0.6s infinite;
  pointer-events: none;
  z-index: 4;
}

@keyframes shine-sweep {
  0%, 55% { transform: translateX(-120%); }
  75%, 100% { transform: translateX(120%); }
}

.role-card-slot {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
  min-height: 200px;
}

.role-card-slot[hidden] {
  display: none !important;
  min-height: 0;
  margin: 0;
}

.night-layout--peek {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.night-layout--peek .play-board[hidden] {
  display: none !important;
}

.night-layout--peek .night-panel {
  width: min(420px, 100%);
  margin: 0 auto;
}

.night-layout--peek .night-panel .prompt {
  margin-bottom: 0.55rem;
  text-align: center;
}

.night-layout--peek .reveal-stage .role-card--sm,
.night-layout--peek .reveal-cards .role-card--sm {
  width: min(168px, 48vw);
}

.reveal-stage,
.reveal-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: flex-start;
  margin: 0.35rem 0 0.55rem;
}

.reveal-caption {
  flex: 0 0 100%;
  margin: 0.15rem 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.reveal-hint {
  text-align: center;
  margin: 0.35rem 0 0;
}

.linkish {
  background: none;
  border: none;
  color: var(--cyan);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.chip-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.night-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
  justify-content: center;
}

/* —— Night / Day —— */
.phase-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.phase-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 16px rgba(94, 231, 255, 0.45);
  margin: 0 0 0.5rem;
}

.announce {
  color: var(--ember-hot);
  font-size: 1.05rem;
  max-width: 36rem;
  margin: 0.5rem auto;
  line-height: 1.45;
}

.night-layout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.night-panel {
  width: min(520px, 100%);
}

.night-panel .prompt {
  margin: 0 0 1rem;
  color: var(--text);
}

.sleeping-msg {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-dim);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}

.target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.target-btn {
  background: rgba(94, 231, 255, 0.1);
  border: 1px solid rgba(94, 231, 255, 0.2);
  color: var(--text);
  padding: 0.85rem 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.target-btn--player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.target-av {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(94, 231, 255, 0.35);
}

.target-btn:hover {
  border-color: var(--cyan);
  background: rgba(94, 231, 255, 0.22);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(94, 231, 255, 0.3);
}

.target-btn.selected {
  border-color: var(--cyan);
  background: rgba(94, 231, 255, 0.18);
  box-shadow: 0 0 0 2px var(--cyan), 0 0 20px rgba(94, 231, 255, 0.35);
}

.target-btn.tap-pulse,
.center-card.tap-pulse {
  animation: tap-pulse 0.35s ease;
}

.target-btn.is-locked,
.center-card.is-locked {
  pointer-events: none;
  opacity: 0.7;
}

@keyframes tap-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

.center-cards {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.center-card,
.center-card--img {
  width: 92px;
  height: 128px;
  padding: 0;
  border-radius: 12px;
  border: 2px solid rgba(94, 231, 255, 0.25);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: #0a0e18;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  animation: center-float 3.5s ease-in-out infinite;
}

.center-card:nth-child(2) { animation-delay: 0.4s; }
.center-card:nth-child(3) { animation-delay: 0.8s; }

@keyframes center-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.center-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.center-card-glow {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 20px rgba(94, 231, 255, 0.35);
  pointer-events: none;
}

.center-card:hover,
.center-card.selected {
  transform: translateY(-8px) scale(1.04);
  border-color: var(--cyan);
  box-shadow: 0 12px 28px rgba(94, 231, 255, 0.35);
  animation: none;
}

.info-box {
  background: rgba(94, 231, 255, 0.18);
  border: 1px solid rgba(94, 231, 255, 0.45);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  font-size: 1.05rem;
  box-shadow: 0 0 24px rgba(94, 231, 255, 0.15);
}

.info-box strong {
  color: var(--cyan);
  font-size: 1.15rem;
}

.info-box.danger {
  background: rgba(168, 40, 40, 0.2);
  border-color: rgba(168, 40, 40, 0.45);
  box-shadow: none;
}

.day-header .timer {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--ember-hot);
  margin-top: 0.35rem;
  animation: timer-glow 2s ease-in-out infinite;
}

@keyframes timer-glow {
  0%, 100% { text-shadow: 0 0 10px transparent; }
  50% { text-shadow: 0 0 20px rgba(212, 120, 58, 0.4); }
}

.day-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(200px, 280px) 1fr;
  margin-top: 1.25rem;
}

@media (max-width: 720px) {
  .day-grid {
    grid-template-columns: 1fr;
  }
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-panel > h2 {
  flex-shrink: 0;
}

.chat-log {
  flex: 1 1 auto;
  min-height: 120px;
  height: auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
}

.chat-msg {
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.lobby-chat .chat-msg,
.day-side .chat-msg {
  overflow-wrap: break-word;
  word-break: normal;
}

.chat-msg strong,
.chat-name {
  color: var(--ember-hot);
}

.chat-name-btn {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ember-hot);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.chat-name-btn:hover,
.chat-name-btn:focus-visible {
  text-decoration: underline;
  outline: none;
}

.chat-time {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.65rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: rgba(160, 190, 210, 0.55);
  white-space: nowrap;
  vertical-align: baseline;
}

.chat-msg--announce {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: rgba(94, 231, 255, 0.06);
  border: 1px solid rgba(94, 231, 255, 0.16);
}

.chat-announce-text {
  color: rgba(220, 235, 245, 0.92);
}

.chat-join-btn {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(94, 231, 255, 0.45);
  background: rgba(94, 231, 255, 0.14);
  color: #9eecff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.chat-join-btn:hover,
.chat-join-btn:focus-visible {
  background: rgba(94, 231, 255, 0.24);
  outline: none;
}

.chat-form {
  flex-shrink: 0;
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
}

.chat-form input {
  flex: 1;
}

.my-role-reminder {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.my-role-reminder strong {
  color: var(--moon);
}

/* —— Voting —— */
.vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  max-width: 700px;
  margin: 0 auto 1rem;
}

.vote-btn {
  background: linear-gradient(160deg, rgba(168, 40, 40, 0.25), rgba(18, 20, 28, 0.8));
  border: 1px solid rgba(168, 40, 40, 0.4);
  color: var(--text);
  padding: 1.1rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s;
}

.vote-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(168, 40, 40, 0.3);
}

.vote-btn.voted {
  border-color: var(--ember);
  box-shadow: 0 0 0 2px var(--ember);
}

/* —— Reveal —— */
.winner-banner {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ember-hot);
  margin: 0.5rem 0 0;
}

.reveal-dead {
  text-align: center;
  margin-bottom: 1.25rem;
  color: var(--blood);
  font-weight: 600;
}

.reveal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.reveal-card {
  text-align: center;
  padding: 1rem 0.75rem;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--panel-border);
}

.reveal-card.dead {
  border-color: var(--blood);
  box-shadow: 0 0 20px rgba(168, 40, 40, 0.25);
}

.reveal-card.won {
  border-color: var(--moss);
}

.reveal-mini {
  display: flex;
  justify-content: center;
  margin-bottom: 0.65rem;
}

.reveal-mini .role-card {
  width: 132px;
}

.reveal-card .name {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.reveal-card .role-name {
  font-family: var(--font-display);
  color: var(--moon);
  font-size: 0.95rem;
}

.reveal-card .meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

.reveal-showcase {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 0.25rem 0.35rem 0.75rem;
}

.reveal-players {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem 1rem;
}

.reveal-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  width: min(148px, 42vw);
  padding: 0.65rem 0.55rem 0.75rem;
  border-radius: 14px;
  border: 1px solid rgba(94, 231, 255, 0.28);
  background: rgba(8, 12, 24, 0.72);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.reveal-seat.is-you {
  border-color: rgba(94, 231, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(94, 231, 255, 0.2), 0 10px 28px rgba(0, 0, 0, 0.35);
}

.reveal-seat.is-dead {
  border-color: rgba(224, 62, 74, 0.55);
}

.reveal-seat.is-won {
  border-color: rgba(59, 165, 93, 0.55);
}

.reveal-seat-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
}

.reveal-seat-av {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.reveal-seat.is-you .reveal-seat-av {
  border-color: var(--cyan);
}

.reveal-seat.is-dead .reveal-seat-av {
  filter: grayscale(0.75) brightness(0.75);
  border-color: rgba(224, 62, 74, 0.65);
}

.reveal-seat-av--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(94, 231, 255, 0.2);
  color: var(--cyan);
  font-weight: 700;
}

.reveal-seat-name {
  font-size: 0.82rem;
  font-weight: 650;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reveal-seat-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
}

.reveal-seat-tag--dead {
  color: #ffb4b8;
  background: rgba(224, 62, 74, 0.22);
}

.reveal-seat-points {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cyan);
}

.reveal-seat-tag--won {
  color: #b8f0c8;
  background: rgba(59, 165, 93, 0.22);
}

.reveal-seat-card {
  display: flex;
  justify-content: center;
}

.reveal-seat-card .role-card {
  width: min(118px, 34vw);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}

.reveal-seat-card .role-card .card-name {
  font-size: 0.72rem;
  padding: 1.1rem 0.35rem 0.55rem;
}

.reveal-center-block {
  text-align: center;
  padding: 0.85rem 0.75rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(94, 231, 255, 0.28);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(94, 231, 255, 0.08), transparent 55%),
    rgba(8, 12, 24, 0.65);
}

.reveal-center-label {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
}

.reveal-center-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.reveal-center-slot .role-card {
  width: min(110px, 28vw);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}

.reveal-center-slot .role-card .card-name {
  font-size: 0.68rem;
  padding: 1rem 0.3rem 0.5rem;
}

@media (max-width: 520px) {
  .reveal-seat {
    width: min(132px, 44vw);
  }

  .reveal-seat-card .role-card {
    width: min(102px, 38vw);
  }

  .reveal-center-slot .role-card {
    width: min(96px, 30vw);
  }
}

#reveal-host {
  justify-content: center;
}

/* —— Discord Auth & Social —— */
.login-panel {
  max-width: 380px;
  margin: 0 auto;
  text-align: center;
}

.login-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.login-legal a {
  color: rgba(94, 231, 255, 0.65);
  text-decoration: none;
}

.login-legal a:hover {
  color: var(--cyan);
  text-decoration: underline;
}

/* —— Legal pages (Privacy / Terms) —— */
.legal-page {
  min-height: 100vh;
}

.legal-wrap {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.legal-card {
  padding: 1.75rem 1.6rem 2rem;
}

.legal-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.legal-card h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--cyan);
}

.legal-card h2 {
  margin: 1.6rem 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cyan);
}

.legal-card p,
.legal-card li {
  color: var(--text);
  line-height: 1.55;
  font-size: 0.95rem;
}

.legal-card ul {
  margin: 0.4rem 0 0.8rem;
  padding-left: 1.2rem;
}

.legal-card li + li {
  margin-top: 0.35rem;
}

.legal-card a {
  color: var(--cyan);
}

.legal-card code {
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(200, 215, 255, 0.9);
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(94, 231, 255, 0.25);
  font-size: 0.9rem;
}

.legal-nav a {
  text-decoration: none;
}

.legal-nav a:hover {
  text-decoration: underline;
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  background: #5865f2;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.85rem 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(88, 101, 242, 0.35);
  transition: background 0.15s, transform 0.15s;
}

.btn-discord:hover {
  background: #4752c4;
}

.btn-discord.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.btn-sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
}

.hero-compact {
  padding: 2rem 0 1.5rem;
}

.player-av,
.chat-av {
  border-radius: 50%;
  object-fit: cover;
  background: #1a2030;
}

.topbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.social-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(4, 8, 16, 0.65);
  display: flex;
  justify-content: flex-end;
  animation: fade-in 0.25s ease;
}

.social-drawer[hidden] {
  display: none;
}

.social-drawer-inner {
  width: min(400px, 100%);
  height: 100%;
  border-radius: 0;
  overflow-y: auto;
  animation: slide-in 0.3s ease;
}

@keyframes slide-in {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.social-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.social-drawer-head h2 {
  margin: 0;
}

.social-drawer-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.social-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1rem 0;
  min-height: 80px;
}

.social-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

.social-row img {
  border-radius: 50%;
  flex-shrink: 0;
}

.social-row strong {
  display: block;
  font-size: 0.95rem;
}

.guide-modal .guide-card {
  width: min(100%, 640px);
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.15rem 1.25rem;
}

.guide-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  flex-shrink: 0;
}

.guide-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(94, 231, 255, 0.75);
}

.guide-modal-head h2 {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
}

.guide-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.35rem;
  overflow-y: auto;
  min-height: 0;
  padding-right: 0.15rem;
}

.leaderboard-modal .leaderboard-card {
  width: min(100%, 560px);
  max-height: min(90vh, 880px);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.15rem 1.2rem;
}

.leaderboard-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
  flex-shrink: 0;
}

.leaderboard-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(94, 231, 255, 0.75);
}

.leaderboard-modal-head h2 {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
}

.leaderboard-head-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.leaderboard-hint {
  margin: 0 0 0.75rem;
  flex-shrink: 0;
}

.leaderboard-list {
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.leaderboard-rest-label {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(160, 190, 210, 0.65);
  flex-shrink: 0;
}

.lb-group {
  display: grid;
  grid-template-columns: 3.6rem minmax(0, 1fr);
  gap: 0.55rem 0.65rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.lb-group--tied {
  border-color: rgba(94, 231, 255, 0.14);
  background: rgba(94, 231, 255, 0.04);
}

.lb-group-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding-top: 0.15rem;
}

.lb-group-side .leaderboard-rank {
  margin: 0;
}

.lb-group-pts {
  font-size: 0.68rem;
  color: rgba(170, 200, 220, 0.72);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.lb-group-tied {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(94, 231, 255, 0.7);
  text-align: center;
}

.lb-group-players {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.lb-group-player {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.lb-group-player.is-you strong {
  color: var(--cyan);
}

.lb-group-player img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #0a101c;
}

.lb-podium-avs {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-podium-slot--multi .lb-podium-avs {
  padding-left: 0.55rem;
}

.lb-podium-slot--multi .lb-podium-av-wrap {
  margin-left: -0.55rem;
}

.lb-podium-slot--multi .lb-podium-av {
  width: 2.85rem;
  height: 2.85rem;
}

.lb-podium-slot--1.lb-podium-slot--multi .lb-podium-av {
  width: 3.15rem;
  height: 3.15rem;
}

.lb-podium-more {
  margin-left: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(94, 231, 255, 0.85);
}

/* Podium — positions match bot boards.py PODIUM_SLOTS (1280×720 art) */
.lb-podium {
  position: relative;
  width: 100%;
  aspect-ratio: 1280 / 720;
  border-radius: 12px;
  overflow: hidden;
  margin: 0 0 0.85rem;
  flex-shrink: 0;
  border: 1px solid rgba(94, 231, 255, 0.16);
  background: #0a101c;
}

.lb-podium[hidden] {
  display: none !important;
}

.lb-podium-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lb-podium-slot {
  /* Anchor at stone TOP surface — stack sits fully above so carved numbers stay visible */
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
  width: max-content;
  max-width: 32%;
  z-index: 1;
  pointer-events: none;
}

/* Anchor at stone top rim — 2/3 sit higher so they clear the carved numerals */
.lb-podium-slot--1 {
  left: 50%;
  top: 41%;
  z-index: 2;
}

.lb-podium-slot--2 {
  left: 29.84%;
  top: 46%;
}

.lb-podium-slot--3 {
  left: 70.16%;
  top: 50%;
}

.lb-podium-slot--empty {
  display: none;
}

.lb-podium-plate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.28rem 0.55rem;
  border-radius: 8px;
  background: rgba(6, 10, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
  max-width: 100%;
}

.lb-podium-slot--1 .lb-podium-plate {
  border-color: rgba(255, 200, 80, 0.45);
  box-shadow: 0 0 16px rgba(255, 200, 80, 0.18);
}

.lb-podium-slot--2 .lb-podium-plate {
  border-color: rgba(190, 205, 230, 0.4);
}

.lb-podium-slot--3 .lb-podium-plate {
  border-color: rgba(210, 150, 95, 0.45);
}

.lb-podium-name {
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--moon);
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-podium-slot--1 .lb-podium-name {
  color: #ffec96;
  font-size: 0.85rem;
}

.lb-podium-pts {
  font-size: 0.68rem;
  color: rgba(190, 215, 235, 0.8);
  font-variant-numeric: tabular-nums;
}

.lb-podium-av-wrap {
  position: relative;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.35), rgba(40, 60, 90, 0.2));
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.lb-podium-slot--1 .lb-podium-av-wrap {
  padding: 3px;
  background: linear-gradient(145deg, #ffc850, rgba(120, 80, 20, 0.35));
  box-shadow: 0 0 0 2px rgba(8, 12, 22, 0.85), 0 8px 20px rgba(255, 200, 80, 0.25);
}

.lb-podium-slot--2 .lb-podium-av-wrap {
  background: linear-gradient(145deg, #c5d0e0, rgba(80, 90, 110, 0.35));
}

.lb-podium-slot--3 .lb-podium-av-wrap {
  background: linear-gradient(145deg, #d2965f, rgba(90, 55, 30, 0.35));
}

.lb-podium-av {
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #0a101c;
}

.lb-podium-slot--1 .lb-podium-av {
  width: 3.85rem;
  height: 3.85rem;
}

.lb-podium-av--empty {
  background: radial-gradient(circle at 35% 30%, rgba(94, 231, 255, 0.2), #0a101c 60%);
}

.lb-podium-slot.is-you .lb-podium-plate {
  box-shadow: 0 0 0 1px rgba(94, 231, 255, 0.45);
}

@media (max-width: 520px) {
  .lb-podium-name {
    max-width: 5.5rem;
    font-size: 0.68rem;
  }

  .lb-podium-av {
    width: 2.6rem;
    height: 2.6rem;
  }

  .lb-podium-slot--1 .lb-podium-av {
    width: 3rem;
    height: 3rem;
  }

  .lb-podium-plate {
    padding: 0.2rem 0.35rem;
  }
}

.guide-section h3 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.guide-steps {
  margin: 0 0 0.85rem;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: rgba(230, 236, 255, 0.88);
  font-size: 0.88rem;
  line-height: 1.4;
}

.guide-teams {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.84rem;
  line-height: 1.4;
  color: rgba(210, 220, 245, 0.78);
}

.guide-team {
  display: inline-block;
  font-weight: 700;
  margin-right: 0.25rem;
}

.guide-team--village { color: #c4a574; }
.guide-team--wolf { color: #e07070; }
.guide-team--tanner { color: #8fb87a; }

.guide-roles {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.65rem;
}

.guide-role {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.guide-role .mini-card {
  flex-shrink: 0;
  width: 64px;
  pointer-events: none;
}

.guide-role-body {
  min-width: 0;
  flex: 1;
}

.guide-role-body p {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: rgba(210, 220, 245, 0.78);
}

.guide-role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
}

.guide-role-head strong {
  font-size: 0.92rem;
}

.guide-role-team {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.9;
}

.guide-role-team--village { color: #c4a574; }
.guide-role-team--werewolf { color: #e07070; }
.guide-role-team--tanner { color: #8fb87a; }

.guide-wake {
  font-size: 0.72rem;
  color: rgba(170, 190, 255, 0.75);
}

.guide-wake--day {
  color: rgba(180, 180, 190, 0.55);
}

.leaderboard-row {
  gap: 0.65rem;
}

.leaderboard-row.is-you {
  border: 1px solid rgba(94, 231, 255, 0.4);
  background: rgba(94, 231, 255, 0.1);
}

.leaderboard-rank {
  flex-shrink: 0;
  width: 1.6rem;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(220, 230, 255, 0.55);
  font-size: 0.95rem;
}

.leaderboard-rank.rank-gold {
  color: #e8c547;
}

.leaderboard-rank.rank-silver {
  color: #c5d0e0;
}

.leaderboard-rank.rank-bronze {
  color: #c48a5a;
}

.leaderboard-meta {
  min-width: 0;
  flex: 1;
}

.leaderboard-meta strong .hint {
  font-weight: 500;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.user-profile-modal .user-profile-card {
  position: relative;
  width: min(100%, 400px);
  padding: 0;
  overflow: hidden;
}

.user-profile-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 3;
}

.user-profile-body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 12rem;
}

.user-profile-status {
  margin: 1.5rem 1.25rem;
  text-align: center;
}

.user-profile-hero {
  height: 7.25rem;
  background:
    radial-gradient(ellipse 80% 90% at 50% 110%, rgba(94, 231, 255, 0.28), transparent 55%),
    radial-gradient(ellipse 55% 70% at 18% 20%, rgba(61, 202, 232, 0.16), transparent 60%),
    linear-gradient(165deg, rgba(22, 36, 58, 0.95), rgba(8, 12, 22, 0.55) 70%),
    url('/img/background-night.png') center 40% / cover no-repeat;
  border-bottom: 1px solid rgba(94, 231, 255, 0.16);
}

.user-profile-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 1.25rem 0.85rem;
  margin-top: -2.85rem;
  position: relative;
  z-index: 1;
}

.user-profile-av-wrap {
  width: 5.75rem;
  height: 5.75rem;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(145deg, rgba(94, 231, 255, 0.85), rgba(40, 90, 130, 0.35) 55%, rgba(94, 231, 255, 0.45));
  box-shadow:
    0 0 0 4px rgba(8, 12, 22, 0.92),
    0 12px 28px rgba(0, 0, 0, 0.45),
    0 0 32px rgba(94, 231, 255, 0.22);
  margin-bottom: 0.7rem;
}

.user-profile-av {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #0a101c;
}

.user-profile-av--empty {
  background:
    radial-gradient(circle at 35% 30%, rgba(94, 231, 255, 0.25), transparent 55%),
    #0a101c;
}

.user-profile-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(94, 231, 255, 0.72);
}

.user-profile-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.15;
  color: var(--moon);
}

.user-profile-tag {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: rgba(170, 200, 220, 0.7);
}

.user-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0 1.1rem 0.85rem;
}

.user-profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.55rem 0.35rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
  min-width: 0;
}

.user-profile-stat-label {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(160, 190, 210, 0.65);
}

.user-profile-stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--cyan);
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile-progress {
  padding: 0 1.25rem 0.85rem;
}

.user-profile-progress-track {
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.user-profile-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan-dim), var(--cyan));
  box-shadow: 0 0 12px rgba(94, 231, 255, 0.35);
}

.user-profile-progress-label {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(170, 200, 220, 0.72);
  text-align: center;
}

.user-profile-progress-label--solo {
  padding: 0 1.25rem 0.75rem;
  color: rgba(94, 231, 255, 0.85);
}

.user-profile-ach {
  padding: 0.15rem 1.1rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.user-profile-ach-label {
  margin: 0.65rem 0 0.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(160, 190, 210, 0.65);
}

.user-profile-ach-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.user-profile-ach-chip {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(94, 231, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(94, 231, 255, 0.1);
  background: #0a101c;
}

.user-profile-ach-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-profile-ach-more {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(94, 231, 255, 0.8);
  padding: 0 0.25rem;
}

.user-profile-ach-empty {
  margin: 0;
  font-size: 0.82rem;
}

.achievements-modal .achievements-card {
  width: min(100%, 720px);
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.15rem 1.25rem;
}

.achievements-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.achievements-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(94, 231, 255, 0.75);
}

.achievements-head h2 {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
}

.achievements-head-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.achievements-hint {
  margin: 0 0 0.85rem;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.6rem, 1fr));
  gap: 0.75rem;
  overflow-y: auto;
  padding: 0.15rem 0.15rem 0.35rem;
  min-height: 0;
}

.ach-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(8, 12, 22, 0.92);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(94, 231, 255, 0.12);
}

.ach-card.is-unlocked {
  border-color: rgba(94, 231, 255, 0.35);
  box-shadow:
    0 0 0 1px rgba(94, 231, 255, 0.28),
    0 8px 18px rgba(94, 231, 255, 0.12);
}

.ach-card-art {
  aspect-ratio: 1;
  overflow: hidden;
  background: #0a101c;
}

.ach-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ach-card.is-locked .ach-card-art img {
  filter: grayscale(1) brightness(0.55) contrast(0.9);
  opacity: 0.72;
}

.ach-card-name {
  display: block;
  padding: 0.4rem 0.4rem 0.15rem;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.25;
  color: rgba(232, 247, 255, 0.95);
}

.ach-card.is-locked .ach-card-name {
  color: rgba(160, 180, 205, 0.55);
}

.ach-card-desc {
  display: block;
  padding: 0 0.4rem 0.55rem;
  font-size: 0.68rem;
  line-height: 1.35;
  color: rgba(170, 195, 220, 0.72);
}

.ach-card.is-locked .ach-card-desc {
  color: rgba(140, 160, 185, 0.42);
}

.social-badges {
  display: block;
  font-size: 0.72rem;
  color: var(--ember-hot);
  margin-top: 0.15rem;
}

.social-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.invite-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.invite-dm-note {
  margin: 0 0 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(232, 197, 71, 0.35);
  background: rgba(232, 197, 71, 0.1);
  color: rgba(255, 236, 180, 0.95);
  font-size: 0.88rem;
  line-height: 1.4;
}

.invite-link-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.invite-link-input {
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(8, 14, 24, 0.7);
  color: var(--text);
}

.invite-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.invite-box textarea {
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(8, 14, 24, 0.7);
  color: var(--text);
  resize: vertical;
  margin: 0.25rem 0;
}

.vote-btn img {
  display: block;
  margin: 0 auto 0.4rem;
  border-radius: 50%;
}

.chat-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.player-list li .player-av {
  flex-shrink: 0;
}

/* —— Play table (avatar ring + felt) —— */
.screen-play .phase-header--compact {
  margin-bottom: 0.45rem;
}

.screen-play .phase-header--compact h1 {
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  margin-bottom: 0.25rem;
}

.lede--compact {
  margin: 0 auto 0.55rem;
  text-align: center;
  font-size: 0.88rem;
  max-width: 36rem;
  color: var(--text-dim);
}

.play-phase {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0.65rem;
}

.day-play {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 1fr);
  gap: 0.85rem;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

@media (max-width: 820px) {
  .day-play {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

.day-side {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
}

.day-side .chat-panel {
  flex: 1;
  min-height: 0;
}

.day-side > .host-only,
.day-side > .my-role-reminder {
  flex-shrink: 0;
}

.play-board {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
}

.play-side {
  flex-shrink: 0;
}

.night-panel.play-side {
  width: min(520px, 94%);
  margin: 0 auto;
  padding: 0.4rem 0.75rem 0.5rem;
  background: rgba(6, 10, 20, 0.72);
  border: 1px solid rgba(94, 231, 255, 0.14);
  flex-shrink: 0;
}

.night-panel .prompt {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  line-height: 1.35;
  text-align: center;
}

.night-panel .hint {
  margin: 0.2rem 0 0.35rem;
  font-size: 0.78rem;
  text-align: center;
}

.night-panel .info-box {
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}

.night-panel .sleeping-msg {
  padding: 0.35rem 0.25rem 0.15rem;
  font-size: 0.85rem;
}

.night-actions-bar {
  margin-top: 0.35rem;
  gap: 0.45rem;
}

.night-own-card {
  display: flex;
  justify-content: center;
  margin: 0.15rem 0 0.3rem;
}

.night-own-card .role-card--sm {
  width: min(92px, 24vw);
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.4));
}

.night-own-card .role-card .card-name {
  font-size: 0.62rem;
  padding: 0.85rem 0.25rem 0.4rem;
}

.night-layout.play-phase {
  overflow: hidden;
  gap: 0.35rem;
}

.night-layout .play-board {
  min-height: min(58dvh, 640px);
  flex: 1 1 auto;
  max-height: none;
}

.day-play .play-board,
.vote-play .play-board {
  min-height: min(58dvh, 640px);
}

.screen-night .phase-header--compact {
  margin-bottom: 0.25rem;
}

.screen-night .phase-header--compact h1 {
  font-size: clamp(1.15rem, 3vw, 1.45rem);
}

.screen-night .announce {
  font-size: 0.88rem;
  margin: 0.2rem auto;
}

.night-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  margin: 0.15rem auto 0.35rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(94, 231, 255, 0.4);
  background: rgba(94, 231, 255, 0.18);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  box-shadow: 0 0 18px rgba(94, 231, 255, 0.2);
}

.night-timer.is-urgent {
  border-color: rgba(224, 62, 74, 0.65);
  color: #ffb4b8;
  background: rgba(224, 62, 74, 0.18);
  box-shadow: 0 0 18px rgba(224, 62, 74, 0.25);
}

.night-timer[hidden] {
  display: none !important;
}

.vote-status-bar,
.reveal-host-bar {
  text-align: center;
  flex-shrink: 0;
}

.play-table {
  position: relative;
  width: min(920px, 96vw);
  aspect-ratio: 1.08 / 1;
  max-height: min(78dvh, 820px);
  margin: 0 auto;
  filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.55));
}

@media (min-width: 1280px) {
  .play-table {
    width: min(1020px, 92vw);
    max-height: min(82dvh, 900px);
  }
}

.play-table-glow {
  position: absolute;
  left: 10%;
  top: 12%;
  width: 80%;
  height: 78%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(94, 231, 255, 0.16), transparent 55%),
    radial-gradient(ellipse at 50% 60%, rgba(94, 231, 255, 0.28), transparent 70%);
  filter: blur(22px);
  z-index: 0;
  pointer-events: none;
}

.play-table-felt {
  position: absolute;
  left: 10%;
  top: 11%;
  width: 80%;
  height: 78%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: auto;
  isolation: isolate;
}

/* Obsidian / cold ash rim — night CI, not casino wood */
.play-table-rim {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 28% 18%, rgba(94, 231, 255, 0.14), transparent 42%),
    radial-gradient(ellipse at 72% 82%, rgba(94, 231, 255, 0.18), transparent 48%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.25), transparent 70%),
    conic-gradient(
      from 12deg,
      #1a1528 0deg,
      #2c2540 35deg,
      #12101c 80deg,
      #3a3358 125deg,
      #0e0c16 175deg,
      #252038 230deg,
      #161222 290deg,
      #332c4a 330deg,
      #1a1528 360deg
    );
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(94, 231, 255, 0.12),
    inset 0 1px 0 rgba(220, 233, 255, 0.16),
    inset 0 -10px 22px rgba(0, 0, 0, 0.55);
  z-index: 0;
}

.play-table-rim::after {
  content: '';
  position: absolute;
  inset: 3.2%;
  border-radius: 50%;
  border: 1px solid rgba(94, 231, 255, 0.14);
  box-shadow: inset 0 0 12px rgba(94, 231, 255, 0.2);
  pointer-events: none;
}

/* Midnight felt — moonlit indigo, matches sky / Discord CI */
.play-table-cloth {
  position: absolute;
  inset: 5.5%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(220, 233, 255, 0.1), transparent 42%),
    radial-gradient(ellipse at 72% 28%, rgba(94, 231, 255, 0.08), transparent 38%),
    radial-gradient(ellipse at 30% 70%, rgba(94, 231, 255, 0.16), transparent 48%),
    radial-gradient(ellipse at 55% 78%, rgba(0, 0, 0, 0.45), transparent 52%),
    radial-gradient(ellipse at 50% 50%, #1a2448 0%, #121a32 38%, #0b1020 72%, #05070f 100%);
  box-shadow:
    inset 0 0 0 1px rgba(94, 231, 255, 0.1),
    inset 0 0 56px rgba(2, 4, 12, 0.72),
    inset 0 2px 0 rgba(220, 233, 255, 0.06);
  z-index: 1;
  overflow: hidden;
}

.play-table-cloth::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0.35;
  background-image:
    radial-gradient(circle at 50% 46%, transparent 0 16%, rgba(94, 231, 255, 0.05) 17%, transparent 22%),
    radial-gradient(circle at 50% 46%, transparent 0 9%, rgba(220, 233, 255, 0.06) 10%, transparent 14%),
    repeating-linear-gradient(
      -22deg,
      transparent 0,
      transparent 3px,
      rgba(94, 231, 255, 0.02) 3px,
      rgba(94, 231, 255, 0.02) 4px
    ),
    repeating-linear-gradient(
      68deg,
      transparent 0,
      transparent 4px,
      rgba(0, 0, 0, 0.06) 4px,
      rgba(0, 0, 0, 0.06) 5px
    );
  pointer-events: none;
}

.play-table-cloth::after {
  content: '';
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  border: 1px dashed rgba(94, 231, 255, 0.16);
  box-shadow: 0 0 20px rgba(94, 231, 255, 0.08);
  pointer-events: none;
}

.play-table-centers {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.75rem;
  transform: translateY(1%);
  position: relative;
  z-index: 4;
}

/* No idle float/breathe on the play table — motion must not leak night activity */
.play-table .center-card,
.play-table .play-center-card {
  animation: none !important;
}

.play-seat-card .role-card .card-art img,
.play-center-card .role-card .card-art img,
.play-seat-card .card-shine,
.play-center-card .card-shine {
  animation: none !important;
}

.play-center-card,
.play-table-felt .center-card {
  width: 96px;
  height: 136px;
  border-radius: 11px;
  padding: 0;
  border: 2px solid rgba(94, 231, 255, 0.32);
  background: #0a0e18;
  overflow: hidden;
  cursor: default;
  position: relative;
  animation: none;
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.55),
    0 0 16px rgba(94, 231, 255, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.play-center-card.is-selectable,
.play-table-felt .center-card.is-selectable {
  cursor: pointer;
}

.play-center-card.is-selectable:hover,
.play-center-card.is-selected,
.play-table-felt .center-card.is-selectable:hover,
.play-table-felt .center-card.is-selected {
  transform: translateY(-8px) scale(1.05);
  border-color: var(--cyan);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.55),
    0 0 20px rgba(94, 231, 255, 0.35);
}

.play-center-card > img,
.play-table-felt .center-card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Face-up role card must fit the slot (not crop/zoom a large card) */
.play-center-card .role-card {
  width: 100%;
  height: 100%;
  filter: none;
  border-radius: 7px;
}

.play-center-card .role-card .card-inner,
.play-center-card .role-card .card-face {
  border-radius: inherit;
}

.play-center-card .role-card .card-name {
  font-size: 0.55rem;
  padding: 0.75rem 0.15rem 0.35rem;
  letter-spacing: 0.02em;
}

.play-center-card .role-card .card-art img {
  animation: none;
  object-fit: cover;
  object-position: center 28%;
}

.play-center-slot {
  width: 96px;
}

.play-center-slot .role-card {
  width: 96px;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.5));
}

.play-center-slot .role-card .card-name {
  font-size: 0.58rem;
  padding: 0.85rem 0.2rem 0.45rem;
  letter-spacing: 0.02em;
}

.play-table-ring {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* Seat unit: card on felt, avatar+name always under the card */
.play-seat {
  position: absolute;
  transform: translate(-50%, -42%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: auto;
  max-width: 9rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  pointer-events: auto;
  cursor: default;
  z-index: 6;
}

.play-seat.is-selectable {
  cursor: pointer;
}

.play-seat-card {
  position: relative;
  width: 96px;
  height: 136px;
  flex-shrink: 0;
  border-radius: 11px;
  overflow: hidden;
  border: 2px solid rgba(94, 231, 255, 0.34);
  background: #0a0e18;
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.52),
    0 0 16px rgba(94, 231, 255, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.35);
  transform-style: preserve-3d;
  transition: transform 0.2s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.play-seat-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.94);
}

.play-seat-card--face {
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  width: 96px;
  height: 136px;
  min-height: 136px;
}

.play-seat-card--face .role-card {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: inherit;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.55));
}

.play-seat-card--face .role-card .card-inner,
.play-seat-card--face .role-card .card-face {
  border-radius: inherit;
}

.play-seat-card--face .role-card .card-name {
  font-size: 0.55rem;
  padding: 0.75rem 0.15rem 0.35rem;
}

.play-seat-card--own {
  border: 2px solid rgba(94, 231, 255, 0.55);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.5),
    0 0 22px rgba(94, 231, 255, 0.32);
  overflow: hidden;
  width: 96px;
  height: 136px;
  min-height: 136px;
}

.play-seat-id {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.4rem 0.2rem 0.2rem;
  border-radius: 999px;
  background: rgba(4, 8, 18, 0.88);
  border: 1px solid rgba(94, 231, 255, 0.18);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.play-seat-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(94, 231, 255, 0.4);
  background: rgba(10, 14, 28, 0.95);
  box-shadow: 0 0 0 2px rgba(8, 12, 28, 0.75);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.play-seat-av--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--cyan);
}

.play-seat-marker {
  width: 12px;
  height: 12px;
  margin: 0 0.15rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 40% 35%, #7aefff, #2aa8c4 55%, #146878 100%);
  box-shadow:
    0 0 0 2px rgba(8, 18, 28, 0.8),
    0 0 12px rgba(94, 231, 255, 0.45);
}

.play-seat-name {
  max-width: 6.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0;
  border: none;
  background: transparent;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.play-seat.is-you .play-seat-av {
  border-color: var(--cyan);
}

.play-seat--self {
  pointer-events: none;
}

.play-seat--self .play-seat-card {
  border-color: rgba(94, 231, 255, 0.5);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(94, 231, 255, 0.28);
}

.play-seat--self .play-seat-id {
  border-color: rgba(94, 231, 255, 0.4);
  background: rgba(8, 24, 40, 0.88);
}

.play-seat-name--self {
  color: var(--cyan);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.play-seat.is-selectable:hover .play-seat-card,
.play-seat.is-selected .play-seat-card {
  border-color: rgba(94, 231, 255, 0.75);
  transform: translateY(-6px) scale(1.04);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.55),
    0 0 22px rgba(94, 231, 255, 0.4);
}

.play-seat.is-selectable:hover .play-seat-id,
.play-seat.is-selected .play-seat-id {
  border-color: rgba(94, 231, 255, 0.55);
}

.play-seat.is-selectable:hover .play-seat-av,
.play-seat.is-selected .play-seat-av {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan), 0 0 12px rgba(94, 231, 255, 0.35);
}

.play-seat.is-dead .play-seat-av {
  filter: grayscale(0.85) brightness(0.7);
  border-color: rgba(224, 62, 74, 0.65);
}

.play-seat.is-won .play-seat-av {
  border-color: var(--moss);
  box-shadow: 0 0 0 2px rgba(59, 165, 93, 0.45);
}

.play-seat-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  z-index: 3;
  font-size: 0.75rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

/* Card action animations */
.play-seat-card.is-flipping,
.play-center-card.is-flipping {
  animation: card-flip 0.55s ease;
}

.play-seat-card.is-revealed {
  border-color: rgba(94, 231, 255, 0.65);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(94, 231, 255, 0.35);
}

/* Peek: grow the center card so the role art/name are readable */
.play-center-card.is-revealed {
  z-index: 30;
  overflow: visible;
  transform: translateY(-22px) scale(1.85);
  border-color: rgba(94, 231, 255, 0.75);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.65),
    0 0 28px rgba(94, 231, 255, 0.4);
}

.play-center-card.is-revealed .role-card .card-name {
  font-size: 0.52rem;
  padding: 0.7rem 0.15rem 0.35rem;
}

.play-seat-card.is-swap-pulse,
.play-center-card.is-swap-pulse {
  animation: card-swap-pulse 0.7s ease;
}

.play-seat.tap-pulse .play-seat-card,
.play-center-card.tap-pulse {
  animation: tap-pulse 0.35s ease;
}

.play-fx-ghost {
  position: fixed;
  z-index: 80;
  width: 72px;
  height: 102px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(94, 231, 255, 0.45);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.55), 0 0 20px rgba(94, 231, 255, 0.3);
  pointer-events: none;
  transition: transform 0.55s cubic-bezier(0.4, 0.1, 0.2, 1), opacity 0.55s ease;
  will-change: transform, opacity;
}

.play-fx-ghost img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@keyframes card-flip {
  0% { transform: rotateY(0deg) scale(1); }
  45% { transform: rotateY(90deg) scale(1.05); }
  55% { transform: rotateY(90deg) scale(1.05); }
  100% { transform: rotateY(0deg) scale(1); }
}

@keyframes card-swap-pulse {
  0%, 100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-14px) scale(1.08); }
  70% { transform: translateY(-4px) scale(0.98); }
}

.play-seat.is-locked,
.play-center-card.is-locked {
  pointer-events: none;
  opacity: 0.72;
}

.play-board[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  .play-table {
    width: min(100%, 420px);
    max-height: min(58dvh, 420px);
  }

  .play-seat-card,
  .play-seat-card--face,
  .play-seat-card--own {
    width: 58px;
    height: 82px;
    min-height: 82px;
  }

  .play-seat-av {
    width: 28px;
    height: 28px;
  }

  .play-seat-marker {
    width: 12px;
    height: 12px;
  }

  .play-seat-name {
    font-size: 0.62rem;
    max-width: 4.2rem;
  }

  .play-center-card,
  .play-table-felt .center-card,
  .play-center-slot {
    width: 54px;
  }

  .play-center-card,
  .play-table-felt .center-card {
    height: 76px;
  }

  .play-center-slot .role-card {
    width: 54px;
  }
}

/* —— Phone / small tablet: playable website layout —— */
@media (max-width: 720px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    overscroll-behavior-y: contain;
  }

  button,
  a,
  input,
  select,
  textarea,
  .friends-chip,
  .profile-trigger,
  .play-seat,
  .play-center-card,
  .visibility-option-card {
    touch-action: manipulation;
  }

  #app {
    padding:
      max(0.55rem, env(safe-area-inset-top, 0px))
      max(0.7rem, env(safe-area-inset-right, 0px))
      max(0.85rem, env(safe-area-inset-bottom, 0px))
      max(0.7rem, env(safe-area-inset-left, 0px));
  }

  /* Let stacked layouts scroll instead of clipping */
  .screen-fit.active {
    height: auto;
    max-height: none;
    min-height: calc(100dvh - 1rem);
    overflow: visible;
  }

  body.is-discord-activity .screen-fit.active {
    height: calc(100dvh - 1.1rem);
    max-height: calc(100dvh - 1.1rem);
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .moon {
    width: min(16vw, 64px);
    height: min(16vw, 64px);
    top: max(1.5vh, env(safe-area-inset-top, 0px));
    right: max(3vw, env(safe-area-inset-right, 0px));
  }

  .hero-brand {
    padding: 2.5vh 0 1.1rem;
  }

  .brand-logo {
    width: min(168px, 46vw);
    height: min(168px, 46vw);
  }

  .brand {
    font-size: clamp(2rem, 11vw, 2.6rem);
  }

  .login-panel {
    margin-inline: 0;
  }

  .btn,
  .btn-discord {
    min-height: 44px;
  }

  /* —— Hub topbar: icon chips —— */
  .entry-top {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
  }

  .entry-top-spacer {
    display: none;
  }

  .entry-user-bar {
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.3rem;
  }

  .entry-user-bar .friends-chip {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .entry-user-bar .friends-chip > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .entry-user-bar .profile-meta,
  .entry-user-bar .profile-caret {
    display: none;
  }

  .entry-user-bar .profile-trigger {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
  }

  .entry-user-bar .profile-avatar {
    width: 34px;
    height: 34px;
  }

  .profile-dropdown {
    right: 0;
    left: auto;
    width: min(260px, calc(100vw - 1.4rem));
  }

  /* —— Hub lobby stack —— */
  .lobby-browser {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.25rem;
    flex: none;
    min-height: 0;
  }

  .lobby-main {
    gap: 0.7rem;
    flex: none;
  }

  .create-panel,
  .room-list-panel,
  .hub-chat-panel {
    flex: none;
  }

  .hub-chat-panel {
    max-height: none;
    min-height: 240px;
  }

  .hub-chat-panel .chat-log {
    min-height: 160px;
    max-height: 42dvh;
  }

  .room-list-panel {
    min-height: 200px;
  }

  .room-list-wrap {
    min-height: 160px;
    max-height: min(48dvh, 360px);
  }

  .create-panel input,
  .create-panel select,
  #password-modal-input {
    font-size: 16px;
    min-height: 44px;
  }

  .hub-admin-tools {
    width: 100%;
    justify-content: flex-start;
  }

  .chat-form {
    gap: 0.4rem;
  }

  .chat-form input {
    min-height: 44px;
    font-size: 16px; /* avoid iOS zoom on focus */
  }

  .chat-form .btn {
    flex-shrink: 0;
  }

  /* —— In-room lobby —— */
  .topbar--compact {
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
  }

  .topbar--compact .brand-lockup {
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar--compact .lang-switch {
    margin-left: 0;
    order: 3;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .topbar-actions .btn {
    flex: 1 1 auto;
    min-height: 42px;
  }

  .lobby-grid {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    flex: none;
  }

  .lobby-players,
  .lobby-setup,
  .lobby-chat {
    flex: none;
    overflow: visible;
    max-height: none;
  }

  .lobby-players .player-list {
    max-height: min(36dvh, 280px);
    overflow-y: auto;
  }

  .lobby-setup .scenario-list {
    max-height: min(42dvh, 320px);
    overflow-y: auto;
  }

  .lobby-chat {
    max-height: none;
  }

  .lobby-chat .chat-log {
    min-height: 140px;
    max-height: 36dvh;
  }

  .host-bar {
    flex-wrap: wrap;
  }

  .host-bar .btn-primary {
    width: 100%;
  }

  /* —— Play screens —— */
  .phase-topbar {
    margin-bottom: 0.35rem;
  }

  .phase-topbar .btn-leave-game,
  .phase-topbar .btn-settings {
    min-height: 40px;
  }

  .screen-play .phase-header--compact h1 {
    font-size: clamp(1.2rem, 6vw, 1.55rem);
  }

  .day-header .timer {
    font-size: 1.65rem;
  }

  .lede--compact {
    font-size: 0.82rem;
    margin-bottom: 0.4rem;
    padding-inline: 0.15rem;
  }

  .day-play {
    display: flex;
    flex-direction: column;
    overflow: visible;
    gap: 0.7rem;
    flex: none;
  }

  .day-play .play-board,
  .vote-play .play-board,
  .night-layout .play-board {
    flex: 0 0 auto;
    min-height: min(72vw, 360px);
    max-height: none;
    padding: 0.15rem 0;
  }

  .day-side {
    flex: none;
    gap: 0.5rem;
  }

  .day-side .chat-panel {
    flex: none;
    min-height: 0;
  }

  .day-side .chat-log {
    min-height: 120px;
    max-height: 32dvh;
  }

  .day-side > .host-only .btn,
  .reveal-host-bar .btn {
    width: 100%;
    min-height: 46px;
  }

  .night-layout.play-phase {
    overflow: visible;
    flex: none;
  }

  .night-panel.play-side {
    width: 100%;
    margin: 0;
    padding: 0.55rem 0.7rem 0.65rem;
  }

  .vote-play,
  .reveal-play {
    flex: none;
    overflow: visible;
  }

  .play-table {
    width: min(100%, 100vw - 1.4rem);
    max-height: min(62dvh, 440px);
  }

  .play-seat.is-selectable .play-seat-card {
    /* larger tap target via padding hit area */
    box-shadow:
      0 10px 22px rgba(0, 0, 0, 0.5),
      0 0 14px rgba(94, 231, 255, 0.22),
      0 0 0 1px rgba(0, 0, 0, 0.35);
  }

  .play-seat.is-selectable {
    padding: 0.2rem;
    margin: -0.2rem;
  }

  /* —— Modals & drawer —— */
  .modal {
    padding:
      max(0.45rem, env(safe-area-inset-top, 0px))
      0.55rem
      max(0.55rem, env(safe-area-inset-bottom, 0px));
    align-items: end;
    place-items: end center;
  }

  .modal-card,
  .guide-modal .guide-card,
  .leaderboard-modal .leaderboard-card,
  .achievements-modal .achievements-card,
  .user-profile-modal .user-profile-card,
  .settings-modal .settings-card {
    width: 100%;
    max-width: none;
    max-height: min(92dvh, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 0.8rem));
    border-bottom-left-radius: max(var(--radius), env(safe-area-inset-bottom, 0px) > 0px ? 18px : var(--radius));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .social-drawer-inner {
    width: min(100%, 100vw);
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }

  .lb-podium {
    min-height: 11rem;
  }

  .guide-role {
    align-items: center;
  }

  .icon-btn {
    width: 2.35rem;
    height: 2.35rem;
  }
}

@media (max-width: 420px) {
  .room-row {
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .room-row .btn {
    width: 100%;
  }

  .create-visibility-row .visibility-option-card {
    padding-inline: 0.45rem;
  }

  .play-table {
    max-height: min(58dvh, 360px);
  }

  .play-seat-card,
  .play-seat-card--face,
  .play-seat-card--own {
    width: 52px;
    height: 74px;
    min-height: 74px;
  }

  .play-seat-name {
    max-width: 3.6rem;
    font-size: 0.58rem;
  }
}
