/* 瓦查查 v2 — editorial, poster-like. Monochrome ink + bone, square geometry, hairlines,
   big numerals. Colour comes from the game itself (maps, agents), not from UI chrome. */
:root, :root[data-theme="dark"] {
  --bg: #0a0a0b;
  --bg-grid: transparent;
  --surface: #121214;
  --surface-2: #18181b;
  --surface-3: #222226;
  --line: rgba(236, 232, 225, .08);
  --line-strong: rgba(236, 232, 225, .16);
  --text: #ece8e1;
  --text-2: #b9b4ab;
  --muted: #7c786f;
  --accent: #ece8e1;
  --accent-ink: #0a0a0b;
  --accent-soft: rgba(236, 232, 225, .08);
  --amber: #f0c36a;
  --amber-soft: rgba(240, 195, 106, .12);
  --win: #5fd39b;
  --win-soft: rgba(95, 211, 155, .1);
  --loss: #f06a6a;
  --loss-soft: rgba(240, 106, 106, .1);
  --shadow: none;
  --radius: 6px;
  --radius-sm: 4px;
  --display: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f1eee8;
  --surface: #faf8f4;
  --surface-2: #ece8e1;
  --surface-3: #e2ddd4;
  --line: rgba(10, 10, 11, .09);
  --line-strong: rgba(10, 10, 11, .18);
  --text: #111112;
  --text-2: #3d3b37;
  --muted: #7a766e;
  --accent: #111112;
  --accent-ink: #f1eee8;
  --accent-soft: rgba(10, 10, 11, .06);
  --amber: #a8730f;
  --amber-soft: rgba(168, 115, 15, .1);
  --win: #1f8f5c;
  --win-soft: rgba(31, 143, 92, .09);
  --loss: #c4413f;
  --loss-soft: rgba(196, 65, 63, .08);
  color-scheme: light;
}

body { background: var(--bg); letter-spacing: .01em; }
::selection { background: var(--text); color: var(--bg); }

/* Calm the chrome: no glow, no gradient text, no letter-spaced mono kickers */
.eyebrow { font: 600 12px/1 var(--sans); letter-spacing: .12em; color: var(--muted); text-transform: none; }
.eyebrow::before, .eyebrow::after { display: none; }
.card, .mrow, .lrow, .fc, .kpi, .stat, .side-card, .palette-panel, .sf-box, .field, .btn, .badge, .pick, .icon-btn, .search-trigger, .seg, .seg button, .lb-pager .pages button {
  border-radius: var(--radius) !important;
}
.card { background: var(--surface); border-color: var(--line); box-shadow: none; }
.btn { font-weight: 700; letter-spacing: .02em; }
.btn.ghost { background: transparent; border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--text); }
.badge { background: transparent; border: 1px solid var(--line-strong); color: var(--text-2); font-family: var(--sans); font-weight: 600; }
.badge.mvp { background: var(--amber); color: #1a1206; border: 0; }
.badge.win { border-color: transparent; background: var(--win-soft); }
.badge.loss { border-color: transparent; background: var(--loss-soft); }

/* Header: thin, quiet */
.header { background: color-mix(in srgb, var(--bg) 86%, transparent); border-bottom-color: var(--line); }
.header .wrap { height: 58px; }
.brand { font-size: 17px; letter-spacing: .06em; }
.brand svg { display: none; }
.brand::before {
  content: "瓦"; display: grid; place-items: center; width: 28px; height: 28px; margin-right: 2px;
  background: var(--text); color: var(--bg); font-weight: 900; font-size: 16px; border-radius: 4px;
}
.brand small { font-family: var(--sans); letter-spacing: .3em; font-size: 9px; }
.nav a { border-radius: 4px; }
.nav a.active { background: transparent; color: var(--text); box-shadow: inset 0 -2px 0 var(--text); border-radius: 0; }
.pill { border-radius: 4px; font-family: var(--sans); letter-spacing: .04em; }
.notice { background: var(--surface); color: var(--amber); font-weight: 600; }
.nav-count { background: var(--text); color: var(--bg); }
.footer { border-top-color: var(--line); }

/* Search pieces use ink-on-bone buttons */
.sf-go { background: var(--text); color: var(--bg); }
.sf-hash { background: transparent; color: var(--text); }
.sf-box:focus-within { border-color: var(--text); box-shadow: none; }
.sf-field-name svg, .sf-box:focus-within .sf-field-name svg { color: var(--muted); }

/* ============ Home: cinematic search ============ */
.is-home .header { position: absolute; left: 0; right: 0; background: linear-gradient(180deg, rgba(0,0,0,.55), transparent); border-bottom: 0; backdrop-filter: none; }
.is-home .header, .is-home .header a, .is-home .header .pill, .is-home .icon-btn { color: #ece8e1; }
.is-home .icon-btn { background: transparent; border-color: rgba(236,232,225,.25); }
.is-home .brand::before { background: #ece8e1; color: #0a0a0b; }
.is-home .nav a.active { box-shadow: none; }
/* The home header always sits on dark art, in both themes: keep hover states light-on-dark. */
.is-home .nav a:hover, .is-home .nav a.active { color: #fff; background: rgba(255,255,255,.14); }
.is-home .icon-btn:hover { color: #fff; border-color: rgba(236,232,225,.6); background: rgba(255,255,255,.1); }
.is-home .acct-chip:hover { color: #fff; border-color: rgba(236,232,225,.6); }
.is-home .pill { border-color: rgba(236,232,225,.25); }
.is-home main { padding-top: 0; }

.cine {
  position: relative; width: 100vw; margin-left: calc(50% - 50vw); min-height: min(100svh, 980px);
  display: grid; place-items: center; overflow: hidden; color: #ece8e1; isolation: isolate; background: #0a0a0b;
}
.cine-bg { position: absolute; inset: 0; z-index: -3; }
.cine-slide {
  position: absolute; inset: -4%; background: var(--art) center / cover no-repeat; opacity: 0;
  filter: grayscale(.85) contrast(1.05) brightness(.55);
  transition: opacity 1.8s ease; transform: scale(1.04);
}
.cine-slide.on { opacity: 1; animation: kenburns 14s linear both; }
@keyframes kenburns { from { transform: scale(1.04) translate3d(0, 0, 0); } to { transform: scale(1.12) translate3d(-1.5%, -1%, 0); } }
.cine::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 70% at 50% 45%, transparent 20%, rgba(10,10,11,.75) 100%),
    linear-gradient(180deg, rgba(10,10,11,.2) 0%, rgba(10,10,11,.1) 50%, #0a0a0b 100%);
}
.cine-grain {
  position: absolute; inset: -50%; z-index: -1; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: repeating-radial-gradient(circle at 17% 32%, #fff 0 .6px, transparent .6px 2.4px),
    repeating-radial-gradient(circle at 71% 63%, #000 0 .7px, transparent .7px 2.9px);
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 33% { transform: translate(-2%, 1%); } 66% { transform: translate(1%, -2%); } 100% { transform: translate(0, 0); } }
.cine-inner { width: min(1060px, 100% - 40px); padding: 120px 0 90px; text-align: center; }
.cine-kicker { margin: 0 0 34px; font-size: 13px; letter-spacing: .5em; color: rgba(236,232,225,.6); padding-left: .5em; }
.cine-hint { margin: 26px 0 0; font-size: 14px; color: rgba(236,232,225,.55); letter-spacing: .06em; }
.cine-picks { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.cine-picks .pick { background: rgba(10,10,11,.45); border-color: rgba(236,232,225,.18); color: #ece8e1; backdrop-filter: blur(6px); border-radius: 999px !important; }
.cine-picks .pick:hover { border-color: #ece8e1; }
.cine-caption {
  position: absolute; left: max(20px, calc(50% - 580px)); bottom: 34px; display: flex; gap: 14px; align-items: baseline;
  font-size: 12px; letter-spacing: .3em; color: rgba(236,232,225,.55);
}
.cine-caption b { font-size: 15px; letter-spacing: .2em; color: #ece8e1; font-weight: 700; transition: opacity .6s ease; }
.cine-scroll {
  position: absolute; right: max(20px, calc(50% - 580px)); bottom: 30px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .25em; color: rgba(236,232,225,.6);
}
.cine-scroll:hover { color: #ece8e1; }
.cine-scroll svg { width: 16px; height: 16px; transform: rotate(90deg); animation: nudge 2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: rotate(90deg) translateX(4px); } }

/* The giant inline search */
.sf-xl { color: #ece8e1; }
.sf-xl .sf-box {
  height: auto !important; padding: 0 0 14px; gap: 18px; background: transparent; border: 0; border-bottom: 2px solid rgba(236,232,225,.35);
  border-radius: 0 !important; box-shadow: none !important; transition: border-color .25s ease;
}
.sf-xl .sf-box:focus-within { border-bottom-color: #ece8e1; }
.sf-xl .sf-field-name { padding-left: 0; }
.sf-xl .sf-field-name svg { display: none; }
.sf-xl .sf-field input {
  font-size: clamp(30px, 5.4vw, 64px); font-weight: 800; letter-spacing: -.01em; color: #ece8e1; font-family: var(--display);
  caret-color: #ece8e1;
}
.sf-xl .sf-field input::placeholder { color: rgba(236,232,225,.28); font-weight: 700; }
.sf-xl .sf-hash { width: auto; height: auto; margin: 0; background: none; color: rgba(236,232,225,.45); font: 300 clamp(30px, 5.4vw, 64px)/1 var(--display); }
.sf-xl .sf-field-tag { width: clamp(120px, 17vw, 230px); }
.sf-xl .sf-field-tag input { font-family: var(--display); letter-spacing: .04em; }
.sf-xl .sf-go {
  width: clamp(58px, 6.4vw, 78px); height: clamp(58px, 6.4vw, 78px); padding: 0; border-radius: 50% !important;
  background: #ece8e1; color: #0a0a0b; font-size: clamp(20px, 2.2vw, 26px); font-weight: 900; align-self: center;
}
.sf-xl .sf-go svg { display: none; }
.sf-xl.busy .sf-go { animation: breathe 1s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.92); opacity: .7; } }
.sf-xl .sf-go:hover { transform: scale(1.05); }
.sf-xl .sf-msg { text-align: center; color: rgba(236,232,225,.7); font-size: 14px; margin-top: 16px; }
.sf-xl .sf-msg.error { color: #ff9b8f; }

/* Feed below the fold */
.wc-feed, .wc-invite { scroll-margin-top: 80px; }
.wc-invite { border-radius: var(--radius); }
.wc-invite-art .dot { border-color: var(--text); }
.wc-invite-art { color: var(--text); }

/* ============ Player page v2 ============ */
.pv { --a1: #3a3a40; --a2: #1b1b1f; }
.pv-hero {
  position: relative; width: 100vw; margin-left: calc(50% - 50vw); min-height: 460px; overflow: hidden; isolation: isolate;
  color: #ece8e1; background: #0a0a0b;
}
.pv-bg { position: absolute; inset: 0; z-index: -3; background: var(--art, none) center 35% / cover no-repeat; filter: grayscale(.5) brightness(.5); transform: scale(1.03); }
.pv-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(90deg, rgba(10,10,11,.92) 0%, rgba(10,10,11,.6) 45%, transparent 80%),
    linear-gradient(0deg, var(--bg) 0%, transparent 38%),
    radial-gradient(ellipse 60% 90% at 78% 40%, color-mix(in srgb, var(--a1) 55%, transparent), transparent 70%);
}
.pv-agent {
  position: absolute; z-index: -1; right: max(-40px, calc(50% - 720px)); bottom: -6%; height: 118%; width: auto;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,.6)); pointer-events: none; user-select: none;
  animation: agent-in .9s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes agent-in { from { opacity: 0; transform: translateX(40px); } }
.pv-inner { position: relative; display: flex; align-items: flex-end; gap: 26px; min-height: 460px; padding: 90px 0 40px; }
.pv-card { width: 112px; height: 112px; flex: none; border-radius: 4px; overflow: hidden; position: relative; background: #222226; box-shadow: 0 0 0 1px rgba(236,232,225,.15); display: grid; place-items: center; font-size: 40px; font-weight: 900; }
.pv-id { flex: 1; min-width: 0; }
.pv-kicker { display: flex; align-items: center; gap: 10px; font-size: 14px; letter-spacing: .08em; color: rgba(236,232,225,.8); }
.pv-kicker img { width: 30px; height: 30px; }
.pv-kicker b { color: #ece8e1; font-size: 15px; }
.pv-name { margin: 10px 0 6px; font: 900 clamp(40px, 6.8vw, 86px)/.95 var(--display); letter-spacing: -.03em; word-break: break-word; }
.pv-tag { font-weight: 300; color: rgba(236,232,225,.5); font-size: .42em; letter-spacing: .02em; margin-left: .25em; }
.pv-sub { font-size: 14px; color: rgba(236,232,225,.65); letter-spacing: .04em; }
.pv-sub i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--a1); margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--a1) 30%, transparent); }
.pv-actions { display: flex; gap: 8px; }
.pv-actions .btn.follow { background: #ece8e1; color: #0a0a0b; height: 42px; padding: 0 20px; }
.pv-actions .btn.follow.on { background: transparent; color: #ece8e1; border: 1px solid rgba(236,232,225,.4); }
.pv-actions .btn.ghost { color: #ece8e1; border-color: rgba(236,232,225,.3); height: 42px; width: 42px; }
.pv-actions .btn.ghost.wide { width: auto; padding: 0 16px; gap: 7px; white-space: nowrap; }
.pv-actions .btn.ghost:hover { border-color: rgba(236,232,225,.7); background: rgba(255,255,255,.08); }

/* Stat band: big numerals on hairlines */
.pv-stats { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); margin-top: 0; }
.pv-stat { padding: 22px 22px 20px 0; position: relative; }
.pv-stat + .pv-stat { padding-left: 22px; border-left: 1px solid var(--line); }
.pv-stat label { display: block; font-size: 12.5px; color: var(--muted); letter-spacing: .1em; }
.pv-stat b { display: block; margin-top: 10px; font: 800 clamp(30px, 3.6vw, 46px)/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pv-stat small { display: block; margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.pv-stat .spark { position: absolute; right: 16px; top: 22px; width: 84px; height: 34px; }
.pv-stat .spark polyline { fill: none; stroke: var(--a1); stroke-width: 2; vector-effect: non-scaling-stroke; }
.pv-stat .spark .base { stroke: var(--line-strong); }
.wr-bar { display: flex; height: 4px; margin-top: 10px; background: var(--loss); opacity: .9; width: 100%; max-width: 160px; }
.wr-bar i { background: var(--win); display: block; }

/* Section titles */
.pv-section { margin-top: 34px; }
.pv-section > h2, .list-head h2 { font: 800 20px/1.2 var(--display); letter-spacing: .02em; margin: 0 0 14px; }
.list-head { margin-top: 34px; }

/* Best match */
.best {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 20px; min-height: 210px; padding: 24px;
  border-radius: var(--radius); overflow: hidden; isolation: isolate; color: #ece8e1; cursor: pointer;
  background: #0a0a0b;
}
.best::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--art) center / cover; filter: brightness(.45) saturate(.8); transition: transform .6s ease; }
.best:hover::before { transform: scale(1.04); }
.best::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(10,10,11,.85), rgba(10,10,11,.2) 70%); }
.best .bk { font-size: 12.5px; letter-spacing: .3em; color: rgba(236,232,225,.7); }
.best .bv { font: 900 clamp(54px, 7vw, 84px)/.9 var(--display); letter-spacing: -.04em; margin: 12px 0 6px; }
.best .bv small { font-size: 16px; font-weight: 700; letter-spacing: .1em; margin-left: 8px; color: rgba(236,232,225,.7); }
.best .bm { font-size: 14px; color: rgba(236,232,225,.8); }
.best .bm b { color: #ece8e1; }
.best .bagent { height: 170px; margin: -24px -10px -24px 0; align-self: end; filter: drop-shadow(0 10px 30px rgba(0,0,0,.5)); }

/* Agent pool */
.pool { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pool-tile {
  position: relative; height: 150px; border-radius: var(--radius); overflow: hidden; isolation: isolate; padding: 12px;
  display: flex; flex-direction: column; justify-content: flex-end; color: #ece8e1;
  background: linear-gradient(160deg, var(--c1, #333), var(--c2, #111));
}
.pool-tile img { position: absolute; z-index: -1; right: -18%; top: -6%; height: 125%; width: auto; transition: transform .4s ease; }
.pool-tile:hover img { transform: scale(1.05) translateX(-4px); }
.pool-tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(10,10,11,.85) 0%, transparent 65%); }
.pool-tile b { font-size: 15px; }
.pool-tile span { font-size: 12px; color: rgba(236,232,225,.75); margin-top: 2px; font-variant-numeric: tabular-nums; }
.pool-tile .pool-wr { position: absolute; top: 10px; left: 12px; font: 800 18px/1 var(--display); }

/* Match rows: flatter, editorial */
.mrow { border-radius: var(--radius) !important; }
.mrow.win { background: linear-gradient(90deg, var(--win-soft), transparent 40%), var(--surface); }
.mrow.loss { background: linear-gradient(90deg, var(--loss-soft), transparent 40%), var(--surface); }
.mrow .kda b, .mrow .score b { font-family: var(--display); }

/* Side cards */
.side-card h3 { font: 800 15px/1.2 var(--display); letter-spacing: .04em; }
.side-card h3 small { font-family: var(--sans); letter-spacing: .1em; }
.chart .line { stroke: var(--text); }

@media (max-width: 1020px) {
  .pv-stats { grid-template-columns: repeat(3, 1fr); }
  .pv-stat:nth-child(4) { border-left: 0; padding-left: 0; }
  .pv-stat:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .cine-inner { padding: 110px 0 100px; }
  .cine-kicker { letter-spacing: .3em; margin-bottom: 24px; }
  .sf-xl .sf-box { gap: 10px; }
  .pv-hero, .pv-inner { min-height: 420px; }
  .pv-inner { flex-wrap: wrap; padding-top: 80px; gap: 16px; }
  .pv-card { width: 76px; height: 76px; }
  .pv-agent { right: -30%; opacity: .55; }
  .pv-actions { width: 100%; }
  .pv-actions .btn.follow { flex: 1; }
  .pv-stats { grid-template-columns: repeat(2, 1fr); }
  .pv-stat, .pv-stat + .pv-stat { padding: 16px 12px 14px 0; border-left: 0; }
  .pv-stat:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line); }
  .pv-stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .pv-stat .spark { display: none; }
  .best { grid-template-columns: 1fr; }
  .best .bagent { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cine-slide.on, .cine-grain, .pv-agent { animation: none !important; }
}
.sf-xl .sf-go-label { display: inline !important; }

/* fixes */
.is-home .header { top: auto; width: 100%; }
.pv-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s ease; }
.pv-card.has-img img { opacity: 1; }
.pv-card.has-img { color: transparent; }
.best { min-height: 230px; }
.best .bagent { height: 280px; margin: -60px -24px -24px 0; }
.pool-tile span { line-height: 1.35; }
@media (max-width: 640px) {
  .sf-xl .sf-box { flex-wrap: wrap; row-gap: 18px; column-gap: 10px; border-bottom: 0; padding-bottom: 0; }
  .sf-xl .sf-field-name { flex: 1 1 100%; padding-bottom: 10px; border-bottom: 2px solid rgba(236,232,225,.35); }
  .sf-xl .sf-field-tag { flex: 1; width: auto; padding-bottom: 10px; border-bottom: 2px solid rgba(236,232,225,.35); }
  .sf-xl .sf-field-name:focus-within, .sf-xl .sf-field-tag:focus-within { border-bottom-color: #ece8e1; }
  .sf-xl .sf-field input { font-size: 34px; }
  .sf-xl .sf-hash { font-size: 34px; }
}

/* Leaderboard: editorial list */
.lb-list { gap: 0; border-top: 1px solid var(--line-strong); }
.lrow, .lrow.m1, .lrow.m2, .lrow.m3 {
  background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0 !important; padding: 14px 8px;
  box-shadow: none !important;
}
.lrow:hover { transform: none; background: var(--surface); box-shadow: none; }
.lrow .medal, .lrow.m1 .medal, .lrow.m2 .medal, .lrow.m3 .medal {
  width: auto; height: auto; background: none !important; border: 0; box-shadow: none !important;
  font: 900 22px/1 var(--display); color: var(--muted); letter-spacing: -.02em; justify-content: start;
}
.lrow.m1 .medal { color: #e8c26a; }
.lrow.m2 .medal { color: #c9ccd2; }
.lrow.m3 .medal { color: #c88a5b; }
.lrow .avatar { border-radius: 4px; }
.lrow .nm { font-size: 15.5px; }
.lrow .rrbar .meter { height: 3px; background: var(--surface-3); }
.lrow .rrbar .meter i { background: var(--text); opacity: .55; }
.lrow.m1 .rrbar .meter i { background: #e8c26a; opacity: .9; }
.lrow .rr b { font-family: var(--display); font-size: 20px; }
.lrow.m1 .rr b { color: #e8c26a; }
.lb-pager { margin-top: 18px; }
.lb-pager .pages button.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.pv-stat .spark polyline:not(.base) { stroke: color-mix(in srgb, var(--a1) 40%, var(--text)); }
.pv-sub i { background: color-mix(in srgb, var(--a1) 50%, #ece8e1); }
.badge.nonstd { color: var(--muted); border-style: dashed; }

/* ---- 排位分走势: rank ladder line, one dot per game ---- */
.rrx { --rrx: var(--text); position: relative; height: 168px; margin: 6px 0 0; }
.rrx-plot { position: absolute; inset: 0; }
.rrx.has-axis .rrx-plot { left: 62px; }
.rrx svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rrx-guide { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.rrx-line { fill: none; stroke: var(--rrx); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rrx-tier {
  position: absolute; left: 0; width: 58px; white-space: nowrap; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--muted); pointer-events: none;
}
.rrx-tier img { width: 14px; height: 14px; flex: none; }
.rrx-dot {
  position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 0 0 2px var(--win); cursor: default; outline: none; transition: transform .12s ease;
}
.rrx-dot.down { box-shadow: 0 0 0 2px var(--loss); }
.rrx-dot.last { width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; background: var(--rrx); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--rrx); }
.rrx-dot:hover, .rrx-dot:focus-visible { transform: scale(1.35); z-index: 2; }
.rrx-dot::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  padding: 6px 9px; border-radius: 6px; background: var(--text); color: var(--bg); font-size: 12px; line-height: 1.3; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s ease;
}
.rrx-dot:hover::after, .rrx-dot:focus-visible::after { opacity: 1; }
.rrx-dot:first-of-type::after { left: 0; transform: none; }
.rrx-dot.last::after { left: auto; right: 0; transform: none; }
.rrx-now {
  position: absolute; right: 0; transform: translate(0, -170%); padding: 2px 7px; border-radius: 4px;
  background: var(--rrx); color: var(--bg); font: 700 11px/1.5 var(--mono); pointer-events: none;
}
.rrx.has-axis + .rrx-axis { padding-left: 62px; }
.rrx-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.rrx-chips-h { display: flex; justify-content: space-between; margin: 16px 0 8px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 12px; font-weight: 700; }
.rrx-chips-h span { font-weight: 400; color: var(--muted); }
.rrx-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.rrx-chip {
  display: grid; place-items: center; height: 26px; border-radius: 4px; background: var(--surface-2); color: var(--muted);
  font: 700 12px/1 var(--mono);
}
.rrx-chip.up { background: var(--win-soft); color: var(--win); }
.rrx-chip.down { background: color-mix(in srgb, var(--loss) 12%, transparent); color: var(--loss); }

/* ---- 上分预测 (inside the rank card) ---- */
.rforecast { margin-top: 16px; padding: 14px; border-radius: 8px; background: var(--surface-2); }
.rf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rf-kicker { font: 800 12px/1 var(--display); letter-spacing: .08em; color: var(--accent); }
.rf-mini { font: 600 11px/1 var(--mono); color: var(--muted); }
.rf-line { margin-top: 10px; font-size: 15px; font-weight: 600; }
.rf-line b { font-weight: 800; }
.rf-bar { position: relative; height: 8px; margin: 12px 0 20px; border-radius: 4px; background: var(--surface-3); }
.rf-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent)); }
.rf-from, .rf-to { position: absolute; top: 13px; font-size: 11px; color: var(--muted); }
.rf-from { left: 0; } .rf-to { right: 0; }
.rf-sub { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }

/* ---- 战绩海报 dialog ---- */
.poster-panel { width: min(460px, 100%); }
.poster-stage { display: grid; place-items: center; min-height: 320px; margin-top: 12px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.poster-img { display: block; width: 100%; height: auto; max-height: 68vh; object-fit: contain; }
.poster-loading { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.poster-loading .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.poster-actions { display: flex; gap: 10px; margin-top: 14px; }
.poster-actions .btn { flex: 1; justify-content: center; height: 44px; }

/* ============ First-visit introduction ============ */
.intro { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(6, 6, 8, .72); backdrop-filter: blur(10px); animation: ix-fade .25s ease both; }
.intro.closing { animation: ix-fade .2s ease reverse both; }
.intro-panel {
  position: relative; width: min(1040px, 100%); max-height: calc(100vh - 48px); overflow: auto; border-radius: 16px;
  background: var(--bg); border: 1px solid var(--line-strong); box-shadow: 0 40px 120px rgba(0, 0, 0, .55);
  animation: ix-rise .45s cubic-bezier(.2, .8, .2, 1) both; scrollbar-width: thin;
}
@keyframes ix-fade { from { opacity: 0; } }
@keyframes ix-rise { from { opacity: 0; transform: translateY(18px) scale(.985); } }
.intro-x { position: absolute; top: 14px; right: 14px; z-index: 3; background: rgba(0, 0, 0, .35); color: #fff; border-color: rgba(255, 255, 255, .2); }

.ix-hero { position: relative; padding: 64px 48px 46px; color: #ece8e1; overflow: hidden; isolation: isolate; }
.ix-hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--art) center/cover no-repeat; transform: scale(1.05); }
.ix-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(10, 10, 12, .96) 18%, rgba(10, 10, 12, .7) 55%, rgba(10, 10, 12, .35)), linear-gradient(180deg, transparent 60%, var(--bg)); }
.ix-kick { margin: 0; font: 700 13px/1 var(--sans); letter-spacing: .24em; color: rgba(236, 232, 225, .65); }
.ix-hero h2 { margin: 16px 0 0; font: 900 clamp(34px, 5.4vw, 60px)/1.04 var(--display); letter-spacing: -.02em; }
.ix-lead { max-width: 560px; margin: 18px 0 0; font-size: 16px; line-height: 1.8; color: rgba(236, 232, 225, .82); }
.ix-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.ix-cta .btn { height: 46px; padding: 0 22px; }
.ix-hero .btn.ghost { color: #ece8e1; border-color: rgba(236, 232, 225, .35); }

.ix-sec { padding: 8px 48px 34px; }
.ix-h { margin: 22px 0 16px; font: 800 13px/1 var(--sans); letter-spacing: .2em; color: var(--muted); }
.ix-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ix-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; transition: transform .2s ease, border-color .2s ease; animation: ix-rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.ix-card:nth-child(2) { animation-delay: .05s; } .ix-card:nth-child(3) { animation-delay: .1s; } .ix-card:nth-child(4) { animation-delay: .15s; }
.ix-card:nth-child(5) { animation-delay: .2s; } .ix-card:nth-child(6) { animation-delay: .25s; }
.ix-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.ix-demo { height: 150px; padding: 16px; background: linear-gradient(160deg, var(--surface-2), var(--surface)); border-bottom: 1px solid var(--line); display: grid; align-content: center; gap: 8px; overflow: hidden; }
.ix-txt { padding: 16px 18px 18px; }
.ix-n { font: 800 11px/1 var(--mono); color: var(--muted); }
.ix-txt h3 { display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; font: 800 17px/1.25 var(--display); }
.ix-txt p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--text-2); }
.ix-badge { padding: 2px 7px; border-radius: 3px; background: var(--amber); color: #1a1206; font: 800 10.5px/1.4 var(--sans); }

.ix-ag { width: 22px; height: 22px; border-radius: 4px; flex: none; background: var(--surface-3); }
.ix-who { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.ix-tag { padding: 0 6px; height: 18px; display: inline-flex; align-items: center; border-radius: 3px; font: 700 11px/1 var(--sans); }
.ix-tag.g { background: var(--win-soft); color: var(--win); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--win) 40%, transparent); }
.ix-tag.p { background: rgba(180, 140, 255, .14); color: #b48cff; box-shadow: inset 0 0 0 1px rgba(180, 140, 255, .4); }
.ix-tag.red { background: var(--loss); color: #fff; }
.ix-tag.fb { background: var(--amber-soft); color: var(--amber); }

.ix-ov { gap: 14px; }
.ix-rank { display: flex; align-items: center; gap: 10px; }
.ix-emb { width: 44px; height: 44px; filter: drop-shadow(0 4px 14px rgba(187, 61, 101, .45)); }
.ix-rank b { display: block; font: 900 20px/1.1 var(--display); }
.ix-rank small { font: 700 12px var(--mono); color: var(--muted); }
.ix-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ix-stats div { padding: 7px 6px; border-radius: 6px; background: var(--surface-3); text-align: center; }
.ix-stats small { display: block; font-size: 10.5px; color: var(--muted); }
.ix-stats b { font: 800 14px/1.3 var(--display); }

.ix-strip { display: flex; gap: 3px; }
.ix-strip i { flex: 1; height: 16px; border-radius: 2px; animation: ix-rise .4s ease both; animation-delay: var(--d); }
.ix-strip i.b { background: var(--team-blue); }
.ix-strip i.r { background: var(--team-red); }
.ix-kill { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.ix-kill b.b { color: var(--team-blue); }
.ix-kill b.r { color: var(--team-red); }
.ix-gun { padding: 0 6px; border-radius: 3px; background: var(--surface-3); color: var(--muted); font: 600 10.5px/16px var(--mono); }

.ix-ov, .ix-rd, .ix-party, .ix-tr, .ix-an, .ix-sh { display: grid; gap: 8px; }
.ix-party { grid-template-columns: 1fr 1fr; column-gap: 10px; row-gap: 8px; }
.ix-party small { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }

.ix-tr svg { width: 100%; height: 64px; display: block; }
.ix-guide { stroke: var(--line-strong); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.ix-line { fill: none; stroke: var(--win); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ix-fc span { font-size: 13.5px; font-weight: 600; }
.ix-fc b { font-weight: 800; }
.ix-fc small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }

.ix-an-row { display: flex; align-items: baseline; gap: 14px; padding: 8px 10px; border-radius: 6px; background: color-mix(in srgb, var(--loss) 10%, transparent); font-size: 12.5px; color: var(--text-2); }
.ix-an-row b { color: var(--text); font-family: var(--mono); }
.ix-an-row .ix-x { margin-left: auto; color: var(--loss); font-size: 15px; }

.ix-sh { grid-template-columns: auto 1fr; align-items: center; gap: 14px; }
.ix-poster { position: relative; width: 74px; height: 104px; padding: 8px; border-radius: 6px; background: linear-gradient(170deg, #413476, #0f1923 70%); color: #ece8e1; display: grid; align-content: end; gap: 2px; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); transform: rotate(-4deg); }
.ix-pemb { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; }
.ix-poster b { font: 900 11px/1.1 var(--display); }
.ix-poster small { font-size: 8px; opacity: .75; }
.ix-poster i { font: 800 7px var(--display); font-style: normal; opacity: .6; }
.ix-mail { display: flex; gap: 8px; padding: 9px 10px; border-radius: 8px; background: var(--surface-3); font-size: 12px; }
.ix-mail svg { width: 16px; height: 16px; flex: none; color: var(--amber); margin-top: 2px; }
.ix-mail small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

.ix-table { width: 100%; min-width: 600px; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.ix-table th, .ix-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.ix-table th:first-child, .ix-table td:first-child { text-align: left; color: var(--text-2); white-space: normal; min-width: 150px; }
.ix-table th b { display: block; font: 800 15px/1.2 var(--display); }
.ix-table th small { display: block; margin-top: 3px; font: 700 12px var(--mono); color: var(--muted); }
.ix-table .hot { background: color-mix(in srgb, var(--amber) 7%, transparent); }
.ix-table th.hot { box-shadow: inset 0 2px 0 var(--amber); }
.ix-yes { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--win-soft); color: var(--win); }
.ix-yes svg { width: 14px; height: 14px; }
.ix-no { color: var(--muted); }
.ix-foot { margin: 16px 0 0; font-size: 12px; color: var(--muted); }

@media (max-width: 860px) {
  .ix-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ix-hero { padding: 54px 26px 36px; }
  .ix-sec { padding: 4px 26px 28px; }
}
@media (max-width: 560px) {
  .intro { padding: 0; align-items: end; }
  .intro-panel { max-height: 94vh; border-radius: 16px 16px 0 0; }
  .ix-grid { grid-template-columns: 1fr; }
  .ix-hero { padding: 50px 20px 30px; }
  .ix-sec { padding: 4px 20px 26px; }
}
@media (prefers-reduced-motion: reduce) { .intro, .intro-panel, .ix-card, .ix-strip i { animation: none; } }

/* ============ Phone-width fixes (nothing may widen the page past the screen) ============ */
/* Scoreboards: grid items default to min-width:auto and would stretch to the table's width;
   let them shrink so the table scrolls inside its own .scroll-x box. */
.mx-boards > *, .mx-team-block { min-width: 0; }
/* Hidden tooltips still count towards the page width unless they are out of layout entirely. */
.rrx-dot::after, .anom-tag::after { display: none; }
.rrx-dot:hover::after, .rrx-dot:focus-visible::after, .anom-tag:hover::after, .anom-tag:focus-visible::after { display: block; }
@media (max-width: 480px) {
  .header .wrap { gap: 8px; }
}

/* ============ Loading feedback ============ */
/* Top progress bar: appears while any request takes longer than 150ms. */
#loadbar { position: fixed; top: 0; left: 0; right: 0; z-index: 200; height: 3px; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .25s ease; }
#loadbar.on { opacity: 1; }
#loadbar i {
  position: absolute; top: 0; bottom: 0; left: 0; width: 38%; border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, transparent, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff));
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent);
  animation: loadbar 1.15s cubic-bezier(.45, .05, .55, .95) infinite;
}
@keyframes loadbar { from { transform: translateX(-110%); } to { transform: translateX(290%); } }

/* Inline "正在加载…" note with a ring spinner. */
.load-note {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin: 22px auto 4px; padding: 12px 18px;
  width: fit-content; max-width: 100%; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font-size: 14px; font-weight: 600; box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
  animation: ld-in .3s ease both;
}
.load-note.compact { margin: 6px auto 12px; padding: 9px 14px; font-size: 13px; box-shadow: none; }
.load-note .ld-text { display: grid; gap: 2px; }
.load-note small { font-size: 12px; font-weight: 500; color: var(--muted); animation: ld-in .3s ease both; }
.ld-ring {
  width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--accent) 22%, transparent); border-top-color: var(--accent);
  animation: spin .75s linear infinite;
}
.ld-ring.sm { width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: -2px; margin-right: 8px; }
@keyframes ld-in { from { opacity: 0; transform: translateY(4px); } }

/* Search message while looking a player up gets the same spinner. */
.sf-msg.busy { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.sf-msg.busy::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: spin .75s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  #loadbar i { animation-duration: 2.5s; }
  .ld-ring, .sf-msg.busy::before { animation-duration: 1.6s; }
}

/* Full-bleed heroes use 100vw, which includes a classic desktop scrollbar; clip the few pixels it adds
   (clip, unlike hidden, keeps the sticky header working). */
html { overflow-x: clip; }
