.game-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 25;
  pointer-events: none;
}

.game-overlay.active {
  display: flex;
}

.overlay-card {
  background: rgba(20,20,22,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: modalSlideIn 300ms ease-out;
}

.overlay-card h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  font-family: 'Rajdhani', sans-serif;
  color: var(--text);
}

.overlay-card p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
  font-weight: 500;
}

/* Animated waiting dots */

#lobby-msg::after {
  content: '';
  animation: waitDots 1.5s steps(4) infinite;
}

/* Lobby player badges */

#lobby-players {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

.countdown-num {
  font-size: 80px;
  font-weight: 700;
  line-height: 1;
  margin: 16px 0;
  font-family: 'Rajdhani', sans-serif;
  color: var(--text);
}

.results-list {
  text-align: left;
  margin: 16px 0;
}

.results-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}

/* Top 3 with small colored indicator dot */
.results-row:first-child .r-rank::before,
.results-row:nth-child(2) .r-rank::before,
.results-row:nth-child(3) .r-rank::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.results-row:first-child .r-rank::before {
  background: #fbbf24;
}

.results-row:nth-child(2) .r-rank::before {
  background: #94a3b8;
}

.results-row:nth-child(3) .r-rank::before {
  background: #d97706;
}

.results-row:first-child {
  font-size: 15px;
  font-weight: 700;
}

.results-row .r-rank {
  min-width: 28px;
  font-weight: 700;
  color: var(--muted);
  font-size: 14px;
  font-family: 'Rajdhani', sans-serif;
}

.results-row:first-child .r-rank {
  color: var(--gold);
  font-size: 16px;
}

.results-row:nth-child(2) .r-rank {
  color: var(--silver);
}

.results-row:nth-child(3) .r-rank {
  color: var(--bronze);
}

.results-row .r-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.results-row .r-name {
  flex: 1;
  font-weight: 600;
}

.results-row .r-score {
  font-weight: 700;
  font-size: 14px;
  font-family: 'Rajdhani', sans-serif;
  color: var(--text);
}
