/* ===== visual-polish.css ===== */
/* Factburst visual polish: mobile navigation, category identity, profile hierarchy and leaderboards. */

/* Quiz library cards get a restrained category identity without changing their structure. */
.quiz-card[data-category-key],
.quiz-feature[data-category-key] {
  --category-rgb: 53, 199, 255;
  --category-accent: rgb(var(--category-rgb));
}

[data-category-key="science"] { --category-rgb: 69, 212, 131; }
[data-category-key="history"] { --category-rgb: 246, 200, 95; }
[data-category-key="geography"] { --category-rgb: 92, 193, 170; }
[data-category-key="space"] { --category-rgb: 140, 124, 255; }
[data-category-key="nature-animals"] { --category-rgb: 111, 205, 120; }
[data-category-key="technology"] { --category-rgb: 53, 199, 255; }
[data-category-key="arts-literature"] { --category-rgb: 193, 135, 255; }
[data-category-key="music"] { --category-rgb: 241, 115, 154; }
[data-category-key="film"] { --category-rgb: 255, 145, 95; }
[data-category-key="logos"] { --category-rgb: 103, 218, 255; }
[data-category-key="sports"] { --category-rgb: 93, 218, 158; }
[data-category-key="entertainment"] { --category-rgb: 238, 130, 211; }
[data-category-key="mathematics"] { --category-rgb: 111, 166, 255; }
[data-category-key="general-knowledge"] { --category-rgb: 118, 221, 255; }

.quiz-card[data-category-key] {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.quiz-card[data-category-key]::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(var(--category-rgb), 1), rgba(var(--category-rgb), .25));
  opacity: .9;
}

.quiz-card[data-category-key]::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -90px;
  right: -90px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--category-rgb), .075), transparent 68%);
  pointer-events: none;
}

.quiz-card[data-category-key] .category-pill,
.quiz-feature[data-category-key] .category-pill {
  border-color: rgba(var(--category-rgb), .28);
  color: rgba(var(--category-rgb), 1);
  background: rgba(var(--category-rgb), .07);
}

.quiz-card[data-category-key] .category-pill::before,
.quiz-feature[data-category-key] .category-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: rgba(var(--category-rgb), 1);
  box-shadow: 0 0 10px rgba(var(--category-rgb), .42);
}

.quiz-feature[data-category-key]::before {
  background: linear-gradient(180deg, rgba(var(--category-rgb), 1), rgba(var(--category-rgb), .35));
}

.quiz-card[data-category-key] .quiz-card-footer span:last-child {
  color: rgba(var(--category-rgb), .92);
}

.quiz-card:focus-visible {
  border-color: rgba(var(--category-rgb, 53, 199, 255), .55);
  box-shadow: 0 0 0 3px rgba(var(--category-rgb, 53, 199, 255), .11);
}

/* Profile: clearer identity and stat hierarchy. */
.profile-hero {
  position: relative;
  overflow: hidden;
}

.profile-hero::after {
  content: "";
  position: absolute;
  top: -110px;
  left: -70px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(53, 199, 255, .085), transparent 70%);
  pointer-events: none;
}

.profile-identity {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.profile-identity-copy { min-width: 0; }

.profile-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(113, 221, 255, .34);
  border-radius: 21px;
  color: #f8fcff;
  background:
    radial-gradient(circle at 32% 24%, rgba(115, 219, 255, .32), transparent 35%),
    linear-gradient(145deg, rgba(53, 199, 255, .18), rgba(140, 124, 255, .18));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 32px rgba(0,0,0,.24);
  font-size: 29px;
  font-weight: 900;
  letter-spacing: -.04em;
  text-transform: uppercase;
}

.profile-verified {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid rgba(69, 212, 131, .18);
  border-radius: 999px;
  background: rgba(69, 212, 131, .055);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.profile-stat {
  position: relative;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.profile-stat:first-child {
  background: linear-gradient(145deg, rgba(246, 200, 95, .065), transparent 70%);
}

.profile-stat:first-child strong { color: #f6d477; }
.profile-stat:last-child strong { color: #78ddff; }

.profile-stat:first-child::after,
.profile-stat:last-child::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: .35;
}

.friend-card,
.profile-history-card,
#profile-engagement .achievement-card {
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

#profile-engagement .achievement-card {
  border-radius: 12px;
}

#profile-engagement .achievement-card strong {
  color: #f8fbff;
}

.category-progress span {
  transition: width 420ms cubic-bezier(.2,.7,.2,1);
}

/* Leaderboards: podium emphasis, stronger current-user state, and useful mobile rows. */
.leaderboard-row:not(.leaderboard-header) {
  position: relative;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.leaderboard-row:not(.leaderboard-header) .leaderboard-cell.score {
  color: #f5f8fc;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.leaderboard-table > .leaderboard-row:nth-child(2) {
  background: linear-gradient(90deg, rgba(246, 200, 95, .095), transparent 72%);
}
.leaderboard-table > .leaderboard-row:nth-child(3) {
  background: linear-gradient(90deg, rgba(199, 210, 224, .075), transparent 72%);
}
.leaderboard-table > .leaderboard-row:nth-child(4) {
  background: linear-gradient(90deg, rgba(204, 143, 92, .075), transparent 72%);
}

.leaderboard-table > .leaderboard-row:nth-child(2) .leaderboard-cell.rank,
.leaderboard-table > .leaderboard-row:nth-child(3) .leaderboard-cell.rank,
.leaderboard-table > .leaderboard-row:nth-child(4) .leaderboard-cell.rank {
  width: fit-content;
  min-width: 40px;
  padding: 4px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  text-align: center;
  font-weight: 900;
}
.leaderboard-table > .leaderboard-row:nth-child(2) .leaderboard-cell.rank { color: #f6d477; background: rgba(246, 200, 95, .075); }
.leaderboard-table > .leaderboard-row:nth-child(3) .leaderboard-cell.rank { color: #d2dae5; background: rgba(210, 218, 229, .055); }
.leaderboard-table > .leaderboard-row:nth-child(4) .leaderboard-cell.rank { color: #dca172; background: rgba(220, 161, 114, .055); }

.leaderboard-cell.player {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.leaderboard-row.current-user .leaderboard-cell.player::after {
  content: "You";
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid rgba(53, 199, 255, .22);
  border-radius: 999px;
  color: #9ee7ff;
  background: rgba(53, 199, 255, .075);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .02em;
}

.leaderboard-row.current-user {
  background: rgba(53, 199, 255, .075);
  box-shadow: inset 3px 0 0 rgba(53, 199, 255, .82);
}

/* Mobile header: one compact, swipeable navigation row so links never wrap. */
