/* tt-leaderboard.css — shared global-leaderboard widget (window.TTLeaderboardUI).
   Self-contained, theme-neutral card so it reads on both light and dark game
   result screens. All selectors are scoped under .tt-lb. */
.tt-lb {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
  margin: 18px auto;
  text-align: left;
  background: #ffffff;
  border: 1px solid #e3e1d8;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #2b2b2b;
}
.tt-lb *, .tt-lb *::before, .tt-lb *::after { box-sizing: border-box; }

.tt-lb-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 16px;
}
.tt-lb-title {
  display: flex; flex-direction: column; gap: 2px;
  font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: #1c1c1e;
}
.tt-lb-sub {
  color: #9a978c; font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.tt-lb-refresh {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0; font-size: 15px; line-height: 1;
  background: #f6f4ed; border: 1px solid #ebe8dd; border-radius: 9px;
  color: #8a877c; cursor: pointer; touch-action: manipulation; transition: all .18s ease;
}
.tt-lb-refresh:hover { background: #eef3fa; border-color: #cfe0f3; color: #185FA5; transform: rotate(45deg); }
.tt-lb-refresh:active { transform: rotate(180deg); }

/* Post row — score chip + name/submit pairing */
.tt-lb-post {
  display: flex; gap: 12px; align-items: stretch; margin-bottom: 14px;
}
.tt-lb-score-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0; min-width: 74px; padding: 8px 14px;
  background: linear-gradient(160deg, #f4f8fd 0%, #eaf1fa 100%);
  border: 1px solid #d7e4f4; border-radius: 12px;
}
.tt-lb-score-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; color: #185FA5;
}
.tt-lb-score-cap {
  margin-top: 4px; font-size: 10px; font-weight: 600; color: #7d96b4;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.tt-lb-entry { display: flex; flex: 1; min-width: 0; gap: 8px; align-items: center; }
.tt-lb-name {
  flex: 1; min-width: 0; height: 100%;
  font-family: inherit; font-size: 14px; color: #2b2b2b;
  padding: 10px 13px; border: 1px solid #ddd9cd; border-radius: 10px; background: #faf8f1;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.tt-lb-name::placeholder { color: #b3b0a4; }
.tt-lb-name:focus {
  outline: none; border-color: #185FA5; background: #fff;
  box-shadow: 0 0 0 3px rgba(24, 95, 165, 0.12);
}
.tt-lb-submit {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  font-family: inherit; font-size: 14px; font-weight: 600; color: #fff;
  padding: 10px 16px; border: none; border-radius: 10px; cursor: pointer; touch-action: manipulation;
  background: #185FA5;
  box-shadow: 0 1px 2px rgba(24, 95, 165, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background .18s ease, transform .12s ease, box-shadow .18s ease;
}
.tt-lb-submit:hover { background: #14528f; box-shadow: 0 4px 12px rgba(24, 95, 165, 0.3); }
.tt-lb-submit:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(24, 95, 165, 0.25); }
.tt-lb-submit:disabled { opacity: .55; cursor: default; box-shadow: none; transform: none; }
.tt-lb-submit-score {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700; padding: 1px 7px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
}
.tt-lb-posted {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 500; color: #14794f;
  background: linear-gradient(160deg, #f1fbf6 0%, #e8f7f0 100%);
  border: 1px solid #bfe7d4; padding: 11px 14px; border-radius: 12px;
}
.tt-lb-posted-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; flex-shrink: 0; font-size: 13px; font-weight: 700;
  color: #fff; background: #1D9E75; border-radius: 50%;
}
.tt-lb-posted-text strong { font-weight: 700; color: #0f5e3e; }
.tt-lb-status { font-size: 12px; color: #888; margin-bottom: 10px; }
.tt-lb-status:empty { display: none; }
.tt-lb-status.err { color: #C03A39; }

.tt-lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tt-lb-row {
  display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 10px; background: #faf8f1; border: 1px solid #ede9da; border-radius: 8px;
}
.tt-lb-row.me { background: #eef3fa; border-color: #C7DBF1; }
.tt-lb-rank { font-weight: 800; font-size: 14px; color: #777; text-align: center; }
.tt-lb-player { font-size: 14px; color: #2b2b2b; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-lb-row.me .tt-lb-player { color: #185FA5; }
.tt-lb-tag { color: #9a978c; font-weight: 700; font-size: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tt-lb-score { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; font-weight: 800; color: #2b2b2b; }
.tt-lb-loading, .tt-lb-empty { font-size: 13px; color: #999; padding: 8px 10px; font-style: italic; }

@media (max-width: 540px) {
  .tt-lb-post { flex-direction: column; gap: 10px; }
  .tt-lb-score-chip {
    flex-direction: row; gap: 8px; width: 100%; min-width: 0;
    justify-content: center; padding: 8px 14px;
  }
  .tt-lb-score-num { font-size: 22px; }
  .tt-lb-score-cap { margin-top: 0; }
  .tt-lb-entry { width: 100%; }
  .tt-lb-submit { justify-content: center; }
}
