/* CSS do Painel Mafia Mayor (Zoom Ampliado, Preenchimento Total e Sidebar do DashboardCM).
   Identidade visual noir (a mesma do celular e do Display): os painéis são
   vidro escuro por cima da atmosfera - a rua à noite com chuva e o feixe de
   poste (mafia-atmo.js) -, títulos em serifa itálica, rótulos em mono. Tokens
   de cor/fonte compartilhados e as camadas da atmosfera: mafia-theme.css. */

:root {
  /* Superfícies: vidro escuro (a atmosfera passa por trás, desfocada) */
  --bg-app: var(--ink);
  --bg-sidebar: rgba(8, 9, 12, 0.72);
  --bg-card: rgba(19, 20, 26, 0.96); /* popovers e modais: quase opacos */
  --bg-panel: rgba(12, 13, 17, 0.56);
  --bg-panel-solid: #0d0e12; /* cabeçalhos que grudam no topo ao rolar */
  --bg-control: rgba(255, 255, 255, 0.045); /* botões, pílulas e cards */
  --bg-control-hover: rgba(255, 255, 255, 0.09);
  --glass-blur: blur(18px) saturate(1.15);
  --border-color: rgba(255, 255, 255, 0.07);
  --border-card-default: rgba(255, 255, 255, 0.06);

  /* Cores dos papéis e estados (paleta do celular) */
  --neon-red: #e5484d;
  --neon-red-glow: rgba(229, 72, 77, 0.25);
  --neon-orange: #e8b064;
  --neon-grey: #4b5563;
  --neon-grey-glow: rgba(75, 85, 99, 0.1);
  --neon-gold: #e9c87d;
  --neon-gold-glow: rgba(233, 200, 125, 0.22);
  --neon-purple: #b98cf0;
  --neon-purple-glow: rgba(185, 140, 240, 0.22);
  --neon-blue: #7ea6e0;
  --neon-blue-glow: rgba(126, 166, 224, 0.2);
  --success: #7fd6a4; /* Verde do status ativo */

  /* Cores de Texto */
  --text-primary: #efe9dd;
  --text-secondary: #b3ac9f;
  --text-muted: #706a60;

  /* Fontes (serifa e mono vêm do mafia-theme.css) */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;

  /* Escala de zoom do conteúdo (controlada pelo botão de zoom) */
  --ui-scale: 1;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* O atributo "hidden" não é aplicado de forma confiável a elementos <svg>
   pelo stylesheet padrão do navegador — força aqui explicitamente. */
[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-primary);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Container do App - Tela Cheia Absoluta, por cima da atmosfera (canvas fixo). */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}
/* Num painel de trabalho, a vinheta mais leve. */
.atmo-vignette { opacity: 0.55; }

/* ==========================================================================
   SIDEBAR (identidade noir: vidro escuro, marca em serifa, item ativo aceso)
   ========================================================================== */

.sidebar {
  position: relative;
  width: 252px;
  height: 100%;
  background: var(--bg-sidebar);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition-normal);
  color: var(--text-primary);
  flex-shrink: 0;
}

/* Marca: o ícone do mafioso + "Mafia" em serifa itálica, como no topo do celular. */
.sidebar-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 26px 16px 22px 22px;
  min-height: 72px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  user-select: none;
}

.sidebar-logo-mark {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 16px rgba(255, 75, 69, 0.3));
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.sidebar-logo-word {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 30px;
  line-height: 0.9;
  color: var(--text-primary);
}
.sidebar-logo-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Botão de colapso */
.sidebar-collapse-btn {
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.sidebar-collapse-btn:hover {
  background: var(--bg-control-hover);
  border-color: var(--line-2);
  color: var(--text-primary);
}
.sidebar-collapse-btn svg {
  transition: transform var(--transition-normal);
}

/* Menu de Navegação */
.sidebar-nav {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow-y: auto;
  padding: 6px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-section-label {
  padding: 0 10px 10px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
  font-size: 15.5px;
  font-weight: 500;
  text-decoration: none;
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-control);
  color: var(--text-primary);
}

/* Item ativo: uma poça de luz vermelha e um filete aceso na borda (o mesmo
   indicador das abas do celular). */
.nav-item.active {
  background:
    radial-gradient(120% 160% at 0% 50%, rgba(255, 75, 69, 0.2), transparent 70%),
    rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 75, 69, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--lamp);
  box-shadow: 0 0 12px var(--lamp);
  transform: translateY(-50%);
}
.nav-item svg {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}
.nav-item:hover svg { opacity: 0.9; }
.nav-item.active svg {
  opacity: 1;
  color: var(--lamp);
}

/* Sidebar Footer */
.sidebar-footer {
  position: relative;
  z-index: 2;
  padding: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-nav-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 14px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 14.5px;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
  text-align: left;
  width: 100%;
}
.settings-nav-btn:hover {
  background: var(--bg-control);
  color: var(--text-primary);
}
.settings-nav-btn svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* Quem está logado: um cartão de vidro com a foto num anel vermelho. */
.sidebar-footer-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border-radius: 16px;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
}

.user-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-red), var(--blood-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 19px;
  font-weight: 400;
  color: var(--text-primary);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 3px rgba(255, 75, 69, 0.55), 0 0 18px rgba(255, 75, 69, 0.25);
  overflow: hidden;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  transition: opacity 0.2s ease;
}

.user-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-status {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 6px;
}
.user-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.logout-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logout-btn:hover {
  background: rgba(229, 72, 77, 0.12);
  border-color: rgba(229, 72, 77, 0.3);
  color: var(--neon-red);
}

/* Silhueta decorativa do detetive, quase sumindo no escuro */
.sidebar-silhouette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%; /* Ocupa 100% da altura da sidebar para nunca cortar o topo da silhueta/chapéu */
  background-image: url('assets/detective_silhouette.svg');
  background-repeat: no-repeat;
  background-position: bottom center; /* Começa do ponto mais baixo da sidebar */
  background-size: 135% auto;
  opacity: 0.04;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1;
}

/* ==========================================================================
   SIDEBAR COLLAPSED (RECOLHIDA): só o ícone da marca e os ícones do menu
   ========================================================================== */

.sidebar.collapsed {
  width: 76px;
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .settings-label,
.sidebar.collapsed .user-details,
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .sidebar-section-label {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  flex-direction: column;
  padding: 22px 0 18px;
  justify-content: center;
}

.sidebar.collapsed .sidebar-logo-mark {
  width: 34px;
  height: 34px;
}

.sidebar.collapsed .nav-item,
.sidebar.collapsed .settings-nav-btn {
  justify-content: center;
  padding: 0;
  width: 46px;
  height: 46px;
  margin: 0 auto 2px auto;
}

.sidebar.collapsed .sidebar-footer {
  padding: 14px 0;
  align-items: center;
}

.sidebar.collapsed .sidebar-footer-user {
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
  background: transparent;
  border: none;
  align-items: center;
  width: 100%;
}

.sidebar.collapsed .user-info {
  justify-content: center;
  margin: 0;
}

.sidebar.collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-silhouette {
  opacity: 0.02;
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL (ZOOM AUMENTADO PARA EVITAR ZOOM MINUS)
   ========================================================================== */

.main-content {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.6vh 3.5vw;
  overflow: hidden;
  justify-content: space-between;
}

/* CABEÇALHO */
/* O cabeçalho tem, no fluxo normal, só dois elementos: o grupo de papéis
   (esquerda) e o cronômetro (direita) - "space-between" já os fixa nas
   pontas. O player de música e os botões de revelação ficam FORA do fluxo
   (position: absolute), assim a largura do grupo de papéis ou do cronômetro
   nunca desloca o player do centro exato do cabeçalho. A posição dos botões
   de revelação (exatamente no meio entre o player e o cronômetro) é
   recalculada via JS (ver initHeaderLayout em main.js) sempre que o player
   ou o cronômetro mudam de tamanho - por isso continua correta mesmo com o
   player crescendo (barra de progresso, atalhos de faixas, etc.).
*/
.app-header {
  position: relative;
  z-index: 20; /* menus e tooltips do cabeçalho por cima dos painéis abaixo dele */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8vh 0;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.header-role-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-role-group .header-round {
  margin-left: 6px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

/* Botões de ação do cabeçalho (Nova Partida / Encerrar Partida) - apenas
   ícone, com o rótulo disponível via tooltip nativo (atributo title) */
.header-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(38px * var(--ui-scale));
  height: calc(38px * var(--ui-scale));
  border-radius: 50%;
  background: var(--bg-control);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.header-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}
.header-action-btn:not(.header-action-btn-danger):hover {
  color: var(--success);
  border-color: rgba(127, 214, 164, 0.35);
}
.header-action-btn-danger:hover {
  background: rgba(229, 72, 77, 0.12);
  color: var(--neon-red);
  border-color: rgba(229, 72, 77, 0.35);
}

/* Tooltip customizado (mais visível que o title nativo do navegador) -
   mostra o texto de data-tooltip logo abaixo do botão, ao passar o mouse
   ou focar via teclado. */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #17181e;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  width: max-content;
  max-width: 180px;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 500;
}
[data-tooltip]::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: #17181e;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s;
  z-index: 500;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.header-center-group {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Botão "Abrir votação": fica entre "PARTIDA #N" e o player de música - a
   posição (left) é recalculada em JS (initHeaderLayout), no meio exato
   entre os dois, e se reajusta sozinha quando qualquer um dos dois muda de
   tamanho (ex.: "PARTIDA #9" pra "PARTIDA #10", ou o texto do botão
   mudando pra "Votação Aberta"). Pílula com ícone + texto (em vez de só
   ícone) porque no tamanho de um botão circular comum o ícone da urna
   ficava pequeno demais pra reconhecer.
*/
.header-vote-group {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-vote-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(38px * var(--ui-scale));
  padding: 0 16px;
  border-radius: 999px;
  background: var(--bg-control);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.header-vote-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--success);
  border-color: rgba(127, 214, 164, 0.35);
}
.header-vote-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.header-vote-btn:disabled:hover {
  background: var(--bg-control);
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.08);
}
.header-vote-btn-svg {
  flex-shrink: 0;
}
/* Sem espaço no cabeçalho: só o ícone (ver initHeaderLayout). */
.header-vote-group.is-compact { gap: 6px; }
.header-vote-group.is-compact .header-vote-btn { padding: 0 12px; }
.header-vote-group.is-compact .header-vote-btn-label { display: none; }
.header-vote-btn.vote-active {
  background: rgba(229, 72, 77, 0.12);
  color: var(--neon-red);
  border-color: rgba(229, 72, 77, 0.35);
}
.header-vote-btn-icon {
  display: block;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask-image: url('assets/icon-voto-cropped.png');
  mask-image: url('assets/icon-voto-cropped.png');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  mask-mode: luminance;
}
.header-vote-btn-label {
  font-size: calc(13px * var(--ui-scale));
  font-weight: 600;
}

/* Menu "Noite": pede ao assassino, ao detetive ou ao anjo (pelo celular) que
   façam a escolha da rodada - ver initAcoesNoturnas. O botão acende e mostra
   quantas escolhas estão em aberto. */
.night-menu { position: relative; }
.night-menu.is-open #night-menu-btn::before,
.night-menu.is-open #night-menu-btn::after { display: none; } /* sem tooltip com o menu aberto */
.night-menu-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--neon-red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.night-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 240px;
  padding: 6px;
  border-radius: 12px;
  background: var(--bg-control);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 600;
}
.night-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.night-menu-item svg { flex-shrink: 0; }
.night-menu-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }
.night-menu-item-text { display: flex; flex-direction: column; gap: 2px; }
.night-menu-item-label { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.night-menu-item-status { font-size: 11px; color: var(--text-muted); }
.night-menu-item.vote-active { color: var(--neon-red); background: rgba(229, 72, 77, 0.08); }
.night-menu-item.vote-active .night-menu-item-status { color: var(--neon-red); }
.header-round {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: calc(12px * var(--ui-scale));
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.header-round-number {
  font-size: calc(12px * var(--ui-scale));
  font-weight: 500;
  color: var(--lamp);
}

/* Player de música de fundo */
.music-player {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-control);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
}
.music-toggle-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--neon-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.music-toggle-btn svg {
  width: 13px;
  height: 13px;
}
.music-toggle-btn:hover {
  background: var(--lamp);
}
.music-nav-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease;
}
.music-nav-btn svg {
  width: 13px;
  height: 13px;
}
.music-nav-btn:hover {
  color: var(--text-primary);
}
.music-playing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: none;
  flex-shrink: 0;
  animation: music-pulse 1s ease-in-out infinite;
}
.music-player.is-playing .music-playing-dot {
  display: block;
}
@keyframes music-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
.music-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 150px;
  flex: 0 0 150px;
  min-height: 30px;
}
.music-track-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.music-player.is-playing .music-track-name {
  color: var(--text-primary);
}
.music-progress-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.music-time {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 22px;
  font-variant-numeric: tabular-nums;
}
.music-time:last-child {
  text-align: right;
}
.music-progress-bar {
  position: relative;
  flex: 1;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  overflow: visible;
  touch-action: none;
}
.music-progress-bar::after {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--progress, 0%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.music-progress-bar:hover::after,
.music-progress-bar.is-dragging::after {
  opacity: 1;
}
.music-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--neon-red);
  border-radius: 3px;
}
.music-quick-tracks {
  display: flex;
  gap: 4px;
  padding-left: 5px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.music-quick-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.music-quick-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}
.music-quick-btn.is-current {
  background: var(--neon-red);
  color: #fff;
}
.music-repeat-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.music-repeat-btn svg {
  width: 13px;
  height: 13px;
}
.music-repeat-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
.music-repeat-btn.is-active {
  color: var(--success);
  background: rgba(34, 197, 94, 0.15);
}

/* ==========================================================================
   CRONÔMETRO E CONTROLES (NO CABEÇALHO, À DIREITA)
   ========================================================================== */

.header-timer-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Botões de revelação (Mafia / Morador) - centralizados entre o player de
   música e o cronômetro (posição calculada via JS, ver initHeaderLayout em
   main.js). Disparam a animação de revelação no Display. */
.header-reveal-group {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.reveal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(38px * var(--ui-scale));
  height: calc(38px * var(--ui-scale));
  border-radius: 12px;
  background: var(--bg-control);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.reveal-btn-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.reveal-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.reveal-btn-mafia {
  background: rgba(229, 72, 77, 0.14);
  border-color: rgba(229, 72, 77, 0.35);
  color: var(--neon-red);
}

.reveal-btn-mafia:hover {
  background: rgba(229, 72, 77, 0.24);
  border-color: rgba(229, 72, 77, 0.5);
  color: var(--neon-red);
}

/* Relógio + barra de progresso embaixo (a barra tem a largura dos dígitos). */
.timer-clock {
  display: flex;
  flex-direction: column;
  gap: calc(5px * var(--ui-scale));
  flex-shrink: 0;
}
.timer-display {
  display: flex;
  justify-content: flex-end;
  font-family: var(--font-serif);
  font-size: calc(76px * var(--ui-scale));
  font-weight: 400;
  color: var(--text-primary);
  line-height: 0.86;
  min-width: 152px;
  text-shadow: 0 0 30px rgba(255, 176, 102, 0.12);
}
.timer-display.timer-critical {
  animation: timer-blink-red 0.5s steps(1, start) infinite;
}
.timer-display.timer-finished {
  color: var(--neon-red);
}
@keyframes timer-blink-red {
  0%, 100% { color: var(--neon-red); }
  50% { color: var(--text-primary); }
}

.timer-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.timer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-control);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.timer-btn:hover {
  background: var(--bg-control-hover);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}
/* Barra de progresso do cronômetro: mesmo visual da barra da música (trilho de
   4px, preenchimento vermelho, bolinha ao passar o mouse/arrastar). Quanto mais
   tempo passou, mais cheia; arrastar pra direita adianta, pra esquerda retrocede.
   O ::before só aumenta a área de clique (a barra é fina). */
.timer-progress {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  touch-action: none;
  outline: none;
}
.timer-progress::before {
  content: "";
  position: absolute;
  inset: -8px 0;
}
.timer-progress::after {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--progress, 0%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.timer-progress:hover::after,
.timer-progress:focus-visible::after,
.timer-progress.is-dragging::after {
  opacity: 1;
}
.timer-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--neon-red);
  border-radius: 3px;
}
/* Sem tempo definido ainda: a barra fica apagada e não responde. */
.timer-progress.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* O botão de play/pause ocupa a mesma altura dos dígitos do cronômetro */
.timer-btn-icon {
  width: calc(66px * var(--ui-scale));
  height: calc(66px * var(--ui-scale));
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 75, 69, 0.2), rgba(255, 75, 69, 0.08));
  border-color: rgba(255, 75, 69, 0.4);
  color: #ff8a86;
}
.timer-btn-icon:hover {
  background: linear-gradient(180deg, rgba(255, 75, 69, 0.34), rgba(255, 75, 69, 0.16));
  border-color: var(--lamp);
  color: #fff;
  box-shadow: 0 0 24px -4px rgba(255, 75, 69, 0.55);
}
.timer-btn-icon svg {
  width: calc(26px * var(--ui-scale));
  height: calc(26px * var(--ui-scale));
}

/* Presets de 5/3/1 min empilhados verticalmente (crescem junto com o cronômetro) */
.timer-presets-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  height: calc(66px * var(--ui-scale));
  justify-content: space-between;
}
.timer-btn-preset {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: calc(10.5px * var(--ui-scale));
  font-weight: 500;
  letter-spacing: 0.08em;
  border-radius: 7px;
}

/* Pré-definição variável: borda tracejada + lápis indicam que o tempo é escolhido pelo mayor. */
.timer-btn-custom {
  gap: 4px;
  padding: 0 5px; /* mesma largura do antigo "5MIN": o cabeçalho é apertado e o grupo do cronômetro não pode crescer */
  font-variant-numeric: tabular-nums;
  border-style: dashed;
}
.timer-btn-custom svg {
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.timer-btn-custom:hover svg,
.timer-btn-custom[aria-expanded="true"] svg {
  opacity: 1;
}
.timer-btn-custom[aria-expanded="true"] {
  background: var(--bg-control-hover);
  color: #fff;
  border-color: var(--neon-red);
}

/* Seletor de minutos e segundos (popover no <body>, position:fixed). */
.timer-custom-pop {
  position: fixed;
  z-index: 1500;
  width: max-content;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
.timer-custom-pop[hidden] {
  display: none;
}
.timer-custom-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.timer-custom-fields {
  display: flex;
  align-items: center;
  gap: 8px;
}
.timer-custom-field {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}
.timer-custom-field input {
  width: 64px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}
.timer-custom-field input::-webkit-outer-spin-button,
.timer-custom-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.timer-custom-field input:focus {
  outline: none;
  border-color: var(--neon-red);
}
.timer-custom-sep {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-secondary);
}
.timer-custom-error {
  margin: 0;
  font-size: 11px;
  color: var(--neon-red);
}
.timer-custom-error[hidden] {
  display: none;
}
.timer-custom-apply {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: var(--neon-red);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.timer-custom-apply:hover,
.timer-custom-apply:focus-visible {
  filter: brightness(1.15);
  outline: none;
}

/* ==========================================================================
   PAINEL CENTRAL: STATUS DA CIDADE (ESQUERDA) + HISTÓRICO DA PARTIDA (DIREITA)
   ========================================================================== */

.main-panels-row {
  flex: 1;
  display: flex;
  /* Sem gap: o espaço entre os dois painéis é a divisória arrastável
     (.panel-resizer, com a mesma largura que o gap tinha). */
  gap: 0;
  /* Fatia do Status da Cidade, em % (o resto vai pro Histórico) - ajustada
     pela divisória (initPanelResizer em main.js). */
  --split-left: 45;
  margin: 2vh 0;
  min-height: 0;
}

/* Divisória entre Status da Cidade e Histórico da Partida: invisível até o
   mouse chegar nela, quando mostra uma linha e uma alça. Arrastar muda a
   proporção entre os dois lados. */
.panel-resizer {
  flex: 0 0 1.6vw;
  min-width: 14px;
  position: relative;
  cursor: col-resize;
  touch-action: none;
  outline: none;
}
.panel-resizer::before,
.panel-resizer::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 4px;
  transition: background 0.15s ease;
}
.panel-resizer::before {
  top: 0;
  bottom: 0;
  width: 3px;
}
.panel-resizer::after {
  top: 50%;
  width: 4px;
  height: 44px;
  transform: translate(-50%, -50%);
}
.panel-resizer:hover::before,
.panel-resizer:focus-visible::before {
  background: rgba(255, 255, 255, 0.1);
}
.panel-resizer:hover::after,
.panel-resizer:focus-visible::after {
  background: rgba(255, 255, 255, 0.45);
}
.panel-resizer.is-dragging::before {
  background: rgba(229, 72, 77, 0.35);
}
.panel-resizer.is-dragging::after {
  background: var(--neon-red);
}
/* Enquanto arrasta: cursor fixo e sem selecionar texto por acidente. */
body.is-resizing {
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
}

/* Divisória horizontal (entre Status da Cidade e Preview Display): mesma ideia
   da vertical, girada. */
.panel-resizer-y {
  flex: 0 0 1.6vh;
  min-width: 0;
  min-height: 12px;
  cursor: row-resize;
}
.panel-resizer-y::before {
  top: 50%;
  bottom: auto;
  left: 0;
  right: 0;
  width: auto;
  height: 3px;
  transform: translateY(-50%);
}
.panel-resizer-y::after {
  top: 50%;
  left: 50%;
  width: 44px;
  height: 4px;
  transform: translate(-50%, -50%);
}
body.is-resizing-y {
  cursor: row-resize;
  user-select: none;
  -webkit-user-select: none;
}

/* PREVIEW DISPLAY - dois monitores ao vivo (o Display e a tela do celular do
   jogador, ambos em "modo prévia"), lado a lado ou empilhados conforme o
   espaço (mafia-preview.js calcula o tamanho de cada um). */
.preview-panel {
  flex: calc(100 - var(--split-top)) 1 0;
  min-width: 0;
  min-height: 0;
}
.preview-inner {
  container-type: inline-size; /* as legendas se reorganizam conforme a largura (abaixo) */
  width: 100%;
  height: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 30px 60px -34px rgba(0, 0, 0, 0.9);
  padding: 2.2vh 1.8vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.preview-inner .panel-header-row {
  margin-bottom: 1.2vh;
}
.preview-stage {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Os dois monitores: lado a lado ou empilhados (.is-stacked, ver mafia-preview.js). */
.pv-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.pv-group.is-stacked {
  flex-direction: column;
  align-items: center;
}
.pv-monitor {
  flex: 0 0 auto;
}
.pv-screen {
  position: relative;
  overflow: hidden;
  background: #05060a;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
/* O iframe tem o tamanho "de verdade" da tela e é reduzido com transform
   (definido pelo mafia-preview.js). Sem cliques: é só um monitor. */
.pv-screen iframe {
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  transform-origin: 0 0;
  pointer-events: none;
}
/* Botão do canto superior direito do cabeçalho: recolhe/expande a sessão. A
   setinha aponta pra baixo (recolher) e vira pra cima quando recolhida. */
.panel-collapse-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent; /* só a setinha, sem caixa em volta */
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease;
}
.panel-collapse-btn:hover,
.panel-collapse-btn:focus-visible {
  color: #fff;
  outline: none;
}
.panel-collapse-btn svg {
  transition: transform 0.2s ease;
}
.left-stack.is-preview-collapsed .panel-collapse-btn svg {
  transform: rotate(180deg);
}

/* Preview recolhido: só o cabeçalho (nome + botão à direita), no fim da coluna;
   o Status da Cidade ocupa o resto e a divisória horizontal some (mas mantém o
   espaço entre as duas sessões). */
.left-stack.is-preview-collapsed .preview-panel {
  flex: 0 0 auto;
}
.left-stack.is-preview-collapsed .preview-inner {
  height: auto;
}
.left-stack.is-preview-collapsed .preview-inner .panel-header-row {
  margin-bottom: 0;
}
.left-stack.is-preview-collapsed .preview-stage,
.left-stack.is-preview-collapsed .pv-legend {
  display: none;
}
.left-stack.is-preview-collapsed .city-status-panel {
  flex: 1 1 0;
}
.left-stack.is-preview-collapsed .panel-resizer-y {
  visibility: hidden;
  pointer-events: none;
}

/* Monitor com animação no ar: borda vermelha. */
.pv-monitor.is-live .pv-screen {
  border-color: var(--neon-red);
  box-shadow: 0 0 10px var(--neon-red-glow);
}
/* Faixa de legendas embaixo dos monitores: uma por monitor, na largura toda
   da sessão (a legenda longa não pode alargar o monitor). */
.pv-legend {
  flex: 0 0 auto;
  display: flex;
  gap: 12px;
  padding-top: 6px;
}
.pv-legend-item {
  flex: 1 1 auto; /* o item com texto maior (o que está no ar) ganha mais espaço */
  min-width: 0;
  height: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: calc(10.5px * var(--ui-scale));
  white-space: nowrap;
}
/* Sessão estreita: uma legenda embaixo da outra (sempre duas linhas, pra a
   altura da faixa não oscilar quando o texto muda). */
@container (max-width: 320px) {
  .pv-legend {
    flex-direction: column;
    gap: 0;
  }
  .pv-legend-item {
    flex: none;
  }
}
.pv-name {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--text-secondary);
}
.pv-status {
  min-width: 0;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}
.pv-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #3a3d47;
}
/* Acende (vermelho piscando) quando há uma animação no ar naquele monitor. */
.pv-legend-item.is-live .pv-dot {
  background: var(--neon-red);
  box-shadow: 0 0 6px var(--neon-red);
  animation: pv-live 1s ease-in-out infinite;
}
.pv-legend-item.is-live .pv-status {
  color: var(--text-primary);
  font-weight: 600;
}
@keyframes pv-live {
  50% { opacity: 0.35; }
}

/* Coluna direita: Histórico da Partida, ocupando toda a altura. */
.right-stack {
  flex: calc(100 - var(--split-left)) 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.6vh;
}

/* O item flex em si não tem padding (fica no wrapper interno)
   para que a proporção 80/20 com o histórico seja exata. */
.characters-panel {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
}
.characters-inner {
  width: 100%;
  height: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 30px 60px -34px rgba(0, 0, 0, 0.9);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.characters-inner .panel-header-row {
  margin-bottom: 5px;
}
/* Painel baixinho: o título em serifa menor, pra sobrar altura pros cards. */
.characters-inner .panel-title {
  font-size: calc(21px * var(--ui-scale));
}

.characters-list {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 6px;
}

/* Subcard de cada categoria de personagem - tamanho fixo, sempre esticado
   para ocupar a altura total do painel (a margem externa é mínima; o que
   se adapta é o conteúdo de cada integrante lá dentro, não a caixa). */
/* O título precisa de uma margem mínima garantida (padding-top) para nunca
   tocar a borda da caixa. Já os lados/embaixo não precisam desse respiro -
   o conteúdo (foto+nome) não é esticado para preenchê-los, então sobra
   espaço ali naturalmente. */
.character-group {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 4px 4px;
}

/* Subcards do time do mal (Assassino, Traidor) com fundo avermelhado */
.character-group-evil {
  background: rgba(229, 72, 77, 0.08);
  border-color: rgba(229, 72, 77, 0.25);
}

/* O título do box fica proporcional ao tamanho da foto/nome (ver os
   seletores :has() mais abaixo, que encolhem tudo junto com mais
   integrantes no grupo). */
.character-group-title {
  font-family: var(--font-mono);
  font-size: calc(12px * var(--ui-scale));
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  flex-shrink: 0;
  transition: font-size 0.15s ease;
}
.role-color-detetive { color: var(--neon-gold); }
.role-color-assassino { color: var(--neon-red); }
.role-color-anjo { color: var(--neon-gold); }
.role-color-traidor { color: var(--neon-purple); }
.role-color-morador { color: var(--neon-blue); }

/* Os integrantes sempre ficam um em cima do outro (nunca lado a lado),
   centralizados no espaço da caixa - sem esticar para preenchê-la, pois a
   foto deve ficar proporcional ao texto (nome/@), não ao tamanho da caixa. */
.character-group-members {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.character-member {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

/* Tamanho coerente com o texto ao lado (nome/@) - a dupla foto+texto forma
   um bloco só, que cresce/encolhe junto conforme a quantidade de
   integrantes (ver os seletores :has() abaixo), sem esticar para preencher
   sozinha a altura da caixa (isso ficaria desproporcional). */
.character-avatar-wrapper {
  position: relative;
  width: calc(50px * var(--ui-scale));
  height: calc(50px * var(--ui-scale));
  flex-shrink: 0;
}
.character-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.character-player-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  min-width: 0;
  max-width: 100%;
}
.character-player-name {
  font-size: calc(15px * var(--ui-scale));
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.character-player-handle {
  font-size: calc(12px * var(--ui-scale));
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Quanto mais integrantes um grupo tiver, menor fica cada um (foto, texto
   e o título do box) - todos encolhem juntos, mantendo a proporção, mas
   sempre usando bem o espaço disponível na fatia de altura que cada um tem. */
.character-group-members:has(.character-member:nth-child(2)) .character-avatar-wrapper {
  width: calc(28px * var(--ui-scale));
  height: calc(28px * var(--ui-scale));
}
.character-group-members:has(.character-member:nth-child(2)) .character-player-name {
  font-size: calc(11px * var(--ui-scale));
}
.character-group-members:has(.character-member:nth-child(2)) .character-player-handle {
  font-size: calc(9px * var(--ui-scale));
}
.character-group:has(.character-member:nth-child(2)) .character-group-title {
  font-size: calc(13px * var(--ui-scale));
}

.character-group-members:has(.character-member:nth-child(3)) .character-avatar-wrapper {
  width: calc(18px * var(--ui-scale));
  height: calc(18px * var(--ui-scale));
}
.character-group-members:has(.character-member:nth-child(3)) .character-player-name {
  font-size: calc(8.5px * var(--ui-scale));
}
.character-group-members:has(.character-member:nth-child(3)) .character-player-handle {
  font-size: calc(7.5px * var(--ui-scale));
}
.character-group:has(.character-member:nth-child(3)) .character-group-title {
  font-size: calc(11.5px * var(--ui-scale));
}

/* O item flex em si não tem padding (fica no wrapper interno)
   para que a proporção 80/20 com o card de personagens seja exata. */
.dashboard-panel {
  flex: 4 1 0;
  min-height: 0;
  min-width: 0;
}
.dashboard-inner {
  width: 100%;
  height: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 30px 60px -34px rgba(0, 0, 0, 0.9);
  padding: 2.5vh 2.2vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2vh;
  flex-shrink: 0;
}
.panel-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: calc(28px * var(--ui-scale));
  font-weight: 400;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: 0.005em;
}

.historico-match-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.historico-duration {
  font-size: calc(13px * var(--ui-scale));
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.historico-winner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: calc(12.5px * var(--ui-scale));
  font-weight: 700;
  letter-spacing: 0.3px;
}
.historico-winner-badge.winner-cidade {
  background: rgba(127, 214, 164, 0.14);
  color: var(--success);
}
.historico-winner-badge.winner-mafia {
  background: rgba(229, 72, 77, 0.14);
  color: var(--neon-red);
}

/* TABELA DE HISTÓRICO */
.history-table-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding-right: 12px;
}

.history-table-container,
.characters-list,
.city-status-column,
.city-status-columns.is-single,
.vote-session-condenacao-list,
.vote-session-player-list {
  scrollbar-width: thin;
  scrollbar-color: #3a3d47 transparent;
}
.history-table-container::-webkit-scrollbar,
.characters-list::-webkit-scrollbar,
.city-status-column::-webkit-scrollbar,
.city-status-columns.is-single::-webkit-scrollbar,
.vote-session-condenacao-list::-webkit-scrollbar,
.vote-session-player-list::-webkit-scrollbar {
  width: 10px;
}
.history-table-container::-webkit-scrollbar-track,
.characters-list::-webkit-scrollbar-track,
.city-status-column::-webkit-scrollbar-track,
.city-status-columns.is-single::-webkit-scrollbar-track,
.vote-session-condenacao-list::-webkit-scrollbar-track,
.vote-session-player-list::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 8px;
}
.history-table-container::-webkit-scrollbar-thumb,
.characters-list::-webkit-scrollbar-thumb,
.city-status-column::-webkit-scrollbar-thumb,
.city-status-columns.is-single::-webkit-scrollbar-thumb,
.vote-session-condenacao-list::-webkit-scrollbar-thumb,
.vote-session-player-list::-webkit-scrollbar-thumb {
  background: #3a3d47;
  background-clip: padding-box;
  border-radius: 8px;
  border: 2px solid transparent;
}
.history-table-container::-webkit-scrollbar-thumb:hover,
.characters-list::-webkit-scrollbar-thumb:hover,
.city-status-column::-webkit-scrollbar-thumb:hover,
.city-status-columns.is-single::-webkit-scrollbar-thumb:hover,
.vote-session-condenacao-list::-webkit-scrollbar-thumb:hover,
.vote-session-player-list::-webkit-scrollbar-thumb:hover {
  background: #4a4d59;
}

.history-table,
.mortos-popover {
  /* Tamanhos de UM jogador numa célula (foto + nome embaixo). Tudo que aparece
     compactado na coluna Morto deriva destes valores (ver .mortos-grid), então
     acompanha o zoom (--ui-scale) e qualquer ajuste feito aqui. */
  --hist-avatar: calc(40px * var(--ui-scale));
  --hist-name: calc(15px * var(--ui-scale));
  --hist-name-min: calc(10.5px * var(--ui-scale)); /* o menor texto que a interface já usa (cabeçalhos da tabela, personagem nos cards) */
  --hist-gap: 4px; /* entre a foto e o nome */
  --hist-cell-gap: 8px; /* entre jogadores na célula (era o espaço do empilhado) */
}
.history-table {
  width: 100%;
  min-width: 700px;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: center;
}
/* Cabeçalho congelado: fica no topo do container enquanto as rodadas rolam.
   Fundo opaco (senão as linhas aparecem por baixo) e a linha de baixo vai em
   box-shadow porque, com border-collapse, a borda não acompanha o sticky. */
.history-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg-panel-solid);
  box-shadow: inset 0 -1px 0 var(--border-color);
  padding: 1.5vh 4px;
  font-family: var(--font-mono);
  font-size: calc(10px * var(--ui-scale));
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  overflow-wrap: break-word;
}
/* O cabeçalho da coluna Condenado mantém o tom roxo por cima do fundo opaco. */
.history-table th.col-plebiscito {
  background: linear-gradient(rgba(185, 140, 240, 0.05), rgba(185, 140, 240, 0.05)), var(--bg-panel-solid);
}
.history-table td {
  padding: 1.7vh 12px; /* Aumentado para linhas mais altas e confortáveis */
  font-size: calc(17.5px * var(--ui-scale));
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  transition: background 0.2s ease;
}
.history-table tbody tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}
/* Rodada em andamento (ainda não concluída) no Painel: acesa pela luz quente. */
#history-table-body tr:not([data-concluida="1"]) {
  background: linear-gradient(90deg, rgba(255, 176, 102, 0.08), transparent 55%);
}
#history-table-body tr:not([data-concluida="1"]) .cell-rodada {
  color: var(--text-primary);
  text-shadow: 0 0 18px rgba(255, 176, 102, 0.45);
}

/* Colunas */
.col-rodada, .cell-rodada {
  width: 6%;
  text-align: center;
  color: var(--text-muted);
}
.cell-rodada {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: calc(30px * var(--ui-scale)) !important;
  line-height: 1;
  transition: color 0.3s ease;
}
.col-imunizado, .col-morto, .col-investigado, .col-plebiscito {
  width: 15.5%;
}
.cell-imunizado { color: var(--text-muted); }
.cell-morto { color: var(--neon-red); }
.cell-investigado { color: var(--text-muted); }
.cell-plebiscito { color: var(--text-muted); }
/* A foto de quem está na célula ganha o anel da cor da coluna (as mesmas cores
   do celular e do Display: anjo, morte, detetive, condenação). */
.cell-imunizado { --cell-ring: var(--halo); }
.cell-morto { --cell-ring: var(--neon-red); }
.cell-investigado { --cell-ring: var(--neon-gold); }
.cell-plebiscito { --cell-ring: var(--neon-purple); }

.col-advertencias {
  width: 15%;
}
.col-acoes {
  width: 17%;
}
/* "RODADA" numa coluna estreita: sem quebrar a palavra no meio. */
.history-table th.col-rodada {
  overflow-wrap: normal;
  font-size: calc(9px * var(--ui-scale));
  letter-spacing: 0;
  padding-left: 0;
  padding-right: 0;
}
.acoes-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
/* Pílulas de vidro com a cor da ação: Exibir Mortes (vermelho, com uma luz
   acesa) e Concluir (verde; depois de concluída, apagada com um ✓). */
.acao-btn {
  min-width: 122px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-main);
  font-size: calc(12px * var(--ui-scale));
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.25s ease, opacity 0.15s ease, transform 0.15s var(--ease-out);
}
.acao-btn:active:not(:disabled) {
  transform: scale(0.97);
}
.acao-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.morte-btn {
  border: 1px solid rgba(229, 72, 77, 0.45);
  background: linear-gradient(180deg, rgba(229, 72, 77, 0.22), rgba(229, 72, 77, 0.08));
  color: #ff9a9c;
}
.morte-btn::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-red);
  box-shadow: 0 0 8px var(--neon-red);
}
.morte-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(229, 72, 77, 0.38), rgba(229, 72, 77, 0.18));
  border-color: var(--neon-red);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 22px -4px rgba(229, 72, 77, 0.6);
}
.concluir-btn {
  border: 1px solid rgba(127, 214, 164, 0.4);
  background: rgba(127, 214, 164, 0.1);
  color: var(--success);
}
.concluir-btn:hover:not(:disabled) {
  background: rgba(127, 214, 164, 0.2);
  border-color: var(--success);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 20px -6px rgba(127, 214, 164, 0.5);
}
/* "Clicado": apagado, cinza, pra contrastar com o verde de "pendente". */
.concluir-btn.is-done {
  border-color: var(--border-color);
  background: var(--bg-control);
  color: var(--text-muted);
}
.concluir-btn.is-done::before {
  content: '✓';
  font-size: 11px;
}
.concluir-btn.is-done:hover:not(:disabled) {
  background: var(--bg-control-hover);
  color: var(--text-secondary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* Continua sendo uma célula de tabela (com display:flex ela saía da linha:
   desalinhava a altura e a borda e cortava o fundo da rodada); os avisos
   ficam empilhados e centralizados. */
.cell-advertencias {
  text-align: center;
}
.cell-advertencias > * {
  display: block;
  width: fit-content;
  margin: 2px auto;
}

.advertencia-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: calc(10.5px * var(--ui-scale));
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}
.advertencia-badge.advertencia-aviso {
  color: var(--neon-orange);
  background: rgba(232, 176, 100, 0.1);
  border-color: rgba(232, 176, 100, 0.3);
}
.advertencia-badge.advertencia-penalidade {
  color: #ff8a8d;
  background: rgba(229, 72, 77, 0.1);
  border-color: rgba(229, 72, 77, 0.32);
}

/* Coluna "Mortes por Plebiscito" com tom levemente diferente */
.col-plebiscito, .cell-plebiscito {
  background: rgba(185, 140, 240, 0.045);
  border-left: 1px solid var(--line);
}

/* Célula de destino ao arrastar um jogador do Status da Cidade */
.history-drop-cell {
  transition: background 0.15s ease;
}
.history-drop-cell.drop-target {
  background: rgba(255, 176, 102, 0.08) !important;
  outline: 1px dashed rgba(255, 176, 102, 0.5);
  outline-offset: -3px;
}

/* Lixeira para remover o jogador da célula: aparece POR CIMA da foto (um
   disco vermelho a 75% cobrindo a foto inteira) quando o mouse passa na foto.
   Fica dentro do .table-avatar-wrap (ver fillCell em main.js). */
.cell-clear-btn {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  inset: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(229, 72, 77, 0.75);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}
.cell-clear-btn svg {
  width: 45%;
  height: 45%;
}
.table-avatar-wrap:hover .cell-clear-btn,
.cell-clear-btn:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Jogador numa célula do histórico: a foto e, logo abaixo, o nome (sem o @),
   centralizados. */
.table-player-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--hist-gap) * var(--k, 1));
  width: 100%;
  min-width: 0;
}
/* Wrapper da foto: mesmo tamanho dela, pra a lixeira cobri-la exatamente.
   --k é o fator de compactação (1 = normal; a coluna Morto o reduz quando há
   vários jogadores - ver .mortos-grid). */
.table-avatar-wrap {
  position: relative;
  width: calc(var(--hist-avatar) * var(--k, 1));
  height: calc(var(--hist-avatar) * var(--k, 1));
  flex-shrink: 0;
}
.table-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ink);
  box-shadow: 0 0 0 1.5px var(--cell-ring, var(--line-2)), 0 0 14px color-mix(in srgb, var(--cell-ring, transparent) 30%, transparent);
  flex-shrink: 0;
}
.player-info-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  min-width: 0;
  max-width: 100%;
  text-align: center;
}
.player-name {
  /* Sem largura máxima o "..." nunca acontecia e o nome vazava da célula. */
  max-width: 100%;
  font-weight: 600;
  letter-spacing: 0.03em;
  /* Nunca menor que o menor texto da interface (--hist-name-min). */
  font-size: max(calc(var(--hist-name) * var(--k, 1)), var(--hist-name-min));
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* COLUNA MORTO com vários jogadores (ver layoutMortos em main.js).
   A célula guarda no máximo 4 "vagas" (grade de 2 colunas): 1 = tamanho normal;
   2 = lado a lado; 3 = 2 em cima e 1 embaixo, centralizado; 4 = 2x2. Com mais
   de 4 mortos, as 3 primeiras vagas ficam com jogadores e a 4ª vira "+N" (com
   a lista completa num popover). A altura da linha praticamente não cresce.

   Compactação: o fator --k = 1/raiz(n), com n = número de vagas da grade
   (1, 2, 4 e 4: 3 mortos usam a mesma grade 2x2 do que 4), mantém constante a
   ÁREA total das vagas (n fotos com lado k x o normal = 1 foto normal). Então
   quanto mais mortos, menor cada um - foto, fonte do nome e espaços, todos
   derivados dos tokens --hist-* acima - e a linha quase não cresce. O nome
   nunca fica menor que --hist-name-min. */
.mortos-grid {
  --n: 1;
  --k: 1;
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  gap: calc(var(--hist-cell-gap) * var(--k));
  justify-items: center;
  align-items: start;
  width: 100%;
}
.mortos-grid[data-count="2"] { --n: 2; --cols: 2; --k: 0.7071; }
.mortos-grid[data-count="3"] { --n: 4; --cols: 2; --k: 0.5; }
.mortos-grid[data-count="4"] { --n: 4; --cols: 2; --k: 0.5; }
@supports (width: calc(sqrt(4) * 1px)) {
  .mortos-grid[data-count="2"],
  .mortos-grid[data-count="3"],
  .mortos-grid[data-count="4"] {
    --k: calc(1 / sqrt(var(--n)));
  }
}
/* O terceiro fica sozinho na segunda linha, centralizado, com a largura de uma coluna. */
.mortos-grid[data-count="3"] > .table-player-badge:nth-child(3) {
  grid-column: 1 / -1;
  width: calc((100% - var(--hist-cell-gap) * var(--k)) / 2);
}
.mortos-grid > .table-player-badge.is-overflow {
  display: none;
}

/* "+N": ocupa a 4ª vaga, do tamanho de uma foto compactada. */
.mortos-more {
  width: calc(var(--hist-avatar) * var(--k));
  height: calc(var(--hist-avatar) * var(--k));
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-family: inherit;
  font-size: max(calc(var(--hist-name) * var(--k)), var(--hist-name-min));
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.mortos-more:hover,
.mortos-more:focus-visible,
.mortos-more[aria-expanded="true"] {
  background: rgba(229, 72, 77, 0.2);
  border-color: var(--neon-red);
  outline: none;
}

/* Popover com a lista completa dos mortos da rodada (um só, no <body>, posicionado
   com position:fixed pra não ser cortado pela rolagem da tabela). */
.mortos-popover {
  --k: 0.7071; /* fotos no tamanho do "2 mortos" */
  position: fixed;
  z-index: 1500;
  min-width: calc(160px * var(--ui-scale));
  max-width: calc(260px * var(--ui-scale));
  max-height: 60vh;
  overflow-y: auto;
  padding: calc(var(--hist-cell-gap) * 1.25);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
.mortos-popover[hidden] {
  display: none;
}
.mortos-popover-title {
  margin: 0 0 var(--hist-cell-gap);
  font-size: var(--hist-name-min);
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.mortos-popover-item {
  display: flex;
  align-items: center;
  gap: calc(var(--hist-cell-gap) * 1.25);
  padding: calc(var(--hist-gap) / 2) 0;
}
.mortos-popover-item .table-avatar-wrap {
  width: calc(var(--hist-avatar) * var(--k));
  height: calc(var(--hist-avatar) * var(--k));
}
.mortos-popover-name {
  flex: 1;
  min-width: 0;
  font-size: max(calc(var(--hist-name) * var(--k)), var(--hist-name-min));
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Remover pelo popover (mesma ação da lixeira sobre a foto). */
.mortos-popover-remove {
  flex-shrink: 0;
  width: calc(var(--hist-avatar) * var(--k));
  height: calc(var(--hist-avatar) * var(--k));
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.mortos-popover-remove svg {
  width: 55%;
  height: 55%;
}
.mortos-popover-remove:hover,
.mortos-popover-remove:focus-visible {
  background: rgba(229, 72, 77, 0.75);
  color: #fff;
  outline: none;
}

/* Estilo do traço vazio */
.history-table td:empty, 
.history-table td:contains("—") {
  color: var(--text-muted);
}

/* ==========================================================================
   CARDS DE JOGADORES (RODAPÉ - ZOOM AUMENTADO)
   ========================================================================== */

/* Coluna esquerda do Painel: Status da Cidade em cima e Preview Display
   embaixo, com a divisória horizontal entre eles. Leva a fatia horizontal
   (--split-left) e a vertical (--split-top, fatia do Status da Cidade). */
.left-stack {
  flex: var(--split-left) 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  --split-top: 52;
}

/* Card "Status da Cidade". O item flex em si não tem padding/borda (ficam no
   wrapper interno) para que a proporção com o Preview (--split-top) seja exata. */
.city-status-panel {
  flex: var(--split-top) 1 0;
  min-width: 0;
  min-height: 0;
}
.city-status-inner {
  width: 100%;
  height: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 30px 60px -34px rgba(0, 0, 0, 0.9);
  padding: 2.2vh 1.8vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Duas colunas ordenáveis (drag and drop) */
.city-status-columns {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2vw;
  overflow: hidden;
}

.city-status-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-width: 0;
  overflow-y: auto;
  padding-right: 4px;
}

/* Coluna única (ver initCityStatusLayout): quando duas colunas não cabem sem
   cortar o nome do personagem, as duas ficam empilhadas dentro de UM só
   container com rolagem. */
.city-status-columns.is-single {
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
}
.city-status-columns.is-single .city-status-column {
  height: auto;
  overflow: visible;
  padding-right: 0;
}
.city-status-columns.is-single .city-status-column + .city-status-column {
  margin-top: 10px;
}
.city-status-columns.is-single .city-status-column:empty {
  display: none;
}

/* Placeholder visual do espaço vazio ao arrastar sobre uma coluna */
.city-status-column.drag-over {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

/* CARD DE JOGADOR BASE - layout em 2 blocos horizontais:
   (1) card-left: foto + nome e, logo abaixo, o personagem do jogador na
   partida (ocupa o espaço que era do @);
   (2) card-right: os dois cartões (amarelo = aviso, vermelho = multa) e os
   botões − / + logo abaixo.
   Identidade noir: vidro escuro com um filete aceso na cor do time (--team,
   ver os cards temáticos abaixo) na borda esquerda e uma luz da mesma cor
   vazando por trás da foto - no lugar da borda neon inteira. */
.player-card {
  --team: var(--neon-grey);
  position: relative;
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--team) 14%, transparent), transparent 46%),
    var(--bg-control);
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--team) 26%, var(--border-card-default));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 8px 10px 8px 13px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  transition: background 0.25s ease, border-color 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease, transform 0.2s var(--ease-out), filter 0.4s ease;
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
  cursor: grab;
  /* Sem isso, iniciar o arraste sobre o nome/@arroba/personagem (texto
     selecionável) faz o navegador começar uma seleção de texto em vez de
     disparar o dragstart do card - só a foto (não selecionável) arrastava. */
  user-select: none;
  -webkit-user-select: none;
  /* No Safari, um <div draggable="true"> só é de fato arrastável se também
     tiver -webkit-user-drag:element - sem isso, apenas elementos com drag
     nativo (como a <img> da foto) respondem, e o resto do card ignora o
     draggable="true" do HTML. */
  -webkit-user-drag: element;
}
/* Filete do time, aceso, na borda esquerda. */
.player-card::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--team);
  box-shadow: 0 0 10px var(--team);
}
.player-card:hover {
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--team) 20%, transparent), transparent 52%),
    var(--bg-control-hover);
  border-color: color-mix(in srgb, var(--team) 45%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 30px -18px rgba(0, 0, 0, 0.9);
  transform: translateY(-1px);
}
.player-card.dragging {
  opacity: 0.35;
  cursor: grabbing;
}

/* Efeito de foco visual no card */
.card-focused {
  box-shadow: 0 0 0 1px var(--team), 0 0 26px color-mix(in srgb, var(--team) 35%, transparent);
}

/* Bloco esquerdo: foto + identidade. Ocupa o espaço que sobra (min-width:0
   deixa o nome encolher com "..." em vez de empurrar os botões pra fora). */
.card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: stretch;
  flex: 1 1 auto;
  min-width: 0;
}

/* Avatar redondo dimensionado para preencher a altura do card. Um tamanho
   fixo (em vez de derivar de aspect-ratio/stretch) evita depender do
   tamanho intrínseco da imagem, que faria o card inflar descontroladamente.
   Anel na cor do time, com uma folga escura entre o anel e a foto. */
.card-avatar-wrapper {
  position: relative;
  width: calc(40px * var(--ui-scale));
  height: calc(40px * var(--ui-scale));
  min-width: calc(40px * var(--ui-scale));
  align-self: center;
  flex-shrink: 0;
}
.card-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ink);
  box-shadow: 0 0 0 1.5px var(--team), 0 0 14px color-mix(in srgb, var(--team) 30%, transparent);
  transition: filter 0.4s ease;
}

/* Identidade do jogador - centralizada verticalmente ao longo da altura
   total. Ocupa o espaço que sobra entre a foto e os botões (sem o texto do
   personagem no meio do card, o nome aparece por inteiro). */
.player-identity {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
}
.card-name {
  font-size: calc(13px * var(--ui-scale));
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
/* Personagem do jogador na partida, na cor do papel (role-color-*). */
.card-role {
  font-family: var(--font-mono);
  font-size: calc(9.5px * var(--ui-scale));
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  /* Nunca cortado: o layout do Status da Cidade (initCityStatusLayout) garante
     a largura mínima pra ele caber; só o nome do jogador vira "...". */
  overflow: visible;
}

/* Bloco direito: cartões de aviso/multa + botões. */
.card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  flex: 0 0 auto;
}

/* Carimbo "ELIMINADO" (oculto enquanto o jogador está vivo), como o "Morto"
   da tela dos jogadores. */
.status-badge {
  position: absolute;
  top: -7px;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px 1px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: calc(8px * var(--ui-scale));
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  min-width: 0;
  max-width: 90px;
  z-index: 1;
  transform: rotate(-4deg);
}
.status-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Avisos e multas como cartões de futebol: o amarelo acende com o 1º aviso;
   o 2º aviso vira multa (-1 ponto), apaga o amarelo e acende o vermelho, que
   guarda a contagem de multas. O botão "+" fica vermelho quando o próximo
   clique já fecha uma multa. */
.discipline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.discipline-cards {
  display: flex;
  align-items: center;
  gap: 5px;
  height: calc(16px * var(--ui-scale));
}
.dcard {
  box-sizing: border-box;
  width: calc(11px * var(--ui-scale));
  min-width: calc(11px * var(--ui-scale));
  height: 100%;
  border-radius: 2.5px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-6deg);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.35s var(--ease-back);
}
.dcard-yellow {
  border-color: rgba(242, 201, 76, 0.28);
}
.dcard-yellow.is-on {
  background: linear-gradient(160deg, #f6d469, #d9a92c);
  border-color: #f2c94c;
  box-shadow: 0 0 10px rgba(242, 201, 76, 0.45);
  transform: rotate(-6deg) scale(1.08);
}
.dcard-red {
  border-color: rgba(229, 72, 77, 0.28);
  padding: 0 2px;
}
.dcard-red.is-on {
  background: linear-gradient(160deg, #ff6b6f, var(--neon-red));
  border-color: var(--neon-red);
  box-shadow: 0 0 10px rgba(229, 72, 77, 0.5);
  transform: rotate(-6deg) scale(1.08);
}
.dcard-count {
  font-family: var(--font-mono);
  font-size: calc(9px * var(--ui-scale));
  font-weight: 500;
  line-height: 1;
  color: #fff;
  transform: rotate(6deg);
}
.discipline-btns {
  display: flex;
  gap: 4px;
}
.discipline-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(22px * var(--ui-scale));
  height: calc(18px * var(--ui-scale));
  padding: 0;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: calc(13px * var(--ui-scale));
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.discipline-btn:hover {
  background: var(--bg-control-hover);
  border-color: var(--line-2);
  color: var(--text-primary);
}
.discipline-btn:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}
.discipline-btn[data-discipline="add"] {
  background: rgba(242, 201, 76, 0.12);
  border-color: rgba(242, 201, 76, 0.3);
  color: #f2c94c;
}
.discipline-btn[data-discipline="add"]:hover {
  background: rgba(242, 201, 76, 0.24);
}
.discipline-btn[data-discipline="add"].is-penalty {
  background: rgba(229, 72, 77, 0.16);
  border-color: rgba(229, 72, 77, 0.4);
  color: #ff8a8d;
}
.discipline-btn[data-discipline="add"].is-penalty:hover {
  background: rgba(229, 72, 77, 0.32);
}

/* ==========================================================================
   ESTILOS DE CARDS TEMÁTICOS (cor do time no filete, na foto e na luz)
   ========================================================================== */

/* Time Pró-Cidade: Morador (azul) */
.card-blue { --team: var(--neon-blue); }

/* Time Pró-Cidade: Detetive e Anjo (amarelo) */
.card-yellow { --team: var(--neon-gold); }

/* Time Contra-Cidade: Assassino (vermelho) */
.card-red { --team: var(--neon-red); }

/* Time Contra-Cidade: Traidor (roxo) */
.card-purple { --team: var(--neon-purple); }

.card-grey { --team: var(--neon-grey); }
.badge-grey {
  border: 1px solid rgba(229, 72, 77, 0.7);
  background: rgba(24, 6, 8, 0.92);
  color: #ff8a8d;
  box-shadow: 0 0 12px rgba(229, 72, 77, 0.25);
}

/* Eliminado: foto em preto e branco (vivo é sempre colorido), card apagado. */
.status-eliminated {
  opacity: 0.55;
}
.status-eliminated .card-avatar {
  filter: grayscale(1) brightness(0.7);
}
.status-eliminated .card-name {
  text-decoration: line-through;
  text-decoration-color: rgba(229, 72, 77, 0.7);
}
.status-eliminated:hover {
  opacity: 0.85;
}

/* ==========================================================================
   CONTROLE DE ZOOM (fixo na tela, fora da área escalada)
   ========================================================================== */

.zoom-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(12, 13, 17, 0.72);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 6px 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.zoom-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}
.zoom-level {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: center;
}

/* ==========================================================================
   VISÕES (PAINEL / JOGADORES / RANKING / HISTÓRICO)
   ========================================================================== */

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.placeholder-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
  background: var(--bg-panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  margin: 2vh 0;
}

/* ==========================================================================
   ABA HISTÓRICO: navegação entre partidas + reaproveita os cards do Painel
   ========================================================================== */

.historico-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 1.6vh 0;
  flex-shrink: 0;
}
.historico-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.historico-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}
.historico-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.historico-nav-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 130px;
}
.historico-nav-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--text-secondary);
}
.historico-nav-number {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 34px;
  font-weight: 400;
  color: var(--text-primary);
}

.historico-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1.6vh;
}

/* ==========================================================================
   ABA JOGADORES - CADASTRO/GESTÃO DO ELENCO
   ========================================================================== */

.players-panel {
  flex: 1;
  min-height: 0;
  margin: 2vh 0;
}
.players-panel-inner {
  width: 100%;
  height: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 30px 60px -34px rgba(0, 0, 0, 0.9);
  padding: 2.5vh 2.2vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.btn-add-player {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 8px 16px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-add-player:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.players-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.players-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.players-search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}
.players-search-input {
  width: 260px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 8px 14px 8px 36px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 13px;
  transition: all 0.15s ease;
}
.players-search-input::placeholder {
  color: var(--text-muted);
}
.players-search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
}

.players-table-container {
  flex: 1;
  overflow-y: auto;
  padding-right: 12px;
}
.players-table {
  width: 100%;
  border-collapse: collapse;
}
.players-table th {
  text-align: left;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-bottom: 1px solid var(--border-color);
}
.players-table .col-player-avatar { width: 56px; }
.players-table .col-player-active { width: 80px; text-align: center; }
.players-table .col-player-senha { width: 160px; }
.players-table .col-player-lastgame { width: 170px; }

.players-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}
.players-table th.sortable:hover {
  color: var(--text-primary);
}
.players-table th.sortable .sort-icon {
  display: inline-block;
  margin-left: 4px;
  width: 8px;
  opacity: 0.3;
}
.players-table th.sortable .sort-icon::after {
  content: '▲';
  font-size: 8px;
}
.players-table th.sortable.sort-desc .sort-icon::after {
  content: '▼';
}
.players-table th.sortable.sort-active .sort-icon {
  opacity: 1;
  color: var(--neon-red);
}

.player-lastgame-cell {
  font-size: 13px;
  color: var(--text-secondary);
}
.player-lastgame-cell.never-played {
  color: var(--text-muted);
  font-style: italic;
}

.ranking-table .col-ranking-pos { width: 48px; }
.ranking-table .col-ranking-matches,
.ranking-table .col-ranking-wins,
.ranking-table .col-ranking-warns,
.ranking-table .col-ranking-penalties,
.ranking-table .col-ranking-points { width: 100px; text-align: center; }
.ranking-table td.cell-ranking-pos,
.ranking-table td.cell-ranking-matches,
.ranking-table td.cell-ranking-wins,
.ranking-table td.cell-ranking-warns,
.ranking-table td.cell-ranking-penalties,
.ranking-table td.cell-ranking-points {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ranking-table td.cell-ranking-pos {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  font-weight: 400;
  color: var(--text-secondary);
}
.ranking-table td.cell-ranking-warns {
  color: var(--neon-orange);
}
.ranking-table td.cell-ranking-penalties {
  color: var(--neon-red);
}
.ranking-table .col-ranking-points,
.ranking-table td.cell-ranking-points {
  background: rgba(255, 255, 255, 0.055);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.ranking-table td.cell-ranking-points {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 28px;
  color: var(--neon-red);
}
.ranking-table tr[data-pos="1"] td.cell-ranking-pos { color: var(--lamp); }
.ranking-table tr[data-pos="2"] td.cell-ranking-pos { color: #c9ccd3; }
.ranking-table tr[data-pos="3"] td.cell-ranking-pos { color: #c98d5e; }
.players-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}
.players-table tr:last-child td {
  border-bottom: none;
}

.player-table-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: block;
}

/* Botão que envolve a foto na tabela - clicar abre o seletor de
   arquivo/câmera do dispositivo para trocar a foto do jogador */
.player-avatar-btn {
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: block;
}
.player-avatar-edit-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--neon-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-panel);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}
.player-avatar-btn:hover .player-avatar-edit-badge,
.player-avatar-btn:focus-visible .player-avatar-edit-badge {
  opacity: 1;
  transform: scale(1);
}

/* Círculo com iniciais - usado quando o jogador não tem foto definida */
.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1d1e25, var(--ink-3));
  color: var(--text-secondary);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  border: 1px solid var(--line-2);
}

.player-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 13.5px;
  transition: all 0.15s ease;
}
.player-input:hover {
  background: rgba(255, 255, 255, 0.03);
}
.player-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(229, 72, 77, 0.4);
}

/* Coluna Nome: foto, nome e quantos aparelhos estão na conta */
.player-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.player-name-cell .player-input {
  flex: 1;
  min-width: 0;
}
.player-avatar-slot,
.player-presence-slot {
  flex: none;
}

/* Botão de presença/desconectar: "online" com 1 aparelho, vermelho com 2+
   (alguém na conta errada) e, sem nenhum, só aparece ao passar o mouse */
.player-presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.player-presence:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}
.player-presence-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.player-presence.is-online {
  color: var(--alive);
  border-color: rgba(127, 214, 164, 0.3);
  background: rgba(127, 214, 164, 0.07);
}
.player-presence.is-multi {
  color: #f5a3a6;
  border-color: rgba(229, 72, 77, 0.55);
  background: rgba(229, 72, 77, 0.14);
}
.player-presence.is-multi .player-presence-dot {
  background: var(--neon-red);
  box-shadow: 0 0 8px var(--neon-red);
  animation: player-presence-pulse 1.2s ease-in-out infinite;
}
.player-presence.is-offline {
  opacity: 0;
}
.player-presence.is-offline .player-presence-dot {
  display: none;
}
.players-table tr:hover .player-presence.is-offline,
.player-presence.is-offline:focus-visible {
  opacity: 1;
}
@keyframes player-presence-pulse {
  50% { opacity: 0.35; }
}

/* Arroba/WhatsApp (login): "@" fixo dentro da caixa e aviso de repetido */
.player-login-box {
  position: relative;
}
.player-handle-at {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13.5px;
  pointer-events: none;
}
.player-login-field[data-login-field="handle"] .player-input {
  padding-left: 23px;
}
.player-login-field.is-conflict .player-input {
  border-color: rgba(229, 72, 77, 0.6);
  background: rgba(229, 72, 77, 0.08);
}
.player-field-error {
  display: block;
  padding: 3px 9px 0;
  font-size: 11px;
  color: #f5a3a6;
}
.player-field-error:empty {
  display: none;
}

/* Senha atrás do cadeado: fechado mostra ••••••, aberto vira campo editável */
.player-senha-open {
  display: flex;
  align-items: center;
  gap: 2px;
}
.player-senha-open .player-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
}
.player-senha-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.player-senha-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}
.player-senha-toggle.is-open {
  color: var(--neon-orange);
}
.player-senha-mask {
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
}
.player-senha-mask.is-empty {
  font-family: var(--font-main);
  font-style: italic;
  letter-spacing: normal;
  color: var(--text-muted);
}

.player-active-cell {
  text-align: center;
}

/* Switch (toggle) de Ativo/Inativo */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.switch-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  transition: background 0.15s ease;
}
.switch-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}
.switch input:checked + .switch-slider {
  background: var(--success);
}
.switch input:checked + .switch-slider::before {
  transform: translateX(16px);
}

/* ==========================================================================
   MODAL: NOVA PARTIDA
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 7, 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
}
.modal-panel {
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  background: var(--bg-card);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.modal-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--text-primary);
}
.modal-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.new-match-summary {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}
.new-match-summary span {
  color: var(--text-primary);
  font-weight: 700;
}

.role-quantity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.role-quantity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 14px;
}
.role-quantity-item.role-quantity-remainder {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.02);
}
.role-quantity-label {
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.quantity-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.role-quantity-item.role-quantity-remainder .role-quantity-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}
.role-stepper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.role-stepper-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}
.role-stepper-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.quantity-stepper .role-quantity-value {
  min-width: 18px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.new-match-actions-row {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.btn-sortear {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--lamp);
  border: none;
  border-radius: 24px;
  padding: 11px 26px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px -6px rgba(255, 75, 69, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.15s ease;
}
.btn-sortear:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.new-match-draw-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}
.draw-result-group {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 12px;
}
.draw-result-group.draw-result-group-evil {
  background: rgba(229, 72, 77, 0.08);
  border-color: rgba(229, 72, 77, 0.25);
}
.draw-result-title {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}
.draw-result-members {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.draw-result-member {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  padding: 4px 10px 4px 4px;
}
.draw-result-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  font-size: 10px;
}
.draw-result-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-confirm-start {
  width: 100%;
  background: linear-gradient(135deg, var(--lamp), var(--blood-deep));
  border: none;
  border-radius: 24px;
  padding: 13px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-confirm-start:hover:not(:disabled) {
  filter: brightness(1.1);
}
.btn-confirm-start:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ==========================================================================
   MODAL: MENU DE FOTO DO JOGADOR
   ========================================================================== */

.photo-menu-panel {
  max-width: 360px;
}
.photo-menu-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.photo-menu-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 13px 16px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.photo-menu-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}
.photo-menu-btn-danger {
  color: var(--neon-red);
}
.photo-menu-btn-danger:hover {
  background: rgba(229, 72, 77, 0.1);
  border-color: rgba(229, 72, 77, 0.3);
}
.photo-menu-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   MODAL: GENÉRICO (confirmação / aviso do jogo - substitui confirm()/alert())
   ========================================================================== */

.app-modal-panel {
  max-width: 400px;
}
.app-modal-message {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-line;
}
.app-modal-footer {
  display: flex;
  gap: 10px;
}
.app-modal-footer .btn-confirm-start {
  flex: 1;
}
.btn-modal-cancel {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 13px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Modal de escolha do time vencedor (Encerrar Partida) */
.winner-choice-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.winner-choice-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-main);
}
.winner-choice-label {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}
.winner-choice-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}
.winner-choice-bem:hover {
  background: rgba(127, 214, 164, 0.12);
  border-color: rgba(127, 214, 164, 0.4);
}
.winner-choice-bem:hover .winner-choice-label {
  color: var(--success);
}
.winner-choice-mal:hover {
  background: rgba(229, 72, 77, 0.12);
  border-color: rgba(229, 72, 77, 0.4);
}
.winner-choice-mal:hover .winner-choice-label {
  color: var(--neon-red);
}

/* ==========================================================================
   RESPONSIVIDADE AJUSTADA
   ========================================================================== */

@media (max-width: 900px) {
  .sidebar {
    width: 60px;
    padding: 16px 0;
  }
  .sidebar-logo, .nav-label, .logo-collapsed-text, .settings-label, .sidebar-footer-user {
    display: none !important;
  }
  .menu-item, .nav-item {
    justify-content: center;
    padding: 12px 0;
  }
  .main-panels-row {
    flex-direction: column;
    height: auto;
    gap: 1.6vh;
  }
  .panel-resizer {
    display: none;
  }
  /* Sem altura definida a coluna esquerda não reparte espaço: cada sessão ganha uma altura própria. */
  .left-stack {
    flex: none;
  }
  .left-stack .city-status-panel,
  .left-stack .preview-panel {
    flex: none;
    height: 50vh;
  }
  .left-stack.is-preview-collapsed .preview-panel {
    height: auto;
  }
}

/* ==========================================================================
   VOTAÇÃO AO VIVO: "Votar" x "Dormir" (e Condenação / veredito) - sessão
   acoplada na coluna do Histórico da Partida. Abre de baixo pra cima (a
   coluna do Histórico encolhe e a sessão cresce) em vez de um pop-up por cima
   de tudo, então música, cartões, cronômetro etc. seguem utilizáveis. Timer
   de 30s sincronizado com o celular de cada player (ver initVotingControl em
   main.js e a mesma sessão em player.js). O timer roda independente em cada
   cliente, calculado a partir do mesmo iniciada_em salvo em mafia_cache -
   não precisa de um "tick" central, só o mesmo ponto de partida.
   ========================================================================== */

/* Coluna direita: Histórico em cima e, com a votação aberta, a sessão embaixo
   (--split-hist = fatia do Histórico, em %, ajustável pela divisória). Fechada,
   a sessão e a divisória têm altura 0 e o Histórico ocupa a coluna toda. */
.right-stack {
  --split-hist: 54;
  gap: 0;
}
.right-stack .dashboard-panel {
  flex: 1 1 0;
  transition: flex-grow 0.35s ease;
}
.right-stack.is-vote-open .dashboard-panel {
  flex-grow: var(--split-hist);
}
.vote-dock {
  flex: 0 1 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: flex-grow 0.35s ease, opacity 0.25s ease, visibility 0s linear 0.35s;
}
.right-stack.is-vote-open .vote-dock {
  flex-grow: calc(100 - var(--split-hist));
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
/* Fase final (a cidade dorme / defesa): a sessão esmaece sozinha antes de fechar. */
.vote-dock.is-fading {
  opacity: 0;
  transition: opacity 1.2s ease;
}
/* A divisória só aparece com a sessão aberta. */
.right-stack:not(.is-vote-open) .panel-resizer-vote {
  flex-basis: 0;
  min-height: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .right-stack .dashboard-panel,
  .vote-dock {
    transition: none;
  }
}

.vote-dock-inner {
  width: 100%;
  height: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 30px 60px -34px rgba(0, 0, 0, 0.9);
  padding: 2.2vh 1.8vw;
  display: flex;
  flex-direction: column;
  gap: 1.4vh;
  overflow: hidden;
  /* Os conteúdos entram subindo, junto com a sessão. */
  transform: translateY(24px);
  transition: transform 0.35s ease;
}
.right-stack.is-vote-open .vote-dock-inner {
  transform: translateY(0);
}

.vote-session-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  flex-shrink: 0;
}

.vote-session-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: calc(28px * var(--ui-scale));
  font-weight: 400;
  line-height: 1;
  color: var(--text-primary);
  margin: 0;
}

.vote-session-timer {
  display: flex;
  justify-content: flex-end;
  font-family: var(--font-serif);
  font-size: calc(48px * var(--ui-scale));
  font-weight: 400;
  line-height: 0.9;
  color: var(--text-primary);
  transition: opacity 0.15s ease;
}
.vote-session-timer.is-ending {
  color: var(--neon-red);
}
/* Parado (antes do primeiro play ou pausado): o número fica apagado. */
.vote-session-timer.is-paused {
  opacity: 0.55;
}

/* Timer + controles: [relógio com a barra embaixo] [play/pause] [lápis: mudar o
   tempo] [X: cancelar]. A barra é a mesma do relógio principal (.timer-progress). */
.vote-session-timer-group {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.vote-session-timer-group[hidden] {
  display: none;
}
.vote-session-clock {
  display: flex;
  flex-direction: column;
  gap: calc(6px * var(--ui-scale));
  min-width: calc(150px * var(--ui-scale));
}
.vote-session-play-btn,
.vote-session-time-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-control);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.vote-session-play-btn:hover,
.vote-session-time-btn:hover,
.vote-session-time-btn[aria-expanded="true"] {
  background: var(--bg-control-hover);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}
.vote-session-play-btn {
  width: calc(46px * var(--ui-scale));
  height: calc(46px * var(--ui-scale));
  border-radius: 10px;
  padding: 0;
}
/* Rodando: o botão vira "pausar" em vermelho, como um lembrete de que está valendo. */
.vote-session-play-btn[data-state="running"] {
  color: var(--neon-red);
  border-color: rgba(229, 72, 77, 0.4);
}
.vote-session-time-btn {
  width: calc(46px * var(--ui-scale));
  height: calc(46px * var(--ui-scale));
  padding: 0;
  border-radius: 10px;
}

/* Cancelar votação: só o "X" (o rótulo fica no tooltip). Avermelha ao passar o mouse. */
.vote-session-cancel-btn {
  width: calc(46px * var(--ui-scale));
  height: calc(46px * var(--ui-scale));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 10px;
  background: var(--bg-control);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.vote-session-cancel-btn:hover,
.vote-session-cancel-btn:focus-visible {
  background: rgba(229, 72, 77, 0.14);
  border-color: rgba(229, 72, 77, 0.4);
  color: var(--neon-red);
  outline: none;
}
.vote-session-cancel-btn[hidden] {
  display: none;
}

.vote-dock-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2vh;
}
/* [hidden] perde pra display:flex/grid dos blocos abaixo sem isso. */
.vote-dock-body > [hidden] {
  display: none !important;
}

.vote-session-accused {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-shrink: 0;
}
.vote-session-accused-avatar {
  width: calc(48px * var(--ui-scale));
  height: calc(48px * var(--ui-scale));
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--text-primary);
  transition: filter 0.9s ease, border-color 0.9s ease;
}
.vote-session-accused-name {
  font-size: calc(18px * var(--ui-scale));
  font-weight: 700;
  color: var(--text-primary);
}
.vote-session-accused.is-condenado .vote-session-accused-avatar {
  filter: grayscale(1);
  border-color: #6b7280;
}
.vote-session-accused-caption {
  font-size: calc(13px * var(--ui-scale));
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.vote-session-accused-caption[hidden] {
  display: none;
}
/* Tempo de defesa: a tela intermediária entre a Condenação e o veredito - a foto e o
   nome de quem se defende ocupam a sessão (o timer de 1 min fica no cabeçalho). */
.vote-session-accused.is-defesa {
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
}
.vote-session-accused.is-defesa .vote-session-accused-avatar {
  width: auto;
  height: clamp(48px, 17vh, calc(96px * var(--ui-scale)));
  aspect-ratio: 1;
}
.vote-session-accused.is-defesa .vote-session-accused-name {
  font-size: calc(24px * var(--ui-scale));
}

.vote-session-resultado {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: vote-sleeping-in 0.6s ease-out;
}
.vote-session-resultado-word {
  font-size: calc(36px * var(--ui-scale));
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--success);
}
.vote-session-resultado.is-condenado .vote-session-resultado-word {
  color: var(--neon-red);
}

.vote-session-columns {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.vote-session-column {
  min-height: 0;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vote-session-column-votar {
  border-color: rgba(229, 72, 77, 0.3);
}
.vote-session-column-dormir {
  border-color: rgba(126, 166, 224, 0.3);
}

.vote-session-column-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: calc(13px * var(--ui-scale));
  font-weight: 700;
}
.vote-session-column-votar .vote-session-column-header {
  background: rgba(229, 72, 77, 0.12);
  color: var(--neon-red);
}
.vote-session-column-dormir .vote-session-column-header {
  background: rgba(126, 166, 224, 0.12);
  color: var(--neon-blue);
}

.vote-session-count {
  font-size: calc(17px * var(--ui-scale));
  font-weight: 800;
}
/* Quanto falta pra esse lado ter a maioria (a mesma informação dos celulares e do Display). */
.vote-session-need {
  margin-left: auto;
  margin-right: 10px;
  font-family: var(--font-mono);
  font-size: calc(10.5px * var(--ui-scale));
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.8;
}
.vote-session-need.is-maioria {
  color: var(--success);
  opacity: 1;
}

.vote-session-player-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  overflow-y: auto;
}

.vote-session-player {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: calc(12.5px * var(--ui-scale));
  color: var(--text-primary);
}

.vote-session-player-avatar {
  width: calc(24px * var(--ui-scale));
  height: calc(24px * var(--ui-scale));
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Fases transitórias "a cidade dorme" e "tempo de defesa": ícone + frase,
   com uma animação suave de entrada; a sessão esmaece sozinha logo em seguida
   (.vote-dock.is-fading, alternado via JS). */
.vote-session-sleeping {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  animation: vote-sleeping-in 0.6s ease-out;
}
@keyframes vote-sleeping-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.vote-session-sleeping-icon {
  font-size: calc(44px * var(--ui-scale));
}
.vote-session-sleeping-img {
  height: calc(72px * var(--ui-scale));
  width: auto;
}
.vote-session-sleeping-text {
  font-size: calc(22px * var(--ui-scale));
  font-weight: 700;
  color: var(--text-primary);
}

/* Fase 2 "Condenação" - 1 linha por jogador vivo, ordenada por quem tem
   mais votos; o(s) líder(es) ganham destaque vermelho. Cada linha mostra a
   PORCENTAGEM dos votos já dados (a mesma que os celulares veem), com barra, e
   o resumo no topo diz quantos já votaram, a maioria necessária e o que falta. */
.vote-session-condenacao {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1vh;
}
.vote-session-condenacao-summary {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: calc(12.5px * var(--ui-scale));
  color: var(--text-secondary);
}
.vote-session-condenacao-summary strong {
  color: var(--text-primary);
  font-weight: 700;
}
.vote-session-condenacao-summary .is-ok {
  color: var(--success);
  font-weight: 700;
}
.vote-session-condenacao-summary .is-warn {
  color: var(--amber);
  font-weight: 700;
}
.vote-session-condenacao-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}
.vote-session-condenacao-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  flex-shrink: 0;
}
.vote-session-condenacao-row.is-leading {
  border-color: var(--neon-red);
  background: rgba(229, 72, 77, 0.1);
}
.vote-session-condenacao-avatar {
  width: calc(28px * var(--ui-scale));
  height: calc(28px * var(--ui-scale));
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.vote-session-condenacao-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vote-session-condenacao-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.vote-session-condenacao-name {
  flex-shrink: 0;
  font-size: calc(13px * var(--ui-scale));
  font-weight: 600;
  color: var(--text-primary);
}
.vote-session-condenacao-voters {
  flex: 1;
  min-width: 0;
  font-size: calc(11px * var(--ui-scale));
  color: var(--text-secondary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vote-session-condenacao-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.vote-session-condenacao-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: var(--text-muted);
  transition: width 0.3s ease;
}
.vote-session-condenacao-row.is-leading .vote-session-condenacao-fill {
  background: var(--neon-red);
}
.vote-session-condenacao-pct {
  flex-shrink: 0;
  min-width: 3.4em;
  font-size: calc(17px * var(--ui-scale));
  font-weight: 800;
  text-align: right;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.vote-session-condenacao-row.is-leading .vote-session-condenacao-pct {
  color: var(--neon-red);
}
.vote-session-condenacao-count {
  flex-shrink: 0;
  min-width: 2.6em;
  font-size: calc(11.5px * var(--ui-scale));
  font-weight: 600;
  text-align: right;
  color: var(--text-muted);
}

/* Janela pequena (colunas empilhadas): a sessão ganha uma altura própria e a divisória some. */
@media (max-width: 900px) {
  .right-stack.is-vote-open .vote-dock {
    flex: none;
    height: 60vh;
  }
  .panel-resizer-vote {
    display: none;
  }
}
