/* assets/games/leaderboard.css — shared arcade leaderboard overlay (ArcadeLB).
 * Loaded by the standalone game pages (johnpork, sahur-run). Everything is
 * lb-prefixed: the parent about.html injects !important styles into embedded
 * game iframes for #wrap/#canvas-wrap/#c/#hud/.back-link, so those names are
 * off-limits here. Per-game tint comes from --lb-accent/--lb-accent2 set by
 * ArcadeLB.init on the overlay root. */

.lb-overlay {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 12, .58);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}
.lb-overlay[hidden] { display: none; }

.lb-card {
  width: min(340px, 100%);
  max-height: 100%;
  display: flex; flex-direction: column;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(16, 24, 38, .94), rgba(5, 9, 18, .9));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px rgba(255, 255, 255, .1);
  color: #fff;
  animation: lb-pop .22s ease;
}
@keyframes lb-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .lb-card { animation: none; } }

.lb-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 16px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.lb-title {
  font-size: 11px; font-weight: 850; letter-spacing: .16em;
  text-transform: uppercase; color: var(--lb-accent, #ffd76a);
}
.lb-close {
  appearance: none; border: 1px solid rgba(255, 255, 255, .18); cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%; padding: 0;
  display: grid; place-items: center;
  color: rgba(255, 255, 255, .82); background: rgba(255, 255, 255, .07);
  font: 700 12px/1 inherit;
}
.lb-close:hover { background: rgba(255, 255, 255, .16); }

.lb-body { padding: 14px 14px 4px; overflow-y: auto; scrollbar-width: thin; }
.lb-note {
  margin: 4px 2px 10px; text-align: center;
  color: rgba(255, 255, 255, .55); font-size: 11px; line-height: 1.5;
}

/* --- Podium: visual order 2 | 1 | 3, #1 raised --- */
.lb-podium {
  display: grid; grid-template-columns: 1fr 1.15fr 1fr;
  align-items: end; gap: 7px; margin-bottom: 12px;
}
.lb-pod {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 5px 8px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .05);
  min-width: 0;
}
.lb-pod--1 { order: 2; padding-top: 12px; padding-bottom: 14px; background: rgba(255, 255, 255, .085); border-color: rgba(255, 255, 255, .18); }
.lb-pod--2 { order: 1; }
.lb-pod--3 { order: 3; }
.lb-medal { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.lb-pod--1 .lb-medal { width: 54px; height: 54px; }
.lb-pod-name {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; font-weight: 800; letter-spacing: .01em;
}
.lb-pod--1 .lb-pod-name { font-size: 13px; }
.lb-pod-score {
  font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums;
  color: var(--lb-accent, #ffd76a);
}
.lb-pod--1 .lb-pod-score { font-size: 16px; }
.lb-pod.is-you { outline: 1.5px solid var(--lb-accent, #ffd76a); outline-offset: -1.5px; }
.lb-pod.is-empty { opacity: .38; }

/* --- Ranks 4+ --- */
.lb-rows { list-style: none; margin: 0; padding: 0; }
.lb-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: 10px;
  font-size: 12px;
}
.lb-row:nth-child(odd) { background: rgba(255, 255, 255, .04); }
.lb-row.is-you { background: color-mix(in srgb, var(--lb-accent, #ffd76a) 16%, transparent); }
.lb-rank {
  min-width: 20px; text-align: right;
  color: rgba(255, 255, 255, .42); font-weight: 800;
  font-variant-numeric: tabular-nums; font-size: 10px;
}
.lb-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.lb-row-score { font-weight: 900; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .85); }

/* --- Footer: save form / identity --- */
.lb-foot { padding: 10px 14px 13px; border-top: 1px solid rgba(255, 255, 255, .09); }
.lb-save { display: flex; flex-direction: column; gap: 7px; }
.lb-save[hidden], .lb-me[hidden] { display: none; }
.lb-save-note { color: rgba(255, 255, 255, .72); font-size: 11px; }
.lb-save-row { display: flex; gap: 7px; }
.lb-name {
  flex: 1; min-width: 0; appearance: none;
  border: 1px solid rgba(255, 255, 255, .2); border-radius: 11px;
  padding: 9px 11px; font: 700 13px/1 inherit; color: #fff;
  background: rgba(255, 255, 255, .07); outline: none;
}
.lb-name:focus { border-color: var(--lb-accent, #ffd76a); }
.lb-name::placeholder { color: rgba(255, 255, 255, .35); font-weight: 600; }
.lb-submit {
  appearance: none; border: 0; cursor: pointer; border-radius: 11px;
  padding: 9px 15px; font: 850 12px/1 inherit; letter-spacing: .05em;
  text-transform: uppercase; color: #17110a;
  background: linear-gradient(180deg, var(--lb-accent2, #fff2d3), var(--lb-accent, #ffd76a));
  box-shadow: inset 0 1px rgba(255, 255, 255, .6), 0 4px 12px rgba(0, 0, 0, .35);
}
.lb-submit:disabled { opacity: .55; cursor: default; }
.lb-hint { color: rgba(255, 255, 255, .4); font-size: 9.5px; letter-spacing: .03em; }
.lb-me { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: rgba(255, 255, 255, .72); }
.lb-me-name { color: #fff; font-weight: 850; }
.lb-me-best { color: rgba(255, 255, 255, .5); }
.lb-switch {
  appearance: none; border: 0; cursor: pointer; margin-left: auto;
  padding: 4px 8px; border-radius: 999px;
  color: rgba(255, 255, 255, .65); background: rgba(255, 255, 255, .08);
  font: 700 9.5px/1 inherit; letter-spacing: .06em; text-transform: uppercase;
}
.lb-switch:hover { background: rgba(255, 255, 255, .16); color: #fff; }
/* Share pill: same language as .lb-switch, tinted with the game accent. It
 * takes the auto margin when visible so Share + Switch group on the right;
 * when hidden, .lb-switch's own auto margin resumes. */
.lb-share {
  appearance: none; border: 0; cursor: pointer; margin-left: auto;
  padding: 4px 8px; border-radius: 999px;
  color: var(--lb-accent, #ffd76a);
  background: color-mix(in srgb, var(--lb-accent, #ffd76a) 14%, transparent);
  font: 700 9.5px/1 inherit; letter-spacing: .06em; text-transform: uppercase;
}
.lb-share:hover { background: color-mix(in srgb, var(--lb-accent, #ffd76a) 26%, transparent); }
.lb-share[hidden] { display: none; }
.lb-share:not([hidden]) + .lb-switch { margin-left: 0; }
.lb-status { margin: 7px 0 0; min-height: 13px; font-size: 10.5px; color: var(--lb-accent, #ffd76a); }
.lb-status:empty { margin: 0; min-height: 0; }

/* --- Trigger pill used by the games on their start/pause/over screens --- */
.lb-open-btn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--lb-accent, #ffd76a) 55%, transparent);
  color: var(--lb-accent, #ffd76a);
  background: color-mix(in srgb, var(--lb-accent, #ffd76a) 12%, rgba(4, 8, 16, .5));
  font: 800 10.5px/1 inherit; letter-spacing: .1em; text-transform: uppercase;
  backdrop-filter: blur(8px);
  transition: transform .14s ease, background .14s ease;
}
.lb-open-btn::before { content: "\1F3C6"; font-size: 12px; }
.lb-open-btn:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--lb-accent, #ffd76a) 22%, rgba(4, 8, 16, .5)); }
@media (prefers-reduced-motion: reduce) { .lb-open-btn { transition: none; } }
