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

:root {
  --bola: #ffb020;
  --bola-2: #ff7a00;
  --cobra: #7CFC00;
  --cobra-2: #36d66b;
  --faroeste: #ffce47;
  --faroeste-2: #d9632a;
  --panel: rgba(13, 18, 38, 0.72);
  --panel-border: rgba(255, 255, 255, 0.12);
}

html, body {
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #f4f6ff;
  background:
    radial-gradient(circle at 18% 18%, #2a1b50 0%, transparent 45%),
    radial-gradient(circle at 82% 28%, #1b2a6b 0%, transparent 50%),
    linear-gradient(160deg, #0a1024 0%, #0d162e 55%, #05060f 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 18px env(safe-area-inset-bottom, 18px);
  position: relative;
  overflow-x: hidden;
}

/* ===================== Estrelas de fundo ===================== */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.4;
}

/* ===================== Layout do hub ===================== */
.hub {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.hub-head { text-align: center; }
.hub-title {
  font-size: clamp(34px, 8vw, 64px);
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #ffb020, #7CFC00 55%, #58a6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 18px rgba(124, 252, 0, 0.25));
}
.hub-sub {
  margin-top: 8px;
  font-size: clamp(14px, 3.4vw, 18px);
  color: #b9c2e8;
}

/* Campo do nome */
.name-field {
  margin-top: 18px;
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.name-field label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #9aa6d4;
}
.name-field input {
  width: min(320px, 80vw);
  background: #161f44;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 16px;
  text-align: center;
  outline: none;
}
.name-field input:focus {
  border-color: #58a6ff;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.25);
}

/* ===================== Cards dos jogos ===================== */
.cards {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.game-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 26px 22px 24px;
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.game-card:hover {
  transform: translateY(-4px);
}
.card-bola:hover { border-color: var(--bola); box-shadow: 0 14px 40px rgba(255, 122, 0, 0.22); }
.card-cobra:hover { border-color: var(--cobra); box-shadow: 0 14px 40px rgba(124, 252, 0, 0.20); }
.card-faroeste:hover { border-color: var(--faroeste); box-shadow: 0 14px 40px rgba(217, 99, 42, 0.24); }

/* brilho difuso no topo do card */
.card-glow {
  position: absolute;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
}
.card-bola .card-glow { background: var(--bola-2); }
.card-cobra .card-glow { background: var(--cobra-2); }
.card-faroeste .card-glow { background: var(--faroeste-2); }

.card-emoji {
  font-size: 64px;
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}
.card-name {
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 800;
}
.card-bola .card-name { color: var(--bola); }
.card-cobra .card-name { color: var(--cobra); }
.card-faroeste .card-name { color: var(--faroeste); }
.card-desc {
  font-size: 14px;
  color: #c2cbef;
  min-height: 40px;
}

/* Prévia do Top 3 */
.card-top {
  width: 100%;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 10px 12px;
}
.card-top-label {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #9aa6d4;
  margin-bottom: 6px;
}
.card-top-total {
  font-size: 11px;
  color: #8893bd;
  text-align: center;
  margin-top: 6px;
}
.card-top-list { list-style: none; }
.card-top-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}
.card-top-list li:last-child { border-bottom: none; }
.card-top-list .rk-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-top-list .rk-val {
  font-variant-numeric: tabular-nums;
  color: #d7defb;
}
.card-top-list .loading,
.card-top-list .empty {
  justify-content: center;
  color: #8893bd;
  font-style: italic;
  border-bottom: none;
}

/* Botão jogar */
.play-btn {
  margin-top: 4px;
  display: inline-block;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-decoration: none;
  color: #0a0e1f;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  /* alvo de toque confortável no celular */
  min-height: 52px;
}
.card-bola .play-btn { background: linear-gradient(180deg, var(--bola), var(--bola-2)); }
.card-cobra .play-btn { background: linear-gradient(180deg, var(--cobra), var(--cobra-2)); }
.card-faroeste .play-btn { background: linear-gradient(180deg, var(--faroeste), var(--faroeste-2)); }
.play-btn:hover { filter: brightness(1.08); }
.play-btn:active { transform: scale(0.97); }

/* ===================== Rodapé ===================== */
.hub-foot { min-height: 20px; }
.rank-status {
  font-size: 12px;
  color: #8893bd;
}

/* ===================== Mobile ===================== */
@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; gap: 18px; }
  .card-desc { min-height: 0; }
}
