:root {
  /* ====================================================================
     Paleta USB Arcade (extraída do site de referência, em OKLCH).
     Amarelo neon = primária; violeta/magenta neon = acentos;
     fundo roxo profundo em gradiente radial; texto quase branco.
     ==================================================================== */
  --bg: oklch(16% 0.065 300);            /* fundo (roxo profundo, levemente mais claro) */
  --bg-deep: oklch(12% 0.05 300);        /* fundo mais escuro ainda */
  --panel: oklch(25% 0.095 300);         /* cards / painéis */
  --panel-2: oklch(31% 0.08 295);        /* muted / realce de fundo */
  --border: oklch(36% 0.09 295);
  --text: oklch(98% 0.01 280);
  --text-dim: oklch(80% 0.05 290);

  --accent: oklch(92% 0.19 100);        /* amarelo neon (primária) */
  --accent-ink: oklch(20% 0.08 300);    /* texto escuro sobre o amarelo */
  --accent-2: oklch(55% 0.27 305);      /* violeta neon (secundária) */
  --magenta: oklch(70% 0.30 330);       /* magenta neon (acento) */
  --green: oklch(72% 0.19 150);
  --yellow: oklch(92% 0.19 100);
  --danger: oklch(65% 0.27 25);         /* vermelho (erros/perigo) */

  --radius: 14px;
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-hard: 0 6px 0 rgba(0, 0, 0, 0.35);
  --shadow-neon-yellow: 0 0 24px oklch(92% 0.19 100 / 0.45), 0 0 1px oklch(92% 0.19 100 / 0.8);
  --shadow-neon-magenta: 0 0 28px oklch(70% 0.30 330 / 0.55);
  --gradient-bg: radial-gradient(120% 80% at 50% 0%, oklch(31% 0.13 305) 0%, oklch(16% 0.065 300) 60%, oklch(12% 0.05 300) 100%);
  --gradient-neon: linear-gradient(90deg, oklch(55% 0.27 305) 0%, oklch(70% 0.30 330) 100%);
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-deep);
  background-image: var(--gradient-bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
}

.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: transparent;
  overflow: hidden;
}

.bg-fx::before,
.bg-fx::after {
  content: "";
  position: absolute;
  width: 56vmax;
  height: 56vmax;
}

.bg-fx::before {
  top: -18vmax;
  right: -18vmax;
  background: repeating-linear-gradient(135deg, oklch(55% 0.27 305 / 0.10) 0 16px, transparent 16px 32px);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}

.bg-fx::after {
  bottom: -22vmax;
  left: -22vmax;
  background: repeating-linear-gradient(135deg, oklch(70% 0.30 330 / 0.08) 0 16px, transparent 16px 32px);
  clip-path: polygon(0 100%, 100% 100%, 0 0);
}

/* ---------- Header ---------- */
.topbar {
  text-align: center;
  padding: 1.8rem 1.2rem 1.5rem;
  border-bottom: 4px solid var(--accent);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  text-align: left;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 2.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.logo-icon {
  width: 2.1rem;
  height: 2.1rem;
  color: var(--accent);
}

.logo-text .accent {
  color: var(--bg);
  background: var(--accent);
  padding: 0 0.22em;
  margin-left: 0.18em;
  display: inline-block;
  transform: skewX(-10deg);
}

.tagline {
  color: var(--text-dim);
  margin: 0.7rem auto 0;
  max-width: 540px;
  font-family: "Barlow", sans-serif;
  font-weight: 400;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

/* ---------- Navegação principal ---------- */
.main-nav {
  display: flex;
  gap: 0.3rem;
}

.nav-link {
  border: 2px solid transparent;
  background: transparent;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: "Barlow", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: var(--bg);
  border-color: var(--accent-2);
  background: var(--accent-2);
}

/* ---------- Widget de autenticação ---------- */
.auth-guest,
.auth-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-username {
  font-family: "Barlow", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text);
  font-size: 0.9rem;
}

.auth-record {
  color: var(--text-dim);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ---------- Lobby banner (salas aguardando jogador) ---------- */
.lobby-banner {
  max-width: 1000px;
  margin: 0 auto 1.5rem;
  padding: 0 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.lobby-banner.hidden {
  display: none;
}

.lobby-banner-label {
  font-family: "Barlow", sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

.lobby-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.lobby-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  background: var(--panel);
  border: 2px solid var(--border);
  border-left: 5px solid var(--accent-2);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
}

.lobby-room-code {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--accent-2);
}

.lobby-room-tag {
  font-family: "Barlow", sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.lobby-room-tag.open {
  border-color: var(--green);
  color: var(--green);
}

.lobby-room-msg {
  color: var(--text-dim);
  font-size: 0.9rem;
  flex: 1;
}

.btn-mini {
  border: 2px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-family: "Barlow", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: filter 0.15s, border-color 0.15s, background 0.15s, color 0.15s;
}

.btn-mini:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.btn-mini-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-mini-primary:hover {
  filter: brightness(1.15);
  color: #fff;
}

.btn-mini:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Layout ---------- */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.2rem 3rem;
}

.screen.hidden {
  display: none;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* ---------- Títulos de seção ---------- */
.section-title {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 1.6rem 0 1.3rem;
  padding-left: 0.9rem;
  border-left: 6px solid var(--accent);
}

/* ---------- Botão "voltar" ---------- */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: "Barlow", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.2rem;
  transition: color 0.15s;
}

.btn-back:hover {
  color: var(--accent-2);
}

/* ---------- Catálogo de jogos ---------- */

/* Hero banner: destaca a capa do jogo principal no topo da tela "Jogos" */
.hero-banner {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 280px;
  margin-bottom: 1.8rem;
  overflow: hidden;
  border-radius: var(--radius);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%);
  box-shadow: var(--shadow-hard);
}

.hero-banner-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.42) saturate(1.1);
}

.hero-banner-overlay {
  position: relative;
  z-index: 1;
  max-width: 560px;
  padding: 1.8rem;
  background: linear-gradient(90deg, rgba(13, 9, 20, 0.88) 0%, rgba(13, 9, 20, 0.4) 75%, transparent 100%);
}

.hero-banner-tag {
  display: inline-block;
  margin-bottom: 0.6rem;
  border: 1px solid var(--accent-2);
  border-radius: var(--radius);
  padding: 0.2rem 0.6rem;
  font-family: "Barlow", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-2);
}

.hero-banner-title {
  margin: 0 0 0.5rem;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 2.4rem;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.hero-banner-desc {
  max-width: 460px;
  margin: 0 0 1.1rem;
  color: var(--text-dim);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.2rem;
}

/* Card de jogo em formato "poster" (capa preenche o card, com o título
   sobreposto num gradiente, igual a uma capa de jogo numa estante). */
.game-card {
  position: relative;
  padding: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  cursor: pointer;
}

.game-card .card-cover,
.game-card .card-icon {
  margin: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.game-card .card-icon {
  clip-path: none;
}

.game-card .card-cover img {
  transition: transform 0.25s ease;
}

.game-card:hover .card-cover img {
  transform: scale(1.05);
}

.game-card-info {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.8rem 0.9rem;
  background: linear-gradient(180deg, transparent 0%, rgba(13, 9, 20, 0.92) 85%);
}

.game-card-platform {
  display: block;
  margin-bottom: 0.2rem;
  font-family: "Barlow", sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-2);
}

.game-card-info h2 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.game-card-play {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 2;
}

/* ---------- Criar/entrar em sala (jogo selecionado) ---------- */
.room-setup-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.room-setup-block h3 {
  margin: 0 0 0.4rem;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.room-setup-block p {
  color: var(--text-dim);
  margin: 0 0 1rem;
}

.room-setup-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: "Barlow", sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.solo-setup-card {
  margin-top: 1.5rem;
}

.solo-setup-card .room-setup-block p {
  max-width: 520px;
}

@media (max-width: 760px) {
  .room-setup-card {
    grid-template-columns: 1fr;
  }
}

/* Telas de celular bem estreitas: encolhe a tabela de ranking para não
   "espremer" demais as colunas. */
@media (max-width: 480px) {
  .ranking-card {
    padding: 1.1rem 0.6rem;
  }

  .ranking-table th,
  .ranking-table td {
    padding: 0.45rem 0.35rem;
    font-size: 0.82rem;
  }

  .ranking-table th {
    font-size: 0.6rem;
    letter-spacing: 0.03em;
  }

  .ranking-vip {
    margin-left: 0.2rem;
    font-size: 0.55rem;
    padding: 0.05rem 0.3rem;
  }

  .btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
  }

  .nav-link,
  .btn-mini {
    padding: 0.35rem 0.6rem;
    font-size: 0.7rem;
  }

  .hero-banner {
    min-height: 200px;
  }

  .hero-banner-overlay {
    max-width: 100%;
    padding: 1.1rem;
  }

  .hero-banner-title {
    font-size: 1.6rem;
  }

  .hero-banner-desc {
    display: none;
  }
}

/* ---------- Ranking ---------- */
.ranking-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ranking-tab {
  border: 2px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-family: "Barlow", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.ranking-tab:hover {
  color: var(--text);
}

.ranking-tab.active {
  border-color: var(--accent-2);
  color: var(--bg);
  background: var(--accent-2);
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
}

.ranking-table th,
.ranking-table td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
}

.ranking-table th {
  font-family: "Barlow", sans-serif;
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 2px solid var(--border);
}

.ranking-table tbody tr:last-child td {
  border-bottom: none;
}

.ranking-table td:first-child,
.ranking-table th:first-child {
  width: 2.5rem;
  font-family: "Bebas Neue", sans-serif;
  color: var(--accent-2);
}

.ranking-vip {
  display: inline-block;
  margin-left: 0.5rem;
  font-family: "Barlow", sans-serif;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--accent-2);
  color: var(--accent-2);
}

/* ---------- Campeonatos ---------- */
.section-subtitle {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 2rem 0 1rem;
}

.vip-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.vip-banner-text {
  flex: 1;
  min-width: 220px;
}

.vip-banner-text h2,
.vip-banner-text p {
  margin: 0;
}

.vip-banner-text p {
  margin-top: 0.4rem;
}

.vip-banner .btn {
  width: auto;
  white-space: nowrap;
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border: 2px solid var(--border);
  background: var(--bg);
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
  cursor: pointer;
}

.checkbox-option input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.championship-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.championship-card {
  display: flex;
  flex-direction: column;
}

.championship-card p {
  margin-bottom: 0.8rem;
}

.championship-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.entry-badge {
  font-family: "Barlow", sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.55rem;
  border: 1px solid currentColor;
}

.entry-badge.free {
  color: var(--green);
}

.entry-badge.paid {
  color: var(--accent-2);
}

.championship-games,
.championship-slots {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.championship-card .btn {
  margin-top: auto;
}

/* ---------- Replays ---------- */
.replay-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.replay-card {
  display: flex;
  flex-direction: column;
}

.replay-card .replay-meta {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.replay-card .btn {
  margin-top: 0.8rem;
  width: auto;
}

/* ---------- Resultado da partida (ranking básico) ---------- */
.result-panel {
  margin-top: 1.5rem;
}

.result-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.8rem 0;
}

.result-buttons .btn-mini {
  flex: 1 1 160px;
  text-align: center;
  padding: 0.6rem 0.9rem;
}

/* ---------- Modal (login / cadastro) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 360px;
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.modal-close:hover {
  color: var(--text);
}

.modal-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}

.modal-tab {
  flex: 1;
  border: 2px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-family: "Barlow", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.modal-tab.active {
  border-color: var(--accent);
  color: var(--text);
  background: oklch(55% 0.27 305 / 0.14);
}

.text-input {
  width: 100%;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: "Barlow", sans-serif;
  font-size: 1rem;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---------- Modal de detalhes do jogo ---------- */
.modal-game {
  max-width: 640px;
}

.modal-game-body {
  display: flex;
  gap: 1.2rem;
}

.modal-game-cover {
  flex: 0 0 200px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius);
}

.modal-game-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-game-info {
  flex: 1;
  min-width: 0;
}

.modal-game-platform {
  display: inline-block;
  margin-bottom: 0.4rem;
  font-family: "Barlow", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-2);
}

.modal-game-info h2 {
  margin: 0 0 0.5rem;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.modal-game-info p {
  margin: 0 0 1rem;
  color: var(--text-dim);
}

.modal-game-ranking h3 {
  margin: 0 0 0.5rem;
  font-family: "Barlow", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.modal-game-ranking ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  font-size: 0.9rem;
}

.modal-game-ranking ol li {
  margin-bottom: 0.2rem;
}

.modal-game-actions {
  display: flex;
  gap: 0.6rem;
}

.modal-game-actions .btn {
  width: auto;
}

@media (max-width: 600px) {
  .modal-game-body {
    flex-direction: column;
  }

  .modal-game-cover {
    flex-basis: auto;
    max-height: 200px;
  }

  .modal-game-actions {
    flex-direction: column;
  }

  .modal-game-actions .btn {
    width: 100%;
  }
}

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 2px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: var(--bg);
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.card-cover {
  margin: -1.8rem -1.8rem 1rem -1.8rem;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-icon svg {
  width: 26px;
  height: 26px;
}

.card h2 {
  margin: 0 0 0.4rem;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card p {
  color: var(--text-dim);
  margin: 0 0 1.2rem;
}

/* ---------- Form elements ---------- */
.field-label {
  display: block;
  font-family: "Barlow", sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.code-input {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1.2rem;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 1.2rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-align: center;
}

.code-input:focus {
  outline: none;
  border-color: var(--accent);
}

.role-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
}

.role-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  border: 2px solid var(--border);
  background: var(--bg);
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.role-card strong {
  font-family: "Barlow", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.92rem;
}

.role-card small {
  color: var(--text-dim);
  font-size: 0.78rem;
}

.role-option input:checked + .role-card {
  border-color: var(--accent);
  background: oklch(55% 0.27 305 / 0.12);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  border: 2px solid transparent;
  padding: 0.55rem 1.1rem;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius);
  transition: filter 0.15s, transform 0.08s, box-shadow 0.08s, border-radius 0.08s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  clip-path: none;
  box-shadow: var(--shadow-neon-yellow);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 32px oklch(92% 0.19 100 / 0.6), 0 0 2px oklch(92% 0.19 100 / 0.9);
}

.btn-secondary {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-soft);
}

.btn-secondary:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

/* Botão grande (CTA do hero banner) */
.btn-lg {
  width: auto;
  padding: 0.8rem 1.8rem;
  font-size: 1rem;
}

/* Botão pequeno (ação compacta dentro de cards / overlays) */
.btn-sm {
  width: auto;
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  clip-path: none;
  box-shadow: none;
}

.btn-arrow {
  width: 1.1rem;
  height: 1.1rem;
}

.file-btn {
  width: auto;
  white-space: nowrap;
}

.btn-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 2px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.btn-icon:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.btn-icon.copied {
  border-color: var(--green);
  color: var(--green);
}

.error {
  color: var(--danger);
  min-height: 1.2em;
  font-size: 0.9rem;
  margin: 0.6rem 0 0;
}

.hint {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0.2rem 0 0;
}

/* ---------- Room banner ---------- */
.room-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--panel);
  border: 2px solid var(--border);
  border-left: 6px solid var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.5rem;
}

.room-banner-text .label {
  display: block;
  font-family: "Barlow", sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.room-code-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.room-code {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 2.2rem;
  letter-spacing: 0.35em;
  color: var(--accent-2);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 2px solid var(--border);
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
  font-family: "Barlow", sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--yellow);
  animation: pulse 1.6s infinite;
}

.status-pill.connected .status-dot {
  background: var(--green);
}

.status-pill.connected {
  color: var(--green);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- VS banner (Desafiante 1 vs Desafiante 2) ---------- */
.vs-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  background: var(--panel);
  border: 2px solid var(--border);
  padding: 1rem 1.4rem;
  margin-bottom: 1.5rem;
}

.vs-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.vs-player.vs-p2 {
  align-items: center;
}

.vs-tag {
  font-family: "Barlow", sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}

.vs-name {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.vs-p1 .vs-name {
  color: var(--accent-2);
}

.vs-p2 .vs-name {
  color: var(--accent);
}

.vs-versus {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ---------- Screen frame (moldura de transmissão) ---------- */
.screen-frame {
  border: 2px solid var(--border);
  overflow: hidden;
  background: #000;
  margin-bottom: 1.5rem;
}

.screen-frame-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  background: var(--panel-2);
  border-bottom: 3px solid var(--accent);
}

.live-dot {
  width: 9px;
  height: 9px;
  background: var(--accent);
  animation: pulse 1.2s infinite;
}

.screen-frame-title {
  font-family: "Barlow", sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.screen-frame-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

#game-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 4 / 3;
  background: #000;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

#game-wrapper > div#game {
  width: 100%;
  height: 100%;
}

/* Força o canvas do EmulatorJS a preencher o container sempre */
#game canvas,
#game-guest canvas,
#game-solo canvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: contain;
}

#game-wrapper-guest,
#game-wrapper-solo {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 4 / 3;
  min-height: 240px; /* evita colapso para 0 em modo portrait */
  background: #000;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

#game-wrapper-guest > div#game-guest,
#game-wrapper-solo > div#game-solo {
  width: 100%;
  height: 100%;
}

/* Congelamento de 1-2 frames durante o state-sync (ver socket.on
   'state-sync' em app.js): cobre o canvas do Jogador 2/espectador com a
   última imagem boa enquanto o loadState() é aplicado, escondendo o
   "flash" de sprites corrompidos. */
#state-sync-freeze {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  object-fit: contain;
  display: none;
}

/* Container interno do EJS (div criado dinamicamente) */
#game > div,
#game-guest > div,
#game-solo > div,
#game-replay > div {
  width: 100% !important;
  height: 100% !important;
}

/* ---------- Player de replay ---------- */
#game-wrapper-replay {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 4 / 3;
  min-height: 240px;
  background: #000;
}

#game-wrapper-replay > div#game-replay {
  width: 100%;
  height: 100%;
}

#game-replay canvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: contain;
}

.replay-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.replay-controls .btn {
  width: auto;
}

.replay-progress {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex: 1 1 220px;
}

.replay-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.replay-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

.replay-time {
  font-family: "Barlow", sans-serif;
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Modo "tela cheia" da partida */
body.match-fullscreen > .topbar,
body.match-fullscreen #lobby-banner,
body.match-fullscreen .rotate-hint,
body.match-fullscreen .room-banner,
body.match-fullscreen .vs-banner,
body.match-fullscreen .controls-panel,
body.match-fullscreen .result-panel,
body.match-fullscreen #player-controls-info {
  display: none;
}

body.match-fullscreen main {
  max-width: 100%;
  padding: 0;
}

body.match-fullscreen .screen-frame {
  position: fixed;
  inset: 0;
  z-index: 500;
  margin: 0;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: #000;
}

body.match-fullscreen .screen-frame-bar {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: rgba(13, 9, 20, 0.75);
  border-bottom: 2px solid var(--accent);
  flex-shrink: 0;
}

/* O game-wrapper ocupa todo o espaço restante abaixo da barra */
body.match-fullscreen #game-wrapper,
body.match-fullscreen #game-wrapper-guest,
body.match-fullscreen #game-wrapper-solo {
  flex: 1;
  width: 100%;
  min-height: 0;
  aspect-ratio: unset; /* sem aspect-ratio fixo: expande para preencher */
  max-height: 100%;
}

/* O canvas também precisa preencher o wrapper expandido */
body.match-fullscreen #game canvas,
body.match-fullscreen #game-guest canvas,
body.match-fullscreen #game-solo canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.loading-overlay.hidden {
  display: none;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  background: rgba(13, 9, 20, 0.88);
  color: var(--text-dim);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---------- Tela de "conectando" / contagem (início e revanche) ---------- */
.match-overlay {
  background: rgba(13, 9, 20, 0.94);
  z-index: 2;
}

.match-overlay-label {
  font-family: "Barlow", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  margin: 0;
}

.match-overlay-label span {
  color: var(--accent-2);
}

.match-countdown {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 5rem;
  line-height: 1;
  color: var(--accent);
  text-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
  animation: countdown-pop 0.4s ease-out;
}

@keyframes countdown-pop {
  from { transform: scale(1.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- Tela de vitória / revanche ---------- */
.victory-title {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 2.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
  text-shadow: 5px 5px 0 rgba(0, 0, 0, 0.45);
  margin: 0;
  text-align: center;
}

.victory-score {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 2rem;
  color: var(--text);
  margin: 0;
}

.match-overlay #btn-rematch-host,
.match-overlay #btn-rematch-guest {
  width: auto;
  min-width: 220px;
}

/* ---------- Controls panel ---------- */
.controls-panel {
  background: var(--panel);
  border: 2px solid var(--border);
  border-left: 6px solid var(--accent-2);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
  padding: 1.4rem 1.6rem;
}

.controls-panel h3 {
  margin: 0 0 1rem;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.controls-tag {
  display: inline-block;
  font-family: "Barlow", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.6rem;
  border: 1px solid currentColor;
  margin-bottom: 0.6rem;
}

.controls-tag.p1 {
  color: var(--accent);
}

.controls-tag.p2 {
  color: var(--accent-2);
}

.controls-col ul,
.controls-inline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.controls-col li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.controls-col li:last-child {
  border-bottom: none;
}

.controls-col li > span:first-child {
  color: var(--text-dim);
}

.controls-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  margin-bottom: 0.8rem;
}

.controls-inline li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.controls-inline li > span {
  color: var(--text-dim);
}

kbd {
  font-family: "Barlow", sans-serif;
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.2rem 0.45rem;
  margin-left: 0.3rem;
  color: var(--text);
}

/* ---------- Footer ---------- */
footer {
  text-align: center;
  padding: 1.5rem 1rem 2.5rem;
  color: var(--text-dim);
  font-family: "Barlow", sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Toast (notificações rápidas) ---------- */
.toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--bg);
  padding: 0.7rem 1.4rem;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
  z-index: 200;
  transition: opacity 0.25s, transform 0.25s;
}

.toast.hidden {
  opacity: 0;
  transform: translate(-50%, -10px);
  pointer-events: none;
}

/* ---------- Aviso de rotação (mobile) ---------- */
.rotate-hint {
  display: none;
}

@media (orientation: portrait) and (max-width: 700px) {
  .rotate-hint {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--panel-2);
    border: 2px solid var(--accent-2);
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    color: var(--text-dim);
    font-family: "Barlow", sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .rotate-hint svg {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    color: var(--accent-2);
  }
}

/* ---------- Controles virtuais (mobile, estilo controle de videogame) ---------- */
.virtual-controls {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  pointer-events: none;
  z-index: 60;
}

.virtual-controls.hidden {
  display: none;
}

.vc-dpad-wrap,
.vc-system,
.vc-face-wrap {
  pointer-events: auto;
}

.vc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  opacity: 0.7;
  transition: transform 0.06s ease-out, filter 0.06s ease-out, opacity 0.06s ease-out;
}

.vc-btn:active,
.vc-btn.pressed {
  transform: scale(0.9);
  filter: brightness(1.35);
  opacity: 1;
}

/* Analógico (joystick) virtual: base circular fixa + bastão que segue o
   dedo. Substitui a cruz de 4 botões separados para permitir direções
   diagonais num único toque (ex: pulos em ângulo, que a cruz não permitia
   pressionar ao mesmo tempo). */
.vc-joystick {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 3px solid rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.5), 0 4px 6px rgba(0, 0, 0, 0.5);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.vc-joystick-stick {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  transition: transform 0.05s ease-out, background-color 0.1s ease-out, border-color 0.1s ease-out;
}

.vc-joystick.active .vc-joystick-stick {
  background: oklch(70% 0.30 330 / 0.45);
  border-color: var(--accent);
}

/* Select / Start */
.vc-system {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.vc-pill {
  width: 66px;
  height: 26px;
  border-radius: 14px;
  background: linear-gradient(180deg, #46464e 0%, #202026 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  font-family: "Barlow", sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Bloquear/Correr + diamante de ação (estilo SNES: A/B/X/Y) */
.vc-face-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.vc-shoulders {
  display: flex;
  gap: 10px;
}

.vc-shoulder {
  width: 64px;
  height: 36px;
  border-radius: 10px;
  flex-direction: column;
  gap: 1px;
  background: linear-gradient(180deg, #4c4c54 0%, #25252b 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-family: "Bebas Neue", sans-serif;
  font-size: 0.85rem;
}

.vc-shoulder span {
  font-family: "Barlow", sans-serif;
  font-size: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.vc-face {
  position: relative;
  width: 150px;
  height: 150px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

.vc-face-btn {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  flex-direction: column;
  gap: 1px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 1.15rem;
  color: rgba(13, 9, 20, 0.78);
}

.vc-face-btn span {
  font-family: "Barlow", sans-serif;
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: rgba(13, 9, 20, 0.65);
}

.vc-face-x { top: 0; left: 46px; background: radial-gradient(circle at 30% 28%, #7cc6f7, #2a7fbd); }
.vc-face-y { top: 46px; left: 0; background: radial-gradient(circle at 30% 28%, #82e6a8, #2c9d57); }
.vc-face-a { top: 46px; left: 92px; background: radial-gradient(circle at 30% 28%, #ff7b8a, var(--accent)); }
.vc-face-b { top: 92px; left: 46px; background: radial-gradient(circle at 30% 28%, #ffe27a, var(--accent-2)); }

/* ---------- Layout paisagem em telas pequenas (mobile) ---------- */
@media (orientation: landscape) and (max-height: 540px) {
  body > .topbar,
  .lobby-banner,
  .rotate-hint,
  #screen-host .room-banner,
  #screen-host .controls-panel,
  #screen-guest .room-banner,
  #screen-guest #player-controls-info,
  #screen-solo .section-title,
  #screen-solo .controls-panel {
    display: none;
  }

  main {
    max-width: 100%;
    padding: 0;
  }

  .screen-frame {
    border: none;
    margin-bottom: 0;
  }

  .screen-frame-bar {
    display: none;
  }

  #game-wrapper,
  #game-wrapper-guest,
  #game-wrapper-solo {
    aspect-ratio: auto;
    height: 100vh;
  }
}

/* Telas paisagem bem curtas (celulares pequenos): reduz tamanho dos
   controles para caber sem cobrir demais a tela do jogo. */
@media (orientation: landscape) and (max-height: 400px) {
  .virtual-controls {
    padding: 0.5rem 0.7rem;
  }

  .vc-joystick,
  .vc-face {
    width: 116px;
    height: 116px;
  }

  .vc-joystick-stick {
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
  }

  .vc-face-btn {
    width: 44px;
    height: 44px;
    font-size: 0.95rem;
  }

  .vc-face-x { top: 0; left: 36px; }
  .vc-face-y { top: 36px; left: 0; }
  .vc-face-a { top: 36px; left: 72px; }
  .vc-face-b { top: 72px; left: 36px; }

  .vc-shoulder {
    width: 52px;
    height: 30px;
    font-size: 0.7rem;
  }

  .vc-pill {
    width: 54px;
    height: 22px;
  }

  .vc-face-wrap {
    gap: 6px;
  }
}

/* ====================================================================
   ESCONDE O GAMEPAD NATIVO DO EMULATORJS (usamos o nosso próprio #vc-*)
   Os seletores cobrem as diferentes versões do EmulatorJS stable CDN.
   ==================================================================== */
.ejs_gamepad,
.ejs_virtual_gamepad,
.ejs_virtualGamepad,
[class*="ejs_gamepad"],
[class*="ejs_virtual"] {
  display: none !important;
}

/* ====================================================================
   OVERLAY "PRONTO" — aparece quando os dois jogadores entram na sala
   ==================================================================== */
.btn-ready {
  min-width: 220px;
  margin-top: 1.2rem;
  font-size: 1.1rem;
  padding: 0.85rem 1.8rem;
  background: var(--green);
  border-color: var(--green);
  color: #000;
  font-weight: 700;
  animation: ready-pulse 1.4s ease-in-out infinite;
}

.btn-ready:disabled {
  animation: none;
  opacity: 0.55;
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--text-dim);
}

@keyframes ready-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6); }
  50%       { box-shadow: 0 0 0 12px rgba(46, 204, 113, 0); }
}

.ready-hint {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0.5rem 0 0;
  text-align: center;
}

.ready-hint strong {
  color: var(--green);
}

.ready-wait-msg {
  margin-top: 0.8rem;
  text-align: center;
  font-size: 0.85rem;
}

/* Timer de 2 minutos (waiting-p2-countdown) */
.waiting-timer {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  margin-top: 0.5rem;
}

/* ====================================================================
   Modo Solo (seção no topo do catálogo) + busca
   ==================================================================== */
.solo-section {
  margin-bottom: 2.5rem;
}
.solo-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.solo-section-head .section-title {
  margin: 0;
}
.solo-search {
  flex: 1 1 320px;
  max-width: 420px;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.solo-search::placeholder {
  color: rgba(255, 255, 255, 0.45);
}
.solo-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(92% 0.19 100 / 0.18);
}

/* ====================================================================
   POLIMENTO VISUAL — tema USB Arcade (neon)
   Bloco final: refina cards, placeholders, navegação, títulos e brilhos.
   ==================================================================== */

/* Cards de jogo: brilho neon no hover + cantos arredondados consistentes */
.game-card {
  border: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.game-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px oklch(92% 0.19 100 / 0.5), 0 0 26px oklch(92% 0.19 100 / 0.28), 0 14px 30px rgba(0, 0, 0, 0.55);
}

/* Placeholder dos jogos sem capa: tile escuro com joystick neon (em vez de
   um quadrado amarelo). O título aparece no rótulo inferior. */
.game-card .card-icon {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(120% 90% at 50% 0%, oklch(28% 0.12 305) 0%, oklch(15% 0.08 300) 70%),
    var(--panel);
  color: oklch(92% 0.19 100 / 0.85);
  clip-path: none;
  border-radius: 0;
}
.game-card .card-icon svg {
  width: 38%;
  height: 38%;
  filter: drop-shadow(0 0 10px oklch(92% 0.19 100 / 0.5));
}

/* Rótulo inferior do card */
.game-card-info {
  background: linear-gradient(180deg, transparent 0%, oklch(9% 0.05 300 / 0.65) 45%, oklch(7% 0.04 300 / 0.96) 100%);
  padding: 1rem 0.9rem 0.85rem;
}
.game-card-info h2 {
  font-size: 1.1rem;
  line-height: 1.05;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.game-card-platform {
  color: var(--magenta);
}

/* Botão "Jogar" do card: pílula neon compacta */
.game-card-play {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  border-radius: 999px;
}
.game-card:hover .game-card-play {
  opacity: 1;
  transform: translateY(0);
}

/* Navegação principal: item ativo com sublinhado neon */
.nav-link {
  position: relative;
  border-radius: 8px;
}
.nav-link.active {
  color: var(--accent);
}
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -4px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 10px oklch(92% 0.19 100 / 0.8);
}

/* Títulos de seção: barrinha neon à esquerda */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.section-title::before {
  content: "";
  width: 6px;
  height: 1.05em;
  border-radius: 2px;
  background: var(--gradient-neon);
  box-shadow: var(--shadow-neon-magenta);
}
.solo-section-head .section-title::before {
  background: var(--accent);
  box-shadow: var(--shadow-neon-yellow);
}

/* Topbar e logo com brilho neon */
.topbar {
  border-bottom: 2px solid var(--border);
  box-shadow: 0 1px 0 oklch(92% 0.19 100 / 0.25), 0 8px 30px rgba(0, 0, 0, 0.4);
}
.logo-text .accent {
  box-shadow: var(--shadow-neon-yellow);
  border-radius: 6px;
}
.tagline {
  color: var(--text-dim);
}

/* Cartões/painéis em geral: borda superior fina neon (exceto cards de jogo) */
.card:not(.game-card) {
  border-top: 2px solid var(--accent);
}

/* Inputs e selects: foco neon coerente */
.text-input:focus,
.code-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(92% 0.19 100 / 0.16);
  outline: none;
}

/* Tabela de ranking: destaque do topo */
.ranking-table th:first-child {
  color: var(--accent);
}
.ranking-vip {
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 4px;
  padding: 0 0.35rem;
}

/* Pílula de status com ponto neon pulsante já existente — realça a cor */
.status-dot {
  box-shadow: 0 0 8px currentColor;
}

/* ====================================================================
   CAPAS COMO "TELA DE ARCADE" (CRT)
   Cada card vira um monitor de fliperama: moldura/bezel escuro, tela com
   scanlines, leve curvatura/brilho e glow neon quando aceso (hover).
   ==================================================================== */
.game-card {
  border: none;
  border-radius: 16px;
  padding: 7px;                                   /* bezel do monitor */
  background:
    linear-gradient(160deg, oklch(30% 0.03 300) 0%, oklch(16% 0.02 300) 55%, oklch(11% 0.02 300) 100%);
  box-shadow:
    inset 0 1px 0 oklch(70% 0.04 300 / 0.35),
    inset 0 0 0 1px oklch(50% 0.05 300 / 0.35),
    0 10px 26px rgba(0, 0, 0, 0.55);
  overflow: visible;
}

/* A "tela" propriamente dita (capa ou placeholder) */
.game-card .card-cover,
.game-card .card-icon {
  position: relative;
  border-radius: 9px;
  overflow: hidden;
  box-shadow:
    inset 0 0 34px rgba(0, 0, 0, 0.65),           /* vinheta CRT */
    inset 0 0 3px oklch(92% 0.19 100 / 0.12),
    0 0 0 2px oklch(8% 0.03 300);                  /* contorno interno do tubo */
}

/* Scanlines horizontais */
.game-card .card-cover::after,
.game-card .card-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.22) 0px,
    rgba(0, 0, 0, 0.22) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 2;
}

/* Brilho/curvatura da tela (reflexo no topo) */
.game-card .card-cover::before,
.game-card .card-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 80% at 50% -10%, rgba(255, 255, 255, 0.12) 0%, transparent 55%),
    radial-gradient(140% 120% at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
  z-index: 3;
}

/* Rótulo do jogo fica dentro da moldura da tela */
.game-card-info {
  left: 7px;
  right: 7px;
  bottom: 7px;
  border-radius: 0 0 9px 9px;
  z-index: 4;
}
.game-card-play {
  top: 12px;
  right: 12px;
  z-index: 5;
}

/* Monitor "aceso" no hover: glow neon na moldura e na tela */
.game-card:hover {
  transform: translateY(-5px);
  box-shadow:
    inset 0 1px 0 oklch(70% 0.04 300 / 0.4),
    0 0 0 1px oklch(92% 0.19 100 / 0.55),
    0 0 26px oklch(92% 0.19 100 / 0.3),
    0 16px 34px rgba(0, 0, 0, 0.6);
}
.game-card:hover .card-cover,
.game-card:hover .card-icon {
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.45),
    inset 0 0 12px oklch(92% 0.19 100 / 0.22),
    0 0 0 2px oklch(8% 0.03 300);
}
.game-card:hover .card-cover img {
  transform: scale(1.04);
}

/* Em telas pequenas, scanlines mais discretas para não pesar */
@media (max-width: 600px) {
  .game-card .card-cover::after,
  .game-card .card-icon::after {
    background: repeating-linear-gradient(0deg, rgba(0,0,0,0.16) 0 1px, transparent 1px 4px);
  }
}

/* ====================================================================
   Aba Competitiva
   ==================================================================== */
.competitive-head {
  margin: 0 0 1.2rem;
}
.competitive-head .hint {
  margin-top: 0.4rem;
  max-width: 640px;
}
/* Poucos jogos na arena: cards um pouco maiores para preencher melhor */
#screen-competitive .games-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

/* ====================================================================
   Contador de jogadores (pílula com bolinha pulsante) sobre o card
   ==================================================================== */
.player-count {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.6rem 0.22rem 0.5rem;
  border-radius: 999px;
  background: oklch(15% 0.03 300 / 0.85);
  border: 1px solid oklch(45% 0.05 300 / 0.5);
  backdrop-filter: blur(4px);
  font-family: "Barlow", sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  color: #fff;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.player-count .pc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px oklch(92% 0.19 100 / 0.9);
  animation: pc-pulse 1.8s ease-in-out infinite;
}
.player-count .pc-num {
  letter-spacing: 0.02em;
}
@keyframes pc-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}
@media (prefers-reduced-motion: reduce) {
  .player-count .pc-dot { animation: none; }
}

/* ====================================================================
   Replay em vídeo (multiplayer)
   ==================================================================== */
.replay-video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}
.replay-badge {
  display: inline-block;
  margin-left: 0.5rem;
  vertical-align: middle;
  font-family: "Barlow", sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  box-shadow: var(--shadow-neon-yellow);
}

/* ====================================================================
   LAYOUT FULL-SCREEN + EFEITOS AMBIENTE (mobile e desktop)
   - Container mais largo (preenche melhor o desktop)
   - Footer sempre no rodapé (sem buraco em telas com pouco conteúdo)
   - Fundo neon animado (grade + orbs) preenchendo a tela
   ==================================================================== */
:root {
  --container: 1480px;
  --pad-x: clamp(0.9rem, 3.5vw, 3rem);
}

/* Body em coluna para o footer "grudar" no fim quando há pouco conteúdo */
html { overflow-x: hidden; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}
main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 2rem) var(--pad-x) 3rem;
}
.topbar-row,
.lobby-banner {
  max-width: var(--container);
}
.topbar { padding-left: var(--pad-x); padding-right: var(--pad-x); }
footer { flex-shrink: 0; }

/* ---------- Fundo ambiente animado ---------- */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(38% 42% at 12% 18%, oklch(45% 0.22 305 / 0.20), transparent 70%),
    radial-gradient(40% 44% at 88% 12%, oklch(58% 0.26 330 / 0.16), transparent 72%),
    radial-gradient(50% 50% at 50% 110%, oklch(50% 0.18 280 / 0.14), transparent 70%);
}
/* grade em perspectiva, com leve deriva */
.bg-fx::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(oklch(70% 0.12 300 / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, oklch(70% 0.12 300 / 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 50% 8%, #000 0%, transparent 78%);
          mask-image: radial-gradient(circle at 50% 8%, #000 0%, transparent 78%);
  animation: gridDrift 26s linear infinite;
  clip-path: none;
}
/* orb de luz flutuando no topo */
.bg-fx::after {
  content: "";
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  left: 50%;
  top: -26vmax;
  transform: translateX(-50%);
  background: radial-gradient(circle, oklch(55% 0.27 305 / 0.12) 0%, transparent 60%);
  animation: orbFloat 20s ease-in-out infinite;
  clip-path: none;
}
@keyframes gridDrift {
  to { background-position: 46px 46px, 46px 46px; }
}
@keyframes orbFloat {
  0%, 100% { transform: translate(-50%, 0) scale(1); }
  50%      { transform: translate(-44%, 3vmax) scale(1.08); }
}

/* Leve textura de scanline em toda a tela (CRT ambiente, bem sutil) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.05) 0 1px, transparent 1px 3px);
  opacity: 0.5;
  mix-blend-mode: multiply;
}

/* ---------- Grids preenchendo a largura ---------- */
.solo-grid {
  grid-template-columns: repeat(auto-fill, minmax(clamp(124px, 15vw, 170px), 1fr));
  gap: clamp(0.7rem, 1.4vw, 1.3rem);
}
#screen-competitive .games-grid {
  grid-template-columns: repeat(auto-fill, minmax(clamp(160px, 20vw, 240px), 1fr));
}

/* ---------- Header responsivo ---------- */
.topbar-row { gap: 0.8rem; }
.main-nav {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }

/* ---------- Hero banner mais cheio ---------- */
.hero-banner {
  border-radius: 18px;
  overflow: hidden;
}

/* ====================================================================
   AJUSTES MOBILE
   ==================================================================== */
@media (max-width: 720px) {
  .topbar { padding-top: 1rem; padding-bottom: 0.9rem; }
  .topbar-row { flex-direction: column; align-items: stretch; gap: 0.7rem; }
  .main-nav { justify-content: center; gap: 0.1rem; }
  .nav-link { padding: 0.5rem 0.7rem; font-size: 0.82rem; }
  .tagline { font-size: 0.82rem; padding: 0 0.5rem; }
  .solo-section-head { gap: 0.6rem; }
  .solo-search { flex-basis: 100%; max-width: 100%; }
  .section-title { font-size: 1.45rem; }
  .player-count { top: 8px; left: 8px; font-size: 0.7rem; padding: 0.18rem 0.5rem; }
  .game-card-info { padding: 0.7rem 0.6rem 0.6rem; }
  .game-card-info h2 { font-size: 0.92rem; }
  .game-card-platform { font-size: 0.58rem; }
}

@media (max-width: 420px) {
  .solo-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .game-card-play { display: none; } /* no toque, clicar no card já joga */
}

/* Telas muito largas: limita o crescimento dos cards competitivos */
@media (min-width: 1200px) {
  #screen-competitive .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 240px));
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-fx::before, .bg-fx::after { animation: none; }
}

/* ====================================================================
   FASE 1 — fix da sombra sobre o jogo, modal de login, banner slides
   ==================================================================== */

/* Remove a textura/scanline global quando uma tela de jogo está ativa */
body.in-game::after { content: none !important; }

/* ---------- Modal de login/cadastro ---------- */
.auth-modal-card {
  max-width: 420px;
  width: 100%;
  border-top: none;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% -10%, oklch(28% 0.12 305) 0%, oklch(18% 0.07 300) 60%),
    var(--panel);
  border: 1px solid oklch(45% 0.08 300 / 0.5);
  box-shadow: 0 0 0 1px oklch(92% 0.19 100 / 0.12), 0 24px 60px rgba(0, 0, 0, 0.6);
}
.auth-modal-head {
  text-align: center;
  margin-bottom: 1.1rem;
}
.auth-modal-logo {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.1rem;
  letter-spacing: 0.04em;
  color: #fff;
}
.auth-modal-logo .accent {
  color: var(--accent);
  text-shadow: 0 0 16px oklch(92% 0.19 100 / 0.6);
}
.auth-modal-sub {
  margin: 0.2rem 0 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.auth-modal-foot {
  margin: 1rem 0 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.72rem;
}
.btn-coin {
  width: 100%;
  margin-top: 0.4rem;
}
/* tabs do modal mais "arcade" */
.auth-modal-card .modal-tabs {
  display: flex;
  gap: 0.4rem;
  background: oklch(12% 0.03 300 / 0.6);
  padding: 0.3rem;
  border-radius: 12px;
  margin-bottom: 1.1rem;
}
.auth-modal-card .modal-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.06em;
  font-size: 1.05rem;
  padding: 0.5rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-modal-card .modal-tab.active {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-neon-yellow);
}

/* ---------- Banner de slides ---------- */
.hero-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 560px;
  min-height: 200px;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 1.8rem;
  border: 1px solid oklch(40% 0.06 300 / 0.5);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.7s ease, transform 6s ease;
  display: flex;
  align-items: center;
}
.hero-slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}
.hero-slide-shade {
  position: absolute;
  inset: 0;
  /* Sem escurecimento: os banners 16:9 do admin aparecem limpos.
     A leitura do título/subtítulo é garantida por text-shadow. */
  background: none;
  pointer-events: none;
}
.hero-slide-content {
  position: relative;
  z-index: 2;
  padding: clamp(1rem, 3vw, 2.4rem);
  max-width: 620px;
}
.hero-slide-tag {
  display: inline-block;
  font-family: "Barlow", sans-serif;
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  box-shadow: var(--shadow-neon-yellow);
}
.hero-slide-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(1.6rem, 4vw, 3rem);
  line-height: 1;
  margin: 0.6rem 0 0.4rem;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}
.hero-slide-desc {
  color: var(--text-dim);
  margin: 0 0 1rem;
  font-size: clamp(0.8rem, 1.6vw, 0.98rem);
  max-width: 460px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-dots {
  position: absolute;
  z-index: 3;
  bottom: 12px;
  right: 16px;
  display: flex;
  gap: 0.4rem;
}
.hero-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: none;
  background: oklch(80% 0.02 300 / 0.4);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, width 0.2s;
}
.hero-dot.active {
  width: 22px;
  background: var(--accent);
  box-shadow: var(--shadow-neon-yellow);
}
@media (max-width: 600px) {
  .hero-slider { aspect-ratio: 16 / 9; }
  .hero-slide-desc { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: opacity 0.3s ease; transform: none; }
}

/* ====================================================================
   FASE 2/3 — avatar, perfil, líderes (coluna direita), replays públicos
   ==================================================================== */

/* ---------- Avatar no topo + botão de perfil ---------- */
.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: oklch(20% 0.06 300 / 0.6);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.6rem 0.25rem 0.3rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.profile-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-neon-yellow);
}
.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-2);
  border: 2px solid oklch(92% 0.19 100 / 0.5);
}
.auth-user-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }

/* ---------- Modal de perfil ---------- */
.profile-modal-card { max-width: 440px; width: 100%; }
.profile-modal-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.7rem;
  margin: 0 0 1rem;
}
.profile-current {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.profile-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--panel-2);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-neon-yellow);
}
.profile-name { font-family: "Bebas Neue", sans-serif; font-size: 1.3rem; letter-spacing: 0.03em; }
.profile-section {
  font-family: "Barlow", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin: 1.1rem 0 0.6rem;
}
.avatar-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 0.6rem;
}
.avatar-choice {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--panel-2);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.12s;
}
.avatar-choice img { width: 100%; height: 100%; display: block; aspect-ratio: 1; }
.avatar-choice:hover { transform: translateY(-2px); border-color: var(--magenta); }
.avatar-choice.selected { border-color: var(--accent); box-shadow: var(--shadow-neon-yellow); }

/* ---------- Layout da home com coluna direita ---------- */
.home-grid {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.home-main { min-width: 0; }
.leaders-panel { order: -1; }
@media (min-width: 1000px) {
  .home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 308px;
    align-items: start;
    gap: 1.6rem;
  }
  .leaders-panel { order: 0; position: sticky; top: 1rem; }
}

/* ---------- Cartões de líderes ---------- */
.leaders-title { font-size: 1.3rem; margin: 0 0 0.4rem; }
.leader-card {
  position: relative;
  background: linear-gradient(160deg, oklch(24% 0.10 305) 0%, oklch(17% 0.07 300) 100%);
  border: 1px solid oklch(45% 0.08 300 / 0.5);
  border-radius: 16px;
  padding: 1.1rem 1rem 1rem;
  text-align: center;
  margin-bottom: 1rem;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.leader-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--gradient-neon);
}
.leader-badge { font-size: 1.6rem; line-height: 1; }
.leader-label {
  font-family: "Barlow", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.66rem;
  color: var(--accent);
  margin: 0.2rem 0 0.7rem;
}
.leader-extra { display: block; color: var(--text-dim); letter-spacing: 0.04em; margin-top: 0.15rem; }
.leader-avatar {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-neon-yellow);
  background: var(--panel-2);
}
.leader-name { font-family: "Bebas Neue", sans-serif; font-size: 1.35rem; letter-spacing: 0.03em; margin: 0.5rem 0 0.4rem; }
.leader-scores { display: flex; justify-content: center; gap: 1rem; margin-bottom: 0.8rem; font-family: "Bebas Neue", sans-serif; font-size: 1.4rem; }
.leader-scores small { font-size: 0.6rem; color: var(--text-dim); margin-left: 1px; }
.leader-scores .ls-win { color: var(--accent); }
.leader-scores .ls-loss { color: oklch(70% 0.18 20); }
.leader-scores .ls-draw { color: var(--text-dim); }
.leader-replays { width: 100%; }

/* ---------- Modal de histórico de replays ---------- */
.userreplays-card { max-width: 560px; width: 100%; max-height: 86vh; overflow-y: auto; }
.userreplays-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.userreplays-head h2 { font-family: "Bebas Neue", sans-serif; margin: 0; font-size: 1.5rem; }

/* ====================================================================
   LOGO PULSANTE
   ==================================================================== */
.logo-icon {
  animation: logoGlow 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 6px oklch(92% 0.19 100 / 0.6));
}
.logo-text .accent {
  animation: chipPulse 2.4s ease-in-out infinite;
}
@keyframes logoGlow {
  0%, 100% { filter: drop-shadow(0 0 5px oklch(92% 0.19 100 / 0.45)); transform: scale(1); }
  50%      { filter: drop-shadow(0 0 16px oklch(92% 0.19 100 / 0.95)); transform: scale(1.04); }
}
@keyframes chipPulse {
  0%, 100% { box-shadow: 0 0 10px oklch(92% 0.19 100 / 0.4); }
  50%      { box-shadow: 0 0 22px oklch(92% 0.19 100 / 0.9), 0 0 2px oklch(92% 0.19 100 / 1); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-icon, .logo-text .accent { animation: none; }
}

/* ====================================================================
   TELA DE LOADING ESTILO FLIPERAMA
   --al-hue define a cor do tema (sorteada a cada carregamento)
   ==================================================================== */
.arcade-loader {
  --al-hue: 50;
  --al-color: hsl(var(--al-hue) 95% 62%);
  position: absolute;
  inset: 0;
  z-index: 0;            /* cria contexto de empilhamento: contém os filhos
                            internos (al-inner z3) para não cobrirem os
                            overlays interativos (PRONTO/vitória). */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 50% 35%, hsl(var(--al-hue) 60% 14%) 0%, #05060a 70%),
    #05060a;
}
/* scanlines + vinheta CRT */
.arcade-loader .al-scan {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.32) 0 1px, transparent 1px 3px),
    radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
  z-index: 2;
  animation: alFlicker 5s steps(60) infinite;
}
@keyframes alFlicker { 0%,100%{opacity:1} 48%{opacity:0.92} 50%{opacity:0.82} 52%{opacity:0.95} }

.arcade-loader .al-inner {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 1.4rem;
  width: 100%;
  max-width: 460px;
}
.arcade-loader .al-logo {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  letter-spacing: 0.08em;
  color: #fff;
  margin-bottom: 0.5rem;
  animation: logoGlow 2s ease-in-out infinite;
}
.arcade-loader .al-logo span {
  color: var(--al-color);
  text-shadow: 0 0 18px var(--al-color);
}
.arcade-loader .al-theme {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 1;
  color: var(--al-color);
  text-shadow: 0 0 18px var(--al-color), 0 0 2px #fff;
  margin: 0.2rem 0 1.1rem;
  animation: alTextFlicker 1.6s infinite;
}
@keyframes alTextFlicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  94% { opacity: 0.5; }
  96% { opacity: 1; }
}
/* barra de progresso indeterminada estilo arcade */
.arcade-loader .al-bar {
  height: 16px;
  border: 2px solid var(--al-color);
  border-radius: 4px;
  background: rgba(0,0,0,0.5);
  overflow: hidden;
  box-shadow: 0 0 14px hsl(var(--al-hue) 95% 62% / 0.5), inset 0 0 8px rgba(0,0,0,0.8);
}
.arcade-loader .al-bar i {
  display: block;
  height: 100%;
  width: 35%;
  background: repeating-linear-gradient(90deg, var(--al-color) 0 10px, transparent 10px 16px);
  box-shadow: 0 0 12px var(--al-color);
  animation: alBar 1.1s linear infinite;
}
@keyframes alBar {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.arcade-loader .al-status {
  font-family: "Barlow", sans-serif;
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  color: #fff;
  margin-top: 0.9rem;
}
.arcade-loader .al-coin {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.16em;
  font-size: 1.1rem;
  color: var(--al-color);
  margin-top: 0.5rem;
  animation: alBlink 1s steps(2, start) infinite;
}
@keyframes alBlink { 0%,100%{opacity:1} 50%{opacity:0} }
.arcade-loader .al-tip {
  margin-top: 1rem;
  color: oklch(80% 0.03 280 / 0.75);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  min-height: 1.1em;
}
@media (prefers-reduced-motion: reduce) {
  .arcade-loader .al-scan, .arcade-loader .al-theme, .arcade-loader .al-coin, .arcade-loader .al-bar i, .arcade-loader .al-logo { animation: none; }
  .arcade-loader .al-bar i { width: 100%; transform: none; }
}

/* ====================================================================
   EFEITOS RETRÔ EXTREMOS — boot splash, capa de fundo, grade synthwave,
   glitch RGB, power-on. A logo (gabinete) aparece em todo loading.
   ==================================================================== */

/* ---------- Capa do jogo como fundo do loader ---------- */
.arcade-loader .al-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.12);
  filter: blur(7px) brightness(0.42) saturate(1.2);
  transition: opacity 0.4s ease;
}
.arcade-loader .al-cover.has-cover {
  opacity: 1;
  animation: alCoverZoom 14s ease-in-out infinite alternate;
}
@keyframes alCoverZoom {
  0% { transform: scale(1.12); }
  100% { transform: scale(1.28) translateY(-2%); }
}

/* ---------- Grade synthwave (chão neon em perspectiva) ---------- */
.arcade-loader .al-grid,
.boot-grid {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: 0;
  height: 48%;
  z-index: 1;
  background-image:
    linear-gradient(var(--al-color, #f5d400) 2px, transparent 2px),
    linear-gradient(90deg, var(--al-color, #f5d400) 2px, transparent 2px);
  background-size: 46px 46px;
  transform: perspective(300px) rotateX(64deg);
  transform-origin: bottom center;
  opacity: 0.22;
  -webkit-mask-image: linear-gradient(to top, #000 5%, transparent 95%);
          mask-image: linear-gradient(to top, #000 5%, transparent 95%);
  animation: gridScroll 1.1s linear infinite;
  pointer-events: none;
}
@keyframes gridScroll { to { background-position: 0 46px, 0 0; } }

/* ---------- Logo (gabinete) nas telas de loading ---------- */
.arcade-loader .al-cab,
.boot-logo {
  width: clamp(74px, 16vw, 120px);
  height: auto;
  display: block;
  margin: 0 auto 0.4rem;
  animation: cabFloat 2.6s ease-in-out infinite;
  filter: drop-shadow(0 0 14px var(--al-color, #f5d400));
}
@keyframes cabFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-7px) rotate(1deg); }
}

/* ---------- Glitch RGB no título ---------- */
.al-logo[data-text],
.boot-title[data-text] { position: relative; }
.al-logo[data-text]::before, .al-logo[data-text]::after,
.boot-title[data-text]::before, .boot-title[data-text]::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.7;
}
.al-logo[data-text]::before, .boot-title[data-text]::before {
  color: #00eaff;
  animation: glitchX 2.4s infinite steps(2) alternate;
}
.al-logo[data-text]::after, .boot-title[data-text]::after {
  color: #ff2bd6;
  animation: glitchX 2.4s infinite steps(2) alternate-reverse;
}
@keyframes glitchX {
  0% { transform: translate(-2px, 0); }
  20% { transform: translate(2px, -1px); }
  40% { transform: translate(-1px, 1px); }
  60% { transform: translate(2px, 1px); }
  80% { transform: translate(-2px, 0); }
  100% { transform: translate(1px, -1px); }
}

/* ---------- SPLASH DE BOOT (loading da página) ---------- */
#boot-splash {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  --al-color: #f5d400;
  background:
    radial-gradient(70% 60% at 50% 40%, oklch(28% 0.14 305) 0%, #04040a 72%),
    #04040a;
  transition: opacity 0.6s ease, filter 0.6s ease;
}
#boot-splash.gone { opacity: 0; filter: brightness(3) blur(2px); pointer-events: none; }
.boot-scan {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.32) 0 1px, transparent 1px 3px),
    radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0,0,0,0.7) 100%);
  animation: alFlicker 5s steps(60) infinite;
}
.boot-inner {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 1.5rem;
  width: 100%;
  max-width: 460px;
  animation: powerOn 1s ease-out both;
}
.boot-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.4rem, 9vw, 4rem);
  letter-spacing: 0.06em;
  color: #fff;
  line-height: 1;
  margin-bottom: 1rem;
}
.boot-title span { color: var(--al-color); text-shadow: 0 0 22px var(--al-color); }
.boot-bar {
  height: 16px;
  max-width: 320px;
  margin: 0 auto;
  border: 2px solid var(--al-color);
  border-radius: 4px;
  background: rgba(0,0,0,0.5);
  overflow: hidden;
  box-shadow: 0 0 16px var(--al-color), inset 0 0 8px rgba(0,0,0,0.8);
}
.boot-bar i {
  display: block; height: 100%; width: 35%;
  background: repeating-linear-gradient(90deg, var(--al-color) 0 10px, transparent 10px 16px);
  box-shadow: 0 0 12px var(--al-color);
  animation: alBar 1.1s linear infinite;
}
.boot-coin {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.18em;
  font-size: 1.2rem;
  color: var(--al-color);
  margin-top: 0.8rem;
  animation: alBlink 1s steps(2, start) infinite;
}
@keyframes powerOn {
  0%   { transform: scaleY(0.006) scaleX(1.3); filter: brightness(6); opacity: 0; }
  10%  { transform: scaleY(0.006) scaleX(1); opacity: 1; }
  28%  { transform: scaleY(1) scaleX(1); filter: brightness(2.2); }
  45%  { filter: brightness(1); }
  100% { transform: none; filter: none; }
}

/* mais brilho no tema do loader (aberração cromática via sombra) */
.arcade-loader .al-theme {
  text-shadow: -2px 0 #00eaff, 2px 0 #ff2bd6, 0 0 18px var(--al-color), 0 0 2px #fff;
}

@media (prefers-reduced-motion: reduce) {
  .al-cover.has-cover, .al-grid, .boot-grid, .al-cab, .boot-logo,
  .boot-inner, .boot-scan,
  .al-logo[data-text]::before, .al-logo[data-text]::after,
  .boot-title[data-text]::before, .boot-title[data-text]::after { animation: none; }
}

/* ====================================================================
   PAINEL ADMIN
   ==================================================================== */
.admin-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}
.admin-tab {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.05em;
  font-size: 1rem;
  padding: 0.5rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.admin-tab.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: var(--shadow-neon-yellow);
}
.admin-card { margin-bottom: 1.4rem; }
.admin-card h3 { font-family: "Bebas Neue", sans-serif; font-size: 1.3rem; margin: 0 0 0.6rem; }
.admin-card .text-input, .admin-card select.text-input { margin-bottom: 0.6rem; }

.admin-game-list { display: flex; flex-direction: column; gap: 0.5rem; }
.admin-game-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem 0.7rem;
}
.admin-game-row.is-hidden { opacity: 0.5; }
.agr-cover {
  width: 46px; height: 46px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--panel-2);
  flex: 0 0 auto;
}
.agr-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.agr-info strong { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agr-info span { font-size: 0.72rem; color: var(--text-dim); }
.agr-actions { display: flex; gap: 0.35rem; flex: 0 0 auto; }
.admin-pow-results { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.6rem; max-height: 320px; overflow-y: auto; }

/* ====================================================================
   Capas inteiras (sem corte) — arte "contain" com fundo desfocado atrás
   ==================================================================== */
.game-card .card-cover .cc-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(16px) brightness(0.45) saturate(1.1);
  transform: scale(1.15);
}
.game-card .card-cover img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;   /* mostra a capa INTEIRA, sem cortar */
  display: block;
}
/* rótulo do jogo com fundo sólido para legibilidade sobre a arte */
.game-card .game-card-info {
  z-index: 4;
  background: linear-gradient(180deg, transparent 0%, oklch(8% 0.04 300 / 0.55) 35%, oklch(6% 0.03 300 / 0.98) 100%);
}

/* Encerramento manual de partida (arena competitiva) */
#manual-end { margin-top: 0.8rem; }
.winner-pick { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }
.winner-pick .btn { width: auto; }

/* ====================================================================
   PORTÃO DE LOGIN DEDICADO DO ADMIN (/admin)
   ==================================================================== */
#admin-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  overflow: hidden;
  background:
    radial-gradient(70% 60% at 50% 30%, oklch(26% 0.14 305) 0%, #05060a 72%),
    #05060a;
}
#admin-gate.hidden { display: none; }
#admin-gate .ag-scan {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.32) 0 1px, transparent 1px 3px);
}
.admin-gate-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  text-align: center;
  background: oklch(18% 0.06 300 / 0.7);
  border: 1px solid oklch(45% 0.08 300 / 0.5);
  border-radius: 18px;
  padding: 2rem 1.6rem;
  box-shadow: 0 0 0 1px oklch(92% 0.19 100 / 0.15), 0 24px 60px rgba(0, 0, 0, 0.6);
}
.admin-gate-logo { width: 84px; height: auto; filter: drop-shadow(0 0 12px oklch(92% 0.19 100 / 0.7)); }
.admin-gate-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.2rem;
  letter-spacing: 0.06em;
  margin: 0.4rem 0 0;
  color: #fff;
}
.admin-gate-title span { color: var(--accent); text-shadow: 0 0 18px oklch(92% 0.19 100 / 0.7); }
.admin-gate-sub { color: var(--text-dim); font-size: 0.85rem; margin: 0.2rem 0 1.2rem; }
#admin-gate-form { display: flex; flex-direction: column; gap: 0.6rem; }
.admin-gate-back { display: inline-block; margin-top: 1rem; color: var(--text-dim); font-size: 0.8rem; text-decoration: none; }
.admin-gate-back:hover { color: var(--accent); }

/* ====================================================================
   Points (carteira) + Loja
   ==================================================================== */
.auth-points {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  box-shadow: var(--shadow-neon-yellow);
  white-space: nowrap;
}
.profile-points {
  margin-top: 0.3rem;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.2rem;
  color: var(--accent);
}

.store-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.store-balance {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.6rem;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0.3rem 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow-neon-yellow);
}
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}
.store-item { text-align: center; }
.store-item .store-emoji { font-size: 2.6rem; }
.store-item h3 { font-family: "Bebas Neue", sans-serif; font-size: 1.15rem; margin: 0.5rem 0 0.3rem; }
.store-cost { color: var(--accent); font-family: "Bebas Neue", sans-serif; font-size: 1.3rem; margin-bottom: 0.7rem; }
.store-item .btn { width: 100%; }

@media (max-width: 720px) {
  .auth-points { font-size: 0.85rem; padding: 0.15rem 0.5rem; }
}

/* ====================================================================
   Modal de perfil com abas + rolagem (não estoura a tela)
   ==================================================================== */
.profile-modal-card {
  max-width: 460px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.profile-tabs { display: flex; gap: 0.4rem; margin: 1rem 0 0.8rem; }
.profile-tab {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.05em;
  font-size: 1rem;
  padding: 0.45rem;
  border-radius: 10px;
  cursor: pointer;
}
.profile-tab.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.profile-scroll { overflow-y: auto; flex: 1 1 auto; padding-right: 4px; }
.avatar-gallery {
  max-height: 46vh;
  overflow-y: auto;
  padding: 0.2rem;
}

/* ====================================================================
   Admin: dashboard, tabela de usuários, banners
   ==================================================================== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.9rem; }
.stat-card {
  background: linear-gradient(160deg, oklch(24% 0.10 305), oklch(18% 0.07 300));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
}
.stat-card::before { content: ""; display: block; height: 3px; background: var(--gradient-neon); border-radius: 2px; margin: -1rem -1rem 0.8rem; }
.stat-icon { font-size: 1.6rem; }
.stat-val { font-family: "Bebas Neue", sans-serif; font-size: 2rem; color: var(--accent); line-height: 1; }
.stat-label { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }

.admin-users-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.admin-users-table { display: flex; flex-direction: column; gap: 0.5rem; }
.au-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  flex-wrap: wrap;
}
.au-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--panel-2); }
.au-main { flex: 1 1 180px; min-width: 0; }
.au-name { font-weight: 700; display: flex; align-items: center; gap: 0.4rem; }
.au-sub { font-size: 0.72rem; color: var(--text-dim); }
.au-stats { display: flex; gap: 0.7rem; font-size: 0.8rem; color: var(--text-dim); flex-wrap: wrap; }
.au-actions { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.badge { font-size: 0.6rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 999px; letter-spacing: 0.06em; }
.badge-admin { background: var(--magenta); color: #fff; }
.badge-vip { background: var(--accent); color: var(--accent-ink); }

.admin-banner-list { display: flex; flex-direction: column; gap: 0.6rem; }
.admin-banner-row { display: flex; align-items: center; gap: 0.8rem; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 0.5rem 0.7rem; }
.abr-img { width: 120px; height: 68px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: var(--panel-2); }

@media (max-width: 640px) {
  .au-stats { width: 100%; }
  .au-actions { width: 100%; }
}

/* Edição por clique no admin (jogos) */
.agr-edit-tools { display: inline-flex; gap: 0.35rem; }
.agr-edit-tools.hidden { display: none; }
.agr-edit.active { background: var(--accent); color: var(--accent-ink); }
#au-export { white-space: nowrap; }

/* ---------- Efeito de entrada (scroll reveal) dos cards ---------- */
.game-card.reveal {
  opacity: 0;
  transform: translateY(22px) scale(0.98);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.game-card.reveal.revealed {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .game-card.reveal { opacity: 1; transform: none; transition: none; }
}

/* Sentinela invisível da rolagem infinita do Modo Solo */
.solo-sentinel { grid-column: 1 / -1; height: 1px; }

/* Legibilidade do texto do banner agora que não há overlay escuro */
.hero-slide-title { text-shadow: 0 2px 6px rgba(0,0,0,0.9), 0 4px 22px rgba(0,0,0,0.7); }
.hero-slide-desc  { text-shadow: 0 1px 4px rgba(0,0,0,0.9); }
.hero-slide-tag   { text-shadow: 0 1px 3px rgba(0,0,0,0.6); }

/* ---------- Loja: imagem/descrição do produto ---------- */
.store-item-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 160px;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
}
.store-item-desc {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0.2rem 0 0.6rem;
  min-height: 2.4em;
}

/* ---------- Admin: gerenciador de competitivo e produtos ---------- */
.admin-comp-list, .admin-prod-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.8rem; }
.admin-comp-row, .admin-prod-row {
  display: flex; align-items: center; gap: 0.8rem;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.45rem 0.7rem;
}
.admin-comp-row img, .admin-prod-row img {
  width: 54px; height: 40px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; background: var(--panel-2);
}
.admin-comp-row .acr-name { flex: 1; min-width: 0; }
.admin-comp-row .acr-name small { color: var(--text-dim); display: block; }
.admin-comp-tag {
  font-size: 0.72rem; padding: 0.1rem 0.5rem; border-radius: 999px;
  background: oklch(40% 0.06 300 / 0.4); color: var(--text-dim);
}
.admin-comp-tag.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.admin-comp-filter { display: flex; gap: 0.5rem; margin: 0.6rem 0; flex-wrap: wrap; }
.label-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1rem; }
@media (max-width: 640px) { .label-editor-grid { grid-template-columns: 1fr; } }

/* ============================================================ */
/* FUNDO ROTATIVO DO SITE (imagens que trocam na navegação)     */
/* ============================================================ */
#bg-rotator {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: #0a0512;
}
#bg-rotator .bg-slot {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.1s ease, transform 9s ease;
  will-change: opacity, transform;
}
#bg-rotator .bg-slot.active {
  opacity: 1;
  transform: scale(1);
}
/* Véu escuro para manter o conteúdo legível sobre a imagem */
#bg-rotator .bg-rotator-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 800px at 50% 0%, oklch(12% 0.06 300 / 0.55), transparent 70%),
    linear-gradient(180deg, oklch(8% 0.05 300 / 0.82) 0%, oklch(6% 0.04 300 / 0.9) 100%);
}
/* Quando há fundo rotativo, deixa o corpo levemente translúcido para ver a arte */
body.has-bg-rotator .bg-fx { opacity: 0.35; }

/* ============================================================ */
/* MODAIS GAMER RETRO (anúncio + sucesso de cadastro)           */
/* ============================================================ */
@keyframes modalPopIn {
  0% { opacity: 0; transform: translateY(24px) scale(0.9); }
  60% { transform: translateY(-6px) scale(1.02); }
  100% { opacity: 1; transform: none; }
}
.modal-overlay.pop-in .modal { animation: modalPopIn 0.45s cubic-bezier(0.22, 1, 0.36, 1); }

.announce-card, .success-card {
  position: relative;
  overflow: hidden;
  text-align: center;
  max-width: 440px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 1px oklch(70% 0.2 300 / 0.4), 0 18px 60px rgba(0, 0, 0, 0.7), inset 0 0 40px oklch(60% 0.2 300 / 0.12);
  background:
    linear-gradient(180deg, oklch(16% 0.07 300 / 0.98), oklch(10% 0.05 300 / 0.98));
}
/* Linha de varredura CRT animada */
.announce-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 100%;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 2px, transparent 2px 4px);
  pointer-events: none; opacity: 0.5;
}
.announce-badge {
  display: inline-block;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 2px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  font-size: 1rem;
  margin-bottom: 0.8rem;
  box-shadow: var(--shadow-neon-yellow);
}
.announce-image {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 0.9rem;
  border: 1px solid var(--border);
}
.announce-title, .success-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.05;
  margin: 0 0 0.6rem;
  color: var(--accent);
  text-shadow: 0 0 12px oklch(75% 0.2 95 / 0.6);
}
.announce-message, .success-message {
  color: var(--text-dim);
  margin: 0 0 1.2rem;
  font-size: 1rem;
  line-height: 1.5;
}
.announce-card .btn, .success-card .btn { width: 100%; }

/* Modal de sucesso: troféu pulsante + moedas + brilho magenta */
.success-card { border-color: var(--accent-2, #ff3db0); }
@keyframes trophyBounce { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }
.success-trophy { font-size: 3.4rem; animation: trophyBounce 1.2s ease-in-out infinite; filter: drop-shadow(0 0 14px oklch(80% 0.18 95 / 0.7)); }
.success-badge {
  font-family: "Bebas Neue", sans-serif; letter-spacing: 3px; color: var(--accent);
  font-size: 1.1rem; margin: 0.3rem 0 0.4rem; animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0.35; } }
.success-coins { display: flex; gap: 0.5rem; justify-content: center; margin: 0 0 1rem; }
.success-coins span { color: var(--accent); animation: coinFlip 1.2s ease-in-out infinite; font-size: 1.2rem; }
.success-coins span:nth-child(2) { animation-delay: 0.15s; }
.success-coins span:nth-child(3) { animation-delay: 0.3s; }
@keyframes coinFlip { 0%,100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(0.2); opacity: 0.5; } }

/* ============================================================ */
/* RANKING — busca + chips + pódio + lista (gamer retro)        */
/* ============================================================ */
.ranking-controls { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; margin-bottom: 1.2rem; }
.rank-game-picker { flex: 1; min-width: 260px; }
.rank-search {
  width: 100%;
  background: oklch(14% 0.05 300 / 0.8);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  font-family: "Barlow", sans-serif;
  margin-bottom: 0.6rem;
}
.rank-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px oklch(70% 0.2 300 / 0.25); }
.rank-game-chips {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  max-height: 132px; overflow-y: auto;
  padding: 0.2rem;
  scrollbar-width: thin;
}
.rank-game-chips .ranking-tab {
  font-size: 0.82rem; padding: 0.3rem 0.7rem; border-radius: 999px; white-space: nowrap;
}
.rank-current-game {
  display: flex; align-items: center; gap: 0.9rem;
  background: oklch(14% 0.05 300 / 0.6);
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 12px; padding: 0.7rem 1rem; margin-bottom: 1.2rem;
}
.rank-current-game img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; }
.rank-current-game .rcg-label { display: block; font-size: 0.7rem; letter-spacing: 2px; color: var(--accent); font-family: "Bebas Neue", sans-serif; }
.rank-current-game strong { font-family: "Bebas Neue", sans-serif; font-size: 1.5rem; letter-spacing: 1px; }

/* Pódio top 3 */
.rank-podium { display: flex; justify-content: center; align-items: flex-end; gap: 0.8rem; margin-bottom: 1.4rem; flex-wrap: nowrap; }
.podium-spot {
  flex: 1; max-width: 170px; text-align: center;
  background: linear-gradient(180deg, oklch(18% 0.07 300 / 0.85), oklch(11% 0.05 300 / 0.85));
  border: 1px solid var(--border); border-radius: 14px 14px 0 0;
  padding: 0.8rem 0.5rem 0; position: relative;
  animation: modalPopIn 0.5s both;
}
.podium-spot.pos-1 { border-color: oklch(85% 0.17 95); box-shadow: 0 0 24px oklch(80% 0.18 95 / 0.35); transform: translateY(-12px); z-index: 2; }
.podium-spot.pos-2 { border-color: oklch(80% 0.02 300); }
.podium-spot.pos-3 { border-color: oklch(65% 0.12 40); }
.podium-medal { font-size: 1.8rem; }
.podium-avatar { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); margin: 0.2rem auto; display: block; }
.podium-spot.pos-1 .podium-avatar { width: 76px; height: 76px; border-color: oklch(85% 0.17 95); }
.podium-name { font-weight: 700; font-size: 0.9rem; margin-top: 0.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-stats { font-size: 0.72rem; color: var(--text-dim); margin: 0.2rem 0 0.5rem; }
.podium-base {
  font-family: "Bebas Neue", sans-serif; font-size: 1.4rem; letter-spacing: 1px;
  background: oklch(30% 0.06 300 / 0.6); border-radius: 4px; padding: 0.15rem 0;
}
.podium-spot.pos-1 .podium-base { background: linear-gradient(180deg, oklch(85% 0.17 95), oklch(70% 0.17 60)); color: #2a1800; }

/* Lista do 4º em diante */
.rank-list { display: flex; flex-direction: column; gap: 0.4rem; }
.rank-row {
  display: flex; align-items: center; gap: 0.8rem;
  background: oklch(14% 0.04 300 / 0.55); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.45rem 0.8rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.rank-row:hover { transform: translateX(4px); border-color: var(--accent); }
.rank-pos { font-family: "Bebas Neue", sans-serif; font-size: 1.2rem; color: var(--accent); min-width: 2ch; text-align: center; }
.rank-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.rank-name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-wdl { font-size: 0.85rem; color: var(--text-dim); white-space: nowrap; }
.rank-wdl b { font-size: 1rem; }
.rank-wdl small { margin-right: 0.4rem; opacity: 0.7; }
.ls-win { color: #4ade80; } .ls-loss { color: #f87171; } .ls-draw { color: #fbbf24; }

@media (max-width: 560px) {
  .podium-spot .podium-stats { display: none; }
  .rank-podium { gap: 0.3rem; }
}

/* ============================================================ */
/* ADMIN — grade de fundos                                      */
/* ============================================================ */
.admin-bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.8rem; margin-top: 0.8rem; }
.admin-bg-cell { display: flex; flex-direction: column; gap: 0.4rem; }
.abg-thumb { width: 100%; aspect-ratio: 3 / 4; background-size: cover; background-position: center; border-radius: 10px; border: 1px solid var(--border); }
