/* ---------- LEADERBOARD : best times carved in stone ---------- */
#modal { z-index: 52; }
.rv:not(.in) { pointer-events: none; }

.lb { width: min(560px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lb-crest { width: clamp(54px, 9vmin, 76px); aspect-ratio: 1; margin-top: -4px; }
.lb-crest svg { width: 100%; height: 100%; animation: spin 30s linear infinite; }
.lb-crest circle { fill: none; stroke: var(--gold-2); stroke-width: 1.2; }
.lb-crest circle + circle { stroke-dasharray: 3 4; }
.lb-crest path { fill: rgba(79,209,165,.12); stroke: var(--jade); stroke-width: 1.4; filter: drop-shadow(0 0 5px rgba(79,209,165,.7)); }
.lb-board { width: 100%; }

.end-scores {
  position: relative; width: min(520px, 100%); padding: clamp(12px, 2.4vh, 20px) clamp(12px, 3vw, 24px);
  background: linear-gradient(180deg, rgba(36,24,12,.82), rgba(16,10,5,.9));
  border: 1px solid var(--gold-2); border-radius: 6px;
  box-shadow: 0 0 0 4px rgba(16,10,5,.6), 0 0 0 5px rgba(224,180,90,.35), 0 20px 60px rgba(0,0,0,.6);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.end-scores::before { content: ""; position: absolute; left: 12%; right: 12%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, #c9ffe9, transparent); }
.lb-title {
  font-family: 'Cinzel Decorative', serif; color: var(--gold); font-size: clamp(16px, 2.6vw, 22px);
  text-shadow: 0 0 18px rgba(224,180,90,.45); display: flex; align-items: center; gap: .7em;
}
.lb-title::before, .lb-title::after { content: ""; width: clamp(24px, 6vw, 60px); height: 12px; background: var(--fret) repeat-x center / auto 10px; opacity: .7; }

.lb-head, .lb-row { display: grid; grid-template-columns: 3.2em 1fr auto; align-items: center; gap: 10px; }
.lb-head {
  padding: 0 12px 6px; border-bottom: 1px solid rgba(224,180,90,.25);
  font-family: 'Cinzel', serif; font-size: clamp(9px, 1.2vw, 11px); letter-spacing: .25em; text-transform: uppercase; color: var(--muted);
}
.lb-head span:last-child { text-align: right; }
.lb-list { list-style: none; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.lb-row {
  position: relative; padding: 6px 12px; border-radius: 4px;
  background: linear-gradient(90deg, rgba(58,40,20,.55), rgba(20,13,7,.35));
  border: 1px solid rgba(224,180,90,.12);
  opacity: 0; transform: translateX(-10px); animation: lbIn .5s ease var(--d) forwards;
}
.lb-row:nth-child(even) { background: linear-gradient(90deg, rgba(46,32,16,.45), rgba(20,13,7,.25)); }
@keyframes lbIn { to { opacity: 1; transform: none; } }
.lb-rank { position: relative; display: grid; place-items: center; width: 2.4em; height: 2.4em; }
.lb-rank b { position: relative; font-family: 'Cinzel', serif; font-weight: 700; color: var(--muted); font-size: clamp(13px, 1.8vw, 16px); }
.lb-rank svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 18s linear infinite; }
.lb-r1 .lb-rank svg { fill: #e0b45a; filter: drop-shadow(0 0 6px rgba(255,210,120,.8)); }
.lb-r2 .lb-rank svg { fill: #4fd1a5; filter: drop-shadow(0 0 6px rgba(79,209,165,.7)); }
.lb-r3 .lb-rank svg { fill: #b4672b; filter: drop-shadow(0 0 5px rgba(200,110,50,.6)); }
.lb-r1 .lb-rank b, .lb-r2 .lb-rank b, .lb-r3 .lb-rank b { color: #1a1005; }
.lb-r1 { border-color: rgba(224,180,90,.5); background: linear-gradient(90deg, rgba(120,84,30,.55), rgba(30,20,8,.35)); }
.lb-r1 .lb-time { color: #fff3c4; text-shadow: 0 0 12px rgba(224,180,90,.8); }
.lb-who { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); text-decoration: none; font-size: clamp(13px, 1.8vw, 16px); }
.lb-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-who img, .lb-me img { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--gold-2); flex: none; object-fit: cover; }
a.lb-who:hover span { color: var(--gold); }
.lb-time { font-family: 'Cinzel', serif; font-weight: 700; color: var(--gold); font-size: clamp(14px, 2vw, 18px); font-variant-numeric: tabular-nums; }
.lb-row.me { border-color: var(--jade); box-shadow: 0 0 0 1px var(--jade), 0 0 16px rgba(79,209,165,.45); }
.lb-row.me::after { content: ""; position: absolute; inset: 0; border-radius: 4px; pointer-events: none; background: linear-gradient(100deg, transparent 30%, rgba(201,255,233,.18) 50%, transparent 70%); background-size: 250% 100%; animation: lbShine 2.6s ease-in-out infinite; }
@keyframes lbShine { from { background-position: 150% 0; } to { background-position: -100% 0; } }

.lb-empty, .lb-loading, .lb-note { text-align: center; font-style: italic; color: var(--muted); padding: 14px 6px; font-size: clamp(13px, 1.8vw, 15px); line-height: 1.5; }
.lb-note { padding: 2px 6px; }
.lb-loading { display: flex; align-items: center; justify-content: center; gap: 10px; }
.lb-loading i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(224,180,90,.25); border-top-color: var(--gold); animation: spin .9s linear infinite; }

.lb-submit { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lb-form { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.lb-me { display: flex; align-items: center; gap: 8px; color: var(--text); }
.lb-name {
  font: inherit; font-size: clamp(14px, 1.9vw, 16px); color: var(--text); width: 11em; padding: .5em .9em;
  background: rgba(10,6,3,.7); border: 1px solid var(--gold-2); border-radius: 30px; outline: none; user-select: text; -webkit-user-select: text;
}
.lb-name:focus { border-color: var(--jade); box-shadow: 0 0 12px rgba(79,209,165,.45); }
.lb-form .pz-btn:disabled { opacity: .6; cursor: wait; }
.lb-msg { min-height: 1.2em; color: #f08a6c; font-size: 13px; font-style: italic; text-align: center; }
.lb-msg:empty { display: none; }
.lb-result { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: clamp(14px, 2vw, 17px); animation: popIn .5s cubic-bezier(.2,1.3,.5,1); }
.lb-place {
  font-family: 'Cinzel Decorative', serif; font-weight: 900; font-size: clamp(30px, 5vw, 44px); line-height: 1;
  background: linear-gradient(180deg, #e9fff5, #4fd1a5 55%, #1f7a5e); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px rgba(79,209,165,.7));
}
.lb-place sup { font-size: .4em; }
