/*
 * Reusable pieces: surfaces, buttons, section titles, chips, rank medallions, the podium,
 * leaderboard tables, run feeds and the cards/tiles of games, records and levels.
 * See docs/design.md.
 */

/* ── Surfaces ─────────────────────────────────────────────────────────────── */
.card,
.surface {
  --bs-card-bg: var(--cs-surface);
  --bs-card-border-color: var(--cs-border);
  --bs-card-border-radius: var(--cs-radius);
  --bs-card-inner-border-radius: calc(var(--cs-radius) - 1px);
  --bs-card-cap-bg: rgba(255, 255, 255, 0.025);
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius);
}

.card-header {
  border-bottom: 1px solid var(--cs-border);
  font-weight: 600;
}

.card-footer {
  border-top: 1px solid var(--cs-border);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-accent {
  --bs-btn-color: var(--cs-accent-contrast);
  --bs-btn-bg: var(--cs-accent);
  --bs-btn-border-color: var(--cs-accent);
  --bs-btn-hover-color: var(--cs-accent-contrast);
  --bs-btn-hover-bg: color-mix(in srgb, var(--cs-accent) 85%, #000);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--cs-accent) 85%, #000);
  --bs-btn-active-color: var(--cs-accent-contrast);
  --bs-btn-active-bg: color-mix(in srgb, var(--cs-accent) 75%, #000);
  --bs-btn-active-border-color: color-mix(in srgb, var(--cs-accent) 75%, #000);
}

.btn-gold {
  --bs-btn-color: #2b1d03;
  --bs-btn-bg: var(--cs-gold);
  --bs-btn-border-color: var(--cs-gold);
  --bs-btn-hover-color: #2b1d03;
  --bs-btn-hover-bg: color-mix(in srgb, var(--cs-gold) 88%, #000);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--cs-gold) 88%, #000);
  --bs-btn-active-color: #2b1d03;
  --bs-btn-active-bg: color-mix(in srgb, var(--cs-gold) 78%, #000);
  --bs-btn-active-border-color: color-mix(in srgb, var(--cs-gold) 78%, #000);
}

.btn-ghost {
  --bs-btn-color: var(--cs-text);
  --bs-btn-bg: rgba(255, 255, 255, 0.04);
  --bs-btn-border-color: var(--cs-border-strong);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: rgba(255, 255, 255, 0.08);
  --bs-btn-hover-border-color: var(--cs-muted);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: rgba(255, 255, 255, 0.12);
  --bs-btn-active-border-color: var(--cs-muted);
  --bs-btn-disabled-color: var(--cs-faint);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--cs-border);
}

/* ── Typography pieces ────────────────────────────────────────────────────── */
.kicker {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cs-muted);
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cs-text);
}

.time,
.mono {
  font-family: var(--cs-font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.time {
  font-weight: 600;
}

.time a {
  color: var(--cs-text);
}

.time a:hover {
  color: var(--cs-accent);
}

/* ── Chips and badges ─────────────────────────────────────────────────────── */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--cs-border);
  background: rgba(255, 255, 255, 0.045);
  color: var(--cs-muted);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.chip strong {
  color: var(--cs-text);
  font-weight: 650;
}

.chip .bi-star-fill {
  color: var(--cs-gold);
  font-size: 0.7rem;
}

.chip-game {
  border-color: color-mix(in srgb, var(--cs-accent) 40%, transparent);
  background: color-mix(in srgb, var(--cs-accent) 13%, transparent);
  color: var(--cs-text);
}

.badge-wr {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 0.3rem;
  background: var(--cs-gold);
  color: #2b1d03;
  font-family: var(--cs-font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  vertical-align: middle;
}


.tier-dot {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  vertical-align: middle;
  background: var(--tier-color, var(--cs-muted));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.flag {
  border-radius: 2px;
  margin-right: 0.4rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

/* Uploaded icon of a category or variable value ({icon}): its name is the alt and the tooltip */
.catalog-icon {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 4px;
}

.catalog-icon-lg {
  width: 3rem;
  height: 3rem;
}

.player-link {
  white-space: nowrap;
}

.player-link a {
  color: var(--cs-text);
  font-weight: 550;
}

.player-link a:hover {
  color: var(--cs-accent);
}

/* ── Rank medallions ──────────────────────────────────────────────────────── */
.rank {
  position: relative;
  isolation: isolate;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--cs-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cs-muted);
  font-family: var(--cs-font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.rank-1,
.rank-2,
.rank-3 {
  border: 0;
}

.rank-1 {
  background: var(--cs-gold);
  color: #241703;
}

.rank-1::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -0.55rem -0.7rem -0.35rem;
  background: var(--cs-gold);
  mask: url("/assets/img/laurel.svg") center / contain no-repeat;
  opacity: 0.8;
}

.rank-2 {
  background: var(--cs-silver);
  color: #1d2530;
}

.rank-3 {
  background: var(--cs-bronze);
  color: #2e1a0a;
}

.rank-lg {
  width: 3rem;
  height: 3rem;
  font-size: 1.15rem;
}

.rank-lg.rank-1::before {
  inset: -0.85rem -1.05rem -0.5rem;
}

.rank-xl {
  width: 4.2rem;
  height: 4.2rem;
  font-size: 1.6rem;
}

.rank-xl.rank-1::before {
  inset: -1.2rem -1.5rem -0.7rem;
}

/* Text colors of places (run page, rankings) */
.place-1 { color: var(--cs-gold); }
.place-2 { color: var(--cs-silver); }
.place-3 { color: var(--cs-bronze); }

/* ── Leaderboard tables ───────────────────────────────────────────────────── */
.board {
  margin-bottom: 0;
  font-size: 0.94rem;
}

.board > :not(caption) > * > * {
  padding: 0.7rem 0.85rem;
}

.board th {
  color: var(--cs-faint);
  font-weight: 650;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  border-bottom-color: var(--cs-border);
}

.board td {
  vertical-align: middle;
}

.board tbody tr:last-child > * {
  border-bottom: 0;
}

.board .place {
  width: 4rem;
  text-align: center;
}

.board .time {
  font-size: 0.98rem;
}

@media (max-width: 575.98px) {
  .board .hide-sm {
    display: none;
  }
}

.board tr.obsolete td {
  opacity: 0.45;
}

/* Whole row clickable (row-link module) */
.board tr[data-href] {
  cursor: pointer;
}

/* The current record: a gold tint on the row and a gold bar on its first cell */
.board tr.is-record {
  background: color-mix(in srgb, var(--cs-gold) 7%, transparent);
}

.board tr.is-record > :first-child {
  box-shadow: inset 3px 0 0 var(--cs-gold);
}

.board tr.is-record .time a {
  color: var(--cs-gold);
  font-weight: 700;
}

.board .bi-camera-video {
  font-size: 1.05rem;
  color: var(--cs-muted);
  transition: color 0.15s ease;
}

.board a:hover .bi-camera-video {
  color: var(--cs-accent);
}

/* Board header and controls */
.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.page-title {
  margin: 0.15rem 0 0.6rem;
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--cs-faint);
}

.crumbs a {
  color: var(--cs-muted);
}

.crumbs a:hover {
  color: #fff;
}

.crumbs .bi {
  font-size: 0.7rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Full-game categories above a Speedruns board */
.category-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1.5rem;
}

.category-row .dropdown-toggle.active,
.subcategory-row .dropdown-toggle.active {
  border-color: var(--cs-accent);
  color: #fff;
}

.subcategory-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.subcategory-label {
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cs-faint);
}

.segmented {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  max-width: 100%;
  overflow-x: auto;
  padding: 0.25rem;
  margin: 0;
  list-style: none;
  border-radius: 999px;
  border: 1px solid var(--cs-border);
  background: rgba(255, 255, 255, 0.03);
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segmented .nav-link {
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  color: var(--cs-muted);
  font-size: 0.86rem;
  font-weight: 550;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.segmented .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.segmented .nav-link.active {
  color: var(--cs-accent-contrast);
  background: var(--cs-accent);
}

.filter-bar {
  padding: 0;
  margin-bottom: 1rem;
}

.filter-bar > summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.1rem;
  list-style: none;
  cursor: pointer;
  color: var(--cs-muted);
  font-weight: 550;
  font-size: 0.9rem;
}

.filter-bar > summary::-webkit-details-marker {
  display: none;
}

.filter-bar > summary::after {
  content: "\F282"; /* bi-chevron-down */
  margin-left: auto;
  font-family: "bootstrap-icons";
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.filter-bar[open] > summary::after {
  transform: rotate(180deg);
}

.filter-bar > summary:hover {
  color: #fff;
}

.filter-bar > form {
  padding: 0 1.1rem 1.1rem;
  border-top: 1px solid var(--cs-border);
}

.filter-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cs-faint);
}

/* A filter whose values have icons: one toggle per value, the name on hover */
.icon-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.icon-filter-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0.2rem;
  border-radius: 8px;
  border: 1px solid var(--cs-border);
  color: var(--cs-muted);
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.icon-filter-option .catalog-icon {
  width: 1.9rem;
  height: 1.9rem;
}

.icon-filter-option:hover {
  opacity: 0.9;
}

.btn-check:checked + .icon-filter-option {
  opacity: 1;
  border-color: var(--cs-accent);
  box-shadow: 0 0 0 1px var(--cs-accent);
}

.btn-check:focus-visible + .icon-filter-option {
  outline: 2px solid var(--cs-accent);
  outline-offset: 2px;
}

/* ── Podium ───────────────────────────────────────────────────────────────── */
.podium {
  display: grid;
  grid-template-columns: 1fr 1.16fr 1fr;
  align-items: end;
  gap: clamp(0.5rem, 2vw, 1rem);
  margin: 1.75rem auto 2rem;
  padding: 0;
  max-width: 54rem;
  list-style: none;
}

.podium-step {
  --tone: var(--cs-muted);
  position: relative;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 1.5rem 0.9rem 1rem;
  border-radius: var(--cs-radius);
  border: 1px solid var(--cs-border);
  border-top: 3px solid var(--tone);
  background: var(--cs-surface);
  text-align: center;
}

.podium-step-1 {
  grid-column: 2;
  min-height: 14.5rem;
  padding-top: 2.4rem;
}

.podium-step-2 {
  grid-column: 1;
  min-height: 12.25rem;
}

.podium-step-3 {
  grid-column: 3;
  min-height: 11rem;
}

.tone-1 { --tone: var(--cs-gold); }
.tone-2 { --tone: var(--cs-silver); }
.tone-3 { --tone: var(--cs-bronze); }

.podium-step .rank {
  margin-bottom: 0.35rem;
}

.podium-players {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
}

.podium-time {
  font-family: var(--cs-font-mono);
  font-size: clamp(1.05rem, 2.6vw, 1.6rem);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  white-space: nowrap;
}

.tone-1 .podium-time {
  font-size: clamp(1.2rem, 3.2vw, 1.95rem);
  color: var(--cs-gold);
}

.podium-step:hover {
  border-color: color-mix(in srgb, var(--cs-accent) 45%, var(--cs-border));
}

.podium-step:hover .podium-time {
  color: var(--cs-accent);
}

.podium-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.6rem;
  font-size: 0.78rem;
  color: var(--cs-faint);
}

.podium-meta a {
  color: var(--cs-muted);
}

.podium-meta a:hover {
  color: var(--cs-accent);
}

@media (max-width: 575.98px) {
  .podium-step {
    padding: 1.2rem 0.45rem 0.8rem;
  }

  .podium-step-1 {
    min-height: 12rem;
    padding-top: 2rem;
  }

  .podium-step-2 { min-height: 10.25rem; }
  .podium-step-3 { min-height: 9.25rem; }

  .podium-players {
    font-size: 0.82rem;
  }

  .podium-meta .podium-platform {
    display: none;
  }
}

/* ── Run feed ─────────────────────────────────────────────────────────────── */
.feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem 0.85rem 1.15rem;
  border-radius: var(--cs-radius);
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
  transition: border-color 0.15s ease;
}

/* A bar in the colour of the run's game (gold for a record) */
.feed-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75rem;
  bottom: 0.75rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--cs-accent);
}

.feed-item:hover {
  border-color: color-mix(in srgb, var(--cs-accent) 45%, var(--cs-border));
}

.feed-item.is-record {
  border-color: color-mix(in srgb, var(--cs-gold) 30%, var(--cs-border));
}

.feed-item.is-record::before {
  background: var(--cs-gold);
}

.feed-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  font-weight: 600;
}

.feed-title a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--cs-text);
}

.feed-title a:hover {
  color: #fff;
}

.feed-players {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  color: var(--cs-muted);
}

.feed-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.feed-time {
  font-family: var(--cs-font-mono);
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
}

.feed-item.is-record .feed-time {
  color: var(--cs-gold);
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--cs-faint);
}

.feed-meta .chip {
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
}

/* Links over a stretched link stay clickable */
.feed-item .player-link a,
.feed-item .feed-video,
.record-card .player-link a,
.record-card .record-time,
.podium-step .player-link a,
.podium-step .podium-meta a {
  position: relative;
  z-index: 2;
}

@media (max-width: 575.98px) {
  .feed-item {
    gap: 0.7rem;
    padding-right: 0.8rem;
  }

  .feed-title a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
  }

  .feed-meta .chip {
    display: none;
  }
}

.feed-video {
  color: var(--cs-muted);
}

.feed-video:hover {
  color: var(--cs-accent);
}

.empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--cs-muted);
  border: 1px dashed var(--cs-border-strong);
  border-radius: var(--cs-radius);
}

.empty-state .bi {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
  color: var(--cs-faint);
}

/* ── Game cards (home) ────────────────────────────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1rem;
}

.game-card {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 12.5rem;
  padding: 1.5rem;
  overflow: hidden;
  border-radius: var(--cs-radius-lg);
  border: 1px solid var(--cs-border);
  background: var(--cs-bg-deep);
  color: #fff;
  transition: border-color 0.15s ease;
}

.game-card:hover {
  color: #fff;
  border-color: var(--cs-accent);
}

.game-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    var(--game-art, none),
    linear-gradient(160deg, color-mix(in srgb, var(--cs-accent) 18%, var(--cs-bg-deep)), var(--cs-bg-deep) 75%);
}

.game-card .game-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(8, 7, 12, 0.92) 0%, rgba(8, 7, 12, 0.5) 45%, transparent 75%);
}

.game-emblem {
  position: absolute;
  z-index: -1;
  background: color-mix(in srgb, var(--cs-accent) 40%, #fff);
  mask: var(--game-emblem, url("/assets/img/emblem.svg")) center / contain no-repeat;
}

.game-card .game-emblem {
  top: 1.25rem;
  right: 1.25rem;
  width: 7rem;
  height: 7rem;
  opacity: 0.75;
}

.game-card-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.game-card-year {
  font-family: var(--cs-font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: color-mix(in srgb, var(--cs-accent) 50%, #fff);
}

.game-card-name {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 800;
  line-height: 1.15;
}

.game-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--cs-accent) 40%, #fff);
}

/* ── Record cards (game page) ─────────────────────────────────────────────── */
.record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}

.record-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.25rem 1rem;
  border-radius: var(--cs-radius);
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
  transition: border-color 0.15s ease;
}

.record-card:hover {
  border-color: var(--cs-border-strong);
}

.record-card.is-empty {
  background: transparent;
}

.record-category {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 650;
  color: var(--cs-text);
}

.record-category:hover {
  color: #fff;
}

.record-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cs-gold);
}

.record-time {
  font-family: var(--cs-font-mono);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--cs-text);
  align-self: flex-start;
}

.record-holder {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-meta {
  font-size: 0.78rem;
  color: var(--cs-faint);
}

.record-empty {
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--cs-faint);
}

/* ── Category tiles (game page) ───────────────────────────────────────────── */
.tile-list {
  display: grid;
  gap: 0.6rem;
}

.tile-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--cs-radius);
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
  color: var(--cs-text);
  font-weight: 600;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tile-link:hover {
  color: #fff;
  border-color: color-mix(in srgb, var(--cs-accent) 45%, var(--cs-border));
  background: color-mix(in srgb, var(--cs-accent) 6%, var(--cs-surface));
}

.tile-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--cs-radius);
  background: color-mix(in srgb, var(--cs-accent) 18%, transparent);
  color: color-mix(in srgb, var(--cs-accent) 50%, #fff);
}

.tile-link .chip {
  margin-left: auto;
}

/* Title + secondary line (guides, resources) */
.tile-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tile-sub {
  font-size: 0.82rem;
  font-weight: 450;
  color: var(--cs-muted);
}

/* Categories a guide or resource is about, under its title */
.tile-chips {
  margin-top: 0.4rem;
}

.tile-link .tile-chips .chip {
  margin-left: 0;
  padding: 0.1rem 0.55rem;
  font-size: 0.74rem;
}

/* ── Level records table (per-level category overview) ───────────────────── */
.records-table .level-col {
  min-width: 11rem;
}

.level-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 650;
  color: var(--cs-text);
}

.level-link:hover {
  color: #fff;
}

.level-number {
  display: grid;
  place-items: center;
  flex: none;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.3rem;
  border-radius: var(--cs-radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--cs-muted);
  font-family: var(--cs-font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.records-table .time a {
  font-family: var(--cs-font-mono);
  font-weight: 700;
  color: #fff;
}

.records-table .time a:hover {
  color: var(--cs-gold);
}

/* Warp room, cup... header rows */
.records-table .group-row th {
  padding-top: 1.1rem;
  background: color-mix(in srgb, var(--cs-accent) 9%, transparent);
  color: color-mix(in srgb, var(--cs-accent) 45%, #fff);
}

/* A record verified in the last days: gold tint like the board's record row */
.records-table tr.is-recent {
  background: color-mix(in srgb, var(--cs-gold) 7%, transparent);
}

.records-table tr.is-recent > :first-child {
  box-shadow: inset 3px 0 0 var(--cs-gold);
}

.badge-new {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.12rem 0.4rem;
  border-radius: 0.3rem;
  background: var(--cs-gold);
  color: #2b1d03;
  font-family: var(--cs-font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* On phones the level stays visible while the table scrolls sideways */
@media (max-width: 575.98px) {
  .records-table .level-col {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 8.5rem;
    background: var(--cs-surface);
  }

  .records-table .level-number {
    display: none;
  }
}

/* ── Players ──────────────────────────────────────────────────────────────── */
.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 0.75rem;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  border-radius: var(--cs-radius);
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
  color: var(--cs-text);
  transition: border-color 0.15s ease;
}

.player-card:hover {
  color: #fff;
  border-color: var(--cs-border-strong);
}

.player-card-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.player-card .chip {
  margin-left: auto;
  font-family: var(--cs-font-mono);
}

/* ── WR history chart (wr-history.js) ─────────────────────────────────────── */
.wr-chart {
  margin: 0 0 1.5rem;
  padding: 1rem 1rem 0.75rem;
}

.wr-chart-plot {
  position: relative;
  min-height: 240px;
  touch-action: pan-y;
}

.wr-chart-plot svg {
  display: block;
  overflow: visible;
}

.wr-grid text {
  fill: var(--cs-muted);
  font-family: var(--cs-font-mono);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.wr-grid line {
  stroke: var(--cs-border);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.wr-grid .wr-axis,
.wr-grid .wr-tick {
  stroke: var(--cs-border-strong);
}

.wr-line {
  fill: none;
  stroke: var(--cs-accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.wr-area {
  fill: var(--cs-accent);
  opacity: 0.1;
}

.wr-crosshair {
  stroke: var(--cs-muted);
  stroke-width: 1;
  shape-rendering: crispEdges;
  pointer-events: none;
}

.wr-point {
  cursor: pointer;
  outline: none;
}

.wr-point .wr-hit {
  fill: transparent;
}

.wr-point .wr-dot {
  fill: var(--cs-accent);
  stroke: var(--cs-surface);
  stroke-width: 2;
  transition: r 0.1s ease;
}

.wr-point.is-active .wr-dot,
.wr-point:focus-visible .wr-dot {
  r: 6.5px;
}

.wr-point:focus-visible .wr-dot {
  stroke: var(--cs-gold);
}

.wr-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 9rem;
  max-width: 16rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--cs-border-strong);
  border-radius: var(--cs-radius-sm);
  background: var(--cs-surface-2);
  font-size: 0.8rem;
  line-height: 1.35;
  pointer-events: none;
}

.wr-tooltip-time {
  font-family: var(--cs-font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.wr-tooltip-players {
  color: var(--cs-text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.wr-tooltip-meta {
  color: var(--cs-muted);
}

.wr-chart-caption {
  margin: 0.5rem 0 0;
  color: var(--cs-faint);
  font-size: 0.8rem;
}

.wr-improvement {
  color: var(--cs-ahead);
}

@media (prefers-reduced-motion: reduce) {
  .wr-point .wr-dot {
    transition: none;
  }
}

/* ── Account avatar ─────────────────────────────────────────────────────────
   Frame and effects copied as-is from crash-community-auth (apps/api/src/avatars/avatar-styles.ts):
   the account's `picture` inside <span class="cca-avatar cca-fx-{avatar_effect}"><img></span>. */
@property --cca-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.cca-avatar { position: relative; display: inline-block; flex: none; aspect-ratio: 1; border-radius: 22%; isolation: isolate; }
.cca-avatar > img, .cca-avatar > .cca-layers { display: block; width: 100%; height: 100%; border-radius: inherit; }
.cca-layers { position: relative; overflow: hidden; background: #22252d; }
.cca-layers > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cca-layers > img.cca-accessory { inset: auto; left: 50%; top: 50%; width: auto; height: auto; max-width: none; transform-origin: center; }
.cca-layers > img[hidden] { display: none; }

/* Glow: a warm halo that breathes. */
.cca-fx-glow { animation: cca-glow 2.4s ease-in-out infinite; }
@keyframes cca-glow {
  0%, 100% { box-shadow: 0 0 4px 1px rgba(255, 168, 64, .55), 0 0 0 2px rgba(255, 168, 64, .7); }
  50% { box-shadow: 0 0 22px 6px rgba(255, 168, 64, .9), 0 0 0 2px rgba(255, 214, 120, .95); }
}

/* Holographic: spinning rainbow ring plus a sheen sweeping across the picture. */
.cca-fx-holo::before { content: ''; position: absolute; inset: -4px; z-index: -1; border-radius: inherit;
  background: conic-gradient(from var(--cca-angle), #ff4d6d, #ffbe0b, #3ae374, #17c0eb, #7d5fff, #ff4d6d);
  animation: cca-spin 3s linear infinite; }
.cca-fx-holo::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .45) 45%, rgba(160, 220, 255, .25) 52%, transparent 65%);
  background-size: 250% 100%; mix-blend-mode: overlay; animation: cca-sheen 3.5s ease-in-out infinite; }
@keyframes cca-spin { to { --cca-angle: 360deg; } }
@keyframes cca-sheen { 0% { background-position: 120% 0; } 60%, 100% { background-position: -120% 0; } }

/* Retro: faded CRT photo with scanlines and a vignette. */
.cca-fx-retro > img, .cca-fx-retro > .cca-layers { filter: sepia(.55) saturate(1.35) contrast(1.08) brightness(.97); }
.cca-fx-retro::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px),
              radial-gradient(circle, transparent 55%, rgba(30, 10, 0, .45) 100%); }

/* Wumpa: orange and red stripes spinning round the frame. */
.cca-fx-wumpa { box-shadow: 0 0 10px 2px rgba(255, 128, 32, .55); }
.cca-fx-wumpa::before { content: ''; position: absolute; inset: -4px; z-index: -1; border-radius: inherit;
  background: repeating-conic-gradient(from var(--cca-angle), #ff8a1c 0 14deg, #ffd23f 14deg 20deg, #d9480f 20deg 34deg, #ffb347 34deg 40deg);
  animation: cca-spin 6s linear infinite; }

/* Evolvo-Ray: a green energy ring that pulses while a scan sweeps the picture. */
.cca-fx-evolvo::before { content: ''; position: absolute; inset: -3px; z-index: -1; border-radius: inherit;
  background: #39ff88; animation: cca-evolvo 1.6s ease-in-out infinite; }
.cca-fx-evolvo::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, transparent 0 40%, rgba(80, 255, 150, .45) 48%, rgba(200, 255, 220, .6) 50%, transparent 58%);
  background-size: 100% 300%; mix-blend-mode: screen; animation: cca-scan 2.6s linear infinite; }
@keyframes cca-evolvo {
  0%, 100% { box-shadow: 0 0 4px 1px rgba(57, 255, 136, .5); }
  50% { box-shadow: 0 0 18px 5px rgba(57, 255, 136, .9); }
}
@keyframes cca-scan { 0% { background-position: 0 100%; } 100% { background-position: 0 0; } }

/* Flamethrower: fire flickering up from under the picture. */
.cca-fx-flame::before { content: ''; position: absolute; inset: -10px -5px -5px; z-index: -1; border-radius: inherit;
  background: linear-gradient(0deg, #ffe066 0%, #ff8c1a 35%, #e8370c 70%, rgba(232, 55, 12, .4) 100%);
  filter: blur(4px); transform-origin: 50% 100%; animation: cca-flame .45s ease-in-out infinite alternate; }
.cca-fx-flame::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(0deg, rgba(255, 120, 20, .5), rgba(255, 120, 20, 0) 45%); mix-blend-mode: screen;
  animation: cca-flicker .3s steps(2) infinite alternate; }
@keyframes cca-flame { from { transform: scale(1, .96); opacity: .85; } to { transform: scale(1.03, 1.06); opacity: 1; } }
@keyframes cca-flicker { from { opacity: .6; } to { opacity: 1; } }

/* Stomp: a heavy landing that shakes the frame and kicks up dust. */
.cca-fx-stomp { animation: cca-stomp 2.2s ease-out infinite; }
.cca-fx-stomp::before { content: ''; position: absolute; left: -12%; right: -12%; bottom: -10%; height: 30%; z-index: -1;
  border-radius: 50%; background: radial-gradient(ellipse at center, rgba(176, 137, 90, .85), rgba(176, 137, 90, 0) 70%);
  opacity: 0; animation: cca-dust 2.2s ease-out infinite; }
@keyframes cca-stomp {
  0%, 30% { transform: translateY(0); }
  36% { transform: translateY(-8%); }
  42% { transform: translateY(2%) scale(1.02, .97); }
  46% { transform: translate(-2%, 0); }
  50% { transform: translate(2%, 0); }
  54% { transform: translate(-1%, 0); }
  58%, 100% { transform: none; }
}
@keyframes cca-dust { 0%, 40% { opacity: 0; transform: scale(.6); } 46% { opacity: 1; } 75%, 100% { opacity: 0; transform: scale(1.3); } }

/* Circuit: a cyan trace running round the frame over a faint grid. */
.cca-fx-circuit { box-shadow: 0 0 8px 1px rgba(0, 229, 255, .5); }
.cca-fx-circuit::before { content: ''; position: absolute; inset: -3px; z-index: -1; border-radius: inherit;
  background: conic-gradient(from var(--cca-angle), #00e5ff 0 40deg, #0b3a4a 40deg 360deg); animation: cca-spin 2.4s linear infinite; }
.cca-fx-circuit::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 229, 255, .14) 0 1px, transparent 1px 12.5%),
              repeating-linear-gradient(90deg, rgba(0, 229, 255, .14) 0 1px, transparent 1px 12.5%); }

/* Frost: an icy rim with frosted corners that twinkle. */
.cca-fx-frost { box-shadow: 0 0 0 2px #dff4ff, 0 0 12px 3px rgba(150, 215, 255, .8); }
.cca-fx-frost::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at 18% 22%, #fff 0 1.5%, transparent 2.5%), radial-gradient(circle at 80% 30%, #fff 0 1%, transparent 2%),
              radial-gradient(circle at 70% 82%, #fff 0 1.5%, transparent 2.5%), radial-gradient(circle, transparent 50%, rgba(200, 235, 255, .65) 100%);
  animation: cca-twinkle 2.8s ease-in-out infinite; }
@keyframes cca-twinkle { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }

/* Quantum: the frame shifts through the four Quantum Masks while the picture glitches. */
.cca-fx-quantum::before { content: ''; position: absolute; inset: -3px; z-index: -1; border-radius: inherit;
  animation: cca-masks 4s steps(1) infinite; }
.cca-fx-quantum > img, .cca-fx-quantum > .cca-layers { animation: cca-glitch 4s linear infinite; }
@keyframes cca-masks {
  0% { background: #9b5cff; box-shadow: 0 0 12px 2px #9b5cff; }
  25% { background: #e0342f; box-shadow: 0 0 12px 2px #e0342f; }
  50% { background: #2d9cdb; box-shadow: 0 0 12px 2px #2d9cdb; }
  75% { background: #f2c94c; box-shadow: 0 0 12px 2px #f2c94c; }
}
@keyframes cca-glitch {
  0%, 22%, 26%, 47%, 51%, 72%, 76%, 97%, 100% { filter: none; }
  24%, 49%, 74%, 99% { filter: drop-shadow(2px 0 0 rgba(255, 0, 90, .7)) drop-shadow(-2px 0 0 rgba(0, 210, 255, .7)); }
}

/* Mojo: blue orbs rising through the picture. */
.cca-fx-mojo { box-shadow: 0 0 10px 2px rgba(64, 170, 255, .6); }
.cca-fx-mojo::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at 30% 40%, rgba(150, 220, 255, .95) 0 4%, rgba(60, 160, 255, .5) 6%, transparent 9%),
              radial-gradient(circle at 75% 75%, rgba(150, 220, 255, .9) 0 3%, rgba(60, 160, 255, .45) 5%, transparent 8%);
  background-size: 50% 50%; mix-blend-mode: screen; animation: cca-rise 3s linear infinite; }
@keyframes cca-rise { from { background-position: 0 0; } to { background-position: 0 -100%; } }

/* Turbo Boost: exhaust flames behind the frame and speed lines across it. */
.cca-fx-boost { animation: cca-boost .5s ease-in-out infinite alternate; }
.cca-fx-boost::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(90deg, transparent 0 20%, rgba(255, 255, 255, .55) 35%, transparent 50%) 0 20% / 50% 6% repeat-x,
              linear-gradient(90deg, transparent 0 40%, rgba(255, 255, 255, .45) 60%, transparent 75%) 0 70% / 50% 4% repeat-x;
  animation: cca-streak .6s linear infinite; }
@keyframes cca-boost {
  from { box-shadow: -4px 0 8px 1px rgba(255, 140, 0, .7), 0 0 0 2px rgba(255, 140, 0, .8); }
  to { box-shadow: -10px 0 18px 4px rgba(255, 90, 0, .9), 0 0 0 2px rgba(80, 170, 255, .9); }
}
@keyframes cca-streak { from { background-position-x: 0; } to { background-position-x: -100%; } }

/* Nitro Neon: a magenta and cyan neon tube that flickers like a sign. */
.cca-fx-neon::before { content: ''; position: absolute; inset: -3px; z-index: -1; border-radius: inherit;
  background: linear-gradient(135deg, #ff2bd6, #7a3cff 50%, #00e5ff);
  box-shadow: 0 0 10px 2px rgba(255, 43, 214, .7), 0 0 14px 3px rgba(0, 229, 255, .5); animation: cca-neon 3s linear infinite; }
@keyframes cca-neon { 0%, 18%, 22%, 24%, 60%, 100% { opacity: 1; } 20%, 23%, 62% { opacity: .35; } }

/* On Air: a TV broadcast frame with a blinking REC light. */
.cca-fx-onair { box-shadow: 0 0 0 2px #222, 0 0 0 3px #e03131; }
.cca-fx-onair::before { content: ''; position: absolute; inset: 7%; z-index: 1; pointer-events: none;
  background: linear-gradient(#fff, #fff) 0 0 / 18% 2px, linear-gradient(#fff, #fff) 0 0 / 2px 18%,
              linear-gradient(#fff, #fff) 100% 0 / 18% 2px, linear-gradient(#fff, #fff) 100% 0 / 2px 18%,
              linear-gradient(#fff, #fff) 0 100% / 18% 2px, linear-gradient(#fff, #fff) 0 100% / 2px 18%,
              linear-gradient(#fff, #fff) 100% 100% / 18% 2px, linear-gradient(#fff, #fff) 100% 100% / 2px 18%;
  background-repeat: no-repeat; opacity: .85; }
.cca-fx-onair::after { content: ''; position: absolute; top: 12%; right: 12%; width: 11%; height: 11%; z-index: 1; border-radius: 50%;
  background: #ff2d2d; box-shadow: 0 0 6px 1px rgba(255, 45, 45, .9); pointer-events: none; animation: cca-rec 1.2s steps(1) infinite; }
@keyframes cca-rec { 0% { opacity: 1; } 50% { opacity: 0; } }

/* Ghost: a translucent racer that trails behind, like a Time Trial ghost. */
.cca-fx-ghost > img, .cca-fx-ghost > .cca-layers { filter: saturate(.75) brightness(1.08); }
.cca-fx-ghost { animation: cca-ghost 2.4s ease-in-out infinite; }
@keyframes cca-ghost {
  0%, 100% { box-shadow: -4px 3px 0 0 rgba(140, 200, 255, .55), -8px 6px 0 0 rgba(140, 200, 255, .3); }
  50% { box-shadow: -9px 5px 0 0 rgba(140, 200, 255, .6), -18px 10px 0 0 rgba(140, 200, 255, .32); }
}

/* Platinum Relic: a polished platinum ring with a sheen. */
.cca-fx-relic::before { content: ''; position: absolute; inset: -4px; z-index: -1; border-radius: inherit;
  background: conic-gradient(from var(--cca-angle), #e9eef5, #9aa6b8, #ffffff, #b8c4d6, #eef3fa, #8d99ab, #e9eef5);
  box-shadow: 0 0 10px 1px rgba(200, 220, 255, .6); animation: cca-spin 5s linear infinite; }
.cca-fx-relic::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .55) 48%, transparent 60%);
  background-size: 250% 100%; mix-blend-mode: soft-light; animation: cca-sheen 4s ease-in-out infinite; }

/* Gem: a ring of the six gem colours with sparkles. */
.cca-fx-gem::before { content: ''; position: absolute; inset: -4px; z-index: -1; border-radius: inherit;
  background: conic-gradient(from var(--cca-angle), #e8f6ff 0 60deg, #ff3b5c 60deg 120deg, #2ee66b 120deg 180deg,
              #b14dff 180deg 240deg, #3b82ff 240deg 300deg, #ffd23f 300deg 360deg);
  animation: cca-spin 8s linear infinite; }
.cca-fx-gem::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at 20% 18%, #fff 0 2%, transparent 3.5%), radial-gradient(circle at 84% 64%, #fff 0 1.5%, transparent 3%),
              radial-gradient(circle at 35% 85%, #fff 0 1.5%, transparent 3%);
  animation: cca-sparkle 1.8s ease-in-out infinite; }
@keyframes cca-sparkle { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

/* Power Crystal: a pink glow that pulses, with a glint passing over. */
.cca-fx-crystal { animation: cca-crystal 2s ease-in-out infinite; }
.cca-fx-crystal::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 170, 230, .7) 50%, transparent 60%);
  background-size: 300% 300%; mix-blend-mode: screen; animation: cca-glint 3s ease-in-out infinite; }
@keyframes cca-crystal {
  0%, 100% { box-shadow: 0 0 4px 1px rgba(255, 64, 190, .6), 0 0 0 2px rgba(255, 110, 210, .8); }
  50% { box-shadow: 0 0 18px 5px rgba(255, 64, 190, .9), 0 0 0 2px rgba(255, 190, 240, 1); }
}
@keyframes cca-glint { 0% { background-position: 100% 100%; } 50%, 100% { background-position: 0 0; } }

/* Time Twister: a warp spiral turning behind the frame. */
.cca-fx-warp::before { content: ''; position: absolute; inset: -6px; z-index: -1; border-radius: 50%;
  background: repeating-conic-gradient(from var(--cca-angle), #2b1a6b 0 15deg, #6c4cff 15deg 30deg, #19c3d6 30deg 45deg);
  box-shadow: 0 0 12px 2px rgba(108, 76, 255, .6); animation: cca-spin 2.5s linear infinite; }

/* Elemental: the frame cycles through fire, water, wind and earth. */
.cca-fx-elemental::before { content: ''; position: absolute; inset: -3px; z-index: -1; border-radius: inherit;
  animation: cca-elements 6s ease-in-out infinite; }
@keyframes cca-elements {
  0%, 100% { background: #ff5a1f; box-shadow: 0 0 14px 3px rgba(255, 90, 31, .8); }
  25% { background: #1f8bff; box-shadow: 0 0 14px 3px rgba(31, 139, 255, .8); }
  50% { background: #d8e6ef; box-shadow: 0 0 14px 3px rgba(216, 230, 239, .8); }
  75% { background: #8a5a2b; box-shadow: 0 0 14px 3px rgba(122, 170, 60, .8); }
}

/* Invincibility: Aku Aku's flashing rainbow aura with golden sparks. */
.cca-fx-invincible::before { content: ''; position: absolute; inset: -5px; z-index: -1; border-radius: inherit;
  background: conic-gradient(from var(--cca-angle), #ff4d6d, #ffbe0b, #3ae374, #17c0eb, #7d5fff, #ff4d6d);
  box-shadow: 0 0 16px 4px rgba(255, 214, 80, .8); animation: cca-spin .8s linear infinite; }
.cca-fx-invincible > img, .cca-fx-invincible > .cca-layers { animation: cca-flash .3s steps(1) infinite; }
.cca-fx-invincible::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at 15% 20%, #ffe066 0 2%, transparent 3.5%), radial-gradient(circle at 85% 30%, #fff3b0 0 1.5%, transparent 3%),
              radial-gradient(circle at 78% 85%, #ffe066 0 2%, transparent 3.5%), radial-gradient(circle at 25% 78%, #fff3b0 0 1.5%, transparent 3%);
  animation: cca-sparkle .6s ease-in-out infinite; }
@keyframes cca-flash { 0% { filter: none; } 50% { filter: brightness(1.3) saturate(1.4); } }

@media (prefers-reduced-motion: reduce) {
  .cca-fx-glow, .cca-fx-holo::before, .cca-fx-holo::after,
  .cca-fx-wumpa::before, .cca-fx-evolvo::before, .cca-fx-evolvo::after, .cca-fx-flame::before, .cca-fx-flame::after,
  .cca-fx-stomp, .cca-fx-stomp::before, .cca-fx-circuit::before, .cca-fx-frost::after,
  .cca-fx-quantum::before, .cca-fx-quantum > img, .cca-fx-quantum > .cca-layers, .cca-fx-mojo::after,
  .cca-fx-boost, .cca-fx-boost::after, .cca-fx-neon::before, .cca-fx-onair::after, .cca-fx-ghost,
  .cca-fx-relic::before, .cca-fx-relic::after, .cca-fx-gem::before, .cca-fx-gem::after, .cca-fx-crystal, .cca-fx-crystal::after,
  .cca-fx-warp::before, .cca-fx-elemental::before, .cca-fx-invincible::before, .cca-fx-invincible::after,
  .cca-fx-invincible > img, .cca-fx-invincible > .cca-layers { animation: none; }
  .cca-fx-quantum::before { background: #9b5cff; }
  .cca-fx-elemental::before { background: #ff5a1f; }
}

.nav-avatar { width: 26px; margin-right: 0.15rem; vertical-align: middle; }
.player-avatar { width: 4.5rem; }
.player-avatar-link { display: block; flex: none; border-radius: 22%; transition: transform 0.15s ease, filter 0.15s ease; }
.player-avatar-link:hover, .player-avatar-link:focus-visible { transform: scale(1.04); filter: brightness(1.08); }

/* Typeable dates (date-text.js): a text box and a calendar button; the native input stays below the
   button, invisible, so its calendar opens there and it still holds the posted value. */
.date-text { position: relative; }
.date-text > .input-group > .form-control { min-width: 0; }
.date-text-native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
