/* Escuro e suave, com acentos neon: cores chapadas (sem degradês), cantos
   arredondados e movimento só nos detalhes. */

:root {
  --void: #0a0710;
  --surface: #130f1c;
  --surface-2: #1b1627;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.17);
  --text: #f4f0fa;
  --muted: #a79fb8;
  --cyan: #45e0ee;
  --magenta: #ff4fa3;
  --yellow: #ffc94d;
  --violet: #9a6bff;
  --up: #5ee08f;
  --down: #ff8597;
  --silver: #d5dbe6;
  --bronze: #e7a076;
  --on-neon: #06181b;
  --radius: 10px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-display: 'Sora', system-ui, 'Segoe UI', sans-serif;
  --font: 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { color-scheme: dark; scrollbar-color: var(--line-strong) var(--void); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--cyan); color: var(--on-neon); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 8px; }

/* ------------------------------------------------- Fundo: vazio e fluxos */

/* Linhas de fluxo desenhadas pelo flow.js. */
.flow { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; opacity: 0.42; pointer-events: none; }

/* O "vazio": um disco preto com anéis girando em volta, no canto do topo. */
.void { position: fixed; top: -250px; right: -250px; z-index: 0; width: 560px; height: 560px; pointer-events: none; }
.void span { position: absolute; border-radius: 50%; }
.void span:nth-child(1) { inset: 0; border: 1px dashed rgba(69, 224, 238, 0.2); animation: orbit 90s linear infinite; }
.void span:nth-child(2) {
  inset: 70px;
  border: 1px solid rgba(255, 79, 163, 0.22);
  border-left-color: transparent; border-bottom-color: transparent;
  animation: orbit 38s linear infinite reverse;
}
.void span:nth-child(3) {
  inset: 150px;
  background: #050308;
  box-shadow: 0 0 0 1px rgba(154, 107, 255, 0.4), 0 0 70px 8px rgba(154, 107, 255, 0.16);
  animation: breathe 7s ease-in-out infinite alternate;
}
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes breathe { from { transform: scale(0.95); } to { transform: scale(1.05); } }

.page { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; padding: 32px 20px 56px; }

/* ------------------------------------------------------------- Cabeçalho */

.top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 16px 24px;
  margin-bottom: 20px;
}

.brand { margin: 0; display: flex; flex-direction: column; line-height: 1; white-space: nowrap; }
.brand-mark {
  align-self: flex-start;
  font: 800 clamp(44px, 8vw, 76px)/0.92 var(--font-display);
  letter-spacing: -0.04em;
  color: var(--text);
  text-shadow: 2px 0 0 var(--magenta), -2px 0 0 var(--cyan);
}
.brand-sub {
  margin-top: 14px;
  font: 600 12px/1.2 var(--font-display);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-sub::before { content: '// '; color: var(--cyan); }

.status { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; padding-bottom: 2px; }
.actions, .live-info { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; justify-content: flex-end; }
.popwrap { position: relative; }
.status-text { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.pill, .online {
  display: inline-flex; align-items: center; gap: 8px;
  height: 26px; padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--magenta);
  background: rgba(255, 79, 163, 0.1);
  color: var(--magenta);
  font: 600 11px/1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--magenta); animation: pulse 1.6s ease-out infinite; }
.pill.is-demo { border-color: var(--yellow); background: rgba(255, 201, 77, 0.1); color: var(--yellow); }
.pill.is-demo .pill-dot { background: var(--yellow); animation: none; }
.pill.is-off { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); color: var(--muted); }
.pill.is-off .pill-dot { background: var(--muted); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 79, 163, 0.75); }
  100% { box-shadow: 0 0 0 8px rgba(255, 79, 163, 0); }
}

.online {
  border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); color: var(--text);
  font: 600 12px/1 var(--font); letter-spacing: 0; text-transform: none;
  font-variant-numeric: tabular-nums;
}
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); }

/* Linha de tempo até a próxima atualização. */
.progress { grid-column: 1 / -1; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progress-fill { display: block; height: 2px; width: 0; border-radius: 2px; background: var(--cyan); }

/* ----------------------------------------------------------------- Avisos */

.banners { display: grid; gap: 8px; }
.banners:not(:empty) { margin-bottom: 16px; }
.banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--yellow);
  background: rgba(255, 201, 77, 0.08);
  color: var(--text);
  font-size: 13.5px;
}
.banner .icon { margin-top: 2px; color: var(--yellow); }
.banner.is-error { border-color: var(--magenta); background: rgba(255, 79, 163, 0.08); }
.banner.is-error .icon { color: var(--magenta); }
.banner code { font: 600 12.5px/1 ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 3px; }

/* ----------------------------------------------------------------- Resumo */

.summary {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 20px 14px; border-left: 1px solid var(--line); }
.tile:first-child { border-left: 0; padding-left: 2px; }
.tile-label { font: 600 11px/1.4 var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tile-value {
  font: 700 clamp(22px, 2.8vw, 30px)/1.2 var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.tile-main .tile-value { color: var(--cyan); }
.tile-value-text { font-size: clamp(17px, 2vw, 21px); line-height: 1.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-note { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --------------------------------------------- Vitrine de canais pequenos */

/* Um canal pequeno por vez. Quem vence a rodada de torcida fica fixo aqui. */
.spot {
  display: grid; grid-template-columns: auto 40px minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px;
  margin: 14px 0 6px; padding: 9px 16px 9px 14px;
  border: 1px solid rgba(69, 224, 238, 0.3);
  border-radius: 14px;
  background: rgba(69, 224, 238, 0.05);
}
.spot .avatar, .spot .who, .spot .go { grid-area: auto; }
.spot-label { display: inline-flex; align-items: center; gap: 9px; color: var(--cyan); }
.spot-label > span { display: flex; flex-direction: column; gap: 2px; }
.spot-label strong { font: 600 12.5px/1.2 var(--font); white-space: nowrap; }
.spot-rule { color: var(--muted); font-size: 11.5px; line-height: 1.2; }
.spot-meta { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.spot .go { color: var(--text); text-decoration: none; }
.spot .go:hover { color: var(--cyan); }
.spot .cheer { position: static; margin: 0; height: 32px; padding: 0 12px; border: 1px solid rgba(69, 224, 238, 0.45); color: var(--cyan); }
.spot .cheer:hover { background: rgba(69, 224, 238, 0.14); }

/* ----------------------------------------------------------------- Torcida */

.cheer {
  position: absolute; right: 46px; top: 50%; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 58px; height: 30px; margin-top: -15px; padding: 0 8px;
  border: 0; border-radius: 999px;
  background: none; color: var(--muted);
  font: 600 12px/1 var(--font);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cheer .icon { width: 15px; height: 15px; }
.cheer:hover { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.cheer.has-cheers { color: var(--cyan); }
.cheer.is-cooling { color: var(--up); cursor: default; }
.cheer-count:empty { display: none; }
.item.top .cheer { top: 10px; right: 52px; margin-top: 0; min-width: 34px; height: 34px; background: rgba(10, 7, 16, 0.66); color: #fff; }
.item.top .cheer.has-cheers { color: var(--cyan); }
.item.top .cheer.is-cooling { color: var(--up); }

/* O "+1" que sobe quando a torcida é registrada. */
@keyframes cheer-rise { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-22px); } }
.cheer-plus {
  position: absolute; left: 50%; top: -6px; margin-left: -8px;
  color: var(--up); font: 700 12px/1 var(--font);
  pointer-events: none;
  animation: cheer-rise 0.7s ease-out forwards;
}

/* --------------------------------------------------------------- Panorama */

.charts { display: grid; gap: 14px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fact {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}
.fact strong { font: 700 clamp(26px, 3.4vw, 34px)/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.fact span { color: var(--muted); font-size: 13px; }

.chart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.chart-card {
  min-width: 0;
  padding: 16px 18px 18px;
  border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}
.chart-wide { grid-column: 1 / -1; }
.chart-card h3 { margin: 0; font: 700 15px/1.3 var(--font-display); letter-spacing: -0.01em; }
.chart-sub { margin: 4px 0 14px; color: var(--muted); font-size: 12.5px; }
.chart-note { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; }
.chart-note:empty { display: none; }

/* Barras horizontais. Cada linha é um botão: clicar filtra o ranking. */
.cbars { display: grid; gap: 4px; }
.cbar {
  display: grid; grid-template-columns: minmax(0, 118px) minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 32px; padding: 4px 8px;
  border: 1px solid transparent; border-radius: 8px;
  background: none; color: var(--text);
  font: 500 13px/1.2 var(--font);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.cbar:hover { background: rgba(255, 255, 255, 0.06); }
.cbar[aria-pressed='true'] { border-color: rgba(255, 201, 77, 0.6); background: rgba(255, 201, 77, 0.08); }
.cbar.is-empty { color: var(--muted); }
.cbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbar-track { height: 10px; }
.cbar-fill { display: block; height: 10px; border-radius: 0 4px 4px 0; background: #1aa6bd; transition: width 0.5s var(--ease); }
.cbar:hover .cbar-fill { background: var(--cyan); }
.cbar-num { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------ Torcidas chegando ao vivo */

.ticker {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto; max-width: 46%;
  color: var(--cyan); font: 600 12.5px/1.2 var(--font);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.35s, transform 0.35s var(--ease);
}
.ticker.is-on { opacity: 1; transform: none; }
.ticker .icon { width: 14px; height: 14px; }

/* Partículas que saem de um botão ao torcer, sortear ou completar missões. */
.burst-dot { position: fixed; z-index: 40; width: 7px; height: 7px; border-radius: 2px; pointer-events: none; }

/* ---------------------------------------------------------------- Sorteio */

.spin { width: min(420px, calc(100vw - 24px)); }
.spin-stage {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-height: 190px; padding: 18px 12px;
  border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
}
.spin-stage .avatar { width: 72px; height: 72px; margin-bottom: 6px; }
.spin-stage .avatar-initials { font-size: 24px; }
.spin-name { font: 700 22px/1.2 var(--font-display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.spin-live { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.spin-meta { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.spin-stage.is-rolling .spin-name { color: var(--cyan); }
.spin-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.spin-actions .btn { display: inline-flex; align-items: center; margin-top: 0; text-decoration: none; }

/* ---------------------------------------------------------------- Missões */

.link-btn.is-done { border-color: rgba(255, 201, 77, 0.6); color: var(--yellow); }
.game-panel { width: 270px; padding: 14px; gap: 10px; }
.game-level { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.game-level strong { font: 700 15px/1.2 var(--font-display); }
.game-level span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.game-meter { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.game-meter span { display: block; height: 6px; border-radius: 6px; background: var(--yellow); transition: width 0.5s var(--ease); }
.game-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.game-list li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.game-list .icon { color: var(--muted); }
.game-list li.is-complete { color: var(--muted); }
.game-list li.is-complete .icon { color: var(--up); }
.game-progress { margin-left: auto; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.game-streak { margin: 0; color: var(--muted); font-size: 12.5px; }

@media (max-width: 860px) {
  .chart-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .ticker { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker, .cbar-fill, .game-meter span { transition: none; }
}

/* ------------------------------------------------------- Busca com Ctrl+K */

.palette { width: min(560px, calc(100vw - 24px)); margin: 12vh auto auto; padding: 0; }
.palette-field { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 500 15px var(--font); }
.palette-field input::placeholder { color: var(--muted); font-weight: 400; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: min(56vh, 420px); overflow: auto; }
.palette-list:empty { display: none; }
.palette-group { padding: 10px 10px 4px; color: var(--muted); font: 600 11px/1 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-size: 14px; cursor: pointer; }
.palette-item .icon { color: var(--muted); }
.palette-item[aria-selected='true'] { background: rgba(255, 255, 255, 0.08); }
.palette-item[aria-selected='true'] .icon { color: var(--cyan); }
.palette-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-hint { margin-left: auto; padding-left: 12px; max-width: 55%; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-empty { margin: 0; padding: 18px 16px; color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------------------------- Duelo */

.modal {
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: auto; padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  overflow: auto;
}
.modal::backdrop { background: rgba(5, 3, 8, 0.72); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font: 700 20px/1.2 var(--font-display); letter-spacing: -0.01em; }
.modal-foot { display: flex; justify-content: flex-end; margin-top: 14px; }

.duel-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.duel-score { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duel-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.duel-legend { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 13px; }
.duel-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A chave da legenda repete o traço da linha: cheio para A, tracejado para B. */
.duel-key { flex: none; width: 22px; height: 0; border-top: 3px solid #1aa6bd; }
.duel-key.key-b { border-top: 3px dashed #ee5099; }
.duel-count { font: 700 clamp(24px, 5vw, 34px)/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.duel-gap { margin: 12px 0 0; color: var(--muted); font-size: 13.5px; }
.duel-chart { position: relative; margin-top: 12px; }
.duel-chart svg { display: block; width: 100%; height: auto; touch-action: none; }
.duel-note { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.duel-note:empty { display: none; }
.duel-grid { stroke: var(--line); stroke-width: 1; }
.duel-axis { fill: var(--muted); font: 11px var(--font); }
.duel-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.duel-dot { stroke: var(--surface); stroke-width: 2; }
.duel-cross { stroke: var(--line-strong); stroke-width: 1; }
.duel-tip {
  position: absolute; z-index: 1;
  display: grid; gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface-2);
  font-size: 12.5px; font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}
.duel-tip strong { font-weight: 600; }
.duel-tip span { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.duel-tip b { margin-left: auto; padding-left: 12px; color: var(--text); font-weight: 600; }

/* ------------------------------------------- Barra única: lentes e filtros */

.toolbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px;
  height: 50px;
  margin: 0 -8px 14px; padding: 0 8px;
  background: rgba(10, 7, 16, 0.86);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

/* Seções: o primeiro nível da navegação. */
.sections { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }
.section {
  height: 34px; padding: 0 15px;
  border: 0; border-radius: 9px;
  background: none; color: var(--muted);
  font: 600 13.5px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.section:hover { color: var(--text); }
.section[aria-pressed='true'] { background: var(--text); color: #170f22; }
.section:focus-visible { outline-offset: -3px; }

/* Opções da seção escolhida. */
.subbar { display: flex; align-items: center; gap: 10px; min-height: 32px; margin-bottom: 12px; }
.subbar-note { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.subbar-note:empty { display: none; }
.lenses { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.lens {
  height: 30px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: none; color: var(--muted);
  font: 600 12.5px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.lens:hover { color: var(--text); border-color: var(--line-strong); }
.lens.is-empty { opacity: 0.5; }
.lens[aria-pressed='true'] { background: rgba(69, 224, 238, 0.12); border-color: rgba(69, 224, 238, 0.5); color: var(--cyan); opacity: 1; }

.tools { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }

.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg {
  height: 32px; padding: 0 12px;
  border: 0; background: none;
  color: var(--muted);
  font: 600 13px/1 var(--font);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.seg:hover { color: var(--text); }
.seg[aria-pressed='true'] { background: rgba(255, 255, 255, 0.14); color: var(--text); }
.seg:focus-visible { outline-offset: -3px; }

/* Botão que abre a busca (Ctrl+K). */
.search-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 8px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: none; color: var(--muted);
  font: 500 13px/1 var(--font);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.search-trigger:hover { color: var(--text); border-color: rgba(69, 224, 238, 0.5); }
kbd {
  padding: 3px 6px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  color: var(--muted);
  font: 600 10.5px/1 var(--font);
  white-space: nowrap;
}

.filter-menu { position: relative; }
.icon-btn {
  position: relative;
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: none; color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.icon-btn:hover { color: var(--text); }
.icon-btn.is-active, .icon-btn[aria-expanded='true'] { border-color: var(--cyan); color: var(--cyan); }
.filter-badge {
  position: absolute; top: -7px; right: -7px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px;
  background: var(--magenta); color: #fff;
  font: 700 10px/16px var(--font);
  text-align: center;
}

.filter-panel {
  position: absolute; right: 0; top: calc(100% + 9px); z-index: 10;
  display: grid; gap: 8px;
  width: 250px; padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 24px 40px -12px #000;
}

.select {
  position: relative; display: block;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s;
}
.select:focus-within { border-color: var(--cyan); }
.select.is-active { border-color: var(--yellow); }
.select-label {
  position: absolute; top: 7px; left: 12px;
  font: 600 10px/1 var(--font-display);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}
.select.is-active .select-label { color: var(--yellow); }
.select select {
  display: block; width: 100%; height: 44px;
  padding: 19px 34px 5px 12px;
  border: 0; outline: 0; border-radius: 8px;
  background: transparent; color: var(--text);
  font: 500 13.5px/1.2 var(--font);
  -webkit-appearance: none; appearance: none;
  cursor: pointer;
}
.select select option { background: var(--surface-2); color: var(--text); }
.select-chevron { position: absolute; right: 10px; top: 50%; margin-top: -8px; color: var(--muted); pointer-events: none; }

/* Linha de contexto: o que a lente mostra e quantas lives sobraram. */
.context {
  display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap;
  margin-bottom: 14px;
  color: var(--muted); font-size: 13px;
}
.lens-hint { display: flex; align-items: baseline; gap: 8px; flex: 1 1 320px; min-width: 0; margin: 0; }
.lens-hint .icon { align-self: center; color: var(--cyan); }
.lens-hint strong { flex: none; color: var(--cyan); font: 600 13px/1.2 var(--font); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 8px 0 11px;
  border: 1px solid rgba(255, 201, 77, 0.5); border-radius: 999px;
  background: rgba(255, 201, 77, 0.1); color: var(--yellow);
  font: 600 12.5px/1 var(--font);
  cursor: pointer;
  transition: background 0.15s;
}
.chip:hover { background: rgba(255, 201, 77, 0.2); }
.chip .icon { width: 13px; height: 13px; }
.ticker + .context-count { margin-left: 0; }
.context-count { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: none; color: var(--text);
  font: 600 12.5px/1 var(--font);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.link-btn:hover { border-color: var(--magenta); color: var(--magenta); }
.link-btn .icon { width: 13px; height: 13px; }

/* ---------------------------------------------------------------- Ranking */

.list {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 14px;
}
.item { position: relative; grid-column: 1 / -1; min-width: 0; }
.item.top { grid-column: auto; margin-bottom: 10px; transition: transform 0.3s var(--ease); }
.item.top:hover { transform: translateY(-3px); }

/* Linha: caixa baixa e suave. */
.item-link {
  position: relative;
  display: grid;
  grid-template-columns: 38px 40px minmax(0, 1fr) 190px 110px 124px 88px;
  grid-template-areas: 'rank avatar who meta bar viewers go';
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 9px 116px 9px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.item:not(.top) .item-link[href]:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(69, 224, 238, 0.45); }
.item.is-fav:not(.top) .item-link { border-color: rgba(255, 201, 77, 0.4); }

.rank {
  grid-area: rank;
  display: grid; place-items: center;
  min-width: 32px; height: 30px;
  border-radius: 9px;
  font: 600 14px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.rank-crown { display: none; }
.r1 .rank { background: var(--yellow); color: #2b1c00; }
.r2 .rank { background: var(--silver); color: #10131a; }
.r3 .rank { background: var(--bronze); color: #1c0d02; }

.thumb { grid-area: thumb; display: none; }

.avatar {
  grid-area: avatar;
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: hsl(var(--hue, 200) 60% 24%);
  flex: none;
}
.avatar-initials {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font: 700 14px/1 var(--font-display);
  color: #fff;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.who { grid-area: who; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.channel { font: 600 15px/1.3 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { display: flex; align-items: center; gap: 8px; min-width: 0; }
.title { min-width: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Plataformas da live: ícone de cada uma e, no canal unido, a audiência de cada. */
.plat { display: inline-flex; align-items: center; gap: 9px; flex: none; }
.plat-part { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font: 600 11.5px/1 var(--font); font-variant-numeric: tabular-nums; }
.plat-logo { width: 14px; height: 14px; flex: none; fill: currentColor; stroke: none; }
.plat-youtube .plat-logo { color: #ff6b6b; }
.plat-twitch .plat-logo { color: #b79cff; }
.plat-kick .plat-logo { color: #5ee08f; }

/* Número em destaque da lente escolhida (ou sobe/desce e disputas no ranking). */
.stat {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  height: 20px; padding: 0 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: 600 11.5px/1 var(--font);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat .icon { width: 12px; height: 12px; }
.stat.tone-up { background: rgba(94, 224, 143, 0.14); color: var(--up); }
.stat.tone-down { background: rgba(255, 133, 151, 0.14); color: var(--down); }
.stat.tone-gold { background: rgba(255, 201, 77, 0.15); color: var(--yellow); }
.stat.tone-duel { background: rgba(255, 79, 163, 0.14); color: #ff8cc2; }

.meta { grid-area: meta; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.delta { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta .icon { width: 14px; height: 14px; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta-window { font-weight: 400; color: var(--muted); }
.uptime { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.uptime .icon { width: 12px; height: 12px; }

.bar { grid-area: bar; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar-fill { display: block; height: 4px; width: 0; border-radius: 4px; background: var(--cyan); transition: width 0.6s var(--ease); }

.viewers { grid-area: viewers; display: flex; flex-direction: column; align-items: flex-end; }
.count { font: 700 19px/1.2 var(--font-display); font-variant-numeric: tabular-nums; transition: color 0.5s; }
.count.tick-up { color: var(--up); transition: none; }
.count.tick-down { color: var(--down); transition: none; }
.count-label { color: var(--muted); font-size: 12px; }

.spark { grid-area: spark; display: none; }

.go {
  grid-area: go;
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px;
  color: var(--muted);
  font: 600 13px/1 var(--font);
  transition: color 0.15s;
}
.item-link[href]:hover .go { color: var(--text); }

/* Estrela de favorito: botão próprio, por cima da linha. */
.fav {
  position: absolute; right: 8px; top: 50%; z-index: 2;
  display: grid; place-items: center;
  width: 34px; height: 34px; margin-top: -17px;
  border: 0; border-radius: 50%;
  background: none; color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, transform 0.2s var(--ease);
}
.fav .icon { width: 17px; height: 17px; }
.fav:hover { color: var(--yellow); transform: scale(1.1); }
.fav[aria-pressed='true'] { color: var(--yellow); }
.fav[aria-pressed='true'] .icon { fill: currentColor; }

/* Pódio: os três primeiros viram cartões */

.item.top .item-link {
  grid-template-columns: 66px minmax(0, 1fr) auto;
  grid-template-areas:
    'thumb thumb thumb'
    'avatar who who'
    'viewers viewers spark'
    'meta meta go';
  align-content: start;
  gap: 12px;
  padding: 0 0 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 22px 44px -30px #000;
}
.item.top .item-link[href]:hover { background: var(--surface-2); border-color: rgba(69, 224, 238, 0.5); box-shadow: 0 0 30px -14px var(--cyan); }

.item.top .thumb {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: hsl(var(--hue, 200) 62% 20%);
}
.item.top .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.item.top .item-link[href]:hover .thumb img { transform: scale(1.04); }

.live-badge {
  position: absolute; bottom: 12px; right: 12px; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px;
  border-radius: 8px;
  background: var(--magenta); color: #fff;
  font: 700 10.5px/1 var(--font-display);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.is-demo .live-badge { display: none; }

.item.top .rank {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  display: inline-flex; gap: 6px;
  height: 32px; padding: 0 12px;
  font-size: 15px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}
.item.top.r1 .rank-crown { display: block; width: 15px; height: 15px; }

.item.top .avatar {
  width: 50px; height: 50px;
  margin: -32px 0 0 16px;
  z-index: 1;
  box-shadow: 0 0 0 3px var(--surface);
}
.item.top .avatar-initials { font-size: 17px; }
.item.top .who { margin: -4px 16px 0 0; }
.item.top .channel { font: 700 17px/1.3 var(--font-display); letter-spacing: -0.01em; }
.item.top .sub { flex-wrap: wrap; row-gap: 4px; }
.item.top .viewers { margin-left: 16px; align-items: flex-start; }
.item.top .count { font-size: 32px; line-height: 1.1; }
.item.top.r1 .count { font-size: 40px; color: var(--yellow); }
.item.top.r1 .count.tick-up { color: var(--up); }
.item.top.r1 .count.tick-down { color: var(--down); }
.item.top .bar { display: none; }

.item.top .spark { display: block; width: 116px; height: 36px; margin-right: 16px; align-self: end; color: var(--cyan); }
.spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.spark-line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark-area { fill: currentColor; opacity: 0.1; }

.item.top .meta { margin-left: 16px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 6px 14px; flex-wrap: wrap; min-height: 32px; }
.item.top .go {
  margin-right: 16px;
  height: 32px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.item.top .item-link[href]:hover .go { background: var(--text); border-color: var(--text); color: #170f22; }

.item.top .fav { top: 10px; right: 10px; margin-top: 0; background: rgba(10, 7, 16, 0.66); color: #fff; }
.item.top .fav[aria-pressed='true'] { color: var(--yellow); }

/* 1º lugar: borda amarela e um feixe de luz correndo pela borda de cima. */
.item.top.r1 .item-link { border-color: rgba(255, 201, 77, 0.7); box-shadow: 0 24px 50px -32px var(--yellow); }
.item.top.r1 .item-link[href]:hover { border-color: var(--yellow); box-shadow: 0 24px 54px -28px var(--yellow); }
.item.top.r1 .item-link::before {
  content: '';
  position: absolute; top: 0; left: -30%; z-index: 3;
  width: 30%; height: 2px;
  background: var(--yellow);
  box-shadow: 0 0 10px 1px var(--yellow);
  animation: beam 4.5s linear infinite;
}
@keyframes beam { to { left: 100%; } }

/* Clarão quando a liderança muda de mãos. */
@keyframes leader-flash {
  0% { box-shadow: 0 0 0 0 rgba(255, 201, 77, 0.85); }
  100% { box-shadow: 0 0 0 26px rgba(255, 201, 77, 0); }
}
.item.flash .item-link { animation: leader-flash 0.9s ease-out 2; }

/* ----------------------------------------------------- Avisos flutuantes */

.toasts {
  position: fixed; left: 20px; bottom: 20px; z-index: 20;
  display: flex; flex-direction: column; gap: 8px;
  width: min(360px, calc(100vw - 40px));
  pointer-events: none;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 40px -16px #000;
  animation: toast-in 0.35s var(--ease);
  transition: opacity 0.4s, transform 0.4s var(--ease);
}
.toast.is-leaving { opacity: 0; transform: translateX(-12px); }
.toast-icon {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(69, 224, 238, 0.12); color: var(--cyan);
}
.toast.tone-gold { border-color: var(--yellow); }
.toast.tone-gold .toast-icon { background: var(--yellow); color: #2b1c00; }
.toast-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12.5px; color: var(--muted); }
.toast-body strong { color: var(--text); font: 600 14px/1.3 var(--font-display); }

/* --------------------------------------------------------------- Esqueleto */

@keyframes blink { from { opacity: 0.35; } to { opacity: 1; } }
.skeleton .sk {
  grid-column: 1 / -1;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  animation: blink 0.9s ease-in-out infinite alternate;
}
.skeleton .sk-card { grid-column: auto; height: 368px; margin-bottom: 10px; border-radius: 18px; }

/* ------------------------------------------------------------------ Vazio */

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(19, 15, 28, 0.7);
}
.empty-title { font: 600 19px/1.3 var(--font-display); }
.empty-text { margin: 0; color: var(--muted); max-width: 46ch; }

.btn {
  margin-top: 14px;
  min-height: 40px; padding: 0 20px;
  border: 0; border-radius: 999px;
  background: var(--text); color: #170f22;
  font: 600 14px/1 var(--font);
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: #fff; }

.foot { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; }

/* ------------------------------------------------------------- Responsivo */

@media (max-width: 1020px) {
  .spot .go-text { display: none; }
  .item-link {
    grid-template-columns: 38px 40px minmax(0, 1fr) 150px 124px 18px;
    grid-template-areas: 'rank avatar who meta viewers go';
  }
  .item:not(.top) .bar,
  .item:not(.top) .go-text { display: none; }
  .item.top .spark { width: 84px; }
}

@media (max-width: 860px) {
  .list { grid-template-columns: 1fr; }
  .item.top { margin-bottom: 4px; }
  .item.top:hover { transform: none; }
  .skeleton .sk-card { height: 330px; margin-bottom: 12px; }
  .item.top .spark { width: 116px; }

  .summary { grid-template-columns: 1fr 1fr; }
  .tile:first-child { grid-column: 1 / -1; }
  .tile:nth-child(2) { border-left: 0; padding-left: 2px; }
  .tile:nth-child(n + 2) { border-top: 1px solid var(--line); }

  /* A barra vira duas faixas: seções em cima, ferramentas embaixo. */
  .toolbar { flex-wrap: wrap; height: auto; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .sections { flex: 1 1 100%; }
  .section { flex: 1; padding: 0 6px; }
  .tools { flex: 1 1 100%; min-width: 0; }
  .search-trigger { flex: 1; }
  .seg { height: 34px; }
  .subbar { flex-wrap: wrap; }

  .void { top: -160px; right: -160px; width: 340px; height: 340px; }
  .void span:nth-child(2) { inset: 44px; }
  .void span:nth-child(3) { inset: 92px; }
}

@media (max-width: 640px) {
  .page { padding: 24px 16px 48px; }
  .top { grid-template-columns: 1fr; align-items: start; }
  .status { align-items: flex-start; }
  .actions, .live-info { justify-content: flex-start; }
  /* O painel de missões se alinha pela fileira de botões, para caber na tela. */
  .actions { position: relative; }
  .popwrap { position: static; }
  .game-panel { right: auto; left: 0; max-width: calc(100vw - 32px); }
  .tile { padding: 10px 14px 12px; }
  .toasts { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .spot { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px 10px; padding: 10px 12px; }
  .spot-label, .spot-meta { grid-column: 1 / -1; }
  .spot .who { grid-column: 2 / -1; }
  .spot .cheer { grid-column: 1 / 3; justify-self: start; }
  .spot .go { grid-column: 3; }
  .spot .go-text { display: inline; }
  .item:not(.top) .cheer { right: 40px; min-width: 34px; padding: 0 6px; }
  .item:not(.top) .cheer .cheer-count { display: none; }
  .modal { padding: 16px; }
  .duel-pick { grid-template-columns: 1fr; }
  .item-link {
    grid-template-columns: 30px 36px minmax(0, 1fr) auto;
    grid-template-areas: 'rank avatar who viewers';
    gap: 10px;
    padding: 9px 80px 9px 8px;
  }
  .avatar { width: 36px; height: 36px; }
  .item:not(.top) .meta,
  .item:not(.top) .go { display: none; }
  .count { font-size: 16px; }
  .delta-window { display: none; }
  /* Linha estreita: no canal unido ficam só os ícones; os números de cada
     plataforma aparecem nos cartões e em telas maiores. */
  .item:not(.top) .plat-count { display: none; }
  .item:not(.top) .plat { gap: 6px; }
  .item:not(.top) .who { overflow: hidden; }
  /* Cinco seções numa tela estreita: letra e margens menores para caberem. */
  .sections { min-width: 0; }
  .section { min-width: 0; padding: 0 3px; font-size: 12.5px; }
  .search-trigger-text { flex: 1; text-align: left; }
  .search-trigger kbd { display: none; }
  .fav { right: 4px; }
  .filter-panel { width: min(250px, calc(100vw - 32px)); }
}

@media (prefers-reduced-motion: reduce) {
  .pill-dot, .void span, .skeleton .sk, .toast,
  .item.top.r1 .item-link::before, .item.flash .item-link { animation: none; }
  .item.top.r1 .item-link::before { display: none; }
  .bar-fill, .item-link, .item.top, .item.top .thumb img, .fav, .cheer, .toast, .search input, .count { transition: none; }
  .cheer-plus { display: none; }
  .item.top:hover, .fav:hover { transform: none; }
  .item.top .item-link[href]:hover .thumb img { transform: none; }
}

/* -------------------------------------------------------------------- Chat */

/* Botão fixo no canto: abre e fecha o painel e conta as mensagens novas. */
.chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 30;
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 18px 0 16px;
  border: 1px solid var(--cyan); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font: 600 14px/1 var(--font-display);
  box-shadow: 0 16px 36px -14px #000, 0 0 0 4px rgba(69, 224, 238, 0.08);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.2s var(--ease);
}
.chat-fab .icon { width: 18px; height: 18px; color: var(--cyan); }
.chat-fab:hover { transform: translateY(-2px); }
.chat-fab.is-open { background: var(--cyan); color: var(--on-neon); }
.chat-fab.is-open .icon { color: var(--on-neon); }
.chat-unread {
  position: absolute; top: -6px; right: -6px;
  min-width: 22px; height: 22px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: 999px; border: 2px solid var(--void);
  background: var(--magenta); color: #fff;
  font: 700 11px/1 var(--font); font-variant-numeric: tabular-nums;
}

.chat {
  position: fixed; right: 20px; bottom: 78px; z-index: 30;
  display: flex; flex-direction: column;
  width: min(370px, calc(100vw - 40px));
  height: min(580px, calc(100vh - 110px));
  border: 1px solid var(--line-strong); border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 30px 70px -24px #000;
  overflow: hidden;
  animation: chat-in 0.25s var(--ease);
}
@keyframes chat-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 12px 12px 16px;
  border-bottom: 1px solid var(--line);
}
.chat-head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chat-head h2 { margin: 0; font: 700 16px/1.2 var(--font-display); }
.chat-online { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.chat-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-list {
  flex: 1; min-height: 0; margin: 0; padding: 10px 6px 10px 10px;
  list-style: none; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin;
}
.chat-msg { padding: 6px 8px; border-radius: 10px; }
.chat-msg + .chat-msg { margin-top: 2px; }
.chat-msg.is-mine { background: rgba(69, 224, 238, 0.07); }
.chat-msg.is-mention { background: rgba(255, 201, 77, 0.1); box-shadow: inset 2px 0 0 var(--yellow); }
.chat-msg-head { display: flex; align-items: baseline; gap: 8px; }
.chat-who {
  padding: 0; border: 0; background: none;
  font: 600 13px/1.3 var(--font); cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-who:hover { text-decoration: underline; }
.chat-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chat-text { margin: 2px 0 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }

.chat-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; color: var(--muted); text-align: center; pointer-events: none; }
.chat-jump {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border: 0; border-radius: 999px;
  background: var(--cyan); color: var(--on-neon);
  font: 600 12.5px/1 var(--font); cursor: pointer;
  box-shadow: 0 10px 24px -10px #000;
}
.chat-jump .icon { width: 13px; height: 13px; }

.chat-form { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.chat-name-row { display: flex; flex-direction: column; gap: 4px; }
.chat-name-row label { color: var(--muted); font-size: 12px; font-weight: 600; }
.chat-me { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 12px; }
.chat-me strong { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-rename { margin-left: auto; padding: 0; border: 0; background: none; color: var(--cyan); font: 600 12px var(--font); cursor: pointer; }
.chat-rename:hover { text-decoration: underline; }
.chat-compose { display: flex; gap: 8px; }
.chat-form input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text);
  font: 400 14px var(--font);
}
.chat-form input::placeholder { color: var(--muted); }
.chat-form input:focus { outline: 0; border-color: var(--cyan); }
.chat-send {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px;
  border: 0; border-radius: var(--radius);
  background: var(--cyan); color: var(--on-neon); cursor: pointer;
}
.chat-send:disabled { opacity: 0.5; cursor: default; }
.chat-hint { min-height: 0; margin: 0; color: var(--muted); font-size: 12px; }
.chat-hint:empty { display: none; }
.chat-hint.is-error { color: var(--down); }

@media (max-width: 640px) {
  .chat-fab { right: 12px; bottom: 12px; height: 44px; }
  .toasts { bottom: 68px; }
  /* Em tela de celular, o chat ocupa a tela toda. */
  .chat { inset: 0; width: auto; height: auto; border: 0; border-radius: 0; }
  .chat-is-open .chat-fab { display: none; }
  .chat-form input { font-size: 16px; } /* evita o zoom automático no iPhone */
}

@media (prefers-reduced-motion: reduce) {
  .chat, .chat-fab { animation: none; transition: none; }
}

/* Tarja sobre ofensas, ações de denúncia e moderação. */
.chat-tarja {
  display: inline-block; vertical-align: -2px;
  height: 1.05em; margin: 0 1px; padding: 0 2px;
  border-radius: 3px;
  background: #000;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: transparent; font-size: 0.85em; line-height: 1.05em;
  overflow: hidden; user-select: none;
}
.chat-mod {
  padding: 2px 5px; border-radius: 4px;
  background: var(--yellow); color: #2b1c00;
  font: 700 9.5px/1 var(--font); letter-spacing: 0.06em;
}
.chat-acts { display: inline-flex; gap: 2px; margin-left: auto; opacity: 0; transition: opacity 0.15s; }
.chat-msg:hover .chat-acts, .chat-msg:focus-within .chat-acts { opacity: 1; }
@media (hover: none) { .chat-acts { opacity: 0.7; } }
.chat-act {
  display: grid; place-items: center;
  width: 24px; height: 24px; padding: 0;
  border: 0; border-radius: 6px;
  background: none; color: var(--muted); cursor: pointer;
}
.chat-act .icon { width: 13px; height: 13px; }
.chat-act:hover { background: var(--surface-2); color: var(--text); }
.chat-act.is-danger:hover { color: var(--down); }
.chat-act:disabled { opacity: 0.4; cursor: default; }
.chat-modbar { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.chat-modbar-text { margin-right: auto; }
.chat-mod-enter {
  flex: none; height: 40px; padding: 0 14px;
  border: 0; border-radius: var(--radius);
  background: var(--yellow); color: #2b1c00;
  font: 600 13px var(--font); cursor: pointer;
}
.chat-hint.is-warn { color: var(--yellow); }
