#result {
  background: #000;
  justify-content: center;
  align-items: center;
  padding: clamp(40px, 6vh, 80px) clamp(20px, 5vw, 40px);
  cursor: pointer;
}

/* ── Modal (no pop-in animation per client request) ── */
.result-modal {
  width: min(88%, 480px);
  background: var(--white);
  padding: clamp(28px, 5vw, 44px) clamp(20px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(10px, 2vw, 14px);
}

#result.win .result-modal { background: #EEFF41; }

/* ── Title / sub ── */
.result-title {
  font-family: var(--display-font);
  font-weight: 800;
  font-size: clamp(38px, 9vw, 60px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: #000;
  margin: 0;
  /* fade-up animation removed with modal pop */
}

.result-sub {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: clamp(14px, 3.4vw, 20px);
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: #000;
  margin: 0 0 clamp(10px, 2vw, 16px);
  /* fade-up animation removed */
}

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

/* ── Leaderboard rows ── */
.result-lb-rows {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.6vw, 12px);
}

.lb-row {
  display: flex;
  align-items: center;
  padding: clamp(12px, 2.4vw, 16px) clamp(14px, 3vw, 22px);
  border: 3px solid #000;
  border-radius: 4px;
  font-family: var(--display-font);
  font-weight: 600;
  font-size: clamp(14px, 3.2vw, 18px);
  color: #000;
  background: transparent;
  letter-spacing: 0;
  line-height: 1;
  /* Each row drops in one after the other (cascade in) */
  opacity: 0;
  animation: lb-row-in 0.5s cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

.lb-row:nth-child(1) { animation-delay: 0.20s; }
.lb-row:nth-child(2) { animation-delay: 0.36s; }
.lb-row:nth-child(3) { animation-delay: 0.52s; }
.lb-row:nth-child(4) { animation-delay: 0.68s; }
.lb-row:nth-child(5) { animation-delay: 0.84s; }
.lb-row:nth-child(6) { animation-delay: 1.00s; }

@keyframes lb-row-in {
  0%   { opacity: 0; transform: translateX(-24px) scale(0.96); }
  60%  { opacity: 1; transform: translateX(2px)   scale(1.01); }
  100% { opacity: 1; transform: translateX(0)     scale(1);    }
}

/* "You" row gets an extra emphasis pulse after it lands */
.lb-row.you {
  animation: lb-row-in 0.5s cubic-bezier(0.2, 0.85, 0.25, 1) both,
             lb-row-you-flash 0.6s 1.1s ease-out both;
}

@keyframes lb-row-you-flash {
  0%   { box-shadow: 0 0 0 0 rgba(238, 255, 65, 0); }
  40%  { box-shadow: 0 0 0 10px rgba(238, 255, 65, 0.55); }
  100% { box-shadow: 0 0 0 0 rgba(238, 255, 65, 0); }
}

.lb-row.you {
  background: #000;
  color: #fff;
  font-weight: 700;
  border-color: #000;
}

.lb-rank {
  width: 2.4em;
  flex-shrink: 0;
  text-align: left;
}

.lb-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: left;
}

.lb-pts {
  min-width: 3em;
  text-align: right;
}

.lb-sep { display: none; }

/* ── "Tap anywhere to restart" hint (sits just below the modal, not at bottom) ── */
.result-tap {
  margin-top: clamp(28px, 5vh, 56px);
  font-family: var(--display-font);
  font-weight: 700;
  font-size: clamp(16px, 3.4vw, 22px);
  letter-spacing: 0;
  color: #6B7373;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-out;
}

#result.tap-ready .result-tap {
  opacity: 0.7;
  animation: resultTapPulse 2.4s ease-in-out infinite;
}

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

/* Block taps on the screen until the hint shows up */
#result { pointer-events: none; }
#result.tap-ready { pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  .result-modal,
  .result-title,
  .result-sub,
  .result-lb-rows,
  .lb-row,
  .lb-row.you,
  .result-tap {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ── Kiosk 1080×1920 (slightly scaled down) ── */
@media (orientation: portrait) and (min-width: 1000px) and (min-height: 1700px) {
  #result {
    padding: 56px 56px;
  }
  .result-modal {
    width: min(80%, 760px);
    padding: 68px 56px;
    gap: 20px;
    border-radius: 6px;
  }
  .result-title    { font-size: clamp(82px, 7.2vw, 112px); }
  .result-sub      { font-size: clamp(24px, 2.2vw, 32px); margin-bottom: 24px; }
  .lb-row          { font-size: 24px; padding: 20px 30px; border-width: 4px; border-radius: 6px; }
  .lb-rank         { width: 2.6em; }
  .result-tap      { font-size: clamp(24px, 2.2vw, 32px); }
}
