/* BiteFlip Trending — leaderboard styles. Extends swipe.css dark theme. */

/* ── Header extras ── */
.refresh-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.4s;
}
.refresh-btn:hover { background: var(--surface-2); }
.refresh-btn:active { transform: rotate(180deg); }

/* ── Loading ── */
.trending-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Leaderboard list ── */
.page-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 0 16px;
}

.leaderboard {
  list-style: none;
  margin: 0;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
  border: 1px solid transparent;
}
.leaderboard-item:hover {
  background: var(--surface-2);
  border-color: #333;
}
.leaderboard-item:active {
  transform: scale(0.985);
}

/* ── Rank badge ── */
.rank-badge {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text-muted);
}
.rank-badge.rank-gold   { background: linear-gradient(135deg, #b8860b, #f5c518); color: #111; }
.rank-badge.rank-silver { background: linear-gradient(135deg, #999, #ccc);        color: #111; }
.rank-badge.rank-bronze { background: linear-gradient(135deg, #8b5a2b, #cd853f); color: #fff; }

/* ── Thumbnail ── */
.leaderboard-thumb-wrap {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.leaderboard-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.leaderboard-thumb-placeholder {
  width: 100%; height: 100%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

/* ── Info ── */
.leaderboard-info {
  flex: 1;
  min-width: 0;
}
.leaderboard-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.leaderboard-meta {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Chevron ── */
.leaderboard-chevron {
  flex-shrink: 0;
  color: #444;
}

/* ── Detail rank badge ── */
.detail-rank-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text-muted);
  margin-bottom: 8px;
}
.detail-rank-badge.rank-gold   { background: linear-gradient(135deg, #b8860b, #f5c518); color: #111; }
.detail-rank-badge.rank-silver { background: linear-gradient(135deg, #999, #ccc);        color: #111; }
.detail-rank-badge.rank-bronze { background: linear-gradient(135deg, #8b5a2b, #cd853f); color: #fff; }

/* ── Save button ── */
.detail-btn-save {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: white !important;
  flex: 1;
}
.detail-btn-save:disabled {
  opacity: 0.6;
  cursor: default;
}
.detail-btn-save svg { stroke: white; }

/* ── Toast ── */
.save-toast {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #222;
  color: var(--text);
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #333;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 500;
  white-space: nowrap;
  pointer-events: none;
}
.save-toast.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Manual location overlay ── */
.loc-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.loc-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
}
.loc-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-align: center;
}
.loc-input {
  background: var(--surface-2);
  border: 1.5px solid #333;
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 16px;
  outline: none;
  width: 100%;
}
.loc-input:focus { border-color: var(--accent); }

/* ── Responsive desktop ── */
@media (min-width: 600px) {
  .leaderboard {
    padding: 0 20px;
  }
  .leaderboard-item {
    padding: 14px 18px;
  }
  .leaderboard-thumb-wrap {
    width: 64px; height: 64px;
  }
  .leaderboard-name {
    font-size: 16px;
  }
  .leaderboard-meta {
    font-size: 13px;
  }
}
