/* Public strength leaderboard. Scoped so it does not touch the in-game board. */

.leaderboard-page {
  display: block;
  height: auto;
  min-height: 100vh;
  background-image: url("../images/whispering_winds_bg.png");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  color: #eaeaf5;
  --rarity-breezed: #6495ed;
  --rarity-zephyrian: #ba55d3;
  --rarity-tempest: #daa520;
  --rarity-breezed-rgb: 100, 149, 237;
  --rarity-zephyrian-rgb: 186, 85, 211;
  --rarity-tempest-rgb: 218, 165, 32;
}

.leaderboard-page .page-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.leaderboard-page h1,
.leaderboard-page h2,
.leaderboard-page h3 {
  font-family: "Cinzel", "Tangerine", serif;
  color: #ffd166;
  letter-spacing: 0.6px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.leaderboard-page h1 {
  text-align: center;
  font-size: 2rem;
  margin: 0 0 8px;
}

.leaderboard-page h1::before {
  content: "\2726";
  display: block;
  text-align: center;
  font-size: 14px;
  letter-spacing: 10px;
  margin-bottom: 8px;
  opacity: 0.75;
}

.site-leaderboard-lead,
.site-leaderboard-note,
.site-leaderboard-empty,
.site-leaderboard-notice {
  text-align: center;
  color: #eaeaf5;
  line-height: 1.5;
}

.site-leaderboard-panel,
.site-inspect {
  background: rgba(20, 22, 35, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  padding: 18px 20px 22px;
  margin-top: 22px;
}

.site-leaderboard-search {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
}

.site-leaderboard-search label {
  font-family: "Cinzel", serif;
  color: #ffd166;
  font-size: 0.95rem;
}

.site-leaderboard-search input {
  min-width: 220px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 209, 102, 0.45);
  background: rgba(8, 8, 16, 0.65);
  color: #eaeaf5;
  font-size: 1rem;
}

.site-leaderboard-search button,
.site-leaderboard-back {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 209, 102, 0.55);
  background: rgba(90, 24, 154, 0.55);
  color: #ffd166;
  font-family: "Cinzel", serif;
  cursor: pointer;
  text-decoration: none;
}

.site-leaderboard-search button:hover,
.site-leaderboard-back:hover {
  background: rgba(90, 24, 154, 0.8);
  color: #ffffff;
}

.site-leaderboard-notice {
  margin-top: 14px;
  color: #ffd166;
}

.site-leaderboard-table-wrap {
  overflow-x: auto;
}

.site-leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.site-leaderboard-table th,
.site-leaderboard-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-leaderboard-table th {
  font-family: "Cinzel", serif;
  color: #ffd166;
  font-weight: 700;
  font-size: 0.85rem;
}

.site-leaderboard-table td {
  color: #eaeaf5;
}

.site-leaderboard-table a {
  color: #ffd166;
  font-weight: 700;
  text-decoration: none;
}

.site-leaderboard-table a:hover {
  color: #ffffff;
}

.site-leaderboard-table tr.is-current td {
  background: rgba(255, 209, 102, 0.08);
}

.site-leaderboard-table td.site-leaderboard-rank-1 { color: #daa520; }
.site-leaderboard-table td.site-leaderboard-rank-2 { color: #d9d9d9; }
.site-leaderboard-table td.site-leaderboard-rank-3 { color: #cd853f; }

.site-leaderboard-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.site-leaderboard-how {
  margin-top: 16px;
  color: #d7d7e6;
  font-size: 0.95rem;
}

.site-leaderboard-how summary {
  cursor: pointer;
  color: #ffd166;
  font-family: "Cinzel", serif;
}

.site-leaderboard-how ul {
  margin: 8px auto 0;
  max-width: 640px;
  text-align: left;
}

.site-inspect-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.site-inspect-status {
  color: #cfcfd9;
  font-size: 0.95rem;
}

.site-inspect-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-top: 12px;
}

.site-inspect-identity {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-right: 16px;
  border-right: 1px solid rgba(139, 119, 64, 0.35);
}

.site-inspect-portrait-frame {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 3px solid #8b7740;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(139, 119, 64, 0.3);
  background: rgba(0, 0, 0, 0.35);
}

.site-inspect-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-inspect-facts {
  width: 100%;
  margin-top: 14px;
}

.site-inspect-fact,
.site-inspect-stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-inspect-fact span:first-child,
.site-inspect-stat strong {
  color: #c9b896;
  font-weight: 600;
}

.site-inspect-flavor {
  margin-top: 12px;
  font-family: "Crimson Text", Georgia, serif;
  font-style: italic;
  color: #e8dcc8;
  text-align: center;
}

.site-inspect-equipment {
  flex: 0 0 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.site-inspect-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.site-inspect-slot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.site-inspect-slot-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #c9b896;
}

.site-inspect-slot {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 2px solid rgba(139, 119, 64, 0.55);
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(234, 234, 245, 0.35);
  font-size: 10px;
  text-align: center;
  padding: 4px;
}

.site-inspect-slot.is-large {
  width: 76px;
  height: 76px;
}

.site-inspect-slot.is-small {
  width: 54px;
  height: 54px;
}

.site-inspect-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.site-inspect-slot.is-breezed {
  border: 3px solid var(--rarity-breezed);
  box-shadow: 0 0 16px rgba(var(--rarity-breezed-rgb), 0.85);
}

.site-inspect-slot.is-zephyrian {
  border: 3px solid var(--rarity-zephyrian);
  box-shadow: 0 0 16px rgba(var(--rarity-zephyrian-rgb), 0.85);
}

.site-inspect-slot.is-tempest {
  border: 3px solid var(--rarity-tempest);
  box-shadow: 0 0 16px rgba(var(--rarity-tempest-rgb), 0.9);
}

.site-inspect-slot.is-ethereal {
  border: 2px solid #e7f4ff;
  box-shadow:
    0 0 0 1px rgba(143, 180, 212, 0.95),
    0 0 18px 4px rgba(176, 210, 235, 0.75);
}

.site-inspect-slot.is-tuned::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9370db;
  box-shadow: 0 0 6px #9370db;
}

.site-inspect-rank {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 11px;
  font-weight: 700;
  color: #e7f4ff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.site-inspect-divider {
  width: 80%;
  height: 1px;
  background: rgba(139, 119, 64, 0.45);
  margin: 4px 0;
}

.site-inspect-sheet {
  margin-top: 18px;
  padding-top: 8px;
  border-top: 1px solid rgba(139, 119, 64, 0.35);
}

.site-inspect-sheet-note {
  color: #cfcfd9;
  font-size: 0.92rem;
  margin: 0 0 10px;
}

.site-inspect-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 28px;
}

.site-inspect-section-title {
  margin: 12px 0 6px;
  font-size: 1rem;
}

.leaderboard-page .char-stat-display {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.leaderboard-page .char-stat-value-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.leaderboard-page .char-stat-total,
.leaderboard-page .char-stat-base {
  font-weight: 600;
  color: #e8dcc8;
}

.leaderboard-page .char-stat-bonus-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
}

.leaderboard-page .char-stat-bonus {
  font-family: "Crimson Text", Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
  line-height: 1.35;
}

.leaderboard-page .char-stat-bonus.is-equipment {
  background: rgba(50, 205, 50, 0.12);
  border: 1px solid rgba(50, 205, 50, 0.4);
  color: #7ddf7d;
}

.leaderboard-page .char-stat-bonus.is-tuning {
  background: rgba(147, 112, 219, 0.14);
  border: 1px solid rgba(147, 112, 219, 0.45);
  color: #c9a0f0;
}

.leaderboard-page .char-stat-bonus.is-negative {
  background: rgba(205, 92, 92, 0.14);
  border: 1px solid rgba(205, 92, 92, 0.45);
  color: #e88a8a;
}

.leaderboard-page .char-stat-bonus.is-buff {
  background: rgba(65, 105, 225, 0.14);
  border: 1px solid rgba(65, 105, 225, 0.45);
  color: #8eb4ff;
}

.site-inspect-tip {
  position: relative;
}

.site-inspect-tip-body {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 5;
  width: 240px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #8b7740;
  background: #1e1810;
  color: #e8dcc8;
  font-weight: 400;
  white-space: pre-line;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.site-inspect-tip:hover .site-inspect-tip-body,
.site-inspect-tip:focus .site-inspect-tip-body,
.site-inspect-tip:focus-within .site-inspect-tip-body {
  display: block;
}

.site-inspect-stones {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-inspect-stones ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.site-inspect-stones li {
  display: flex;
  gap: 16px;
  padding: 3px 0;
}

.site-inspect-stones-slot {
  flex: 0 0 96px;
  color: #c9a84c;
}

.site-inspect-stones-names {
  color: #e8dcc8;
}

.site-inspect-tip-stones {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.site-inspect-tip-stones-title,
.site-inspect-tip-stone {
  color: #c9a84c;
}

.site-inspect-tip-stones-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.site-inspect-tip-stone {
  padding-left: 8px;
}

.site-inspect-tip-stone-detail {
  color: #b5a890;
  font-size: 11px;
  padding-left: 16px;
  margin-bottom: 4px;
}

.site-inspect-score {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-inspect-score ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.site-inspect-score li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-variant-numeric: tabular-nums;
}

.site-inspect-tooltip {
  display: none;
  position: fixed;
  z-index: 40;
  min-width: 180px;
  max-width: 260px;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  padding: 8px 10px;
  border: 2px solid #8b7740;
  border-radius: 6px;
  background: linear-gradient(180deg, #2a2218 0%, #1e1810 40%, #16120c 100%);
  color: #e8dcc8;
  font-family: "Crimson Text", Georgia, serif;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.site-inspect-tooltip.is-visible {
  display: block;
}

.site-inspect-tooltip img {
  width: 72px;
  height: 72px;
  display: block;
  margin: 4px auto;
  object-fit: contain;
}

.site-inspect-tip-type,
.site-inspect-tip-line {
  margin-top: 4px;
}

.site-inspect-tooltip em {
  color: rgba(201, 168, 76, 0.85);
  font-size: 11px;
}

@media (max-width: 800px) {
  .site-inspect-layout {
    flex-direction: column;
    align-items: center;
  }

  .site-inspect-identity {
    border-right: none;
    border-bottom: 1px solid rgba(139, 119, 64, 0.35);
    padding-right: 0;
    padding-bottom: 14px;
    width: 100%;
  }

  .site-inspect-equipment {
    flex-basis: auto;
  }

  .site-inspect-stat-grid {
    grid-template-columns: 1fr;
  }
}
