/* Self-hosted fonts — same files Google serves, without the extra DNS + TLS + 2 round trips
   to a third-party origin that used to block first paint. */
@font-face {
  font-family: 'Luckiest Guy';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/luckiest-guy-latin-ext-f0a7aa5c.woff2?v=1fbdf1d552") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Luckiest Guy';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/luckiest-guy-latin-f3dff7c5.woff2?v=3877b52218") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* BastardPVP — black-first with a blood-red accent, thick white borders, anime PvP art */
:root {
  --bg: #050101;
  --bg-2: #0e0304;
  --panel: rgba(6, 1, 2, 0.88);
  --panel-solid: #070102;
  --line: #ffffff;
  --line-soft: rgba(255, 255, 255, 0.16);
  --red: #a8121b;
  --red-rgb: 168, 18, 27;
  --red-hot: #e11d2a;
  --blood: #7a0a10;
  --blood-rgb: 122, 10, 16;
  --text: #ffffff;
  --muted: #d4aeae;
  --gold: #ffcf3f;
  --silver: #d9dde3;
  --bronze: #e39a5b;
  --discord: #5865f2;
  --ok: #3ddc84;
  --live: #ff2fd1;
  --radius: 14px;
  --border: 3px solid var(--line);
  --display: "Luckiest Guy", "Arial Black", Impact, system-ui, sans-serif; /* big headline moments only — logo, page titles, big stat numbers */
  --label: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; /* everything smaller: table headers, nav, buttons, chips, form labels — plain and legible, no custom webfont to load */
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}
/* ---------- site-wide theme selector (cookie-driven, see /theme/<name>) ---------- */
/* Blood (red) is the site default — :root above. These override the same accent tokens;
   borders stay white and rank/badge colors (gold/silver/bronze) stay put in every theme. */
html[data-theme="black"] {
  --bg: #000000; --bg-2: #0c0c0c;
  --red: #4a4a4a; --red-rgb: 74, 74, 74; --red-hot: #9a9a9a;
  --blood: #1a1a1a; --blood-rgb: 26, 26, 26;
}
html[data-theme="white"] {
  --bg: #08080a; --bg-2: #1a1a1e;
  --red: #c7ccd6; --red-rgb: 199, 204, 214; --red-hot: #ffffff;
  --blood: #4a4d55; --blood-rgb: 74, 77, 85;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; zoom: 80%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.5 var(--body);
  color: var(--text);
  background: #000;
}
a { color: inherit; }
img { max-width: 100%; }
code { font-size: .85em; background: rgba(255,255,255,.08); padding: .1em .35em; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: #fff; color: #000; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden-el { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- blood splatter layer (behind content, never blocks clicks) ---------- */
#splatter-layer { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.splat { position: absolute; width: var(--s); height: var(--s); opacity: 0; transform: scale(.4) rotate(var(--r));
  animation: splat 9s cubic-bezier(.2,.8,.3,1) forwards; will-change: transform, opacity; }
.splat svg { width: 100%; height: 100%; fill: #300000; filter: drop-shadow(0 0 6px rgba(48, 0, 0, .5)); }
@keyframes splat {
  0% { opacity: 0; transform: scale(.35) rotate(var(--r)); }
  0.5% { opacity: 1; transform: scale(1.05) rotate(var(--r)); }
  30% { opacity: 1; transform: scale(1) rotate(var(--r)); }
  100% { opacity: 0; transform: scale(1.02) translateY(14px) rotate(var(--r)); }
}

/* ---------- layout ---------- */
.shell {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px;
  max-width: 1320px; margin: 0 auto; padding: 24px 24px 0;
}
.sidebar { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); }
.main-col { min-width: 0; display: flex; flex-direction: column; }
main { flex: 1; display: flex; flex-direction: column; gap: 22px; }

.box { border: var(--border); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.stat { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.stat span { display: block; font-family: var(--label); font-weight: 700; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; line-height: 1.1; }
.stat b { font-family: var(--label); font-size: 1.15rem; letter-spacing: .08em; font-weight: 700; }

.side-nav { display: flex; flex-direction: column; gap: 8px; }
.navbtn {
  display: flex; align-items: center; gap: 9px; padding: 7px 11px;
  border: var(--border); border-radius: 8px; background: linear-gradient(#5b0a0e, #3a0508);
  font-family: var(--label); font-weight: 700; font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
  transition: transform .12s ease, background .15s ease;
}
.navbtn:hover, .navbtn.on { background: linear-gradient(var(--red), var(--blood)); transform: translateX(3px); }
.navbtn.discord { background: var(--discord); }
.navbtn.discord:hover { background: #6b76ff; }
.navbtn.admin { background: linear-gradient(#2a2a2a, #111); }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.ic-lg { width: 1.9em; height: 1.9em; }
.ic-xs { width: .95em; height: .95em; }

.topelo { position: relative; padding: 10px 8px 8px; overflow: hidden; background: #000; }
.topelo::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url("../img/topelo-flame.gif?v=d06e73876a") center/cover;
}
.topelo h2, .topelo ol { position: relative; z-index: 1; }
.topelo h2 { margin: 0 0 8px; text-align: center; font: 400 1.9rem/1 var(--display); letter-spacing: .02em; text-shadow: 3px 3px 0 #000; }
.topelo ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.topelo li { min-height: 36px; background: rgba(0, 0, 0, .4); border-radius: 4px; }
.topelo li a { display: flex; align-items: center; gap: 6px; padding: 5px 6px; text-decoration: none; font-size: .82rem; }
.topelo .r { font-family: var(--label); font-weight: 700; width: 1.1em; text-align: center; }
.topelo .n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topelo b { font-family: var(--label); font-weight: 700; }

/* ---------- featured streamers: one fixed slot per platform (YouTube/Twitch/TikTok) ---------- */
.stream-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 1700px) {
  .stream-slots { display: contents; }
  .stream-slot { position: fixed; z-index: 2; width: 200px; }
  .stream-slot-youtube { right: 24px; top: 50%; transform: translateY(-338px); }
  .stream-slot-twitch { right: 24px; top: 50%; transform: translateY(-108px); }
  .stream-slot-tiktok { right: 24px; top: 50%; transform: translateY(122px); }
}
.stream-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.live-label { display: flex; align-items: center; gap: 4px; font: 700 .68rem/1.2 var(--label); text-transform: uppercase; letter-spacing: .01em; text-align: center; text-decoration: none; }
.live-label:hover { text-decoration: underline; }
.live-label.is-empty { color: var(--muted); }
.live-dot { width: .5em; height: .5em; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; animation: pulse 1s infinite alternate; flex: none; }
.stream-slot-thumb { display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; border: var(--border); background: var(--bg-2); }
.stream-slot-thumb img, .stream-slot-thumb iframe { width: 100%; height: 100%; object-fit: cover; display: block; border: 0; }
.stream-slot-thumb.is-empty { opacity: .45; }
.stream-slot-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.stream-slot-empty .ic { width: 1.4em; height: 1.4em; opacity: .6; }
/* YouTube = red, Twitch = purple. TikTok's brand is black, but literal black text/glow would
   vanish on this dark theme, so its slot gets a light readable label plus a black-and-white
   outline treatment instead of a black glow. */
.stream-slot-youtube .live-label { color: #ff3b3b; }
.stream-slot-youtube .stream-slot-thumb { border-color: #ff3b3b; box-shadow: 0 0 10px rgba(255, 59, 59, .5); }
.stream-slot-twitch .live-label { color: #b073ff; }
.stream-slot-twitch .stream-slot-thumb { border-color: #9146ff; box-shadow: 0 0 10px rgba(145, 70, 255, .5); }
.stream-slot-tiktok .live-label { color: var(--text); }
.stream-slot-tiktok .stream-slot-thumb { border-color: #000; background: #000; box-shadow: 0 0 10px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .25); }
.empty-row { font-size: .8rem; color: var(--muted); display: flex; align-items: center; justify-content: center; }

.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 6px 0 20px; }
.logo { position: relative; grid-column: 2; display: inline-flex; text-decoration: none; filter: drop-shadow(0 4px 0 #000); }
.logo-img { height: clamp(75px, 10.24vw, 146px); width: auto; display: block; }
.auth { grid-column: 3; justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.auth form { margin: 0; }
.auth .btn-discord { padding: 4.5px 9px; font: 700 .5rem/1.1 var(--label); letter-spacing: .05em; border-width: 1.5px; border-radius: 6px; gap: 4px; box-shadow: 0 2px 0 #000; }
.auth .btn-discord .ic { width: .58em; height: .58em; }
.theme-picker { display: flex; gap: 6px; }
.theme-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-soft); cursor: pointer; }
.theme-dot.on { border-color: var(--line); box-shadow: 0 0 0 2px var(--bg), 0 0 6px var(--gold); }
.theme-dot-red { background: linear-gradient(135deg, #e11d2a, #1c0203); }
.theme-dot-black { background: linear-gradient(135deg, #6a6a6a, #000000); }
.theme-dot-white { background: linear-gradient(135deg, #ffffff, #4a4d55); }
.me { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; }
.cookie-note { margin: 0; font-size: .75rem; color: var(--muted); }
.menu-toggle { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 9px 18px; border: var(--border); border-radius: 12px; color: #fff; text-decoration: none;
  background: linear-gradient(var(--blood), var(--bg-2)); font: 700 1rem/1.1 var(--label); letter-spacing: .05em; text-transform: uppercase;
  box-shadow: 0 4px 0 #000; transition: transform .1s ease, box-shadow .1s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.25); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-width: 2px; border-radius: 9px; box-shadow: 0 3px 0 #000; }
.btn-xs { padding: 4px 9px; font-size: .75rem; border-width: 2px; border-radius: 7px; box-shadow: 0 2px 0 #000; }
.btn-lg { padding: 13px 26px; font-size: 1.25rem; }
.btn-ghost { background: rgba(0,0,0,.35); }
.btn-discord { background: var(--discord); white-space: nowrap; }
.btn-danger { background: linear-gradient(#d0121d, #8a0a10); }
button.btn { font-family: var(--label); font-weight: 700; }

.pill {
  display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 6px 12px;
  border: var(--border); border-radius: 10px; background: rgba(40, 2, 4, .88);
  font: 700 clamp(.8rem, 1.4vw, 1rem)/1.15 var(--label); letter-spacing: .05em; text-transform: uppercase; text-decoration: none;
  box-shadow: var(--shadow);
}
.pill-lg { font-size: clamp(1.4rem, 3vw, 2.2rem); padding: 6px 16px; }
a.pill:hover { background: rgba(var(--blood-rgb), .95); }

/* ---------- art panels (drop images into /static/img — gradients show until then) ---------- */
.art { position: relative; overflow: hidden; background-color: var(--bg-2); background-size: cover; background-position: center; }
.art-hero { background-image: linear-gradient(90deg, rgba(20,2,3,.35), rgba(20,2,3,0) 60%), url("../img/hero.jpg?v=e7423c5f6a"), radial-gradient(circle at 25% 40%, #c4162b 0, transparent 45%), radial-gradient(circle at 75% 45%, #1aa6d8 0, transparent 48%), linear-gradient(120deg, #3a0508, #0a1c2e); }
.art-card1 { background-image: linear-gradient(rgba(40,2,4,.25), rgba(40,2,4,.45)), url("../img/card-leaderboards.jpg?v=672256c63f"), radial-gradient(circle at 40% 40%, #d11b2b, transparent 55%), linear-gradient(135deg, #5b0a0e, #1a0203); }
.art-card2 { background-image: linear-gradient(rgba(40,2,4,.3), rgba(40,2,4,.55)), url("../img/card-profile.jpg?v=ca47853dcd"), radial-gradient(circle at 30% 60%, #ff7a1a, transparent 50%), radial-gradient(circle at 75% 35%, #9b2bd6, transparent 50%), linear-gradient(135deg, #3a0508, #120104); }
.art-card2 { background-position: center; }
.art-card3 { background-image: linear-gradient(rgba(40,2,4,.3), rgba(40,2,4,.55)), url("../img/card-crews.jpg?v=39682b30ee"), radial-gradient(circle at 70% 70%, #ff5a1a, transparent 50%), radial-gradient(circle at 25% 30%, #cfd6e0, transparent 45%), linear-gradient(135deg, #2b0506, #120104); }

.hero { border: var(--border); border-radius: var(--radius); min-height: clamp(220px, 30vw, 330px); box-shadow: var(--shadow); }
.hero-sm { min-height: 180px; }
.hero-inner { position: relative; padding: clamp(18px, 3vw, 34px); display: flex; flex-direction: column; align-items: flex-start; gap: 18px; height: 100%; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.hero-stats span { background: rgba(0,0,0,.6); border: 2px solid var(--line-soft); border-radius: 8px; padding: 3px 10px; font-size: .85rem; }
.hero-stats b { font-family: var(--label); font-weight: 700; font-size: 1.05rem; }

.cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.card { display: flex; align-items: center; justify-content: center; min-height: 170px; border: var(--border); border-radius: var(--radius);
  text-decoration: none; box-shadow: var(--shadow); transition: transform .18s ease; }
.card:hover { transform: translateY(-4px) rotate(-.4deg); }
.card .pill { font-size: clamp(.9rem, 1.5vw, 1.05rem); }
.cards3 .card { background-position: center 10%; } /* home cards: art shifted down 40% */

/* ---------- panels ---------- */
.panel { background: var(--panel); border: var(--border); border-radius: var(--radius); padding: clamp(14px, 2.2vw, 22px); box-shadow: var(--shadow); min-width: 0; }
.panel h1, .panel h2, .page-head h1 { margin: 0 0 12px; font: 400 clamp(1.4rem, 2.6vw, 2rem)/1.1 var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: 3px 3px 0 #000; }
.panel h2 { font-size: clamp(1.15rem, 2vw, 1.45rem); }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.panel-head h1, .panel-head h2 { margin: 0; }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.narrow { max-width: 760px; width: 100%; margin-inline: auto; }
.narrow-in > form { max-width: 640px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; }
.stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.prose p, .prose li { color: #f1dede; max-width: 75ch; }
.prose a { color: #fff; text-decoration-color: var(--red-hot); text-decoration-thickness: 2px; }
.empty { color: var(--muted); text-align: center; padding: 18px 8px; margin: 0; }
.crumbs { margin: 0 0 10px; font-size: .88rem; color: var(--muted); }
.danger { border-color: #ff4d57; }

.flash { border: 2px solid var(--line); border-radius: 10px; padding: 10px 14px; font-weight: 700; background: #1d4d2e; }
.flash-err { background: #6d0b11; }

/* ---------- tabs & filters ---------- */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tabs a { flex: none; padding: 8px 14px; border: var(--border); border-radius: 10px; background: rgba(20,2,3,.8); text-decoration: none;
  font: 700 .95rem/1 var(--label); letter-spacing: .04em; text-transform: uppercase; }
.tabs a.on, .tabs a:hover { background: linear-gradient(var(--red), var(--blood)); }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 6px 0 14px; }
.filters label { display: flex; flex-direction: column; gap: 3px; font: 700 .8rem/1 var(--label); letter-spacing: .05em; text-transform: uppercase; }
select, input, textarea {
  font: 500 .95rem var(--body); color: #fff; background: #0c0102; border: 2px solid rgba(255,255,255,.75); border-radius: 8px; padding: 7px 9px; min-width: 0;
}
select { padding-right: 26px; }
input:focus, select:focus, textarea:focus { border-color: #fff; outline: 2px solid var(--red-hot); }
textarea { resize: vertical; width: 100%; }

/* ---------- leaderboard tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.lb { width: 100%; border-collapse: separate; border-spacing: 0 5px; font-size: .93rem; }
.lb th { text-align: left; font: 700 .78rem/1 var(--label); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 4px 10px; white-space: nowrap; }
.lb td { padding: 8px 10px; background: linear-gradient(90deg, rgba(var(--blood-rgb), .42), rgba(50,4,7,.42)); white-space: nowrap; }
.lb td:first-child { border-radius: 8px 0 0 8px; }
.lb td:last-child { border-radius: 0 8px 8px 0; }
.lb tr:hover td { background: linear-gradient(90deg, rgba(var(--red-rgb), .6), rgba(80,6,10,.6)); }
.lb .num { text-align: right; font-variant-numeric: tabular-nums; }
.lb b { font-family: var(--label); font-weight: 700; font-size: 1.05rem; letter-spacing: .03em; }
.c-rank { width: 3.2em; font-family: var(--label); font-weight: 700; font-size: 1.05rem; }
.c-player a { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; max-width: 260px; }
.pname { overflow: hidden; text-overflow: ellipsis; }
.lb a:hover .pname, .lb td a:hover { text-decoration: underline; }
.podium-1 td { box-shadow: inset 0 2px 0 var(--gold), inset 0 -2px 0 var(--gold); }
.podium-1 td:first-child { box-shadow: inset 2px 2px 0 var(--gold), inset 0 -2px 0 var(--gold); color: var(--gold); }
.podium-2 .c-rank { color: var(--silver); }
.podium-3 .c-rank { color: var(--bronze); }
.clamp { white-space: normal; max-width: 36ch; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 12px; }
.ranks td { white-space: normal; }

.av-wrap { position: relative; display: inline-flex; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; background: #333; flex: none; }
.av-img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: block; }
.av-xs { width: 22px; height: 22px; border-width: 1.5px; }
.av-sm { width: 30px; height: 30px; }
.av-lg { width: 64px; height: 64px; border-width: 3px; }
.av-xl { width: clamp(84px, 12vw, 120px); height: clamp(84px, 12vw, 120px); border-width: 4px; box-shadow: 0 0 0 4px #000; }

/* ---------- win/loss streak badges — 3+ small, 5+ big, 10+ blue (see app.py streak_tier / loss_streak_tier) ---------- */
.streak-badge, .loss-streak-badge { position: absolute; bottom: -14%; display: flex; align-items: center; gap: .12em; z-index: 2; }
.streak-badge { right: -12%; }
.loss-streak-badge { left: -12%; }
.streak-flame, .loss-streak-skull { width: 40%; height: 40%; filter: drop-shadow(0 0 2px rgba(0,0,0,.8)); transform-origin: 50% 90%; flex: none; }
.streak-flame { fill: #ff9a1a; animation: flame-flicker 1.4s ease-in-out infinite; }
.loss-streak-skull { fill: #9a9a9a; }
.streak-n, .loss-streak-n {
  font: 800 .62em/1 var(--label); color: #fff; -webkit-text-stroke: 2px #000; paint-order: stroke fill;
  text-shadow: 0 1px 2px #000;
}
.streak-big .streak-flame { width: 55%; height: 55%; fill: #ff5a1a; filter: drop-shadow(0 0 3px rgba(255,90,20,.9)) drop-shadow(0 0 2px rgba(0,0,0,.8)); animation-duration: 1s; }
.loss-streak-big .loss-streak-skull { width: 55%; height: 55%; fill: #6b6b6b; filter: drop-shadow(0 0 3px rgba(0,0,0,.9)) drop-shadow(0 0 2px rgba(0,0,0,.8)); }
.streak-blue .streak-flame { width: 62%; height: 62%; fill: #3ac8ff; filter: drop-shadow(0 0 4px rgba(58,200,255,.95)) drop-shadow(0 0 2px rgba(0,0,0,.8)); animation-duration: .8s; }
.loss-streak-blue .loss-streak-skull { width: 62%; height: 62%; fill: #d8d8d8; filter: drop-shadow(0 0 4px rgba(255,255,255,.5)) drop-shadow(0 0 2px rgba(0,0,0,.8)); }

/* on the profile page's big avatar, the streak number sits inside the icon instead of beside it, and reads bigger */
.av-xl .streak-badge, .av-xl .loss-streak-badge { position: absolute; }
.av-xl .streak-flame, .av-xl .loss-streak-skull { width: 62%; height: 62%; }
.av-xl .streak-big .streak-flame, .av-xl .loss-streak-big .loss-streak-skull { width: 78%; height: 78%; }
.av-xl .streak-blue .streak-flame, .av-xl .loss-streak-blue .loss-streak-skull { width: 90%; height: 90%; }
.av-xl .streak-n, .av-xl .loss-streak-n {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  font-size: 1.3em;
}
@keyframes flame-flicker {
  0%, 100% { transform: scale(1) skewX(0deg); }
  25% { transform: scale(1.06, .96) skewX(-3deg); }
  50% { transform: scale(.96, 1.05) skewX(2deg); }
  75% { transform: scale(1.03, .98) skewX(-1deg); }
}
@media (prefers-reduced-motion: reduce) { .streak-flame { animation: none; } }

.tier { display: inline-grid; place-items: center; width: 1.55em; height: 1.55em; border-radius: 5px; font: 700 .78rem/1 var(--label); color: #000; vertical-align: 1px; margin-left: 4px; }
.tier-s { background: #ff3b3b; } .tier-a { background: #ff9933; } .tier-b { background: #ffd23f; } .tier-c { background: #4ade80; } .tier-d { background: #cfd4da; }
.verified { display: inline-grid; place-items: center; width: 1.1em; height: 1.1em; border-radius: 50%; background: var(--discord); color: #fff; border: 1.5px solid #fff; flex: none; }
.verified .ic { width: .75em; height: .75em; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 2px solid #fff; border-radius: 999px; background: #000;
  font: 700 .8rem/1.2 var(--label); letter-spacing: .05em; text-transform: uppercase; margin: 2px 4px 2px 0; }
.badge-sm { font-size: .68rem; padding: 1px 7px; border-width: 1.5px; }
.badge-verified { background: var(--discord); }
.badge-muted { background: #333; }
.badge-bad { background: #b3121b; }

/* ---------- category grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.cat-card { border: 2px solid #fff; border-radius: 10px; padding: 10px 12px; background: rgba(60,4,7,.55); }
.cat-card.is-empty { opacity: .55; }
.cat-card h2 { font-size: 1.05rem; margin: 0 0 8px; }
.cat-card h2 a { text-decoration: none; }
.cat-card ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cat-card li { display: flex; align-items: center; gap: 6px; font-size: .88rem; }
.cat-card li a { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; text-decoration: none; }
.cat-card .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-card .r, .cat-card b { font-family: var(--label); font-weight: 700; }
.cat-card li:first-child .r { color: var(--gold); }

/* ---------- profile ---------- */
.profile { display: flex; flex-direction: column; gap: 22px; }
.profile-card { padding-top: clamp(20px, 3vw, 30px); }
/* profile background — purely cosmetic tint over the same art photo. Red is the site default (no override needed). */
.profile-bg-black.art-card2 { background-image: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .78)), url("../img/card-profile.jpg?v=ca47853dcd"), linear-gradient(135deg, #1a1a1a, #000); }
.profile-bg-white.art-card2 { background-image: linear-gradient(rgba(255, 255, 255, .4), rgba(255, 255, 255, .62)), url("../img/card-profile.jpg?v=ca47853dcd"), linear-gradient(135deg, #dcdcdc, #fff); color: #1a0203; }
.profile-bg-white .muted { color: #6b3a3d; }
/* crew background — same cosmetic tint system as profiles, over the crew art photo. */
.crew-bg-black.art-card3 { background-image: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .78)), url("../img/card-crews.jpg?v=39682b30ee"), linear-gradient(135deg, #1a1a1a, #000); }
.crew-bg-white.art-card3 { background-image: linear-gradient(rgba(255, 255, 255, .4), rgba(255, 255, 255, .62)), url("../img/card-crews.jpg?v=39682b30ee"), linear-gradient(135deg, #dcdcdc, #fff); color: #1a0203; }
.crew-bg-white .muted { color: #6b3a3d; }
/* ---------- profile background picker (swatches) ---------- */
.swatch-row { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border: var(--border); border-radius: 20px; cursor: pointer; background: var(--panel); }
.swatch input { margin: 0; }
.swatch::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-soft); flex: none; }
.swatch-red::before { background: linear-gradient(135deg, #a8121b, #1c0203); }
.swatch-black::before { background: linear-gradient(135deg, #3a3a3a, #000); }
.swatch-white::before { background: linear-gradient(135deg, #fff, #b8b8b8); }
.swatch:has(input:checked) { border-color: var(--gold); }
.profile-id { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-id h1 { margin: 0 0 6px; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.profile-edit { margin-left: auto; align-self: flex-start; }
.small-id { margin-bottom: 14px; }
.social-links { display: flex; gap: 6px; margin-top: 8px; }
.social-link {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,.55); border: 2px solid #fff; color: #fff; transition: transform .12s ease, background .15s ease;
}
.social-link:hover { transform: translateY(-2px); }
.social-link .ic { width: 16px; height: 16px; }
.social-youtube:hover { background: #ff0000; }
.social-twitch:hover { background: #9146ff; }
.social-tiktok:hover { background: #000; }
.social-discord:hover { background: var(--discord); }
.stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.stat-big { background: rgba(0,0,0,.62); border: 2px solid #fff; border-radius: 10px; padding: 8px 10px; text-align: center; min-width: 0; }
.stat-big span { display: block; font: 700 .75rem/1 var(--label); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat-big b { display: inline-block; max-width: 100%; vertical-align: middle; font: 400 clamp(1.3rem, 2.6vw, 1.9rem)/1.2 var(--display); letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-big .tier { vertical-align: middle; }
.stat-big .smallb { font-size: 1.05rem; }
.stat-big b a { text-decoration: none; }
.stat-panels { margin-top: 0; }
.stat-panels .panel { padding: 12px; }
.rank-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.rank-badge { padding: 5px 12px; border: 3px solid #fff; border-radius: 10px; background: #000; text-decoration: none;
  font: 700 1.05rem/1 var(--label); letter-spacing: .05em; text-transform: uppercase; }
.rank-badge.pos-1 { background: linear-gradient(#ffcf3f, #c98a00); color: #000; }
.rank-badge.pos-2 { background: linear-gradient(#eef1f5, #9aa3ad); color: #000; }
.rank-badge.pos-3 { background: linear-gradient(#f0b27a, #a45a1e); color: #000; }
.build { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.build div { background: rgba(var(--blood-rgb), .35); border-radius: 8px; padding: 7px 10px; min-width: 0; }
.build dt { font: 700 .72rem/1 var(--label); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.build dd { margin: 3px 0 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; }
.build a { text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; border: 2px solid #fff; border-radius: 999px; padding: 3px 12px; font-weight: 800; }
.chip small { font: 700 .7rem/1 var(--label); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chip a { text-decoration: none; }

/* ---------- matches ---------- */
.matches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.matches li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 7px 10px; border-radius: 8px; background: rgba(var(--blood-rgb), .3); font-size: .9rem; }
.matches li.removed { opacity: .5; text-decoration: line-through; }
.matches .mid { font-family: var(--label); font-weight: 700; color: var(--muted); }
.matches a { font-weight: 800; text-decoration: none; }
.matches a.won { color: #7dffb0; }
.matches a.lost { color: #ff9aa0; }
.matches .elo-delta { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.matches .vs { font-family: var(--label); font-weight: 700; font-size: .8rem; }
.matches .when { margin-left: auto; font-size: .78rem; color: var(--muted); }

/* ---------- crews ---------- */
.crew-ic { width: 44px; height: 44px; border-radius: 10px; border: 2px solid #fff; object-fit: cover; background: #000; flex: none; display: inline-grid; place-items: center; }
.crew-ic-sm { width: 30px; height: 30px; border-radius: 7px; }
.crew-ic-xl { width: clamp(84px, 12vw, 120px); height: clamp(84px, 12vw, 120px); border-width: 4px; border-radius: 18px; box-shadow: 0 0 0 4px #000; }
.crew-ic-empty .ic { width: 60%; height: 60%; }
.crew-head { display: flex; align-items: center; gap: 18px; }
.crew-head h1 { margin: 0; font-size: clamp(1.8rem, 4.5vw, 3rem); }
.crew-rank { margin: 0; font: 400 1.5rem/1 var(--display); color: var(--gold); text-shadow: 2px 2px 0 #000; }
.crew-desc { margin: 6px 0 0; max-width: 60ch; text-shadow: 0 1px 3px #000; }
.crew-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.crew-actions form { margin: 0; }
.crew-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.crew-mini a { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; background: rgba(var(--blood-rgb), .35); text-decoration: none; }
.crew-mini .r { font-family: var(--label); font-weight: 700; width: 2em; }
.crew-mini .n { flex: 1; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-mini b { font-family: var(--label); font-weight: 700; }

.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rows li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border-radius: 8px; background: rgba(var(--blood-rgb), .3); }
.rows li.warn { background: rgba(179, 18, 27, .55); }
.rows li > a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.row-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.row-actions form { margin: 0; }
.plain { margin: 0; padding-left: 18px; }
.inline { display: inline; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form fieldset { border: 2px solid var(--line-soft); border-radius: 10px; margin: 0; padding: 12px 14px 14px; }
.form legend { font: 700 1.05rem/1 var(--label); letter-spacing: .05em; text-transform: uppercase; padding: 0 6px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font: 700 .8rem/1.1 var(--label); letter-spacing: .05em; text-transform: uppercase; }
.field input, .field select { width: 100%; }
.form > .btn { align-self: flex-start; }
.inline-form { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.inline-form .field { flex: 1 1 220px; }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mod-actions form { margin: 0; }

/* ---------- queue ---------- */
.queue-status { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.q-live { font: 400 clamp(1.3rem, 3vw, 1.8rem)/1.2 var(--display); letter-spacing: .03em; margin: 4px 0 0; }
.queue-status[data-state="queued"] .q-live::after { content: ""; display: inline-block; width: .5em; height: .5em; margin-left: .4em; border-radius: 50%; background: var(--ok); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .2; transform: scale(.6); } }
.q-buttons { display: flex; gap: 10px; }
.q-buttons form { margin: 0; }

.steps { padding-left: 22px; }
.steps li { margin-bottom: 6px; }
.error-page { text-align: center; }

.footer { position: relative; z-index: 1; margin: 34px 0 0; padding: 18px 0 28px; border-top: 2px solid var(--line-soft); font-size: .88rem; color: #e9caca; }
.footer p { margin: 4px 0; }
.footer .links a { text-decoration: none; font-weight: 700; }
.footer .links a:hover { text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .hide-md { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 12px 16px 0; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(280px, 85vw); max-height: none; padding: 16px; z-index: 40;
    background: #120203; border-right: var(--border); overflow-y: auto; transform: translateX(-105%); transition: transform .2s ease;
  }
  body.nav-open .sidebar { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.7); }
  .topbar { grid-template-columns: auto 1fr auto; padding-bottom: 14px; }
  .menu-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; border: var(--border); border-radius: 10px; background: var(--panel); color: #fff; cursor: pointer; }
  .menu-toggle .ic { width: 22px; height: 22px; }
  .logo { grid-column: 2; justify-self: center; }
  .logo-img { height: clamp(51px, 14.18vw, 75px); }
  .auth .me span, .cookie-note { display: none; }
  .btn-discord { font-size: .8rem; padding: 7px 10px; }
  .stream-slots { gap: 6px; }
  .live-label { font-size: .58rem; gap: 3px; }
  .cards3 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .card { min-height: 110px; }
  .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .form-grid, .build { grid-template-columns: minmax(0, 1fr); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth .btn-discord { font-size: 0; gap: 0; padding: 8px 10px; }
  .auth .btn-discord .ic { font-size: 1rem; width: 20px; height: 20px; }
  .auth form .btn { padding: 6px 8px; font-size: .7rem; }
  .c-player a { max-width: 150px; }
  .matches .when { margin-left: 0; width: 100%; }
  .crew-head { flex-direction: column; align-items: flex-start; }
  .row-actions { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  #splatter-layer { display: none; }
}

/* Same art, ~25% fewer bytes, for browsers that take WebP. Anything older keeps the
   JPEG rules above — image-set() inside @supports means nobody gets a broken background. */
@supports (background-image: image-set(url("a.webp") type("image/webp"))) {
  .art-hero { background-image: linear-gradient(90deg, rgba(20,2,3,.35), rgba(20,2,3,0) 60%), image-set(url("../img/hero.webp?v=d61e86adee") type("image/webp") 1x), radial-gradient(circle at 25% 40%, #c4162b 0, transparent 45%), radial-gradient(circle at 75% 45%, #1aa6d8 0, transparent 48%), linear-gradient(120deg, #3a0508, #0a1c2e); }
  .art-card1 { background-image: linear-gradient(rgba(40,2,4,.25), rgba(40,2,4,.45)), image-set(url("../img/card-leaderboards.webp?v=7f8f4ef043") type("image/webp") 1x), radial-gradient(circle at 40% 40%, #d11b2b, transparent 55%), linear-gradient(135deg, #5b0a0e, #1a0203); }
  .art-card2 { background-image: linear-gradient(rgba(40,2,4,.3), rgba(40,2,4,.55)), image-set(url("../img/card-profile.webp?v=7ea3fcdb27") type("image/webp") 1x), radial-gradient(circle at 30% 60%, #ff7a1a, transparent 50%), radial-gradient(circle at 75% 35%, #9b2bd6, transparent 50%), linear-gradient(135deg, #3a0508, #120104); }
  .art-card3 { background-image: linear-gradient(rgba(40,2,4,.3), rgba(40,2,4,.55)), image-set(url("../img/card-crews.webp?v=61c8a4c200") type("image/webp") 1x), radial-gradient(circle at 70% 70%, #ff5a1a, transparent 50%), radial-gradient(circle at 25% 30%, #cfd6e0, transparent 45%), linear-gradient(135deg, #2b0506, #120104); }
}
