/* RESULTS SCREEN — modal on black bg, with top-5 leaderboard */
#screen-results {
  --yellow: #EEFF41;
  --black: #111111;
  background: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 8cqh, 160px) clamp(20px, 5cqi, 64px);
  cursor: pointer;
}

/* ── Modal ── */
.results-modal {
  width: min(94%, 920px);
  border-radius: 6px;
  padding: clamp(28px, 5cqh, 80px) clamp(24px, 5cqi, 80px);
  background: #ffffff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(8px, 1.5cqh, 24px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.results-modal.is-win  { background: var(--yellow); }
.results-modal.is-lose { background: #ffffff; }

#screen-results.active .results-modal {
  animation: resultsModalIn 0.55s cubic-bezier(0.2, 1.2, 0.3, 1) both;
}

@keyframes resultsModalIn {
  0%   { transform: scale(0.6) translateY(40px); opacity: 0; }
  60%  { transform: scale(1.04) translateY(0);    opacity: 1; }
  100% { transform: scale(1)    translateY(0);    opacity: 1; }
}

/* ── Title + sub ── */
.results-title {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(40px, 9cqi, 116px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--black);
}

.results-sub {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(15px, 3cqi, 36px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--black);
}

/* ── Leaderboard ── */
.results-board {
  list-style: none;
  margin: clamp(16px, 3cqh, 40px) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4cqh, 22px);
}

.results-row {
  display: grid;
  grid-template-columns: clamp(28px, 5cqi, 64px) 1fr auto;
  align-items: center;
  gap: clamp(10px, 2cqi, 28px);
  padding: clamp(12px, 2.4cqh, 30px) clamp(16px, 3cqi, 36px);
  border: 2px solid var(--black);
  border-radius: 6px;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(14px, 2.6cqi, 32px);
  color: var(--black);
  text-align: left;
}

.results-row.is-player {
  background: var(--black);
  color: #ffffff;
  border-color: var(--black);
}

.results-rank,
.results-score {
  font-feature-settings: "tnum" 1;
}

.results-score { text-align: right; }

/* ── Tap to restart caption ── */
.results-tap {
  margin: clamp(28px, 5cqh, 80px) 0 0;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(15px, 2.6cqi, 32px);
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  animation: resultsTapPulse 1.8s ease-in-out infinite;
}

@keyframes resultsTapPulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #screen-results.active * { animation: none !important; }
}
