/* The leaderboard as a game screen (views/toplistPartial.jsx): the
   trophy-hall frame from public/achievements-hall.css, the top three on a
   podium under their banners, the rest in a stone panel with a small banner
   beside each name. Theme tokens are re-pointed inside the hall so the older
   pieces from public/toplist.css read light-on-dark in both themes. */

.lb-hall.toplist-wrapper {
  width: auto;
  max-width: none;
  margin: 0;
  font-family: "Comfortaa", sans-serif;
  --text: #f6e9cc;
  --cloud-bg2: transparent;
  --lb-gold: #ffd23a;
  --lb-ink-dim: #d4c39f;
  --lb-edge: rgba(255, 220, 160, 0.16);
  --lb-panel: rgba(18, 14, 10, 0.62);
}
.lb-hall .lb-frame { max-width: 860px; padding: 16px 20px 22px; }

/* ── Header ── */
.lb-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
}
.lb-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 clamp(1.3rem, 1rem + 1.2vw, 1.8rem)/1.1 "Cinzel", serif;
  letter-spacing: 0.04em;
  color: #ffe9b0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
}
.lb-title i { color: var(--lb-gold); }
.lb-head-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lb-your-rating {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 210, 58, 0.4);
}
.lb-your-rating i { grid-row: span 2; color: var(--lb-gold); font-size: 1.1rem; }
.lb-your-rating b { font: 700 1.1rem/1.1 "Cinzel", serif; color: #fff; }
.lb-your-rating span {
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lb-ink-dim);
}
.lb-subscribe {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(200, 150, 12, 0.55);
  background: linear-gradient(180deg, rgba(48, 44, 40, 0.92), rgba(22, 20, 18, 0.95));
  color: var(--text);
  font: 700 0.82rem/1 "Comfortaa", sans-serif;
  cursor: pointer;
}
.lb-subscribe i { color: var(--lb-gold); }
.lb-subscribe:hover { border-color: rgba(230, 206, 106, 0.9); color: #fff; }

/* ── Period tabs ── */
.lb-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--lb-edge);
}
.lb-tab {
  padding: 9px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--lb-ink-dim);
  font: 700 0.85rem/1 "Cinzel", serif;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.lb-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.lb-tab.active {
  background: linear-gradient(180deg, #ffe48a 0%, #f0b52e 55%, #c98a12 100%);
  border-color: #7a5310;
  color: #3d2000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 0 #6b4410;
}
.lb-description {
  margin: 10px 0 4px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--lb-ink-dim);
}

/* ── Podium ── */
.lb-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  max-width: 620px;
  margin: 14px auto 16px;
}
.lb-podium-1 { grid-template-columns: minmax(0, 220px); justify-content: center; }
.lb-podium-2 { grid-template-columns: repeat(2, minmax(0, 220px)); justify-content: center; }
.lb-step { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.lb-step-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 4px 8px;
  min-width: 0;
}
.lb-step-medal { font-size: 1.2rem; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.lb-gold .lb-step-medal { color: #ffd23a; font-size: 1.5rem; }
.lb-silver .lb-step-medal { color: #d8dde3; }
.lb-bronze .lb-step-medal { color: #d98c4a; }
.lb-step-crest svg,
.lb-step-crest img {
  width: 64px;
  height: auto;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.6));
}
.lb-gold .lb-step-crest svg,
.lb-gold .lb-step-crest img { width: 84px; }
.lb-step-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 0.98rem/1.2 "Cinzel", serif;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.lb-step-name:hover { color: #ffe27a; }
.lb-step-meta { display: flex; align-items: center; gap: 6px; min-height: 0; }
.lb-step-meta:empty { display: none; }
.lb-step-rating { display: flex; align-items: baseline; gap: 6px; }
.lb-step-rating b { font: 700 1.05rem/1 "Cinzel", serif; color: #ffe27a; }
.lb-step-rating .toplist-change { font-size: 0.8rem; font-weight: 700; }
.lb-step-block {
  display: grid;
  place-items: center;
  border-radius: 8px 8px 2px 2px;
  border: 1px solid rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), inset 0 -6px 12px rgba(0, 0, 0, 0.35), 0 6px 12px rgba(0, 0, 0, 0.45);
  font: 800 1.15rem/1 "Cinzel", serif;
  color: rgba(0, 0, 0, 0.6);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.lb-gold .lb-step-block { height: 92px; background: linear-gradient(180deg, #ffe48a, #c98a12); }
.lb-silver .lb-step-block { height: 66px; background: linear-gradient(180deg, #eef1f4, #9aa3ad); }
.lb-bronze .lb-step-block { height: 48px; background: linear-gradient(180deg, #f0b07a, #9a5a24); }
.lb-step.is-player .lb-step-block { outline: 2px solid #7ee07e; outline-offset: 2px; }

/* ── Table ── */
.lb-table-panel {
  border-radius: 12px;
  background: var(--lb-panel);
  border: 1px solid var(--lb-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.lb-hall .toplist-table { box-shadow: none; border-radius: 0; background: none; }
.lb-hall .toplist-table thead { background: rgba(0, 0, 0, 0.35); }
.lb-hall .toplist-table th {
  padding: 10px 12px;
  font: 700 0.75rem/1 "Cinzel", serif;
  letter-spacing: 0.08em;
  color: var(--lb-ink-dim);
}
.lb-hall .toplist-table td {
  padding: 8px 12px;
  border-bottom-color: var(--lb-edge);
  color: var(--text);
}
.lb-hall .toplist-table tbody tr:hover { background: rgba(255, 210, 58, 0.06); }
.lb-hall .toplist-row.is-player { background: rgba(126, 224, 126, 0.1); box-shadow: inset 3px 0 0 #7ee07e; }
.lb-rank-num { font-family: "Cinzel", serif; color: var(--lb-ink-dim); }
.lb-player-cell { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.lb-row-crest { flex: none; }
.lb-row-crest svg,
.lb-row-crest img { width: 26px; height: auto; }
.lb-row-crest-empty { display: inline-block; width: 26px; height: 30px; }
.lb-hall .toplist-player-link { color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-hall .toplist-player-link:hover { color: #ffe27a; }
.lb-hall .toplist-rating { font-family: "Cinzel", serif; font-weight: 700; color: #ffe27a; }
.lb-hall .toplist-separator-cell { color: var(--lb-ink-dim); opacity: 1; }
.lb-unranked {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--lb-ink-dim);
}
.lb-unranked i { color: var(--lb-gold); }
.lb-hall .lb-empty { color: var(--text); }
.lb-hall .lb-empty i { color: var(--lb-gold); }

/* ── Discord servers ── */
.lb-hall .guild-section {
  margin-top: 18px;
  padding: 16px;
  border-radius: 12px;
  background: var(--lb-panel);
  border: 1px solid var(--lb-edge);
}
.lb-hall .guild-section-title { font-family: "Cinzel", serif; color: var(--text); }
.lb-hall .guild-section-desc,
.lb-hall .guild-rank,
.lb-hall .guild-members { color: var(--lb-ink-dim); opacity: 1; }
.lb-hall .guild-name { color: var(--text); }
.lb-hall .guild-card { background: rgba(0, 0, 0, 0.3); border-color: var(--lb-edge); }

@media (max-width: 600px) {
  .lb-hall.ach-hall { padding: 16px 6px 28px; }
  .lb-hall .lb-frame { padding: 12px 10px 16px; }
  .lb-tab { font-size: 0.78rem; padding: 8px 2px; }
  .lb-podium { gap: 6px; }
  .lb-step-crest svg, .lb-step-crest img { width: 50px; }
  .lb-gold .lb-step-crest svg, .lb-gold .lb-step-crest img { width: 64px; }
  .lb-step-name { font-size: 0.82rem; }
  .lb-gold .lb-step-block { height: 72px; }
  .lb-silver .lb-step-block { height: 52px; }
  .lb-bronze .lb-step-block { height: 38px; }
  .lb-hall .toplist-table th, .lb-hall .toplist-table td { padding: 8px 6px; }
  .lb-hall .toplist-player-link { max-width: 42vw; }
}

/* Collapsed borders rounded the row lines a pixel apart between the name and
   rating columns (the banner makes rows a fractional height). */
.lb-hall .toplist-table { border-collapse: separate; border-spacing: 0; }
.lb-hall .toplist-table td { vertical-align: middle; }
.lb-hall .toplist-table tbody tr:last-child td { border-bottom: 0; }
.lb-hall .toplist-separator-row td {
  padding: 5px 12px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--lb-ink-dim);
  opacity: 0.8;
}
.lb-tab { white-space: nowrap; }
.lb-hall .guild-members { flex-wrap: wrap; }
@media (max-width: 600px) {
  .lb-tab { font-size: 0.72rem; letter-spacing: 0; }
}
.lb-hall .toplist-change.positive { color: #7ee07e; }
.lb-hall .toplist-change.negative { color: #ff8a7a; }
