/* Layout: ranking à esquerda, recordes da conta à direita */
.board-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

.board-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* ---------- Abas de jogo ---------- */
.game-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.game-tab {
  border: 2px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 0.6rem;
  padding: 12px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.game-tab:hover {
  color: var(--text);
  border-color: var(--accent);
}

.game-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(124, 92, 255, 0.5);
}

/* ---------- Ranking ---------- */
.board-panel {
  padding: 20px;
}

.board-status {
  text-align: center;
  color: var(--text-dim);
  font-size: 1.15rem;
  padding: 20px 0;
}

.board-status:empty {
  display: none;
  padding: 0;
}

.ranking {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}

.rank-row.is-me {
  border-color: var(--accent-3);
  background: rgba(47, 245, 192, 0.1);
  box-shadow: 0 0 12px rgba(47, 245, 192, 0.25);
}

.rank-pos {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: center;
}

.rank-pos.medal {
  font-size: 1.3rem;
}

.rank-name {
  font-size: 1.2rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Etiqueta que identifica os recordes de referência da máquina */
.bot-tag {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-display);
  font-size: 0.4rem;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 5px;
  vertical-align: middle;
}

.rank-score {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--accent-3);
  text-shadow: 0 0 8px rgba(47, 245, 192, 0.5);
  white-space: nowrap;
}

.rank-score small {
  font-size: 0.5rem;
  color: var(--text-dim);
  text-shadow: none;
}

/* ---------- Painel direito ---------- */
.board-side {
  position: sticky;
  top: 20px;
}

.side-panel {
  padding: 22px;
}

.side-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--accent-2);
  margin: 0 0 18px;
  text-align: center;
  text-shadow: 0 0 8px rgba(255, 77, 141, 0.6);
}

.side-account {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.side-account:empty {
  display: none;
}

.side-username {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--accent-3);
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-scores {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.side-game {
  font-size: 1.1rem;
  color: var(--text-dim);
}

.side-value {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--accent-3);
  text-shadow: 0 0 8px rgba(47, 245, 192, 0.5);
}

.side-value small {
  font-size: 0.45rem;
  color: var(--text-dim);
  text-shadow: none;
}

.side-value.empty {
  color: var(--text-dim);
  text-shadow: none;
}

.side-empty {
  color: var(--text-dim);
  font-size: 1.05rem;
  text-align: center;
  line-height: 1.5;
  margin: 0 0 16px;
}

.side-panel .btn {
  width: 100%;
}

/* ---------- Placar na home ---------- */
.home-board {
  margin-top: 56px;
}

.home-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.home-board-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--accent-2);
  margin: 0;
  text-shadow: 0 0 8px rgba(255, 77, 141, 0.6);
}

.home-board-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 1rem;
  margin: 14px 0 0;
}

/* Estrela de favorito dentro do card */
.game-card {
  position: relative;
}

.fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  z-index: 2;
}

.fav-btn:hover {
  color: var(--amber);
  border-color: var(--amber);
}

.fav-btn.ativo {
  color: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 12px rgba(255, 207, 77, 0.45);
}

/* ---------- Painel do administrador ---------- */
.admin-card {
  width: min(460px, 92vw);
}

.admin-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.25rem;
  cursor: pointer;
}

.admin-select:focus {
  outline: none;
  border-color: var(--accent-3);
}

.admin-hint {
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0 0 20px;
}

.admin-negado {
  text-align: center;
  color: var(--text-dim);
  font-size: 1.2rem;
  margin: 0 0 20px;
}

.auth-error.sucesso {
  color: var(--accent-3);
  text-shadow: 0 0 8px rgba(47, 245, 192, 0.5);
}

/* Destaque do jogo da semana na home */
.semana-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--font-display);
  font-size: 0.45rem;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--amber);
  padding: 5px 8px;
  border-radius: var(--radius);
  z-index: 2;
}

.game-card.destaque {
  border-color: var(--amber);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.55), 0 0 20px rgba(255, 207, 77, 0.3);
}

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .board-layout {
    grid-template-columns: 1fr;
  }
  .board-side {
    position: static;
    order: -1; /* recordes aparecem antes no mobile */
  }
}

/* Ranking do jogo da semana, no topo da home */
.home-board.home-board-topo { margin-top: 8px; margin-bottom: 36px; }
.home-board-sub { margin: 8px 0 0; color: var(--text-dim); font-size: 1.05rem; }
.home-board-sub strong { color: var(--amber); font-weight: normal; }
@media (max-width: 640px) {
  .home-board.home-board-topo { margin-bottom: 24px; }
  .home-board-topo .home-board-head { margin-bottom: 12px; flex-wrap: nowrap; align-items: flex-start; }
  .home-board-topo .home-board-head > div { min-width: 0; }
  .home-board-topo .back-link { flex: none; }
}

/* Filtros da lista de jogos */
.filtros { display: flex; justify-content: center; gap: 10px; margin: 0 0 24px; flex-wrap: wrap; }
.filtro {
  min-height: 44px; padding: 0 18px; cursor: pointer;
  background: var(--card); color: var(--text-dim);
  border: 2px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-display); font-size: 0.7rem;
}
.filtro:hover { background: var(--card-hover); color: var(--text); }
.filtro.ativo { color: var(--bg); background: var(--accent-3); border-color: var(--accent-3); }
.game-card[hidden] { display: none; }
.filtro-vazio { text-align: center; color: var(--text-dim); margin: 8px 0 0; }
@media (max-width: 640px) { .filtros { gap: 8px; } .filtro { flex: 1 1 0; padding: 0 8px; } }
