@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* tokens, neutral surfaces, the rainbow is the only accent */
:root {
  --bg: #0b0b0c;
  --surface: #0f0f10;
  --surface-2: #151516;
  --surface-3: #1c1c1e;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --radius: 12px;
  --color-xp: #8ccf86;
  --color-dif: #6fb791;
  --color-xp-soft: rgba(59, 191, 125, 0.1);
  --color-xp-border: rgba(59, 191, 125, 0.4);
  --color-sp: #7fa3d8;
  --color-sp-soft: rgba(127, 163, 216, 0.1);
  --color-sp-border: rgba(127, 163, 216, 0.35);
}

.text-dif {
  color: var(--color-dif);
}
.text-xp {
  color: var(--color-xp);
}

.text-sp {
  color: var(--color-sp);
}

.bg-xp {
  background-color: var(--color-xp);
}

.bg-sp {
  background-color: var(--color-sp);
}

.bg-xp-soft {
  background-color: var(--color-xp-soft);
}

.bg-sp-soft {
  background-color: var(--color-sp-soft);
}

.border-xp {
  border-color: var(--color-xp-border);
}

.border-sp {
  border-color: var(--color-sp-border);
}

body {
  background: var(--bg);
  color: #d4d4d8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(185, 140, 246, 0.35);
}

::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.site-hero-glow {
  background-color: rgba(158, 77, 192, 0.10);
  background-image:
    radial-gradient(closest-side, rgba(166, 239, 123, 0.32), transparent),
    radial-gradient(closest-side, rgba(246, 201, 139, 0.26), transparent),
    radial-gradient(closest-side, rgba(245, 143, 180, 0.30), transparent),
    radial-gradient(closest-side, rgba(185, 140, 246, 0.36), transparent),
    radial-gradient(closest-side, rgba(136, 182, 250, 0.30), transparent);
  background-size: 70% 140%, 60% 120%, 65% 130%, 75% 150%, 60% 125%;
  background-repeat: no-repeat;
  background-position: 0% 0%, 100% 100%, 60% 0%, 100% 0%, 0% 100%;
  animation: hero-glow-drift 22s ease-in-out infinite alternate;
}

@keyframes hero-glow-drift {
  0% {
    background-position: 0% 0%, 100% 100%, 60% 0%, 100% 0%, 0% 100%;
  }

  33% {
    background-position: 40% 100%, 0% 30%, 100% 60%, 70% 100%, 30% 0%;
  }

  66% {
    background-position: 100% 40%, 40% 0%, 20% 100%, 0% 30%, 80% 80%;
  }

  100% {
    background-position: 60% 0%, 80% 70%, 0% 20%, 30% 70%, 100% 10%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-hero-glow {
    animation-duration: 60s;
  }
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}
/* rainbow accents, the logo's colours */
:root {
  --chromia-green: #a6ef7b;
  --chromia-peach: #f6c98b;
  --chromia-pink: #f58fb4;
  --chromia-violet: #b98cf6;
  --chromia-blue: #88b6fa;
  --chromia-rainbow: linear-gradient(90deg, var(--chromia-green), var(--chromia-peach), var(--chromia-pink),
      var(--chromia-violet), var(--chromia-blue), var(--chromia-green));
}


/* rainbow-line, the strip under banners, colours keep flowing along it */
.rainbow-line {
  height: 4px;
  background-image: var(--chromia-rainbow);
  background-size: 600px 100%;
  opacity: 0.75;
  animation: rainbow-line-flow 8s linear infinite;
}

@keyframes rainbow-line-flow {
  from { background-position: 0 0; }
  to { background-position: 600px 0; }
}

/* leaderboard top three and loading rows */
.rank-1 { --rank: 245, 196, 81; }   /* gold */
.rank-2 { --rank: 169, 201, 245; }  /* silver */
.rank-3 { --rank: 240, 140, 74; }   /* bronze */

.rank-row.rank-1,
.rank-row.rank-2,
.rank-row.rank-3 {
  border-color: rgba(var(--rank), 0.35);
  background-color: rgba(var(--rank), 0.04);
}

.rank-num.rank-1,
.rank-num.rank-2,
.rank-num.rank-3 {
  color: rgb(var(--rank));
  font-weight: 700;
}

.skeleton {
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 30%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.04) 70%);
  background-size: 300% 100%;
  animation: skeleton-shimmer 1.1s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

.row-in {
  animation: row-in 0.28s ease-out both;
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* home page */
.home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 480px;
}

/* glow fallback when there's no webgl */
.home-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.home-hero.no-webgl {
  background:
    radial-gradient(40% 60% at 15% 20%, rgba(166, 239, 123, 0.06), transparent),
    radial-gradient(40% 60% at 85% 20%, rgba(136, 182, 250, 0.07), transparent);
}

/* floating logos on the home banner */
.home-logo {
  position: absolute;
  /* 30% room each side for the lean, outline and shadow, plus 34px for the bob and drift, drawn by assets/logo-float.js */
  width: calc(var(--size) * 1.6 + 68px);
  height: calc(var(--size) * 1.6 + 68px);
  margin: calc(var(--size) * -0.3 - 34px); /* works for logos placed from the left or the right */
  pointer-events: none;
}

/* gold, silver, bronze ring round the top 3 */
.rank-ring {
  border: 3px solid rgba(255, 255, 255, 0.15);
  padding: 2px;
}

.rank-ring.rank-1,
.rank-ring.rank-2,
.rank-ring.rank-3 {
  border-color: rgb(var(--rank));
}

/* stats rows with dotted leaders */
.stat-leader {
  flex: 1;
  min-width: 16px;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.18);
  transform: translateY(-4px);
}

/* reduce motion still gets the decorations, just slower, nothing flashes */
@media (prefers-reduced-motion: reduce) {
  .rainbow-line {
    animation-duration: 20s;
  }

  .row-in {
    animation: none;
  }

  .skeleton {
    animation-duration: 2.5s;
  }
}

/* the view leaderboards link at the bottom of home cards */
.home-card-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 16px;
  font-size: 14px;
  color: #a3a3a3;
  border-radius: 0 0 12px 12px;
  transition: color 0.15s, background-color 0.15s;
}

.home-card-link:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.02);
}

/* vr, mobile and spin badges */
.play-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
  padding: 0 6px;
  border: 1px solid;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  vertical-align: middle;
  white-space: nowrap;
}
.play-badge:first-child { margin-left: 0; }
.play-badge-vr { color: #c9adf9; border-color: rgba(185, 140, 246, 0.35); background: rgba(185, 140, 246, 0.1); }
.play-badge-mobile { color: #b8f297; border-color: rgba(166, 239, 123, 0.35); background: rgba(166, 239, 123, 0.08); }
.play-badge-spin { color: #a3c7fb; border-color: rgba(136, 182, 250, 0.35); background: rgba(136, 182, 250, 0.1); }

/* profile banner, their picture or the moving lines on plain dark */
.profile-banner-default {
  background: #0f0f10;
}

/* map difficulty badge */
.diff-badge {
  --d: #a1a1aa;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em; line-height: 1.5; white-space: nowrap;
  color: var(--d);
  background: rgba(10, 10, 12, .74);
  border: 1px solid color-mix(in srgb, var(--d) 38%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

.diff-badge.lg { font-size: 12px; padding: 4px 12px; }

.diff-badge[data-d="0"] { --d: #8fd0a0; }
.diff-badge[data-d="1"] { --d: #e3c27a; }
.diff-badge[data-d="2"] { --d: #e88a8a; }
.diff-badge[data-d="3"] { --d: #b9a0e8; }
.diff-badge[data-d="4"] { --d: #d4d4d8; }

/* a mod chip on a pass */
.mod-chip {
  display: inline-flex; align-items: center; margin: 0 4px 0 0; padding: 0 6px;
  border: 1px solid rgba(246, 201, 139, .35); border-radius: 6px; background: rgba(246, 201, 139, .08);
  color: #f6c98b; font-size: 11px; font-weight: 700; line-height: 17px; white-space: nowrap; vertical-align: middle;
}


/* design layer, body-prefixed since tailwind loads after this file */

body .bg-ink-900 { background-color: var(--surface); }
body .bg-ink-800 { background-color: var(--surface-2); }
body .border-white\/10 { border-color: var(--line); }
body .border-white\/5 { border-color: rgba(255, 255, 255, 0.05); }
body .hover\:border-white\/20:hover,
body .hover\:border-white\/15:hover { border-color: var(--line-strong); }
/* page content outlines (cards, panels, boxes): 2px; buttons, inputs, divider lines, the header and footer stay thin */
body .border-2,
body :is(.rounded-xl, .rounded-2xl).border:not(button):not(input):not(select):not(textarea):not(.site-header *):not(#site-footer *),
body .map-card, body .home-panel-card, body .pf-card { border-width: 2px; }
body .bg-black { background-color: #0c0c0e; }
body .text-neutral-300 { color: #d4d4d8; }
body .text-neutral-400 { color: var(--text-2); }
body .text-neutral-500 { color: var(--text-3); }
body h1, body h2, body h3 { letter-spacing: -0.015em; }

body input[type="text"], body input[type="search"], body input:not([type]), body select, body textarea {
  border-color: var(--line);
  background-color: #0c0c0e;
  transition: border-color 0.15s, box-shadow 0.15s;
}
body input:focus, body select:focus, body textarea:focus {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
  outline: none;
}

.btn-primary, a.btn-primary, button.btn-primary {
  background: #fafafa;
  color: #0b0b0c;
  font-weight: 600;
  transition: background-color 0.15s, transform 0.15s;
}
a.btn-primary:hover, button.btn-primary:hover { background: #e4e4e7; }
.btn-secondary, a.btn-secondary, button.btn-secondary {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  transition: background-color 0.15s, border-color 0.15s;
}
a.btn-secondary:hover, button.btn-secondary:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 9px;
  color: var(--text-2);
  transition: color 0.15s, background-color 0.15s;
}
.btn-icon:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

/* header */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 64px;
  background: rgba(11, 11, 12, 0.85);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background-image: var(--chromia-rainbow); background-size: 600px 100%;
  opacity: 0.25;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
}
.site-header-spacer { height: 64px; }
/* the header's search (savia.js headerSearch) */
.site-search { position: relative; }
.site-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #71717a; pointer-events: none; }
.site-search-input { width: 100%; height: 36px; padding: 0 10px 0 32px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04); color: #fafafa; font-size: 13px; outline: none; transition: border-color .15s, background .15s; }
.site-search-input::placeholder { color: #71717a; }
.site-search-input:focus { border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.06); }
.site-search-input::-webkit-search-cancel-button { filter: invert(0.6); }
.site-search-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; max-height: 70vh; overflow-y: auto;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.1); background: #111113; padding: 4px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); }
@media (min-width: 768px) { .site-search-results { left: auto; width: 340px; } }
.site-search-head { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #71717a; }
.site-search-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; }
.site-search-row:hover, .site-search-row.is-active { background: rgba(255, 255, 255, 0.06); }
.site-nav-link {
  position: relative; display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: color 0.15s, background-color 0.15s;
}
.site-nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.site-nav-link.is-active { color: var(--text); }
.site-nav-link.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -14px; height: 2px; border-radius: 2px;
  background-image: var(--chromia-rainbow); background-size: 300px 100%;
  animation: rainbow-line-flow 8s linear infinite; /* same speed as the banner strip */
}
.site-mobile-menu {
  position: fixed; top: 64px; left: 0; right: 0; z-index: 49;
  padding: 8px 16px 16px; background: rgba(11, 11, 12, 0.97); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.site-mobile-menu a { display: flex; align-items: center; height: 44px; padding: 0 12px; border-radius: 8px; color: #d4d4d8; font-weight: 500; }
.site-mobile-menu a:hover, .site-mobile-menu a.is-active { background: rgba(255, 255, 255, 0.05); color: #fff; }

/* page banners */
/* lines on page banners fade out on the left where the text sits */
.banner-lines canvas {
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.6) 35%, #000 70%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.6) 35%, #000 70%);
}
/* dark fade behind the banner text, from the left, or round the middle when the text is centred */
.banner-lines::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(11, 11, 12, 0.85), rgba(11, 11, 12, 0.6) 40%, rgba(11, 11, 12, 0) 75%);
}
.banner-lines:has(+ .text-center)::after {
  background: radial-gradient(50% 75% at 50% 50%, rgba(11, 11, 12, 0.85), rgba(11, 11, 12, 0.5) 60%, rgba(11, 11, 12, 0));
}

/* list rows, no box each, top three get a coloured edge */
#rows > .rounded-xl, #lb-rows > .rounded-xl {
  border-color: transparent;
  background-color: rgba(255, 255, 255, 0.022);
}
#rows > .rounded-xl:hover, #lb-rows > .rounded-xl:hover {
  background-color: rgba(255, 255, 255, 0.05);
}
.rank-row.rank-1, .rank-row.rank-2, .rank-row.rank-3 {
  border-color: transparent !important;
  background-color: rgba(var(--rank), 0.04);
  box-shadow: inset 2px 0 0 rgb(var(--rank));
}

/* home */
.home-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 160px; z-index: -1;
  background: linear-gradient(to bottom, rgba(11, 11, 12, 0), var(--bg));
  pointer-events: none;
}
.home-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 6px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(17, 17, 19, 0.7);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 500; color: #d4d4d8;
}
.home-eyebrow-dot {
  display: inline-flex; height: 20px; padding: 0 8px; align-items: center; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); color: #e4e4e7; font-size: 11px; font-weight: 600;
}
.home-stat { display: flex; justify-content: center; padding: 20px 24px; }
.home-stat:nth-child(even) { border-left: 1px solid var(--line); }
.home-stat:nth-child(n+3) { border-top: 1px solid var(--line); }
.home-stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: #fff; font-variant-numeric: tabular-nums; }
.home-stat-label { margin-top: 2px; font-size: 13px; color: var(--text-2); }
/* home: top players and stats side by side, cards the same height, a link along the bottom */
.home-panel { display: flex; flex-direction: column; min-width: 0; }
.home-panel-card { margin-top: 12px; flex: 1; display: flex; flex-direction: column; overflow: hidden; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); }
.home-panel-link { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 13px 16px; border-top: 1px solid var(--line);
  font-size: 13.5px; color: #a1a1aa; transition: color .15s, background-color .15s; }
.home-panel-link:hover { color: #fff; background: rgba(255, 255, 255, .03); }
.home-stats { flex: 1; display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.home-stats .home-stat { display: flex; flex-direction: column-reverse; justify-content: center; padding: 22px 24px; border: 0; }
.home-stats .home-stat:nth-child(even) { border-left: 1px solid var(--line); }
.home-stats .home-stat:nth-child(n+3) { border-top: 1px solid var(--line); }
.home-section-title { font-size: 15px; font-weight: 600; color: #fff; letter-spacing: -0.01em; }


/* misses, sp, xp tiles on a pass, only the label keeps its colour */
body .border-red-500\/40.bg-red-700\/5,
body .border-sp.bg-sp-soft,
body .border-xp.bg-xp-soft {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.035);
}
body .bg-red-700\/5 > .text-red-400 { color: #f2a0a0; }

/* calmer accents */
body .text-blue-400 { color: #9db8e0; }
body .hover\:text-blue-400:hover { color: #b8cbea; }
.play-badge { font-weight: 600; }


/* map card, square 512 cover then name, mapper, difficulty and sp, used on maps and home */
.map-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  transition: border-color .15s, transform .15s; }
.map-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.map-card.is-motd { border: 2px solid rgba(227, 207, 122, .55); } /* a thicker gold edge for map of the day */
.map-card-cover { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface-2); }
.map-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.map-card:hover .map-card-cover img { transform: scale(1.04); }
/* a soft dark fade up from the bottom so the tag stands out on any cover */
.map-card-fade { position: absolute; inset: auto 0 0 0; height: 45%; pointer-events: none; background: linear-gradient(to top, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0)); }
.map-card-tag { position: absolute; left: 8px; bottom: 8px; padding: 2px 7px; border-radius: 6px; background: #e3cf7a; color: #0b0b0c;
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.map-card-body { padding: 10px 12px 12px; min-width: 0; }
.map-card-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: #fff; }
.map-card-sub { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: #a1a1aa; }
.map-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.map-card-sp { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
