/* ====== Tema Pixel Pokémon ====== */
:root {
  --bg-0: #1a1d2e;
  --bg-1: #232744;
  --bg-2: #2a2f55;
  --panel: #f5f7ff;
  --panel-dark: #1c1f36;
  --ink: #1a1d2e;
  --ink-soft: #4a4f6f;
  --paper: #fff9e6;

  --pokeball-red: #ef3a3a;
  --pokeball-dark: #2b2b2b;
  --gold: #ffcb05;
  --gold-dark: #b3a125;
  --pokedex-red: #c92327;
  --pokedex-shadow: #7d1518;

  --ok: #4fae4f;
  --ok-dark: #2d7a2d;
  --warn: #f0c419;
  --warn-dark: #b08a0d;
  --bad: #e15a5a;
  --bad-dark: #993333;
  --neutral: #9aa3c7;

  --line: #1a1d2e;
  --line-soft: #d6d9ea;

  --pixel: 4px;
  --radius: 0px;

  --font-pixel: "Press Start 2P", "VT323", monospace;
  --font-body: "VT323", "Press Start 2P", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 203, 5, 0.08), transparent 60%),
    radial-gradient(circle at 80% 90%, rgba(239, 58, 58, 0.1), transparent 50%),
    var(--bg-0);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1.3;
  min-height: 100vh;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
}

img {
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
}

/* Scanlines decorativas em cima de tudo */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.08) 0px,
    rgba(0, 0, 0, 0.08) 2px,
    transparent 2px,
    transparent 4px
  );
  z-index: 1000;
  mix-blend-mode: multiply;
  opacity: 0.4;
}

/* ====== Topbar ====== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--pokedex-red);
  color: #fff;
  border-bottom: var(--pixel) solid var(--line);
  box-shadow: 0 var(--pixel) 0 var(--pokedex-shadow);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-ball {
  width: 36px;
  height: 36px;
  filter: drop-shadow(2px 2px 0 #000);
}
.brand h1 {
  font-family: var(--font-pixel);
  font-size: 16px;
  margin: 0;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 var(--pokedex-shadow);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-pixel);
  font-size: 9px;
  background: var(--gold);
  color: var(--ink);
  padding: 6px 10px;
  border: var(--pixel) solid var(--ink);
  box-shadow: var(--pixel) var(--pixel) 0 #000;
}

#auth-area {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 9px;
  /* Crítico em mobile: sem wrap, os botões transbordam e empurram o site lateralmente */
  flex-wrap: wrap;
}

.status-dot {
  width: 12px;
  height: 12px;
  background: var(--neutral);
  border: 2px solid var(--ink);
  display: inline-block;
}
.status-dot.online {
  background: var(--ok);
}

/* ====== Container ====== */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ====== Painel pixelado base ====== */
.pixel-panel {
  background: var(--panel);
  color: var(--ink);
  border: var(--pixel) solid var(--ink);
  box-shadow:
    var(--pixel) var(--pixel) 0 #000,
    inset 0 0 0 2px #fff;
  padding: 16px 18px;
  position: relative;
}

/* "Cantos cortados" via clip-path opcional */
.pixel-panel::before,
.pixel-panel::after {
  content: "";
  position: absolute;
  width: var(--pixel);
  height: var(--pixel);
  background: var(--bg-0);
}
.pixel-panel::before { top: 0; left: 0; }
.pixel-panel::after { top: 0; right: 0; }

/* ====== Hero ====== */
.hero {
  background: var(--paper);
  text-align: center;
}
.hero-line {
  font-family: var(--font-pixel);
  font-size: 11px;
  margin: 4px 0 10px;
  color: var(--ink);
}
.hero-line strong {
  color: var(--pokeball-red);
}
.hero-sub {
  font-size: 18px;
  color: var(--ink-soft);
  margin: 0;
}

.legend-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: middle;
  border: 2px solid var(--ink);
  margin: 0 4px;
}
.legend-dot.green { background: var(--ok); }
.legend-dot.yellow { background: var(--warn); }
.legend-dot.red { background: var(--bad); }

/* ====== Combo input + dropdown ====== */
.guess-panel {
  background: var(--panel);
}

.combo {
  display: flex;
  gap: 10px;
}
.combo input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 24px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  border: var(--pixel) solid var(--ink);
  outline: none;
  box-shadow: inset 2px 2px 0 var(--line-soft);
}
.combo input:focus {
  background: #fffbe0;
}

/* ====== Botões pixel ====== */
.pixel-btn {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 10px 16px;
  background: #fff;
  color: var(--ink);
  border: var(--pixel) solid var(--ink);
  box-shadow: var(--pixel) var(--pixel) 0 #000;
  cursor: pointer;
  transition: transform 60ms steps(1, end), box-shadow 60ms steps(1, end);
  user-select: none;
}
.pixel-btn:hover {
  background: #fff8c4;
}
.pixel-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}
.pixel-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.pixel-btn--primary {
  background: var(--pokeball-red);
  color: #fff;
}
.pixel-btn--primary:hover { background: #ff5252; }
.pixel-btn--ghost {
  background: transparent;
  color: #fff;
  border-color: #fff;
  box-shadow: var(--pixel) var(--pixel) 0 var(--pokedex-shadow);
}
.pixel-btn--ghost:hover { background: rgba(255, 255, 255, 0.15); }

/* Cancelar — contraste alto em modal claro */
.pixel-btn--cancel {
  background: #4a4f6f;
  color: #fff;
  border-color: var(--ink);
}
.pixel-btn--cancel:hover { background: #2f3350; color: #fff; }

/* ====== Dropdown de sugestões ====== */
.suggestions {
  position: absolute;
  z-index: 30;
  list-style: none;
  margin: 6px 0 0;
  padding: 4px;
  background: #fff;
  border: var(--pixel) solid var(--ink);
  box-shadow: var(--pixel) var(--pixel) 0 #000;
  max-height: 340px;
  overflow-y: auto;
  width: calc(100% - 36px);
}
.suggestions.hidden { display: none; }
.suggestions li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 22px;
  cursor: pointer;
  border-bottom: 2px dashed var(--line-soft);
}
.suggestions li:last-child { border-bottom: none; }
.suggestions li:hover,
.suggestions li.active {
  background: var(--gold);
}
.suggestions li img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.suggestions li .pkid {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--ink-soft);
  margin-left: auto;
}

/* ====== Status msg ====== */
.status-msg {
  margin-top: 12px;
  min-height: 28px;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--ink);
}
.status-msg.win {
  color: var(--ok-dark);
  background: #d8f5d8;
  border: var(--pixel) solid var(--ok-dark);
  padding: 8px 10px;
  box-shadow: var(--pixel) var(--pixel) 0 var(--ok-dark);
}
.status-msg.lose {
  color: var(--bad-dark);
  background: #ffe0e0;
  border: var(--pixel) solid var(--bad-dark);
  padding: 8px 10px;
  box-shadow: var(--pixel) var(--pixel) 0 var(--bad-dark);
}
.status-msg.warn {
  color: var(--warn-dark);
  background: #fff7c8;
  border: var(--pixel) solid var(--warn-dark);
  padding: 8px 10px;
  box-shadow: var(--pixel) var(--pixel) 0 var(--warn-dark);
}

/* ====== Tabela de resultados (grid) ====== */
.results-panel {
  background: var(--panel-dark);
  color: #fff;
  padding: 12px;
}
.results-header,
.row-result {
  display: grid;
  grid-template-columns: 1.4fr repeat(8, 1fr);
  gap: 4px;
  align-items: center;
}
.results-header {
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.5px;
  background: var(--bg-1);
  color: #fff;
  padding: 8px 4px;
  border: 2px solid var(--ink);
}
.results-header .col {
  text-align: center;
  text-transform: uppercase;
}
.results-header .col--name {
  text-align: left;
  padding-left: 8px;
}

.results { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.row-result {
  padding: 4px;
  background: var(--bg-2);
  border: 2px solid var(--ink);
}
.row-result .cell {
  font-family: var(--font-pixel);
  font-size: 9px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
  border: 2px solid var(--ink);
  background: var(--neutral);
  color: var(--ink);
  position: relative;
  word-break: break-word;
  animation: flipIn 360ms steps(6, end);
}
.row-result .cell.green { background: var(--ok); color: #fff; }
.row-result .cell.yellow { background: var(--warn); color: var(--ink); }
.row-result .cell.red { background: var(--bad); color: #fff; }
.row-result .cell .arrow {
  display: block;
  font-size: 14px;
  line-height: 1;
  margin-top: 4px;
}

.row-result .cell--name {
  background: var(--paper);
  color: var(--ink);
  flex-direction: column;
  gap: 2px;
  padding: 4px;
}
.row-result .cell--name img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  image-rendering: pixelated;
}
.row-result .cell--name span {
  font-family: var(--font-pixel);
  font-size: 8px;
  text-align: center;
}

@keyframes flipIn {
  0% { transform: rotateX(90deg); opacity: 0; }
  60% { transform: rotateX(-15deg); opacity: 1; }
  100% { transform: rotateX(0); }
}

.row-result.win .cell { animation: pulseWin 600ms steps(6, end) 1; }
@keyframes pulseWin {
  0%, 100% { box-shadow: 0 0 0 0 var(--gold); }
  50% { box-shadow: 0 0 0 6px var(--gold); }
}

/* ====== Empty state ====== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 8px;
  color: #cdd2ee;
  font-family: var(--font-pixel);
  font-size: 10px;
  text-align: center;
  gap: 12px;
}
.empty-state img {
  width: 96px;
  height: 96px;
}
.empty-state.hidden { display: none; }

/* ====== Modais ====== */
.pixel-modal {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 560px;
  width: 92%;
  /* O .modal-close fica em right:-8px (sai 8px pra fora, de propósito). Quando o
     conteúdo é alto e o dialog ganha scroll vertical, esse overhang virava uma
     barra de scroll HORIZONTAL fantasma. Clipamos só o eixo X — o Y continua
     rolando normalmente. O overhang superior do botão segue visível. */
  overflow-x: hidden;
}
.pixel-modal::backdrop {
  background: rgba(10, 10, 25, 0.78);
  backdrop-filter: blur(2px);
}
.modal-body {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-body h2 {
  font-family: var(--font-pixel);
  font-size: 14px;
  margin: 0;
  color: var(--pokedex-red);
}
.modal-sub {
  font-size: 18px;
  margin: 0;
  color: var(--ink-soft);
}
.modal-body label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--ink);
}
.modal-body label .label-hint {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: 0;
  font-weight: normal;
}
.modal-body input {
  font-family: var(--font-body);
  font-size: 22px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  border: var(--pixel) solid var(--ink);
  box-shadow: inset 2px 2px 0 var(--line-soft);
  outline: none;
}
.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.auth-error {
  min-height: 18px;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--bad-dark);
}

/* ====== Histórico ====== */
.history-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.history-tab {
  font-size: 10px;
  background: #fff;
  padding: 8px 12px;
}
.history-tab.active {
  background: var(--gold);
  color: var(--ink);
}
.history-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.history-summary .stat {
  flex: 1;
  min-width: 120px;
  background: #fff;
  border: var(--pixel) solid var(--ink);
  padding: 8px 10px;
  text-align: center;
}
.history-summary .stat .num {
  font-family: var(--font-pixel);
  font-size: 18px;
  color: var(--pokedex-red);
  display: block;
}
.history-summary .stat .lbl {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--ink-soft);
}

.history-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.history-list .item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 9px;
  background: #fff;
  border: 2px solid var(--ink);
  padding: 6px 10px;
}
.history-list .item .res {
  padding: 2px 6px;
  border: 2px solid var(--ink);
}
.history-list .item .res.win { background: var(--ok); color: #fff; }
.history-list .item .res.lose { background: var(--bad); color: #fff; }
.history-list .empty {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--ink-soft);
  text-align: center;
  padding: 12px;
}

/* ====== Footer ====== */
.footer {
  text-align: center;
  padding: 24px 16px;
  color: #a0a6cf;
  font-family: var(--font-pixel);
  font-size: 8px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.footer a {
  color: var(--gold);
  text-decoration: none;
}
.footer a:hover { text-decoration: underline; }

/* Countdown + busca */
.countdown {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-pixel);
  background: var(--panel-dark);
  color: #fff;
  border: var(--pixel) solid var(--ink);
  padding: 6px 10px;
  box-shadow: var(--pixel) var(--pixel) 0 #000;
}
.countdown .cd-label { font-size: 8px; color: var(--gold); }
.countdown .cd-time { font-size: 14px; letter-spacing: 1px; }

/* Formulário de busca dentro do modal */
.search-form-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.search-form-modal input {
  font-family: var(--font-body);
  font-size: 22px;
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
  border: var(--pixel) solid var(--ink);
  box-shadow: inset 2px 2px 0 var(--line-soft);
  outline: none;
}

/* Game over actions */
.gameover-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Share modal */
.share-body { max-width: 480px; }
.share-preview-wrap {
  background: #000;
  border: var(--pixel) solid var(--ink);
  padding: 8px;
  display: flex;
  justify-content: center;
}
.share-preview-wrap canvas {
  width: 100%;
  max-width: 320px;
  height: auto;
  aspect-ratio: 9 / 16;
  image-rendering: pixelated;
}

/* Mode selector */
.mode-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--paper);
}
.mode-label {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--ink);
}
.mode-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mode-tab {
  background: #fff;
  font-size: 9px;
}
.mode-tab.active {
  background: var(--gold);
  color: var(--ink);
}
.mode-tab.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Botão de fechar dentro do modal */
.modal-body { position: relative; }
.modal-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 32px;
  height: 32px;
  border: var(--pixel) solid var(--ink);
  background: var(--pokeball-red);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--pixel) var(--pixel) 0 #000;
  padding: 0;
  /* Fica acima do .pixel-panel::after (o "canto cortado" de 4×4px do design pixel
     art), que senão aparece como um pixelzinho escuro dentro do botão, logo acima do X. */
  z-index: 2;
}
.modal-close:hover { background: #ff5252; }
.modal-close:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }

.pixel-modal--wide { max-width: 720px; }

/* Detalhe de partida no histórico */
.history-detail {
  margin-top: 8px;
  padding: 12px;
  background: var(--paper);
  border: var(--pixel) solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-detail.hidden { display: none; }
.history-detail .head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-pixel);
  font-size: 10px;
}
.history-detail .head img {
  width: 48px;
  height: 48px;
}
.history-detail .head .target-name {
  color: var(--pokedex-red);
}
.history-detail .attempts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
}
.history-detail .att {
  display: grid;
  grid-template-columns: 40px 1fr repeat(8, minmax(38px, 1fr));
  gap: 2px;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: 7px;
}
.history-detail .att img {
  width: 32px;
  height: 32px;
}
.history-detail .att .mini {
  border: 1px solid var(--ink);
  padding: 4px 2px;
  text-align: center;
  background: var(--neutral);
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.history-detail .att .mini.green { background: var(--ok); color: #fff; }
.history-detail .att .mini.yellow { background: var(--warn); }
.history-detail .att .mini.red { background: var(--bad); color: #fff; }
.history-detail .back-btn {
  align-self: flex-start;
}

.history-list .item {
  cursor: pointer;
}
.history-list .item:hover {
  background: var(--gold);
}

/* ====== Pokémon de ontem ====== */
.yesterday-panel {
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.yesterday-label {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--ink);
  letter-spacing: 1px;
}
.yesterday-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.yesterday-content img {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
}
.yesterday-content .y-name {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--pokedex-red);
}
.yesterday-content .y-date {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--ink-soft);
}
.yesterday-content .y-types {
  display: flex;
  gap: 4px;
}
.yesterday-content .y-type {
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 4px 6px;
  border: 2px solid var(--ink);
  background: #fff;
}
.yesterday-loading {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--ink-soft);
}
.yesterday-content .y-desc {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--ink);
  margin-top: 6px;
  padding: 6px 10px;
  border-left: 3px solid var(--pokeball-red);
  background: #fff;
  max-width: 360px;
  font-style: italic;
}

/* ====== Seletor de modo (Pokédex / Dica) ====== */
.game-mode-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--panel);
}
.game-mode-label {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--ink);
  letter-spacing: 1px;
}
.game-mode-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.game-mode-tab {
  background: #fff;
  font-size: 11px;
  padding: 10px 16px;
}
.game-mode-tab.active {
  background: var(--pokeball-red);
  color: #fff;
}

.mode-view.hidden { display: none !important; }

/* ====== Modo Dica ====== */
.dica-panel {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 220px;
}

/* Estado de carregamento do painel Dica (confirmando se já jogou hoje) */
.dica-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 12px;
  font-family: var(--font-body);
  font-size: 20px;
  color: var(--ink);
}
.dica-loading .pixel-spinner {
  width: 16px;
  height: 16px;
  margin-right: 0;
}

/* Tela inicial: botão Começar */
.dica-start {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 12px;
  text-align: center;
}
.dica-start-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: 20px;
  color: var(--ink);
}
.dica-start-btn {
  font-size: 14px;
  padding: 14px 28px;
  /* Largura fixa pra não "pular" quando o texto vira "Carregando…". */
  min-width: 244px;
}
.dica-start-btn.is-loading {
  cursor: wait;
}
/* Spinner pixelado para botões em carregamento (ex.: "Começar" do Dica) */
.pixel-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  vertical-align: -1px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: pixel-spin 0.6s steps(8, end) infinite;
}
@keyframes pixel-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .pixel-spinner { animation-duration: 1.6s; }
}

/* Tela em jogo: descrição + timer + chute */
.dica-play {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dica-description-wrap {
  background: #fff;
  border: var(--pixel) solid var(--ink);
  padding: 14px;
  position: relative;
  box-shadow: var(--pixel) var(--pixel) 0 var(--pokedex-shadow);
}
.dica-description-label {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--pokedex-red);
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.dica-description {
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink);
}

.dica-timer-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dica-timer-bar {
  flex: 1;
  height: 18px;
  background: var(--bg-1);
  border: var(--pixel) solid var(--ink);
  overflow: hidden;
  position: relative;
}
.dica-timer-fill {
  height: 100%;
  background: var(--ok);
  width: 100%;
  transition: width 0.1s linear, background 0.4s ease;
}
.dica-timer-wrap.warn .dica-timer-fill { background: var(--warn); }
.dica-timer-wrap.danger .dica-timer-fill { background: var(--bad); }
.dica-timer-text {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--ink);
  min-width: 36px;
  text-align: right;
}

#dica-guess-form { position: relative; }

/* Tela de resultado: revela Pokémon e bloqueia */
.dica-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 20px 12px;
}
.dica-result-banner {
  font-family: var(--font-pixel);
  font-size: 14px;
  padding: 10px 14px;
  border: var(--pixel) solid var(--ink);
  box-shadow: var(--pixel) var(--pixel) 0 var(--ink);
}
.dica-result-banner.win { background: var(--ok); color: #fff; }
.dica-result-banner.lose { background: var(--bad); color: #fff; }
.dica-result-sprite,
#dica-result-sprite {
  width: 128px;
  height: 128px;
  image-rendering: pixelated;
}
.dica-result-name {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--pokedex-red);
}
.dica-result-sub {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--ink-soft);
}
.dica-result-desc {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--ink);
  padding: 10px 14px;
  background: #fff;
  border: 3px solid var(--ink);
  max-width: 520px;
  font-style: italic;
}
.dica-result-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* CTA cross-modo (reusada pelo Pokédex + Dica) */
.cross-mode-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--gold);
  border: var(--pixel) solid var(--ink);
  box-shadow: var(--pixel) var(--pixel) 0 var(--ink);
  margin-top: 12px;
  flex-wrap: wrap;
}
.cross-mode-cta.hidden { display: none !important; }
.cross-mode-cta-icon {
  font-size: 32px;
  line-height: 1;
}
.cross-mode-cta-text {
  flex: 1;
  min-width: 180px;
  text-align: left;
}
.cross-mode-cta-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--ink);
  letter-spacing: 1px;
  line-height: 1.4;
  margin-bottom: 4px;
}
.cross-mode-cta-sub {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--ink);
  line-height: 1.2;
}

/* ====== Overlay de Game Over ====== */
.gameover-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 25, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 220ms steps(4, end);
}
.gameover-overlay.hidden { display: none; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gameover-card {
  background: var(--paper);
  max-width: 420px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  position: relative;
  z-index: 2;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: dropIn 480ms steps(8, end);
}
@keyframes dropIn {
  0% { transform: translateY(-200px); opacity: 0; }
  60% { transform: translateY(20px); opacity: 1; }
  80% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}
.gameover-title {
  font-family: var(--font-pixel);
  font-size: 18px;
  color: var(--pokedex-red);
  margin: 0;
  text-shadow: 2px 2px 0 #000;
}
.gameover-sub {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--ink-soft);
  margin: 0;
}
.gameover-card img {
  width: 144px;
  height: 144px;
  image-rendering: pixelated;
  filter: drop-shadow(3px 3px 0 #000);
  animation: bounceMon 1.2s steps(6, end) infinite;
}
@keyframes bounceMon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.gameover-name {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--pokedex-red);
}

.gameover-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  width: 100%;
  margin-top: 4px;
}
.gameover-stats .stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: #fff;
  border: 2px solid var(--ink);
  font-family: var(--font-pixel);
  font-size: 8px;
  gap: 6px;
}
.gameover-stats .stat-row .k {
  color: var(--ink-soft);
  text-transform: uppercase;
}
.gameover-stats .stat-row .v {
  color: var(--ink);
}
.gameover-card.win .gameover-title { color: var(--ok-dark); }

/* Prompt proativo de dica (faltando 1 tentativa) */
.hint-prompt {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 0;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fff3b8 0%, #ffe080 100%);
  border: 4px solid var(--gold-dark);
  box-shadow: 0 4px 0 var(--line);
  animation: hp-pulse 1.8s ease-in-out infinite;
}
@keyframes hp-pulse {
  0%, 100% { box-shadow: 0 4px 0 var(--line), 0 0 0 rgba(255, 203, 5, 0); }
  50% { box-shadow: 0 4px 0 var(--line), 0 0 18px rgba(255, 203, 5, 0.55); }
}
.hint-prompt-icon {
  font-size: 32px;
  flex-shrink: 0;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.3));
}
.hint-prompt-text {
  flex: 1;
  min-width: 0;
}
.hp-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--bad-dark);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.hp-sub {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  line-height: 1.3;
}
.hint-prompt-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.hint-prompt-actions .pixel-btn {
  font-size: 9px;
  padding: 8px 12px;
}

/* Card de dica do Versus — aparece automaticamente na última tentativa quando a partida foi criada com hint_enabled */
.vs-hint-card {
  padding: 14px 16px;
  background: linear-gradient(135deg, #fff8d8 0%, #ffeebd 100%);
  border: var(--pixel) solid var(--ink);
  box-shadow: 4px 4px 0 var(--gold-dark);
  animation: vs-hint-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.vs-hint-card .vs-hint-label {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--pokedex-red);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.vs-hint-card .vs-hint-text {
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.35;
  color: var(--ink);
}
@keyframes vs-hint-pop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Checkbox label (no modal de criar partida) */
.modal-body .checkbox-label {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 9px;
}
.modal-body .checkbox-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  padding: 0;
  flex-shrink: 0;
  background: #fff;
  border: var(--pixel) solid var(--ink);
  box-shadow: inset 2px 2px 0 var(--line-soft);
  cursor: pointer;
  margin-top: 2px;
  position: relative;
}
.modal-body .checkbox-label input[type="checkbox"]:checked {
  background: var(--pokedex-red);
}
.modal-body .checkbox-label input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 14px;
  line-height: 1;
}
.modal-body .checkbox-label > span { flex: 1; }

/* Dica revelada (depois do "Sim") */
.hint-revealed {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: var(--paper);
  border: 4px solid var(--gold-dark);
  box-shadow: 0 4px 0 var(--line);
}
.hint-revealed-label {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--pokedex-red);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.hint-revealed-text {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.35;
  color: var(--ink);
}
@media (max-width: 600px) {
  .hint-prompt { flex-direction: column; text-align: center; padding: 12px; }
  .hp-title { font-size: 9px; }
  .hp-sub { font-size: 14px; }
}

/* CTA "Desafie um amigo" — só aparece na vitória do modo Single */
.gameover-vs-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 4px 6px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fff3b8 0%, #ffe080 100%);
  border: 4px solid var(--gold-dark);
  box-shadow: 0 4px 0 var(--line);
  text-align: left;
  position: relative;
  overflow: hidden;
  /* overflow:hidden zera o min-height auto deste flex item; sem flex-shrink:0
     ele é esmagado quando o card (flex column) fica sem altura. Mantém tamanho
     fixo e deixa o card rolar. */
  flex-shrink: 0;
}
.gameover-vs-cta::before {
  /* Brilho diagonal sutil que passa */
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%);
  animation: vs-cta-shine 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes vs-cta-shine {
  0%, 60%, 100% { left: -120%; }
  80% { left: 130%; }
}
.vs-cta-icon {
  font-size: 32px;
  flex-shrink: 0;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.3));
  animation: vs-cta-wobble 2s ease-in-out infinite;
}
@keyframes vs-cta-wobble {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
.vs-cta-text {
  flex: 1;
  min-width: 0;
}
.vs-cta-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--pokedex-red);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.vs-cta-sub {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  line-height: 1.3;
}
.gameover-vs-cta .pixel-btn {
  flex-shrink: 0;
  font-size: 9px;
  padding: 10px 14px;
}
@media (max-width: 600px) {
  .gameover-vs-cta {
    flex-direction: column;
    text-align: center;
    padding: 12px;
  }
  .vs-cta-icon { font-size: 28px; }
  .vs-cta-title { font-size: 9px; }
  .vs-cta-sub { font-size: 14px; }
}

/* Card de dica "brinde" — só aparece quando perde todas as tentativas */
.gameover-hint {
  margin: 14px 4px 6px;
  padding: 12px 14px;
  background: var(--paper);
  border: 4px solid var(--gold-dark);
  border-radius: 0;
  text-align: left;
  box-shadow: 0 4px 0 var(--line);
}
.gameover-hint .hint-label {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--pokedex-red);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.gameover-hint .hint-text {
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.35;
  color: var(--ink);
}
@media (max-width: 600px) {
  .gameover-hint { padding: 10px 12px; }
  .gameover-hint .hint-label { font-size: 8px; }
  .gameover-hint .hint-text { font-size: 18px; }
}

/* Chuva de emojis chorando */
.emoji-rain {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.emoji-rain .cry {
  position: absolute;
  top: -40px;
  font-size: 28px;
  animation: fall linear forwards;
  user-select: none;
  filter: drop-shadow(0 0 4px rgba(70, 130, 240, 0.5));
}
@keyframes fall {
  to {
    transform: translateY(120vh) rotate(360deg);
  }
}

.hidden { display: none !important; }

/* ====== Responsivo ====== */
@media (max-width: 920px) {
  .results-header,
  .row-result {
    grid-template-columns: 1.2fr repeat(8, minmax(58px, 1fr));
    overflow-x: auto;
  }
}
@media (max-width: 700px) {
  .results-panel { padding: 8px; overflow-x: auto; }
  .results-header,
  .row-result {
    min-width: 720px;
  }
  .container { padding: 16px 12px 60px; }
  .topbar { padding: 12px; gap: 10px; }
  .brand h1 { font-size: 12px; }
  .hero-line { font-size: 10px; }

  /* Topbar em mobile: auth-area ocupa linha inteira pra evitar overflow lateral */
  .topbar-right {
    width: 100%;
    justify-content: flex-start;
  }
  #auth-area {
    width: 100%;
    gap: 6px;
  }
  #auth-area .pixel-btn {
    padding: 8px 10px;
    font-size: 8px;
  }
  .badge { font-size: 8px; }
}

/* Safety contra qualquer overflow lateral causar scroll horizontal indesejado */
html, body { overflow-x: hidden; }

/* ===== Bloco de conteúdo SEO ===== */
.seo-panel {
  margin-top: 24px;
  margin-left: auto;
  margin-right: auto;
  max-width: 760px;
  padding: 20px 22px;
  background: var(--panel);
  color: var(--ink);
  line-height: 1.5;
}
.seo-panel h2 {
  font-family: var(--font-pixel);
  font-size: 12px;
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--pokedex-red);
}
.seo-panel h3 {
  font-family: var(--font-pixel);
  font-size: 10px;
  margin-top: 18px;
  margin-bottom: 8px;
  color: var(--ink);
}
.seo-panel p {
  font-family: var(--font-body);
  font-size: 18px;
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--ink-soft);
}
.seo-panel p strong { color: var(--ink); }
.seo-panel .seo-list {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--ink-soft);
  padding-left: 22px;
  margin-top: 0;
  margin-bottom: 10px;
}
.seo-panel .seo-list li { margin-bottom: 4px; }
.seo-panel .seo-foot {
  font-size: 16px;
  opacity: 0.85;
}
@media (max-width: 600px) {
  .seo-panel { padding: 14px; }
  .seo-panel h2 { font-size: 10px; }
  .seo-panel h3 { font-size: 9px; }
  .seo-panel p, .seo-panel .seo-list { font-size: 16px; }
}

/* ===== Modo Versus ===== */
/* Wrapper: cada sub-seção é seu próprio .pixel-panel, igual ao single mode.
   O #versus-panel fica fora do <main class="container"> no HTML (sibling do
   container, no body), então precisamos replicar aqui o max-width + margin
   auto + padding pra ele ficar centralizado igual ao single em telas largas. */
.versus-mode {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}
/* Header da partida */
.versus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.versus-header h2 {
  font-family: var(--font-pixel);
  font-size: 14px;
  margin: 0;
  color: var(--pokedex-red);
}

/* Em rodada: 3 cards stacked com mesmo gap do container */
.versus-round {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Lobby */
.lobby-meta {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.lobby-link-row { margin-bottom: 14px; }
.lobby-link-label {
  display: block;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--ink);
  margin-bottom: 6px;
}
.lobby-link-input-wrap {
  display: flex;
  gap: 8px;
}
.lobby-link-input-wrap input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 18px;
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
  border: var(--pixel) solid var(--ink);
  box-shadow: inset 2px 2px 0 var(--line-soft);
  outline: none;
}
.lobby-hint {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink-soft);
  margin-top: 6px;
}
.lobby-players {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.lobby-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--paper);
  border: var(--pixel) solid var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
}
.lobby-player.empty { color: var(--ink-soft); font-style: italic; }
.lp-name { font-weight: bold; }
.lp-status { font-family: var(--font-pixel); font-size: 9px; }
.lobby-actions { margin-top: 8px; text-align: center; }

/* Scoreboard reusável */
.versus-scoreboard {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sb-player {
  flex: 1;
  min-width: 140px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--paper);
  border: var(--pixel) solid var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
}
.sb-player.me { background: #fff7d6; box-shadow: 0 4px 0 var(--gold-dark); }
.sb-name { font-weight: bold; }
.sb-score {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--pokedex-red);
}

/* Status durante a rodada — pills/cards */
.versus-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.vs-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  background: var(--paper);
  border: var(--pixel) solid var(--ink);
  box-shadow: 4px 4px 0 var(--line);
  text-align: center;
  min-width: 0;
  transition: transform 80ms steps(1, end), box-shadow 80ms steps(1, end);
}
.vs-pill .vp-label {
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.vs-pill .vp-value {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--ink);
  line-height: 1;
}
.vs-pill--round { background: #fff3b8; }
.vs-pill--round .vp-value { color: var(--gold-dark); }
.vs-pill--gen { background: #e6efff; }
.vs-pill--gen .vp-value { color: var(--pokedex-red); font-size: 11px; }
.vs-pill--me { background: #d8f1d8; box-shadow: 4px 4px 0 var(--ok-dark); }
.vs-pill--me .vp-value { color: var(--ok-dark); }
.vs-pill--opp { background: #f5d7d7; box-shadow: 4px 4px 0 var(--bad-dark); }
.vs-pill--opp .vp-value { color: var(--bad-dark); }
.vs-pill.is-done .vp-value::after { content: " ✓"; }

.vs-banner {
  grid-column: 1 / -1;
  font-family: var(--font-pixel);
  font-size: 10px;
  text-align: center;
  padding: 10px;
  background: var(--paper);
  border: var(--pixel) dashed var(--ink);
  color: var(--ink);
}
.vs-banner--wait { background: #fff7d6; color: var(--warn-dark); }

/* Flash de fim de rodada: aparece por ~1.6s antes da transição pra tela de resultado.
   Dá tempo do jogador ver a linha vencedora aparecer no tabuleiro. */
.vs-flash {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px;
  font-family: var(--font-pixel);
  font-size: 14px;
  border: var(--pixel) solid var(--ink);
  box-shadow: 4px 4px 0 var(--line);
  letter-spacing: 0.5px;
  animation: vs-flash-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.vs-flash-icon { font-size: 28px; line-height: 1; }
.vs-flash--win {
  background: linear-gradient(180deg, #ffe580 0%, #f0c419 100%);
  color: #5a4500;
}
.vs-flash--lose {
  background: linear-gradient(180deg, #3a3f5a 0%, #1c1f36 100%);
  color: #ffd6d6;
}
.vs-flash--tie {
  background: linear-gradient(180deg, #cfdcff 0%, #9bb3ff 100%);
  color: #1a1d6e;
}
@keyframes vs-flash-pop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.vs-error {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--bad-dark);
  margin-top: 6px;
  display: block;
}

/* ===== Tela de resultado da rodada (tema Pokédex) ===== */
/* (.versus-round-result agora é um .pixel-panel — herda padding da base) */

/* Banner do resultado */
.rr-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-family: var(--font-pixel);
  font-size: 13px;
  text-align: center;
  border: var(--pixel) solid var(--ink);
  box-shadow: 4px 4px 0 var(--line);
  letter-spacing: 0.5px;
}
.rr-banner-icon { font-size: 28px; line-height: 1; }
.rr-banner-text { line-height: 1.3; }
.rr-banner--win {
  background: linear-gradient(180deg, #ffe580 0%, #f0c419 100%);
  color: #5a4500;
  animation: rr-glow 1.6s ease-in-out infinite alternate;
}
.rr-banner--lose {
  background: linear-gradient(180deg, #3a3f5a 0%, #1c1f36 100%);
  color: #ffd6d6;
}
.rr-banner--tie {
  background: linear-gradient(180deg, #cfdcff 0%, #9bb3ff 100%);
  color: #1a1d6e;
}
@keyframes rr-glow {
  from { box-shadow: 4px 4px 0 var(--line), 0 0 0 rgba(255, 203, 5, 0); }
  to { box-shadow: 4px 4px 0 var(--line), 0 0 24px rgba(255, 203, 5, 0.55); }
}

/* Card "Pokédex" — moldura vermelha com tela embutida */
.rr-pokedex {
  --rr-type-color: #6390F0;
  background: linear-gradient(180deg, var(--pokedex-red) 0%, var(--pokedex-shadow) 100%);
  border: var(--pixel) solid var(--ink);
  box-shadow:
    var(--pixel) var(--pixel) 0 #000,
    inset 0 0 0 2px #fff;
  padding: 22px 20px;
  margin-bottom: 18px;
  position: relative;
}
.rr-pokedex::before {
  /* "Botão" decorativo no canto */
  content: "";
  position: absolute;
  top: 10px;
  right: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0%, #aaa 60%, #555 100%);
  border: 2px solid #1a1d2e;
}

.rr-pokedex-screen {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), transparent 50%),
    linear-gradient(180deg, var(--rr-type-color) 0%, color-mix(in srgb, var(--rr-type-color) 70%, black) 100%);
  border: var(--pixel) solid var(--ink);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
  padding: 18px 16px 16px;
  text-align: center;
  position: relative;
}

/* LEDzinhos e dots decorativos no topo da tela */
.rr-pokedex-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.rr-led {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #6effa2 0%, #2da144 60%, #0c4d1e 100%);
  box-shadow: 0 0 6px #6effa2;
  animation: rr-led-blink 1.2s ease-in-out infinite;
}
.rr-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.6);
}
@keyframes rr-led-blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px #6effa2; }
  50% { opacity: 0.4; box-shadow: 0 0 2px #6effa2; }
}

/* Sprite */
.rr-sprite-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 140px;
  margin: 6px 0 8px;
  background:
    radial-gradient(ellipse at center bottom, rgba(0, 0, 0, 0.35) 0%, transparent 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 4px, transparent 4px 8px);
  border-radius: 0;
  position: relative;
}
.rr-sprite-wrap img {
  width: 130px;
  height: 130px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.4));
  animation: rr-bounce 1.4s ease-in-out infinite;
}
@keyframes rr-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.rr-id {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 1px;
  margin-top: 6px;
}
.rr-name {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  margin: 6px 0 12px;
  letter-spacing: 1px;
}
.rr-types {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rr-type {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.5px;
  color: #fff;
  padding: 6px 12px;
  border: 2px solid rgba(0, 0, 0, 0.6);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
  text-transform: uppercase;
}

/* Label de seção (Placar / Próxima) */
.rr-section-label {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  margin: 0 0 10px;
}

/* Ações: status do oponente + botão "Pronto" */
.rr-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.rr-opp-status {
  font-family: var(--font-pixel);
  font-size: 9px;
  text-align: center;
}
.rr-opp-status .opp-ready { color: var(--ok-dark); }
.rr-opp-status .opp-waiting { color: var(--ink-soft); }

/* Botão "Pronto" com pokébola */
.rr-next-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-size: 11px;
}
.rr-next-btn.is-ready { background: var(--ok); }
.rr-next-btn.is-ready:hover { background: var(--ok-dark); }

/* Loading nos botões "Pronto!" / "Pronto pra próxima" do Versus — enquanto o
   servidor inicia a rodada e gera os dados/descrição da IA. */
.vs-ready-btn.is-loading { cursor: wait; }
.vs-ready-btn.is-loading::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  vertical-align: -1px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: pixel-spin 0.6s steps(8, end) infinite;
}
/* No botão da rodada (inline-flex com gap) o próprio gap já espaça o spinner */
.rr-next-btn.is-loading::before { margin-right: 0; }
.rr-next-btn.is-loading .pokeball-mini { display: none; }
.pokeball-mini {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background:
    linear-gradient(180deg, var(--pokeball-red) 0%, var(--pokeball-red) 47%, #1a1d2e 47%, #1a1d2e 53%, #fff 53%, #fff 100%);
  border: 2px solid #1a1d2e;
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}
.pokeball-mini::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  border: 2px solid #1a1d2e;
}

@media (max-width: 600px) {
  .rr-banner { font-size: 11px; padding: 12px 14px; }
  .rr-banner-icon { font-size: 24px; }
  .rr-sprite-wrap { height: 120px; }
  .rr-sprite-wrap img { width: 110px; height: 110px; }
  .rr-name { font-size: 14px; }
  .rr-id { font-size: 8px; }
  .rr-type { font-size: 8px; padding: 5px 9px; }
}

/* Fim de partida */
/* (.versus-done agora é um .pixel-panel — só ajusta alinhamento) */
.versus-done {
  text-align: center;
}
.versus-done .done-title {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--pokedex-red);
  margin-bottom: 8px;
}
.done-subtitle {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--ink-soft);
  margin-bottom: 18px;
  min-height: 1em;
}

/* Modal labels (criar / entrar) */
#versus-create-modal label:not(.checkbox-label),
#versus-join-modal label:not(.checkbox-label) {
  display: block;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--ink);
  margin: 10px 0 4px;
}
#versus-create-modal input:not([type="checkbox"]),
#versus-create-modal select,
#versus-join-modal input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: 20px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  border: var(--pixel) solid var(--ink);
  box-shadow: inset 2px 2px 0 var(--line-soft);
  outline: none;
}

/* ===== Versus · Tipo de jogo (modal de criar) ===== */
.vc-mode-field {
  margin: 14px 0 6px;
}
.vc-mode-label {
  display: block;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--ink);
  margin: 0 0 6px;
}
.vc-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.vc-mode-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 9px;
  background: var(--paper);
  color: var(--ink);
  border: var(--pixel) solid var(--ink);
  box-shadow: var(--pixel) var(--pixel) 0 var(--line-soft);
  cursor: pointer;
}
.vc-mode-tab .vc-mode-icon { font-size: 22px; line-height: 1; }
.vc-mode-tab .vc-mode-name { font-size: 11px; letter-spacing: 1px; }
.vc-mode-tab .vc-mode-hint {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  opacity: 0.75;
  letter-spacing: 0;
}
.vc-mode-tab.active {
  background: var(--gold);
  color: var(--ink);
  box-shadow: var(--pixel) var(--pixel) 0 var(--pokedex-shadow);
  transform: translate(-1px, -1px);
}
.vc-mode-tab.active .vc-mode-hint { opacity: 0.9; }

/* Botão "Como funciona?" + descrição do seletor Sortido/Escolha */
.vc-howto-btn {
  display: block;
  width: 100%;
  margin: 0 0 4px;
  padding: 8px;
  font-family: var(--font-body);
  font-size: 16px;
  background: #eef4ff;
  color: var(--ink);
  border: 2px dashed var(--pokedex-red);
  cursor: pointer;
}
.vc-howto-btn:hover { background: #dfeaff; }
.vc-pickmode-desc {
  margin: 8px 2px 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.3;
  color: var(--ink);
  background: var(--paper);
  border-left: var(--pixel) solid var(--gold-dark);
  padding: 6px 8px;
}

/* ===== Versus · Tutorial ===== */
.tut-section { margin: 14px 0; }
.tut-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--pokedex-red);
  margin-bottom: 6px;
}
.tut-icon { font-size: 16px; }
.tut-list { margin: 0; padding-left: 18px; }
.tut-list li,
.tut-p {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 5px;
}
.tut-mode {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 8px 10px;
  margin-bottom: 8px;
  box-shadow: 3px 3px 0 var(--line-soft);
}
.tut-mode-name {
  font-family: var(--font-pixel);
  font-size: 11px;
  margin-bottom: 4px;
}
.tut-mode p {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.35;
  margin: 0 0 4px;
}
.tut-score {
  background: #fff3b8;
  border-left: var(--pixel) solid var(--gold-dark);
  padding: 5px 7px;
}
.tut-tag {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 2px 5px;
  background: var(--ink);
  color: var(--paper);
  vertical-align: middle;
}
.tut-tag--new { background: var(--pokedex-red); }

/* ===== Versus · Tela de Escolha (picking) ===== */
.picking-head { text-align: center; margin-bottom: 10px; }
.picking-title { font-family: var(--font-pixel); font-size: 14px; margin: 0 0 6px; }
.picking-sub {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
}
.picking-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
}
.pick-dots { display: flex; gap: 5px; }
.pick-dot {
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  background: var(--paper);
}
.pick-dot.filled { background: var(--ok); }
.pick-count { font-family: var(--font-pixel); font-size: 11px; color: var(--ink-soft); }
.picking-chosen {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
  justify-content: center;
  min-height: 40px;
}
.pick-empty {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink-soft);
  font-style: italic;
  padding: 10px;
}
.pick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 88px;
  padding: 6px 4px 4px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--line-soft);
}
.pick-card.locked { box-shadow: 3px 3px 0 var(--ok-dark); background: #eefaee; }
.pick-card-round { font-family: var(--font-pixel); font-size: 8px; color: var(--pokedex-red); }
.pick-card img { width: 52px; height: 52px; image-rendering: pixelated; }
.pick-card-name { font-family: var(--font-body); font-size: 14px; text-align: center; line-height: 1.1; }
.pick-card-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  background: var(--bad);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}
.pick-card-lock { position: absolute; top: -6px; right: -6px; font-size: 14px; }
.picking-actions { text-align: center; margin: 8px 0; }
.picking-status {
  margin-top: 8px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 15px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.picking-status .opp-ready { color: var(--ok-dark); font-weight: bold; }
.picking-status .opp-waiting { color: var(--ink-soft); }
.pick-warn { color: var(--bad-dark); font-weight: bold; }

/* ===== Versus · Chat rápido (frases prontas) ===== */
.versus-quickchat { display: flex; flex-direction: column; gap: 8px; }
.quickchat-label { font-family: var(--font-pixel); font-size: 9px; color: var(--ink-soft); }
.quickchat-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.quickchat-btn {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 5px 10px;
  background: #eef4ff;
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--line-soft);
  cursor: pointer;
}
.quickchat-btn:hover { background: var(--gold); }
.quickchat-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--line-soft); }

/* Bolhas de recado recebidas — flutuam no topo da tela */
.vs-chat-stack {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 60;
  pointer-events: none;
  width: max-content;
  max-width: 92vw;
}
.vs-chat-bubble {
  display: flex;
  flex-direction: column;
  padding: 6px 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--line-soft);
  animation: vsChatIn 0.25s ease-out, vsChatOut 0.4s ease-in 3.2s forwards;
}
.vs-chat-bubble.mine { align-self: flex-end; background: #e6efff; }
.vs-chat-bubble.theirs { align-self: flex-start; background: #fff3b8; }
.vs-chat-who { font-family: var(--font-pixel); font-size: 8px; color: var(--ink-soft); }
.vs-chat-text { font-family: var(--font-body); font-size: 16px; color: var(--ink); }
@keyframes vsChatIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes vsChatOut { to { opacity: 0; transform: translateY(-8px); } }

/* Banner de contexto do Escolha + legenda do placar + nota da revelação */
.vs-banner--escolha { background: #e9defb; color: var(--ink); border-style: solid; border-left: var(--pixel) solid #6F35FC; }
.sb-caption {
  flex: 0 0 100%;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--ink-soft);
  text-align: center;
  margin-bottom: 2px;
}
.rr-chooser-note { font-family: var(--font-body); font-size: 14px; color: var(--pokedex-red); margin-top: 2px; }

/* ===== Versus · Chip do modo no lobby ===== */
.lobby-mode-chip {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 4px 8px;
  border: var(--pixel) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  margin-right: 6px;
  letter-spacing: 1px;
}
.lobby-mode-chip--dica { background: #ffe9b3; }
.lobby-mode-chip--pokedex { background: #ffd5d5; }
.lobby-mode-chip--escolha { background: #e9defb; }

/* ===== Versus · Reações emoji (fim da partida) ===== */
.reactions-row {
  margin: 18px 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.reactions-label {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--ink);
  letter-spacing: 1px;
}
.reactions-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.reaction-btn {
  font-size: 22px;
  line-height: 1;
  padding: 8px 10px;
  background: var(--paper);
  border: var(--pixel) solid var(--ink);
  box-shadow: var(--pixel) var(--pixel) 0 var(--line-soft);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.reaction-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--pokedex-shadow);
}
.reaction-btn:active,
.reaction-btn.is-sending {
  transform: translate(1px, 1px) scale(1.15);
  box-shadow: 1px 1px 0 var(--line-soft);
}
.reactions-hint {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  opacity: 0.7;
}
.reactions-hint.warn { color: var(--bad); opacity: 1; }

/* Camada onde os emojis flutuam — sobreposta ao painel do versus inteiro.
   pointer-events:none pra não atrapalhar cliques nos botões abaixo. */
.reactions-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  overflow: hidden;
}
.reaction-fly {
  position: absolute;
  bottom: -60px;
  font-size: 48px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0,0,0,0.18);
  user-select: none;
  /* drift e rot vêm via custom properties setadas no JS (variação por emoji) */
  --reaction-drift: 0px;
  --reaction-rot: 0deg;
  animation: reaction-float 2.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  will-change: transform, opacity;
}
@keyframes reaction-float {
  0%   { transform: translate(0, 0) rotate(0deg) scale(0.6); opacity: 0; }
  10%  { opacity: 1; transform: translate(0, -40px) rotate(0deg) scale(1.1); }
  60%  { opacity: 1; }
  100% {
    transform:
      translate(var(--reaction-drift), calc(-100vh - 60px))
      rotate(var(--reaction-rot))
      scale(1);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .reaction-fly { animation-duration: 1s; }
  @keyframes reaction-float {
    0%   { opacity: 0; transform: translateY(0); }
    20%  { opacity: 1; transform: translateY(-30px); }
    100% { opacity: 0; transform: translateY(-50vh); }
  }
}

/* ===== Versus · Fim da partida · Jogar novamente / Nova partida ===== */
.done-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.done-actions .pixel-btn { min-width: 140px; }
.rematch-status {
  margin: 8px 0 0;
  padding: 10px 14px;
  background: #fffbe6;
  border: var(--pixel) solid var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--ink);
  text-align: center;
}
.rematch-status.is-ready { background: #e0ffd8; }
.rematch-status.is-waiting { background: #fff3c4; }

/* ===== Versus · Dica · "Esperando o oponente" ===== */
.versus-dica-waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  margin-top: 4px;
  background: #fffbe6;
  border: var(--pixel) solid var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--ink);
}
.versus-dica-waiting-icon { font-size: 22px; }

@media (max-width: 600px) {
  .versus-header h2 { font-size: 11px; }
  .lobby-link-input-wrap { flex-direction: column; }
  .versus-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .vs-pill { padding: 8px 6px; }
  .vs-pill .vp-label { font-size: 7px; }
  .vs-pill .vp-value { font-size: 11px; }
  .vs-pill--gen .vp-value { font-size: 10px; }
  .vc-mode-tab .vc-mode-icon { font-size: 18px; }
  .vc-mode-tab .vc-mode-name { font-size: 10px; }
  .vc-mode-tab .vc-mode-hint { font-size: 11px; }
}

/* ====== Painel Admin ====== */
#admin-modal.pixel-modal--wide { max-width: 920px; }

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 14px;
  padding-bottom: 10px;
  border-bottom: var(--pixel) solid var(--line-soft);
}
.admin-tab {
  font-family: var(--font-pixel);
  font-size: 10px;
  background: var(--panel);
  color: var(--ink);
  border: var(--pixel) solid var(--ink);
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: var(--pixel) var(--pixel) 0 #000;
}
.admin-tab:hover { background: var(--paper); }
.admin-tab:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }
.admin-tab.is-active {
  background: var(--gold);
  color: var(--ink);
}

.admin-content {
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 18px;
  min-height: 200px;
}
.admin-content .empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.admin-card {
  background: var(--paper);
  border: var(--pixel) solid var(--ink);
  padding: 12px;
  box-shadow: var(--pixel) var(--pixel) 0 #000;
}
.admin-card-label {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.admin-card-value {
  font-family: var(--font-pixel);
  font-size: 22px;
  color: var(--pokedex-red);
  line-height: 1.2;
}
.admin-card-sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-soft);
}

.admin-section { margin-top: 16px; }
.admin-section h3 {
  font-family: var(--font-pixel);
  font-size: 11px;
  margin: 0 0 8px;
  color: var(--ink);
}
.admin-daily-warn {
  font-family: var(--font-body, inherit);
  font-size: 10px;
  color: var(--pokedex-red);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 6px;
}
.admin-daily-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.admin-daily-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: var(--pixel) solid var(--ink);
  padding: 8px 10px;
  box-shadow: var(--pixel) var(--pixel) 0 #000;
}
.admin-daily-card__sprite {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-daily-card__sprite img {
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
}
.admin-daily-card__info { min-width: 0; }
.admin-daily-card__name {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--ink);
  margin-top: 4px;
  word-break: break-word;
}
.admin-daily-card__desc {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 6px;
  font-style: italic;
  line-height: 1.3;
}
.admin-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
}
.admin-bullets li {
  background: var(--panel);
  border: var(--pixel) solid var(--ink);
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
}
.admin-bullets strong {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--pokedex-red);
}

.admin-toolbar {
  margin-bottom: 8px;
  font-size: 16px;
  color: var(--ink-soft);
}
.admin-toolbar strong {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--ink);
  margin-right: 4px;
}

.admin-table-wrap {
  overflow-x: auto;
  border: var(--pixel) solid var(--ink);
  background: var(--panel);
  box-shadow: var(--pixel) var(--pixel) 0 #000;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.admin-table th,
.admin-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid var(--line-soft);
  white-space: nowrap;
}
.admin-table th {
  font-family: var(--font-pixel);
  font-size: 9px;
  background: var(--bg-1);
  color: var(--paper);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-table tbody tr:nth-child(even) { background: var(--paper); }
.admin-table code {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--gold);
  padding: 2px 6px;
  border-radius: 0;
  font-size: 14px;
}

.admin-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  font-size: 16px;
  color: var(--ink-soft);
}
.admin-pager .pixel-btn { font-size: 9px; padding: 6px 10px; }
.admin-pager .pixel-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(1);
}

.admin-footnote {
  margin-top: 14px;
  padding: 10px;
  border-left: 4px solid var(--gold);
  background: var(--paper);
  font-size: 14px;
  color: var(--ink-soft);
}

.admin-mute { color: var(--ink-soft); font-size: 12px; }
.admin-table--clickable tbody tr.admin-row--clickable { cursor: pointer; }
.admin-table--clickable tbody tr.admin-row--clickable:hover { background: var(--gold); color: var(--ink); }
.admin-table--compact th, .admin-table--compact td { padding: 4px 6px; font-size: 12px; }

.admin-pill {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: var(--pixel) solid var(--ink);
}
.admin-pill--win { background: #7ad17a; color: var(--ink); }
.admin-pill--loss { background: #d17a7a; color: var(--ink); }
.admin-pill--neutral { background: var(--paper); color: var(--ink-soft); }
.admin-pill--mode-pokedex { background: #fde6a7; color: var(--ink); }
.admin-pill--mode-dica { background: #c7ccf2; color: var(--ink); }

.admin-fb { font-size: 12px; }
.admin-fb--green { background: #7ad17a; color: var(--ink); }
.admin-fb--yellow { background: #f0d36b; color: var(--ink); }
.admin-fb--red { background: var(--paper); color: var(--ink-soft); }
.admin-fb--neutral { background: var(--paper); color: var(--ink-soft); }

.admin-back {
  background: transparent;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 4px 0;
  margin-bottom: 6px;
}
.admin-back:hover { color: var(--ink); }

.pixel-btn--small { font-size: 10px; padding: 4px 8px; }

/* ===== Spectator (modo telespectador) ===== */
.spectate-header { margin-bottom: 12px; }
.spectate-meta {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.spectate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.spectate-col {
  background: var(--paper);
  border: var(--pixel) solid var(--ink);
  padding: 10px;
  box-shadow: var(--pixel) var(--pixel) 0 #000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spectate-name {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ink);
}
.spec-score {
  font-size: 16px;
  color: var(--pokedex-red);
}
.spectate-attempts {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.spec-attempt {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 6px;
  align-items: center;
  padding: 4px;
  background: var(--bg-0);
  border: 1px solid var(--ink);
}
.spec-attempt--win { background: #7ad17a; }
.spec-attempt img {
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}
.spec-guess {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--ink);
  text-transform: uppercase;
}
.spec-cells {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}
.spec-cell {
  font-size: 9px;
  padding: 2px 3px;
  text-align: center;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spec-cell--green { background: #7ad17a; color: var(--ink); }
.spec-cell--yellow { background: #f0d36b; color: var(--ink); }
.spec-cell--red { background: var(--paper); color: var(--ink-soft); }
.spec-cell--neutral { background: var(--paper); color: var(--ink-soft); }
.spec-remaining {
  font-size: 11px;
  color: var(--ink-soft);
  text-align: right;
}
.spectate-result {
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 8px;
  margin-bottom: 8px;
  background: var(--gold);
  border: var(--pixel) solid var(--ink);
}
@media (max-width: 600px) {
  .spectate-grid { grid-template-columns: 1fr; }
  .spec-cells { grid-template-columns: repeat(4, 1fr); }
}

.spectate-live { margin-bottom: 14px; }
.spectate-live__title,
.spectate-history__title {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--ink);
  margin: 0 0 8px;
}
.spectate-history { margin-top: 12px; }
.spectate-history__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.spectate-round {
  background: var(--paper);
  border: var(--pixel) solid var(--ink);
}
.spectate-round[open] {
  box-shadow: var(--pixel) var(--pixel) 0 #000;
}
.spectate-round__head {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
}
.spectate-round__head::-webkit-details-marker { display: none; }
.spectate-round__num {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.spectate-round__target {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.spectate-round__target img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}
.spectate-round__result {
  font-size: 12px;
}
.spectate-round__counts {
  font-size: 11px;
  color: var(--ink-soft);
}
.spectate-round[open] .spectate-grid {
  padding: 10px;
  border-top: 2px solid var(--ink);
}
@media (max-width: 600px) {
  .spectate-round__head {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 560px) {
  .admin-card-value { font-size: 18px; }
  .admin-table { font-size: 14px; }
  .admin-table th { font-size: 8px; }
  .admin-tab { font-size: 9px; padding: 6px 8px; }
}

/* Aviso de oponente desconectado (Versus em tempo real) */
.vs-conn-lost {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fde68a;
  color: #7c2d12;
  border: 2px solid #f59e0b;
  font-weight: 700;
  text-align: center;
  font-size: 0.95rem;
  animation: vs-conn-pulse 1.4s ease-in-out infinite;
}
.vs-conn-lost.hidden { display: none; }
@keyframes vs-conn-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* ===================================================================== */
/* ===== Avatares (sprites de treinadores) ===== */
/* ===================================================================== */
.pk-avatar {
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
}
/* Avatares cujo src é definido via JS (topbar + miniaturas dos modais) ficam
   invisíveis até a imagem terminar de carregar — em vez de piscar o ícone de
   "imagem quebrada" no refresh. .is-loaded entra no onload (ou na hora, se cache).
   Escopo só nestes: as imagens dinâmicas (lobby/placar) re-renderizam direto e
   uma regra global de opacity causaria flicker a cada update. */
#avatar-btn-img,
[data-my-avatar] {
  opacity: 0;
  transition: opacity 140ms ease;
}
#avatar-btn-img.is-loaded,
[data-my-avatar].is-loaded {
  opacity: 1;
}
.avatar-sm { width: 30px; height: 30px; }
.avatar-lg { width: 72px; height: 72px; }

/* Botão de avatar na topbar — sempre visível (visitante ou logado) */
.avatar-btn {
  width: 34px;
  height: 34px;
  padding: 2px;
  flex-shrink: 0;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.avatar-btn:hover { background: #fff7d6; }
.avatar-btn:active { transform: translateY(2px); box-shadow: none; }
.avatar-btn img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }

/* Grid do seletor de avatar */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 4px;
  margin-top: 6px;
}
.avatar-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 6px;
  background: #fff;
  border: 3px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-body);
  cursor: pointer;
}
.avatar-cell:hover { background: #fff7d6; }
.avatar-cell img { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; }
.avatar-cell-name { font-size: 15px; line-height: 1.05; text-align: center; }
.avatar-cell.is-selected {
  border-color: var(--pokedex-red);
  background: #fff7d6;
  box-shadow: 0 0 0 3px var(--gold) inset;
}

/* Linha "Seu avatar" nos modais de criar/entrar no versus.
   flex-wrap + min-width:0 garantem que NUNCA estoura a largura do modal (em telas
   bem estreitas a meta desce pra baixo do avatar em vez de criar scroll lateral). */
.avatar-row { display: flex; align-items: center; gap: 12px; margin: 4px 0 8px; flex-wrap: wrap; }
.avatar-row .pk-avatar.avatar-lg { background: var(--paper); border: 3px solid var(--ink); padding: 4px; flex-shrink: 0; }
.avatar-row-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.avatar-row-label { font-family: var(--font-pixel); font-size: 9px; color: var(--ink); }

/* Avatar no topo do perfil */
.profile-avatar { display: flex; justify-content: center; margin: 2px 0 4px; }
.profile-avatar:empty { display: none; }
.profile-avatar .pk-avatar.avatar-lg {
  width: 84px;
  height: 84px;
  background: var(--paper);
  border: 4px solid var(--ink);
  padding: 6px;
}

/* Avatar inline em lobby / scoreboard / spectate */
.lp-id, .sb-id { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.lp-id .pk-avatar, .sb-id .pk-avatar,
.spectate-name .pk-avatar {
  background: var(--bg-1);
  border: 2px solid var(--ink);
  padding: 1px;
  flex-shrink: 0;
}
.spectate-name { gap: 6px; }
.spectate-name > span:not(.spec-score) { flex: 1; }

/* Jogadores no painel admin (coluna "Jogadores") */
.admin-vs-player { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.admin-vs-player .pk-avatar {
  width: 24px;
  height: 24px;
  background: var(--bg-1);
  border: 2px solid var(--ink);
  padding: 1px;
  flex-shrink: 0;
}
.admin-vs-sep { margin: 0 8px; color: var(--ink-soft); font-style: italic; }
