/* ===== Font: Poppins (SIL OFL, fonts/OFL.txt), self-hosted so pages don't wait on a third-party server ===== */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/poppins-latin-400-normal.woff2) 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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/poppins-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/poppins-latin-500-normal.woff2) 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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/poppins-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/poppins-latin-600-normal.woff2) 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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/poppins-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/poppins-latin-700-normal.woff2) 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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/poppins-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ===== Tokens ===== */
:root {
  color-scheme: light;
  --bg: #f3f4f8;
  --surface: #ffffff;
  --surface-2: #f5f6fa;
  --surface-3: #eceef5;
  --line: #e7e9f0;
  --ink: #1f2440;
  --ink-2: #5b6180;
  --ink-3: #9aa0b8;
  --accent: #ef4b4b;
  --accent-hover: #e03d3d;
  --accent-soft: #fde8e8;
  --accent-ink: #ffffff;
  --blue: #3561c4;
  --blue-soft: #e6efff;
  --blue-line: #6fa8f2;
  --purple: #6a3fc4;
  --purple-soft: #efe6ff;
  --good: #1f9d55;
  --good-soft: #e3f6ea;
  --bad: #d64545;
  --bad-soft: #fde8e8;
  --gold: #8a6200;  --gold-soft: #ffe9a8;
  --silver: #5b6180; --silver-soft: #e5e8f0;
  --bronze: #8a4a17; --bronze-soft: #f6d9c0;
  --ring: rgba(31, 36, 64, .035);
  --shadow: 0 10px 30px rgba(31, 36, 64, .07);
  --shadow-hover: 0 16px 36px rgba(31, 36, 64, .12);
  --sprite-shadow: drop-shadow(0 6px 6px rgba(31, 36, 64, .15));
  --radius: 18px;
  --radius-sm: 10px;
  --logo-ink: #1f2440;

  --t-normal: #a8a77a; --t-fire: #f08a4b; --t-water: #6c9cf0; --t-electric: #e8bc2c;
  --t-grass: #74c35a; --t-ice: #6fcaca; --t-fighting: #d0564b; --t-poison: #a865c9;
  --t-ground: #d9a94a; --t-flying: #8fa6ee; --t-psychic: #f2668f; --t-bug: #a2b31f;
  --t-rock: #b39b34; --t-ghost: #7563a8; --t-dragon: #6f5ae6; --t-dark: #6b5a4e;
  --t-steel: #9a9fb8; --t-fairy: #e98fbf;

  --s-hp: #f05454; --s-atk: #f7a24b; --s-def: #e9bf2f; --s-spa: #6fa8f2; --s-spd: #5fc072; --s-spe: #f07fb1;

  --tier-s: #ef4b4b; --tier-a: #f7a24b; --tier-b: #e9bf2f; --tier-c: #5fc072; --tier-d: #6fa8f2; --tier-e: #9aa0b8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11131c; --surface: #1a1d2a; --surface-2: #232737; --surface-3: #2b3043; --line: #2e3346;
    --ink: #eef0f8; --ink-2: #aeb4cc; --ink-3: #757c98;
    --accent: #ff5f5f; --accent-hover: #ff7676; --accent-soft: #3b2128; --accent-ink: #ffffff;
    --blue: #8fb3ff; --blue-soft: #1f2a45; --blue-line: #5f8fe0;
    --purple: #c4a6ff; --purple-soft: #2e2445;
    --good: #5fd08e; --good-soft: #1b3326; --bad: #ff7a7a; --bad-soft: #3b2128;
    --gold: #ffd76a; --gold-soft: #4a3b10; --silver: #d0d5e6; --silver-soft: #343a4f; --bronze: #f3b07e; --bronze-soft: #47301d;
    --ring: rgba(255, 255, 255, .025);
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-hover: 0 16px 36px rgba(0, 0, 0, .5);
    --sprite-shadow: drop-shadow(0 6px 6px rgba(0, 0, 0, .45));
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11131c; --surface: #1a1d2a; --surface-2: #232737; --surface-3: #2b3043; --line: #2e3346;
  --ink: #eef0f8; --ink-2: #aeb4cc; --ink-3: #757c98;
  --accent: #ff5f5f; --accent-hover: #ff7676; --accent-soft: #3b2128; --accent-ink: #ffffff;
  --blue: #8fb3ff; --blue-soft: #1f2a45; --blue-line: #5f8fe0;
  --purple: #c4a6ff; --purple-soft: #2e2445;
  --good: #5fd08e; --good-soft: #1b3326; --bad: #ff7a7a; --bad-soft: #3b2128;
  --gold: #ffd76a; --gold-soft: #4a3b10; --silver: #d0d5e6; --silver-soft: #343a4f; --bronze: #f3b07e; --bronze-soft: #47301d;
  --ring: rgba(255, 255, 255, .025);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-hover: 0 16px 36px rgba(0, 0, 0, .5);
  --sprite-shadow: drop-shadow(0 6px 6px rgba(0, 0, 0, .45));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 'Poppins', system-ui, sans-serif; overflow-x: hidden;
  transition: background-color .2s, color .2s;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.footer a, .prose a { color: var(--accent); }


.shell { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 20px 16px 40px; }

/* ===== Top bar ===== */
.topbar {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px 14px 10px 18px; margin-bottom: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; flex-shrink: 0; }
.brand b { color: var(--accent); font-weight: 700; }
.brand__ball { width: 30px; height: 30px; flex-shrink: 0; display: block; }
.topbar { position: relative; z-index: 30; }
.nav { display: flex; gap: 4px; flex: 1; justify-content: center; min-width: 0; }
.nav__group { position: relative; }
.nav__item {
  position: relative; display: flex; align-items: center; gap: 2px; border: 0; background: none; cursor: pointer;
  padding: 9px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav__item b { font-weight: inherit; }
.nav__item > svg:not(.nav__chev) { display: none; }
.nav__chev { width: 18px; height: 18px; margin-right: -4px; fill: var(--ink-3); transition: transform .15s; }
.nav__group.is-open .nav__chev { transform: rotate(180deg); }
.nav__item:hover, .nav__group.is-open .nav__toggle { color: var(--ink); background: var(--surface-2); }
.nav__item.is-active { color: var(--accent); }
.nav__item.is-active .nav__chev { fill: var(--accent); }
.nav__item.is-active::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -10px; height: 3px; border-radius: 3px; background: var(--accent); }
.nav__menu {
  display: none; position: absolute; z-index: 60; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  min-width: 280px; width: max-content; max-width: min(380px, 92vw); padding: 8px; gap: 2px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-hover), 0 0 0 1px var(--line);
}
.nav__menu::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
@media (hover: hover) and (min-width: 961px) { .nav__group:hover:not(.is-suppressed) .nav__menu { display: grid; } }
.nav__group.is-open .nav__menu { display: grid; }
.nav__menu .nav__link { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 18px 8px 10px; border-radius: 12px; transition: background .15s; }
.nav__menu .nav__link:hover { background: var(--surface-2); }
.nav__menu .nav__link svg { width: 38px; height: 38px; padding: 9px; border-radius: 11px; background: var(--accent-soft); fill: var(--accent); stroke: var(--accent); }
.nav__menu b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.nav__menu small { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.nav__menu .nav__link.is-active b { color: var(--accent); }
.topbar .format-select { width: auto; max-width: 130px; flex-shrink: 0; font-size: 12.5px; font-weight: 600; padding: 7px 30px 7px 12px; border-radius: 999px; background-color: var(--surface-2); border-color: transparent; }
.format-chip { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border-radius: 999px; padding: 6px 12px; }
.theme-toggle {
  flex-shrink: 0; width: 40px; height: 40px; border: 0; border-radius: 12px; cursor: pointer;
  display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); transition: background .15s;
}
.theme-toggle:hover { background: var(--surface-3); }
.discord-link, .x-link, .donate-link { margin-right: -6px; }
.discord-link svg, .x-link svg, .donate-link svg { width: 20px; height: 20px; stroke: none; }
.x-link svg { width: 18px; height: 18px; }
.discord-link:hover { background: #5865f2; color: #fff; }
.x-link:hover { background: var(--ink); color: var(--surface); }
.donate-link { color: var(--accent); }
.donate-link:hover { background: var(--accent); color: var(--accent-ink); }
.theme-toggle[hidden] { display: none; }
/* images with a light and a dark version (article covers): the page's theme decides which one shows */
.theme-dark-only { display: none !important; }
:root[data-theme="dark"] .theme-dark-only { display: block !important; }
:root[data-theme="dark"] .theme-light-only { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-dark-only { display: block !important; }
  :root:not([data-theme="light"]) .theme-light-only { display: none !important; }
}
.theme-toggle svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

/* ===== Generic ===== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.page-head p { color: var(--ink-2); font-size: 14px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 16px; gap: 10px; }
.section-title h2 { font-size: 17px; font-weight: 600; }
.link-more { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.link-more:hover { text-decoration: underline; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--ink-3); }
.ssr { padding: 24px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.ssr h1 { font-size: 24px; margin-bottom: 6px; }
.ssr h2 { font-size: 16px; margin: 14px 0 4px; }

.type-pill {
  display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: #fff; background: var(--tc, #999);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .2); line-height: 1.5;
}
.type-pill--sm { padding: 1px 6px; font-size: 9.5px; }
.types { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
  padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 600;
  background: var(--surface-2); color: var(--ink); transition: background .15s, transform .1s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn--accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px rgba(239, 75, 75, .3); }
.btn--accent:hover { background: var(--accent-hover); }
.btn--sm { padding: 6px 10px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; fill: currentColor; }

.field { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.input, .select {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px;
  padding: 7px 10px; font-size: 13.5px; font-weight: 500; color: var(--ink); outline: none; min-width: 0;
  transition: border-color .15s;
}
.input:focus, .select:focus { border-color: var(--blue-line); }
.select {
  appearance: none; padding-right: 30px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%239aa0b8' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 6px center / 18px;
}
.select--pill { width: auto; border: 0; box-shadow: var(--shadow); border-radius: 999px; padding: 8px 34px 8px 16px; font-size: 13px; }
textarea.input { resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.5; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ===== Search + filters ===== */
.search { display: flex; align-items: center; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 6px 6px 6px 18px; margin-bottom: 16px; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; padding: 10px 0; font-size: 14px; min-width: 0; }
.search input::placeholder { color: var(--ink-3); }
.search__btn { width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--accent); flex-shrink: 0; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(239, 75, 75, .35); cursor: pointer; }
.search__btn svg { width: 20px; height: 20px; fill: #fff; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; align-items: center; }
.filters .count { margin-left: auto; font-size: 13px; color: var(--ink-3); }

/* ===== Pokédex ===== */
.dex { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 26px; align-items: start; }
.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 58px 20px; padding-top: 40px; }
.mon-card { position: relative; display: block; text-align: center; padding: 54px 12px 16px; cursor: pointer; transition: transform .18s, box-shadow .18s; }
.mon-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.mon-card.is-selected { box-shadow: 0 0 0 2px var(--accent), var(--shadow-hover); }
.mon-card__sprite { position: absolute; left: 50%; top: -44px; width: 92px; height: 92px; transform: translateX(-50%); object-fit: contain; filter: var(--sprite-shadow); transition: transform .18s; }
.mon-card:hover .mon-card__sprite { transform: translateX(-50%) scale(1.08); }
.mon-card__num { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.mon-card__name { font-size: 15.5px; font-weight: 600; margin: 2px 0 8px; line-height: 1.25; }
.mon-card__usage { margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.mon-card__usage b { color: var(--ink); font-weight: 700; }
.mon-card__rank { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.mega-tag { position: absolute; z-index: 2; top: 9px; right: 10px; font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--purple); background: var(--purple-soft); border-radius: 6px; padding: 2px 6px; }
.trend { font-size: 11px; font-weight: 700; white-space: nowrap; }
.trend--up { color: var(--good); }
.trend--down { color: var(--bad); }
.trend--new { color: var(--purple); }

.detail { position: sticky; top: 112px; margin-top: 80px; text-align: center; }
.detail__close { display: none; }
.detail__art { width: 190px; height: 190px; margin: -95px auto 0; object-fit: contain; filter: var(--sprite-shadow); }
.detail__body { padding: 0 20px 20px; max-height: calc(100vh - 112px - 95px - 20px); overflow-y: auto; border-radius: 0 0 var(--radius) var(--radius); scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.detail__num { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-top: 4px; }
.detail__name { font-size: 24px; font-weight: 700; line-height: 1.2; }
.detail__usage { display: flex; justify-content: center; gap: 6px; margin: 14px 0 4px; flex-wrap: wrap; }
.detail__usage div { background: var(--surface-2); border-radius: 12px; padding: 6px 12px; min-width: 70px; }
.detail__usage b { display: block; font-size: 15px; }
.detail__usage span { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.detail__actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.d-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 18px 0 8px; }
.ability-row { display: flex; gap: 8px; }
.ability { flex: 1; border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 500; background: var(--surface-2); display: flex; justify-content: center; gap: 6px; }
.ability small { color: var(--ink-3); font-weight: 600; }
.ability:first-child { box-shadow: inset 0 0 0 1.5px var(--blue-line); background: var(--blue-soft); }

.weak { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.weak__item { position: relative; width: 30px; height: 30px; border-radius: 50%; background: var(--tc); display: grid; place-items: center; font-size: 9px; font-weight: 700; color: #fff; text-transform: uppercase; }
.weak__item[data-x="4"]::after { content: '4×'; position: absolute; right: -6px; top: -6px; background: var(--ink); color: var(--surface); font-size: 9px; border-radius: 999px; padding: 1px 4px; }

.stats { display: flex; justify-content: center; gap: 5px; }
.stat { background: var(--surface-2); border-radius: 999px; padding: 4px 4px 8px; width: 40px; }
.stat i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 4px; background: var(--sc); color: #fff; font-style: normal; font-size: 9.5px; font-weight: 700; }
.stat b { font-size: 12.5px; }
.stat--total { background: var(--blue-soft); }
.stat--total i { background: #6f87d9; }

.bars { text-align: left; display: grid; gap: 7px; }
.bar { display: grid; grid-template-columns: 1fr auto; font-size: 13px; gap: 2px 10px; }
.bar span { font-weight: 500; }
.bar b { font-size: 12.5px; color: var(--ink-2); }
.bar__track { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bar__fill { height: 100%; border-radius: 6px; background: var(--accent); }
.bars--items .bar__fill { background: var(--blue-line); }

.spreads { display: grid; gap: 6px; }
.spread { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; text-align: left; background: var(--surface-2); border-radius: 12px; padding: 8px 12px; font-size: 12.5px; }
.spread b { font-weight: 600; }
.spread span { color: var(--ink-2); }
.spread em { font-style: normal; font-weight: 600; color: var(--ink-3); font-size: 12px; }

.mates { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.mates > * { display: block; width: 72px; border-radius: 12px; padding: 2px 0 6px; font-size: 10.5px; line-height: 1.3; color: var(--ink-2); transition: background .15s; }
.mates a:hover { background: var(--surface-2); }
.mates img { width: 48px; height: 48px; margin: 0 auto; object-fit: contain; }
.mates span { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.mates small { color: var(--ink-3); font-weight: 600; }

.counters { display: grid; gap: 6px; text-align: left; }
.counter { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 12px; background: var(--surface-2); font-size: 13px; transition: background .15s; }
a.counter:hover { background: var(--surface-3); }
.counter img { width: 40px; height: 40px; object-fit: contain; }
.counter span { font-weight: 500; }
.counter b { font-size: 12.5px; color: var(--ink-2); }
.counter small { color: var(--ink-3); font-weight: 500; }
.d-sub { font-size: 11px; font-weight: 700; color: var(--ink-2); text-align: left; margin: 12px 0 6px; }
.matchups .counter span { display: grid; min-width: 0; }
.matchup__move { font-size: 11px; color: var(--ink-3); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-card__tour { margin-top: 2px; font-size: 11px; color: var(--ink-3); }
.d-note { font-size: 11px; color: var(--ink-3); margin-top: 6px; text-align: left; }
/* long-tail Pokémon (usage under 0.05%) and unused ones */
.mega-tag--low { color: var(--ink-3); background: var(--bg-2, rgba(127,127,127,.14)); }
.d-note--low { text-align: center; margin: 10px 0 0; font-style: italic; }
.show-all { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 4px; text-align: center; }
.show-all small, .cb-unused { color: var(--ink-3); font-size: 11px; }
.cb-unused { font-style: italic; white-space: nowrap; }

.detail__nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 18px -20px -20px; padding: 10px 14px; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); font-size: 12.5px; font-weight: 600; }
.detail__nav a { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 8px; }
.detail__nav a:hover { background: var(--surface-3); }
.detail__nav img { width: 30px; height: 30px; object-fit: contain; }

/* ===== Home ===== */
.hero { position: relative; overflow: hidden; padding: 30px 32px; margin-bottom: 28px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; }
.hero h1 { font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--ink-2); margin: 10px 0 18px; max-width: 460px; }
.hero .search { box-shadow: 0 0 0 1.5px var(--line); margin: 0; max-width: 460px; }
.hero__art { position: relative; height: 210px; }
.hero__art img { position: absolute; object-fit: contain; filter: var(--sprite-shadow); }
.hero__art img:nth-child(1) { width: 200px; height: 200px; right: 30%; top: 0; z-index: 2; }
.hero__art img:nth-child(2) { width: 150px; height: 150px; right: 0; top: 40px; }
.hero__art img:nth-child(3) { width: 140px; height: 140px; right: 62%; top: 60px; }
.hero::after { content: ''; position: absolute; right: -80px; top: -80px; width: 360px; height: 360px; border-radius: 50%; background: var(--accent-soft); z-index: 0; }
.hero > * { position: relative; z-index: 1; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 34px; }
.tile { padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.tile__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); flex-shrink: 0; }
.tile__icon svg { width: 22px; height: 22px; fill: var(--accent); }
.tile b { display: block; font-size: 20px; line-height: 1.2; }
.tile span { font-size: 12px; color: var(--ink-3); font-weight: 500; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 26px; align-items: start; }
.home-grid .mon-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tools-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 34px; }
.tool-card { padding: 18px 20px; display: flex; gap: 14px; align-items: center; transition: transform .15s, box-shadow .15s; }
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.tool-card b { display: block; font-size: 15px; }
.tool-card span { font-size: 12.5px; color: var(--ink-2); }

.event-list { padding: 8px; }
.event { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; transition: background .15s; }
.event:hover { background: var(--surface-2); }
.event__date { width: 46px; flex-shrink: 0; text-align: center; border-radius: 10px; background: var(--surface-2); padding: 5px 0; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--accent); line-height: 1.2; }
.event__date b { display: block; font-size: 17px; color: var(--ink); }
.event__body { flex: 1; min-width: 0; }
.event__name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event__meta { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event__winner { display: flex; margin-top: 4px; }
.event__winner img { width: 28px; height: 28px; margin-right: -4px; object-fit: contain; }

/* ===== Tiers ===== */
.tier-list { display: grid; gap: 12px; }
.tier-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); overflow: hidden; }
.tier-row__label { display: grid; place-items: center; align-content: center; background: var(--tier); color: #fff; padding: 12px 6px; text-align: center; }
.tier-row__label b { font-size: 30px; line-height: 1; }
.tier-row__label span { font-size: 10.5px; font-weight: 600; opacity: .9; margin-top: 4px; }
.tier-row__mons { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; align-content: flex-start; }
.tier-mon { width: 92px; text-align: center; padding: 4px 2px 6px; border-radius: 12px; transition: background .15s; }
.tier-mon:hover { background: var(--surface-2); }
.tier-mon img { width: 60px; height: 60px; margin: 0 auto; object-fit: contain; }
.tier-mon span { display: block; font-size: 11.5px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tier-mon small { display: block; font-size: 10.5px; color: var(--ink-3); font-weight: 600; }
.movers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 26px; }
.movers .card { padding: 16px 18px; }
.movers h2 { font-size: 15px; margin-bottom: 10px; }
.mover { display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; align-items: center; padding: 3px 4px; border-radius: 10px; font-size: 13px; }
.mover:hover { background: var(--surface-2); }
.mover img { width: 36px; height: 36px; object-fit: contain; }
.mover span { font-weight: 500; }

/* ===== Tournaments ===== */
.tier-badge { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); }
.tier-badge--switch { background: var(--accent-soft); color: var(--accent); }
.tier-badge--showdown { background: var(--blue-soft); color: var(--blue); }
.t-list { display: grid; gap: 14px; }
.t-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 16px 20px; transition: transform .15s, box-shadow .15s; }
.t-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.t-row .event__date { width: 64px; padding: 8px 0; }
.t-row .event__date b { font-size: 22px; }
.t-row__name { font-size: 16px; font-weight: 600; }
.t-row__meta { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; flex-wrap: wrap; }
.t-row__win { text-align: right; font-size: 12px; color: var(--ink-3); }
.t-row__win strong { display: block; font-size: 13.5px; color: var(--ink); }
.team-strip { display: flex; justify-content: flex-end; }
.team-strip img { width: 38px; height: 38px; object-fit: contain; }
.standings { overflow: hidden; }
.standing { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.standing:first-child { border-top: 0; }
.standing__actions { display: flex; gap: 6px; }
.place { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--surface-2); color: var(--ink-2); flex-shrink: 0; }
.place--1 { background: var(--gold-soft); color: var(--gold); }
.place--2 { background: var(--silver-soft); color: var(--silver); }
.place--3 { background: var(--bronze-soft); color: var(--bronze); }
.player { font-weight: 600; min-width: 0; }
.player small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-3); }
.flag { font-size: 11px; font-weight: 700; color: var(--ink-3); background: var(--surface-2); border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: 2px; white-space: nowrap; }
.flag img { display: inline-block; width: 16px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 4px; object-fit: cover; }
h1 .flag { font-size: 13px; vertical-align: 5px; }
/* player page: most used Pokémon */
.p-favs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.p-fav { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 10px; background: var(--surface-2); color: inherit; text-align: center; }
a.p-fav:hover { outline: 1px solid var(--accent); }
.p-fav img { width: 56px; height: 56px; object-fit: contain; }
.p-fav b { font-size: 13px; }
.p-fav small { font-size: 11.5px; color: var(--ink-3); }
.p-ev small a { color: var(--ink-3); text-decoration: underline; }
/* tiers page: ladder vs tournaments */
.gap { margin: 22px 0; }
.gap__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.gap__grid .card { padding: 14px 16px; }
.gap__grid h3 { font-size: 15px; margin: 0 0 2px; }
.gap__grid .note { margin: 0 0 8px; }
.gap-row { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 8px; padding: 4px 0; color: inherit; font-size: 13.5px; }
.gap-row:hover span:first-of-type { color: var(--accent); }
.gap-row img { width: 36px; height: 36px; object-fit: contain; }
.gap-row__nums { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.gap-row__nums b { color: var(--ink); font-size: 13px; }
/* teams page: team styles */
.styles { margin-bottom: 22px; }
.styles__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.style-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; color: inherit; border: 1px solid transparent; }
.style-card:hover { border-color: var(--accent); }
.style-card.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.style-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.style-card__head b { font-size: 14px; }
.style-card__pct { font-weight: 700; font-size: 18px; color: var(--accent); font-variant-numeric: tabular-nums; }
.style-card__meta { font-size: 12px; color: var(--ink-3); }
.style-card__meta .up { color: #2fb36f; } .style-card__meta .down { color: var(--accent); }
.style-card__mons { display: flex; margin-top: 2px; }
.style-card__mons img { width: 34px; height: 34px; object-fit: contain; }
/* teams page: winning teams from the last 60 days */
.team-wins { margin-top: 28px; }
.win-list { display: grid; gap: 8px; margin-bottom: 14px; }
.win-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.win-row__who { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; }
.win-row__ev { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.win-row__ev:hover { color: var(--accent); }
.win-row__who small { color: var(--ink-3); font-size: 12px; width: 100%; }
.win-row .team-strip { flex-shrink: 0; }
@media (max-width: 640px) { .win-row { flex-direction: column; align-items: stretch; } .win-row .team-strip { justify-content: flex-start; } .win-row .team-strip img { width: 34px; height: 34px; } }
.standing .team-strip img { width: 42px; height: 42px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; }
.back:hover { color: var(--accent); }

/* ===== Teams ===== */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.team-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.team-card__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.team-card__arch { font-size: 16px; font-weight: 600; }
.team-card__by { font-size: 12.5px; color: var(--ink-3); }
.team-card__mons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; background: var(--surface-2); border-radius: 14px; padding: 8px 6px; }
.team-card__mons a, .team-card__mons span { border-radius: 10px; transition: background .15s; }
.team-card__mons a:hover { background: var(--surface); }
.team-card__mons img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.team-card__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-card__event { font-size: 12px; color: var(--ink-2); flex: 1; min-width: 140px; }
.team-card__btns { display: flex; gap: 6px; }

/* ===== Builder ===== */
.builder { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.slots { display: grid; gap: 10px; }
.slot { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px 8px 8px; cursor: pointer; border: 0; text-align: left; width: 100%; transition: box-shadow .15s, transform .15s; }
.slot:hover { transform: translateX(2px); }
.slot.is-active { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.slot img, .slot__empty { width: 56px; height: 56px; object-fit: contain; }
.slot__empty { border-radius: 14px; border: 2px dashed var(--line); display: grid; place-items: center; color: var(--ink-3); font-size: 22px; }
.slot b { display: block; font-size: 14px; }
.slot small { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot__num { font-size: 11px; font-weight: 700; color: var(--ink-3); }
.builder__tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.editor { padding: 20px 22px; }
.editor__head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.editor__head img { width: 96px; height: 96px; object-fit: contain; filter: var(--sprite-shadow); flex-shrink: 0; }
.editor__species { flex: 1; display: grid; gap: 6px; min-width: 0; }
.editor__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.editor__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; margin-top: 18px; }
.sp-table { display: grid; gap: 6px; }
.sp-row { display: grid; grid-template-columns: 34px 40px minmax(0, 1fr) 96px; gap: 8px; align-items: center; font-size: 12.5px; }
.sp-row label { font-weight: 700; color: var(--ink-2); }
.sp-row .base { color: var(--ink-3); font-size: 11.5px; }
.sp-row input[type=range] { width: 100%; accent-color: var(--accent); }
.sp-row .val { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.sp-row .val input { width: 48px; flex-shrink: 0; padding: 4px 2px; text-align: center; -moz-appearance: textfield; }
.sp-row .val input::-webkit-inner-spin-button, .sp-row .val input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sp-row b { font-size: 13px; text-align: right; min-width: 30px; }
.sp-row b.up { color: var(--good); }
.sp-row b.down { color: var(--bad); }
.sp-total { font-size: 12px; color: var(--ink-3); margin-top: 6px; display: flex; justify-content: space-between; }
.sp-total.over { color: var(--bad); font-weight: 700; }
.move-inputs { display: grid; gap: 8px; }
.move-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.suggest { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chip { border: 0; cursor: pointer; font-size: 11.5px; font-weight: 500; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.chip:hover { background: var(--surface-3); color: var(--ink); }
.chip small { color: var(--ink-3); }
.analysis { margin-top: 22px; display: grid; gap: 18px; }
.analysis .card { padding: 18px 20px; overflow-x: auto; }
.analysis h2 { font-size: 15px; margin-bottom: 4px; }
.analysis p.note { font-size: 12px; color: var(--ink-3); margin-bottom: 10px; }
.matrix { border-collapse: separate; border-spacing: 3px; font-size: 11.5px; min-width: 100%; }
.matrix th { font-weight: 600; color: var(--ink-3); padding: 2px; }
.matrix th img { width: 34px; height: 34px; object-fit: contain; margin: 0 auto; }
.matrix td { text-align: center; padding: 4px 2px; border-radius: 6px; font-weight: 700; min-width: 30px; }
.matrix td.x4 { background: var(--bad); color: #fff; }
.matrix td.x2 { background: var(--bad-soft); color: var(--bad); }
.matrix td.x05 { background: var(--good-soft); color: var(--good); }
.matrix td.x025 { background: var(--good); color: #fff; }
.matrix td.x0 { background: var(--surface-3); color: var(--ink-2); }
.matrix td.x05w { background: var(--surface-2); color: var(--ink); }
.threats td { min-width: 44px; font-size: 11px; cursor: help; }
.threats__mon a { display: flex; align-items: center; gap: 6px; text-align: left; font-size: 12px; color: var(--ink); white-space: nowrap; }
.threats__mon img { width: 30px !important; height: 30px !important; margin: 0 !important; }
.matrix td.sum-bad { color: var(--bad); }
.matrix td.sum-good { color: var(--good); }
.coverage { display: flex; flex-wrap: wrap; gap: 6px; }
.coverage .type-pill { opacity: .35; }
.coverage .type-pill.hit { opacity: 1; }
.speed-list { display: grid; gap: 4px; }
.speed-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.speed-row img { width: 36px; height: 36px; object-fit: contain; }
.speed-row b { font-variant-numeric: tabular-nums; }
.speed-list:has(.speed-check) { gap: 10px; }
.speed-check { display: block; margin-top: 3px; }
.speed-check small { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.speed-bar { display: block; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; max-width: 220px; }
.speed-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.team-speed-sum { margin-top: 12px; }

/* ===== Calc ===== */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.side { padding: 18px 20px; }
.side__head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.side__head img { width: 80px; height: 80px; object-fit: contain; filter: var(--sprite-shadow); flex-shrink: 0; }
.side__head .field { flex: 1; min-width: 0; }
.side__title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.side__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.side__stats { margin-top: 12px; }
.field-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 14px 18px; margin: 22px 0; }
.field-bar .field { grid-template-columns: auto; }
.field-bar .select { width: auto; }
.results { padding: 8px; }
.result { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; border-radius: 12px; }
.result + .result { border-top: 1px solid var(--line); border-radius: 0; }
.result__move { display: grid; gap: 3px; }
.result__move b { font-size: 14px; }
.result__move > span { display: flex; gap: 5px; align-items: center; font-size: 11.5px; color: var(--ink-3); flex-wrap: wrap; }
.hpbar { position: relative; height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hpbar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 6px; }
.hpbar .max { background: var(--accent-soft); }
.hpbar .min { background: var(--accent); }
.result__pct { text-align: right; min-width: 150px; }
.result__pct b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.result__pct span { font-size: 12px; color: var(--ink-2); }
.result__pct span.ko { color: var(--accent); font-weight: 600; }
.result--none { color: var(--ink-3); font-size: 13px; }
.calc-note { font-size: 12px; color: var(--ink-3); margin-top: 14px; }

.side__set { margin: -4px 0 12px; }
.sweep-head h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sweep-pick { width: auto; font-size: 15px; font-weight: 600; padding: 4px 30px 4px 10px; }
.sweep__mon { grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 8px; }
.sweep__mon img { width: 40px; height: 40px; object-fit: contain; }
.sweep__mon > div { display: grid; gap: 2px; min-width: 0; }
.sweep__mon span { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* calc speed check */
.spd-bar { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; padding: 14px 18px; margin-bottom: 12px; }
.spd-mine { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.spd-mine img { width: 48px; height: 48px; object-fit: contain; filter: var(--sprite-shadow); }
.spd-mine > div { display: grid; gap: 1px; }
.spd-mine small { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.spd-mine b { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--s-spe); }
.spd-mine span { font-size: 11.5px; color: var(--ink-3); }
.spd-mods { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.spd-chip { padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 12.5px; cursor: pointer; user-select: none; }
.spd-chip input { accent-color: var(--accent); }
.spd-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.spd-chip--opp { border-style: dashed; }
.spd-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 150px; gap: 12px; align-items: center; padding: 10px 12px; }
.spd-row + .spd-row { border-top: 1px solid var(--line); }
.spd-row--me { background: var(--blue-soft); border-radius: 12px; border-top-color: transparent !important; }
.spd-row--me + .spd-row { border-top-color: transparent; }
.spd-cell { display: grid; grid-template-columns: auto auto; justify-content: end; align-items: center; gap: 2px 8px; text-align: right; }
.spd-cell small { grid-column: 1 / -1; font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.spd-cell b { font-size: 15px; font-variant-numeric: tabular-nums; }
.spd-cell--me { grid-column: 2 / -1; }
.spd-cell--me b { color: var(--blue); font-size: 17px; }
.spd-pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.spd-pill--win { background: var(--good-soft); color: var(--good); }
.spd-pill--lose { background: var(--bad-soft); color: var(--bad); }
.spd-pill--tie { background: var(--gold-soft); color: var(--gold); }
.spd-tr { margin: 4px 12px 8px; font-size: 12.5px; color: var(--purple); font-weight: 600; }
.spd-chip { white-space: nowrap; }
.spd-head { flex-wrap: wrap; }
.spd-head h2 { white-space: nowrap; }
@media (max-width: 640px) {
  .spd-bar { flex-direction: column; align-items: stretch; padding: 14px; }
  .spd-mods { gap: 6px; }
  .spd-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .spd-row > .sweep__mon { grid-column: 1 / -1; }
  .spd-cell { justify-content: start; text-align: left; }
  .spd-cell--me { grid-column: 1 / -1; }
  .spd-chip { font-size: 12px; padding: 5px 9px; }
}

/* ===== Usage history chart ===== */
.hist { margin: 0; }
.hist svg { width: 100%; height: auto; display: block; overflow: visible; }
.hist text { font-size: 9.5px; fill: var(--ink-3); font-family: inherit; }
.hist .hist__last { fill: var(--ink); font-weight: 600; font-size: 10.5px; }
.hist__grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.hist__axis { stroke: var(--line); stroke-width: 1; }
.hist__line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.hist__dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.hist__hit { fill: transparent; cursor: default; }
.hist__pt:hover .hist__dot { r: 5.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ===== Speed tiers ===== */
.speed-filters .input[type=search] { width: 240px; border: 0; box-shadow: var(--shadow); border-radius: 999px; padding: 9px 16px; }
.speed-mine { grid-template-columns: auto 90px; align-items: center; gap: 8px; margin-left: auto; }
.speed-mine .input { padding: 7px 10px; }
.speed-sum { margin: -14px 0 14px; font-size: 13.5px; color: var(--ink-2); }
.speed-table { padding: 6px; }
.speed-tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) 150px 62px 62px 62px; gap: 10px; align-items: center; padding: 4px 10px 4px 4px; border-radius: 12px; font-size: 13px; transition: background .15s; }
a.speed-tr:hover { background: var(--surface-2); }
.speed-tr img { width: 44px; height: 44px; object-fit: contain; }
.speed-tr__name { min-width: 0; }
.speed-tr__name b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.speed-tr__name small, .speed-tr__v small { display: block; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.speed-tr__v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.speed-tr__common b { color: var(--ink); font-size: 15px; }
.speed-tr.is-tr .speed-tr__v:last-child b { color: var(--ink); font-size: 15px; }
.speed-tr.is-tr .speed-tr__common b { color: var(--ink-2); font-size: 13px; }
.speed-tr--head { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding-top: 8px; padding-bottom: 8px; }
.speed-mark { display: flex; align-items: center; gap: 10px; margin: 4px 0; color: var(--accent); font-size: 12px; font-weight: 700; }
.speed-mark::before, .speed-mark::after { content: ''; flex: 1; height: 2px; border-radius: 2px; background: var(--accent); }

/* ===== Cores ===== */
.core-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.core { padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.core__mons { display: flex; gap: 2px; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.core__mons > * { flex: 1; border-radius: 10px; transition: background .15s; }
.core__mons a:hover { background: var(--surface); }
.core__mons img { width: 100%; max-width: 72px; aspect-ratio: 1; object-fit: contain; margin: 0 auto; }
.core__names { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.core__stat b { font-size: 18px; margin-right: 6px; }
.core__stat span { font-size: 12px; color: var(--ink-3); }
.core .btn { justify-self: start; }
.footer__fresh { font-weight: 600; color: var(--ink-2); }
.footer__fresh.is-stale { color: var(--bad); }

/* ===== Teams filter, moves & items ===== */
.team-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.team-filter .input { width: 260px; border: 0; box-shadow: var(--shadow); border-radius: 999px; padding: 9px 16px; }
.team-filter .count { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.chip--on { background: var(--accent); color: var(--accent-ink); }
.chip--on:hover { background: var(--accent-hover); color: var(--accent-ink); }
.seg { display: flex; gap: 6px; }
.seg .chip { font-size: 12.5px; padding: 6px 12px; }
.bar span a:hover { color: var(--accent); text-decoration: underline; }
.tiles--3 { grid-template-columns: repeat(3, 1fr); }
.index-list { padding: 6px; }
.index-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 90px; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; transition: background .15s; }
.index-row:hover { background: var(--surface-2); }
.index-row b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.index-row span { font-size: 12px; }
.index-row em { font-style: normal; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.index-row__rank { color: var(--ink-3); font-weight: 700; text-align: center; }
.index-row--mon { grid-template-columns: 40px minmax(0, 1fr) auto 120px; padding: 4px 12px 4px 4px; }
.index-row--mon img { width: 40px; height: 40px; object-fit: contain; }
@media (max-width: 720px) {
  .tiles--3 { grid-template-columns: 1fr; }
  .team-filter .input { width: 100%; }
  .team-filter .count { margin-left: 0; }
  .index-row { grid-template-columns: 28px minmax(0, 1fr) 70px; }
  .index-row > span:not(.index-row__rank) { display: none; }
  .index-row--mon { grid-template-columns: 36px minmax(0, 1fr) 100px; }
}

/* ===== Blog ===== */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.blog-grid--home { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.blog-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.blog-card__cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); }
.blog-card__cover--none { background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); }
.blog-card__body { padding: 14px 18px 18px; display: grid; gap: 6px; }
.blog-card__meta { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.blog-card h2 { font-size: 17px; line-height: 1.3; }
.blog-card p { font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article { max-width: 760px; margin: 0 auto; }
.article__head { margin: 6px 0 18px; }
.article__meta { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.article h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.2; letter-spacing: -.015em; margin: 4px 0 8px; }
.article__summary { font-size: 17px; color: var(--ink-2); }
.article__cover { width: 100%; height: auto; border-radius: var(--radius); margin: 4px 0 24px; box-shadow: var(--shadow); }
.prose { font-size: 16.5px; line-height: 1.75; color: var(--ink); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 23px; margin-top: 1.6em; line-height: 1.3; }
.prose h3 { font-size: 19px; margin-top: 1.4em; }
.prose img { max-width: 100%; border-radius: 12px; margin: 1.2em auto; }
.prose img[src^="/sprites/"] { display: inline-block; width: 96px; height: 96px; margin: 0 4px; vertical-align: middle; object-fit: contain; filter: var(--sprite-shadow); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose blockquote { margin-left: 0; padding: 8px 16px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 12px 12px 0; color: var(--ink-2); }
.prose pre { background: var(--surface-2); padding: 12px 14px; border-radius: 12px; overflow-x: auto; font-size: 13.5px; white-space: pre-wrap; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose .ql-align-center { text-align: center; }
.article__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 32px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.share { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.heart { display: inline-flex; align-items: center; gap: 5px; border: 0; background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 5px 10px; font-weight: 700; font-size: 12.5px; cursor: pointer; transition: transform .1s, background .15s; }
.heart svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.heart.is-on { color: var(--accent); background: var(--accent-soft); }
.heart.is-on svg { fill: currentColor; }
.heart:active { transform: scale(.92); }
.heart--big { padding: 8px 16px; font-size: 15px; }
.heart--big svg { width: 22px; height: 22px; }
.comments h2 { font-size: 20px; margin-bottom: 14px; }
.discord-signin { background: #5865f2; color: #fff; }
.discord-signin:hover { background: #4752c4; }
.discord-signin svg { width: 18px; height: 18px; }
.comment-list { display: grid; gap: 14px; margin-top: 18px; }
.comment, .comment-form { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
.comment__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); }
.comment__head { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.comment__head .muted { font-size: 12px; }
.comment__body { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; margin: 2px 0 6px; }
.comment__foot { display: flex; gap: 10px; align-items: center; }
.comment.is-hidden { opacity: .5; }
.comment-form textarea { resize: vertical; font-family: inherit; font-size: 14.5px; }
.comment-form__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; flex-wrap: wrap; }
.link-btn { border: 0; background: none; padding: 2px 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.link-btn:hover { color: var(--ink); }
.link-btn.danger { color: var(--bad); }
.preview-note { padding: 10px 16px; margin-bottom: 18px; font-size: 13.5px; }

/* ===== Modal ===== */
.modal-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(10, 12, 20, .5); display: grid; place-items: center; padding: 16px; }
.modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 20px; display: grid; gap: 12px; }
.modal h2 { font-size: 17px; }
.modal__btns { display: flex; gap: 8px; justify-content: flex-end; }

/* ===== Consent notice ===== */
.consent {
  position: fixed; z-index: 90; left: 16px; right: 16px; bottom: 16px; margin: 0 auto; max-width: 560px;
  padding: 14px 16px; display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--ink-2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.consent p { flex: 1; }
.consent__btns { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 520px) { .consent { flex-direction: column; align-items: stretch; } .consent__btns { justify-content: flex-end; } }

/* ===== Footer + toast ===== */
.footer { margin-top: 48px; padding: 28px 28px 18px; font-size: 13px; color: var(--ink-3); }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 28px; }
.footer__brand .brand { margin-bottom: 10px; color: var(--ink); text-decoration: none; }
.footer__brand p { color: var(--ink-2); line-height: 1.55; max-width: 300px; margin-bottom: 14px; }
.footer__social { display: flex; flex-wrap: wrap; gap: 8px; }
.footer a.social { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; transition: background .15s, color .15s; }
.social svg { width: 17px; height: 17px; fill: currentColor; }
.footer a.social--discord:hover { background: #5865f2; color: #fff; }
.footer a.social--x:hover { background: var(--ink); color: var(--surface); }
.footer a.social--kofi { color: var(--accent); }
.footer a.social--kofi:hover { background: var(--accent); color: var(--accent-ink); }
.footer__col { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.footer__col b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin-bottom: 3px; }
.footer__col > a { color: var(--ink-2); text-decoration: none; }
.footer__col > a:hover { color: var(--accent); }
.footer__col span { line-height: 1.45; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; }
.footer__bottom a { color: var(--ink-2); }
.footer__bottom a:hover { color: var(--accent); }
@media (max-width: 860px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__brand, .footer__grid > .footer__col:last-child { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer { padding: 22px 18px 16px; } .footer__grid { gap: 22px; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 100; background: var(--ink); color: var(--surface); font-size: 13px; font-weight: 500; padding: 10px 18px; border-radius: 12px; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.empty { padding: 40px; text-align: center; color: var(--ink-3); grid-column: 1 / -1; }
.loading { padding: 60px; text-align: center; color: var(--ink-3); }
.dd-tool-boot #app { min-height: 85vh; }   /* tool pages until the tool is drawn (template head script, mountTool): no footer jump */

/* ===== Responsive ===== */
@media (max-width: 1180px) {
  .format-chip { display: none; }
}
@media (max-width: 1080px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .movers { grid-template-columns: 1fr; }
  .builder { grid-template-columns: 1fr; }
  .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .topbar { flex-wrap: wrap; row-gap: 6px; }
  .brand { flex: 1; }
  .nav { order: 3; flex-basis: 100%; justify-content: space-between; gap: 0; overflow-x: auto; scrollbar-width: none;
    padding-right: 28px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
  .nav::-webkit-scrollbar { display: none; }
  .nav__group, .nav__menu { display: contents !important; }
  .nav__toggle { display: none; }
  .nav .nav__link {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1 0 auto;
    padding: 8px 6px; border-radius: 12px; font-size: 11px; color: var(--ink-2); background: none;
  }
  .nav .nav__link svg { display: block; width: 21px; height: 21px; padding: 0; border-radius: 0; background: none; fill: var(--ink-3); stroke: var(--ink-3); }
  .nav .nav__link b { font-size: 11px; font-weight: 500; color: inherit; }
  .nav .nav__link small { display: none; }
  .nav .nav__link.is-active { color: var(--accent); }
  .nav .nav__link.is-active b { color: var(--accent); }
  .nav .nav__link.is-active svg { fill: var(--accent); stroke: var(--accent); }
  .nav .nav__link.is-active::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -2px; height: 3px; border-radius: 3px; background: var(--accent); }
  .dex, .home-grid { grid-template-columns: minmax(0, 1fr); }
  .dex > *, .home-grid > * { min-width: 0; }
  .hero { grid-template-columns: 1fr; }
  .hero__art { display: none; }
  .tools-row { grid-template-columns: 1fr; }
  .calc { grid-template-columns: 1fr; }
  .editor__cols { grid-template-columns: 1fr; }
  .detail {
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; top: auto; margin: 0;
    max-height: 86vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding-top: 16px;
    transform: translateY(105%); transition: transform .25s ease; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25);
    overscroll-behavior: contain;
  }
  .detail.is-open { transform: none; }
  .detail__art { margin-top: 0; width: 150px; height: 150px; }
  .detail__body { max-height: none; overflow: visible; }
  .detail__close { display: grid; place-items: center; position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--surface-2); cursor: pointer; font-size: 18px; }
  .detail__nav { margin-bottom: -20px; border-radius: 0; }
  .sheet-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(10, 12, 20, .4); }
}
@media (max-width: 720px) {
  .t-row { grid-template-columns: 56px minmax(0, 1fr); }
  .t-row .event__date { width: 56px; }
  .t-row__win { grid-column: 1 / -1; text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .standing { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 12px 14px; gap: 10px; }
  .standing .team-strip { grid-column: 1 / -1; justify-content: flex-start; order: 5; }
  .team-grid { grid-template-columns: 1fr; }
  .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor { padding: 16px; }
  .result { grid-template-columns: 1fr auto; }
  .result .hpbar { grid-column: 1 / -1; order: 3; }
  .result__pct { min-width: 0; }
  .tier-row { grid-template-columns: 64px minmax(0, 1fr); }
  .tier-row__label b { font-size: 24px; }
  .tier-mon { width: 76px; }
  .tier-mon img { width: 52px; height: 52px; }
  .speed-tr { grid-template-columns: 40px minmax(0, 1fr) 92px 46px; gap: 8px; }
  .speed-tr > :nth-child(5), .speed-tr > :nth-child(6) { display: none; }
  .speed-tr.is-tr > :nth-child(4) { display: none; }
  .speed-tr.is-tr > :nth-child(6) { display: block; }
  .speed-tr img { width: 40px; height: 40px; }
  .speed-filters .input[type=search] { width: 100%; }
  .speed-mine { margin-left: 0; }
}
@media (max-width: 480px) {
  .topbar { gap: 6px; padding: 10px 10px 8px 12px; }
  .brand { font-size: 14px; gap: 6px; min-width: 0; }
  .brand__ball { width: 24px; height: 24px; }
  .topbar .format-select { max-width: 92px; padding: 6px 24px 6px 10px; background-position: right 3px center; }
  .theme-toggle { width: 32px; height: 32px; border-radius: 10px; }
  .theme-toggle svg { width: 18px; height: 18px; }
  .discord-link { margin-right: 0; }
  .nav .nav__link { padding: 8px 4px; }
  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 24px; }
  .tiles { gap: 10px; }
  .tile { padding: 12px; gap: 10px; }
  .tile__icon { width: 36px; height: 36px; }
  .mon-grid, .home-grid .mon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 54px 12px; }
  .mon-card__sprite { width: 80px; height: 80px; top: -38px; }
  .mon-card { padding-top: 46px; }
  .slots { grid-template-columns: 1fr; }
  .side__grid, .editor__grid { grid-template-columns: 1fr 1fr; }
  .detail__usage div { min-width: 0; padding: 6px 9px; }
}

/* ---------- guide pages: /counters/, /teammates/, /vs/ (server-rendered) ---------- */
.g-head { display: flex; align-items: center; gap: 18px; padding: 20px 22px; margin-bottom: 16px; }
.g-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 6px; }
.g-head p { color: var(--ink-2); font-size: 14.5px; line-height: 1.6; max-width: 820px; }
.g-head__spr { display: flex; flex-shrink: 0; }
.g-head__spr img { width: 96px; height: 96px; object-fit: contain; image-rendering: auto; }
.g-head__spr img + img { margin-left: -18px; }
.guide { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }   /* minmax(0): wide tables scroll inside their card instead of widening the page */
.g-sec { padding: 18px 20px; }
.g-sec h2 { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.g-sec p { font-size: 14px; line-height: 1.6; margin: 6px 0; }
.g-sec .type-pill { margin: 2px 3px 2px 0; }
.g-scroll { overflow-x: auto; }
.g-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.g-table th, .g-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.g-table thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.g-table tbody th { font-weight: 600; color: var(--ink-2); }
.g-num { font-variant-numeric: tabular-nums; font-weight: 600; }
.g-win { color: var(--accent); }
.g-vs thead th { text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--ink); }
.g-mon { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; text-decoration: none; }
.g-mon:hover span { text-decoration: underline; }
.g-spr { width: 40px; height: 40px; object-fit: contain; margin: -6px 0; vertical-align: middle; }
.g-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.g-chip { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 6px 12px 6px 6px; font-size: 13.5px; }
.g-chip b { color: var(--accent); font-variant-numeric: tabular-nums; }
.g-trios { list-style: none; display: grid; gap: 8px; padding: 0; margin: 0; }
.g-trios li { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 6px 12px; font-size: 13.5px; }
.g-trios li span { margin-left: 8px; flex: 1; min-width: 0; }
.g-trios li b { color: var(--ink-2); white-space: nowrap; }
.g-index { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.g-index a { display: flex; align-items: center; gap: 8px; padding: 6px 4px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; border-radius: 8px; }
.g-index a:hover { background: var(--surface-2); }
.g-links { font-size: 13.5px; color: var(--ink-3); line-height: 1.9; }
.g-links a { color: var(--accent); font-weight: 600; }
@media (max-width: 640px) {
  .g-head { flex-direction: column; align-items: flex-start; padding: 16px; }
  .g-head h1 { font-size: 22px; }
  .g-head__spr img { width: 72px; height: 72px; }
  .g-sec { padding: 14px; }
}

/* ---------- search (Ctrl+K) ---------- */
.theme-toggle.search-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; padding: 0 10px 0 12px; font-size: 13px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.search-btn svg { flex-shrink: 0; }
.search-btn kbd { font: 600 11px/1 inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; color: var(--ink-3); }
.search-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(15, 18, 32, .45); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.search-box { width: min(640px, 100%); max-height: 76vh; display: flex; flex-direction: column; overflow: hidden; }
.search-box__in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search-box__in svg { width: 20px; height: 20px; fill: var(--ink-3); flex-shrink: 0; }
.search-box__in input { flex: 1; border: 0; outline: none; background: none; font: 500 16px/1.4 inherit; color: var(--ink); min-width: 0; }
.search-box__in kbd { font: 600 11px/1 inherit; border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; color: var(--ink-3); }
.search-res { overflow-y: auto; padding: 6px; }
.search-res__group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 10px 10px 4px; }
.search-res a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 14px; }
.search-res a small { margin-left: auto; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.search-res a.is-active, .search-res a:hover { background: var(--surface-2); }
.search-res .s-ico { width: 36px; height: 36px; object-fit: contain; margin: -4px 0; flex-shrink: 0; }
.search-res .s-dot { width: 36px; height: 28px; display: grid; place-items: center; flex-shrink: 0; }
.search-res .s-dot svg { width: 18px; height: 18px; fill: var(--ink-3); }
.search-empty { padding: 22px; text-align: center; color: var(--ink-3); font-size: 14px; }
@media (max-width: 1100px) { .search-btn span, .search-btn kbd { display: none; } .theme-toggle.search-btn { width: 40px; padding: 0; } }
.nav__search { display: none !important; }   /* phones: Search is the first tab instead of a top-bar button */
@media (max-width: 960px) { .nav .nav__search { display: flex !important; } .theme-toggle.search-btn { display: none; } }

/* ---------- team rating + saved teams + favourites ---------- */
.rating { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
.rating__grade { width: 92px; height: 92px; border-radius: 22px; display: grid; place-items: center; font-size: 46px; font-weight: 800; color: #fff; background: var(--g, var(--accent)); }
.rating__grade small { display: block; font-size: 12px; font-weight: 600; margin-top: -26px; opacity: .9; }
.rating__score { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.rating ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.5; }
.rating li { display: flex; gap: 8px; }
.rating li::before { content: '✓'; color: #1f9d55; font-weight: 800; }
.rating li.bad::before { content: '!'; color: var(--accent); }
/* team report (Rate my team) */
.team-report__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 22px; margin-top: 8px; }
.team-report h3 { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.team-report__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; font-size: 13px; line-height: 1.45; }
.team-report__list li { display: flex; gap: 8px; }
.team-report__list li::before { content: '✓'; color: var(--good); font-weight: 800; }
.team-report__list li.bad::before { content: '!'; color: var(--accent); }
.team-report__threats, .team-report__fixes { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; }
.team-report__threats a, .team-report__fixes a { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; color: inherit; text-decoration: none; }
.team-report__threats a:hover, .team-report__fixes a:hover { background: var(--surface-2); }
.team-report__threats img, .team-report__fixes img { width: 40px; height: 40px; object-fit: contain; }
.team-report__threats span, .team-report__fixes span { display: grid; gap: 1px; min-width: 0; }
.team-report__threats b, .team-report__fixes b { font-size: 13.5px; }
.team-report__threats small, .team-report__fixes small { font-size: 11.5px; color: var(--ink-2); line-height: 1.4; }
.team-report__fixes a { background: var(--good-soft); }
.team-report__fixes a:hover { background: var(--good-soft); filter: brightness(.97); }
@media (max-width: 900px) { .team-report__grid { grid-template-columns: minmax(0, 1fr); } }
.rating__bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; margin: 4px 0 10px; }
.rating__bar { font-size: 12px; color: var(--ink-2); }
.rating__bar i { display: block; height: 6px; border-radius: 99px; background: var(--surface-2); margin-top: 4px; overflow: hidden; }
.rating__bar i b { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.rate-page textarea { width: 100%; min-height: 220px; font: 13px/1.5 ui-monospace, Consolas, monospace; }
.saved-list { display: grid; gap: 8px; max-height: 56vh; overflow-y: auto; margin: 10px 0; }
.saved-row { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.saved-row .team-strip { flex: 1; min-width: 0; justify-content: flex-start; }
.saved-row b { font-size: 14px; display: block; }
.saved-row small { font-size: 12px; color: var(--ink-3); }
.fav-btn { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--ink-3); border: 0; cursor: pointer; font-size: 18px; line-height: 1; }
.fav-btn.is-on { color: #e8a317; }
.fav-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; align-items: center; }
.fav-strip a { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); box-shadow: var(--shadow); border-radius: 999px; padding: 2px 12px 2px 2px; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }
.fav-strip img { width: 34px; height: 34px; object-fit: contain; }

/* ---------- what changed since last month (Pokémon panel) ---------- */
.changes { display: grid; gap: 2px; text-align: left; }
.changes .d-sub { margin-top: 4px; }
.chg { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; font-size: 12.5px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.chg span { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chg small { color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chg b { min-width: 46px; text-align: right; }

/* ---------- live events ---------- */
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--bad); border-radius: 6px; padding: 3px 8px; flex-shrink: 0; }
.live-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: live-pulse 1.4s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live-badge::before { animation: none; } }
.live { margin-bottom: 28px; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.live-card { display: grid; gap: 8px; align-content: start; justify-items: start; padding: 16px 18px; border: 1.5px solid var(--bad-soft); transition: transform .15s, box-shadow .15s; }
.live-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.live-card__name { font-size: 15px; font-weight: 600; line-height: 1.35; }
.live-card__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-2); }
.live-card__meta span:first-child { font-weight: 600; color: var(--ink); }
.live-card__go { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--accent); }
.live-card__go svg { width: 13px; height: 13px; fill: currentColor; }
.live-home { margin: -12px 0 26px; }
.live-card__name { overflow-wrap: anywhere; }
.live-card__progress { display: grid; gap: 5px; width: 100%; }
.live-card__progress small { font-size: 11.5px; color: var(--ink-3); }
.live-bar { display: block; width: 100%; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.live-bar i { display: block; height: 100%; border-radius: inherit; background: var(--bad); }
.live-strip { display: grid; gap: 12px; padding: 14px 16px; min-width: 0; }
.live-strip__head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.live-strip__head b { flex: 1; min-width: 0; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-strip__head .link-more { flex-shrink: 0; }
.live-strip__row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; min-width: 0; }
.live-strip__row::-webkit-scrollbar { display: none; }
.live-strip__row.is-more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.live-mini { display: grid; gap: 6px; align-content: start; min-width: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); color: inherit; text-decoration: none; scroll-snap-align: start; transition: border-color .15s, background .15s; }
.live-mini:hover { border-color: var(--bad); }
.live-mini__name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-mini__meta { display: flex; gap: 10px; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.live-mini__meta span:first-child { font-weight: 600; }
@media (max-width: 560px) { .live-strip { padding: 12px; } .live-strip__row { grid-auto-columns: 78%; } }

/* ---------- full event list + pager + FAQ ---------- */
.t-row--hist { position: relative; }
.t-row__link { color: var(--ink); display: block; }
.t-row__link::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }
.t-row--hist .player-link { position: relative; z-index: 1; }
.t-row__win .player-link strong { display: block; font-size: 13.5px; color: var(--ink); }
.t-row__win .player-link:hover strong { color: var(--accent); text-decoration: underline; }
.tier-badge--full { background: var(--good-soft); color: var(--good); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.pager__now { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pager .is-disabled { opacity: .45; cursor: default; }
.faq { margin-top: 34px; }
.faq__list { padding: 6px 20px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 14.5px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent); font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details p { color: var(--ink-2); font-size: 14px; line-height: 1.6; padding: 0 0 14px; max-width: 760px; }

/* ---------- players ---------- */
.player-link { color: inherit; }
.player-link:hover { color: var(--accent); text-decoration: underline; }
.p-team { display: inline-flex; }
.p-team img { width: 40px; height: 40px; object-fit: contain; margin: -6px -3px; }
.p-ev small { display: block; color: var(--ink-3); font-size: 12px; }
.p-table td { vertical-align: middle; }
.p-table td.p-ev { white-space: normal; min-width: 200px; }

/* ---------- "How to read this page" ---------- */
/* same look as the home stat tiles (.tile): separate cards with an icon chip */
.howto { margin: 0 0 30px; }
.howto__head { margin-bottom: 12px; }
.howto__x { width: 32px; height: 32px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 18px; line-height: 1; cursor: pointer; transition: background .15s; }
.howto__x:hover { background: var(--surface-3); color: var(--ink); }
.howto__cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.howto__card { padding: 16px 18px; display: flex; align-items: center; gap: 14px; }   /* tips are kept to ~3 lines so centred icons line up */
.howto__card .tile__icon { width: 40px; height: 40px; }
.howto__card .tile__icon svg { width: 20px; height: 20px; }
.howto__card b { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; margin: 1px 0 3px; }
.howto__card p { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
@media (max-width: 1080px) { .howto__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {   /* phones: one swipeable row instead of a tall stack */
  .howto__cards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 80%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: -10px -16px 0; padding: 10px 16px 20px; scroll-padding: 0 16px; scrollbar-width: none; }   /* room for the card shadows */
  .howto__cards::-webkit-scrollbar { display: none; }
  .howto__card { scroll-snap-align: start; padding: 14px; gap: 12px; }
}

/* ---------- guided tour ---------- */
.tour-btn { margin-top: 12px; }
.tour-btn svg { width: 14px; height: 14px; fill: var(--accent); }
.tour { position: fixed; inset: 0; z-index: 1000; }
.tour__block { position: absolute; inset: 0; }
.tour__hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(8, 10, 20, .62); outline: 3px solid var(--accent); outline-offset: 0; pointer-events: none;
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease; }
.tour.is-busy .tour__card { opacity: 0; }
.tour__card { position: fixed; left: 12px; top: 12px; width: 340px; padding: 16px 18px 14px; z-index: 1; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); transition: opacity .15s, left .25s ease, top .25s ease; }
.tour__step { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .07em; }
.tour__card h2 { font-size: 17px; font-weight: 700; margin: 4px 0 6px; }
.tour__card p { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.tour__btns { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tour__skip { margin-right: auto; border: 0; background: none; padding: 6px 2px; font: 500 12.5px/1 inherit; color: var(--ink-3); cursor: pointer; }
.tour__skip:hover { color: var(--ink); text-decoration: underline; }
.tour__btns .btn:disabled { opacity: .45; cursor: default; }
.tour-prompt { position: fixed; z-index: 80; left: 16px; bottom: 16px; max-width: calc(100vw - 32px); display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; font-size: 13.5px; box-shadow: 0 12px 40px rgba(0, 0, 0, .22); }
.tour-prompt p { color: var(--ink-2); }
.tour-prompt b { color: var(--ink); }
.tour-prompt__x { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: 18px; cursor: pointer; flex-shrink: 0; }
@media (max-width: 520px) { .tour-prompt { right: 16px; } .tour-prompt p { flex: 1; } }
@media (prefers-reduced-motion: reduce) { .tour__hole, .tour__card { transition: none; } }

/* ---------- styled pickers (replace the browser's datalist popups) ---------- */
.cb-input { padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%239aa0b8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 18px; }
.cb-panel { position: fixed; z-index: 95; overflow-y: auto; overscroll-behavior: contain; padding: 6px; border-radius: 14px; box-shadow: var(--shadow-hover), 0 0 0 1px var(--line); scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.cb-row { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 5px 10px; border-radius: 10px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.cb-row.is-active, .cb-row:hover { background: var(--surface-2); }
.cb-ico { width: 34px; height: 34px; object-fit: contain; margin: -4px 0; flex-shrink: 0; }
.cb-type { width: 58px; flex-shrink: 0; display: flex; }
.cb-name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-name mark { background: none; color: var(--accent); font-weight: 700; }
.cb-types { display: flex; gap: 3px; flex-shrink: 0; }
.cb-row small { flex-shrink: 0; min-width: 40px; text-align: right; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.cb-empty { padding: 14px; text-align: center; color: var(--ink-3); font-size: 13px; }
@media (max-width: 520px) { .cb-types { display: none; } .cb-row { min-height: 44px; } }

/* ---------- language picker (globe in the top bar + footer row) ---------- */
.lang-pick { position: relative; flex-shrink: 0; }
.lang-btn svg { stroke: none; }
.lang-btn[aria-expanded="true"] { background: var(--surface-3); color: var(--ink); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; display: grid; gap: 2px; min-width: 170px; padding: 6px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-hover), 0 0 0 1px var(--line); }
.lang-menu[hidden] { display: none; }
.lang-menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px;
  background: none; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
.lang-menu button:hover, .lang-menu button:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }
.lang-menu button svg { width: 16px; height: 16px; fill: var(--accent); visibility: hidden; flex-shrink: 0; }
.lang-menu button[aria-checked="true"] { color: var(--ink); font-weight: 600; }
.lang-menu button[aria-checked="true"] svg { visibility: visible; }
.footer__lang { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-weight: 600; color: var(--ink-2); }
.footer__lang svg { width: 16px; height: 16px; fill: var(--ink-3); flex-shrink: 0; }
.footer__lang .select { width: auto; padding: 5px 30px 5px 10px; font-size: 13px; border-radius: 999px; }
.cb-en { margin-left: 6px; font-size: 11px; font-weight: 500; color: var(--ink-3); }
@media (max-width: 960px) { .lang-menu { position: fixed; top: 64px; right: 12px; } }
/* phones: brand + format + Discord + globe + theme on one row */
@media (max-width: 420px) { .topbar { gap: 4px; } .topbar .format-select { max-width: 90px; font-size: 12px; padding-right: 22px; } .topbar .theme-toggle { width: 30px; height: 30px; } }
/* long German names and CJK text: let names wrap instead of pushing layouts wider */
.mon-card__name, .detail__name, .bar span, .chg span, .index-row b, .speed-tr__name b, .core__names, .counter span, .mover span, .tier-mon span { overflow-wrap: anywhere; }
html:lang(ja) body { font-family: 'Poppins', 'Hiragino Sans', 'Yu Gothic UI', Meiryo, system-ui, sans-serif; }
html:lang(ko) body { font-family: 'Poppins', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif; }
html:lang(zh-Hans) body { font-family: 'Poppins', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif; }
html:lang(zh-Hant) body { font-family: 'Poppins', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif; }

/* ---------- 2026-11-21 (b): usage history tooltip, Read more, page FAQs, archetype pages ---------- */
.hist { position: relative; outline: none; }
.hist:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 8px; }
.hist svg { touch-action: pan-y; cursor: crosshair; }
.hist__line--old { stroke: var(--ink-3); stroke-dasharray: 4 3; }
.hist__dot--old { fill: var(--ink-3); }
.hist .hist__reg { font-size: 9px; font-weight: 600; fill: var(--ink-3); letter-spacing: .04em; }
.hist__guide { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 2; }
.hist__focus { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; pointer-events: none; }
.hist__tip { position: absolute; top: -6px; transform: translateY(-100%); z-index: 3; pointer-events: none; display: flex; flex-direction: column; gap: 1px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.hist__tip b { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.hist__tip span { font-weight: 700; font-variant-numeric: tabular-nums; }
.hist__tip small { font-weight: 500; color: var(--ink-3); font-size: 11px; }
.hist figcaption.d-note { margin-top: 4px; }
.read-more { display: grid; gap: 6px; }
.read-more a { display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 600; text-align: left; }
.read-more a:hover { box-shadow: 0 0 0 1px var(--accent) inset; }
.read-more small { font-weight: 500; color: var(--ink-3); font-size: 12px; }
.page-faq { margin-top: 34px; }
.page-faq[hidden] { display: none; }
.styles .section-title { flex-wrap: wrap; }
.faq-ssr h3 { font-size: 14.5px; font-weight: 600; margin: 14px 0 2px; }
.faq-ssr p { color: var(--ink-2); }
.arch-index { margin-bottom: 4px; }
.style-card.is-off { opacity: .55; }
.style-card.is-off:hover { border-color: transparent; }
.arch-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.arch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 12px; }
.arch-row__who { display: flex; flex-direction: column; gap: 2px; font-size: 14px; min-width: 0; }
.arch-row__who > a { color: var(--ink); text-decoration: none; }
.arch-row__who > a:hover b { text-decoration: underline; }
.arch-row__who small { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.arch-row__who small a { color: var(--ink-2); }
.arch-team { display: flex; flex-wrap: wrap; }
.arch-team img { width: 40px; height: 40px; object-fit: contain; display: block; }
.arch-answers { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 12px; }
.arch-answers li > b { font-size: 14px; margin-right: 6px; }
.arch-answers li > span { font-size: 13px; }
.arch-answers .g-chips { margin-top: 6px; }
.arch-h3 { font-size: 15px; font-weight: 700; margin: 16px 0 8px; }
@media (max-width: 600px) { .arch-team img { width: 34px; height: 34px; } .g-head__spr img { width: 72px; height: 72px; } }

/* ===== 2026-11-21 (c): matchup planner, embed modal, sync control, offline note ===== */
.plan-in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.plan-side { padding: 16px; display: grid; gap: 10px; align-content: start; }
.plan-side h2, .plan-card h2 { font-size: 16px; }
.plan-side textarea { min-height: 200px; font-size: 12.5px; font-family: ui-monospace, Consolas, monospace; resize: vertical; }
.plan-btns, .plan-go { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-go { margin: 14px 0 16px; }
.plan-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.plan-card { padding: 16px; margin-bottom: 16px; min-width: 0; }
.plan-top .plan-card { margin-bottom: 0; }
.plan-top + .plan-card { margin-top: 16px; }
.plan-leads { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.plan-lead { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.plan-lead:first-child { box-shadow: inset 0 0 0 2px var(--accent); }
.plan-lead__mons { display: flex; align-items: center; }
.plan-lead__mons img { width: 44px; height: 44px; object-fit: contain; }
.plan-lead__back { display: flex; margin-left: 6px; padding-left: 6px; border-left: 1px solid var(--line); opacity: .75; }
.plan-lead__back img { width: 30px; height: 30px; }
.plan-lead b { font-size: 13.5px; display: block; }
.plan-lead small { display: block; font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.plan-lead small.muted { color: var(--ink-3); }
.plan-threats { margin-top: 10px; }
.plan-threats .plan-answer { color: var(--good); }
.plan-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.plan-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; padding: 6px 12px; }
.plan-chip input { margin: 0; accent-color: var(--accent); }
.plan-chip.is-on, .plan-chip:has(input:checked) { background: var(--accent-soft); color: var(--accent); }
.plan-speed { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 3px; counter-reset: spd; }
.plan-speed li { counter-increment: spd; display: grid; grid-template-columns: 22px 32px minmax(0, 1fr) auto 48px; gap: 8px; align-items: center; padding: 3px 8px; border-radius: 8px; font-size: 13px; }
.plan-speed li::before { content: counter(spd); color: var(--ink-3); font-size: 11.5px; text-align: right; }
.plan-speed li.is-mine { background: var(--blue-soft); }
.plan-speed img { width: 32px; height: 32px; object-fit: contain; }
.plan-speed__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.plan-speed__name small { font-weight: 400; color: var(--ink-3); }
.plan-speed b { text-align: right; font-variant-numeric: tabular-nums; }
.plan-tie { grid-column: 3 / -1; color: var(--gold); font-size: 11px; margin-top: -4px; }
.plan-tag { font-size: 10.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.plan-tag--a { background: var(--blue); color: #fff; }
.plan-tag--b { background: var(--surface-3); color: var(--ink-2); }
.plan-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.plan-grid td small { display: block; font-size: 9.5px; font-weight: 600; opacity: .85; white-space: nowrap; }
.plan-grid .threats__mon > span { display: flex; align-items: center; gap: 6px; text-align: left; font-size: 12px; color: var(--ink); white-space: nowrap; }
@media (max-width: 760px) {
  .plan-in, .plan-top { grid-template-columns: 1fr; }
  .plan-side textarea { min-height: 150px; }
  .plan-grid .threats__mon > span > span { display: none; }
  .plan-speed li { grid-template-columns: 18px 28px minmax(0, 1fr) auto 40px; gap: 6px; }
}

.embed-modal { width: min(620px, 100%); }
.embed-modal__opts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.embed-modal__opts input { accent-color: var(--accent); }
.embed-modal__code { font: 12px/1.45 ui-monospace, Consolas, monospace; resize: none; }
.embed-modal__preview { display: flex; justify-content: center; background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; overflow: auto; }
.embed-modal__preview iframe { border: 0; max-width: 100%; background: transparent; }

.sync-ctl { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #5865f2; }
a.sync-ctl:hover { text-decoration: underline; }
.sync-ctl svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.sync-ctl.is-on { color: var(--ink-2); font-weight: 500; }
.sync-ctl.is-on a { color: var(--accent); }
[data-theme="dark"] .sync-ctl:not(.is-on) { color: #8b95ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sync-ctl:not(.is-on) { color: #8b95ff; } }
.fav-strip__sync { margin-left: auto; }
.saved-sync { margin-top: -4px; }

.offline-note { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 70; background: var(--ink); color: var(--bg); font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 999px; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }
.offline-note[hidden] { display: none; }
.plan-grid .threats__mon img { flex: none; }
.plan-grid .threats__mon { min-width: 38px; }
@media (max-width: 760px) {
  .plan-lead { grid-template-columns: 1fr; gap: 6px; }
  .plan-lead__mons img { width: 38px; height: 38px; }
}
.offline-note { z-index: 95; }

/* ---------- player leaderboard: /leaderboard/ (tools/leaderboard.php) + rank line on player pages ---------- */
.lb-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.lb-tabs a { padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; }
.lb-tabs a:hover { color: var(--ink); }
.lb-tabs a[aria-current="page"] { background: var(--accent); color: #fff; }
.lb-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.lb-bar .input { width: 280px; max-width: 100%; border-radius: 999px; padding: 8px 14px; }
.lb-count { font-size: 12.5px; color: var(--ink-3); }
.lb-table tr[hidden] { display: none; }
.lb-table td { vertical-align: middle; }
.lb-rank { color: var(--ink-3); width: 1%; }
.lb-rank.lb-top { color: var(--accent); }
.lb-howlink { color: var(--accent); font-weight: 600; }
.lb-pts { color: var(--ink); font-size: 14.5px; }
.lb-best b { font-variant-numeric: tabular-nums; }
.lb-best small { color: var(--ink-3); font-size: 12px; }
.lb-best small a { color: var(--ink-2); }
.lb-best { white-space: normal !important; min-width: 190px; max-width: 320px; }
.lb-favs img { width: 36px; height: 36px; }
.lb-empty { color: var(--ink-3); font-size: 13.5px; padding: 8px 0; }
.lb-empty[hidden], .pager[hidden] { display: none; }
.lb-pts-table { max-width: 560px; margin: 6px 0 4px; }
.lb-q { font-size: 14.5px; font-weight: 700; margin: 14px 0 2px; }
#lb-how { scroll-margin-top: 80px; }
.lb-mine { margin-top: 8px !important; font-size: 14px !important; }
.lb-mine a { color: var(--accent); font-weight: 600; }
@media (max-width: 640px) {   /* phones: one stacked block per player instead of a wide table */
  .lb-bar .input { width: 100%; }
  .lb-table thead, .lb-table .lb-evn { display: none; }
  .lb-table tbody tr { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "r n p" "r b b" "r f f"; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .lb-table td { border: 0; padding: 1px 4px; }
  .lb-table .lb-rank { grid-area: r; align-self: start; padding-top: 3px; width: auto; }
  .lb-table .lb-name { grid-area: n; white-space: normal; }
  .lb-table .lb-pts { grid-area: p; text-align: right; }
  .lb-table .lb-pts::after { content: " pts"; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
  .lb-table .lb-best { grid-area: b; min-width: 0; max-width: none; }
  .lb-table td:last-child { grid-area: f; }
  .lb-favs img { width: 32px; height: 32px; margin: -2px -3px; }
}
