/* The stats site (index.html + site.js). */
:root {
  --bg: #070910; --panel: #10141f; --panel2: #161b29; --line: #232a3b;
  --text: #e9ecf4; --dim: #8b93a7; --accent: #5ce6a0; --gold: #ffd60a; --red: #ff4d5e;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px 48px; }
header { display: flex; align-items: center; gap: 12px; padding: 18px 0; flex-wrap: wrap; }
.logo { font-weight: 900; font-size: 20px; letter-spacing: .5px; }
.logo b { color: var(--accent); }
.live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); font-size: 13px; color: var(--dim); }
.live.on { color: #fff; border-color: #ff003355; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); }
.live.on .dot { background: #ff0033; box-shadow: 0 0 10px #ff0033; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.watch { margin-left: auto; background: #ff0033; color: #fff; font-weight: 800; padding: 8px 14px; border-radius: 10px; }
.watch:hover { color: #fff; filter: brightness(1.1); }
nav { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
nav a { padding: 7px 12px; border-radius: 10px; color: var(--dim); font-weight: 600; }
nav a.on, nav a:hover { background: var(--panel); color: var(--text); }
.search { margin-left: auto; position: relative; }
.search input { background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 7px 12px; width: 220px; font: inherit; }
.results { position: absolute; right: 0; top: 40px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; width: 260px; z-index: 5; overflow: hidden; }
.results a { display: flex; gap: 8px; align-items: center; padding: 8px 12px; }
.results a:hover { background: var(--panel); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card h2 { margin: 0 0 12px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(4, 1fr); margin-bottom: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.tile .v { font-size: 26px; font-weight: 900; }
.tile .k { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; color: var(--dim); font: inherit; font-size: 14px; font-weight: 700;
  padding: 6px 8px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.tabs button.on { background: var(--panel2); color: var(--gold); }
.row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; }
.row:nth-child(odd) { background: #ffffff06; }
.row .n { width: 22px; text-align: right; color: var(--dim); font-weight: 800; }
.row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row .name .sub { display: block; font-weight: 400; font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.row .pts { font-weight: 800; color: var(--accent); }
.row.first .n, .row.first .pts { color: var(--gold); }
.muted { color: var(--dim); }
.small { font-size: 12px; }
.fl { width: 24px; height: 18px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px #ffffff22; flex: none; }
.fl.big { width: 120px; height: 90px; border-radius: 10px; }
.fl.mid { width: 52px; height: 39px; border-radius: 6px; }
.flags { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.flagcell { text-align: center; font-size: 12px; }
.flagcell img { width: 100%; aspect-ratio: 4/3; height: auto; border-radius: 6px; box-shadow: 0 0 0 1px #ffffff22; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.hero { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.hero h1 { margin: 0; font-size: 30px; }
svg.chart { width: 100%; height: 140px; display: block; }
.empty { color: var(--dim); padding: 30px; text-align: center; }
/* Home: the live information (its parts side by side), then the stream full width, then the chat. */
.liveinfo { margin-bottom: 14px; }
.livecols { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.player.wide { margin-bottom: 14px; }
.player { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .off { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); text-align: center; padding: 20px; }
.chat iframe { width: 100%; height: 520px; border: 0; border-radius: var(--r); background: #fff; }
.chatbtn { width: 100%; margin-bottom: 14px; background: var(--panel); border: 1px dashed var(--accent); color: var(--accent);
  padding: 12px; border-radius: var(--r); font: inherit; font-weight: 800; cursor: pointer; }
.status { font-size: 18px; font-weight: 800; margin: 6px 0 10px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--panel2); color: var(--dim); font-size: 12px; font-weight: 700; margin-right: 4px; }
.badges { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.badge { background: var(--panel2); border-radius: 12px; padding: 10px; text-align: center; }
.badge .i { font-size: 30px; }
.badge.off { opacity: .35; filter: grayscale(1); }
.badge .b { font-weight: 800; font-size: 13px; }
.passport { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); margin: 8px 0 14px; }
.passport a { display: block; position: relative; }
.passport img { width: 100%; aspect-ratio: 4/3; height: auto; border-radius: 4px; box-shadow: 0 0 0 1px #ffffff22; display: block; }
.passport a.no img { filter: grayscale(1) brightness(.5); opacity: .28; }
.passport a.yes:hover img { box-shadow: 0 0 0 2px var(--accent); }
.passport b { position: absolute; right: 2px; bottom: 1px; font-size: 10px; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.tierhead { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; margin-top: 6px; }
.bar.big { height: 10px; border-radius: 5px; margin: 6px 0 4px; }
.share { background: var(--panel2); border: 1px solid var(--line); color: var(--text); padding: 7px 12px; border-radius: 10px;
  font: inherit; font-weight: 700; cursor: pointer; margin-left: auto; }

/* Lists keep one size whatever they hold, and scroll inside it. */
.scroll { height: 440px; overflow-y: auto; padding-right: 4px; }
.scroll.md { height: 300px; }
.scroll.sm { height: 220px; }
.scroll::-webkit-scrollbar { width: 6px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.scroll { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.map svg { width: 100%; height: auto; display: block; }
.map path { stroke: #070910; stroke-width: .4; }
.map path:hover { stroke: #fff; stroke-width: 1; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); margin-top: 8px; }
.legend i { flex: 1; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #1b3a33, #5ce6a0); max-width: 220px; }
footer { color: var(--dim); font-size: 12px; margin-top: 30px; text-align: center; }
@media (max-width: 560px) { .search { margin-left: 0; width: 100%; } .search input { width: 100%; } .watch { margin-left: 0; }
  .tiles { grid-template-columns: repeat(2, 1fr); } .tile .v { font-size: 22px; } }
[x-cloak] { display: none !important; }
/* The mode switch: flags, borders, or both. */
/* Pinned to the bottom of the screen, so it is at hand on every scroll position. */
.modes { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 3px;
  box-shadow: 0 8px 28px #000a; }
body { padding-bottom: 72px; }
.modes button { background: none; border: 0; color: var(--dim); font: inherit; font-weight: 700; font-size: 14px; padding: 8px 16px;
  border-radius: 8px; cursor: pointer; }
.modes button.on { background: var(--panel2); color: var(--gold); }
/* "Your day": today's numbers with the change since yesterday. */
.daytiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.delta { font-size: 13px; font-weight: 800; margin-left: 6px; vertical-align: 3px; }
.delta.up { color: var(--accent); } .delta.down { color: var(--red); }
/* On a card that counts both modes whatever the switch says. */
.both { font-size: 10px; letter-spacing: .5px; color: var(--dim); border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 6px; margin-left: 6px; text-transform: none; vertical-align: 1px; }

/* A channel member's page header: a moving frame in their theme, their banner flag faint behind, their badge. */
.hero.member { position: relative; padding: 16px 18px; border-radius: var(--r); background: var(--panel); isolation: isolate; }
.hero.member::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; background: var(--frame); background-size: 200% 100%;
  animation: frame-run 6s linear infinite; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask-composite: exclude; z-index: -1; }
.hero.member::after { content: ""; position: absolute; inset: 2px; border-radius: inherit; background: var(--banner, none) right center / auto 140% no-repeat;
  opacity: 0.16; z-index: -2; }
.memberbadge { display: inline-block; margin: 4px 0 2px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
  color: var(--tier); border: 1px solid var(--tier); background: color-mix(in srgb, var(--tier) 12%, transparent); }
@keyframes frame-run { from { background-position: 0% 0; } to { background-position: 200% 0; } }
@media (prefers-reduced-motion: reduce) { .hero.member::before { animation: none; } }

/* The offline player's video: its thumbnail and a play button until clicked. */
.facade { position: absolute; inset: 0; padding: 0; border: 0; background: #000; cursor: pointer; color: #fff; font: inherit; }
.facade img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.facade:hover img { opacity: 1; }
.facade-top { position: absolute; top: 12px; left: 14px; right: 14px; text-align: left; font-size: 13px; color: var(--dim); text-shadow: 0 1px 3px #000; }
.facade-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 76px; height: 54px; border-radius: 14px;
  background: #ff0033; display: grid; place-items: center; font-size: 26px; box-shadow: 0 4px 20px rgba(0,0,0,.5); }
.facade-title { position: absolute; left: 14px; right: 14px; bottom: 12px; text-align: left; font-weight: 800; font-size: 18px; text-shadow: 0 2px 6px #000; }
/* More from the channel: a row of cards that scrolls sideways on a phone. */
.vidstrip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.vid { display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; scroll-snap-align: start; }
.vid-thumb { position: relative; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #000; }
.vid-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.vid:hover .vid-thumb img { transform: scale(1.04); }
.vid-dur { position: absolute; right: 6px; bottom: 6px; padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,.8); font-size: 12px; font-weight: 700; }
.vid-title { font-weight: 700; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
