/* ============================================================
   PalpitaAí — style.css
   Design system extraído de palpita-ai-design.html
   Importado por todas as páginas do projeto
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');


/* ============================================================
   1. RESET + VARIÁVEIS GLOBAIS (:root)
   ============================================================ */

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

:root {
  /* ── Cores principais ── */
  --brand:       #2563EB;   /* azul sólido */
  --brand-dark:  #1D4ED8;
  --brand-light: #EFF6FF;
  --brand-mid:   #BFDBFE;

  /* ── Superfícies ── */
  --bg:          #F8F9FB;
  --surface:     #FFFFFF;
  --surface-2:   #F1F4F8;

  /* ── Texto ── */
  --text:        #111827;
  --text-2:      #4B5563;
  --text-3:      #9CA3AF;

  /* ── Bordas ── */
  --border:      #E5E7EB;
  --border-2:    #D1D5DB;

  /* ── Status ── */
  --green:       #16A34A;
  --green-bg:    #F0FDF4;
  --red:         #DC2626;
  --red-bg:      #FEF2F2;
  --amber:       #D97706;
  --amber-bg:    #FFFBEB;

  /* ── Raios ── */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   18px;

  /* ── Tipografia ── */
  --font:        'Inter', sans-serif;

  /* ── Bottom bar ── */
  --bottom-bar-h: 64px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.2, 0.8, 0.2, 1);
}


/* ============================================================
   2. BASE (body, tipografia)
   ============================================================ */

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  /* Espaço inferior para a bottom bar não cobrir conteúdo */
  padding-bottom: calc(var(--bottom-bar-h) + 16px);
  min-height: 100dvh;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

/* ── Logo ── */
.logo {
  font-family: var(--font);
  font-weight: 800;
  font-size: 1.9rem;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

.logo em {
  font-style: normal;
  color: var(--brand);
}

.tagline {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 6px;
  font-weight: 400;
}

/* ── Escala tipográfica ── */
.t-display {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.t-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.t-body {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.5;
}

.t-caption {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}

/* ── Section title (label de seção interna) ── */
.section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1rem 0;
}


/* ============================================================
   3. LAYOUT (estrutura de página, page-header, bottom-bar)
   ============================================================ */

/* Wrapper interno de cada página — limita largura e centraliza */
.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Variação: páginas sem bottom bar (login, cadastro, etc.) */
.page--no-bar {
  padding-bottom: 2rem;
}

/* ── Page header (topo de Home, Palpites, etc.) ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem 0.75rem;
  max-width: 480px;
  margin: 0 auto;
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(248, 249, 251, 0.94);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.page-header__logo {
  font-family: var(--font);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

.page-header__logo em {
  font-style: normal;
  color: var(--brand);
}

.page-header__subtitle {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  margin-top: 2px;
}

/* Ícone de perfil no canto do header */
.page-header__profile-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.page-header__profile-btn:hover {
  background: var(--surface-2);
}

.profile-header,
.admin-header,
.waiting-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(248, 249, 251, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Título de seção dentro de página ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ── Pills row (filtros horizontais com scroll) ── */
.pills-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  /* Esconde scrollbar mas mantém scroll funcional */
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: 16px;
}

.pills-row::-webkit-scrollbar {
  display: none;
}

/* ── Stack de cards com gap ── */
.cards-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

/* ── Row genérico (flex horizontal) ── */
.row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-3);
}

.empty-state__icon {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}

.empty-state__text {
  font-size: 14px;
  font-weight: 500;
}

/* ── Tela de auth (login/cadastro) — centralizada verticalmente ── */
.auth-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 380px;
}

.auth-card__header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-card__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 4px;
}

.auth-card__subtitle {
  font-size: 13px;
  color: var(--text-2);
}

/* ── Bottom bar ── */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-bar-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 100;
  /* Blur sutil para visual premium */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
}

.bottom-bar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.18s var(--ease-smooth), transform 0.18s var(--ease-smooth);
  padding: 8px 0 12px; /* padding-bottom compensa safe area */
}

.bottom-bar__item:hover {
  color: var(--text-2);
}

.bottom-bar__item:active {
  transform: translateY(1px);
}

.bottom-bar__item.active {
  color: var(--brand);
}

.bottom-bar__icon {
  width: 22px;
  height: 22px;
  line-height: 1;
  transition: transform 0.18s var(--ease-smooth), background 0.18s var(--ease-smooth), color 0.18s var(--ease-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bottom-bar__icon svg,
.icon svg,
.empty-state__icon svg,
.hero-icon svg,
.card-icon svg,
.success-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  stroke: currentColor;
}

.bottom-bar__item.active .bottom-bar__icon {
  width: 30px;
  height: 30px;
  padding: 5px;
  border-radius: 10px;
  background: var(--brand-light);
  transform: translateY(-1px);
}

/* ── Toast / feedback inline ── */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-bar-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 99px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out);
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--success { background: var(--green); }
.toast--error   { background: var(--red); }

/* ── Loading spinner ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--border-2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes softPop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* ============================================================
   4. BOTÕES
   ============================================================ */

/* Reset base de todos os botões */
button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: transform 0.16s var(--ease-smooth), background 0.16s var(--ease-smooth), border-color 0.16s var(--ease-smooth), color 0.16s var(--ease-smooth), opacity 0.16s var(--ease-smooth), box-shadow 0.16s var(--ease-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
}

/* ── Primário — sólido, canto inferior esquerdo cortado ── */
.btn-primary {
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 10px 10px 10px 4px;
  letter-spacing: -0.01em;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible,
.bottom-bar__item:focus-visible {
  outline: 3px solid var(--brand-light);
  outline-offset: 2px;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Variação full-width (usado nos cards de jogo) */
.btn-primary--full {
  width: 100%;
  border-radius: 10px; /* full-width perde o canto cortado */
}

/* ── Secundário — contorno azul ── */
.btn-secondary {
  background: var(--surface);
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1.5px solid var(--brand-mid);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: var(--brand-light);
  transform: translateY(-1px);
}

.btn-secondary--full {
  width: 100%;
}

/* ── Ghost — borda neutra, sem fundo ── */
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: translateY(-1px);
}

/* ── Perigo — fundo rosado, texto vermelho ── */
.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid #FECACA;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-danger:hover {
  background: #FEE2E2;
  transform: translateY(-1px);
}

.btn-danger--full {
  width: 100%;
}

/* ── Pill — chip interativo de filtro ── */
.btn-pill {
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.btn-pill:hover {
  background: var(--brand-light);
  color: var(--brand);
  border-color: var(--brand-mid);
  transform: translateY(-1px);
}

.btn-secondary:active,
.btn-ghost:active,
.btn-danger:active,
.btn-pill:active {
  transform: scale(0.98);
}

.btn-pill.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ── Botão ícone (para perfil, fechar, etc.) ── */
.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
  font-size: 18px;
}

.btn-icon:hover {
  background: var(--surface-2);
  color: var(--text);
}


/* ============================================================
   5. BADGES (com bolinha de status)
   ============================================================ */

/* Container de múltiplos badges */
.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Base: pill neutro, borda fina */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 99px;
  padding: 3px 10px;
  letter-spacing: 0;
  flex-shrink: 0;
}

/* Bolinha de status gerada via ::before */
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-3); /* cinza padrão = aguardando */
}

/* Variações de status */
.badge-open::before    { background: var(--brand); }  /* Aberto */
.badge-locked::before  { background: var(--amber); }  /* Travado */
.badge-ok::before      { background: var(--green); }  /* Acertou */
.badge-fail::before    { background: var(--red); }    /* Errou */
.badge-partial::before { background: var(--amber); }  /* Parcial */
/* .badge sem modificador = Aguardando / Encerrado (cinza padrão) */


/* ============================================================
   6. AVATARES (base — cor aplicada via JS)
   ============================================================ */

/* Tamanho padrão: md (36px) */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.01em;
  flex-shrink: 0;
  user-select: none;
  /* background e color aplicados via JS com base no nome */
}

/* Tamanhos alternativos */
.avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 10px;
}

.avatar--lg {
  width: 52px;
  height: 52px;
  font-size: 18px;
  font-weight: 700;
}

.avatar--xl {
  width: 72px;
  height: 72px;
  font-size: 24px;
  font-weight: 800;
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}

.avatar--custom {
  border: 1px solid rgba(17, 24, 39, 0.08);
}

.avatar--custom svg {
  width: 58%;
  height: 58%;
  display: block;
  stroke: currentColor;
}

/*
  Paleta usada pelo JS (utils.js → getAvatarColors):
  [
    { bg: '#DBEAFE', fg: '#1E40AF' },  azul
    { bg: '#D1FAE5', fg: '#065F46' },  verde
    { bg: '#FEF3C7', fg: '#92400E' },  âmbar
    { bg: '#FCE7F3', fg: '#9D174D' },  rosa
    { bg: '#EDE9FE', fg: '#4C1D95' },  violeta
    { bg: '#FFEDD5', fg: '#7C2D12' },  laranja
    { bg: '#CFFAFE', fg: '#164E63' },  ciano
    { bg: '#F1F5F9', fg: '#334155' },  slate
  ]
*/


/* ============================================================
   7. CARDS (card-jogo, card-resultado, card-ranking)
   ============================================================ */

/* ── Base de card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  animation: cardIn 0.28s var(--ease-out) both;
  transition: border-color 0.18s var(--ease-smooth), box-shadow 0.18s var(--ease-smooth), transform 0.18s var(--ease-smooth);
}

.match-card:active {
  transform: scale(0.995);
}

.card:hover {
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.07);
}

/* ── Card header: label + badge ── */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ── Teams row: bandeira + nome + score-area ── */
.teams-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.team-flag {
  font-size: 30px;
  line-height: 1;
}

.team-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  max-width: 112px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Score area (centro do card) ── */
.score-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.score-vs {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.1em;
}

/* ── Inputs de palpite ── */
.score-inputs {
  display: flex;
  gap: 5px;
  align-items: center;
}

.score-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-2);
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font);
  background: var(--surface-2);
  transition: border-color 0.16s var(--ease-smooth), background 0.16s var(--ease-smooth), box-shadow 0.16s var(--ease-smooth), transform 0.16s var(--ease-smooth);
  /* Esconde setas de number input */
  -moz-appearance: textfield;
  appearance: textfield;
}

.score-box::-webkit-outer-spin-button,
.score-box::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.score-box:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-light);
  transform: translateY(-1px);
}

.score-sep {
  font-size: 16px;
  color: var(--text-3);
  font-weight: 600;
}

/* ── Card resultado: placar final grande ── */
.result-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  justify-content: center;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 4px 10px;
}

.result-num {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}

.result-sep {
  font-size: 18px;
  color: var(--text-3);
  font-weight: 700;
}

/* ── Linhas de palpite (dentro do card resultado) ── */
.palpite-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-2);
  padding: 5px 0;
  border-top: 1px solid var(--border);
  transition: background 0.16s var(--ease-smooth);
}

.palpite-line:hover {
  background: var(--surface-2);
}

.palpite-line:last-child {
  border-bottom: none;
}

/* Resultado por jogador */
.acerto  { color: var(--green); font-weight: 600; }
.erro    { color: var(--red);   font-weight: 600; }
.parcial { color: var(--amber); font-weight: 600; }

/* ── Card do usuário em destaque (linha própria no ranking) ── */
.card--me {
  background: var(--brand-light);
  border-color: var(--brand-mid);
}


/* ============================================================
   8. FORMULÁRIOS (inputs, labels, form-group)
   ============================================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.form-group:last-child {
  margin-bottom: 0;
}

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

/* Campos de texto e e-mail */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"] {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  padding: 10px 13px;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.16s var(--ease-smooth), box-shadow 0.16s var(--ease-smooth), background 0.16s var(--ease-smooth), transform 0.16s var(--ease-smooth);
  width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
  transform: translateY(-1px);
}

input::placeholder {
  color: var(--text-3);
  font-weight: 400;
}

/* Estado de erro no campo */
input.input--error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-bg);
}

/* Mensagem de erro abaixo do campo */
.field-error {
  font-size: 12px;
  color: var(--red);
  font-weight: 500;
  margin-top: 3px;
}

/* Campo grande de código de convite */
.input-code {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-align: center;
  text-transform: uppercase;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
}


/* ============================================================
   9. RANKING (pódio + lista)
   ============================================================ */

/* ── Lista de ranking ── */
.rank-list {
  display: flex;
  flex-direction: column;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.16s var(--ease-smooth), transform 0.16s var(--ease-smooth);
}

.rank-row:hover {
  transform: translateX(2px);
}

.rank-row:last-child {
  border-bottom: none;
}

/* Posição numérica */
.rank-pos {
  font-size: 13px;
  font-weight: 700;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* Cores de pódio */
.pos-1 { color: #D97706; }  /* ouro */
.pos-2 { color: #6B7280; }  /* prata */
.pos-3 { color: #92400E; }  /* bronze */
.pos-n { color: var(--text-3); }

.rank-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-pts {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
}

.rank-pts span {
  color: var(--brand);
}

/* Linha do usuário logado em destaque */
.rank-row--me {
  background: var(--brand-light);
  border-radius: var(--radius-md);
  padding: 9px 10px;
  margin: 0 -10px;
  border-bottom: none;
}

/* ── Pódio visual (barras de gráfico) ── */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  padding: 1.5rem 1rem 0;
  margin-bottom: 1.5rem;
}

.podium__slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 100px;
}

.podium__player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.podium__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium__pts {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
}

/* Barra do pódio */
.podium__bar {
  width: 100%;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
}

/* Alturas e cores por posição */
.podium__slot--1 .podium__bar {
  height: 90px;
  background: linear-gradient(160deg, #F59E0B, #D97706);
}

.podium__slot--2 .podium__bar {
  height: 65px;
  background: linear-gradient(160deg, #9CA3AF, #6B7280);
}

.podium__slot--3 .podium__bar {
  height: 48px;
  background: linear-gradient(160deg, #B45309, #92400E);
}

/* Medalha emoji no centro da barra */
.podium__medal {
  font-size: 20px;
}


/* ============================================================
   10. UTILITÁRIOS (helpers de espaçamento, texto, visibilidade)
   ============================================================ */

/* ── Espaçamento ── */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ── Texto ── */
.text-center   { text-align: center; }
.text-brand    { color: var(--brand); }
.text-muted    { color: var(--text-3); }
.text-sm       { font-size: 13px; }
.text-xs       { font-size: 11px; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* ── Display ── */
.hidden  { display: none !important; }
.flex    { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }

/* ── Truncamento de texto longo ── */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Link estilizado ── */
.link {
  color: var(--brand);
  font-weight: 500;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.link:hover {
  opacity: 0.75;
  text-decoration: none;
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon--lg {
  width: 32px;
  height: 32px;
}

.admin-link {
  display: none;
}

.admin-link.visible {
  display: inline-flex;
}

/* ── Chip de código de convite (exibição) ── */
.invite-code {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1.5px dashed var(--border-2);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  overflow-wrap: anywhere;
  text-align: center;
}

.invite-code:hover {
  background: var(--brand-light);
  border-color: var(--brand-mid);
}

/* ── Info row (linha de metadado: ícone + texto) ── */
.info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  padding: 6px 0;
}

.info-row__icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* ── Stat box (destaque de estatística) ── */
.stat-box {
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  text-align: center;
  flex: 1;
}

.stat-box__value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-box__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Countdown (aguardando tela) ── */
.countdown {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 1.5rem 0;
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  min-width: 64px;
}

.countdown__value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--brand);
  line-height: 1;
}

.countdown__label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(17, 24, 39, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.popup {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.18);
  animation: softPop 0.22s var(--ease-out) both;
}

.popup__badge {
  width: 34px;
  height: 6px;
  border-radius: 999px;
  margin: 0 auto 14px;
  background: var(--brand);
}

.popup__badge--warning { background: var(--amber); }
.popup__badge--success { background: var(--green); }
.popup__badge--danger { background: var(--red); }

.popup__title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.popup__message {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-2);
}

.popup__actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.popup__actions > * {
  flex: 1;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
