/* ==========================================================================
   Clan Hub: light/dark, system-font, Apple-style
   ========================================================================== */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;

  --bg: #f5f5f7;
  --hero-top: #ffffff;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --line: rgba(0, 0, 0, .08);
  --fill: rgba(0, 0, 0, .04);
  --fill-2: rgba(0, 0, 0, .08);
  --nav-bg: rgba(245, 245, 247, .72);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 0, 0, .06);

  --accent: #0071e3;
  --accent-ink: #ffffff;
  --accent-soft: rgba(0, 113, 227, .10);
  --accent-2: color-mix(in srgb, var(--accent) 38%, var(--surface));
  --opp: #b4b4bb;
  --opp-2: color-mix(in srgb, var(--opp) 45%, var(--surface));
  --track: rgba(0, 0, 0, .07);

  --good: #1f8a3b;  --good-bg: rgba(48, 209, 88, .16);
  --bad: #d70015;   --bad-bg: rgba(255, 59, 48, .13);
  --warn: #a05a00;  --warn-bg: rgba(255, 159, 10, .17);
  --star: #ff9f0a;

  /* ordinal ramp for 3/2/1/0-star attacks: more stars = darker */
  --s3: #1c5cab; --s2: #3987e5; --s1: #86b6ef; --s0: rgba(0, 0, 0, .13);

  --gutter: clamp(16px, 5vw, 28px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --hero-top: #0b0b0d; --surface: #1c1c1e; --text: #f5f5f7; --text-2: #a1a1a6;
    --line: rgba(255, 255, 255, .12); --fill: rgba(255, 255, 255, .07); --fill-2: rgba(255, 255, 255, .13);
    --nav-bg: rgba(0, 0, 0, .68); --shadow: 0 0 0 1px rgba(255, 255, 255, .06);
    --accent: #2997ff; --accent-soft: rgba(41, 151, 255, .16); --opp: #5b5b62; --track: rgba(255, 255, 255, .13);
    --good: #30d158; --good-bg: rgba(48, 209, 88, .18); --bad: #ff6961; --bad-bg: rgba(255, 69, 58, .2);
    --warn: #ffb340; --warn-bg: rgba(255, 159, 10, .2);
    --s3: #b7d3f6; --s2: #6da7ec; --s1: #3987e5; --s0: rgba(255, 255, 255, .2);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --hero-top: #0b0b0d; --surface: #1c1c1e; --text: #f5f5f7; --text-2: #a1a1a6;
  --line: rgba(255, 255, 255, .12); --fill: rgba(255, 255, 255, .07); --fill-2: rgba(255, 255, 255, .13);
  --nav-bg: rgba(0, 0, 0, .68); --shadow: 0 0 0 1px rgba(255, 255, 255, .06);
  --accent: #2997ff; --accent-soft: rgba(41, 151, 255, .16); --opp: #5b5b62; --track: rgba(255, 255, 255, .13);
  --good: #30d158; --good-bg: rgba(48, 209, 88, .18); --bad: #ff6961; --bad-bg: rgba(255, 69, 58, .2);
  --warn: #ffb340; --warn-bg: rgba(255, 159, 10, .2);
  --s3: #b7d3f6; --s2: #6da7ec; --s1: #3987e5; --s0: rgba(255, 255, 255, .2);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.47 var(--font); letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.wrap { max-width: 1040px; margin-inline: auto; padding-inline: var(--gutter); }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 600; }
.muted { color: var(--text-2); }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20; background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; object-fit: contain; flex: none; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-right: -8px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  background: none; border: 0; cursor: pointer; padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  font-size: 14px; color: var(--text-2);
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); background: var(--fill-2); font-weight: 500; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(var(--hero-top), var(--bg)); text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 420px; pointer-events: none;
  background: radial-gradient(55% 100% at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 75%);
}
.hero-inner { position: relative; padding-block: 56px 8px; }
.hero .badge { width: clamp(96px, 22vw, 132px); height: auto; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .25)); }
.eyebrow { margin-top: 18px; font-size: 14px; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.hero h1 { margin-top: 6px; font-size: clamp(38px, 9vw, 76px); line-height: 1.04; font-weight: 700; letter-spacing: -.035em; text-wrap: balance; overflow-wrap: anywhere; }
.lede { max-width: 640px; margin: 18px auto 0; font-size: clamp(16px, 2.4vw, 21px); line-height: 1.38; color: var(--text-2); white-space: pre-line; letter-spacing: -.016em; }
.cta { margin-top: 24px; display: flex; gap: 20px; justify-content: center; align-items: center; flex-wrap: wrap; }
.btn { border: 0; cursor: pointer; border-radius: 999px; padding: 10px 20px; font-size: 15px; font-weight: 500; background: var(--accent); color: var(--accent-ink); transition: filter .15s, transform .15s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.link { font-size: 17px; }
.link::after { content: " ›"; }

.specs { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 860px; margin: 48px auto 0; }
.spec { padding: 4px 12px; border-left: 1px solid var(--line); }
.spec:first-child { border-left: 0; }
.spec .v { font-size: clamp(28px, 5vw, 44px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.spec .v small { font-size: .5em; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.spec .l { margin-top: 2px; font-size: 13px; color: var(--text-2); }

.pills { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border-radius: 999px; padding: 5px 13px; font-size: 13px; color: var(--text-2); box-shadow: 0 0 0 1px var(--line); }
.pill b { color: var(--text); font-weight: 600; }
.pill img { width: 18px; height: 18px; object-fit: contain; }

.form-strip { margin-top: 28px; display: inline-flex; flex-direction: column; align-items: center; gap: 8px; }
.form-strip .cap { font-size: 12px; color: var(--text-2); }
.form { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.fd { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 700; cursor: default; }
.fd.win { background: var(--good-bg); color: var(--good); }
.fd.lose { background: var(--bad-bg); color: var(--bad); }
.fd.tie { background: var(--fill-2); color: var(--text-2); }

/* ---------- Layout ---------- */
#view { padding-block: 40px 72px; min-height: 55vh; }
.section-head { margin: 56px 0 18px; }
.section-head:first-child { margin-top: 0; }
.section-head h2 { font-size: clamp(26px, 4.2vw, 34px); font-weight: 700; letter-spacing: -.03em; line-height: 1.12; }
.section-head p { margin-top: 4px; color: var(--text-2); font-size: 17px; }
.card { background: var(--surface); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.card-title { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.card-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.stack-gap > * + * { margin-top: 16px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border-radius: 20px; padding: 18px 20px; box-shadow: var(--shadow); }
.kpi .v { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.kpi .l { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* ---------- Chart parts ---------- */
.ring { position: relative; width: var(--size, 132px); aspect-ratio: 1; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ring .trk { stroke: var(--track); }
.ring .val { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: var(--c); stroke-dashoffset: var(--off); }
.ring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-c b { font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.ring-c span { font-size: 12px; color: var(--text-2); }

.bar { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; width: var(--w); border-radius: 999px; background: var(--accent); transform-origin: left; }

.hrow { display: grid; grid-template-columns: minmax(64px, 104px) 1fr auto; gap: 12px; align-items: center; padding: 7px 0; font-size: 14px; }
.hrow .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.hrow .bar { height: 10px; }
.hrow .bar > i { border-radius: 2px 5px 5px 2px; }

.cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; align-items: end; margin-top: 18px; }
.col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; background: none; border: 0; padding: 0; font-size: 12px; }
.col .cv { font-weight: 600; font-size: 12px; white-space: nowrap; }
.col i { display: block; width: min(100%, 28px); height: var(--h); min-height: 3px; border-radius: 6px 6px 0 0; background: var(--accent); transform-origin: bottom; }
.col.dim i { background: var(--opp); }
.col .cx { color: var(--text-2); font-size: 12px; margin-top: 2px; white-space: nowrap; }
button.col { cursor: pointer; }
button.col:hover i { filter: brightness(1.12); }
.col.on .cx { color: var(--text); font-weight: 600; }
.axis { border-top: 1px solid var(--line); }

.tug { margin-top: 16px; }
.tug-l { text-align: center; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.tug-row { display: grid; grid-template-columns: minmax(56px, auto) 1fr minmax(56px, auto); gap: 12px; align-items: center; }
.tug-row b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tug-row b:last-child { text-align: right; color: var(--text-2); }
.tug-bar { display: flex; gap: 2px; height: 12px; }
.tug-bar i { flex: var(--f) 1 0; min-width: 0; }
.tug-bar .us { background: var(--accent); border-radius: 999px 4px 4px 999px; transform-origin: left; }
.tug-bar .them { background: var(--opp); border-radius: 4px 999px 999px 4px; transform-origin: right; }

.segbar { display: flex; gap: 2px; height: 16px; margin-top: 14px; }
.segbar i { flex: var(--f) 1 0; min-width: 0; transform-origin: left; }
.segbar i:first-child { border-radius: 8px 3px 3px 8px; }
.segbar i:last-child { border-radius: 3px 8px 8px 3px; }
.segbar i:only-child { border-radius: 8px; }
.s3 { background: var(--s3); } .s2 { background: var(--s2); } .s1 { background: var(--s1); } .s0 { background: var(--s0); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend em { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b { color: var(--text); font-variant-numeric: tabular-nums; }

.stack { display: flex; gap: 2px; height: 12px; }
.stack i { display: block; height: 100%; min-width: 0; transform-origin: left; }
.stack i:first-child { border-radius: 3px 0 0 3px; } .stack i:last-child { border-radius: 0 6px 6px 0; } .stack i:only-child { border-radius: 3px 6px 6px 3px; }
.stack .a { background: var(--opp); } .stack .b { background: var(--opp-2); }
.me .stack .a { background: var(--accent); } .me .stack .b { background: var(--accent-2); }
.crow { display: grid; grid-template-columns: 26px minmax(80px, 190px) 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; margin-inline: -10px; border-radius: 12px; font-size: 14px; }
.crow.me { background: var(--accent-soft); }
.crow .rk { color: var(--text-2); text-align: center; font-variant-numeric: tabular-nums; }
.crow .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .tot { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }

.meter { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.meter .bar { flex: 1; height: 6px; }
.meter span { font-size: 12px; color: var(--text-2); width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.inbar { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.inbar .bar { flex: 1; height: 6px; }
.inbar span { min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Controls ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] {
  flex: 1 1 200px; max-width: 340px; min-width: 0; border: 0; border-radius: 12px; padding: 9px 14px 9px 14px; font: inherit;
  color: var(--text); background: var(--fill-2); letter-spacing: inherit;
}
.toolbar input::placeholder { color: var(--text-2); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--fill-2); border-radius: 11px; }
.seg button { border: 0; background: none; padding: 5px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--text-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 3px rgba(0, 0, 0, .16); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 11px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
thead th { font-size: 12px; font-weight: 500; color: var(--text-2); letter-spacing: 0; padding-block: 14px 10px; }
th button { all: unset; cursor: pointer; }
th button:hover { color: var(--text); }
th button:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
th[aria-sort="ascending"] button::after { content: " ↑"; color: var(--accent); }
th[aria-sort="descending"] button::after { content: " ↓"; color: var(--accent); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--fill); }
tr.low td.don { color: var(--bad); }
tr.me td:first-child { box-shadow: inset 3px 0 var(--accent); }
.foot-note { font-size: 12px; color: var(--text-2); margin: 10px 6px 0; }
.who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.who img { width: 24px; height: 24px; object-fit: contain; flex: none; }
.role { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--fill-2); color: var(--text-2); }
.role.leader { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.role.coLeader { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.role.admin { background: var(--warn-bg); color: var(--warn); }
.th { display: inline-grid; place-items: center; min-width: 28px; height: 22px; padding: 0 7px; border-radius: 7px; background: var(--fill-2); font-weight: 600; font-size: 13px; }
.stars { color: var(--star); letter-spacing: 1px; }
.stars .off { color: var(--fill-2); }
.pending { color: var(--text-2); }
.missed { color: var(--bad); }

/* ---------- War ---------- */
.war-hero { padding: clamp(20px, 4vw, 36px); }
.war-top { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.state-pill { font-size: 12px; font-weight: 600; padding: 3px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); letter-spacing: 0; }
.state-pill.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; animation: pulse 1.8s ease-in-out infinite; }
.timer { font-size: clamp(22px, 4vw, 30px); font-weight: 700; letter-spacing: -.03em; }
.war-score { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "a c b"; gap: 12px; align-items: center; margin-top: 22px; }
.team { text-align: center; min-width: 0; }
.team.a { grid-area: a; } .team.b { grid-area: b; } .war-score .vs { grid-area: c; color: var(--text-2); font-size: 15px; text-align: center; }
.card + .notice, .card + .grid2 { margin-top: 16px; }
/* Two lineups side by side. Wider than the 1040px page column so neither table needs to scroll;
   when the window is too narrow for two columns they stack instead. */
.lineups {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr)); gap: 16px;
  position: relative; left: 50%; transform: translateX(-50%); width: min(1240px, 100vw - 2 * var(--gutter));
}
.lineups > section { min-width: 0; }
.lineup th, .lineup td { padding: 10px 10px; }
.team img { width: clamp(52px, 10vw, 76px); height: clamp(52px, 10vw, 76px); object-fit: contain; }
.team .tn { font-size: 16px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; overflow-wrap: anywhere; }
.team .big { font-size: clamp(56px, 14vw, 104px); font-weight: 700; letter-spacing: -.045em; line-height: 1; margin-top: 4px; }
.team .big small { font-size: .32em; color: var(--star); letter-spacing: 0; margin-left: 2px; }
.team.b .big { color: var(--text-2); }
.war-meta { margin-top: 22px; }
.time-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }

.notice { border-radius: 18px; padding: 16px 20px; margin-bottom: 16px; background: var(--warn-bg); }
.notice h3 { font-size: 15px; font-weight: 600; color: var(--warn); }
.notice.err { background: var(--bad-bg); } .notice.err h3 { color: var(--bad); }
.notice.ok { background: var(--good-bg); } .notice.ok h3 { color: var(--good); }
.notice ol { margin: 8px 0 0; padding-left: 20px; }
.notice code { background: var(--fill-2); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.names { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.name-chip { background: var(--surface); border-radius: 999px; padding: 3px 12px; font-size: 13px; }

.matchup { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; }
.matchup.mine { background: var(--accent-soft); }
.matchup .t { display: flex; gap: 8px; align-items: center; min-width: 0; }
.matchup .t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matchup .t.r { flex-direction: row-reverse; text-align: right; }
.matchup img { width: 26px; height: 26px; flex: none; object-fit: contain; }
.matchup .score { font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; min-width: 64px; }
details.round { background: var(--surface); border-radius: 18px; padding: 0 20px; box-shadow: var(--shadow); }
details.round + details.round { margin-top: 10px; }
details.round summary { cursor: pointer; padding: 15px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; list-style: none; }
details.round summary::-webkit-details-marker { display: none; }
details.round summary::after { content: "⌄"; color: var(--text-2); order: 3; transition: transform .2s; }
details.round[open] summary::after { transform: rotate(180deg); }
details.round > div { padding-bottom: 14px; }

.result { font-weight: 600; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.result.win { background: var(--good-bg); color: var(--good); }
.result.lose { background: var(--bad-bg); color: var(--bad); }
.result.tie { background: var(--fill-2); color: var(--text-2); }

.row-flex { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.empty { text-align: center; padding: 72px 16px; color: var(--text-2); }
.empty h2 { color: var(--text); font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin-bottom: 6px; }
.empty p { font-size: 17px; max-width: 46ch; margin-inline: auto; }
.loading { color: var(--text-2); padding: 72px 0; text-align: center; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-2); font-size: 12px; padding-block: 22px 32px; border-top: 1px solid var(--line); }

/* ---------- Tooltip ---------- */
#tip {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; max-width: 260px;
  background: rgba(29, 29, 31, .94); color: #f5f5f7; padding: 7px 11px; border-radius: 10px; font-size: 12.5px; line-height: 1.4;
  white-space: pre-line; box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}
[data-tip] { outline-offset: 3px; }

/* ---------- Motion (only on tab entry, never on the 60s refresh) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes growX { from { transform: scaleX(0); } }
@keyframes growY { from { transform: scaleY(0); } }
@keyframes ring { from { stroke-dashoffset: var(--c); } }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: no-preference) {
  #view[data-anim="on"] > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  #view[data-anim="on"] > *:nth-child(2) { animation-delay: .07s; }
  #view[data-anim="on"] > *:nth-child(3) { animation-delay: .14s; }
  #view[data-anim="on"] > *:nth-child(4) { animation-delay: .21s; }
  #view[data-anim="on"] > *:nth-child(n+5) { animation-delay: .28s; }
  #view[data-anim="on"] .bar > i, #view[data-anim="on"] .tug-bar i, #view[data-anim="on"] .segbar i, #view[data-anim="on"] .stack i { animation: growX .9s cubic-bezier(.2, .8, .2, 1) both .15s; }
  #view[data-anim="on"] .col i { animation: growY .8s cubic-bezier(.2, .8, .2, 1) both .15s; }
  #view[data-anim="on"] .ring .val { animation: ring 1.2s cubic-bezier(.2, .8, .2, 1) both .15s; }
  .hero:not(.done) .hero-inner > * { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
  .hero:not(.done) .hero-inner > *:nth-child(2) { animation-delay: .05s; } .hero:not(.done) .hero-inner > *:nth-child(3) { animation-delay: .1s; }
  .hero:not(.done) .hero-inner > *:nth-child(4) { animation-delay: .15s; } .hero:not(.done) .hero-inner > *:nth-child(n+5) { animation-delay: .2s; }
  .card, .kpi, .table-wrap { transition: box-shadow .2s; }
}

@media (max-width: 720px) {
  .lineup th, .lineup td { padding: 9px 6px; }
  .lineup .pc { display: none; }
  .lineup td.pl { max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
  .brand span { display: none; }
  .specs { grid-template-columns: repeat(2, 1fr); row-gap: 22px; }
  .spec:nth-child(3) { border-left: 0; }
  .war-score { grid-template-columns: 1fr 1fr; grid-template-areas: "c c" "a b"; }
  .war-score .vs { margin-bottom: -4px; }
  .crow { grid-template-columns: 22px minmax(70px, 130px) 1fr auto; gap: 8px; }
  .foot { flex-direction: column; }
  .card { padding: 20px; border-radius: 20px; }
}

@media (max-width: 420px) {
  .lineup { font-size: 13px; }
  .lineup th, .lineup td { padding: 9px 4px; }
  .lineup td.pl { max-width: 70px; }
  .lineup .stars { letter-spacing: 0; }
}
@media (max-width: 340px) {
  .lineup th, .lineup td { padding: 9px 3px; }
  .lineup td.pl { max-width: 56px; }
}
