/* sinnoh.dataross.com — Pokédex-style theme. Light is the default; dark is opt-in via the toggle. */
:root {
  --bg: #f4f1ea;
  --bg-dot: #e6e0d3;
  --surface: #ffffff;
  --surface-2: #f8f6f1;
  --ink: #1f2430;
  --ink-2: #4a5160;
  --ink-3: #5f6778;
  --line: #e2ddd2;
  --ring: #d9d3c6;
  --red: #e3350d;
  --red-dark: #b8290a;
  --red-ink: #ffffff;
  --gold: #ffcb05;
  --gold-ink: #3b2f00;
  --blue: #3466af;
  --pearl: #c76b98;
  --ok: #1f8a4c;
  --ok-bg: #e5f5ec;
  --warn: #9a6200;
  --warn-bg: #fff4d6;
  --bad: #c0281b;
  --bad-bg: #fde8e5;
  --info-bg: #e8f0fb;
  --info-ink: #24497f;
  --shadow: 0 1px 2px rgba(31, 36, 48, .06), 0 4px 14px rgba(31, 36, 48, .06);
  --radius: 14px;
  --acc: #a8a77a;
  --font-head: "Fredoka", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #12141b;
  --bg-dot: #1b1e27;
  --surface: #1c1f29;
  --surface-2: #232733;
  --ink: #eceef3;
  --ink-2: #b7bdcb;
  --ink-3: #8b93a5;
  --line: #2d3240;
  --ring: #343a4a;
  --red: #f0522c;
  --red-dark: #c63d1a;
  --gold: #ffd43b;
  --gold-ink: #2a2100;
  --blue: #6f9be0;
  --pearl: #e091bb;
  --ok: #4cc785;
  --ok-bg: #173325;
  --warn: #f2b84b;
  --warn-bg: #352a12;
  --bad: #ff7a6b;
  --bad-bg: #3a1c1a;
  --info-bg: #1b2a40;
  --info-ink: #a9c6f2;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

/* ---------- type palette (canonical game colours) ---------- */
.t-normal   { --tc: #a8a77a; } .t-fire     { --tc: #ee8130; } .t-water    { --tc: #6390f0; }
.t-electric { --tc: #e8b900; } .t-grass    { --tc: #6fb83f; } .t-ice      { --tc: #74c8c4; }
.t-fighting { --tc: #c22e28; } .t-poison   { --tc: #a33ea1; } .t-ground   { --tc: #cba64a; }
.t-flying   { --tc: #a98ff3; } .t-psychic  { --tc: #f95587; } .t-bug      { --tc: #a6b91a; }
.t-rock     { --tc: #b6a136; } .t-ghost    { --tc: #735797; } .t-dragon   { --tc: #6f35fc; }
.t-dark     { --tc: #705746; } .t-steel    { --tc: #9a9ab8; } .t-fairy    { --tc: #d685ad; }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 0 16px 48px;
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dot) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  color: var(--ink);
  font: 16px/1.6 var(--font-body);
}
body > * { max-width: 980px; margin-left: auto; margin-right: auto; }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--blue); text-underline-offset: 3px; }
code { font-size: .9em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; text-wrap: balance; margin: 0; }
h2 { font-size: 1.55rem; margin: 28px 0 10px; display: flex; align-items: center; gap: 10px; }
h2::before { content: ""; width: 20px; height: 20px; flex: none; border-radius: 50%;
  background: linear-gradient(var(--red) 0 44%, var(--ink) 44% 56%, var(--surface) 56%);
  box-shadow: inset 0 0 0 2px var(--ink); }
h3 { font-size: 1.12rem; }
.lead, .body-text { color: var(--ink-2); margin: 6px 0 14px; }
.meta-note, .live-note { color: var(--ink-3); font-size: .82rem; }
.accent-text { color: var(--red); }

/* ---------- hero ---------- */
.hero {
  max-width: none;
  margin: 0 -16px 18px;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px 22px;
  background: var(--red);
  color: var(--red-ink);
  border-bottom: 6px solid var(--ink);
  position: relative;
}
.hero::after { content: ""; position: absolute; left: 50%; bottom: -19px; transform: translateX(-50%);
  width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 6px solid var(--ink); }
.hero-inner { max-width: 980px; margin: 0 auto; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo { width: 58px; height: 58px; flex: none; }
.hero-text { flex: 1 1 260px; min-width: 0; }
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 700; letter-spacing: .3px; }
.subtitle { margin: 4px 0 0; color: rgba(255, 255, 255, .92); font-weight: 600; }
.hero-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.hero-chip { font-size: .78rem; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .18); color: #fff; }
.hero-chip.gold { background: var(--gold); color: var(--gold-ink); }

/* ---------- controls ---------- */
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 26px; }
.version-toggle { display: flex; flex: 1 1 320px; min-width: 0; background: var(--surface); border: 2px solid var(--ink);
  border-radius: 999px; padding: 3px; gap: 3px; box-shadow: var(--shadow); }
.version-btn { flex: 1; min-width: 0; border: 0; border-radius: 999px; padding: 9px 12px; cursor: pointer;
  font: 700 .92rem var(--font-head); color: var(--ink-2); background: transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.version-btn:hover { background: var(--surface-2); color: var(--ink); }
.version-btn.active { background: var(--ink); color: var(--surface); }
.version-btn.active[data-ver="bdsp"] { background: linear-gradient(90deg, var(--blue), var(--pearl)); color: #fff; }
.theme-btn { border: 2px solid var(--ink); background: var(--surface); color: var(--ink); border-radius: 999px;
  padding: 8px 16px; font: 700 .9rem var(--font-head); cursor: pointer; box-shadow: var(--shadow); }
.theme-btn:hover { background: var(--gold); color: var(--gold-ink); }

/* ---------- provenance strip ---------- */
.provenance { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin: 12px auto 4px;
  font-size: .8rem; color: var(--ink-3); }
.provenance .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex: none; }
.provenance.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.provenance.stale .dot { background: var(--warn); }
.provenance.down .dot { background: var(--bad); }
.provenance strong { color: var(--ink-2); }

/* ---------- tabs ---------- */
.tab-nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; gap: 6px; overflow-x: auto;
  padding: 10px 2px; margin-top: 8px; background: var(--bg); scrollbar-width: none; }
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn { flex: none; display: inline-flex; align-items: center; gap: 7px; border: 2px solid var(--ring);
  background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 7px 14px;
  font: 600 .92rem var(--font-head); cursor: pointer; }
.tab-btn::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink-3);
  background: linear-gradient(var(--ink-3) 0 50%, transparent 50%); }
.tab-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.tab-btn.active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.tab-btn.active::before { border-color: var(--surface); background: linear-gradient(var(--red) 0 50%, var(--surface) 50%); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tab-panel.active { animation: none; } }

/* ---------- version visibility ---------- */
.bdsp-only { display: block; }
.dp-only { display: none; }
body.ver-dp .bdsp-only { display: none; }
body.ver-dp .dp-only { display: block; }
span.bdsp-only, span.dp-only, li.bdsp-only, li.dp-only, tr.bdsp-only, tr.dp-only { display: none; }
span.bdsp-only { display: inline; }
li.bdsp-only { display: inline-flex; }
tr.bdsp-only { display: table-row; }
body.ver-dp span.bdsp-only, body.ver-dp li.bdsp-only, body.ver-dp tr.bdsp-only { display: none; }
body.ver-dp span.dp-only { display: inline; }
body.ver-dp li.dp-only { display: inline-flex; }
body.ver-dp tr.dp-only { display: table-row; }

/* ---------- notes & callouts ---------- */
.dp-note, .callout { border-radius: 10px; padding: 10px 14px; margin: 12px 0; font-size: .93rem; }
.dp-note { background: var(--surface-2); border: 1px dashed var(--ring); color: var(--ink-2); }
.callout { border-left: 5px solid; }
.callout-info { background: var(--info-bg); border-color: var(--blue); color: var(--info-ink); }
.callout-warn { background: var(--warn-bg); border-color: var(--warn); color: var(--ink); }
.dp-note strong, .callout strong { color: var(--ink); }
:root[data-theme="dark"] .callout-info strong { color: var(--info-ink); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 2px solid var(--ring); border-radius: var(--radius); padding: 16px;
  margin: 14px 0; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.card.mon { border-top: 6px solid var(--acc); }
.card.boss { border-top: 6px solid var(--acc); }
.card.cynthia { --acc: #2b2b33; border-color: var(--ink); }
:root[data-theme="dark"] .card.cynthia { --acc: var(--gold); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-header h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-meta { font-size: .78rem; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.pkmn-name { font-weight: 700; }
.types { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.type-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 58px;
  padding: 2px 9px; border-radius: 999px; background: var(--tc, #8a8f9c); color: #fff; font: 800 .68rem/1.5 var(--font-body);
  letter-spacing: .6px; text-transform: uppercase; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); }
.role { margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--ink-2); font-size: .93rem; }
.risk { color: var(--bad); font-weight: 700; }

/* ---------- mon card body ---------- */
.mon .live { display: none; }
.mon.has-live .live { display: block; }
.mon.has-live .static { display: none; }
.mon-body { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: center; }
.sprite { width: 112px; height: 112px; image-rendering: pixelated; border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, var(--surface) 0 52%, transparent 53%),
              linear-gradient(color-mix(in srgb, var(--acc) 22%, var(--surface)) 0 50%, var(--surface-2) 50%);
  border: 3px solid var(--ink); }
.stats { min-width: 0; }
.stat-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 8px; align-items: center; font-size: .8rem; }
.stat-label { font-weight: 800; color: var(--ink-3); }
.stat-bar-wrap { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.stat-bar { height: 100%; border-radius: 999px; background: #f08030; transition: width .4s ease; }
.stat-bar.s1 { background: #f34444; } .stat-bar.s2 { background: #ff7f0f; } .stat-bar.s3 { background: #ffdd57; }
.stat-bar.s4 { background: #a0e515; } .stat-bar.s5 { background: #23cd5e; } .stat-bar.s6 { background: #00c2b8; }
.stat-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-total { margin-top: 4px; font: 700 .78rem var(--font-head); color: var(--ink-3); text-align: right; letter-spacing: .4px; }
.abilities { margin: 10px 0 4px; font-size: .88rem; color: var(--ink-2); }
.abilities .na { text-decoration: line-through; color: var(--ink-3); }
.abilities .hid { color: var(--ink-3); font-size: .8rem; }

/* ---------- moves ---------- */
.move-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.move-list li, .chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: .86rem; font-weight: 700; }
.chip .m { font-weight: 600; color: var(--ink-3); font-size: .74rem; font-variant-numeric: tabular-nums; }
.chip.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: var(--ok-bg); }
.chip.no { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: var(--bad-bg); color: var(--bad); text-decoration: line-through; }
.chip.unk { border-style: dashed; color: var(--ink-3); }
.catch { margin-top: 10px; font-size: .85rem; color: var(--ink-2); background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.catch strong { color: var(--ink); }
.catch ul { margin: 4px 0 8px; padding-left: 18px; }

/* ---------- gym timeline (badge case) ---------- */
.gym-timeline { display: grid; gap: 10px; margin: 14px 0; }
.gym-step { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start;
  background: var(--surface); border: 2px solid var(--ring); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.gym-badge { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%;
  background: var(--gold); color: var(--gold-ink); border: 3px solid var(--ink); font: 700 .95rem var(--font-head);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .12); }
.gym-line { display: none; }
.gym-content { min-width: 0; }
.gym-content strong { font: 600 1.08rem var(--font-head); }
.gym-content .detail { margin-top: 4px; color: var(--ink-2); font-size: .93rem; }

/* ---------- boss teams ---------- */
.boss-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 4px 0 12px; }
.boss-team.dp-only, body.ver-dp .boss-team.bdsp-only { display: none; }
body.ver-dp .boss-team.dp-only { display: grid; }
.boss-mon { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 8px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); text-align: center; min-width: 0; }
.boss-mon img { width: 64px; height: 64px; image-rendering: pixelated; }
.boss-mon .bn { font: 600 .78rem/1.2 var(--font-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.boss-mon .bl { font-size: .7rem; font-weight: 800; color: var(--ink-3); }
.boss-mon.ace { border: 2px solid var(--red); background: color-mix(in srgb, var(--red) 8%, var(--surface)); }
.boss-mon.ace .bl::after { content: " · ACE"; color: var(--red); }

/* ---------- tables ---------- */
.data-table-wrap { overflow-x: auto; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font: 700 .76rem var(--font-head); text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.pkmn-name { color: var(--red); }

/* ---------- misc ---------- */
.mechanics ul { padding-left: 20px; margin: 6px 0; }
details { background: var(--surface); border: 2px solid var(--ring); border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; }
summary { cursor: pointer; font: 600 1rem var(--font-head); list-style: none; display: flex; align-items: center; gap: 8px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); color: var(--surface); font-weight: 800; flex: none; }
details[open] summary::before { content: "–"; background: var(--red); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: .9rem; }
.kv dt { color: var(--ink-3); font-weight: 700; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.status-ok { color: var(--ok); font-weight: 800; }
.status-bad { color: var(--bad); font-weight: 800; }
.status-warn { color: var(--warn); font-weight: 800; }
.sources { font-size: .85rem; color: var(--ink-3); }
.sources a { color: var(--ink-2); }
.sources a:hover { color: var(--red); }

/* ---------- footer ---------- */
.site-foot { margin-top: 40px; padding-top: 16px; border-top: 2px dashed var(--ring); color: var(--ink-3); font-size: .82rem; text-align: center; }
.site-foot p { margin: 4px 0; }

/* ---------- phone ---------- */
@media (max-width: 560px) {
  body { font-size: 15px; }
  .logo { width: 46px; height: 46px; }
  .mon-body { grid-template-columns: 84px minmax(0, 1fr); gap: 10px; }
  .sprite { width: 84px; height: 84px; }
  .gym-step { grid-template-columns: 48px minmax(0, 1fr); }
  .gym-badge { width: 48px; height: 48px; font-size: .8rem; }
  .version-btn { font-size: .8rem; padding: 8px 6px; }
  .card { padding: 13px; }
  h2 { font-size: 1.3rem; }
}

/* ---------- buttons & fields ---------- */
.btn { border: 2px solid var(--ring); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 8px 14px;
  font: 700 .88rem var(--font-head); cursor: pointer; }
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--blue); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); }
.field { width: 100%; min-width: 0; border: 2px solid var(--ring); background: var(--surface); color: var(--ink); border-radius: 10px;
  padding: 8px 10px; font: 600 .92rem var(--font-body); }
.combo-input:focus { outline: none; }
.field:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }
select.field { appearance: none; padding-right: 28px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }

/* ---------- tracker ---------- */
.run-head { display: grid; gap: 12px; }
.run-top { display: flex; gap: 8px; align-items: center; }
.run-name { font: 700 1.15rem var(--font-head); }
.game-chip { flex: none; font: 800 .74rem var(--font-body); text-transform: uppercase; letter-spacing: .5px; padding: 5px 10px;
  border-radius: 999px; color: #fff; background: linear-gradient(90deg, var(--pearl), var(--blue)); }
.run-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.stat-pill { font-size: .82rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.stat-pill strong { font: 700 1rem var(--font-head); margin-right: 2px; }
.stat-pill.alive strong { color: var(--ok); } .stat-pill.team strong { color: var(--blue); }
.stat-pill.dead strong { color: var(--bad); } .stat-pill.missed strong { color: var(--ink-3); }
.run-nav { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.continue { font: 700 1.05rem var(--font-head); color: var(--ink); text-decoration: none; }
.continue:hover { color: var(--red); }
.cap-chip { font: 800 .78rem var(--font-body); padding: 4px 10px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); }
.run-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.run-tools .search { flex: 1 1 200px; }
.seg { display: inline-flex; border: 2px solid var(--ring); border-radius: 10px; overflow: hidden; }
.seg-btn { border: 0; background: var(--surface); color: var(--ink-2); padding: 7px 14px; font: 700 .9rem var(--font-head); cursor: pointer; }
.seg-btn + .seg-btn { border-left: 2px solid var(--ring); }
.seg-btn.active { background: var(--ink); color: var(--surface); }

.enc-list { display: grid; gap: 8px; margin: 12px 0; }
.enc-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; align-items: center; background: var(--surface);
  border: 2px solid var(--ring); border-left-width: 6px; border-radius: 12px; padding: 10px 12px; }
.enc-row.filled { border-left-color: var(--ok); }
.enc-row[data-status="team"] { border-left-color: var(--blue); }
.enc-row[data-status="dead"] { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 6%, var(--surface)); }
.enc-row[data-status="missed"] { border-left-color: var(--ink-3); opacity: .75; }
.enc-row[data-status="shiny"] { border-left-color: var(--gold); }
.enc-loc { display: flex; flex-direction: column; min-width: 0; }
.loc-name { font: 600 1rem/1.25 var(--font-head); }
.loc-note { font-size: .74rem; font-weight: 800; color: var(--warn); text-transform: uppercase; letter-spacing: .3px; }
.loc-count { font-size: .76rem; color: var(--ink-3); }
.enc-fields { display: grid; grid-template-columns: minmax(170px, 1.6fr) minmax(110px, 1fr) minmax(100px, .8fr) minmax(100px, .8fr); gap: 8px; align-items: center; }
.row-types { grid-column: 1 / -1; display: flex; }
.row-types:empty { display: none; }

.combo { position: relative; display: flex; align-items: center; border: 2px solid var(--ring); border-radius: 10px; background: var(--surface); min-width: 0; }
.combo.open { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }
.combo-input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); padding: 8px 6px 8px 34px; font: 700 .92rem var(--font-body);
  background-image: radial-gradient(circle at 15px 50%, transparent 4px, var(--ink-3) 4.5px, var(--ink-3) 5.5px, transparent 6px); background-repeat: no-repeat; }
.combo.has-mon .combo-input { padding-left: 4px; background-image: none; }
.combo-thumb { width: 32px; height: 32px; margin-left: 4px; image-rendering: pixelated; flex: none; }
.combo-caret { flex: none; width: 34px; align-self: stretch; border: 0; border-left: 1px solid var(--line); background: transparent; cursor: pointer; position: relative; }
.combo-caret::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3); transform: translate(-50%, -70%) rotate(45deg); }
.combo-list { position: absolute; z-index: 30; left: -2px; right: -2px; top: calc(100% + 6px); max-height: 320px; overflow-y: auto; margin: 0; padding: 4px;
  list-style: none; background: var(--surface); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .22); }
.combo-opt { display: flex; align-items: center; gap: 10px; padding: 4px 8px; border-radius: 8px; cursor: pointer; font-weight: 700; }
.combo-opt img { width: 40px; height: 40px; image-rendering: pixelated; flex: none; }
.combo-opt:hover, .combo-opt.active { background: var(--surface-2); }
.combo-opt.active { box-shadow: inset 0 0 0 2px var(--blue); }
.combo-opt.dupe { opacity: .45; }
.opt-name { flex: 1; min-width: 0; }
.opt-tag { font-size: .68rem; font-weight: 800; text-transform: uppercase; color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.combo-empty { padding: 10px; color: var(--ink-3); font-size: .88rem; }

.boss-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 4px 0; border-radius: 12px;
  background: color-mix(in srgb, var(--tc) 14%, var(--surface)); border: 2px dashed color-mix(in srgb, var(--tc) 55%, var(--line)); }
.boss-pip { width: 14px; height: 14px; border-radius: 50%; background: var(--tc); border: 2px solid var(--ink); flex: none; }
.boss-name { font: 700 1rem var(--font-head); flex: 1; }
.boss-cap { font: 800 .78rem var(--font-body); padding: 3px 10px; border-radius: 999px; background: var(--ink); color: var(--surface); }
.group-head { margin-top: 18px; }
.group-head h3 { font-size: 1.2rem; }

.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.shelf-mon { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 10px; border-radius: 14px;
  background: var(--surface); border: 2px solid var(--ring); }
.shelf-mon img { width: 72px; height: 72px; image-rendering: pixelated; }
.shelf-mon.team { border-color: var(--blue); }
.shelf-mon.dead img { filter: grayscale(1); opacity: .6; }
.shelf-mon strong { font-family: var(--font-head); }
.shelf-sub { font-size: .76rem; color: var(--ink-3); }
.shelf-mon .types { margin-top: 4px; justify-content: center; }
.shelf-empty { color: var(--ink-3); }
.run-foot { display: grid; gap: 10px; margin-top: 16px; }
.saved-note { font-size: .82rem; font-weight: 700; color: var(--ink-3); }
.saved-note.ok { color: var(--ok); } .saved-note.bad { color: var(--bad); }

/* ---------- consent ---------- */
.consent { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: min(640px, calc(100% - 24px)); display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px;
  background: var(--surface); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 14px 40px rgba(0, 0, 0, .28); }
.consent p { margin: 0; flex: 1; font-size: .93rem; }

@media (max-width: 760px) {
  .enc-row { grid-template-columns: 1fr; gap: 8px; }
  .enc-loc { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
  .enc-fields { grid-template-columns: 1fr 1fr; }
  .enc-fields .combo, .enc-fields input.field { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .consent { flex-direction: column; align-items: stretch; }
}

/* =====================================================================
   POLISH LAYER — motion, feedback, fluid sizing  (2026-10-13)
   Every animation is gated by prefers-reduced-motion at the bottom.
   ===================================================================== */

/* ---------- smooth scrolling + fluid scale ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { font-size: clamp(15px, 0.86rem + 0.28vw, 17.5px); }
@media (min-width: 1400px) { body > *, .hero-inner { max-width: 1140px; } }
@media (min-width: 1800px) { body > *, .hero-inner { max-width: 1280px; } }
::selection { background: var(--gold); color: var(--gold-ink); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.field:focus-visible, .combo-input:focus-visible { outline: none; }

/* hover feel on the small interactive bits only — the theme switch itself is one animated wipe (v11.26), not thousands
   of per-element colour transitions (that was the choppy part) */
.tab-btn, .btn, .field, .combo, .seg-btn, .version-toggle, .theme-btn, .stat-pill, .chip {
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .25s ease, transform .18s cubic-bezier(.2,.8,.2,1); }
.card, .gym-step, .enc-row, .shelf-mon, .boss-mon, .move-list li, .data-table-wrap, .callout, .dp-note, .consent, .combo-list { transition: box-shadow .25s ease, transform .18s cubic-bezier(.2,.8,.2,1); }
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: none !important; animation-play-state: paused; }

/* ---------- scroll progress + back-to-top ---------- */
.scroll-progress { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; z-index: 60; height: 4px; width: 100%;
  transform-origin: left; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--gold), var(--red)); pointer-events: none; }
.to-top { position: fixed; z-index: 55; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: 52px; height: 52px;
  border-radius: 50%; border: 4px solid var(--ink); cursor: pointer; padding: 0; opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none;
  background: radial-gradient(circle at 50% 50%, var(--surface) 0 7px, var(--ink) 7px 10px, transparent 10px),
              linear-gradient(var(--red) 0 44%, var(--ink) 44% 56%, var(--surface) 56%);
  box-shadow: 0 8px 22px rgba(0,0,0,.25); transition: opacity .3s ease, transform .35s cubic-bezier(.34,1.56,.64,1); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-3px) rotate(-12deg) scale(1.06); }
.to-top:active { transform: scale(.92); }
.to-top.spin { animation: ballspin .7s cubic-bezier(.2,.8,.2,1); }
@keyframes ballspin { to { transform: rotate(-360deg); } }

/* ---------- hero: drifting Poké Ball watermark + playful logo ---------- */
.hero { overflow: hidden; }
.hero::before { content: ""; position: absolute; right: -70px; top: -90px; width: 300px; height: 300px; border-radius: 50%; opacity: .14; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #fff 0 34px, var(--ink) 34px 48px, transparent 48px),
              linear-gradient(#fff 0 46%, var(--ink) 46% 54%, var(--red) 54%);
  animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { from { transform: rotate(-8deg) translateY(0); } to { transform: rotate(10deg) translateY(16px); } }
.hero-inner { position: relative; }
.logo { cursor: pointer; transition: transform .25s cubic-bezier(.34,1.56,.64,1); filter: drop-shadow(0 4px 0 rgba(0,0,0,.25)); }
.logo:hover { transform: translateY(-3px) rotate(-10deg) scale(1.06); }
.logo.wobble { animation: wobble .8s ease-in-out; }
@keyframes wobble { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-22deg) translateX(-4px); } 40% { transform: rotate(18deg) translateX(4px); }
  60% { transform: rotate(-12deg); } 80% { transform: rotate(8deg); } }
.hero h1 { text-shadow: 0 3px 0 rgba(0,0,0,.18); }
.hero-chip { transition: transform .18s cubic-bezier(.34,1.56,.64,1), background-color .2s; }
.hero-chip:hover { transform: translateY(-2px) scale(1.05); background: rgba(0,0,0,.3); }
.hero-chip.gold:hover { background: #ffd83d; }

/* ---------- buttons: lift, press, ripple ---------- */
.btn, .tab-btn, .seg-btn, .version-btn, .theme-btn, .combo-caret, .consent .btn { position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.btn:hover, .theme-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.14); }
.btn:active, .theme-btn:active, .tab-btn:active, .seg-btn:active, .version-btn:active { transform: translateY(1px) scale(.97); box-shadow: none; }
.tab-btn { transition: transform .2s cubic-bezier(.34,1.56,.64,1), background-color .25s, border-color .25s, color .25s, box-shadow .25s; }
.tab-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.12); }
.tab-btn::before { transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.tab-btn:hover::before { transform: rotate(180deg) scale(1.15); }
.tab-btn.active { animation: tabpop .35s cubic-bezier(.34,1.56,.64,1); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
@keyframes tabpop { 0% { transform: scale(.92); } 60% { transform: scale(1.06); } 100% { transform: none; } }
.version-btn { transition: background-color .25s, color .25s, transform .15s; }
.seg-btn.active { animation: tabpop .3s cubic-bezier(.34,1.56,.64,1); }
.ripple { position: absolute; left: var(--x); top: var(--y); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; pointer-events: none;
  background: currentColor; opacity: .28; transform: scale(0); animation: ripple .55s ease-out forwards; }
@keyframes ripple { to { transform: scale(22); opacity: 0; } }
.continue { display: inline-flex; align-items: center; gap: 6px; transition: color .2s, transform .2s; }
.continue::after { content: ""; width: 9px; height: 9px; border-top: 3px solid currentColor; border-right: 3px solid currentColor; transform: rotate(45deg); transition: transform .25s; }
.continue:hover::after { transform: rotate(45deg) translate(3px, -3px); }
.cap-chip { transition: transform .2s cubic-bezier(.34,1.56,.64,1); }
.cap-chip:hover { transform: scale(1.06) rotate(-2deg); }

/* ---------- cards: reveal on scroll + hover lift ---------- */
.reveal { opacity: 0; transform: translateY(18px) scale(.985); }
.reveal.in { opacity: 1; transform: none; transition: opacity .55s ease var(--d, 0s), transform .6s cubic-bezier(.2,.8,.2,1) var(--d, 0s), background-color .3s, border-color .3s, color .3s, box-shadow .25s; }
.card:hover, .gym-step:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(31,36,48,.06), 0 14px 30px rgba(31,36,48,.12); }
.card.mon { transform-style: preserve-3d; }
.card.mon.tilt { transform: perspective(900px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) translateY(-3px); transition: transform .08s linear, box-shadow .25s; }
.card::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--acc) 14%, transparent), transparent 45%); }
.card:hover::after { opacity: 1; }

/* ---------- sprites: hop on hover, catch on pick ---------- */
.sprite, .boss-mon img, .shelf-mon img, .combo-opt img, .combo-thumb { transition: transform .25s cubic-bezier(.34,1.56,.64,1), filter .25s; will-change: transform; }
.card.mon:hover .sprite { transform: translateY(-6px) scale(1.06) rotate(-4deg); filter: drop-shadow(0 10px 8px rgba(0,0,0,.18)); }
.sprite { cursor: pointer; }
.sprite:active { transform: scale(.94); }
.sprite.hop, .boss-mon img.hop, .shelf-mon img.hop, .combo-thumb.hop { animation: hop .55s cubic-bezier(.34,1.56,.64,1); }
@keyframes hop { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-14px) scale(1.08) rotate(-6deg); } 70% { transform: translateY(0) scale(.96) rotate(3deg); } 100% { transform: none; } }
.boss-mon, .shelf-mon { transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s, border-color .25s, background-color .3s; cursor: default; }
.boss-mon:hover, .shelf-mon:hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(0,0,0,.14); }
.boss-mon:hover img, .shelf-mon:hover img { transform: translateY(-5px) scale(1.12); }
.boss-mon.ace { animation: acepulse 2.4s ease-in-out infinite; }
@keyframes acepulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 40%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }
.combo-opt { transition: background-color .15s, transform .15s; }
.combo-opt:hover { transform: translateX(4px); }
.combo-opt:hover img { transform: scale(1.18) rotate(-6deg); }
.combo-thumb.pop { animation: pop .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes pop { 0% { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.25) rotate(6deg); } 100% { transform: none; } }
.catch-fx { position: absolute; left: 6px; top: 50%; width: 32px; height: 32px; margin-top: -16px; border-radius: 50%; z-index: 5; pointer-events: none;
  border: 3px solid var(--ink); background: radial-gradient(circle at 50% 50%, #fff 0 4px, var(--ink) 4px 6px, transparent 6px), linear-gradient(var(--red) 0 44%, var(--ink) 44% 56%, #fff 56%);
  animation: throwball 1.1s ease-in-out forwards; }
@keyframes throwball {
  0%   { transform: translateY(-40px) scale(.2) rotate(-180deg); opacity: 0; }
  25%  { transform: translateY(0) scale(1) rotate(0); opacity: 1; }
  40%  { transform: rotate(-25deg); } 55% { transform: rotate(22deg); } 70% { transform: rotate(-14deg); } 82% { transform: rotate(0); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; } }
.catch-fx::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 3px solid var(--gold); opacity: 0; animation: ring 1.1s ease-out forwards; }
@keyframes ring { 0%,75% { transform: scale(.4); opacity: 0; } 85% { opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
.enc-row { transition: border-color .3s, background-color .3s, transform .2s, box-shadow .25s, opacity .3s; }
.enc-row:hover { transform: translateX(3px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.enc-row { position: relative; }
.enc-row:has(.combo.open) { z-index: 40; transform: none; }
.combo.open { z-index: 41; }
.enc-row.flash { animation: flash .9s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.enc-row.shake { animation: shake .5s ease-in-out; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.enc-row[data-status="dead"] .combo-thumb { filter: grayscale(1) opacity(.7); }
.enc-row[data-status="shiny"] { background: linear-gradient(110deg, var(--surface) 40%, color-mix(in srgb, var(--gold) 28%, var(--surface)) 50%, var(--surface) 60%) 0 0 / 260% 100%; animation: shimmer 3.2s linear infinite; }
@keyframes shimmer { to { background-position: -160% 0; } }
.enc-row.target { animation: flash 1.2s ease-out 2; }
.combo-list { transform-origin: top; animation: menu .18s cubic-bezier(.2,.8,.2,1); scrollbar-width: thin; scrollbar-color: var(--ring) transparent; }
@keyframes menu { from { opacity: 0; transform: translateY(-6px) scaleY(.96); } }
.combo-list::-webkit-scrollbar { width: 8px; } .combo-list::-webkit-scrollbar-thumb { background: var(--ring); border-radius: 8px; }
.combo-caret:hover::after { border-color: var(--ink); } .combo.open .combo-caret::after { transform: translate(-50%, -30%) rotate(225deg); }
.combo-caret::after { transition: transform .25s, border-color .2s; }

/* ---------- stat bars grow in; badges + chips pop ---------- */
.stat-bar { transform-origin: left; transition: width .4s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.reveal:not(.in) .stat-bar { transform: scaleX(0); }
.stat-row:hover .stat-bar { filter: brightness(1.1) saturate(1.2); }
.type-badge { position: relative; overflow: hidden; transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .2s; cursor: default; }
.type-badge::after { content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%; transform: skewX(-20deg); background: rgba(255,255,255,.35); transition: left .45s ease; }
.type-badge:hover { transform: translateY(-2px) scale(1.08); box-shadow: 0 4px 10px color-mix(in srgb, var(--tc) 50%, transparent); }
.type-badge:hover::after { left: 130%; }
.chip, .move-list li { transition: transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .2s, border-color .2s, background-color .3s; }
.chip:hover, .move-list li:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.1); }
.stat-pill strong { display: inline-block; }
.stat-pill strong.bump { animation: bump .45s cubic-bezier(.34,1.56,.64,1); }
@keyframes bump { 40% { transform: scale(1.5); } }
.gym-badge { transition: transform .5s cubic-bezier(.34,1.56,.64,1), box-shadow .3s; cursor: default; }
.gym-step:hover .gym-badge { transform: rotateY(360deg) scale(1.08); box-shadow: inset 0 -5px 0 rgba(0,0,0,.12), 0 0 0 6px color-mix(in srgb, var(--gold) 35%, transparent); }
.data-table-wrap tbody tr { transition: background-color .15s; }
.data-table-wrap tbody tr:hover { background: color-mix(in srgb, var(--acc) 10%, var(--surface)); }
.boss-row { transition: transform .2s, box-shadow .2s; }
.boss-row:hover { transform: translateX(4px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.boss-pip { animation: pip 2s ease-in-out infinite; }
@keyframes pip { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tc) 50%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }

/* ---------- consent + saved note ---------- */
.consent { animation: slideup .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes slideup { from { transform: translate(-50%, 40px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.consent.bye { animation: slidedown .3s ease-in forwards; }
@keyframes slidedown { to { transform: translate(-50%, 60px); opacity: 0; } }
.saved-note { transition: color .3s; }
.saved-note.ok { animation: fadein .3s; }
@keyframes fadein { from { opacity: 0; } }

/* ---------- container-based sizing for tracker rows ---------- */
.enc-list { container-type: inline-size; }
@container (max-width: 760px) {
  .enc-row { grid-template-columns: 1fr; gap: 8px; }
  .enc-loc { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
  .enc-fields { grid-template-columns: 1fr 1fr; }
  .enc-fields .combo, .enc-fields input.field { grid-column: 1 / -1; }
}
.mon-body { grid-template-columns: clamp(84px, 11vw, 128px) minmax(0, 1fr); }
.sprite { width: clamp(84px, 11vw, 128px); height: clamp(84px, 11vw, 128px); }
@media (max-width: 560px) { .mon-body { grid-template-columns: 84px minmax(0, 1fr); } .sprite { width: 84px; height: 84px; } }
@media (hover: none) { .card:hover, .gym-step:hover, .enc-row:hover, .boss-mon:hover, .shelf-mon:hover { transform: none; box-shadow: var(--shadow); } }

/* ---------- reduced motion: everything static, nothing hidden ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .reveal { opacity: 1; transform: none; }
  .reveal:not(.in) .stat-bar { transform: none; }
  .hero::before { animation: none; }
}

/* =====================================================================
   TEAM · COMPARE · GYMS · DETAILS · GUIDE  (2026-10-13 d)
   ===================================================================== */

/* ---------- breathing room: wider gutters, roomier cards ---------- */
body { padding-left: clamp(16px, 4vw, 40px); padding-right: clamp(16px, 4vw, 40px); }
.hero { margin-left: calc(-1 * clamp(16px, 4vw, 40px)); margin-right: calc(-1 * clamp(16px, 4vw, 40px)); padding-left: clamp(16px, 4vw, 40px); padding-right: clamp(16px, 4vw, 40px); }
.card { padding: clamp(14px, 2.2vw, 22px); margin: 16px 0; }
h2 { margin-top: 34px; }
.lead { max-width: 72ch; }
.lbl { display: flex; flex-direction: column; gap: 4px; font: 800 .74rem/1.2 var(--font-body); letter-spacing: .4px; text-transform: uppercase; color: var(--ink-3); min-width: 0; }
.lbl.inline { flex-direction: row; align-items: center; gap: 6px; }
.lbl .field { text-transform: none; letter-spacing: 0; }
.field.num { width: 5.5em; text-align: center; font-variant-numeric: tabular-nums; }
.field.bad { border-color: var(--bad); }
.field.ta { font: 600 .9rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; min-height: 150px; }
.spacer { flex: 1 1 auto; }
.btn-ok { border-color: var(--ok); color: var(--ok); }
.btn-ok:hover { background: var(--ok-bg); }
.linkish { border: 0; background: none; padding: 0; color: var(--blue); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.warn-note { color: var(--warn); }

/* ---------- welcome guide ---------- */
.welcome { border-color: var(--gold); border-top: 6px solid var(--gold); background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 12%, var(--surface)), var(--surface) 70%); }
.welcome.bye { animation: fadeout .35s ease-in forwards; }
@keyframes fadeout { to { opacity: 0; transform: translateY(-8px); } }
.welcome-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.welcome-steps { margin: 10px 0 6px; padding-left: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.welcome-steps li { counter-increment: step; position: relative; padding-left: 44px; min-height: 32px; }
.welcome-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--surface); font: 700 1rem var(--font-head); border: 3px solid var(--gold); }

/* ---------- team tab ---------- */
.tm-head .tm-tools { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 10px; }
.tm-picker .combo-input { padding-left: 34px; }
.opt-how { display: block; font-size: .72rem; font-weight: 600; color: var(--ink-3); }
.opt-tag.bd { color: var(--blue); border-color: var(--blue); } .opt-tag.sp { color: var(--pearl); border-color: var(--pearl); }
.opt-tag.bad { color: var(--bad); border-color: var(--bad); }
.tm-slots { display: grid; gap: 16px; }
.card.tm { border-top: 6px solid var(--acc); }
.card.tm.needs-review { box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 35%, transparent), var(--shadow); }
.tm-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tm-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tm-body { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: start; }
.tm-sprite { display: grid; place-items: center; }
.tm-fields { display: grid; gap: 12px; min-width: 0; }
.tm-grid { display: grid; gap: 10px; }
.tm-grid.id { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.tm-grid.moves { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tm-moves { display: grid; gap: 8px; }
.tm-stats { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.tm-stats-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tm-stats-head .meta-note { flex: 1 1 200px; }
.stat-row.tm { grid-template-columns: 40px minmax(0, 1fr) 5.5em; }
.review-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--warn); border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--warn); margin-left: 4px; vertical-align: middle; cursor: help; animation: pip 2s ease-in-out infinite; }
.chip .type-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tc, var(--ink-3)); flex: none; align-self: center; }
.chip img { width: 22px; height: 22px; image-rendering: pixelated; align-self: center; }
.tm-h { font-size: 1.2rem; margin: 0 0 8px; }
.cov-card { border-top: 6px solid var(--red); }
.cov-boss { margin: 14px 0 6px; }
.cov-boss h4 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font: 600 1.05rem var(--font-head); }
.cov-row { display: grid; grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); margin: 6px 0; background: var(--surface-2); }
.cov-row.gap { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); background: color-mix(in srgb, var(--bad) 6%, var(--surface)); }
.cov-target { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cov-target img { width: 48px; height: 48px; image-rendering: pixelated; flex: none; }
.cov-lbl { display: block; font: 800 .68rem/1.3 var(--font-body); letter-spacing: .5px; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.cov-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cov-none { color: var(--bad); font-weight: 700; font-size: .9rem; }
.cov-safe { color: var(--ok); font-weight: 700; font-size: .9rem; }
.io-report { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.io-report ul { margin: 6px 0; padding-left: 18px; }
.io-ok { color: var(--ok); } .io-warn { color: var(--warn); } .io-bad { color: var(--bad); }
@media (max-width: 720px) {
  .tm-head .tm-tools { grid-template-columns: 1fr; }
  .tm-body { grid-template-columns: 1fr; }
  .tm-sprite { justify-items: start; }
  .cov-row { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- boss / leader detail panel ---------- */
.boss-mon { font: inherit; color: inherit; cursor: pointer; }
.boss-mon.open { border-color: var(--ink); background: var(--surface); box-shadow: 0 8px 20px rgba(0,0,0,.14); transform: translateY(-3px); }
.boss-mon.open::after { content: ""; display: block; width: 0; height: 0; margin-top: 2px; border: 7px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.boss-detail { margin: 2px 0 14px; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 2px solid var(--ring); animation: menu .25s cubic-bezier(.2,.8,.2,1); }
.bd-head { display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(220px, 1.2fr); gap: 16px; align-items: start; }
.bd-id { display: grid; gap: 6px; align-content: start; }
.bd-name { font: 700 1.3rem var(--font-head); }
.bd-meta { color: var(--ink-2); font-size: .92rem; }
.bd-stats-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.stat-row.bd { grid-template-columns: 36px minmax(0, 1fr) 34px 44px; }
.stat-act { font-size: .74rem; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.bd-moves { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-top: 14px; }
.bd-move, .cmp-move { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--tc, var(--ring)); min-width: 0; }
.bd-move-h, .cmp-move-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cmp-move-cls { font-size: .7rem; font-weight: 800; text-transform: uppercase; color: var(--ink-3); letter-spacing: .4px; }
.cmp-move-nums { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: .82rem; color: var(--ink-2); }
.cmp-move-nums b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cmp-move-fx { margin: 6px 0 0; font-size: .82rem; color: var(--ink-2); line-height: 1.45; }
.cmp-eff { font-weight: 800; }
.cmp-eff.se, .cmp-match-cell.se strong { color: var(--ok); } .cmp-eff.nve, .cmp-match-cell.nve strong { color: var(--warn); } .cmp-eff.imm, .cmp-match-cell.imm strong { color: var(--bad); }
@media (max-width: 720px) { .bd-head { grid-template-columns: 80px minmax(0, 1fr); } .bd-stats { grid-column: 1 / -1; } }

/* ---------- portraits + fight rows (gyms, E4) ---------- */
.portrait { display: inline-grid; place-items: center; width: 120px; height: 120px; flex: none; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--acc, var(--tc, var(--ink-3))) 30%, var(--surface)), var(--surface-2) 72%); border: 3px solid var(--ink); }
.portrait img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.portrait img.pixel { image-rendering: pixelated; width: 80%; height: 80%; }
.fight-row:hover .portrait img, .fight-card:hover .portrait img { transform: scale(1.08) translateY(-3px); }
.fight-card .card-header { align-items: center; }
.fight-card .card-header h3 { flex: 1 1 200px; }
details.fight { padding: 0; overflow: visible; }
details.fight > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 22px 120px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: clamp(12px, 2vw, 18px) clamp(14px, 2.2vw, 22px); border-radius: var(--radius); }
details.fight > summary::-webkit-details-marker { display: none; }
details.fight > summary::before { content: none; display: none; }
details.fight > summary:hover { background: var(--surface-2); }
.fight-chevron { width: 10px; height: 10px; border-right: 3px solid var(--ink-3); border-bottom: 3px solid var(--ink-3); transform: rotate(-45deg); transition: transform .25s; justify-self: center; }
details.fight[open] > .fight-row .fight-chevron { transform: rotate(45deg); }
.fight-id { display: grid; gap: 2px; min-width: 0; }
.fight-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font: 700 1.35rem var(--font-head); }
.fight-sub { color: var(--ink-2); font-size: .95rem; } .fight-sub.small { font-size: .8rem; color: var(--ink-3); }
.fight-team { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 240px; }
.fight-team img { width: 48px; height: 48px; image-rendering: pixelated; transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.fight-team img:hover { transform: scale(1.3) translateY(-4px); }
.fight-cap { display: grid; text-align: center; line-height: 1; padding: 6px 12px; border-radius: 12px; background: var(--gold); color: var(--gold-ink); }
.fight-cap small { font: 800 .66rem var(--font-body); text-transform: uppercase; letter-spacing: .5px; } .fight-cap b { font: 700 1.6rem var(--font-head); }
.fight-body { padding: 0 clamp(14px, 2.2vw, 22px) clamp(14px, 2.2vw, 22px); border-top: 1px dashed var(--line); animation: menu .25s cubic-bezier(.2,.8,.2,1); }
.gym-h4 { margin: 16px 0 8px; font: 600 1.05rem var(--font-head); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.gym-trainers { display: grid; gap: 8px; }
.gym-trainer { display: grid; grid-template-columns: 56px 170px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.gt-art { width: 56px; height: 56px; object-fit: contain; object-position: bottom; }
.gt-who { display: grid; min-width: 0; }
.gt-mons { display: flex; flex-wrap: wrap; gap: 6px; }
.gt-mon { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .82rem; font-weight: 700; }
.gt-mon img { width: 36px; height: 36px; image-rendering: pixelated; } .gt-mon small { color: var(--ink-3); font-weight: 800; }
.ace-row td:first-child { color: var(--red); font-weight: 700; }
@media (max-width: 760px) {
  details.fight > summary { grid-template-columns: 16px 84px minmax(0, 1fr); grid-template-areas: "c p id" "c p team"; row-gap: 8px; }
  details.fight > summary .fight-chevron { grid-area: c; } details.fight > summary .portrait { grid-area: p; width: 84px; height: 84px; } details.fight > summary .fight-id { grid-area: id; }   /* v12.8: scoped — the bare selectors leaked grid-area into every other head that reuses these classes (Areas cards lost their title column) */
  .fight-team { grid-area: team; justify-content: flex-start; max-width: none; } .fight-cap { grid-area: team; justify-self: end; align-self: end; }
  .fight-team img { width: 40px; height: 40px; }
  .fight-name { font-size: 1.15rem; }
  .gym-trainer { grid-template-columns: 48px minmax(0, 1fr); } .gt-mons { grid-column: 1 / -1; }
}

/* ---------- compare drawer ---------- */
.cmp { position: fixed; inset: 0; z-index: 70; background: rgba(20, 22, 30, .45); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px); }
.cmp.show { opacity: 1; }
.cmp-panel { width: min(1100px, 100%); max-height: 92vh; overflow-y: auto; background: var(--bg); color: var(--ink); border-radius: 22px 22px 0 0; border: 3px solid var(--ink); border-bottom: 0;
  padding: 16px clamp(14px, 3vw, 28px) calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateY(40px); transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -20px 60px rgba(0,0,0,.3); }
.cmp.show .cmp-panel { transform: none; }
.cmp-head { display: flex; align-items: center; gap: 12px; position: sticky; top: -16px; background: var(--bg); padding: 6px 0 10px; z-index: 2; }
.cmp-head h3 { font-size: 1.4rem; } .cmp-head .meta-note { flex: 1; }
.cmp-close { padding: 6px 12px; }
.cmp-fab { position: fixed; z-index: 55; left: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); border: 3px solid var(--ink); background: var(--gold); color: var(--gold-ink); border-radius: 999px; padding: 10px 18px 10px 40px;
  font: 700 .95rem var(--font-head); cursor: pointer; box-shadow: 0 8px 22px rgba(0,0,0,.22); transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .2s; }
.cmp-fab::before { content: ""; position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; border: 2px solid var(--ink);
  background: radial-gradient(circle, #fff 0 3px, var(--ink) 3px 5px, transparent 5px), linear-gradient(var(--red) 0 44%, var(--ink) 44% 56%, #fff 56%); }
.cmp-fab:hover { transform: translateY(-3px) scale(1.04); } .cmp-fab:active { transform: scale(.96); }
body.cmp-open .cmp-fab, body.cmp-open .to-top { opacity: 0; pointer-events: none; }
.cmp-pickers { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: start; margin-bottom: 12px; }
.cmp-vs { font: 700 1.1rem var(--font-head); color: var(--ink-3); padding-top: 10px; }
.cmp-pick { display: grid; gap: 8px; }
.cmp-pick-row { display: flex; gap: 8px; align-items: center; }
.cmp-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-quick .chip { cursor: pointer; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-col-head { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface); border: 2px solid var(--ring); min-width: 0; }
.cmp-col-head.side-a { border-color: var(--blue); } .cmp-col-head.side-b { border-color: var(--red); }
.cmp-col-head .sprite { width: 84px; height: 84px; flex: none; }
.cmp-match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.cmp-match-cell { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.cmp-match-cell strong { font: 700 1.05rem var(--font-head); }
.cmp-stats { margin: 12px 0; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.cmp-sec-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cmp-stat { display: grid; grid-template-columns: 48px minmax(0, 1fr) 70px minmax(0, 1fr) 48px; gap: 8px; align-items: center; padding: 3px 0; font-size: .86rem; }
.cmp-stat.base { color: var(--ink-3); font-weight: 700; margin-top: 4px; border-top: 1px dashed var(--line); padding-top: 6px; }
.cmp-lbl { text-align: center; font-weight: 800; color: var(--ink-3); font-size: .78rem; }
.cmp-v { font-weight: 700; font-variant-numeric: tabular-nums; } .cmp-v.a { text-align: right; } .cmp-v.win { color: var(--ok); }
.cmp-bar { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; display: flex; }
.cmp-bar.a { justify-content: flex-end; } .cmp-bar .stat-bar { transition: width .6s cubic-bezier(.2,.8,.2,1); }
.cmp-bar.a .stat-bar { background: var(--blue); } .cmp-bar.b .stat-bar { background: var(--red); }
.cmp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.cmp-cell, .cmp-moves { padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; display: grid; gap: 8px; align-content: start; }
.cmp-move.no { opacity: .6; }
@media (max-width: 760px) {
  .cmp-pickers { grid-template-columns: 1fr; } .cmp-vs { text-align: center; padding: 0; }
  .cmp-grid, .cmp-match, .cmp-two { grid-template-columns: 1fr; }
  .cmp-stat { grid-template-columns: 40px minmax(0, 1fr) 54px minmax(0, 1fr) 40px; font-size: .8rem; }
  .cmp-panel { max-height: 94vh; border-radius: 18px 18px 0 0; }
}
@media (prefers-reduced-motion: reduce) { .cmp, .cmp-panel { transition: none; } }
/* v4 tune-ups */
.cmp-fab { left: auto; right: 18px; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
.fight-card .card-header h3 { font-size: 1.5rem; }
.cmp-stat { grid-template-columns: 64px minmax(0, 1fr) 70px minmax(0, 1fr) 64px; }
.cmp-stat.base .cmp-v { white-space: nowrap; }
@media (max-width: 760px) { .cmp-stat { grid-template-columns: 52px minmax(0, 1fr) 50px minmax(0, 1fr) 52px; } .cmp-fab { bottom: calc(82px + env(safe-area-inset-bottom, 0px)); } }
@media (max-width: 760px) { .cmp-fab { width: 52px; height: 52px; padding: 0; font-size: 0; border-radius: 50%; } .cmp-fab::before { left: 50%; margin-left: -9px; } }

/* ---------- v5: menus never clipped; TMs tab ---------- */
.card.tm-head, .card.run-head, .card.io { overflow: visible; }
.card.tm-head::after, .card.run-head::after { display: none; }
.tm-picker .combo-list { max-height: min(420px, 60vh); }
.opt-tag.ok { color: var(--ok); border-color: var(--ok); } .opt-tag.warn { color: var(--warn); border-color: var(--warn); }
.type-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.type-filter .type-badge { cursor: pointer; border: 2px solid transparent; opacity: .55; }
.type-filter .type-badge.on, .type-filter .type-badge:hover { opacity: 1; border-color: var(--ink); }
.type-filter .type-badge.all { background: var(--ink-3); }
.tm-tools-card { margin-bottom: 12px; }
.tm-list { display: grid; gap: 10px; }
.tm-card { padding: 0; border-left: 8px solid var(--acc); }
.tmc-head { width: 100%; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px clamp(12px, 2vw, 18px); border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius); }
.tmc-head:hover { background: var(--surface-2); }
.tm-num { font: 700 1.1rem var(--font-head); color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 0; text-align: center; letter-spacing: .3px; }
.tm-id { display: grid; gap: 4px; min-width: 0; }
.tm-move { font: 700 1.15rem var(--font-head); }
.tm-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tm-nums { font-size: .82rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tm-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.tm-count { font: 800 .74rem var(--font-body); text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); }
.tm-mine { font: 800 .74rem var(--font-body); padding: 3px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
.tm-card.open .fight-chevron { transform: rotate(45deg); }
.tmc-body { padding: 4px clamp(12px, 2vw, 18px) 16px; border-top: 1px dashed var(--line); display: grid; gap: 12px; animation: menu .25s cubic-bezier(.2,.8,.2,1); }
.tm-effect { margin: 10px 0 0; color: var(--ink-2); }
.tm-loc { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.tm-learners { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-learners .gt-mon { cursor: default; font: inherit; font-weight: 700; color: inherit; }
.gt-mon.mine { border-color: var(--ok); background: var(--ok-bg); }
.gt-mon.warn { border-color: var(--warn); background: var(--warn-bg); }
.gt-mon.warn small { color: var(--warn); }
button.gt-mon { cursor: pointer; transition: transform .15s cubic-bezier(.34,1.56,.64,1), border-color .2s; }
button.gt-mon:hover { transform: translateY(-2px); border-color: var(--ink); }
.tm-disputed { padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); }
.tm-monpick { display: grid; gap: 10px; margin-bottom: 12px; }
.tm-mini-list { display: grid; gap: 6px; }
.tm-mini { display: grid; grid-template-columns: 60px auto minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); border-left: 5px solid var(--tc); }
.tm-mini.warn { background: var(--warn-bg); }
.tm-mini .tm-num { font-size: .9rem; padding: 3px 0; }
@media (max-width: 760px) {
  .tmc-head { grid-template-columns: 56px minmax(0, 1fr); } .tm-right { grid-column: 1 / -1; justify-content: flex-start; }
  .tm-mini { grid-template-columns: 52px minmax(0, 1fr) auto; } .tm-mini .meta-note, .tm-mini .tm-nums { grid-column: 2 / -1; }
}
/* open menus always win the stacking order, whatever card they live in */
.card:has(.combo.open), .enc-row:has(.combo.open), .cmp-pick:has(.combo.open) { position: relative; z-index: 80; transform: none !important; }
.card:has(.combo.open)::after { display: none; }
.combo-list { z-index: 90; }

/* =====================================================================
   v6: scroll play · dex card · run-killers
   ===================================================================== */
/* reveal v2: alternate sides, replay in both directions, never leave gaps */
.reveal { opacity: 0; transform: translate3d(0, 22px, 0) scale(.985); }
.reveal.from-left { transform: translate3d(-28px, 16px, 0) rotate(-.6deg); }
.reveal.from-right { transform: translate3d(28px, 16px, 0) rotate(.6deg); }
.reveal.out-up { transform: translate3d(0, -22px, 0) scale(.985); }
.reveal.in { opacity: 1; transform: none; }
.reveal .sprite, .reveal .boss-mon img, .reveal .gt-mon img, .reveal .shelf-mon img { transition: transform .5s cubic-bezier(.34,1.56,.64,1); }
.reveal:not(.in) .sprite, .reveal:not(.in) .boss-mon img, .reveal:not(.in) .shelf-mon img { transform: translateY(10px) scale(.8); }
.reveal.in .type-badge { animation: badgein .45s cubic-bezier(.34,1.56,.64,1) both; animation-delay: calc(var(--d, 0s) + .12s); }
@keyframes badgein { from { transform: scale(.4) rotate(-8deg); opacity: 0; } }
.boss-team.reveal.in .boss-mon { animation: tilein .5s cubic-bezier(.34,1.56,.64,1) both; }
.boss-team .boss-mon:nth-child(1) { animation-delay: .05s; } .boss-team .boss-mon:nth-child(2) { animation-delay: .12s; } .boss-team .boss-mon:nth-child(3) { animation-delay: .19s; }
.boss-team .boss-mon:nth-child(4) { animation-delay: .26s; } .boss-team .boss-mon:nth-child(5) { animation-delay: .33s; } .boss-team .boss-mon:nth-child(6) { animation-delay: .4s; }
@keyframes tilein { from { transform: translateY(16px) scale(.9); opacity: 0; } }
/* rolling Poké Ball on the progress bar */
.scroll-ball { position: fixed; z-index: 61; top: calc(env(safe-area-inset-top, 0px) - 6px); left: calc(var(--p, 0) * (100% - 16px)); width: 16px; height: 16px; border-radius: 50%; pointer-events: none;
  border: 2px solid var(--ink); background: radial-gradient(circle, #fff 0 2px, var(--ink) 2px 3.5px, transparent 3.5px), linear-gradient(var(--red) 0 44%, var(--ink) 44% 56%, #fff 56%);
  transform: rotate(var(--spin, 0deg)); box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: left .08s linear; }
/* runner sprite in the sticky tab bar */
.runner-track { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 56px); z-index: 21; height: 0; overflow: visible; pointer-events: none; max-width: 980px; margin: 0 auto; }
@media (min-width: 1400px) { .runner-track { max-width: 1140px; } } @media (min-width: 1800px) { .runner-track { max-width: 1280px; } }
.scroll-runner { position: absolute; top: -10px; left: clamp(0px, var(--x, 0%), calc(100% - 40px)); width: 40px; height: 40px; image-rendering: pixelated; pointer-events: auto; cursor: pointer; z-index: 1;
  transform-origin: 50% 100%; transition: left .12s linear, transform .2s; filter: drop-shadow(0 2px 0 rgba(0,0,0,.18)); }
.scroll-runner.back { transform: scaleX(-1); }
.scroll-runner.moving { animation: jog .28s ease-in-out infinite; }
.scroll-runner.back.moving { animation: jogback .28s ease-in-out infinite; }
@keyframes jog { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-4deg); } }
@keyframes jogback { 0%,100% { transform: scaleX(-1) translateY(0); } 50% { transform: scaleX(-1) translateY(-6px) rotate(4deg); } }
.scroll-runner.hop { animation: hop .55s cubic-bezier(.34,1.56,.64,1); }
/* hero parallax: watermark ball drifts down as you scroll; chips float */
.hero::before { translate: 0 var(--py, 0px); }
.hero-chips .hero-chip { animation: float 4s ease-in-out infinite; }
.hero-chips .hero-chip:nth-child(2) { animation-delay: .6s; } .hero-chips .hero-chip:nth-child(3) { animation-delay: 1.2s; } .hero-chips .hero-chip:nth-child(4) { animation-delay: 1.8s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.tab-btn.active { position: relative; }
.tab-btn.active::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--red); animation: dotin .3s cubic-bezier(.34,1.56,.64,1); }
@keyframes dotin { from { transform: scale(0); } }
.card.tm.tilt { transform: perspective(900px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) translateY(-3px); transition: transform .08s linear; }
.opt-tag.post { color: var(--ink-3); border-style: dashed; }

/* ---------- run-killers ---------- */
.rk-skull { display: inline-block; width: 14px; height: 14px; border-radius: 50% 50% 45% 45%; background: var(--ink); position: relative; vertical-align: -2px; margin-right: 4px; }
.rk-skull::before, .rk-skull::after { content: ""; position: absolute; top: 4px; width: 3px; height: 4px; border-radius: 50%; background: var(--surface); }
.rk-skull::before { left: 3px; } .rk-skull::after { right: 3px; }
.rk-skull.big { width: 22px; height: 22px; } .rk-skull.big::before, .rk-skull.big::after { top: 6px; width: 5px; height: 6px; } .rk-skull.big::before { left: 5px; } .rk-skull.big::after { right: 5px; }
.rk-badge { display: inline-flex; align-items: center; gap: 2px; font: 800 .7rem var(--font-body); text-transform: uppercase; letter-spacing: .4px; padding: 3px 9px; border-radius: 999px; border: 2px solid; white-space: nowrap; }
.rk-badge.sev3 { color: var(--bad); border-color: var(--bad); background: var(--bad-bg); } .rk-badge.sev3 .rk-skull { background: var(--bad); }
.rk-badge.sev2 { color: var(--warn); border-color: var(--warn); background: var(--warn-bg); } .rk-badge.sev2 .rk-skull { background: var(--warn); }
.rk-badge.sev1 { color: var(--ink-2); border-color: var(--ring); background: var(--surface-2); }
.rk-card { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: 14px; border-radius: 14px; margin: 10px 0; background: var(--surface); border: 2px solid var(--ring); border-left-width: 8px; }
.rk-card.sev3 { border-left-color: var(--bad); background: linear-gradient(90deg, color-mix(in srgb, var(--bad) 7%, var(--surface)), var(--surface) 40%); }
.rk-card.sev2 { border-left-color: var(--warn); background: linear-gradient(90deg, color-mix(in srgb, var(--warn) 8%, var(--surface)), var(--surface) 40%); }
.rk-card.sev1 { border-left-color: var(--ink-3); }
.rk-mon { border: 0; background: var(--surface-2); border-radius: 50%; width: 84px; height: 84px; display: grid; place-items: center; cursor: pointer; padding: 0; transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .2s; }
.rk-mon:hover { transform: scale(1.08) rotate(-4deg); box-shadow: 0 8px 18px rgba(0,0,0,.15); }
.rk-mon img { width: 72px; height: 72px; image-rendering: pixelated; }
.rk-body { display: grid; gap: 6px; min-width: 0; }
.rk-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rk-who { font: 700 1.1rem var(--font-head); } .rk-where { font-size: .82rem; color: var(--ink-3); }
.rk-set { display: flex; flex-wrap: wrap; gap: 4px; }
.rk-why, .rk-how { margin: 0; font-size: .92rem; line-height: 1.5; } .rk-how b { color: var(--ok); } .rk-why b { color: var(--bad); }
.rk-card.compact .rk-why, .rk-card.compact .rk-how { font-size: .88rem; }
.rk-grid { display: grid; gap: 10px; margin-top: 10px; }
.rk-overview { border-top: 6px solid var(--bad); }
.rk-overview > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font: 600 1.05rem var(--font-head); }
.rk-overview > summary::before { content: none; } .rk-overview > summary::-webkit-details-marker { display: none; }
.rk-overview > summary strong { flex: 1 1 200px; }
.rk-strip { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; margin: 2px 0 6px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 2px dashed var(--ring); border-left: 6px solid var(--bad); font-size: .9rem; }
.rk-strip.sev2 { border-left-color: var(--warn); } .rk-strip.sev1 { border-left-color: var(--ink-3); }
.rk-strip img { width: 40px; height: 40px; image-rendering: pixelated; cursor: pointer; }
.rk-strip-text { display: grid; gap: 2px; min-width: 0; } .rk-strip-text strong { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font: 600 .98rem var(--font-head); }
.rk-strip-more { grid-column: 1 / -1; padding-top: 8px; border-top: 1px dashed var(--line); display: grid; gap: 4px; animation: menu .25s cubic-bezier(.2,.8,.2,1); }
.rk-strip-more p { margin: 0; font-size: .9rem; line-height: 1.5; }
.rk-next { display: inline-flex; align-items: center; gap: 4px; font: 800 .78rem var(--font-body); padding: 4px 10px; border-radius: 999px; border: 2px solid var(--bad); color: var(--bad); background: var(--bad-bg); cursor: pointer; animation: pip 2.4s ease-in-out infinite; }
.rk-next.sev2 { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); } .rk-next.sev1 { border-color: var(--ring); color: var(--ink-2); background: var(--surface-2); animation: none; }
.rk-next .rk-skull { background: currentColor; }
@media (max-width: 760px) { .rk-card { grid-template-columns: 1fr; } .rk-mon { width: 72px; height: 72px; } .rk-strip { grid-template-columns: 36px minmax(0, 1fr); } .rk-strip .btn { grid-column: 1 / -1; } }

/* ---------- dex card ---------- */
.dex-loading { display: grid; place-items: center; padding: 40px 0; gap: 8px; }
.dex-hero { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: start; padding: 16px; border-radius: 16px; border: 2px solid var(--ring); margin-bottom: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tc, var(--ink-3)) 22%, var(--surface)), var(--surface) 60%); }
.dex-sprite-wrap { display: grid; place-items: center; }
.dex-sprite { width: 128px; height: 128px; animation: hop .7s cubic-bezier(.34,1.56,.64,1); }
.dex-id { display: grid; gap: 6px; min-width: 0; }
.dex-num { font: 800 .76rem var(--font-body); letter-spacing: .5px; text-transform: uppercase; color: var(--ink-3); }
.dex-name { font: 700 1.8rem var(--font-head); line-height: 1.1; }
.dex-flavor { margin: 2px 0 0; color: var(--ink-2); font-style: italic; max-width: 60ch; }
.dex-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .84rem; color: var(--ink-2); }
.dex-actions { margin-top: 4px; }
.dex-section { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); margin-top: 12px; display: grid; gap: 8px; }
.dex-section h4 { margin: 0; font: 600 1.05rem var(--font-head); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.dex-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; } .dex-list b { margin-right: 6px; }
.dex-breed { margin-top: 8px; }
.dex-special { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--ok-bg); border: 1px solid color-mix(in srgb, var(--ok) 40%, var(--line)); }
.dex-locs { display: flex; flex-wrap: wrap; gap: 6px; }
.dex-loc { cursor: pointer; font: inherit; font-weight: 700; } .dex-loc img { width: 22px; height: 22px; image-rendering: pixelated; }
.dex-tms { display: flex; flex-wrap: wrap; gap: 5px; }
.dex-back { justify-self: start; margin-bottom: 6px; }
.evo-tree { overflow-x: auto; padding: 4px 0; }
.evo-node { display: flex; align-items: center; gap: 10px; }
.evo-mon { border: 2px solid var(--ring); background: var(--surface-2); border-radius: 14px; padding: 8px 10px; display: grid; justify-items: center; gap: 2px; cursor: pointer; font: 700 .86rem var(--font-head); color: inherit; min-width: 96px; transition: transform .2s cubic-bezier(.34,1.56,.64,1), border-color .2s; }
.evo-mon:hover { transform: translateY(-3px); border-color: var(--ink); }
.evo-mon img { width: 64px; height: 64px; image-rendering: pixelated; }
.evo-node.cur > .evo-mon { border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 25%, transparent); }
.evo-branches { display: grid; gap: 8px; }
.evo-branch { display: flex; align-items: center; gap: 8px; }
.evo-arrow { display: grid; gap: 3px; min-width: 120px; max-width: 220px; position: relative; padding-right: 16px; }
.evo-arrow::after { content: ""; position: absolute; right: 2px; top: 50%; width: 8px; height: 8px; border-top: 3px solid var(--ink-3); border-right: 3px solid var(--ink-3); transform: translateY(-50%) rotate(45deg); }
.evo-how { font-size: .78rem; line-height: 1.3; color: var(--ink-2); padding: 3px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.evo-how b { text-transform: uppercase; font-size: .68rem; letter-spacing: .4px; margin-right: 2px; }
.evo-how.friendship b { color: var(--pearl); } .evo-how.stone b { color: var(--blue); } .evo-how.trade b { color: var(--bad); } .evo-how.day b { color: var(--warn); } .evo-how.night b { color: #5b4b9a; } .evo-how.level b { color: var(--ok); } .evo-how.location b { color: var(--ink); }
@media (max-width: 760px) { .dex-hero { grid-template-columns: 1fr; } .dex-sprite-wrap { justify-items: start; } .evo-node { align-items: flex-start; } }

/* ---------- spacing audit (v6b): one spacing per gap, never two ---------- */
.card { margin: 12px 0; }
.tm-list > .card, .tm-slots > .card, .rk-grid > .card, .rk-grid > .rk-card, .shelf > .card { margin: 0; }
.tm-list { gap: 8px; }
.tm-slots { gap: 12px; }
.rk-grid { gap: 8px; }
.rk-card { margin: 8px 0; }
.rk-card + .rk-card { margin-top: 0; }
#gyms details.fight { margin: 10px 0; }
.enc-list { gap: 6px; margin: 10px 0; }
.rk-strip { margin: 0 0 2px; }
.boss-detail { margin: 2px 0 10px; }
h2 { margin: 26px 0 8px; }
h2:first-child, .tab-panel > h2:first-child, .welcome + h2 { margin-top: 10px; }
.lead { margin: 4px 0 12px; }
.tm-tools-card { margin-bottom: 8px; }
.tmc-head { padding-top: 10px; padding-bottom: 10px; }
.cov-boss { margin: 10px 0 4px; }
.cov-row { margin: 4px 0; }
.gym-trainers { gap: 6px; }
.site-foot { margin-top: 28px; }
.controls { margin-top: 18px; }
.provenance { margin: 8px auto 2px; }
.tab-nav { margin-top: 4px; }
@media (max-width: 560px) { .card { margin: 10px 0; } .tm-list { gap: 6px; } h2 { margin: 20px 0 6px; } }
.tab-panel { padding-top: 10px; }
.tab-panel > .card:first-child { margin-top: 2px; }

/* =====================================================================
   v7: shared patterns — section · key/value · data table · matchup · stats
   ===================================================================== */
/* section: the only block pattern inside drawers and panels */
.sec { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); margin-top: 12px; display: grid; gap: 10px; }
.sec-h { display: flex; align-items: baseline; gap: 8px 12px; flex-wrap: wrap; margin: 0; }
.sec-h h4 { margin: 0; font: 600 1.1rem var(--font-head); }
.sec-sub { color: var(--ink-3); font-size: .84rem; flex: 1 1 200px; }
.sec-right { margin-left: auto; }
/* key/value: aligned label column, values flow; two columns side by side on wide screens */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: .92rem; align-content: start; }
.kv dt { color: var(--ink-3); font-weight: 700; white-space: nowrap; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.kv .dex-list { padding-left: 0; list-style: none; }
@media (max-width: 760px) { .kv-cols { grid-template-columns: 1fr; } }
/* data table: zebra, numeric columns right-aligned, type badges in-line, sticky head inside scrollers */
.dt { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dt th { position: sticky; top: 0; background: var(--surface-2); color: var(--ink-3); font: 800 .7rem var(--font-body); letter-spacing: .5px; text-transform: uppercase; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); z-index: 1; }
.dt td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dt tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.dt tbody tr:hover { background: color-mix(in srgb, var(--acc, var(--ink-3)) 10%, var(--surface)); }
.dt .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; width: 1%; }
.dt .dt-move { font-weight: 700; } .dt .dt-move.stab { font-weight: 800; } .dt .dt-move.stab::after { content: " •"; color: var(--acc, var(--red)); }
.dt.moves tbody tr { cursor: pointer; } .dt.moves tr.open { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); }
.dt tr.dt-effect td { background: var(--surface-2); padding: 8px 12px 10px; }
.dt-effect-in { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .86rem; color: var(--ink-2); line-height: 1.45; animation: menu .2s cubic-bezier(.2,.8,.2,1); }
.data-table-wrap { max-height: 520px; overflow: auto; }
.cls-pill { display: inline-block; font: 800 .66rem var(--font-body); letter-spacing: .4px; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; color: #fff; }
.cls-pill.physical { background: #c0392b; } .cls-pill.special { background: #2d6cdf; } .cls-pill.status { background: #7a8191; }
.tm-num.small { font-size: .82rem; padding: 2px 6px; display: inline-block; }
/* matchup: weak / resists / immune lines, tile grid, STAB coverage */
.matchup { display: grid; gap: 8px; }
.mu-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mu-label { font: 800 .72rem var(--font-body); letter-spacing: .5px; text-transform: uppercase; color: var(--ink-3); min-width: 92px; }
.mu-line.weak .mu-label { color: var(--bad); } .mu-line.resist .mu-label { color: var(--ok); } .mu-line.immune .mu-label { color: var(--ink-2); } .mu-line.hits .mu-label { color: var(--warn); }
.mu-line.compact { gap: 6px; } .mu-line.compact .mu-label { min-width: 0; } .mu-line.compact .type-badge { min-width: 0; font-size: .62rem; padding: 1px 7px; }
.mu-mini { font: 800 .68rem var(--font-body); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-3); background: var(--surface-2); }
.mu-mini.resist { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); } .mu-mini.immune { color: var(--ink-2); }
.mu-all > summary { cursor: pointer; font: 700 .86rem var(--font-head); color: var(--ink-2); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.mu-all > summary::before { content: "+"; width: 18px; height: 18px; font-size: .9rem; } .mu-all[open] > summary::before { content: "–"; }
.mu-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.mu-tile { display: grid; justify-items: center; gap: 3px; padding: 4px 2px 5px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); animation: badgein .4s cubic-bezier(.34,1.56,.64,1) both; }
.mu-tile:nth-child(n) { animation-delay: calc(var(--i, 0) * 0s); }
.mu-tile .type-badge { min-width: 0; width: 100%; padding: 2px 0; font-size: .6rem; }
.mu-mult { font: 800 .8rem var(--font-head); min-height: 1.1em; color: var(--ink-3); }
.mu-tile.weak { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); } .mu-tile.weak .mu-mult { color: var(--bad); }
.mu-tile.resist { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); } .mu-tile.resist .mu-mult { color: var(--ok); }
.mu-tile.immune { background: var(--ink); border-color: var(--ink); } .mu-tile.immune .mu-mult { color: var(--surface); }
.mu-note { margin: 0; }
@media (max-width: 760px) { .mu-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } .mu-label { min-width: 72px; } }
/* stats with Min/Max columns and a level slider */
.stats.with-extra .stat-row { grid-template-columns: 34px minmax(0, 1fr) 40px 44px 44px; }
.stats .stat-row.head { font: 800 .66rem var(--font-body); letter-spacing: .5px; text-transform: uppercase; color: var(--ink-3); }
.stats .stat-val.x { color: var(--ink-2); font-weight: 600; }
.dex-lvl-wrap { display: inline-flex; align-items: center; gap: 8px; font: 800 .74rem var(--font-body); color: var(--ink-3); }
.dex-lvl { font: 700 .95rem var(--font-head); color: var(--ink); min-width: 3.2em; }
.dex-lvl-wrap input[type=range] { width: 140px; accent-color: var(--red); }
/* a bare native slider: no .field padding/border, so the thumb really reaches both ends at 1 and 100 */
.dex-range { width: 150px; margin: 0; padding: 0; border: 0; background: none; height: 22px; accent-color: var(--red); cursor: pointer; }
/* dex card tidy-ups */
.dex-name::before { content: none; }
.dex-mtabs { margin-bottom: 8px; flex-wrap: wrap; }
.dex-sources { margin-top: 12px; }
/* TM by-Pokémon list: fixed columns so every row lines up */
.tm-mini { grid-template-columns: 64px 96px minmax(140px, 1.3fr) 150px minmax(0, 1fr) auto; gap: 10px; }
.tm-mini .tm-num { text-align: center; } .tm-mini .type-badge { justify-self: start; } .tm-mini .tm-nums { white-space: nowrap; } .tm-mini .meta-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .tm-mini { grid-template-columns: 56px minmax(0, 1fr) auto; } .tm-mini .type-badge { grid-column: 2; } .tm-mini .tm-nums, .tm-mini .meta-note { grid-column: 2 / -1; } }
/* drawers: scrolling happens inside .cmp-scroll so the panel keeps its rounded corners; sits higher on screen */
.cmp-panel { overflow: hidden; max-height: calc(100vh - 18px); padding: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.cmp-head { position: static; padding: 14px clamp(14px, 3vw, 28px) 10px; border-bottom: 1px solid var(--line); }
.cmp-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 12px clamp(14px, 3vw, 28px) calc(24px + env(safe-area-inset-bottom, 0px)); scrollbar-gutter: stable; }
@media (max-width: 760px) { .cmp-panel { max-height: calc(100vh - 10px); } }


/* ---------- v8: official in-game icons, shipped with the site (/assets/icons, see CREDITS.txt) ----------
   The grey-badge defect: .type-badge used to declare its own --tc, out-ranking the .t-* palette on the same element.
   Now the palette owns --tc and the badge only reads it. Every type badge carries the official glyph; move categories
   use the real BDSP Physical / Special / Status icons; TMs show their disc; gyms their badge; items their sprite. */
.t-normal { --ti: url("/assets/icons/types/normal.png"); --td: url("/assets/icons/tm/normal.png"); }
.t-fire { --ti: url("/assets/icons/types/fire.png"); --td: url("/assets/icons/tm/fire.png"); }
.t-water { --ti: url("/assets/icons/types/water.png"); --td: url("/assets/icons/tm/water.png"); }
.t-electric { --ti: url("/assets/icons/types/electric.png"); --td: url("/assets/icons/tm/electric.png"); }
.t-grass { --ti: url("/assets/icons/types/grass.png"); --td: url("/assets/icons/tm/grass.png"); }
.t-ice { --ti: url("/assets/icons/types/ice.png"); --td: url("/assets/icons/tm/ice.png"); }
.t-fighting { --ti: url("/assets/icons/types/fighting.png"); --td: url("/assets/icons/tm/fighting.png"); }
.t-poison { --ti: url("/assets/icons/types/poison.png"); --td: url("/assets/icons/tm/poison.png"); }
.t-ground { --ti: url("/assets/icons/types/ground.png"); --td: url("/assets/icons/tm/ground.png"); }
.t-flying { --ti: url("/assets/icons/types/flying.png"); --td: url("/assets/icons/tm/flying.png"); }
.t-psychic { --ti: url("/assets/icons/types/psychic.png"); --td: url("/assets/icons/tm/psychic.png"); }
.t-bug { --ti: url("/assets/icons/types/bug.png"); --td: url("/assets/icons/tm/bug.png"); }
.t-rock { --ti: url("/assets/icons/types/rock.png"); --td: url("/assets/icons/tm/rock.png"); }
.t-ghost { --ti: url("/assets/icons/types/ghost.png"); --td: url("/assets/icons/tm/ghost.png"); }
.t-dragon { --ti: url("/assets/icons/types/dragon.png"); --td: url("/assets/icons/tm/dragon.png"); }
.t-dark { --ti: url("/assets/icons/types/dark.png"); --td: url("/assets/icons/tm/dark.png"); }
.t-steel { --ti: url("/assets/icons/types/steel.png"); --td: url("/assets/icons/tm/steel.png"); }
.t-fairy { --ti: url("/assets/icons/types/fairy.png"); --td: url("/assets/icons/tm/fairy.png"); }
/* type badge = glyph + name */
.type-badge { gap: 5px; padding-left: 5px; min-width: 74px; justify-content: flex-start; }
.type-badge::before { content: ""; flex: none; width: 15px; height: 15px; border-radius: 50%; background: var(--ti) center / cover no-repeat;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .75); }
.type-badge.all::before, .type-badge:not([class*="t-"])::before { display: none; }
.type-badge.all { justify-content: center; padding-left: 9px; min-width: 58px; }
.type-badge.abbr { min-width: 0; padding: 3px 4px; justify-content: center; letter-spacing: .3px; font-size: .62rem; }
.mu-line.compact .type-badge { padding-left: 4px; min-width: 0; }
/* round glyph alone */
.type-icon { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--ti) center / cover no-repeat; vertical-align: middle;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .8), 0 1px 2px rgba(0, 0, 0, .25); }
/* move category: the in-game icon (60×32 source at 2×) */
.cat { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; line-height: 1; }
.cat::before { content: ""; flex: none; width: 30px; height: 16px; border-radius: 3px; background: center / contain no-repeat; }
.cat.physical::before { background-image: url("/assets/icons/cat/physical.png"); }
.cat.special::before { background-image: url("/assets/icons/cat/special.png"); }
.cat.status::before { background-image: url("/assets/icons/cat/status.png"); }
.cat-text { font: 800 .68rem var(--font-body); letter-spacing: .4px; text-transform: uppercase; }
.cat.physical .cat-text { color: #c0392b; } .cat.special .cat-text { color: #2d6cdf; } .cat.status .cat-text { color: var(--ink-3); }
.chip .cat::before, .move-list .cat::before, .dt .cat::before, .tm-mini .cat::before { width: 26px; height: 14px; }
.chip .cat, .move-list .cat { align-self: center; }
.cls-pill { display: none; }
/* TM discs */
.tm-num.disc { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tm-num.disc::before { content: ""; flex: none; width: 22px; height: 22px; background: var(--td) center / contain no-repeat; image-rendering: pixelated; }
.tm-num.small.disc::before { width: 18px; height: 18px; }
/* gym badges */
.gym-badge { width: 28px; height: 28px; object-fit: contain; vertical-align: middle; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); flex: none; }
.fight-name .gym-badge { width: 36px; height: 36px; }
.boss-row .gym-badge { width: 26px; height: 26px; margin-left: -2px; }
.card-header .gym-badge { width: 40px; height: 40px; }
/* items */
.item-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px 1px 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: .8rem; font-weight: 700; color: var(--ink-2); vertical-align: middle; line-height: 1.5; white-space: nowrap; }
.item-img { width: 24px; height: 24px; image-rendering: pixelated; flex: none; } .item-img.missing { display: none; }
.bd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.evo-how .item-chip { margin-left: 4px; }
/* TMs tab: official full type labels as the filter */
.type-filter .type-chip { padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; opacity: .5; cursor: pointer; line-height: 0;
  transition: opacity .2s, transform .18s cubic-bezier(.34,1.56,.64,1), border-color .2s; }
.type-filter .type-chip img { width: 100px; height: 22px; display: block; border-radius: 6px; }
.type-filter .type-chip.on, .type-filter .type-chip:hover { opacity: 1; border-color: var(--ink); }
.type-filter .type-chip:hover { transform: translateY(-2px); }
@media (max-width: 760px) { .type-filter .type-chip img { width: 82px; height: 18px; } }
/* type defenses: two rows of nine, read like every type chart */
.type-grid { display: grid; gap: 4px; }
.type-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px 2px; margin: 0 -3px; }
.type-table th { padding: 0; font-weight: 800; } .type-table th .type-badge.abbr { width: 100%; display: inline-flex; }
.type-table td.fx { height: 30px; text-align: center; font: 800 .92rem var(--font-head); border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); }
.type-table td.fx-200, .mu-legend .fx-200 { background: #4e9a06; color: #fff; border-color: #4e9a06; }
.type-table td.fx-400, .mu-legend .fx-400 { background: #73d216; color: #103c00; border-color: #73d216; }
.type-table td.fx-50, .mu-legend .fx-50 { background: #a40000; color: #fff; border-color: #a40000; }
.type-table td.fx-25, .mu-legend .fx-25 { background: #7c0000; color: #fff; border-color: #7c0000; }
.type-table td.fx-0, .mu-legend .fx-0 { background: #2e3436; color: #fff; border-color: #2e3436; }
.mu-legend { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.mu-legend .fx { display: inline-block; min-width: 22px; padding: 1px 5px; border-radius: 4px; text-align: center; font: 800 .74rem var(--font-head); }
.mu-line .mu-label { color: var(--ink-3); }
.mu-all, .mu-grid { display: none; }
@media (max-width: 760px) { .type-table th .type-badge.abbr { font-size: .56rem; padding: 3px 1px; gap: 3px; } .type-table th .type-badge.abbr::before { width: 12px; height: 12px; } }
@media (max-width: 420px) { .type-table th .type-badge.abbr::before { display: none; } }
/* TM by-Pokémon rows: named areas, so every row lines up whatever cells it has */
.tm-mini { grid-template-columns: 72px 92px minmax(120px, 1.2fr) 34px 118px minmax(0, 1fr) 76px; grid-template-areas: "num type move cat nums loc tag"; gap: 8px 10px; align-items: center; }
.tm-mini .tm-num { grid-area: num; } .tm-mini .type-badge { grid-area: type; } .tm-mini > strong { grid-area: move; } .tm-mini .cat { grid-area: cat; }
.tm-mini .tm-nums { grid-area: nums; } .tm-mini .meta-note { grid-area: loc; } .tm-mini .opt-tag { grid-area: tag; justify-self: end; }
@media (max-width: 760px) {
  .tm-mini { grid-template-columns: 64px auto auto minmax(0, 1fr); grid-template-areas: "num move move tag" "num type cat nums" "num loc loc loc"; gap: 4px 8px; }
  .tm-mini .tm-nums { justify-self: end; } .tm-mini .meta-note { white-space: normal; }
}
/* ---------- v8: every window opens with a pop and leaves with a Poké Ball "return" poof ---------- */
@keyframes popin { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
@keyframes shrinkout { to { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes menuout { to { opacity: 0; transform: scaleY(.92) translateY(-4px); } }
.boss-detail:not([hidden]) { animation: popin .25s cubic-bezier(.2,.8,.2,1); }
.boss-detail:not([hidden]).closing { animation: shrinkout .2s ease-in forwards; }
.fight[open] .fight-body, .tmc-body { animation: popin .25s cubic-bezier(.2,.8,.2,1); }
.fight[open] .fight-body.closing, .tm-card.closing .tmc-body { animation: shrinkout .2s ease-in forwards; }
.combo-list.closing { animation: menuout .14s ease-in forwards; pointer-events: none; }
.cmp.closing .cmp-panel { transform: translateY(28px) scale(.975); }
.poof { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 200; pointer-events: none; transform: translate(var(--x), var(--y)); }
.poof::before { content: ""; position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--ink); background: linear-gradient(180deg, var(--red) 0 46%, var(--ink) 46% 54%, #fff 54%); animation: poofring .5s ease-out forwards; }
.poof span { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); transform: rotate(var(--a)) translateX(0); animation: poof .55s cubic-bezier(.2,.8,.2,1) forwards; }
.poof span:nth-child(even) { background: #fff; box-shadow: 0 0 0 1.5px var(--ink); width: 6px; height: 6px; }
@keyframes poof { to { transform: rotate(var(--a)) translateX(var(--d)); opacity: 0; } }
@keyframes poofring { 60% { opacity: 1; } to { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .poof { display: none; } .boss-detail:not([hidden]), .fight[open] .fight-body, .tmc-body, .combo-list.closing { animation: none; } }
/* natures: red ▲ raised, blue ▼ lowered — the summary-screen convention */
.stat-row.up .stat-label, .stat-row.up .stat-val:not(.x) { color: #d23b3b; } .stat-row.down .stat-label, .stat-row.down .stat-val:not(.x) { color: #2e6fd8; }
.nat-arrow { font-size: .62em; margin-left: 2px; vertical-align: 1px; }
.stats.cols-3 .stat-row { grid-template-columns: 34px minmax(0, 1fr) 40px 44px 44px 52px; }
.stat-val.nat { color: var(--ink); font-weight: 800; }
.nature-select { font: 600 .9rem var(--font-body); padding: 6px 28px 6px 10px; }
.nat-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.nat-pick { display: grid; gap: 2px; text-align: left; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; max-width: 100%; transition: transform .18s cubic-bezier(.34,1.56,.64,1), border-color .2s, box-shadow .2s; }
.nat-pick:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: 0 6px 14px rgba(0,0,0,.08); }
.nat-pick.on { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent); background: color-mix(in srgb, var(--red) 6%, var(--surface)); }
.nat-pick b { font: 700 .95rem var(--font-head); } .nat-pick small { color: var(--ink-2); font-size: .8rem; line-height: 1.35; }
.nat-pick .nat-up { color: #d23b3b; font-weight: 800; } .nat-pick .nat-down { color: #2e6fd8; font-weight: 800; }
.sec-right { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 760px) { .stats.cols-3 .stat-row { grid-template-columns: 30px minmax(0, 1fr) 36px 40px 40px 46px; } }
/* ---------- v8: strict field pickers (moves, held items) ---------- */
.field-combo .combo-input { padding: 8px 6px 8px 10px; background-image: none; font-weight: 600; }
.field-combo .combo-caret { width: 30px; }
.field-combo .combo-list { min-width: min(420px, 92vw); max-height: min(380px, 55vh); }
.combo-group { font: 800 .66rem var(--font-body); letter-spacing: .6px; text-transform: uppercase; color: var(--ink-3); padding: 8px 8px 3px; position: sticky; top: -4px; background: var(--surface); z-index: 1; }
.combo-opt.picked { box-shadow: inset 0 0 0 2px var(--red); }
.combo-opt .opt-row { display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%; }
.combo-opt .opt-row img { width: 28px; height: 28px; }
.combo-opt .opt-row .type-badge.abbr { flex: none; }
.combo-opt .opt-how { display: block; font-size: .74rem; font-weight: 600; color: var(--ink-3); white-space: normal; line-height: 1.3; }
.combo.shake { animation: shake .35s cubic-bezier(.36,.07,.19,.97) both; border-color: var(--bad); }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-3px); } 40%, 60% { transform: translateX(3px); } }
.item-fx { display: flex; align-items: center; gap: 8px; margin-top: 2px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: .86rem; line-height: 1.4; color: var(--ink-2); animation: popin .25s cubic-bezier(.2,.8,.2,1); }
.item-fx.berry { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); background: var(--ok-bg); }
.item-fx.bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: var(--bad-bg); color: var(--bad); }
.item-fx .item-chip { flex: none; }
.item-fx-text b { color: var(--ink); }
.moves-note { transition: color .2s; } .moves-note.bad { color: var(--bad); font-weight: 700; }
.tm-grid.id { align-items: start; } .tm-grid.id .lbl { min-width: 0; }
.tm-grid.id > .item-fx { grid-column: 1 / -1; }

/* ---------- v8.1: pickers never clip, never inherit the label's uppercase; projected-stat note ---------- */
.card:has(.combo.open), .tm-fields:has(.combo.open), .tm-grid:has(.combo.open) { overflow: visible; }
.lbl .field-combo, .lbl .field-combo .combo-list { text-transform: none; letter-spacing: 0; font-size: .92rem; color: var(--ink); }
.field-combo .combo-list { left: calc(-2px + var(--cx, 0px)); right: auto; width: var(--cw, 100%); min-width: 0; max-width: calc(100vw - 24px); }
.field-combo.align-right .combo-list { left: auto; right: -2px; }
.combo-opt .opt-name { font-weight: 700; }
.combo-group { text-transform: uppercase; }
.tm-stats-head .meta-note.projected { color: var(--ink-3); cursor: help; }

/* stat ranges on projected rows: the formula's honest uncertainty, drawn at the end of the bar */
.stat-row.tm { grid-template-columns: 40px minmax(0, 1fr) 58px 5.5em; }
.stat-row.tm .stat-range { justify-self: end; }
.stat-range { font: 800 .7rem var(--font-body); color: #2e6fd8; border: 1px solid color-mix(in srgb, #2e6fd8 45%, var(--line)); background: color-mix(in srgb, #2e6fd8 8%, var(--surface)); padding: 1px 7px; border-radius: 999px; line-height: 1.5; cursor: help; white-space: nowrap; }
.stat-range:empty { visibility: hidden; }
.stat-row.tm .stat-range { grid-column: 3; } .stat-row.tm input { grid-column: 4; }
.stat-row.tm input.read { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }

/* ---------- vitamins (My Team stats box) ---------- */
.vit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.vit-row .cov-lbl { margin-right: 2px; }
.vit-pair { display: inline-flex; align-items: center; gap: 2px; }
.vit-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font: 700 .8rem var(--font-body); cursor: pointer; transition: transform .15s cubic-bezier(.34,1.56,.64,1), border-color .2s, background-color .2s; }
.vit-chip img { width: 24px; height: 24px; image-rendering: pixelated; }
.vit-chip .cnt { font-weight: 800; color: var(--ink); min-width: 0; }
.vit-chip .cnt:empty { display: none; }
.vit-chip:hover { transform: translateY(-2px); border-color: var(--ink); }
.vit-chip.on { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); background: var(--ok-bg); color: var(--ink); }
.vit-chip.shake { animation: shake .35s cubic-bezier(.36,.07,.19,.97) both; border-color: var(--bad); }
.vit-minus { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); font: 800 .85rem/1 var(--font-body); cursor: pointer; padding: 0; }
.vit-minus:hover { border-color: var(--ink); color: var(--ink); }
.vit-pair:not(:has(.vit-chip.on)) .vit-minus { visibility: hidden; }
.vit-sum { font: 700 .76rem var(--font-body); color: var(--ink-3); margin-left: auto; }
.vit-note { margin: 6px 0 0; font-size: .8rem; color: var(--ink-3); } .vit-note:empty { display: none; } .vit-note.bad { color: var(--bad); font-weight: 700; }
@media (max-width: 760px) { .vit-chip span:not(.cnt) { font-size: .74rem; } .vit-sum { margin-left: 0; width: 100%; } }
/* ---------- v9: global search palette + info cards ---------- */
.search-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 6px 10px 6px 8px; border-radius: 999px; border: 2px solid var(--ring); background: var(--surface); color: var(--ink-2); font: 700 .86rem var(--font-body); cursor: pointer; transition: border-color .2s, transform .18s cubic-bezier(.34,1.56,.64,1); }
.search-btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.search-btn kbd, .pal kbd { font: 700 .68rem var(--font-body); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--ink-3); background: var(--surface-2); }
.pal-icon { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; position: relative; flex: none; }
.pal-icon::after { content: ""; position: absolute; width: 7px; height: 2px; background: currentColor; right: -5px; bottom: -3px; transform: rotate(45deg); border-radius: 2px; }
@media (max-width: 760px) { .search-btn-text, .search-btn kbd { display: none; } .search-btn { padding: 8px; } }
.pal { position: fixed; inset: 0; z-index: 180; background: rgba(20, 22, 30, .45); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: clamp(10px, 8vh, 80px) 12px 12px; opacity: 0; transition: opacity .18s; }
.pal.show { opacity: 1; } .pal.closing { opacity: 0; }
.pal-box { width: min(760px, 100%); max-height: calc(100vh - 24px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--bg); color: var(--ink); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.35); transform: translateY(-10px) scale(.985); transition: transform .22s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
.pal.show .pal-box { transform: none; }
.pal-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.pal-top .pal-icon { width: 20px; height: 20px; }
.pal-in { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 600 1.05rem var(--font-body); padding: 6px 0; outline: none; }
.pal-in::placeholder { color: var(--ink-3); font-weight: 500; }
.pal-list { overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.pal-group { font: 800 .66rem var(--font-body); letter-spacing: .6px; text-transform: uppercase; color: var(--ink-3); padding: 10px 10px 4px; }
.pal-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; font: inherit; }
.pal-item.active { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--red); }
.pal-sprite { width: 40px; height: 40px; image-rendering: pixelated; justify-self: center; } .pal-sprite.item { width: 32px; height: 32px; }
.pal-ic { display: inline-flex; align-items: center; justify-content: center; justify-self: center; min-width: 36px; }
.pal-ic.glyph { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); font: 800 .9rem var(--font-head); color: var(--ink-3); }
.pal-ic.nat b { font: 800 .74rem var(--font-body); }
.pal-ic.tm-num { padding: 2px 6px; }
.pal-text { display: grid; gap: 1px; min-width: 0; }
.pal-name { font: 700 .98rem var(--font-head); }
.pal-sub { font-size: .8rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-kind { font: 800 .64rem var(--font-body); letter-spacing: .5px; text-transform: uppercase; color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.pal-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--ink-3); }
.pal-empty { padding: 18px 12px; text-align: center; }
@media (max-width: 760px) { .pal { padding: 8px; } .pal-box { max-height: calc(100vh - 16px); border-radius: 14px; } .pal-kind { display: none; } .pal-item { grid-template-columns: 40px minmax(0, 1fr); } .pal-foot span:first-child { display: none; } .pal-sub { white-space: normal; } }
/* info cards */
.info-hero { display: grid; gap: 10px; margin-bottom: 4px; }
.info-hero.item { grid-template-columns: 72px minmax(0, 1fr); align-items: center; }
.info-item-img { width: 64px; height: 64px; image-rendering: pixelated; }
.info-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.info-fx { margin: 0; font-size: 1rem; font-weight: 600; } .info-fx.muted { color: var(--ink-3); font-weight: 500; }
.info-group { margin-top: 10px; }
.nat-big { display: flex; gap: 14px; flex-wrap: wrap; font: 800 1.05rem var(--font-head); }
.link-btn { background: none; border: 0; padding: 0; font: 700 .9rem var(--font-body); color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.dt tr.open td { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); }

.tab-nav .search-btn { position: sticky; right: 0; flex: none; box-shadow: -10px 0 10px -6px var(--bg); }

/* ---------- v9.1: mobile love ---------- */
.version-btn .short { display: none; }
.provenance .prov-detail { }
.mbar { display: none; }
@media (max-width: 760px) {
  /* header: version toggle + theme on one row, short labels */
  .controls { gap: 8px; margin-top: 14px; }
  .version-toggle { flex: 1 1 0; }
  .version-btn { padding: 8px 6px; font-size: .86rem; } .version-btn .long { display: none; } .version-btn .short { display: inline; }
  .theme-btn { flex: none; }
  .provenance { gap: 4px 10px; font-size: .78rem; } .provenance .prov-detail { display: none; }
  /* the tab bar's search button yields to the bottom bar */
  .tab-nav .search-btn { display: none; }
  /* runner rides the bottom edge of the tab bar instead of the content */
  .scroll-runner { width: 28px; height: 28px; top: -16px; left: clamp(0px, var(--x, 0%), calc(100% - 28px)); }
  /* bottom action bar — content gets room for it; the floating circles go */
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .cmp-fab, .to-top { display: none !important; }
  .mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-top: 2px solid var(--ring); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 24px rgba(0,0,0,.08); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
  body.cmp-open .mbar { transform: translateY(110%); }
  .mbar-btn { display: grid; justify-items: center; gap: 3px; padding: 4px 0; border: 0; background: none; color: var(--ink-2); font: 700 .68rem var(--font-body); letter-spacing: .2px; cursor: pointer; border-radius: 10px; }
  .mbar-btn:active { background: var(--surface-2); }
  .mbar-btn .pal-icon { width: 18px; height: 18px; margin-top: 3px; margin-bottom: 2px; }
  .mbar-ball { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink); background: radial-gradient(circle, #fff 0 4px, var(--ink) 4px 6px, transparent 6px), linear-gradient(var(--red) 0 44%, var(--ink) 44% 56%, #fff 56%); }
  .mbar-up { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); position: relative; margin-top: 1px; }
  .mbar-up::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border-left: 2px solid var(--ink); border-top: 2px solid var(--ink); transform: translate(-50%, -25%) rotate(45deg); }
  /* team stats: tighter columns, bars get the room */
  .stat-row.tm { grid-template-columns: 34px minmax(0, 1fr) auto 64px; gap: 6px; }
  .stat-row.tm .stat-range:empty { display: none; }
  .stat-row.tm input, .stat-row.tm .field.num { width: 64px; min-width: 0; padding: 6px 4px; font-size: .95rem; }
  .tm-stats-head { flex-wrap: wrap; } .tm-stats-head .btn { padding: 6px 10px; font-size: .82rem; }
  .vit-row { gap: 6px; } .vit-row .cov-lbl { width: 100%; } .vit-chip { padding: 3px 7px 3px 3px; font-size: .76rem; }
  /* drawers sit lower on phones so the thumb reaches the close button; palette near the top */
  .pal { padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 760px) { .consent { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 61; } }

/* ======================================================================================================
   v10 — the master search bar, a warmer hero, Compare beside Search, tooltips everywhere, capture / shiny /
   wild-item / crit / accuracy panels, boss parties on the tracker, leader-first gyms. Light loads first.
   ====================================================================================================== */
/* ---------- hero: warmer, friendlier; the search bar is the main event ---------- */
.hero { background: linear-gradient(118deg, #e3350d 0%, #f0522c 48%, #ff8a3d 100%); padding-bottom: 26px; }
:root[data-theme="dark"] .hero { background: linear-gradient(118deg, #b8290a 0%, #d8441f 52%, #e8742c 100%); }
.hero::before { opacity: .18; background: radial-gradient(circle at 30% 30%, #ffcb05, transparent 60%), radial-gradient(circle at 70% 70%, #fff, transparent 62%); }
.hero-inner { align-items: flex-start; }
.hero h1 { font-size: clamp(1.75rem, 4.6vw, 2.5rem); letter-spacing: .2px; }
.subtitle { max-width: 62ch; font-weight: 600; line-height: 1.45; }
.gsearch { position: relative; display: flex; align-items: center; gap: 8px; max-width: 980px; margin: 18px auto 0; min-height: 60px; padding: 6px 6px 6px 16px; border-radius: 999px;
  background: var(--surface); border: 3px solid var(--ink); box-shadow: 0 8px 0 rgba(0,0,0,.18), 0 14px 30px rgba(0,0,0,.18); color: var(--ink); }
.gsearch:focus-within { box-shadow: 0 8px 0 rgba(0,0,0,.18), 0 0 0 4px rgba(255, 203, 5, .55), 0 14px 30px rgba(0,0,0,.18); }
.gsearch .pal-icon { width: 20px; height: 20px; color: var(--ink); }
.gsearch .pal-icon::after { width: 9px; height: 3px; right: -6px; bottom: -4px; }
.gsearch-in { flex: 1 1 200px; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 700 1.05rem var(--font-head); padding: 10px 4px; outline: none; }
.gsearch-in::placeholder { color: var(--ink-3); font-weight: 600; }
.gsearch-in::-webkit-search-cancel-button { display: none; }
.gsearch-kbd { font: 700 .72rem var(--font-body); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; color: var(--ink-3); background: var(--surface-2); flex: none; }
.gsearch-cmp { flex: none; display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--ink); background: var(--gold); color: var(--gold-ink); border-radius: 999px; padding: 9px 16px 9px 10px;
  font: 700 .95rem var(--font-head); cursor: pointer; transition: transform .18s cubic-bezier(.34,1.56,.64,1), background-color .2s; }
.gsearch-cmp:hover { transform: translateY(-2px); background: #ffd83d; }
.gsearch-cmp:active { transform: scale(.96); }
.mbar-ball { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); flex: none;
  background: radial-gradient(circle, #fff 0 3px, var(--ink) 3px 5px, transparent 5px), linear-gradient(var(--red) 0 46%, var(--ink) 46% 54%, #fff 54%); }
.hero .hero-chips { max-width: 980px; margin: 16px auto 0; gap: 8px; }
.hero-chip { border: 2px solid rgba(255,255,255,.55); background: rgba(255,255,255,.16); color: #fff; cursor: pointer; font: 800 .78rem/1.2 var(--font-body); letter-spacing: .4px; text-transform: uppercase; padding: 6px 12px; }
.hero-chip:hover { background: rgba(255,255,255,.3); }
.hero-chip.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold-ink); }
.hero-chip.gold:hover { background: #ffd83d; }
.hero-chips .hero-chip { animation: none; }
/* the version toggle + theme row sits quietly under the hero */
.controls { margin-top: 22px; }
/* tab bar: the compact search pill is a shortcut to the same palette */
.tab-nav .search-btn { font-size: .86rem; }
/* ---------- tooltips ---------- */
.tip { position: absolute; z-index: 9000; max-width: 320px; padding: 9px 12px; border-radius: 12px; background: var(--surface); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 10px 28px rgba(0,0,0,.18);
  font: 600 .82rem/1.45 var(--font-body); pointer-events: none; opacity: 0; transform: translateY(4px) scale(.98); transition: opacity .14s ease, transform .14s cubic-bezier(.2,.8,.2,1); }
.tip.in { opacity: 1; transform: none; }
.tip.below { transform: translateY(-4px) scale(.98); } .tip.below.in { transform: none; }
.tip-arrow { position: absolute; left: var(--ax, 50%); bottom: -8px; width: 12px; height: 12px; margin-left: -6px; background: var(--surface); border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
.tip.below .tip-arrow { bottom: auto; top: -8px; transform: rotate(-135deg); }
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
/* ---------- fact chips (crit, miss, flinch, burn…) ---------- */
.facts { display: inline-flex; flex-wrap: wrap; gap: 5px; vertical-align: middle; }
.fact { display: inline-block; font: 800 .68rem/1.2 var(--font-body); letter-spacing: .3px; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); cursor: default; }
.fact.crit { color: var(--warn); border-color: var(--warn); background: var(--warn-bg); }
.fact.warn { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 60%, var(--line)); background: var(--bad-bg); }
.fact.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 60%, var(--line)); background: var(--ok-bg); }
.fact.fx { color: var(--info-ink); border-color: color-mix(in srgb, var(--blue) 50%, var(--line)); background: var(--info-bg); }
.fact.quiet { color: var(--ink-3); }
.acc-miss { color: var(--warn); font-weight: 800; } .acc-sure { color: var(--ok); font-weight: 800; }
.bd-move .facts { margin-top: 8px; }
.dt-effect-in .facts { margin-left: 2px; }
/* ---------- item chips are buttons now ---------- */
button.item-chip { font: inherit; color: inherit; cursor: pointer; transition: transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .2s, border-color .2s; }
button.item-chip:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.12); border-color: var(--ink-3); }
.item-chip.wild { padding-right: 6px; } .wild-pct { margin-left: 4px; font-size: .74rem; color: var(--ink-3); }
/* ---------- catching it ---------- */
.catch { display: grid; gap: 12px; }
.catch-top { display: grid; gap: 8px; }
.catch-hp-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 80px; grid-template-rows: auto auto; gap: 4px 10px; align-items: center; }
.catch-hp { grid-column: 1; height: 14px; border-radius: 999px; background: var(--surface-2); border: 2px solid var(--ink); overflow: hidden; }
.catch-hp-fill { display: block; height: 100%; background: var(--ok); transition: width .15s ease, background-color .2s; }
.catch-hp.yellow .catch-hp-fill { background: #e8b900; } .catch-hp.red .catch-hp-fill { background: var(--bad); }
.catch-hp-out { grid-column: 2; grid-row: 1 / 3; font: 700 1.05rem var(--font-head); text-align: right; font-variant-numeric: tabular-nums; }
.catch-hp-range { grid-column: 1; width: 100%; margin: 0; accent-color: var(--ink); }
.catch-presets, .catch-status { display: flex; flex-wrap: wrap; gap: 6px; }
.catch-status .chip { cursor: pointer; font-weight: 800; }
.catch-status .chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.catch-status .chip.st-sleep.on, .catch-status .chip.st-freeze.on { background: var(--blue); border-color: var(--blue); }
.catch-status .chip.st-paralysis.on { background: #c99a00; border-color: #c99a00; } .catch-status .chip.st-poison.on { background: #a33ea1; border-color: #a33ea1; } .catch-status .chip.st-burn.on { background: #ee8130; border-color: #ee8130; }
.catch-sit { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.catch-field { display: inline-flex; align-items: center; gap: 6px; font: 700 .8rem var(--font-body); color: var(--ink-2); }
.catch-field .field { width: 74px; padding: 5px 8px; font-weight: 700; }
.catch-field select.field { width: auto; min-width: 70px; padding-right: 26px; }
.catch-check { display: inline-flex; align-items: center; gap: 6px; font: 700 .8rem var(--font-body); color: var(--ink-2); cursor: pointer; }
.catch-check input { accent-color: var(--ink); width: 16px; height: 16px; margin: 0; }
.catch-big { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 2px solid var(--ring); flex-wrap: wrap; }
.catch-big-n { font: 700 2.4rem/1 var(--font-head); font-variant-numeric: tabular-nums; }
.catch-big-n.ok { color: var(--ok); } .catch-big-n.mid { color: var(--warn); } .catch-big-n.low { color: var(--bad); }
.catch-big-t { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; min-width: 0; flex: 1 1 200px; }
.catch-crit { font-size: .78rem; color: var(--ink-3); font-weight: 700; }
.catch-table { display: grid; gap: 4px; }
.catch-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 48px minmax(60px, 2fr) 54px 76px; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .86rem var(--font-body); cursor: pointer; text-align: left; transition: transform .15s, box-shadow .2s, border-color .2s; }
.catch-row:hover { transform: translateX(3px); box-shadow: 0 4px 12px rgba(0,0,0,.08); border-color: var(--ink-3); }
.catch-row.on { border: 2px solid var(--ink); background: var(--surface-2); padding: 4px 9px; }
.catch-row.idle { opacity: .72; }
.catch-ball { width: 28px; height: 28px; image-rendering: pixelated; }
.catch-ball.glyph { display: inline-block; border-radius: 50%; border: 2px solid var(--ink); background: linear-gradient(var(--red) 0 48%, var(--ink) 48% 56%, #fff 56%); }
.catch-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catch-mult { color: var(--ink-3); font-weight: 800; font-variant-numeric: tabular-nums; }
.catch-bar { display: block; height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.catch-bar-fill { display: block; height: 100%; background: var(--bad); }
.catch-bar-fill.mid { background: #e8b900; } .catch-bar-fill.ok { background: var(--ok); }
.catch-pct { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.catch-throws { color: var(--ink-3); font-size: .78rem; font-weight: 700; text-align: right; white-space: nowrap; }
.catch-note { margin: 0; }
.catch-extras { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 4px; }
.catch-extra { min-width: 0; }
.shiny-rows { display: grid; gap: 4px; }
.shiny-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; font-size: .86rem; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.shiny-row:last-child { border-bottom: 0; }
.shiny-l { color: var(--ink-2); font-weight: 700; } .shiny-row b { font-variant-numeric: tabular-nums; }
/* ---------- landing it (move cards): accuracy + crit ---------- */
.land-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.land-col { min-width: 0; display: grid; gap: 8px; align-content: start; }
.acc { display: grid; gap: 8px; }
.acc-big { font-size: .92rem; } .acc-big b { font: 700 1.5rem/1 var(--font-head); margin-right: 4px; } .acc-big b.ok { color: var(--ok); } .acc-big b.warn { color: var(--bad); }
.acc-mods { display: grid; gap: 4px; }
/* ---------- tracker: boss rows are fight cards with the party ---------- */
.boss-row { display: block; padding: 10px 12px 12px; margin: 10px 0; border-radius: 14px; background: var(--surface); border: 2px dashed color-mix(in srgb, var(--tc, var(--ink-3)) 55%, var(--line)); }
.boss-row:hover { transform: none; }
.boss-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.boss-head .boss-name { flex: 0 1 auto; }
.boss-sub { color: var(--ink-3); font-size: .8rem; font-weight: 700; flex: 1 1 auto; }
.boss-open { padding: 5px 10px; font-size: .82rem; }
.boss-party { margin-top: 8px; }
.boss-party .boss-team { margin: 2px 0 6px; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
.boss-party .boss-mon img { width: 56px; height: 56px; }
.boss-party .boss-detail { margin-top: 4px; }
/* ---------- gyms: leader first, route trainers folded ---------- */
.gym-way { margin: 14px 0 6px; border: 1px dashed var(--ring); border-radius: 12px; background: var(--surface-2); }
.gym-way-sum { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; font-size: .9rem; }
.gym-way-sum::-webkit-details-marker { display: none; }
.gym-way-count { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--surface); font: 800 .82rem var(--font-body); flex: none; }
.gym-way[open] .gym-way-sum { border-bottom: 1px dashed var(--ring); }
.gym-way .gym-trainers { padding: 10px 12px 12px; }
.gym-h4.small { font-size: .95rem; color: var(--ink-2); margin-top: 18px; }
/* ---------- phones ---------- */
@media (max-width: 760px) {
  .gsearch { min-height: 54px; padding: 4px 4px 4px 12px; margin-top: 14px; }
  .gsearch-in { font-size: .95rem; padding: 8px 2px; }
  .gsearch-kbd { display: none; }
  .gsearch-cmp { padding: 8px 10px; font-size: 0; gap: 0; }
  .gsearch-cmp .mbar-ball { width: 24px; height: 24px; }
  .hero-chip { font-size: .72rem; padding: 6px 10px; }
  .catch-extras, .land-cols { grid-template-columns: 1fr; }
  .catch-row { grid-template-columns: 22px minmax(0, 1.7fr) 34px minmax(24px, .8fr) 44px; font-size: .8rem; gap: 6px; padding: 5px 8px; }
  .catch-row .catch-name { font-size: .8rem; }
  .catch-row .catch-throws { display: none; }
  .catch-ball { width: 24px; height: 24px; }
  .catch-big-n { font-size: 2rem; }
  .boss-head .boss-sub { display: none; }
  .boss-party .boss-team { grid-template-columns: repeat(3, 1fr); }
  .tip { max-width: min(320px, calc(100vw - 16px)); }
}

/* ======================================================================================================
   v10.1 — one sticky command bar (search · Compare · tabs) that stays at the top while you scroll; a calm
   text tab strip instead of a row of pills; version + theme live in the hero. Light loads first.
   ====================================================================================================== */
/* ---------- hero holds the brand + the settings row ---------- */
.hero { padding-bottom: 22px; }
.hero .controls { max-width: 980px; margin: 18px auto 0; gap: 8px; }
.hero .version-toggle { flex: 0 1 600px; border-color: rgba(0,0,0,.35); box-shadow: none; }
.hero::after { display: none; }   /* the sticky bar sits right under the hero now */
.hero { border-bottom-width: 4px; margin-bottom: 14px; }
.hero .theme-btn { border-color: rgba(0,0,0,.35); box-shadow: none; }
/* ---------- the sticky command bar ---------- */
.topbar-sentinel { height: 1px; margin: 0; max-width: none; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; max-width: none; margin: 0 calc(-1 * clamp(16px, 4vw, 40px)); padding: 0 clamp(16px, 4vw, 40px);
  background: var(--surface); border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.topbar.stuck { box-shadow: 0 6px 18px rgba(31,36,48,.10); }
:root[data-theme="dark"] .topbar.stuck { box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.topbar-in { max-width: 980px; margin: 0 auto; position: relative; }
@media (min-width: 1400px) { .topbar-in { max-width: 1140px; } } @media (min-width: 1800px) { .topbar-in { max-width: 1280px; } }
.topbar-row { display: flex; align-items: center; gap: 10px; padding: 10px 0 6px; }
.topbar-brand { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px 4px 0; cursor: pointer; color: var(--ink); font: 700 1rem var(--font-head); flex: none; border-radius: 10px; }
.topbar-brand svg { width: 30px; height: 30px; flex: none; transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.topbar-brand:hover svg { transform: rotate(-12deg) scale(1.08); }
.topbar-word { white-space: nowrap; }
/* the search field: the one dominant element in the bar */
.topbar .gsearch { flex: 1 1 320px; margin: 0; min-height: 48px; padding: 4px 8px 4px 14px; border: 2px solid var(--ring); background: var(--surface-2); box-shadow: none; }
.topbar .gsearch:focus-within { border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 4px rgba(255, 203, 5, .45); }
.topbar .gsearch-in { font-size: 1rem; padding: 8px 4px; }
.topbar .gsearch-cmp { flex: none; min-height: 44px; }
/* tab strip: text + underline, no pills, no dots */
.topbar .tab-nav { position: static; display: flex; gap: 2px; margin: 0; padding: 0; background: transparent; overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.topbar .tab-nav::-webkit-scrollbar { display: none; }
.topbar .tab-btn { position: relative; flex: none; display: inline-flex; align-items: center; gap: 0; border: 0; border-radius: 8px 8px 0 0; background: transparent; color: var(--ink-2); padding: 9px 11px 11px; font: 700 .9rem var(--font-head); box-shadow: none; transform: none; animation: none; }
.topbar .tab-btn::before { display: none; }
.topbar .tab-btn::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: transparent; margin: 0; width: auto; animation: none; transition: background-color .2s; }
.topbar .tab-btn:hover { color: var(--ink); background: var(--surface-2); transform: none; box-shadow: none; }
.topbar .tab-btn.active { color: var(--ink); background: transparent; animation: none; box-shadow: none; transform: none; }
.topbar .tab-btn.active::after { background: var(--red); }
.topbar .tab-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
/* the runner jogs along the bar's bottom edge */
.topbar .runner-track { position: absolute; left: 0; right: 0; bottom: 0; top: auto; height: 0; margin: 0; max-width: none; z-index: 2; }
.topbar .scroll-runner { top: -13px; width: 32px; height: 32px; opacity: .95; }
/* no bottom bar; the back-to-top ball is back on every screen size */
.mbar { display: none !important; }
body { padding-bottom: 48px; }
.search-btn { display: none; }
@media (max-width: 760px) {
  .hero .version-toggle { flex: 1 1 0; }
  .topbar { margin: 0 -16px; padding: 0 16px; }
  .topbar-row { padding: 8px 0 4px; gap: 6px; }
  .topbar-word { display: none; }
  .topbar-brand { padding: 2px; }
  .topbar .gsearch { min-height: 44px; padding: 2px 6px 2px 10px; }
  .topbar .gsearch-in { font-size: .92rem; padding: 6px 2px; }
  .topbar .gsearch-cmp { min-height: 40px; padding: 6px 8px; }
  .topbar .gsearch-cmp .gsearch-cmp-text { display: none; }
  .topbar .tab-btn { padding: 7px 9px 9px; font-size: .84rem; }
  .topbar .scroll-runner { width: 26px; height: 26px; top: -11px; }
  .scroll-ball { display: none; }
  body { padding-bottom: 72px; }
  .to-top { display: inline-flex !important; width: 44px; height: 44px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .consent { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}

/* reveal animations slide cards in from the right; that offset must never become a horizontal page scroll (body's overflow propagates to the viewport, so sticky still works) */
body { overflow-x: hidden; }

/* ======================================================================================================
   v10.2 — overlays cover the whole screen; the page scales with the window; official game logos in the hero
   ====================================================================================================== */
/* every fixed overlay appended to <body> must escape the column cap (body > * { max-width }) */
body > .pal, body > .cmp, body > .consent, body > .to-top, body > .scroll-progress, body > .scroll-ball, body > .tip { max-width: none; }
/* fluid page: the column follows the window — 86% of the width between 960 px and 1720 px, gutters scale too */
:root { --page-w: clamp(960px, 86vw, 1720px); --gutter: clamp(16px, 3.5vw, 56px); }
body { padding-left: var(--gutter); padding-right: var(--gutter); font-size: clamp(15px, 0.84rem + 0.3vw, 18px); }
body > *, .hero-inner, .runner-track, .topbar-in, .gsearch, .hero .hero-chips, .hero .controls { max-width: var(--page-w); }
@media (min-width: 1400px) { body > *, .hero-inner, .runner-track, .topbar-in { max-width: var(--page-w); } }
@media (min-width: 1800px) { body > *, .hero-inner, .runner-track, .topbar-in { max-width: var(--page-w); } }
.hero, .topbar { max-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }
.cmp-panel { width: min(100%, clamp(1100px, 74vw, 1560px)); }
.pal-box { width: min(100%, clamp(720px, 60vw, 1100px)); }
@media (max-width: 760px) { :root { --gutter: 16px; } .hero, .topbar { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; } }
/* official game logos: the right side of the hero on wide screens, a row under the title on phones */
.hero-logos { flex: 0 0 auto; display: flex; align-items: center; margin-left: auto; }
.hero-logos-set { display: none; align-items: center; gap: 14px; }
.hero-logos-set.bdsp-only { display: inline-flex; }
body.ver-dp .hero-logos-set.bdsp-only { display: none; } body.ver-dp .hero-logos-set.dp-only { display: inline-flex; }
.game-logo { height: clamp(64px, 7vw, 104px); width: auto; filter: drop-shadow(0 3px 0 rgba(0,0,0,.22)); transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.game-logo:hover { transform: translateY(-3px) scale(1.04); }
@media (max-width: 1100px) { .hero-logos { flex-basis: 100%; margin-left: 0; margin-top: 4px; } .game-logo { height: clamp(56px, 12vw, 84px); } }
@media (max-width: 760px) { .hero-logos-set { gap: 10px; } .game-logo { height: 52px; } }
/* palette: friendlier empty state and no-result state */
.pal-hello { margin: 10px 14px 4px; font: 600 .95rem var(--font-body); color: var(--ink-2); }
.pal-try { padding: 4px 14px 10px; }
.pal-try .pal-group { padding: 0; margin: 4px 0 6px; }
.pal-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pal-chips .chip { cursor: pointer; font-weight: 700; }
.pal-note { margin: 8px 14px 0; font-size: .82rem; color: var(--ink-3); font-weight: 700; }
.pal-empty-box { padding: 12px 0 8px; }
.pal-empty-box .meta-note { margin: 0 14px 8px; }
.pal-ic.pair { display: inline-flex; align-items: center; } .pal-ic.pair img { width: 26px; height: 26px; image-rendering: pixelated; margin: 0 -4px; }
/* tracker picker: levels, method, post-game flag */
.combo-opt .opt-lv { font: 800 .72rem var(--font-body); color: var(--ink-3); margin-left: auto; white-space: nowrap; }
.combo-opt .opt-how { font: 700 .7rem var(--font-body); color: var(--ink-3); white-space: nowrap; }
.combo-opt.post { opacity: .62; } .combo-opt.post .opt-name { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.opt-tag.post { color: var(--bad); border-color: var(--bad); }
/* ---------- the audit panel (Data tab) ---------- */
.card.audit { border-color: var(--ok); }
.audit-grid { display: grid; gap: 10px; margin-top: 10px; }
.audit-row { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.audit-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.audit-sum { display: flex; align-items: center; gap: 10px; }
.audit-bar { display: inline-block; width: 160px; height: 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.audit-fill { display: block; height: 100%; background: var(--bad); } .audit-fill.mid { background: #e8b900; } .audit-fill.ok { background: var(--ok); }
.audit-fields, .audit-src { display: flex; flex-wrap: wrap; gap: 5px; }
.audit-findings { margin-top: 8px; border: 1px dashed var(--ring); border-radius: 12px; padding: 6px 12px; }
.audit-findings summary { cursor: pointer; }
.audit-list li { margin: 6px 0; font-size: .9rem; }
.audit-res { color: var(--ok); font-weight: 700; }
.verified { display: inline-flex; align-items: center; font: 800 .7rem/1.2 var(--font-body); letter-spacing: .3px; text-transform: uppercase; color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 60%, var(--line)); background: var(--ok-bg); border-radius: 999px; padding: 3px 9px; cursor: default; }
/* team card: level number + slider side by side */
.lvl-wrap { display: grid; grid-template-columns: 74px minmax(60px, 1fr); gap: 8px; align-items: center; }
.lvl-wrap .field.num { width: 74px; }
.lvl-range { width: 100%; margin: 0; padding: 0; border: 0; background: none; height: 22px; accent-color: var(--red); cursor: pointer; }
.cmp-lvl-slider { margin: 4px 0 6px; } .cmp-lvl-slider .lvl-range { width: 100%; }

/* ===== v11 · platform + Map + Trainers ===== */
.h1-sub { display: block; font-size: .42em; font-weight: 600; color: rgba(255,255,255,.92); letter-spacing: .01em; margin-top: 2px; }
.mod-host { min-height: 120px; }
.flash { animation: flash .9s ease-out; }
.txt-crit { color: var(--bad); }
/* trainers */
.tr-progress { display: flex; align-items: center; gap: 12px; margin: 10px 0 6px; }
.tr-bar { flex: 1 1 auto; height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.tr-bar-fill { height: 100%; width: 0; background: var(--ok); transition: width .4s ease; }
.tr-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.tr-tools .field { flex: 1 1 260px; min-width: 0; }
.tr-hide { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.tr-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.tr-filters .chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.tr-list { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.tr-loc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); }
.tr-loc-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.tr-loc-head .gym-h4 { margin: 0; }
.tr-rows { display: flex; flex-direction: column; gap: 6px; }
.tr-row { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.tr-row.done { opacity: .62; }
.tr-row.done .tr-who b { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--ok); }
.tr-row.role-galactic { border-left: 4px solid var(--bad); } .tr-row.role-gym-leader, .tr-row.role-league { border-left: 4px solid var(--gold); } .tr-row.role-rival { border-left: 4px solid var(--blue); }
.tr-row > summary.tr-sum { font: inherit; display: grid; grid-template-columns: auto auto minmax(140px, 1.4fr) auto auto minmax(120px, 1fr); align-items: center; gap: 10px; padding: 6px 10px; cursor: pointer; list-style: none; }
.tr-sum::-webkit-details-marker { display: none; }
.tr-check input { width: 18px; height: 18px; accent-color: var(--ok); cursor: pointer; }
.tr-art { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.tr-art.none { display: inline-block; }
.tr-who { display: flex; flex-direction: column; min-width: 0; } .tr-who b { font-size: 15px; } .tr-who .meta-note { font-size: 12px; }
.tr-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.tr-prize { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; font-variant-numeric: tabular-nums; } .tr-prize b { font-size: 14px; } .tr-prize .m { font-size: 11px; color: var(--ink-3); }
.tr-party { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; } .tr-party img { width: 30px; height: 30px; image-rendering: pixelated; }
.tr-body { padding: 4px 12px 12px; border-top: 1px dashed var(--line); }
.tr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.mon-chip img { width: 28px; height: 28px; image-rendering: pixelated; } .mon-chip .it { color: var(--warn); }
.tr-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.tr-detail { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.tr-mon { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.tr-mon-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .tr-mon-head img { image-rendering: pixelated; }
.tr-moves { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tr-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.tr-stat { display: flex; flex-direction: column; align-items: center; background: var(--surface-2); border-radius: 8px; padding: 4px 2px; font-variant-numeric: tabular-nums; }
.tr-stat .k { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; } .tr-stat .v { font-weight: 700; font-size: 13px; }
@media (max-width: 760px) {
  .tr-sum { grid-template-columns: auto auto 1fr auto; } .tr-badges { grid-column: 3 / 5; } .tr-party { grid-column: 1 / 5; justify-content: flex-start; } .tr-prize { align-items: flex-start; }
}
/* map */
.map-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; } .map-find { flex: 1 1 220px; min-width: 0; }
.map-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .map-tools .btn { padding: 6px 10px; min-width: 38px; }
.map-zoom-v { font-size: 12px; color: var(--ink-3); min-width: 42px; text-align: center; font-variant-numeric: tabular-nums; }
.map-cats { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.map-cat { opacity: .55; } .map-cat.on { opacity: 1; }
.map-cat-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; border: 1.5px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.map-cat-dot.md-loc { background: var(--blue); } .map-cat-dot.md-gym { background: var(--gold); } .map-cat-dot.md-galactic { background: var(--bad); } .map-cat-dot.md-trainers { background: var(--ink-2); } .map-cat-dot.md-catch { background: var(--ok); } .map-cat-dot.md-post { background: var(--pearl); }
.map-wrap { position: relative; }
.map-stage { position: relative; width: 100%; height: clamp(360px, 68vh, 820px); overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: #1fb0cb; cursor: grab; touch-action: none; user-select: none; outline: none; }
.map-stage:focus-visible { box-shadow: 0 0 0 3px var(--gold); } .map-stage:active { cursor: grabbing; }
.map-img, .map-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.map-img { pointer-events: none; max-width: none; }
.pin { position: absolute; transform: translate(-50%, -50%); background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; font: inherit; color: inherit; }
.pin-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--blue); border: 2.5px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); display: grid; place-items: center; transition: transform .15s; }
.pin-ic { font-size: 9px; font-weight: 800; color: #fff; line-height: 1; font-family: var(--font-head); }
.pin.kind-town .pin-dot { border-radius: 5px; } .pin.gym .pin-dot { background: var(--gold); } .pin.gym .pin-ic { color: var(--gold-ink); } .pin.galactic .pin-dot { background: var(--bad); } .pin.post .pin-dot { background: var(--pearl); }
.pin.sub .pin-dot { width: 12px; height: 12px; border-width: 2px; } .pin.sub .pin-label { font-size: 9px; }
.pin.partial .pin-dot { box-shadow: 0 0 0 3px rgba(31,138,76,.45); } .pin.cleared .pin-dot { background: var(--ok); } .pin.cleared .pin-ic::after { content: ''; }
.pin.run-caught .pin-dot, .pin.run-alive .pin-dot { outline: 3px solid rgba(31,138,76,.6); outline-offset: 1px; } .pin.run-dead .pin-dot, .pin.run-fainted .pin-dot { outline: 3px solid rgba(192,40,27,.6); outline-offset: 1px; }
.pin-label { font-size: 10px; font-weight: 700; color: #1f2430; background: rgba(255,255,255,.85); padding: 0 4px; border-radius: 4px; white-space: nowrap; line-height: 1.5; pointer-events: none; }
.map-layer.no-labels .pin-label, .map-layer.far .pin.sub .pin-label, .map-layer.far .pin.kind-route .pin-label { display: none; }
.map-layer.hide-trainers .pin:not(.gym):not(.galactic) .pin-ic { display: none; } .map-layer.hide-gym .pin.gym .pin-dot { background: var(--blue); } .map-layer.hide-galactic .pin.galactic .pin-dot { background: var(--blue); }
.pin:hover .pin-dot, .pin.on .pin-dot { transform: scale(1.35); } .pin.on .pin-label { background: var(--gold); }
.pin:focus-visible .pin-dot { box-shadow: 0 0 0 3px var(--gold); }
.map-panel { position: absolute; right: 10px; top: 10px; width: min(360px, calc(100% - 20px)); max-height: calc(100% - 20px); overflow: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; z-index: 3; }
.map-panel-head { display: flex; align-items: baseline; gap: 8px; } .map-panel-head h4 { margin: 0; font-size: 17px; flex: 1 1 auto; } .map-panel-head .linkish { font-size: 16px; }
.map-sub { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 8px; }
.map-fights { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; max-height: 260px; overflow: auto; }
.map-fight { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.map-fight.done { opacity: .55; text-decoration: line-through; } .map-fight img { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; } .map-fight .m { margin-left: auto; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.map-mons { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; } .map-mon { background: none; border: 0; padding: 0; cursor: pointer; } .map-mon img { image-rendering: pixelated; width: 32px; height: 32px; }
.map-panel-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 760px) { .map-stage { height: 62vh; } .map-panel { right: 6px; left: 6px; top: auto; bottom: 6px; width: auto; max-height: 55%; } }
:root[data-theme="dark"] .pin-label { color: #1f2430; }
.tr-sum::before, .tr-sum::after, .tr-row > summary::marker { content: none !important; display: none !important; }
.tr-row > summary { padding-left: 10px; }
.map-layer.mid .pin.sub .pin-label { display: none; }

/* ===== v11.1 · Grand Underground ===== */
.gu-top { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.gu-ver { display: inline-flex; gap: 6px; } .gu-ver .chip.on { background: var(--pearl); color: #fff; border-color: var(--pearl); }
.gu-gates { display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; }
.gu-gate { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); cursor: pointer; }
.gu-gate.on { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); } .gu-gate input { accent-color: var(--ok); }
.gu-zones { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin: 10px 0; }
.gu-zone { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); min-width: 0; }
.gu-zone-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; } .gu-zone-head .gym-h4 { margin: 0; }
.gu-stage { position: relative; width: 100%; border-radius: 10px; overflow: hidden; background: #3a3a3a; }
.gu-stage img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gu-pin { position: absolute; transform: translate(-50%, -50%); width: 16px; height: 16px; border-radius: 4px; border: 2px solid #fff; box-shadow: 0 0 0 1.5px rgba(0,0,0,.55); padding: 0; cursor: pointer; transition: transform .15s; }
.gu-pin.big { width: 24px; height: 24px; border-radius: 6px; } .gu-pin:hover, .gu-pin.on { transform: translate(-50%, -50%) scale(1.3); box-shadow: 0 0 0 3px var(--gold); } .gu-pin:focus-visible { box-shadow: 0 0 0 3px var(--gold); outline: none; }
.gu-legend { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; } .gu-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; border: 1px solid rgba(0,0,0,.25); }
.gu-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.gu-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; padding: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; box-shadow: var(--shadow); transition: transform .15s; }
.gu-card:hover { transform: translateY(-2px); } .gu-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.gu-card-body { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; } .gu-card-body b { font-size: 14px; }
.gu-panel { margin: 10px 0 16px; }
.gu-panel-head { display: flex; gap: 12px; align-items: center; } .gu-panel-head img { border-radius: 8px; width: 120px; height: 68px; object-fit: cover; } .gu-panel-head h4 { margin: 0; font-size: 18px; } .gu-panel-head > div { flex: 1 1 auto; }
.gu-sec { border-top: 1px dashed var(--line); padding: 8px 0; } .gu-sec.off { opacity: .6; }
.gu-sec-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.gu-mons { display: flex; flex-wrap: wrap; gap: 4px; }
.gu-mon { display: flex; flex-direction: column; align-items: center; width: 74px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 2px; font: inherit; font-size: 11px; color: inherit; cursor: pointer; }
.gu-mon img { image-rendering: pixelated; width: 40px; height: 40px; } .gu-mon span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px; }
.gu-panel-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.gu-dig { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.gu-dig-row { display: grid; grid-template-columns: 160px 1fr auto; gap: 10px; align-items: center; padding: 4px 8px; border-radius: 8px; background: var(--surface-2); }
.gu-dig-name { text-align: left; font-weight: 700; } .gu-rar { white-space: nowrap; font-size: 13px; } .gu-rar .m { color: var(--ink-3); }
@media (max-width: 640px) { .gu-dig-row { grid-template-columns: 1fr auto; } .gu-dig-desc { grid-column: 1 / 3; } }
.gu-det { margin: 6px 0; } .gu-det > summary { font-size: 15px; }
.gu-merch { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; } .gu-merch-row { display: grid; grid-template-columns: 200px 1fr auto; gap: 10px; padding: 3px 8px; background: var(--surface-2); border-radius: 6px; font-size: 13px; }
@media (max-width: 640px) { .gu-merch-row { grid-template-columns: 1fr; } }
.gu-zone#gu-zone-main { grid-column: 1 / -1; } .gu-zone#gu-zone-main .gu-stage { max-width: 900px; }
/* items on the map */
.map-items { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; max-height: 320px; overflow: auto; }
.map-item { display: grid; grid-template-columns: auto auto auto auto 1fr; gap: 6px; align-items: center; padding: 3px 6px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.map-item.done { opacity: .55; } .map-item.done .map-item-name { text-decoration: line-through; } .map-item input { accent-color: var(--ok); }
.map-item-name { font-weight: 700; text-align: left; } .map-item-where { grid-column: 1 / -1; font-size: 12px; }
.map-finder { margin-top: 14px; } .map-finder .field { width: 100%; margin: 6px 0; } .map-finder-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.map-finder-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; } .map-finder-row .map-item { min-width: 0; }
@media (max-width: 640px) { .map-finder-row { grid-template-columns: 1fr; } }
/* wild encounters on the map */
.map-wild-group { margin-top: 6px; } .map-wild-group.post { opacity: .75; }
.map-wilds { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.map-wild { display: flex; flex-direction: column; align-items: center; width: 66px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 2px; font: inherit; font-size: 11px; color: inherit; cursor: pointer; }
.map-wild img { image-rendering: pixelated; width: 32px; height: 32px; } .map-wild-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62px; font-weight: 700; } .map-wild .m { font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.map-wild.static { border-color: var(--gold); background: var(--warn-bg); } .map-wild.post { border-style: dashed; }

/* ===== v11.4 · quality pass: sprites and portraits fill their boxes ===== */
.dex-sprite-wrap { width: 184px; height: 184px; border-radius: 50%; background: radial-gradient(circle at 50% 45%, var(--surface) 0 70%, var(--surface-2) 71%); border: 4px solid var(--ink); display: grid; place-items: center; overflow: hidden; }
.dex-art { width: 164px; height: 164px; object-fit: contain; animation: hop .7s cubic-bezier(.34,1.56,.64,1); filter: drop-shadow(0 6px 6px rgba(0,0,0,.18)); }
.dex-art.px { image-rendering: pixelated; width: 150px; height: 150px; }
.dex-hero { grid-template-columns: 190px minmax(0, 1fr); }
@media (max-width: 760px) { .dex-sprite-wrap { width: 150px; height: 150px; } .dex-art { width: 132px; height: 132px; } }
/* trainer rows */
.tr-row > summary.tr-sum { grid-template-columns: auto auto minmax(160px, 1.3fr) auto auto minmax(180px, 1.2fr); gap: 14px; padding: 10px 14px; }
.tr-art { width: 96px; height: 96px; border-radius: 14px; background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.tr-who b { font-size: 18px; font-family: var(--font-head); } .tr-who .meta-note { font-size: 13px; }
.tr-prize b { font-size: 18px; } .tr-prize .m { font-size: 12px; }
.tr-party { gap: 6px; } .tr-party-mon { display: inline-flex; flex-direction: column; align-items: center; width: 66px; }
.tr-party-mon img { width: 64px; height: 64px; image-rendering: pixelated; transform: scale(1.25); transform-origin: 50% 60%; }
.tr-party-lv { font-size: 11px; color: var(--ink-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.mon-chip img { width: 44px; height: 44px; transform: scale(1.3); transform-origin: 50% 60%; margin-right: 4px; }
.tr-mon-head { gap: 12px; } .tr-mon-art { width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,.15)); } .tr-mon-art.px { image-rendering: pixelated; transform: scale(1.2); }
.tr-mon-head b { font-size: 17px; font-family: var(--font-head); }
@media (max-width: 760px) { .tr-row > summary.tr-sum { grid-template-columns: auto auto 1fr auto; gap: 8px; padding: 8px 10px; } .tr-art { width: 64px; height: 64px; } .tr-party-mon { width: 50px; } .tr-party-mon img { width: 48px; height: 48px; } .tr-who b { font-size: 16px; } }
/* map panel */
.map-fight { padding: 4px 8px; gap: 10px; } .map-fight img { width: 44px; height: 44px; border-radius: 8px; } .map-fight > span:not(.m) { font-weight: 700; }
.map-wild { width: 86px; padding: 4px 2px 5px; } .map-wild img { width: 64px; height: 64px; transform: scale(1.3); transform-origin: 50% 58%; margin-bottom: 2px; } .map-wild-n { max-width: 82px; font-size: 12px; }
.map-wilds { gap: 5px; }
/* underground chips */
.gu-mon { width: 96px; padding: 6px 2px; font-size: 12px; } .gu-mon img { width: 72px; height: 72px; transform: scale(1.3); transform-origin: 50% 58%; margin-bottom: 4px; } .gu-mon span { max-width: 92px; font-weight: 700; }
.gu-mons { gap: 6px; }
.gu-card img { aspect-ratio: 16 / 9; }
/* ===== v11.4 · nav with icons, grouped ===== */
.topbar .tab-nav { gap: 4px; align-items: stretch; padding: 2px 0 4px; }
.tab-group { display: inline-flex; gap: 2px; align-items: center; padding-right: 8px; margin-right: 6px; border-right: 1px solid var(--line); position: relative; }
.tab-group:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.topbar .tab-btn { gap: 7px; padding: 7px 12px 9px; border-radius: 10px; font-size: 14px; color: var(--ink-2); }
.topbar .tab-btn::after { left: 12px; right: 12px; }
.topbar .tab-btn:hover { background: var(--surface-2); color: var(--ink); }
.topbar .tab-btn.active { color: var(--ink); background: var(--gold); box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.topbar .tab-btn.active::after { background: transparent; }
.tab-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; opacity: .9; transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.topbar .tab-btn:hover .tab-ic, .topbar .tab-btn.active .tab-ic { transform: translateY(-1px) scale(1.1); }
.topbar .tab-btn.active .tab-ic { stroke-width: 2.2; }
@media (max-width: 900px) {
  .topbar .tab-btn { flex-direction: column; gap: 3px; padding: 6px 9px 7px; font-size: 11.5px; min-width: 62px; }
  .tab-ic { width: 20px; height: 20px; } .tab-group { padding-right: 4px; margin-right: 3px; }
}

/* ===== v11.4 · mini-map, lightbox, hideaway cards, item icons ===== */
.mm { position: fixed; right: 16px; bottom: 16px; width: 320px; height: 230px; min-width: 220px; min-height: 170px; max-width: 90vw; max-height: 80vh; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.22); display: flex; flex-direction: column; overflow: hidden; resize: both; z-index: 60; }
.mm-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; }
.mm-head:active { cursor: grabbing; } .mm-title { font: 700 13px var(--font-head); letter-spacing: .02em; }
.mm-tools { display: inline-flex; gap: 2px; } .mm-btn { width: 26px; height: 24px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font: 700 13px var(--font-body); cursor: pointer; padding: 0; }
.mm-btn:hover { background: var(--gold); border-color: var(--gold); }
.mm-stage { position: relative; flex: 1 1 auto; overflow: hidden; background: #1fb0cb; cursor: grab; touch-action: none; outline: none; }
.mm-img, .mm-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; } .mm-img { pointer-events: none; max-width: none; }
.mm-pin { position: absolute; transform: translate(-50%, -50%); width: 9px; height: 9px; border-radius: 50%; background: #3466af; border: 1.5px solid #fff; padding: 0; cursor: pointer; }
.mm-pin.gym { background: var(--gold); } .mm-pin.galactic { background: var(--bad); }
.mm-pin.on { background: var(--red); width: 16px; height: 16px; border-width: 2.5px; box-shadow: 0 0 0 4px rgba(227,53,13,.35); animation: mmpulse 1.4s ease-out infinite; z-index: 2; }
@keyframes mmpulse { 0% { box-shadow: 0 0 0 0 rgba(227,53,13,.55); } 100% { box-shadow: 0 0 0 14px rgba(227,53,13,0); } }
.mm-label { position: absolute; left: 8px; bottom: 8px; background: rgba(255,255,255,.94); color: #1f2430; border-radius: 9px; padding: 5px 9px; font-size: 12px; display: flex; gap: 8px; align-items: baseline; box-shadow: 0 2px 8px rgba(0,0,0,.2); max-width: calc(100% - 16px); }
.mm-label b { font-family: var(--font-head); font-size: 13px; } .mm-label .m { color: var(--ink-3); } .mm-label .linkish { font-size: 12px; }
.mm-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 10px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12px; }
.mm-op-wrap { display: inline-flex; align-items: center; gap: 6px; } .mm-op { width: 90px; accent-color: var(--red); } .mm-op-ic { color: var(--ink-3); }
.mm-flash { animation: mmflash .7s ease-out; } @keyframes mmflash { 0% { box-shadow: 0 0 0 0 rgba(255,203,5,.9); } 100% { box-shadow: 0 10px 30px rgba(0,0,0,.22); } }
.mm-ball { position: fixed; right: 18px; bottom: 18px; width: 54px; height: 54px; border-radius: 50%; border: 3px solid #1f2430; background: linear-gradient(180deg, #e3350d 0 46%, #1f2430 46% 54%, #fff 54%); box-shadow: 0 6px 16px rgba(0,0,0,.25); cursor: pointer; z-index: 60; padding: 0; transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.mm-ball:hover { transform: scale(1.1) rotate(-10deg); } .mm-ball-dot { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; border: 3px solid #1f2430; }
@media (max-width: 760px) { .mm { right: 8px; bottom: 8px; width: min(300px, 92vw); height: 200px; } .mm-ball { right: 12px; bottom: 12px; width: 48px; height: 48px; } }
:root[data-theme="dark"] .mm-label { background: rgba(28,31,41,.94); color: var(--ink); }
/* lightbox */
.lb { position: fixed; inset: 0; background: rgba(20,22,28,.78); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity .18s; backdrop-filter: blur(4px); }
.lb.in { opacity: 1; } .lb-close { position: absolute; top: 14px; right: 16px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: #1f2430; font-size: 18px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.lb-body { display: flex; gap: 16px; align-items: center; justify-content: center; max-width: 96vw; max-height: 78vh; }
.lb-stage { overflow: hidden; border-radius: 14px; box-shadow: 0 16px 50px rgba(0,0,0,.45); background: #000; cursor: grab; touch-action: none; max-width: 96vw; }
.lb-img { display: block; max-width: min(96vw, 1200px); max-height: 76vh; transform-origin: 50% 50%; transition: transform .08s; user-select: none; }
.lb-aside { width: 300px; max-height: 76vh; overflow: auto; background: var(--surface); color: var(--ink); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; } .lb-aside[hidden] { display: none; }
.lb-cap { color: #fff; margin-top: 12px; text-align: center; max-width: 900px; font-size: 14px; } .lb-cap b { font-family: var(--font-head); font-size: 18px; } .lb-cap .meta-note { color: rgba(255,255,255,.8); }
.lb-hint { color: rgba(255,255,255,.6); font-size: 12px; margin: 6px 0 0; }
@media (max-width: 900px) { .lb-body { flex-direction: column; } .lb-aside { width: min(92vw, 420px); max-height: 30vh; } .lb-img { max-height: 46vh; } }
.gu-ctx { display: flex; flex-direction: column; gap: 8px; } .gu-ctx-stage { position: relative; width: 100%; border-radius: 8px; overflow: hidden; background: #333; } .gu-ctx-stage img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gu-ctx-pin { position: absolute; transform: translate(-50%, -50%); width: 14px; height: 14px; border-radius: 4px; border: 2px solid #fff; box-shadow: 0 0 0 3px var(--red); animation: mmpulse 1.4s ease-out infinite; } .gu-ctx-pin.big { width: 22px; height: 22px; }
/* hideaway card: photo button + name button */
.gu-card { padding: 0; cursor: default; } .gu-card-img { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gu-card-img img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .3s; } .gu-card-img:hover img { transform: scale(1.04); }
.gu-card-zoom { position: absolute; right: 8px; bottom: 8px; background: rgba(255,255,255,.9); color: #1f2430; border-radius: 6px; padding: 2px 7px; font-size: 13px; }
.gu-card-open { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; } .gu-card-open:hover b { color: var(--red); }
/* item icons */
.item-img { width: 30px; height: 30px; } .item-img.big { width: 34px; height: 34px; } .mon-chip .it { display: inline-flex; align-items: center; gap: 3px; }
.info-hero.item .info-item-img { width: 112px; height: 112px; image-rendering: pixelated; background: radial-gradient(circle at 50% 50%, var(--surface) 0 60%, var(--surface-2) 61%); border-radius: 50%; padding: 12px; border: 3px solid var(--ink); }
.map-item-name { display: inline-flex; align-items: center; gap: 6px; }
.map-locimg-btn { display: block; width: 100%; position: relative; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 10px; overflow: hidden; margin: 6px 0; }
.map-locimg { display: block; width: 100%; height: auto; max-height: 190px; object-fit: cover; transition: transform .3s; } .map-locimg-btn:hover .map-locimg { transform: scale(1.03); }
.map-locimg-zoom { position: absolute; right: 8px; bottom: 8px; background: rgba(255,255,255,.9); color: #1f2430; border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.map-wrap { scroll-margin-top: 110px; }

/* ---------- v11.4b trainer battle cards (the gym / League treatment for everyone) ---------- */
.tr-row.fight { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: visible; transition: box-shadow .2s, transform .2s; }
.tr-row.fight:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.tr-row.fight[open] { box-shadow: 0 10px 28px rgba(0,0,0,.12); }
.tr-row.fight > summary.tr-sum { display: grid; grid-template-columns: 22px auto 120px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 16px; border-radius: var(--radius); }
.tr-row.fight > summary.tr-sum:hover { background: var(--surface-2); }
.tr-row.fight .tr-check input { width: 22px; height: 22px; }
.tr-portrait.none { background: var(--surface-2); border-color: var(--line); } .tr-initial { font: 700 2.4rem var(--font-head); color: var(--ink-3); }
.tr-row.done .fight-name strong { text-decoration: line-through; text-decoration-thickness: 3px; text-decoration-color: var(--ok); }
.tr-row.done .tr-portrait img { filter: grayscale(.6); }
.fight-team { max-width: 320px; gap: 6px; } .fight-team img { width: 64px; height: 64px; }
.tr-party-mon { position: relative; display: inline-flex; flex-direction: column; align-items: center; width: 66px; }
.tr-party-mon img:first-child { width: 64px; height: 64px; image-rendering: pixelated; transform: scale(1.18); transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.tr-party-mon:hover img:first-child { transform: scale(1.4) translateY(-4px); }
.tr-party-lv { font-size: 11px; font-weight: 800; color: var(--ink-3); line-height: 1; margin-top: 2px; }
.tr-party-item { position: absolute; right: -4px; top: 38px; width: 26px; height: 26px; padding: 1px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(0,0,0,.2); object-fit: contain; }
.tr-prize-b { color: var(--ink); }
.tr-glance td, .tr-glance th { vertical-align: middle; } .tr-glance td:nth-child(3) .types { flex-wrap: nowrap; }
.tr-glance-mon { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: inherit; } .tr-glance-mon img { width: 40px; height: 40px; image-rendering: pixelated; }
.tr-glance-moves { display: flex; flex-wrap: wrap; gap: 2px 10px; } .tr-glance-moves .linkish { font-weight: 600; }
.tr-item { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: inherit; }
.tr-intel { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.tr-intel .gym-h4 { margin: 0 0 6px; } .tr-intel-line { margin: 4px 0; font-size: .92rem; line-height: 1.45; display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; }
.tr-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.tr-row.fight .fight-sub.small b { font-size: .9rem; }
.gym-trainer { grid-template-columns: 96px 190px minmax(0, 1fr); } .gt-art { width: 96px; height: 96px; } .gt-mon img { width: 48px; height: 48px; }
@media (max-width: 760px) {
  .tr-row.fight > summary.tr-sum { grid-template-columns: 14px auto 84px minmax(0, 1fr); grid-template-areas: "c k p id" "c k p team"; row-gap: 8px; gap: 10px; padding: 10px 12px; }
  .tr-row.fight .tr-check { grid-area: k; } .tr-row.fight .fight-chevron { grid-area: c; } .tr-row.fight .tr-portrait { grid-area: p; width: 84px; height: 84px; } .tr-row.fight .fight-id { grid-area: id; }
  .tr-row.fight .fight-team { grid-area: team; } .tr-row.fight .fight-cap { grid-area: team; }
  .tr-party-mon { width: 52px; } .tr-party-mon img:first-child { width: 48px; height: 48px; } .tr-party-item { top: 28px; width: 22px; height: 22px; }
  .gym-trainer { grid-template-columns: 72px minmax(0, 1fr); } .gt-art { width: 72px; height: 72px; }
}

/* ---------- v11.4c map engine: controls, hover cards, inset, search, fullscreen, pins ---------- */
.map-stage { cursor: grab; } .map-stage.grabbing { cursor: grabbing; }
.map-layer .pin { transform: translate(-50%, -50%) scale(var(--k, 1)); transform-origin: 50% 50%; }
.pin-dot { width: 20px; height: 20px; border-width: 2.5px; }
.pin.pulse .pin-dot { animation: pinpulse .9s cubic-bezier(.2,.8,.2,1); } @keyframes pinpulse { 0% { box-shadow: 0 0 0 0 rgba(227,53,13,.55); } 100% { box-shadow: 0 0 0 18px rgba(227,53,13,0); } }
.pin.on .pin-dot { transform: scale(1.4); background: var(--red); border-color: #fff; }
.map-ctl { position: absolute; left: 10px; top: 10px; z-index: 4; display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.92); border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0,0,0,.14); backdrop-filter: blur(6px); }
:root[data-theme="dark"] .map-ctl { background: rgba(28,32,40,.9); }
.map-ctl-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--ink); cursor: pointer; transition: background .15s, transform .15s; }
.map-ctl-btn:hover { background: var(--surface-2); transform: scale(1.06); } .map-ctl-btn:active { transform: scale(.94); } .map-ctl-btn.off { color: var(--ink-3); } .map-ctl-btn:focus-visible { box-shadow: 0 0 0 3px var(--gold); outline: none; }
.map-ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.map-zoom-v { font: 800 .7rem var(--font-body); text-align: center; color: var(--ink-2); padding: 2px 0; font-variant-numeric: tabular-nums; }
.map-hover { position: absolute; z-index: 5; transform: translate(-50%, -100%); max-width: 260px; padding: 6px 10px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; line-height: 1.35; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.25); display: grid; gap: 1px; animation: popin .12s ease-out; }
.map-hover b { font-size: 13px; } .map-hover::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; background: var(--ink); transform: translateX(-50%) rotate(45deg); }
:root[data-theme="dark"] .map-hover { background: #f4f6fb; color: #1f2430; } :root[data-theme="dark"] .map-hover::after { background: #f4f6fb; }
.map-inset { position: absolute; right: 10px; bottom: 10px; z-index: 4; width: 160px; border-radius: 8px; overflow: hidden; border: 2px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,.3); cursor: crosshair; background: #1fb0cb; line-height: 0; }
.map-inset img { width: 160px; height: auto; display: block; pointer-events: none; } .map-inset-view { position: absolute; border: 2px solid var(--red); background: rgba(227,53,13,.12); box-shadow: 0 0 0 1px rgba(255,255,255,.7); pointer-events: none; border-radius: 2px; }
.map-help { position: absolute; left: 60px; top: 10px; z-index: 6; width: min(300px, calc(100% - 80px)); padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); animation: popin .18s ease-out; }
.map-help dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 6px 0 0; font-size: 13px; } .map-help dt { font-weight: 800; white-space: nowrap; } .map-help dd { margin: 0; color: var(--ink-2); }
.map-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.map-find-wrap { position: relative; flex: 1 1 280px; min-width: 0; } .map-find { width: 100%; }
.map-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; max-height: 380px; overflow: auto; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 2px; animation: popin .14s ease-out; }
.map-result { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; border: 0; border-radius: 9px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.map-result.sel, .map-result:hover { background: var(--surface-2); } .map-result img { width: 40px; height: 40px; image-rendering: pixelated; justify-self: center; } .map-result img.art { image-rendering: auto; object-fit: contain; border-radius: 50%; background: var(--surface-2); } .map-result .item-img { width: 30px; height: 30px; }
.map-result-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--blue); justify-self: center; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.map-result-t { display: grid; min-width: 0; } .map-result-t b { font-size: 14px; } .map-result-t span { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-result-k { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); }
.map-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.map-credit { margin-top: 6px; }
.map-fight img:first-child { width: 56px; height: 56px; object-fit: contain; object-position: bottom; } .map-fight .m { display: inline-flex; gap: 0; } .map-fight-mon { width: 36px; height: 36px; image-rendering: pixelated; margin-left: -6px; }
.map-fight.flash { animation: flash 1.2s; }
/* fullscreen (API or CSS fallback) */
.map-wrap:fullscreen, .map-wrap.fs { background: var(--surface); } .map-wrap:fullscreen .map-stage, .map-wrap.fs .map-stage { height: 100%; border-radius: 0; border: 0; }
.map-wrap.fs { position: fixed; inset: 0; z-index: 70; } body.map-fs { overflow: hidden; }
.map-wrap:fullscreen .map-panel { max-height: calc(100% - 20px); }
@media (max-width: 760px) { .map-ctl { left: 6px; top: 6px; } .map-ctl-btn { width: 40px; height: 40px; } .map-inset { width: 120px; } .map-inset img { width: 120px; } .map-help { left: 56px; } }

/* ---------- v11.4d held items (Thief / Covet): badges + Steal finder ---------- */
.held { display: inline-flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.held-it { display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px 1px 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 11px; cursor: pointer; line-height: 1; transition: transform .15s, border-color .15s; }
.held-it:hover { transform: translateY(-1px); border-color: var(--ink); } .held-it img { width: 22px; height: 22px; } .held-it b { font-size: 11px; }
.held.big .held-it { padding: 3px 8px 3px 4px; font-size: 13px; } .held.big .held-it img { width: 30px; height: 30px; } .held.big .held-it b { font-size: 13px; }
.map-wild .held { margin-top: 2px; }
.steal-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.steal-pick { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: inherit; font: inherit; font-weight: 700; text-align: left; cursor: pointer; transition: transform .15s, border-color .15s; }
.steal-pick:hover { transform: translateY(-2px); border-color: var(--ink); } .steal-pick .m { font-size: 12px; color: var(--ink-3); font-weight: 800; }
.steal-item { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.steal-item-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; } .steal-item-head b { font-size: 1.1rem; font-family: var(--font-head); } .steal-item-head .item-img { width: 40px; height: 40px; }
.steal-rows { display: grid; gap: 6px; }
.steal-row { display: grid; grid-template-columns: 200px 130px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.steal-mon { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; } .steal-mon img { width: 64px; height: 64px; image-rendering: pixelated; transform: scale(1.15); transition: transform .25s cubic-bezier(.34,1.56,.64,1); } .steal-mon:hover img { transform: scale(1.35) translateY(-3px); } .steal-mon b { font-size: 15px; }
.steal-pct { display: grid; line-height: 1.1; } .steal-pct b { font: 700 1.3rem var(--font-head); color: var(--ink); } .steal-pct .m { font-size: 11px; color: var(--ink-3); }
.steal-where { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; } .steal-where .chip .m { color: var(--ink-3); font-size: 10px; margin-left: 2px; }
.steal-trainers { margin-top: 8px; } .steal-trainers .chip img { width: 28px; height: 28px; image-rendering: pixelated; }
@media (max-width: 760px) { .steal-row { grid-template-columns: 1fr auto; } .steal-where { grid-column: 1 / -1; } }
.mm.mm-away, .mm-ball.mm-away { display: none !important; }
.map-inset { right: auto; left: 10px; }
.map-layer:not(.mid) .pin-label { font-size: 12px; }
.tr-party-mon { width: 74px; } .tr-party-mon img:first-child { width: 72px; height: 72px; transform: scale(1.15); } .tr-party-item { top: 44px; }
@media (max-width: 760px) { .tr-party-mon { width: 52px; } .tr-party-mon img:first-child { width: 48px; height: 48px; } .tr-party-item { top: 28px; } }
@media (max-width: 760px) { .map-ctl-btn:nth-child(7), .map-ctl-btn:nth-child(8) { display: none; } .map-ctl-btn { width: 38px; height: 38px; } }
html { overflow-x: clip; } @supports not (overflow-x: clip) { html { overflow-x: hidden; } }

/* ---------- v11.5 where you are: story path, here marker, next-up card ---------- */
.map-path { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; overflow: visible; }
.map-path line { stroke: rgba(31,36,48,.38); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 9; vector-effect: non-scaling-stroke; }
.map-path line.done { stroke: rgba(31,138,76,.85); stroke-dasharray: none; stroke-width: 4; }
.map-path.off { display: none; }
.md-path { background: var(--ok); }
.pin-here { display: none; position: absolute; top: -22px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 800 10px/1 var(--font-body); letter-spacing: .3px; text-transform: uppercase; color: #fff; background: var(--red); padding: 4px 7px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.3); pointer-events: none; }
.pin.here .pin-here { display: block; } .pin.here { z-index: 3; }
.pin.here .pin-dot { background: var(--red); border-color: #fff; transform: scale(1.3); animation: herepulse 1.6s ease-out infinite; }
@keyframes herepulse { 0% { box-shadow: 0 0 0 0 rgba(227,53,13,.55), 0 1px 3px rgba(0,0,0,.35); } 100% { box-shadow: 0 0 0 16px rgba(227,53,13,0), 0 1px 3px rgba(0,0,0,.35); } }
.map-layer.no-labels .pin-here { display: none; }
.mm-pin.here { background: var(--red); width: 14px; height: 14px; border-width: 2px; box-shadow: 0 0 0 3px rgba(227,53,13,.3); animation: mmpulse 1.6s ease-out infinite; }
.map-next .card-header { margin-bottom: 6px; }
.map-here { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(260px, 1.4fr); gap: 12px 18px; align-items: start; }
.map-here-now { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform .15s, border-color .15s; }
.map-here-now:hover { transform: translateY(-2px); border-color: var(--ink); }
.map-here-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--red); border: 2.5px solid #fff; box-shadow: 0 0 0 3px rgba(227,53,13,.3); animation: herepulse 1.6s ease-out infinite; }
.map-here-t { display: grid; min-width: 0; } .map-here-t b { font: 700 1.15rem var(--font-head); } .map-here-t span { font-size: 12.5px; color: var(--ink-2); }
.map-next-list { display: grid; gap: 4px; } .map-next-list .cov-lbl { margin-bottom: 2px; }
.map-next-stop { display: grid; grid-template-columns: minmax(120px, auto) minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform .15s, border-color .15s; }
.map-next-stop:hover { transform: translateX(3px); border-color: var(--ink); } .map-next-stop b { font-size: 14px; } .map-next-stop span { font-size: 12px; color: var(--ink-3); }
.map-next-goals { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; } .chip.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); } .chip.crit { border-color: var(--bad); color: var(--bad); }
@media (max-width: 760px) { .map-here { grid-template-columns: 1fr; } .map-ctl-btn:nth-child(7), .map-ctl-btn:nth-child(8) { display: grid; } .map-ctl-btn:nth-child(8), .map-ctl-btn:nth-child(9) { display: none; } }
/* lightbox v2: a transformed frame (image + overlay), pins keep their size */
.lb-frame { position: relative; display: inline-block; transform-origin: 0 0; line-height: 0; will-change: transform; }
.lb-img { transform-origin: 0 0; transition: none; }
.lb-over { position: absolute; inset: 0; } .lb-over[hidden] { display: none; }
.lb-over .gu-pin { transform: translate(-50%, -50%) scale(var(--k, 1)); } .lb-over .gu-pin:hover, .lb-over .gu-pin.on { transform: translate(-50%, -50%) scale(calc(var(--k, 1) * 1.3)); }
.lb-over .gu-pin-lbl { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 4px); white-space: nowrap; font: 700 11px/1.3 var(--font-body); color: #fff; background: rgba(0,0,0,.65); padding: 2px 6px; border-radius: 6px; pointer-events: none; opacity: 0; transition: opacity .15s; }
.lb-over .gu-pin:hover .gu-pin-lbl, .lb-over .gu-pin.on .gu-pin-lbl { opacity: 1; }
.gu-stage { position: relative; } .gu-stage-zoom { position: absolute; right: 6px; top: 6px; z-index: 2; width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,.6); background: rgba(255,255,255,.88); color: #1f2430; font-size: 18px; cursor: pointer; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.25); transition: transform .15s; }
.gu-stage-zoom:hover { transform: scale(1.08); }
.lb-frame.fill .lb-img { width: min(92vw, 1100px); max-width: none; height: auto; max-height: none; }
.lb-img.px { image-rendering: pixelated; }
@media (max-width: 900px) { .lb-frame.fill .lb-img { width: 92vw; } }

/* ---------- contrast pass (both themes): dark ink on light type colours, readable actives in dark ---------- */
.type-badge { color: #1f2430; text-shadow: none; }
.type-badge.t-poison, .type-badge.t-ghost, .type-badge.t-dragon, .type-badge.t-dark, .type-badge.t-fighting { color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.35); }
:root[data-theme="dark"] .btn-primary { color: #0b1220; }
:root[data-theme="dark"] .cat.physical .cat-text { color: #ff8f7a; } :root[data-theme="dark"] .cat.special .cat-text { color: #8fb4ff; }
:root[data-theme="dark"] .chip.ok .m, :root[data-theme="dark"] .chip.warn .m { color: var(--ink-2); }
.gu-ver .chip.on { color: #231018; }
:root[data-theme="dark"] .topbar .tab-btn.active, :root[data-theme="dark"] .tab-btn.active { color: var(--gold-ink); }
:root[data-theme="dark"] .pin-label { color: #1f2430; background: rgba(255,255,255,.9); }
:root[data-theme="dark"] .map-inset { border-color: #3a4152; }
:root[data-theme="dark"] .gu-stage-zoom { background: rgba(28,32,40,.9); color: #eceef3; border-color: rgba(255,255,255,.2); }
:root[data-theme="dark"] .map-path line { stroke: rgba(236,238,243,.42); } :root[data-theme="dark"] .map-path line.done { stroke: rgba(76,199,133,.9); }

/* ===== v11.7 · nav: captions per group, even rhythm, Nuzlocke group ===== */
.topbar .tab-nav { gap: 0; padding: 14px 0 4px; align-items: flex-end; }
.tab-group { gap: 2px; padding: 0 10px 0 6px; margin: 0; border-right: 1px solid var(--line); position: relative; }
.tab-group:first-child { padding-left: 0; } .tab-group:last-child { border-right: 0; }
.tab-group::before { content: attr(data-group); position: absolute; left: 10px; top: -13px; font: 800 9.5px/1 var(--font-body); letter-spacing: 1.1px; text-transform: uppercase; color: var(--ink-3); pointer-events: none; }
.tab-group:first-child::before { left: 4px; }
.tab-group[data-group="Nuzlocke"]::before { color: var(--red); }
.topbar .tab-btn { gap: 7px; padding: 8px 13px; border-radius: 10px; font-size: 14px; line-height: 1; height: 38px; }
.topbar .tab-btn .tab-lbl { white-space: nowrap; }
.topbar .tab-btn:hover { background: var(--surface-2); color: var(--ink); }
.topbar .tab-btn.active { background: var(--gold); color: var(--gold-ink); box-shadow: 0 1px 0 rgba(0,0,0,.08), inset 0 -2px 0 rgba(0,0,0,.08); }
.topbar .tab-btn.active::after { background: transparent; }
.tab-group[data-group="Nuzlocke"] .tab-btn.active { background: var(--red); color: #fff; }
.nz-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--red); color: #fff; font: 800 10.5px/1.6 var(--font-body); letter-spacing: .6px; text-transform: uppercase; vertical-align: middle; }
.nz-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
@media (max-width: 900px) {
  .topbar .tab-nav { padding: 12px 0 4px; }
  .topbar .tab-btn { flex-direction: column; gap: 3px; padding: 6px 9px 7px; font-size: 11.5px; min-width: 62px; height: auto; }
  .tab-group::before { font-size: 8.5px; top: -11px; }
}
/* companion map v2 */
.mm { display: flex; flex-direction: column; min-width: 260px; min-height: 200px; resize: both; overflow: hidden; }
.mm.dragging { cursor: grabbing; user-select: none; }
.mm-head { cursor: grab; } .mm-title { display: inline-flex; align-items: center; gap: 6px; } .mm-title-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(227,53,13,.25); }
.mm-stage { position: relative; flex: 1 1 auto; min-height: 120px; overflow: hidden; background: #1fb0cb; cursor: grab; touch-action: none; }
.mm-stage .map-ctl { left: 6px; top: 6px; padding: 3px; gap: 2px; } .map-ctl.compact .map-ctl-btn { width: 28px; height: 28px; } .map-ctl.compact .map-ic { width: 16px; height: 16px; } .map-ctl.compact .map-zoom-v { font-size: .62rem; }
.mm-stage .pin-label { font-size: 9px; } .mm-stage .pin-dot { width: 14px; height: 14px; border-width: 2px; } .mm-stage .pin-ic { font-size: 8px; }
.mm-stage .map-layer.far .pin-label { display: none; }
.mm-stage .pin.on .pin-dot { background: var(--red); transform: scale(1.5); box-shadow: 0 0 0 5px rgba(227,53,13,.35); animation: mmpulse 1.4s ease-out infinite; }
.mm-stage .pin.here .pin-here { display: none; }
.mm-label { position: absolute; left: 10px; bottom: 44px; z-index: 5; }
.mm-size { font-size: 10px; font-weight: 800; min-width: 22px; } .mm-size.on { background: var(--gold); color: var(--gold-ink); }
.mm-follow { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-2); cursor: pointer; } .mm-follow input { accent-color: var(--ok); }
.mm-rescue { position: fixed; right: 14px; bottom: 14px; z-index: 95; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 700 13px var(--font-body); box-shadow: var(--shadow); cursor: pointer; animation: popin .25s ease-out; }
.mm-rescue:hover { background: var(--gold); color: var(--gold-ink); }
.mm:fullscreen, .mm.fs { position: fixed; inset: 0; width: 100% !important; height: 100% !important; border-radius: 0; opacity: 1 !important; resize: none; z-index: 120; }
.mm:fullscreen .mm-stage, .mm.fs .mm-stage { border-radius: 0; }
.mm.fs { left: 0 !important; top: 0 !important; }
@keyframes mmflash { 0% { box-shadow: 0 0 0 0 rgba(227,53,13,.6), var(--shadow); } 100% { box-shadow: 0 0 0 14px rgba(227,53,13,0), var(--shadow); } }
.mm.mm-flash { animation: mmflash .9s ease-out; }
/* the map, bigger: taller stage, and on wide screens the map card breaks out of the column (+~40%) */
.map-stage { height: clamp(480px, 78vh, 1080px); }
.mm .map-stage { height: auto; border: 0; border-radius: 0; }
@media (max-width: 760px) { .map-stage { height: 70vh; } }
/* party strip + roster tiles: official artwork, filling the box */
.fight-team { max-width: 460px; gap: 4px; }
.tr-party-mon { width: 100px; } .tr-party-mon img:first-child { width: 96px; height: 96px; transform: none; image-rendering: auto; object-fit: contain; }
.tr-party-mon img.px:first-child { image-rendering: pixelated; transform: scale(1.25); }
.tr-party-mon:hover img:first-child { transform: scale(1.12) translateY(-3px); } .tr-party-item { top: 64px; right: 2px; width: 30px; height: 30px; }
.boss-mon img.art { width: 96px; height: 96px; image-rendering: auto; object-fit: contain; } .boss-mon { min-width: 112px; }
.boss-mon:hover img.art { transform: translateY(-5px) scale(1.08); }
@media (max-width: 760px) { .tr-party-mon { width: 60px; } .tr-party-mon img:first-child { width: 56px; height: 56px; } .tr-party-item { top: 34px; width: 22px; height: 22px; } .boss-mon img.art { width: 72px; height: 72px; } .boss-mon { min-width: 88px; } .fight-team { max-width: none; } }

/* ===== v11.7 · navigation rail (wide scrollbar with section markers) — desktop, fine pointer ===== */
:root { --rail-w: 36px; }
@media (min-width: 1024px) and (pointer: fine) {
  html.has-rail { scrollbar-width: none; } html.has-rail::-webkit-scrollbar { display: none; width: 0; }
  html.has-rail body { padding-right: calc(var(--gutter) + var(--rail-w)); }
  .rail { position: fixed; top: 0; right: 0; bottom: 0; width: var(--rail-w); z-index: 90; background: color-mix(in srgb, var(--surface) 82%, var(--bg)); border-left: 1px solid var(--line); }
  .rail-track { position: absolute; inset: 0; cursor: pointer; }
  .rail-thumb { position: absolute; left: 6px; right: 6px; top: 0; border-radius: 12px; background: color-mix(in srgb, var(--ink-3) 55%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ink-3) 60%, transparent); cursor: grab; transition: background .15s; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
  .rail-thumb:hover, .rail.dragging .rail-thumb { background: var(--gold); border-color: var(--gold); cursor: grabbing; }
  .rail-marks { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
  .rail-thumb { z-index: 1; }
  .rail-mark { position: absolute; left: 0; right: 0; height: 3px; margin-top: -1px; border: 0; padding: 0; background: var(--ink-3); opacity: .55; cursor: pointer; pointer-events: auto; transition: opacity .15s, transform .15s; }
  .rail-mark.k-h2 { height: 4px; background: var(--red); opacity: .9; left: 4px; right: 4px; border-radius: 2px; }
  .rail-mark.k-h3 { left: 9px; right: 9px; border-radius: 2px; } .rail-mark.k-h4 { left: 13px; right: 13px; height: 2px; opacity: .4; } .rail-mark.k-top { height: 6px; background: var(--ink); left: 4px; right: 4px; border-radius: 0 0 3px 3px; margin-top: 0; }
  .rail-mark:hover { opacity: 1; transform: scaleY(1.8); }
  .rail-tip { position: fixed; right: calc(var(--rail-w) + 8px); transform: translateY(-50%); padding: 5px 10px; border-radius: 8px; background: var(--ink); color: var(--surface); font: 700 12px/1.3 var(--font-body); white-space: nowrap; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.25); z-index: 91; }
  .mm, .mm-ball, .mm-rescue, .to-top { right: calc(var(--rail-w) + 14px); }
}
.fight-team img.tr-party-item { width: 32px; height: 32px; image-rendering: pixelated; transform: none; }
.fight-team img.tr-party-item:hover { transform: scale(1.15); }
@media (max-width: 760px) { .fight-team img.tr-party-item { width: 22px; height: 22px; } }
@media (min-width: 900px) { .topbar .tab-nav { flex-wrap: wrap; overflow: visible; mask-image: none; -webkit-mask-image: none; row-gap: 14px; } .topbar .tab-btn { padding: 8px 11px; font-size: 13.5px; } .tab-group { padding: 0 8px 0 5px; } }
.hero .controls { margin-top: 2px; }
:root[data-theme="dark"] .pin:not(.gym):not(.galactic):not(.post):not(.cleared):not(.on):not(.here) .pin-dot { background: #3f6fc4; } :root[data-theme="dark"] .nz-tag, :root[data-theme="dark"] .tab-group[data-group="Nuzlocke"] .tab-btn.active { background: var(--red-dark); }
:root[data-theme="dark"] .mm-stage .pin.on .pin-dot, :root[data-theme="dark"] .pin.here .pin-dot, :root[data-theme="dark"] .pin.on .pin-dot { background: var(--red-dark); }
:root[data-theme="dark"] .tab-group[data-group="Nuzlocke"] .tab-btn.active { color: #fff; }
:root[data-theme="dark"] .pin.galactic .pin-dot { background: #c0281b; }
.pin.post .pin-ic { color: #3a1130; } :root[data-theme="dark"] .pin.post .pin-dot { background: #c95f96; } :root[data-theme="dark"] .pin.post .pin-ic { color: #fff; }
:root[data-theme="dark"] .pin.post .pin-dot { background: #b24a82; }

/* light-theme contrast: muted text now 4.5:1+ on every surface; reds carry white text at 5:1 */
.mu-mini.resist { color: #187a43; } .fact.ok { color: #176b3b; }
.type-badge.all { color: #fff; background: #5f6778; text-shadow: none; }
.nz-tag, .tab-group[data-group="Nuzlocke"] .tab-btn.active { background: var(--red-dark); }
.pin.on .pin-dot, .pin.here .pin-dot, .mm-stage .pin.on .pin-dot { background: var(--red-dark); }
:root[data-theme="dark"] .fact.ok { color: var(--ok); } :root[data-theme="dark"] .mu-mini.resist { color: var(--ok); } :root[data-theme="dark"] .type-badge.all { background: #3a4152; }

/* ===== v11.8 · hidden moves ===== */
.hm-host { margin: 0 0 18px; } .hm-intro { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; } .hm-intro h3 { margin: 0; font: 700 1.25rem var(--font-head); }
.hm-list { display: grid; gap: 10px; }
.hm-card { padding: 14px 16px; border-left: 4px solid var(--acc); }
.hm-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; }
.hm-id { display: grid; gap: 3px; min-width: 0; } .hm-field { font-size: .92rem; color: var(--ink-2); }
.hm-summon { display: grid; justify-items: center; gap: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 4px 10px 6px; color: var(--ink-2); font: 700 11px var(--font-body); cursor: pointer; transition: transform .15s; }
.hm-summon:hover { transform: translateY(-2px); } .hm-summon img { width: 72px; height: 72px; image-rendering: pixelated; transform: scale(1.15); }
.hm-step { display: grid; text-align: center; line-height: 1; padding: 6px 12px; border-radius: 12px; background: var(--gold); color: var(--gold-ink); } .hm-step small { font: 800 .62rem var(--font-body); text-transform: uppercase; letter-spacing: .5px; } .hm-step b { font: 700 1.2rem var(--font-head); }
.hm-body { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.hm-col { display: grid; gap: 4px; align-content: start; } .hm-how { margin: 0; font-size: .9rem; line-height: 1.45; color: var(--ink-2); }
.hm-place, .hm-badge { font-weight: 700; font-size: 1rem; text-align: left; display: inline-flex; align-items: center; gap: 6px; } .hm-badge .gym-badge { width: 28px; height: 28px; }
.tm-spots { margin-top: 6px; }
@media (max-width: 900px) { .hm-body { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .hm-head { grid-template-columns: auto minmax(0, 1fr); } .hm-summon, .hm-step { grid-column: span 1; } .hm-body { grid-template-columns: 1fr; } }
.md-tm { background: #6f35fc; }

/* ===== v11.8 · pins + plan ===== */
.pin-star { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); cursor: pointer; padding: 0; transition: transform .15s, color .15s, border-color .15s; flex: none; }
.pin-star-ic { width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5l-5.9 3.2 1.2-6.6L2.5 9.5l6.6-.9z'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5l-5.9 3.2 1.2-6.6L2.5 9.5l6.6-.9z'/></svg>") center / contain no-repeat; }
.pin-star:hover { transform: scale(1.1); color: var(--ink); border-color: var(--ink); }
.pin-star[aria-pressed="true"] { color: var(--gold-ink); background: var(--gold); border-color: var(--gold); }
.pin-star.pop { animation: starpop .4s cubic-bezier(.34,1.56,.64,1); } @keyframes starpop { 50% { transform: scale(1.35) rotate(-12deg); } }
.pin-star.small { width: 26px; height: 26px; } .pin-star.small .pin-star-ic { width: 14px; height: 14px; }
.pin-star.lbl { width: auto; border-radius: 999px; padding: 0 10px 0 8px; gap: 6px; display: inline-flex; font: 700 12px var(--font-body); }
.plan-gps { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(200px, 1fr) minmax(160px, auto); gap: 10px 14px; align-items: end; margin-bottom: 10px; }
.plan-field { display: grid; gap: 4px; } .plan-sel { width: 100%; }
.plan-route { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); min-height: 48px; }
.plan-sum { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; } .plan-sum b { font: 700 1.05rem var(--font-head); }
.plan-steps { margin: 0; padding: 0 0 0 4px; list-style: none; display: grid; gap: 2px; counter-reset: step; }
.plan-step { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0 4px 26px; position: relative; counter-increment: step; }
.plan-step::before { content: counter(step); position: absolute; left: 0; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--surface); font: 800 11px/20px var(--font-body); text-align: center; }
.plan-step::after { content: ''; position: absolute; left: 9px; top: 24px; bottom: -6px; width: 2px; background: var(--line); } .plan-step.last::after { display: none; }
.plan-step:first-child::before { background: var(--red); color: #fff; } .plan-step.last::before { background: var(--ok); color: #fff; }
.plan-stop { font-weight: 700; font-size: 15px; }
.plan-list { display: grid; gap: 4px; } .plan-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.plan-item.done .plan-item-l { text-decoration: line-through; color: var(--ink-3); } .plan-item-l { font-weight: 700; text-align: left; }
.map-route { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; overflow: visible; }
.route-glow { fill: none; stroke: rgba(255,212,59,.55); stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.route-line { fill: none; stroke: var(--red); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 10 8; vector-effect: non-scaling-stroke; animation: routeflow 1.2s linear infinite; }
@keyframes routeflow { to { stroke-dashoffset: -18; } }
@media (prefers-reduced-motion: reduce) { .route-line { animation: none; } }
@media (max-width: 760px) { .plan-gps { grid-template-columns: 1fr; } .plan-item { grid-template-columns: auto minmax(0, 1fr); } .plan-item .chip { grid-column: 2; justify-self: start; } }
.tr-marks { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; }
.gu-panel-head .pin-star { margin-left: auto; }
.dex-entries { display: grid; gap: 4px; } .dex-entries .dex-flavor { margin: 0; }
.dex-ver { display: inline-block; padding: 1px 7px; border-radius: 999px; font: 800 10px/1.6 var(--font-body); letter-spacing: .5px; vertical-align: middle; margin-right: 2px; }
.dex-ver.bd { background: #2f6fd6; color: #fff; } .dex-ver.sp { background: #c94f9b; color: #fff; }

/* ===== v11.9 — hidden tips & trivia (assets/trivia.js) ===== */
.tv-cat { display: inline-flex; align-items: center; font: 700 11px/1 var(--font-body); letter-spacing: .04em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: var(--tvc-bg, var(--surface-2)); color: var(--tvc-ink, var(--ink-2)); cursor: pointer; white-space: nowrap; }
.tv-cat:hover, .tv-cat:focus-visible { filter: brightness(.96); outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--tvc-ink, var(--ink-3)); }
.c-history { --tvc-bg: #fff1c9; --tvc-ink: #6b4a00; }
.c-design { --tvc-bg: #e3ecfb; --tvc-ink: #24497f; }
.c-sinnoh { --tvc-bg: #dff3e7; --tvc-ink: #14603a; }
.c-mechanic { --tvc-bg: #ebe6fb; --tvc-ink: #4b3a8f; }
.c-pokemon { --tvc-bg: #fbe3ef; --tvc-ink: #7a2f58; }
.c-nuzlocke { --tvc-bg: #fde3df; --tvc-ink: #8a1d12; }
.c-secret { --tvc-bg: #ebebeb; --tvc-ink: #3c3f47; }
:root[data-theme="dark"] .c-history { --tvc-bg: #3a2d08; --tvc-ink: #ffd766; }
:root[data-theme="dark"] .c-design { --tvc-bg: #16304f; --tvc-ink: #9cc1ff; }
:root[data-theme="dark"] .c-sinnoh { --tvc-bg: #0f3a26; --tvc-ink: #7fdba7; }
:root[data-theme="dark"] .c-mechanic { --tvc-bg: #2a2250; --tvc-ink: #c9b8ff; }
:root[data-theme="dark"] .c-pokemon { --tvc-bg: #44203a; --tvc-ink: #f3a7cf; }
:root[data-theme="dark"] .c-nuzlocke { --tvc-bg: #4a1710; --tvc-ink: #ff9f90; }
:root[data-theme="dark"] .c-secret { --tvc-bg: #2a2d36; --tvc-ink: #cfd3dc; }
.tv-go { border: 1px solid var(--line); background: var(--surface); color: var(--info-ink); font: 700 12px/1 var(--font-body); padding: 5px 9px; border-radius: 999px; cursor: pointer; }
.tv-go:hover { background: var(--info-bg); }
.tv-src { font-size: 12px; color: var(--ink-3); text-decoration: underline dotted; text-underline-offset: 2px; }
.tv-src:hover { color: var(--ink); }
/* one-line slot (Pokédex cards, map panel) */
.tv-slot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--gold); font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.tv-slot .tv-bulb { color: var(--warn); font-size: 12px; }
.tv-slot .tv-lead { font: 700 11px/1 var(--font-body); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.tv-slot .tv-text { flex: 1 1 260px; min-width: 0; }
.tv-slot .tv-acts { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-left: auto; }
.tv-slot.in { animation: tv-in .45s ease both; }
@keyframes tv-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* hero line */
.hero-fact { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 14px; align-items: center; margin: 14px 0 0; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink-2); font-size: 14px; line-height: 1.5; opacity: 0; transition: opacity .5s ease; }
.hero-fact.in { opacity: 1; }
.hero-fact-bulb { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--gold-ink); }
.hero-fact-bulb svg { width: 20px; height: 20px; }
.hero-fact-text { margin: 0; min-width: 0; }
.hero-fact-text .tv-cat { margin-right: 4px; vertical-align: 1px; }
.hero-fact-acts { display: inline-flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-self: end; }
@media (max-width: 720px) { .hero-fact { grid-template-columns: auto minmax(0, 1fr); } .hero-fact-acts { grid-column: 2; justify-self: start; } }
/* foot-of-tab card */
.road-tip { margin-top: 22px; border-left: 4px solid var(--gold); padding: 14px 16px; }
.road-tip.in { animation: tv-in .45s ease both; }
.road-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.road-head h3 { margin: 0; font: 700 15px/1.2 var(--font-head); color: var(--ink); }
.road-bulb { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--gold-ink); }
.road-bulb svg { width: 17px; height: 17px; }
.road-text { margin: 0 0 8px; color: var(--ink-2); line-height: 1.55; max-width: 72ch; }
.road-acts { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
/* the Trivia tab */
.tv-tools .card-header h3 { margin: 0; }
.tv-modes { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface-2); }
.tv-mode { border: 0; background: transparent; color: var(--ink-2); font: 700 13px/1 var(--font-body); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.tv-mode.on { background: var(--ink); color: var(--surface); }
:root[data-theme="dark"] .tv-mode.on { background: var(--gold); color: var(--gold-ink); }
.tv-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.tv-search { flex: 1 1 260px; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 14px/1.3 var(--font-body); }
.tv-search:focus { outline: none; box-shadow: 0 0 0 3px var(--info-bg); border-color: var(--blue); }
.tv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.tv-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: var(--tvc-bg); color: var(--tvc-ink); font: 700 12px/1 var(--font-body); padding: 7px 10px; border-radius: 999px; cursor: pointer; opacity: .85; }
.tv-chip b { font-size: 11px; opacity: .85; }
.tv-chip:hover { opacity: 1; }
.tv-chip.on { opacity: 1; border-color: var(--tvc-ink); box-shadow: 0 0 0 2px var(--surface) inset; }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.tv-card { padding: 14px 16px; border-top: 4px solid var(--tvc-ink, var(--line)); display: flex; flex-direction: column; gap: 8px; }
.tv-card-head { display: flex; align-items: center; gap: 8px; }
.tv-card-head .tv-id { margin-left: auto; font-variant-numeric: tabular-nums; }
.tv-q { margin: 0; font: 700 14px/1.4 var(--font-head); color: var(--ink); }
.tv-body { margin: 0; color: var(--ink-2); line-height: 1.55; flex: 1; }
.tv-card-acts { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.tv-card.flash { animation: tv-flash 1.6s ease; }
@keyframes tv-flash { 0% { box-shadow: 0 0 0 0 var(--gold); } 30% { box-shadow: 0 0 0 5px var(--gold); } 100% { box-shadow: var(--shadow); } }
.mod-host.quiz .tv-grid { display: none; }
.tv-quiz { display: none; margin-top: 12px; padding: 14px 16px; }
.mod-host.quiz .tv-quiz { display: block; }
.tv-quiz-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tv-flip { display: grid; min-height: 200px; perspective: 1200px; }
.tv-face { grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 22px 24px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); backface-visibility: hidden; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.tv-front { transform: rotateY(0); }
.tv-back { transform: rotateY(180deg); background: var(--surface); }
.tv-flip.open .tv-front { transform: rotateY(-180deg); }
.tv-flip.open .tv-back { transform: rotateY(0); }
.tv-front .tv-cat { align-self: flex-start; }
.tv-qtext { margin: 0; font: 700 clamp(17px, 2.2vw, 22px)/1.35 var(--font-head); color: var(--ink); text-wrap: balance; }
.tv-front .btn { align-self: flex-start; }
.tv-qlead { margin: 0; font-size: 13px; color: var(--ink-3); }
.tv-qlead .tv-cat { margin-right: 4px; vertical-align: 1px; }
.tv-answer { margin: 0; color: var(--ink); line-height: 1.6; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .tv-face { transition: none; } .tv-slot.in, .road-tip.in, .tv-card.flash { animation: none; } .hero-fact { transition: none; } }
@media (max-width: 600px) { .tv-face { padding: 16px; } .tv-flip { min-height: 260px; } }

/* ===== v12.0 — places everywhere link to the map (assets/places.js) ===== */
.place { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--info-ink); text-decoration: none; border-bottom: 1px dotted currentColor; padding: 0; line-height: inherit; }
.place svg { width: 13px; height: 13px; flex: none; }
.place:hover, .place:focus-visible { color: var(--ink); border-bottom-style: solid; }
.placed .place { font-weight: 600; }
.place-pin { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--info-ink); cursor: pointer; vertical-align: middle; margin-left: 6px; padding: 0; font-size: 13px; line-height: 1; transition: transform .15s ease, background .15s ease; }
.place-pin svg { width: 15px; height: 15px; }
.place-pin:hover, .place-pin:focus-visible { background: var(--info-bg); transform: translateY(-1px); outline: none; }
.place-pin.small { width: 22px; height: 22px; }
.place-pin.small svg { width: 13px; height: 13px; }
.place-here { display: inline-block; vertical-align: middle; margin-left: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: 700 11px/1 var(--font-body); padding: 5px 8px; border-radius: 999px; cursor: pointer; transition: background .15s ease, color .15s ease; }
.place-here:hover, .place-here:focus-visible { background: var(--red-dark); color: var(--red-ink); border-color: var(--red-dark); outline: none; }
.place-here.pop { animation: pin-pop .35s ease; }
@keyframes pin-pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.enc-loc .loc-name { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.tr-loc-head h4 { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.dex-loc-wrap { display: inline-flex; align-items: center; gap: 2px; }
.dex-loc-wrap .place-pin { margin-left: 0; }
.fight-sub .place-pin { margin-left: 2px; }
#tab-e4 h2 .place-pin { vertical-align: 3px; }
:root[data-theme="dark"] .place-pin { background: var(--surface-2); }
@media (prefers-reduced-motion: reduce) { .place-here.pop { animation: none; } }

/* ===== v11.11 — party artwork +25 % (96 → 120 px; roster tiles to match) ===== */
.fight-team { max-width: 560px; }
.tr-party-mon { width: 124px; } .tr-party-mon img:first-child { width: 120px; height: 120px; }
.tr-party-item { top: 82px; right: 4px; width: 34px; height: 34px; }
.tr-party-lv { font-size: 12px; }
.boss-mon img.art { width: 120px; height: 120px; } .boss-mon { min-width: 136px; }
@media (max-width: 760px) { .tr-party-mon { width: 72px; } .tr-party-mon img:first-child { width: 68px; height: 68px; } .tr-party-item { top: 42px; width: 26px; height: 26px; } .boss-mon img.art { width: 90px; height: 90px; } .boss-mon { min-width: 106px; } }
@media (max-width: 760px) {
  /* phones: the party gets its own full-width row under the portrait; the level cap sits top-right beside the name */
  .tr-row.fight > summary.tr-sum { grid-template-areas: "c k p id" "team team team team"; }
  .tr-row.fight .fight-cap { grid-area: team; justify-self: end; align-self: start; }
  .tr-row.fight .fight-team { grid-area: team; max-width: none; justify-content: flex-start; padding-right: 78px; }
}

/* ===== v11.12 — the journey rail: chapter stops, gold fill, a rolling Poké Ball thumb ===== */
html.has-rail { --rail-w: 44px; }
.rail { background: color-mix(in srgb, var(--surface) 88%, var(--bg)); }
.rail-track::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--line); border-radius: 2px; }
.rail-fill { position: absolute; left: 50%; top: 0; width: 3px; margin-left: -1.5px; background: var(--gold); border-radius: 2px; pointer-events: none; z-index: 1; }
.rail-thumb { left: 0; right: 0; background: transparent; border: 0; display: grid; place-items: center; z-index: 4; cursor: grab; }
.rail-thumb:hover, .rail.dragging .rail-thumb { background: transparent; border: 0; }
.rail-ball { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink); background: radial-gradient(circle, #fff 0 3px, var(--ink) 3px 5px, transparent 5px), linear-gradient(var(--red) 0 46%, var(--ink) 46% 54%, #fff 54%); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transform: rotate(var(--roll, 0deg)); transition: transform .08s linear, scale .15s ease; }
.rail-thumb:hover .rail-ball, .rail.dragging .rail-ball { scale: 1.15; box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 55%, transparent), 0 2px 8px rgba(0, 0, 0, .25); }
.rail-marks { z-index: 2; }
.rail-mark { left: 15px; right: 15px; height: 2px; opacity: .35; background: var(--ink-3); }
.rail-mark.k-h2 { left: 12px; right: 12px; height: 3px; background: var(--ink-2); opacity: .55; } .rail-mark.k-h3, .rail-mark.k-h4 { left: 17px; right: 17px; } .rail-mark.k-top { left: 10px; right: 10px; height: 3px; opacity: .6; }
.rail-mark:hover { opacity: 1; transform: scaleY(2); }
.rail-stops { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.rail-stop { position: absolute; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; border: 2px solid var(--ink-3); background: var(--surface); padding: 0; display: grid; place-items: center; cursor: pointer; pointer-events: auto; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), border-color .2s ease, box-shadow .2s ease; }
.rail-stop img { width: 22px; height: 22px; display: block; image-rendering: auto; }
.rail-glyph { font: 800 11px/1 var(--font-head); color: var(--ink-2); letter-spacing: -.02em; }
.rail-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--tvc-ink, var(--ink-3)); }
.rail-stop.k-start { border-color: var(--ok); } .rail-stop.k-start .rail-glyph { color: var(--ok); font-size: 14px; }
.rail-stop.k-league { border-color: var(--gold-ink); background: var(--gold); } .rail-stop.k-league .rail-glyph { color: var(--gold-ink); font-size: 14px; }
.rail-stop.k-post { border-color: var(--pearl); } .rail-stop.k-post .rail-glyph { color: var(--pearl); font-size: 14px; }
.rail-stop.k-champ { background: var(--gold); border-color: var(--gold-ink); } .rail-stop.k-champ .rail-glyph { color: var(--gold-ink); }
.rail-stop:hover { transform: scale(1.2); border-color: var(--ink); z-index: 5; }
.rail-stop.on { transform: scale(1.22); border-color: var(--gold-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 60%, transparent), 0 2px 8px rgba(0, 0, 0, .25); z-index: 5; }
.rail-chap { position: fixed; right: calc(var(--rail-w) + 10px); transform: translateY(-50%); padding: 6px 12px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font: 800 12px/1.2 var(--font-body); letter-spacing: .02em; white-space: nowrap; pointer-events: none; z-index: 91; box-shadow: var(--shadow); }
.rail-chap.in { animation: chap-in .35s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes chap-in { from { opacity: 0; transform: translate(10px, -50%) scale(.9); } to { opacity: 1; transform: translate(0, -50%) scale(1); } }
.rail-spark { position: fixed; z-index: 92; pointer-events: none; color: var(--gold-ink); font-size: 14px; animation: spark .8s ease-out both; }
@keyframes spark { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-18px, -26px) scale(1.2) rotate(40deg); } }
:root[data-theme="dark"] .rail-ball { background: radial-gradient(circle, #fff 0 3px, #0d0f14 3px 5px, transparent 5px), linear-gradient(var(--red) 0 46%, #0d0f14 46% 54%, #e8e8e8 54%); border-color: #0d0f14; }
:root[data-theme="dark"] .rail-stop { background: var(--surface-2); }
@media (prefers-reduced-motion: reduce) { .rail-chap.in, .rail-spark { animation: none; } .rail-ball { transition: none; } }
/* companion map v3: default 640×480, resize from every edge and corner (the native corner grip is gone) */
.mm { resize: none; width: 640px; height: 480px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
.mm-rz { position: absolute; z-index: 6; touch-action: none; }
.mm-rz-n { top: 0; left: 16px; right: 16px; height: 9px; cursor: ns-resize; } .mm-rz-s { bottom: 0; left: 16px; right: 16px; height: 9px; cursor: ns-resize; }
.mm-rz-e { right: 0; top: 16px; bottom: 16px; width: 9px; cursor: ew-resize; } .mm-rz-w { left: 0; top: 16px; bottom: 16px; width: 9px; cursor: ew-resize; }
.mm-rz-ne { top: 0; right: 0; width: 18px; height: 18px; cursor: nesw-resize; } .mm-rz-sw { bottom: 0; left: 0; width: 18px; height: 18px; cursor: nesw-resize; }
.mm-rz-nw { top: 0; left: 0; width: 18px; height: 18px; cursor: nwse-resize; } .mm-rz-se { bottom: 0; right: 0; width: 18px; height: 18px; cursor: nwse-resize; }
.mm-rz-se::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 9px; height: 9px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); border-radius: 0 0 3px 0; opacity: .7; }
.mm:hover .mm-rz-n, .mm:hover .mm-rz-s, .mm:hover .mm-rz-e, .mm:hover .mm-rz-w { background: linear-gradient(var(--gold), var(--gold)) center / 60% 2px no-repeat; opacity: .55; }
.mm-rz-e, .mm-rz-w { background-size: 2px 60% !important; }
.mm.resizing { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 60%, transparent), var(--shadow); } .mm.resizing .mm-stage { pointer-events: none; }
.mm:fullscreen .mm-rz, .mm.fs .mm-rz { display: none; }
@media (max-width: 760px) { .mm { width: min(360px, 94vw); height: 300px; } }

/* ===== v11.13 — what's here: city detail in the place panel + the deep-zoom chip (P8.12) ===== */
.map-detail { margin: 8px 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 0 12px; }
.map-detail > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; font-size: 14px; }
.map-detail > summary::-webkit-details-marker { display: none; }
.map-detail > summary::after { content: "▾"; color: var(--ink-3); font-size: 12px; transition: transform .2s ease; }
.map-detail[open] > summary::after { transform: rotate(180deg); }
.map-detail[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.map-detail-about { margin: 0 0 8px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.map-spots { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; }
.map-spot { border-left: 3px solid var(--gold); padding: 2px 0 2px 10px; }
.map-spot > summary { cursor: pointer; font: 700 13px/1.3 var(--font-body); color: var(--ink); list-style: none; }
.map-spot > summary::-webkit-details-marker { display: none; }
.map-spot > summary::before { content: "›"; display: inline-block; width: 12px; color: var(--ink-3); transition: transform .2s ease; }
.map-spot[open] > summary::before { transform: rotate(90deg); }
.map-spot p { margin: 4px 0 4px 12px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.map-mart { margin: 6px 0 10px; }
.map-mart-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.map-mart-item { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 700 12px/1 var(--font-body); cursor: pointer; }
.map-mart-item img { width: 24px; height: 24px; image-rendering: pixelated; }
.map-mart-item .mi-price { color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.map-mart-item .mi-badge { color: var(--gold-ink); background: var(--gold); border-radius: 999px; padding: 2px 6px; font-size: 10px; }
.map-mart-item.locked { opacity: .62; } .map-mart-item.locked .mi-badge { background: var(--surface-2); color: var(--ink-3); }
.map-mart-item:hover { border-color: var(--ink-3); opacity: 1; }
.map-sign { display: flex; flex-direction: column; gap: 3px; margin: 6px 0 10px; padding: 10px 12px; border-radius: 10px; background: #fdf5d9; border: 1px solid #e3c96b; color: #3b2f00; font: 600 13px/1.5 var(--font-body); }
.map-sign-head { font: 800 11px/1 var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: #6b4a00; }
:root[data-theme="dark"] .map-sign { background: #3a2d08; border-color: #6b4a00; color: #ffe9a6; } :root[data-theme="dark"] .map-sign-head { color: #ffd766; }
.map-explore-btn { font-weight: 800; }
.map-explore { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 7; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 13px/1 var(--font-body); box-shadow: var(--shadow); cursor: pointer; white-space: nowrap; max-width: calc(100% - 120px); }
.map-explore b { color: var(--info-ink); }
.map-explore-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 40%, transparent); }
.map-explore:hover { border-color: var(--ink-3); transform: translateX(-50%) translateY(-1px); }
.map-explore.in { animation: explore-in .4s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes explore-in { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.map-stage.grabbing .map-explore { pointer-events: none; }
@media (max-width: 760px) { .map-explore { top: 8px; font-size: 12px; padding: 7px 10px; max-width: calc(100% - 90px); } .map-explore span:not(.map-explore-dot) { overflow: hidden; text-overflow: ellipsis; } }
@media (prefers-reduced-motion: reduce) { .map-explore.in { animation: none; } }
.map-spot > summary, .map-spot[open] > summary { display: block; font: 700 13px/1.3 var(--font-body); }
.map-spot > summary::before, .map-spot[open] > summary::before { content: "›"; display: inline-block; width: 12px; height: auto; border-radius: 0; background: none; color: var(--ink-3); font: 700 14px/1 var(--font-body); place-items: unset; margin-right: 2px; }
.map-spot[open] > summary::before { transform: rotate(90deg); }
.map-detail > summary::before { width: 20px; height: 20px; font-size: .9rem; }
.map-spot, .map-spot[open] { background: transparent; border: 0; border-left: 3px solid var(--gold); border-radius: 0; padding: 2px 0 2px 10px; margin: 0; box-shadow: none; }
.map-spot > summary { list-style: none; display: flex; align-items: center; gap: 4px; }
.map-spot > summary::marker { content: ""; }
.map-detail, .map-detail[open] { margin: 8px 0 10px; }
.map-detail[open] .map-spot > summary::before, .map-detail[open] .map-spot[open] > summary::before { content: "›"; width: 12px; height: auto; border-radius: 0; background: none; color: var(--ink-3); font: 700 14px/1 var(--font-body); display: inline-block; }
.map-detail[open] .map-spot[open] > summary::before { transform: rotate(90deg); }
:root[data-theme="dark"] .rail-stop.k-league, :root[data-theme="dark"] .rail-stop.k-champ { background: var(--gold); }

/* ===== v11.14 — roster tiles sized to their artwork (no overlap); rail stability ===== */
.boss-team { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
.boss-mon { min-width: 0; }
.boss-mon img.art { max-width: 100%; width: 120px; height: auto; aspect-ratio: 1 / 1; }
.boss-party .boss-team { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
@media (max-width: 760px) { .boss-team { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); } .boss-party .boss-team { grid-template-columns: repeat(3, 1fr); } .boss-mon img.art { width: 90px; } }

/* ===== v11.15 — playful fx (P8.13): bursts, stamps, the catch, runner v2, heading underlines ===== */
.fx-burst { position: fixed; z-index: 130; pointer-events: none; font-weight: 800; line-height: 1; transform: translate(-50%, -50%); animation: fx-burst .9s cubic-bezier(.2, .7, .3, 1) both; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
@keyframes fx-burst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1) rotate(var(--r)); } }
.fx-stamp { animation: fx-stamp .6s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes fx-stamp { 0% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 70%, transparent); } 35% { transform: scale(1.025); box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 45%, transparent); } 100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; } }
.enc-row { position: relative; }
.fx-ball { position: absolute; right: 14px; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; border: 2px solid var(--ink); z-index: 3; pointer-events: none; transform-origin: 50% 90%;
  background: radial-gradient(circle, #fff 0 3px, var(--ink) 3px 5px, transparent 5px), linear-gradient(var(--red) 0 46%, var(--ink) 46% 54%, #fff 54%); animation: fx-catch 1.5s ease-in-out both; }
.fx-ball.shiny { background: radial-gradient(circle, #fff 0 3px, var(--ink) 3px 5px, transparent 5px), linear-gradient(var(--gold) 0 46%, var(--ink) 46% 54%, #fff 54%); }
@keyframes fx-catch { 0% { opacity: 0; transform: translateY(-26px) scale(.6); } 18% { opacity: 1; transform: translateY(0) scale(1); } 30% { transform: rotate(-18deg); } 42% { transform: rotate(18deg); } 54% { transform: rotate(-14deg); } 66% { transform: rotate(12deg); } 76% { transform: rotate(0); } 86% { transform: scale(1.15); } 100% { opacity: 0; transform: scale(.9); } }
.runner-dust { position: fixed; z-index: 20; width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--ink-3) 55%, transparent); pointer-events: none; animation: fx-dust .5s ease-out both; }
@keyframes fx-dust { 0% { opacity: .7; transform: scale(.5); } 100% { opacity: 0; transform: translate(-10px, -8px) scale(1.6); } }
.scroll-runner.jump { animation: fx-jump .6s cubic-bezier(.34, 1.56, .64, 1); }
.scroll-runner.back.jump { animation: fx-jump-back .6s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes fx-jump { 0% { transform: translateY(0); } 40% { transform: translateY(-22px) rotate(-8deg); } 70% { transform: translateY(0) scale(1.05, .92); } 100% { transform: none; } }
@keyframes fx-jump-back { 0% { transform: scaleX(-1) translateY(0); } 40% { transform: scaleX(-1) translateY(-22px) rotate(8deg); } 70% { transform: scaleX(-1) translateY(0) scale(1.05, .92); } 100% { transform: scaleX(-1); } }
.scroll-runner.look { animation: fx-look 1.4s ease-in-out; } .scroll-runner.back.look { animation: fx-look-back 1.4s ease-in-out; }
@keyframes fx-look { 0%, 100% { transform: none; } 30% { transform: rotate(-7deg) translateY(-2px); } 65% { transform: rotate(6deg); } }
@keyframes fx-look-back { 0%, 100% { transform: scaleX(-1); } 30% { transform: scaleX(-1) rotate(7deg) translateY(-2px); } 65% { transform: scaleX(-1) rotate(-6deg); } }
.runner-say { position: absolute; top: -58px; left: clamp(0px, var(--x, 0%), calc(100% - 40px)); transform: translate(-40%, 6px); max-width: min(320px, 70vw); padding: 8px 12px; border-radius: 12px; background: var(--ink); color: var(--surface); font: 600 12px/1.4 var(--font-body); pointer-events: none; opacity: 0; transition: opacity .25s ease, transform .25s cubic-bezier(.34, 1.56, .64, 1); z-index: 22; box-shadow: var(--shadow); }
.runner-say::after { content: ""; position: absolute; left: 44%; bottom: -6px; border: 6px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.runner-say.in { opacity: 1; transform: translate(-40%, 0); }
:root[data-theme="dark"] .runner-say { background: var(--gold); color: var(--gold-ink); } :root[data-theme="dark"] .runner-say::after { border-top-color: var(--gold); }
.tab-panel > h2.reveal { position: relative; } .tab-panel > h2.reveal::after { content: ""; position: absolute; left: 0; bottom: -6px; height: 4px; width: 0; border-radius: 2px; background: var(--gold); transition: width .6s cubic-bezier(.2, .8, .2, 1) .15s; }
.tab-panel > h2.reveal.in::after { width: 56px; }
.tr-loc-head.reveal { transform: translate3d(0, 10px, 0); } .tr-loc-head.reveal.in { transform: none; }
html.has-rail .scroll-progress, html.has-rail .scroll-ball { display: none; }   /* the journey rail carries progress on desktop */
@media (max-width: 760px) { .runner-say { top: -52px; font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { .fx-burst, .fx-ball, .runner-dust { display: none; } .fx-stamp, .scroll-runner.jump, .scroll-runner.look { animation: none; } .tab-panel > h2.reveal::after { transition: none; width: 56px; } }
/* sticky top bar restored: with html { overflow-x: clip } the body must not be a scroll container (body overflow-x hidden broke position: sticky since v11.7) */
body { overflow-x: visible; }
/* gifts & trades in the place panel */
.map-gifts { margin: 6px 0 10px; }
.map-gift-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.map-gift { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.map-gift:hover { border-color: var(--ink-3); }
.map-gift img { width: 40px; height: 40px; image-rendering: pixelated; }
.map-gift .mg-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; } .map-gift .mg-body b { font-size: 13px; } .map-gift .mg-body .meta-note { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-gift .mg-tag { font: 800 10px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 999px; background: var(--info-bg); color: var(--info-ink); }
.map-gift .mg-tag.gift { background: var(--ok-bg); color: var(--ok); }
:root[data-theme="dark"] .map-gift .mg-tag.gift { background: #0f3a26; color: #7fdba7; }

/* ===== v11.18 — audit fixes: names wrap on phones, Gym summaries use artwork tiles, bigger tap targets ===== */
.fight-name { flex-wrap: wrap; min-width: 0; } .fight-name > strong { min-width: 0; overflow-wrap: anywhere; }
.fight-sub { min-width: 0; overflow-wrap: anywhere; }
#gyms details.fight > summary .fight-team.tr-party { gap: 6px; }
@media (max-width: 760px) {
  #gyms details.fight > summary { grid-template-areas: "c p id" "team team team"; }
  #gyms details.fight > summary .fight-team { grid-area: team; max-width: none; justify-content: flex-start; padding-right: 78px; }
  #gyms details.fight > summary .fight-cap { grid-area: team; justify-self: end; align-self: start; }
}
@media (pointer: coarse) {
  .linkish, .tv-src, .place { padding-block: 5px; margin-block: -5px; }      /* ≥ 30 px tap height without moving the layout */
  .gu-pin::after { content: ""; position: absolute; inset: -8px; }
  .gu-pin { position: relative; }
  .tr-check input { width: 20px; height: 20px; }
}
/* v11.19 — experience per fight */
.tr-exp b, .gym-exp b { color: var(--info-ink); font-weight: 800; }
:root[data-theme="dark"] .tr-exp b, :root[data-theme="dark"] .gym-exp b { color: #9cc1ff; }
/* v11.20 — the level planner (“Will I make the cap?”) on the Trainers tab */
.tr-plan { padding: 0; }
.tr-plan > summary.tr-plan-sum { list-style: none; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 14px 18px; cursor: pointer; font-size: 15px; }
.tr-plan > summary.tr-plan-sum::-webkit-details-marker { display: none; }
.tr-plan > summary.tr-plan-sum::before { content: none; }
.tr-plan > summary.tr-plan-sum .meta-note { flex: 1 1 260px; min-width: 0; }
.tr-plan-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--gold); color: #3b2f00; font: 900 15px/1 var(--font-body); flex: 0 0 auto; }
.tr-plan[open] > summary.tr-plan-sum { border-bottom: 1px solid var(--line); }
.tr-plan-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 14px 18px 4px; }
.tr-plan-row .field { min-width: 0; width: auto; flex: 0 1 auto; }
.tr-plan-row select.field { max-width: 100%; flex-basis: 215px; }
.tr-plan-row input[list] { flex-basis: 170px; }
.tr-plan-steps > summary::before { content: "+"; background: var(--ink); }
.tr-plan-steps[open] > summary::before { content: "–"; background: var(--red); }
.tr-plan-lvl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.tr-plan-lv { width: 72px; }
.tr-plan-out { padding: 8px 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.tr-plan-out .body-text { margin: 0; }
.tr-plan-bar { height: 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.tr-plan-fill { height: 100%; width: 0; background: var(--warn, #d08a00); transition: width .5s ease; }
.tr-plan-fill.ok { background: var(--ok); }
.tr-plan-steps { border: 1px solid var(--line); border-radius: 12px; padding: 0; margin: 0; background: var(--surface-2); }
.tr-plan-steps > summary { padding: 8px 12px; font-weight: 700; font-size: 13px; cursor: pointer; }
.tr-plan-list { margin: 0; padding: 4px 12px 10px 34px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.tr-plan-list li.cap { font-weight: 800; }
.tr-plan-list li.cap::marker { color: var(--ok); }
.tr-plan-list li.cap .meta-note { color: var(--ok); font-weight: 700; }
.tr-plan-list li.over { opacity: .55; }
.tr-plan-list li.over .linkish { text-decoration-style: dotted; }
@media (max-width: 760px) {
  .tr-plan > summary.tr-plan-sum, .tr-plan-row, .tr-plan-out { padding-left: 14px; padding-right: 14px; }
  .tr-plan-row .field { flex: 1 1 100%; }
  .tr-plan-row .field.tr-plan-lv { flex: 0 0 72px; }
  .tr-plan-row .tv-modes { flex: 1 1 auto; justify-content: center; }
  .tr-plan-row .btn { flex: 1 1 100%; }
}
/* v11.21 — order the trainer list: story order, or ranked by Exp / prize / level on one flat list */
.tr-sort-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.tr-tools .tr-sort-lbl .field { flex: 0 1 auto; width: auto; padding-block: 7px; }
.tr-ranked .tr-rows { padding-top: 6px; }
.tr-row.ranked { position: relative; }
.tr-row.ranked::before { content: "#" attr(data-rank); position: absolute; top: -9px; left: 14px; z-index: 2; font: 800 11px/1 var(--font-body); letter-spacing: .04em; padding: 4px 8px; border-radius: 999px; background: var(--gold); color: #3b2f00; border: 2px solid var(--surface); }
@media (max-width: 760px) { .tr-tools .tr-sort-lbl { flex: 1 1 100%; } .tr-tools .tr-sort-lbl .field { flex: 1 1 auto; } }
/* v11.22 — ranked list lands below the sticky bar; once-a-day badge */
.tr-ranked, .tr-loc { scroll-margin-top: 120px; }
@media (max-width: 760px) { .tr-ranked, .tr-loc { scroll-margin-top: 150px; } }
/* v11.23/24 — post-game switch in the sticky bar: html.hide-post hides every .post-only element */
html.hide-post .post-only { display: none !important; }
.topbar .post-switch { position: sticky; right: 0; z-index: 3; flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 4px 8px 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: 700 .8rem/1 var(--font-body); cursor: pointer; box-shadow: -14px 0 12px -8px var(--surface); }
.topbar .post-switch:hover { border-color: var(--ink-3); color: var(--ink); }
.topbar .post-switch:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.post-switch .ps-ic { font-size: 13px; color: var(--ok); line-height: 1; }
.post-switch.off .ps-ic { color: var(--ink-3); }
.post-switch .ps-track { position: relative; width: 30px; height: 16px; border-radius: 999px; background: var(--ok); transition: background .2s ease; flex: none; }
.post-switch .ps-knob { position: absolute; top: 2px; left: 16px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .2s cubic-bezier(.34,1.56,.64,1); }
.post-switch.off .ps-track { background: var(--ink-3); }
.post-switch.off .ps-knob { left: 2px; }
.post-switch.off .ps-lbl { text-decoration: line-through; text-decoration-color: var(--ink-3); text-decoration-thickness: 2px; }
@media (max-width: 760px) { .topbar .post-switch { padding: 4px 6px 4px 8px; gap: 5px; min-height: 32px; } .post-switch .ps-lbl { display: none; } }
@media (prefers-reduced-motion: reduce) { .post-switch .ps-knob, .post-switch .ps-track { transition: none; } }
/* v11.24 — "Where the Exp is" card on the Trainers tab */
.tr-exp-card { padding: 0; }
.tr-exp-card > summary.tr-plan-sum { list-style: none; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 14px 18px; cursor: pointer; font-size: 15px; }
.tr-exp-card > summary.tr-plan-sum::-webkit-details-marker { display: none; }
.tr-exp-card > summary.tr-plan-sum::before { content: none; }
.tr-exp-card > summary.tr-plan-sum .meta-note { flex: 1 1 260px; min-width: 0; }
.tr-exp-card[open] > summary.tr-plan-sum { border-bottom: 1px solid var(--line); }
.tr-exp-ic { background: var(--ink); color: var(--gold); }
.tr-exp-body { padding: 12px 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.tr-exp-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px 28px; }
.tr-exp-col { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tr-exp-col .gym-h4 { margin: 0; }
.tr-exp-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.tr-exp-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.tr-exp-row:first-child { border-top: 0; }
.tr-exp-rank { font: 800 11px/1 var(--font-body); color: var(--ink-3); text-align: right; }
.tr-exp-who { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.tr-exp-who .linkish { font-weight: 700; }
.tr-exp-tiers { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 2px; }
.tr-exp-val { color: var(--info-ink); font-weight: 800; white-space: nowrap; }
:root[data-theme="dark"] .tr-exp-val { color: #9cc1ff; }
.chip.tiny { font-size: 11px; padding: 2px 7px; min-height: 0; line-height: 1.3; }
.chip.tiny.post { border-style: dashed; color: var(--ink-3); }
.tr-exp-more { align-self: flex-start; margin-top: 4px; font-size: 13px; }
@media (max-width: 760px) { .tr-exp-card > summary.tr-plan-sum, .tr-exp-body { padding-left: 14px; padding-right: 14px; } }
/* v11.25 — "More filters" on the Trainers tab */
.tr-more { margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.tr-more > summary.tr-more-sum { list-style: none; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 9px 12px; cursor: pointer; font: 700 13px/1.3 var(--font-body); color: var(--ink); }
.tr-more > summary.tr-more-sum::-webkit-details-marker { display: none; }
.tr-more > summary.tr-more-sum::before { content: "+"; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: var(--surface); font-weight: 800; font-size: 12px; flex: none; }
.tr-more[open] > summary.tr-more-sum::before { content: "–"; background: var(--red); }
.tr-more > summary .meta-note { font-weight: 500; }
.tr-more-badge { font: 800 10px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 999px; background: var(--gold); color: #3b2f00; }
.tr-more.has { border-color: var(--gold); }
.tr-more-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 6px 10px; align-items: center; padding: 6px 12px; border-top: 1px solid var(--line); }
.tr-more-lbl { font: 800 11px/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.tr-more-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.tr-more-ctl .tr-filters { margin: 0; }
.tr-more-sel { width: auto; max-width: 100%; flex: 0 1 240px; padding-block: 7px; }
.tr-more-hides { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.tr-more-lv { width: 76px; flex: 0 0 auto; padding-block: 7px; }
.tr-more-types { display: flex; flex-wrap: wrap; gap: 4px; }
.tr-more-types .type-chip img { display: block; width: 72px; height: auto; }
.tr-more-mode .tv-mode, .tr-more .tv-modes .tv-mode { font-size: 12px; padding: 6px 11px; }
.tr-more-foot { padding: 8px 12px 10px; border-top: 1px solid var(--line); font-size: 13px; }
@media (max-width: 760px) { .tr-more-row { grid-template-columns: 1fr; gap: 4px; } .tr-more-sel { flex-basis: 100%; } .tr-more-types .type-chip img { width: 60px; } }
.tr-more-kinds .chip.on { background: var(--surface); color: var(--ink); border-color: var(--line); }
.tr-more-kinds .chip.on::before { content: "✓ "; color: var(--ok); font-weight: 800; }
.tr-more-kinds .chip:not(.on) { opacity: .5; text-decoration: line-through; text-decoration-thickness: 2px; }
/* v11.26 — the theme eclipse: the new theme grows out of the button as a circle (View Transitions where available,
   a clip-path wipe overlay elsewhere); the button's moon/sun turns over */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2147483646; }
.theme-wipe { position: fixed; inset: 0; z-index: 2147483645; pointer-events: none; will-change: clip-path, opacity; }
.theme-btn { display: inline-flex; align-items: center; gap: 7px; }
.theme-btn .tb-ic { display: inline-grid; place-items: center; width: 18px; height: 18px; font-size: 15px; line-height: 1; transition: transform .6s cubic-bezier(.34,1.56,.64,1); }
.theme-btn.flip .tb-ic { transform: rotate(360deg); }
@media (prefers-reduced-motion: reduce) { .theme-btn .tb-ic { transition: none; } }
/* v11.26 — off-screen trainer cards skip layout and paint (content-visibility): faster scrolling and a cheaper theme flip */
.tr-rows > .tr-row { content-visibility: auto; contain-intrinsic-size: auto 168px; }
@media (max-width: 760px) { .tr-rows > .tr-row { contain-intrinsic-size: auto 300px; } }

/* ---------- featured setups (featured.js) — real runs, every number; light first ---------- */
.fs-list { display: grid; gap: 22px; }
.fs-setup.card { padding: 18px 18px 14px; border-top: 6px solid var(--acc); --acc: var(--blue); }
.fs-setup.st-hall-of-fame { --acc: var(--gold); }
.fs-setup.st-in-prep { --acc: var(--pearl); }
.fs-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.fs-logo { width: 120px; height: auto; flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.15)); }
.fs-head-text { flex: 1 1 260px; min-width: 0; }
.fs-title { margin: 0 0 6px; font-size: 1.35rem; line-height: 1.2; text-wrap: balance; }
.fs-meta, .fs-meta2 { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--ink-2); font-size: .92rem; }
.fs-meta2 { margin-top: 4px; font-size: .86rem; color: var(--ink-3); }
.fs-status { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: .8rem; letter-spacing: .02em; text-transform: uppercase; border: 1.5px solid transparent; }
.fs-status.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.fs-status.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.fs-status.info { background: var(--info-bg); color: var(--info-ink); }
.fs-status.bad { background: var(--bad-bg); color: var(--bad); }
.fs-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.fs-summary { color: var(--ink-2); margin: 12px 0 4px; max-width: 78ch; }
.fs-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin: 14px 0 4px; }
.fs-mon.card { margin: 0; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.fs-mon-top { display: flex; gap: 12px; align-items: flex-start; }
.fs-art-btn { border: 0; background: none; padding: 0; cursor: pointer; flex: none; border-radius: 12px; }
.fs-art { width: 84px; height: 84px; object-fit: contain; display: block; }
.fs-art.px { image-rendering: pixelated; }
.fs-mon-id { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.fs-mon-name { margin: 0; font-size: 1.12rem; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.fs-name { font-size: 1.12rem; text-decoration: none; color: var(--ink); }
.fs-name:hover { text-decoration: underline; }
.fs-nick { color: var(--ink-3); font-weight: 600; font-size: .9rem; }
.fs-line { font-size: .9rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.fs-line .linkish { font-weight: 700; }
.fs-dot { color: var(--ink-3); }
.fs-dim { color: var(--ink-3); }
.fs-item { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .9rem; color: var(--ink-2); }
.fs-item-why { color: var(--ink-3); }
.fs-stats-head { display: flex; justify-content: space-between; align-items: baseline; font-size: .82rem; color: var(--ink-3); margin-top: 2px; }
.fs-stats-lv { font-weight: 800; color: var(--ink-2); }
.fs-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.fs-stat { display: flex; flex-direction: column; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 2px; }
.fs-stat-l { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.fs-stat-v { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1rem; color: var(--ink); }
.fs-now { margin: 0; font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fs-moves { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fs-move { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: .95rem; padding: 4px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.fs-move .linkish { text-decoration: none; color: var(--ink); }
.fs-move .linkish:hover { text-decoration: underline; }
.fs-move.new { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); background: var(--warn-bg); }
.fs-move.planned { border-style: dashed; }
.fs-tag { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 999px; }
.fs-tag.new { background: var(--warn); color: #fff; }
.fs-tag.planned { background: var(--surface); color: var(--ink-3); border: 1px solid var(--line); text-transform: none; letter-spacing: 0; }
.fs-move-sub { font-size: .8rem; color: var(--ink-3); flex-basis: 100%; }
.fs-role { margin: 0; font-size: .9rem; color: var(--ink-2); }
.fs-note { margin: 0; font-size: .85rem; color: var(--ink-3); border-left: 3px solid var(--line); padding-left: 8px; }
.fs-panels { display: grid; gap: 10px; margin-top: 14px; }
.fs-acc { border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 0; }
.fs-acc > summary { cursor: pointer; padding: 10px 14px; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.fs-acc > summary::-webkit-details-marker { display: none; }
.fs-acc > summary::before { content: "▸"; color: var(--ink-3); margin-right: 4px; transition: transform .2s; display: inline-block; }
.fs-acc[open] > summary::before { transform: rotate(90deg); }
.fs-acc.warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); background: var(--warn-bg); }
.fs-acc > :not(summary) { padding: 0 14px 12px; }
.fs-lines { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .92rem; color: var(--ink-2); }
.fs-acc > .fs-lines { padding: 0 14px 12px 32px; }
.fs-fights { display: grid; gap: 12px; }
.fs-fight { border-top: 1px solid var(--line); padding-top: 10px; }
.fs-fight:first-child { border-top: 0; padding-top: 0; }
.fs-fight-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-bottom: 6px; }
.fs-boss { font-weight: 800; font-size: 1.02rem; color: var(--ink); }
.fs-lead { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: .92rem; }
.fs-lead-img { width: 32px; height: 32px; image-rendering: pixelated; }
.fs-fight-items { font-size: .84rem; color: var(--warn); font-weight: 700; background: var(--warn-bg); border-radius: 999px; padding: 2px 10px; }
.fs-bag { width: 100%; border-collapse: collapse; font-size: .92rem; }
.fs-bag th, .fs-bag td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.fs-bag th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.fs-bag td.num { font-variant-numeric: tabular-nums; font-weight: 800; text-align: right; }
.fs-bench { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fs-bench li { display: grid; grid-template-columns: 40px 1fr; gap: 4px 10px; align-items: center; font-size: .92rem; }
.fs-bench img { image-rendering: pixelated; }
.fs-bench-name { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.fs-bench-why { grid-column: 2; color: var(--ink-3); font-size: .85rem; }
.fs-foot { margin: 12px 0 0; }
.fs-flash { animation: fs-flash 1.4s ease-out; }
@keyframes fs-flash { 0% { box-shadow: 0 0 0 4px var(--gold); } 100% { box-shadow: var(--shadow); } }
@media (max-width: 480px) {
  .fs-setup.card { padding: 14px 12px 12px; }
  .fs-logo { width: 96px; }
  .fs-team { grid-template-columns: 1fr; }
  .fs-stats { grid-template-columns: repeat(3, 1fr); }
  .fs-art { width: 72px; height: 72px; }
  .fs-bag th:nth-child(3), .fs-bag td:nth-child(3) { font-size: .84rem; }
}
:root[data-theme="dark"] .fs-tag.new { color: #1a1200; }
:root[data-theme="dark"] .fs-logo { filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }

/* ---------- battle replay (v11.29) — light-first; dark follows the theme tokens ---------- */
:root { --rp-sky: #eaf2fb; --rp-sky-2: #f6f9fd; --rp-ground: #e9e4d3; --rp-ground-2: #d9d2bd; --rp-stand: rgba(31, 36, 48, .14); --rp-grid: rgba(52, 102, 175, .08); }
:root[data-theme="dark"] { --rp-sky: #1a2233; --rp-sky-2: #151a26; --rp-ground: #2a2a24; --rp-ground-2: #1f1f1a; --rp-stand: rgba(0, 0, 0, .45); --rp-grid: rgba(111, 155, 224, .08); }
.rp-honest { margin: 10px 0 14px; }
.rp-controls, .rp-transport { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.rp-sel, .rp-seed { border: 2px solid var(--ring); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 7px 10px; font: 600 .86rem var(--font-body); max-width: 100%; }
.rp-sel { appearance: none; padding-right: 26px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.rp-sel:focus, .rp-seed:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }
.rp-seed { width: 7.5em; font-variant-numeric: tabular-nums; }
.rp-seedwrap { display: inline-flex; align-items: center; gap: 6px; font: 600 .86rem var(--font-body); color: var(--ink-2); }
.rp-check { display: inline-flex; align-items: center; gap: 4px; font: 600 .86rem var(--font-body); color: var(--ink-2); padding: 6px 8px; border: 2px solid var(--ring); border-radius: 10px; background: var(--surface); }
.rp-check input { accent-color: var(--blue); margin: 0; }
.rp-transport .rp-turn { margin-left: auto; font: 700 .95rem var(--font-head); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rp-bosshead { display: flex; align-items: center; gap: 10px; min-height: 40px; margin: 4px 0 8px; }
.rp-trainer { width: 56px; height: 56px; object-fit: contain; image-rendering: auto; filter: drop-shadow(0 2px 2px rgba(0,0,0,.18)); }
.rp-title { font: 700 1.25rem var(--font-head); color: var(--ink); }
.rp-arena { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.rp-stage { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 8px 12px; min-height: 400px; padding: 18px 16px 14px;
  border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, var(--rp-sky) 0%, var(--rp-sky-2) 48%, var(--rp-ground) 52%, var(--rp-ground-2) 100%); box-shadow: var(--shadow); }
.rp-stage::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(var(--rp-grid) 1px, transparent 1px), linear-gradient(90deg, var(--rp-grid) 1px, transparent 1px); background-size: 28px 28px; opacity: .6; }
.rp-stage.has-tr { border-color: var(--pearl); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--pearl) 45%, transparent), var(--shadow); }
.rp-stage.has-sand::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: repeating-linear-gradient(115deg, rgba(201, 170, 90, .18) 0 2px, transparent 2px 9px); animation: rp-sand 1.6s linear infinite; }
.rp-stage.won { animation: rp-won 1.4s ease; }
.rp-slot { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 10px; min-width: 0; }
.rp-them { grid-column: 2; grid-row: 1; justify-self: end; }
.rp-us { grid-column: 1; grid-row: 2; justify-self: start; }
.rp-them .rp-panel { order: 0; } .rp-them .rp-stand { order: 1; }
.rp-slot.empty { visibility: hidden; }
.rp-stand { position: relative; width: 172px; height: 172px; flex: none; display: grid; place-items: end center; }
.rp-shadow { position: absolute; left: 50%; bottom: 6px; width: 120px; height: 26px; transform: translateX(-50%); border-radius: 50%; background: var(--rp-stand); filter: blur(2px); }
.rp-art { position: relative; width: 160px; height: 160px; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(0,0,0,.18)); transition: filter .4s, transform .4s, opacity .4s; }
.rp-art.px { image-rendering: pixelated; }
.rp-them .rp-art { transform: scaleX(-1); }
.rp-fx { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.rp-panel { min-width: 0; width: 210px; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px 9px; box-shadow: var(--shadow); }
.rp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rp-name { font: 700 1rem var(--font-head); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-lv { font: 700 .78rem var(--font-body); color: var(--ink-3); white-space: nowrap; }
.rp-hpbar { height: 10px; margin: 6px 0 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.rp-hpfill { height: 100%; width: 100%; background: var(--ok); border-radius: 999px; transition: width .55s cubic-bezier(.3,.8,.3,1), background-color .3s; }
.rp-hpfill.mid { background: var(--gold); } .rp-hpfill.low { background: var(--bad); }
.rp-hpfill.instant { transition: none; }
.rp-hptext { display: block; font: 600 .78rem var(--font-body); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rp-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; min-height: 0; }
.rp-chip { font: 700 .68rem var(--font-body); padding: 2px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.rp-chip.up { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.rp-chip.down { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.rp-chip.item { color: var(--ink-3); }
.rp-chip.sub { background: var(--info-bg); color: var(--info-ink); border-color: transparent; }
.rp-chip.st-brn { background: #fde3d4; color: #a33a0c; border-color: transparent; }
.rp-chip.st-psn, .rp-chip.st-tox { background: #efdcf3; color: #7a2f84; border-color: transparent; }
.rp-chip.st-par { background: #fff3c4; color: #7a5a00; border-color: transparent; }
.rp-chip.st-slp { background: #e3e3ea; color: #4a4a62; border-color: transparent; }
:root[data-theme="dark"] .rp-chip.st-brn { background: #4a2616; color: #ffb48a; }
:root[data-theme="dark"] .rp-chip.st-psn, :root[data-theme="dark"] .rp-chip.st-tox { background: #3d2142; color: #e2a9ee; }
:root[data-theme="dark"] .rp-chip.st-par { background: #44380f; color: #ffe08a; }
:root[data-theme="dark"] .rp-chip.st-slp { background: #2e2e3c; color: #c9c9dc; }
.rp-fieldchips { position: absolute; top: 10px; left: 12px; z-index: 4; display: flex; flex-wrap: wrap; gap: 6px; max-width: 60%; }
.rp-fchip { font: 700 .7rem var(--font-body); padding: 3px 9px; border-radius: 999px; border: 1px solid transparent; background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow); }
.rp-fchip.light { color: #6a5400; background: #fff6cf; } .rp-fchip.reflect { color: #24497f; background: #e2ecfb; }
.rp-fchip.tr { color: #7a2f84; background: #f3e1f6; } .rp-fchip.sand { color: #6e5214; background: #f3e6c3; }
:root[data-theme="dark"] .rp-fchip.light { color: #ffe08a; background: #44380f; } :root[data-theme="dark"] .rp-fchip.reflect { color: #a9c6f2; background: #1b2a40; }
:root[data-theme="dark"] .rp-fchip.tr { color: #e2a9ee; background: #3d2142; } :root[data-theme="dark"] .rp-fchip.sand { color: #f2d48a; background: #3f3214; }
/* effects */
.rp-fxi { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; }
.rp-fxi.hit { background: radial-gradient(circle, color-mix(in srgb, var(--c) 70%, #fff) 0%, color-mix(in srgb, var(--c) 45%, transparent) 40%, transparent 70%); animation: rp-hit .7s ease-out forwards; }
.rp-fxi.hit.physical::after { content: ""; position: absolute; inset: 30%; border-radius: 4px; background: color-mix(in srgb, var(--c) 85%, #fff); transform: rotate(45deg); animation: rp-smack .45s ease-out forwards; }
.rp-fxi.glow { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); animation: rp-glow .7s ease-out forwards; }
.rp-fxi.item { width: 60px; height: 60px; display: grid; place-items: center; animation: rp-item .9s ease-out forwards; }
.rp-fxi.item img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.rp-beam { position: absolute; left: 50%; top: 50%; width: 46%; height: 10px; margin-top: -5px; border-radius: 999px; z-index: 2; pointer-events: none; transform-origin: left center;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--c) 85%, #fff) 35%, var(--c) 70%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 60%, transparent); animation: rp-beam .6s ease-out forwards; }
.rp-beam.to-them { transform: translate(-30%, 20%) rotate(-24deg) scaleX(0); }
.rp-beam.to-us { transform: translate(-70%, -20%) rotate(156deg) scaleX(0); }
.rp-pop { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); z-index: 5; font: 800 1.05rem var(--font-head); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; white-space: nowrap; box-shadow: var(--shadow); animation: rp-pop 1.3s ease-out forwards; pointer-events: none; }
.rp-pop.crit { color: var(--red-ink); background: var(--red); border-color: var(--red-dark); font-size: 1.2rem; }
.rp-pop.se { color: var(--warn); } .rp-pop.nve { color: var(--ink-3); font-size: .9rem; }
.rp-pop.heal, .rp-pop.up { color: var(--ok); } .rp-pop.down { color: var(--bad); }
.rp-pop.status { color: var(--info-ink); background: var(--info-bg); }
.rp-pop.death { color: #fff; background: var(--bad); border-color: var(--bad); font-size: .95rem; top: 6%; }
.rp-pop.ko { color: var(--ink-2); } .rp-pop.miss, .rp-pop.zzz { color: var(--ink-3); font-size: .9rem; }
.rp-pop.note { color: var(--warn); top: 40%; font-size: .85rem; }
.rp-stand.in .rp-art { animation: rp-in .6s cubic-bezier(.2,.9,.3,1.2); }
.rp-stand.out .rp-art { opacity: 0; transform: translateY(16px) scale(.7); }
.rp-them .rp-stand.out .rp-art { transform: translateY(16px) scale(-.7, .7); }
.rp-stand.lunge .rp-art { animation: rp-lunge .5s ease-out; }
.rp-them .rp-stand.lunge .rp-art { animation: rp-lunge-them .5s ease-out; }
.rp-stand.shake .rp-art { animation: rp-shake .5s ease-in-out; }
.rp-them .rp-stand.shake .rp-art { animation: rp-shake-them .5s ease-in-out; }
.rp-stand.gone .rp-art { opacity: 0; transition: none; }
.rp-stand.faint .rp-art { opacity: 0; transform: translateY(60px) scale(.9); filter: grayscale(1); transition: opacity .8s ease-in, transform .8s ease-in, filter .5s; }
.rp-them .rp-stand.faint .rp-art { transform: translateY(60px) scale(-.9, .9); }
@keyframes rp-in { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.rp-them .rp-stand.in .rp-art { animation-name: rp-in-them; }
@keyframes rp-in-them { from { opacity: 0; transform: scale(-.4, .4); } to { opacity: 1; transform: scaleX(-1); } }
@keyframes rp-lunge { 0% { transform: none; } 35% { transform: translate(34px, -22px); } 100% { transform: none; } }
@keyframes rp-lunge-them { 0% { transform: scaleX(-1); } 35% { transform: translate(-34px, 22px) scaleX(-1); } 100% { transform: scaleX(-1); } }
@keyframes rp-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(5px); } }
@keyframes rp-shake-them { 0%, 100% { transform: scaleX(-1); } 20% { transform: translateX(-9px) scaleX(-1); } 40% { transform: translateX(8px) scaleX(-1); } 60% { transform: translateX(-6px) scaleX(-1); } 80% { transform: translateX(5px) scaleX(-1); } }
@keyframes rp-hit { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); } }
@keyframes rp-smack { 0% { opacity: 1; transform: rotate(45deg) scale(.4); } 100% { opacity: 0; transform: rotate(45deg) scale(1.6); } }
@keyframes rp-glow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 65%, transparent); opacity: 1; } 100% { box-shadow: 0 0 0 36px color-mix(in srgb, var(--c) 0%, transparent); opacity: 0; } }
@keyframes rp-item { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 30% { opacity: 1; transform: translate(-50%, -70%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -110%) scale(1); } }
@keyframes rp-beam { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
.rp-beam.to-them { animation-name: rp-beam-them; } .rp-beam.to-us { animation-name: rp-beam-us; }
@keyframes rp-beam-them { 0% { opacity: 0; transform: translate(-30%, 20%) rotate(-24deg) scaleX(0); } 30% { opacity: 1; transform: translate(-30%, 20%) rotate(-24deg) scaleX(1); } 100% { opacity: 0; transform: translate(-30%, 20%) rotate(-24deg) scaleX(1); } }
@keyframes rp-beam-us { 0% { opacity: 0; transform: translate(-70%, -20%) rotate(156deg) scaleX(0); } 30% { opacity: 1; transform: translate(-70%, -20%) rotate(156deg) scaleX(1); } 100% { opacity: 0; transform: translate(-70%, -20%) rotate(156deg) scaleX(1); } }
@keyframes rp-pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 70% { opacity: 1; transform: translate(-50%, -14px); } 100% { opacity: 0; transform: translate(-50%, -30px); } }
@keyframes rp-sand { from { background-position: 0 0; } to { background-position: 60px 30px; } }
@keyframes rp-won { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 70%, transparent), var(--shadow); } 100% { box-shadow: 0 0 0 18px color-mix(in srgb, var(--gold) 0%, transparent), var(--shadow); } }
/* side panel */
.rp-side { display: grid; gap: 10px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.rp-partyrow { display: flex; align-items: center; gap: 8px; }
.rp-partylbl { font: 700 .78rem var(--font-head); color: var(--ink-3); width: 38px; text-transform: uppercase; letter-spacing: .4px; }
.rp-balls { display: flex; gap: 5px; flex-wrap: wrap; }
.rp-ball { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--ink); background: linear-gradient(180deg, var(--red) 0 48%, var(--ink) 48% 56%, #fff 56%); box-sizing: border-box; }
.rp-ball.hurt { background: linear-gradient(180deg, var(--gold) 0 48%, var(--ink) 48% 56%, #fff 56%); }
.rp-ball.out { background: var(--ring); border-color: var(--ring); opacity: .7; }
.rp-baghead { font: 700 .78rem var(--font-head); color: var(--ink-3); text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }
.rp-bag { display: flex; flex-wrap: wrap; gap: 5px; }
.rp-bagitem { display: inline-flex; align-items: center; gap: 4px; font: 600 .74rem var(--font-body); color: var(--ink-2); padding: 3px 8px 3px 5px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.rp-bagitem img { width: 18px; height: 18px; image-rendering: pixelated; }
.rp-bagitem.gone { opacity: .45; text-decoration: line-through; }
.rp-summary { border-top: 1px solid var(--line); padding-top: 8px; }
.rp-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .86rem; }
.rp-results li { padding-left: 14px; position: relative; color: var(--ink-2); }
.rp-results li::before { content: ""; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.rp-results li.bad::before { background: var(--bad); }
.rp-results li strong { color: var(--ink); }
/* risk check */
.rp-risk { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 6px; }
.rp-riskhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rp-riskhead .btn { padding: 6px 10px; font-size: .8rem; }
.rp-riskbar { height: 12px; border-radius: 999px; background: var(--bad-bg); overflow: hidden; border: 1px solid var(--line); }
.rp-riskfill { height: 100%; background: var(--ok); border-radius: 999px; transition: width .5s ease; }
.rp-riskline { font: 800 .95rem var(--font-head); color: var(--ink); font-variant-numeric: tabular-nums; }
.rp-risklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: .82rem; color: var(--ink-2); }
.rp-risklist li strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.rp-risklist li.bad strong { color: var(--bad); }
.rp-riskprog { font-size: .8rem; color: var(--ink-3); }
/* log */
.rp-caption { margin: 10px 0 6px; }
.rp-log { list-style: none; margin: 0; padding: 8px 10px; max-height: 340px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font: 500 .86rem var(--font-body); color: var(--ink-2); display: grid; gap: 2px; }
.rp-line { padding: 2px 8px; border-radius: 6px; border-left: 3px solid transparent; }
.rp-line.s-us { border-left-color: var(--blue); } .rp-line.s-them { border-left-color: var(--red); }
.rp-line.turn { font: 800 .74rem var(--font-head); color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; margin-top: 6px; border-left-color: transparent; }
.rp-line.head { font: 700 1rem var(--font-head); color: var(--ink); text-align: center; margin: 6px 0 2px; border-left-color: transparent; }
.rp-line.say { color: var(--ink-3); font-style: italic; }
.rp-line.move { color: var(--ink); font-weight: 700; }
.rp-line.dmg.crit { color: var(--bad); font-weight: 700; }
.rp-line.death { background: var(--bad-bg); color: var(--bad); font-weight: 700; }
.rp-line.win { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.rp-line.heal, .rp-line.up { color: var(--ok); } .rp-line.down, .rp-line.status { color: var(--warn); }
.rp-line.item { color: var(--info-ink); } .rp-line.field { color: var(--pearl); font-weight: 600; }
.rp-line.miss { color: var(--ink-3); }
@media (max-width: 900px) { .rp-arena { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .rp-stage { grid-template-columns: 1fr; min-height: 0; padding: 44px 10px 12px; gap: 14px; }
  .rp-them, .rp-us { grid-column: 1; }
  .rp-them { grid-row: 1; justify-self: end; } .rp-us { grid-row: 2; justify-self: start; }
  .rp-stand { width: 120px; height: 120px; } .rp-art { width: 112px; height: 112px; } .rp-shadow { width: 84px; height: 18px; }
  .rp-panel { width: min(200px, 56vw); }
  .rp-beam { width: 40%; }
  .rp-fieldchips { max-width: 90%; }
  .rp-transport .rp-turn { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .rp-stand.in .rp-art, .rp-stand.lunge .rp-art, .rp-stand.shake .rp-art, .rp-them .rp-stand.in .rp-art, .rp-them .rp-stand.lunge .rp-art, .rp-them .rp-stand.shake .rp-art { animation: none; }
  .rp-beam, .rp-fxi, .rp-stage.has-sand::after, .rp-stage.won { animation: none; opacity: 0; }
  .rp-pop { animation-duration: .9s; }
  .rp-hpfill { transition: none; }
}

/* ---------- battle replay v2 (v11.30) — choreography: text box, order tags, projectiles, impacts, status overlays, screens, cards ---------- */
.rp-stage { grid-template-rows: auto auto auto; padding-bottom: 12px; }
.rp-textbox { grid-column: 1 / -1; grid-row: 3; position: relative; z-index: 4; margin-top: 4px; min-height: 56px; background: var(--surface); border: 2px solid var(--ring); border-radius: 12px; padding: 8px 14px; display: grid; gap: 2px; align-content: center; box-shadow: var(--shadow); transition: border-color .25s, background-color .25s; }
.rp-nowmain { font: 700 1.02rem var(--font-head); color: var(--ink); line-height: 1.25; }
.rp-nowsub { font: 600 .8rem var(--font-body); color: var(--ink-3); }
.rp-textbox.us { border-color: var(--blue); } .rp-textbox.them { border-color: var(--red); }
.rp-textbox.turn { border-color: var(--ring); background: var(--surface-2); } .rp-textbox.turn .rp-nowmain { color: var(--ink-3); text-transform: uppercase; letter-spacing: .6px; font-size: .9rem; }
.rp-textbox.order .rp-nowmain { color: var(--ink-2); }
.rp-textbox.plan { border-color: var(--blue); background: var(--info-bg); } .rp-textbox.plan .rp-nowmain { color: var(--info-ink); font-style: italic; }
.rp-textbox.crit { border-color: var(--red); background: var(--bad-bg); } .rp-textbox.crit .rp-nowmain { color: var(--bad); }
.rp-textbox.death { border-color: var(--bad); background: var(--bad); } .rp-textbox.death .rp-nowmain, .rp-textbox.death .rp-nowsub { color: #fff; }
.rp-textbox.win { border-color: var(--ok); background: var(--ok-bg); } .rp-textbox.win .rp-nowmain { color: var(--ok); }
.rp-textbox.heal .rp-nowmain, .rp-textbox.up .rp-nowmain { color: var(--ok); } .rp-textbox.down .rp-nowmain, .rp-textbox.status .rp-nowmain { color: var(--warn); }
.rp-textbox.miss .rp-nowmain { color: var(--ink-3); } .rp-textbox.field .rp-nowmain { color: var(--pearl); } .rp-textbox.item .rp-nowmain { color: var(--info-ink); }
.rp-textbox.eot { background: var(--surface-2); } .rp-textbox.eot .rp-nowmain { color: var(--ink-3); font-size: .9rem; }
.rp-textbox.intro { border-color: var(--gold); }
.rp-turntag { font: 800 .66rem var(--font-head); color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; margin-left: auto; min-width: 0; }
.rp-turntag:empty { display: none; }
.rp-panel { transition: box-shadow .25s, border-color .25s, background-color .25s; }
.rp-panel.acting { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 30%, transparent), var(--shadow); }
.rp-them .rp-panel.acting { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 28%, transparent), var(--shadow); }
.rp-panel.dead { background: var(--ink); border-color: var(--ink); } .rp-panel.dead .rp-name, .rp-panel.dead .rp-lv, .rp-panel.dead .rp-hptext { color: #fff; } .rp-panel.dead .rp-hpbar { border-color: #555; }
.rp-turnpill { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 6; font: 800 .8rem var(--font-head); letter-spacing: .6px; text-transform: uppercase; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; box-shadow: var(--shadow); animation: rp-pill 1.1s ease-out forwards; pointer-events: none; }
@keyframes rp-pill { 0% { opacity: 0; transform: translate(-50%, -8px) scale(.9); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.rp-think { position: absolute; left: 50%; bottom: 100%; transform: translateX(-30%); z-index: 6; width: max-content; max-width: 260px; font: 600 .78rem var(--font-body); font-style: italic; color: var(--info-ink); background: var(--info-bg); border: 1px solid color-mix(in srgb, var(--blue) 45%, transparent); border-radius: 14px; padding: 6px 11px; box-shadow: var(--shadow); animation: rp-think 1.7s ease-out forwards; pointer-events: none; }
.rp-think::after { content: ""; position: absolute; left: 34%; bottom: -7px; width: 12px; height: 12px; background: var(--info-bg); border-right: 1px solid color-mix(in srgb, var(--blue) 45%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--blue) 45%, transparent); transform: rotate(45deg); }
@keyframes rp-think { 0% { opacity: 0; transform: translate(-30%, 6px); } 15% { opacity: 1; transform: translate(-30%, 0); } 85% { opacity: 1; } 100% { opacity: 0; } }
.rp-movetag { position: absolute; left: 50%; top: 2px; transform: translateX(-50%); z-index: 6; font: 800 .74rem var(--font-head); color: #fff; background: var(--c); border-radius: 999px; padding: 3px 10px; white-space: nowrap; text-shadow: 0 1px 1px rgba(0,0,0,.35); box-shadow: 0 2px 8px color-mix(in srgb, var(--c) 50%, transparent); animation: rp-movetag 1.2s ease-out forwards; pointer-events: none; }
@keyframes rp-movetag { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 30% { transform: translate(-50%, 0) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
/* projectiles (special moves) */
.rp-proj { position: absolute; z-index: 5; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, #fff 0%, var(--c) 45%, color-mix(in srgb, var(--c) 40%, transparent) 70%, transparent 72%); box-shadow: 0 0 18px 6px color-mix(in srgb, var(--c) 55%, transparent); animation: rp-proj .42s cubic-bezier(.3,.1,.7,1) forwards; }
.rp-proj::before, .rp-proj::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: color-mix(in srgb, var(--c) 55%, transparent); animation: rp-trail .42s linear forwards; }
.rp-proj::after { animation-delay: .06s; opacity: .6; }
@keyframes rp-proj { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 12% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1.15); opacity: 1; } }
@keyframes rp-trail { 0% { transform: scale(1); } 100% { transform: scale(2.2); opacity: 0; } }
/* impacts */
.rp-fxi.slash { width: 110px; height: 110px; background: repeating-linear-gradient(135deg, transparent 0 18px, color-mix(in srgb, var(--c) 85%, #fff) 18px 24px, transparent 24px 40px); border-radius: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); animation: rp-slash .55s ease-out forwards; mix-blend-mode: multiply; }
:root[data-theme="dark"] .rp-fxi.slash { mix-blend-mode: screen; }
@keyframes rp-slash { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-10deg) scale(.5); } 20% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(8deg) scale(1.3); } }
.rp-fxi.ring { width: 130px; height: 130px; background: none; border: 4px solid var(--c); animation: rp-ring .75s ease-out forwards; }
@keyframes rp-ring { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); } }
.rp-fxi.shield { width: 120px; height: 120px; background: none; border: 3px dashed var(--ink-3); animation: rp-ring .9s ease-out forwards; }
.rp-fxi.arrows { width: 80px; height: 100px; background: none; display: grid; place-items: center; animation: rp-arrows .9s ease-out forwards; }
.rp-fxi.arrows::before { content: "▲▲"; font: 900 1.6rem var(--font-head); letter-spacing: -2px; color: var(--ok); }
.rp-fxi.arrows.down::before { content: "▼▼"; color: var(--bad); }
@keyframes rp-arrows { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -110%) scale(1.1); } }
.rp-fxi.arrows.down { animation-name: rp-arrows-down; }
@keyframes rp-arrows-down { 0% { opacity: 0; transform: translate(-50%, -110%) scale(.7); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -20%) scale(1.1); } }
.rp-fxi.ball { width: 26px; height: 26px; background: linear-gradient(180deg, var(--red) 0 46%, var(--ink) 46% 54%, #fff 54%); border: 2px solid var(--ink); box-sizing: border-box; animation: rp-ballin .6s cubic-bezier(.3,1.2,.4,1) forwards; }
.rp-fxi.ball.recall { animation: rp-ballout .55s ease-in forwards; }
@keyframes rp-ballin { 0% { opacity: 0; transform: translate(-50%, -250%) scale(.7) rotate(-90deg); } 60% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); } 80% { transform: translate(-50%, -70%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); } }
@keyframes rp-ballout { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); } 40% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -280%) scale(.5); } }
.rp-fxi.sendflash { width: 150px; height: 150px; background: radial-gradient(circle, #fff 0%, rgba(255,255,255,.7) 35%, transparent 70%); animation: rp-hit .5s ease-out forwards; }
.rp-stand.recall .rp-art { animation: rp-recall .5s ease-in forwards; }
.rp-them .rp-stand.recall .rp-art { animation-name: rp-recall-them; }
@keyframes rp-recall { to { opacity: 0; transform: translateY(-20px) scale(.1); filter: brightness(3); } }
@keyframes rp-recall-them { to { opacity: 0; transform: translateY(-20px) scale(-.1, .1); filter: brightness(3); } }
.rp-stand.charge .rp-art { animation: rp-charge .45s ease-in-out; }
.rp-them .rp-stand.charge .rp-art { animation-name: rp-charge-them; }
@keyframes rp-charge { 0%, 100% { transform: none; filter: drop-shadow(0 6px 6px rgba(0,0,0,.18)); } 50% { transform: scale(1.06); filter: drop-shadow(0 6px 6px rgba(0,0,0,.18)) brightness(1.25); } }
@keyframes rp-charge-them { 0%, 100% { transform: scaleX(-1); } 50% { transform: scale(-1.06, 1.06); filter: brightness(1.25); } }
.rp-stand.dodge .rp-art { animation: rp-dodge .5s ease-out; }
.rp-them .rp-stand.dodge .rp-art { animation-name: rp-dodge-them; }
@keyframes rp-dodge { 0%, 100% { transform: none; } 40% { transform: translateX(-28px); } }
@keyframes rp-dodge-them { 0%, 100% { transform: scaleX(-1); } 40% { transform: translateX(28px) scaleX(-1); } }
/* sparkles */
.rp-spark { position: absolute; left: 50%; top: 55%; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); pointer-events: none; animation: rp-spark .9s ease-out forwards; }
.rp-spark.healspark { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.rp-spark.hitspark { background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.25); width: 6px; height: 6px; animation-duration: .6s; }
@keyframes rp-spark { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(1.2); } }
/* popups with a second line */
.rp-pop { display: grid; justify-items: center; line-height: 1.15; }
.rp-pop small { font: 700 .66rem var(--font-body); letter-spacing: .3px; text-transform: uppercase; opacity: .9; }
.rp-pop.crit small { color: #fff; }
/* persistent status overlays on the sprite */
.rp-stov { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.rp-stand.gone .rp-stov, .rp-stand.faint .rp-stov, .rp-stand.out .rp-stov { display: none; }
.rp-stand.st-brn .rp-stov::before { content: ""; position: absolute; left: 50%; bottom: 14px; width: 54px; height: 54px; margin-left: -27px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(ellipse at 50% 80%, #ffd36a 0%, #ee8130 45%, transparent 72%); opacity: .85; animation: rp-flame .5s ease-in-out infinite alternate; }
@keyframes rp-flame { from { transform: scale(1, .9); } to { transform: scale(1.1, 1.15) translateY(-4px); } }
.rp-stand.st-par .rp-stov::before, .rp-stand.st-par .rp-stov::after { content: "⚡"; position: absolute; font-size: 22px; color: #e3b900; animation: rp-blink .7s steps(2) infinite; }
.rp-stand.st-par .rp-stov::before { left: 18%; top: 28%; } .rp-stand.st-par .rp-stov::after { right: 18%; top: 50%; animation-delay: .35s; }
@keyframes rp-blink { 50% { opacity: 0; } }
.rp-stand.st-psn .rp-stov::before, .rp-stand.st-psn .rp-stov::after, .rp-stand.st-tox .rp-stov::before, .rp-stand.st-tox .rp-stov::after { content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: color-mix(in srgb, #a33ea1 70%, #fff); left: 30%; top: 60%; animation: rp-bubble 1.6s ease-out infinite; }
.rp-stand.st-psn .rp-stov::after, .rp-stand.st-tox .rp-stov::after { left: 62%; top: 70%; width: 9px; height: 9px; animation-delay: .8s; }
@keyframes rp-bubble { 0% { opacity: 0; transform: translateY(0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-50px) scale(1.1); } }
.rp-stand.st-slp .rp-stov::before { content: "z Z z"; position: absolute; right: 12%; top: 10%; font: 800 .9rem var(--font-head); color: var(--ink-3); animation: rp-zz 1.8s ease-in-out infinite; }
@keyframes rp-zz { 0% { opacity: 0; transform: translateY(6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
/* screens in front of their sprite; trick room tint; flashes */
.rp-screen { position: absolute; inset: 8% 6% 14% 6%; z-index: 2; border-radius: 10px; opacity: 0; transition: opacity .4s; pointer-events: none; transform: skewY(-6deg); }
.rp-screen.light { opacity: 1; background: linear-gradient(180deg, rgba(255, 220, 90, .32), rgba(255, 220, 90, .08)); border: 1px solid rgba(214, 170, 20, .55); box-shadow: inset 0 0 18px rgba(255, 220, 90, .35); }
.rp-screen.reflect { opacity: 1; background: linear-gradient(180deg, rgba(99, 144, 240, .3), rgba(99, 144, 240, .08)); border: 1px solid rgba(52, 102, 175, .55); box-shadow: inset 0 0 18px rgba(99, 144, 240, .35); }
.rp-screen.light.reflect { background: linear-gradient(180deg, rgba(255, 220, 90, .28), rgba(99, 144, 240, .22)); border-color: rgba(120, 110, 90, .5); }
.rp-stage.has-tr::before { background-image: linear-gradient(color-mix(in srgb, var(--pearl) 22%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--pearl) 22%, transparent) 1px, transparent 1px); opacity: 1; }
.rp-stage.flash-crit { animation: rp-flashcrit .6s ease-out; } .rp-stage.flash-death { animation: rp-flashdeath .9s ease-out; } .rp-stage.flash-tr { animation: rp-flashtr .9s ease-out; }
@keyframes rp-flashcrit { 0% { box-shadow: inset 0 0 0 999px rgba(227, 53, 13, .0); } 15% { box-shadow: inset 0 0 0 999px rgba(227, 53, 13, .28); } 100% { box-shadow: inset 0 0 0 999px rgba(227, 53, 13, 0); } }
@keyframes rp-flashdeath { 0% { box-shadow: inset 0 0 0 999px rgba(31, 36, 48, 0); } 20% { box-shadow: inset 0 0 0 999px rgba(31, 36, 48, .45); } 100% { box-shadow: inset 0 0 0 999px rgba(31, 36, 48, 0); } }
@keyframes rp-flashtr { 0% { box-shadow: inset 0 0 0 999px rgba(199, 107, 152, 0); } 25% { box-shadow: inset 0 0 0 999px rgba(199, 107, 152, .3); } 100% { box-shadow: inset 0 0 0 999px rgba(199, 107, 152, 0); } }
/* intro / outcome cards */
.rp-card { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 7; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 2px solid var(--gold); border-radius: 14px; padding: 12px 18px; box-shadow: var(--shadow); animation: rp-card 1.5s ease-out forwards; pointer-events: none; max-width: 90%; }
.rp-card img { width: 64px; height: 64px; object-fit: contain; }
.rp-card strong { display: block; font: 800 1.1rem var(--font-head); color: var(--ink); } .rp-card span { font: 600 .8rem var(--font-body); color: var(--ink-3); }
.rp-card.won { border-color: var(--ok); } .rp-card.won strong { color: var(--ok); } .rp-card.lost { border-color: var(--bad); } .rp-card.lost strong { color: var(--bad); }
@keyframes rp-card { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.9); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
/* legend */
.rp-legend { margin: 0 0 8px; font-size: .84rem; color: var(--ink-2); }
.rp-legend summary { cursor: pointer; font: 700 .86rem var(--font-head); color: var(--ink-2); }
.rp-legend ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
@media (max-width: 640px) {
  .rp-stage { grid-template-rows: auto auto auto; }
  .rp-textbox { grid-row: 3; }
  .rp-think { max-width: 200px; }
  .rp-proj { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
}
@media (prefers-reduced-motion: reduce) {
  .rp-proj, .rp-spark, .rp-fxi.slash, .rp-fxi.ring, .rp-fxi.ball, .rp-fxi.sendflash, .rp-fxi.arrows, .rp-fxi.shield, .rp-stage.flash-crit, .rp-stage.flash-death, .rp-stage.flash-tr { animation: none; opacity: 0; }
  .rp-stand.recall .rp-art, .rp-stand.charge .rp-art, .rp-stand.dodge .rp-art, .rp-them .rp-stand.recall .rp-art, .rp-them .rp-stand.charge .rp-art, .rp-them .rp-stand.dodge .rp-art { animation: none; }
  .rp-stand.st-brn .rp-stov::before, .rp-stand.st-par .rp-stov::before, .rp-stand.st-par .rp-stov::after, .rp-stand.st-psn .rp-stov::before, .rp-stand.st-psn .rp-stov::after, .rp-stand.st-tox .rp-stov::before, .rp-stand.st-tox .rp-stov::after, .rp-stand.st-slp .rp-stov::before { animation: none; }
  .rp-turnpill, .rp-think, .rp-movetag, .rp-card { animation-duration: 1.2s; }
}

/* ======================================================================================================
   v12 — the shell ("one author", Phase 9.1 / STYLE.md). One fixed header, one fixed footer, one hierarchy.
   ====================================================================================================== */
:root { --shell-top: 128px; --shell-bottom: 44px; --stat-lbl: 3.1em; --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; }
html { scroll-padding-top: calc(var(--shell-top) + 12px); scroll-padding-bottom: calc(var(--shell-bottom) + 12px); }
body { padding-top: calc(var(--shell-top) + 14px); padding-bottom: calc(var(--shell-bottom) + 28px); }
#shell-main { max-width: var(--page-w); margin: 0 auto; min-height: calc(100vh - var(--shell-top) - var(--shell-bottom) - 42px); }
#shell-main > .tab-panel > *:first-child { margin-top: 0; }
#shell-main h2:first-child { margin-top: 4px; }
*, *::before, *::after { scroll-margin-top: calc(var(--shell-top) + 12px); }
/* section colours — the one accent of each view (OneNote's coloured section tabs) */
.sh-sec[data-sec="home"], html[data-section="home"] { --sec-c: var(--red); }
.sh-sec[data-sec="journey"], html[data-section="journey"] { --sec-c: #1f8a4c; }
.sh-sec[data-sec="trainers"], html[data-section="trainers"] { --sec-c: #d9741e; }
.sh-sec[data-sec="dex"], html[data-section="dex"] { --sec-c: var(--blue); }
.sh-sec[data-sec="battle"], html[data-section="battle"] { --sec-c: #7b4fc4; }
.sh-sec[data-sec="teams"], html[data-section="teams"] { --sec-c: #b58b00; }
.sh-sec[data-sec="more"], html[data-section="more"] { --sec-c: var(--ink-3); }
:root[data-theme="dark"] .sh-sec[data-sec="journey"], :root[data-theme="dark"][data-section="journey"] { --sec-c: #4cc785; }
:root[data-theme="dark"] .sh-sec[data-sec="teams"], :root[data-theme="dark"][data-section="teams"] { --sec-c: var(--gold); }
/* ---- header ---- */
.sh { position: fixed; top: 0; left: 0; right: 0; z-index: 80; max-width: none; margin: 0; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 4px 16px rgba(31, 36, 48, .06); padding: env(safe-area-inset-top, 0px) var(--gutter) 0; }
:root[data-theme="dark"] .sh { box-shadow: 0 4px 16px rgba(0, 0, 0, .4); }
.sh-in { max-width: var(--page-w); margin: 0 auto; }
.sh-row { display: flex; align-items: center; gap: 10px; }
.sh-row1 { padding: 6px 0 4px; }
.sh-brand { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px 4px 0; cursor: pointer; color: var(--ink); font: 700 1.15rem var(--font-head); flex: none; border-radius: 10px; }
.sh-brand svg { width: 32px; height: 32px; flex: none; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.sh-brand:hover svg { transform: rotate(-12deg) scale(1.08); }
.sh .gsearch { flex: 1 1 320px; margin: 0; min-height: 44px; max-width: none; padding: 2px 8px 2px 14px; border: 2px solid var(--ring); background: var(--surface-2); box-shadow: none; }
.sh .gsearch:focus-within { border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 4px rgba(255, 203, 5, .45); }
.sh .gsearch-in { font-size: 1rem; padding: 6px 4px; }
.sh-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.sh .gsearch-cmp { min-height: 40px; padding: 7px 14px 7px 9px; transition: background-color .2s; }
.sh .gsearch-cmp:hover { transform: none; }
.sh-here { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; border: 2px solid var(--ring); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 7px 13px; font: 700 .9rem var(--font-head); cursor: pointer; }
.sh-here:hover { border-color: var(--ink-3); }
.sh-here-ic { font-size: 1.05rem; line-height: 1; color: var(--red); }
.sh .theme-btn { min-height: 40px; padding: 7px 12px; font: 700 .9rem var(--font-head); }
.sh-menu { display: inline-flex; width: 40px; height: 40px; border: 2px solid var(--ring); background: var(--surface); border-radius: 10px; cursor: pointer; position: relative; flex: none; }
.sh-menu-ic, .sh-menu-ic::before, .sh-menu-ic::after { position: absolute; left: 9px; width: 18px; height: 2.5px; border-radius: 2px; background: var(--ink); content: ""; }
.sh-menu-ic { top: 17px; } .sh-menu-ic::before { left: 0; top: -6px; } .sh-menu-ic::after { left: 0; top: 6px; }
.sh-sections { gap: 2px; overflow-x: auto; scrollbar-width: none; margin-top: 2px; }
.sh-sections::-webkit-scrollbar { display: none; }
.sh-sec { position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--ink-2); padding: 6px 12px 9px; font: 700 .95rem var(--font-head); border-radius: 8px 8px 0 0; cursor: pointer; transition: background-color .15s, color .15s; }
.sh-sec:hover { background: var(--surface-2); color: var(--ink); }
.sh-sec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sec-c, var(--ink-3)); flex: none; }
.sh-sec.active { color: var(--ink); }
.sh-sec.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--sec-c, var(--red)); }
.sh-sec:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.sh-row3 { background: var(--surface-2); border-top: 1px solid var(--line); margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter); gap: 8px; }
.sh-pages { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; }
.sh-pages::-webkit-scrollbar { display: none; }
.sh-pagerow { display: contents; }
.sh .sh-page { flex: none; border: 0; background: transparent; color: var(--ink-2); padding: 6px 12px; border-radius: 999px; font: 700 .88rem var(--font-head); cursor: pointer; transition: background-color .15s, color .15s; box-shadow: none; transform: none; animation: none; }
.sh .sh-page::before, .sh .sh-page::after { display: none; }
.sh .sh-page:hover { background: var(--surface); color: var(--ink); transform: none; box-shadow: none; }
.sh .sh-page.active { background: var(--ink); color: var(--surface); animation: none; box-shadow: none; }
.sh .sh-page:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sh-secbtn { display: none; }
.sh .post-switch { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 3px 8px 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: 700 .8rem/1 var(--font-body); cursor: pointer; }
.sh .post-switch:hover { border-color: var(--ink-3); color: var(--ink); }
.sh .post-switch.off .ps-lbl { text-decoration: none; color: var(--ink-3); }
/* the phone sheet (sections › pages, an outline of the whole site) */
.sh-sheet { position: fixed; left: 0; right: 0; top: var(--shell-top); bottom: 0; z-index: 79; max-width: none; margin: 0; background: rgba(0, 0, 0, .35); }
.sh-sheet-in { background: var(--surface); max-height: 100%; overflow: auto; padding: 10px var(--gutter) 22px; border-bottom: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0, 0, 0, .2); }
.sh-sheet-head { display: flex; align-items: center; gap: 10px; padding: 4px 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.sh-sheet-head .linkish { margin-left: auto; font-size: 1.1rem; }
.sh-sheet-sec { padding: 6px 0; border-left: 3px solid var(--line); padding-left: 10px; margin: 4px 0; }
.sh-sheet-sec.on { border-left-color: var(--sec-c, var(--red)); }
.sh-sheet-secname { font: 700 .95rem var(--font-head); color: var(--ink); margin-bottom: 4px; }
.sh-sheet-pages { display: flex; flex-wrap: wrap; gap: 6px; }
.sh-sheet-foot { display: flex; gap: 8px; margin-top: 10px; }
/* ---- footer ---- */
.sh-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; max-width: none; margin: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 6px var(--gutter) calc(6px + env(safe-area-inset-bottom, 0px)); font-size: .78rem; color: var(--ink-3); }
.sh-foot-in { max-width: var(--page-w); margin: 0 auto; display: flex; align-items: center; gap: 14px; min-height: 26px; }
.sh-foot-brand { flex: none; white-space: nowrap; } .sh-foot-brand b { color: var(--ink-2); font-family: var(--font-head); }
.sh-foot-dim { color: var(--ink-3); }
.sh-trivia { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-trivia-lead { font-weight: 800; color: var(--ink-2); margin-right: 6px; } .sh-trivia-lead::after { content: "·"; margin-left: 6px; color: var(--ink-3); }
.sh-trivia .linkish { margin-left: 8px; font-size: .78rem; }
.sh-foot-links { margin-left: auto; display: flex; gap: 12px; flex: none; }
.sh-foot-links .linkish, .sh-foot-links a { font-size: .78rem; color: var(--ink-2); }
/* ---- v12.10 the two medallions: Town Map (Map) · Poké Ball (Pokédex) — one fixed row, every screen size ---- */
.fabs { position: fixed; right: 18px; bottom: calc(var(--shell-bottom) + 14px + env(safe-area-inset-bottom, 0px)); z-index: 85; display: flex; align-items: flex-end; gap: 12px; max-width: none; margin: 0; }
.fab { position: relative; width: 72px; height: 72px; border-radius: 50%; border: 0; background: none; padding: 0; cursor: pointer; max-width: none; margin: 0; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .22)); }
.fab-map-pic { display: block; width: 100%; height: 100%; border-radius: 50%; border: 4px solid var(--ink); background: #2ab2c4 url('/assets/maps/medallion.webp') center / cover no-repeat; transition: transform .22s cubic-bezier(.34, 1.56, .64, 1); }
.fab:hover .fab-map-pic { transform: scale(1.06) rotate(-4deg); }
.fab-ball { display: block; width: 100%; height: 100%; border-radius: 50%; border: 4px solid var(--ink); background: radial-gradient(circle, #fff 0 9px, var(--ink) 9px 13px, transparent 13px), linear-gradient(var(--red) 0 46%, var(--ink) 46% 54%, #fff 54%); transition: transform .22s cubic-bezier(.34, 1.56, .64, 1); }
.fab:hover .fab-ball { transform: rotate(-10deg) scale(1.05); }
.fab.open .fab-ball { transform: rotate(180deg); }
.fab:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.fab-grid, .fab-scroll { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fab-scroll { margin-top: 8px; }
.fab-act { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 10px; padding: 9px 6px; font: 700 .8rem var(--font-head); cursor: pointer; text-align: center; min-height: 44px; }
.fab-act:hover { border-color: var(--ink-3); background: var(--surface); }
.fab-chapter-list { display: flex; flex-direction: column; gap: 1px; max-height: 240px; overflow: auto; }
.fab-chapter { text-align: left; border: 0; background: none; padding: 5px 8px; border-radius: 8px; font: 600 .85rem var(--font-body); color: var(--ink-2); cursor: pointer; }
.fab-chapter:hover { background: var(--surface-2); color: var(--ink); }
/* ---- jump highlight: unmistakable ---- */
.jumped, .flash { outline: 3px solid var(--gold); outline-offset: 4px; box-shadow: 0 0 0 10px rgba(255, 203, 5, .22); animation: jumpfade 2.4s ease-out forwards; border-radius: 10px; }
@keyframes jumpfade { 0% { box-shadow: 0 0 0 16px rgba(255, 203, 5, .5); } 60% { outline-color: var(--gold); box-shadow: 0 0 0 10px rgba(255, 203, 5, .22); } 100% { outline-color: transparent; box-shadow: 0 0 0 0 rgba(255, 203, 5, 0); } }
/* ---- Home ---- */
.home-hero { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; padding: 6px 0 10px; }
.home-hero-text { flex: 1 1 320px; min-width: 0; }
.home-hero h1 { font-size: 2.2rem; }
.home-sub { font: 700 1rem var(--font-head); color: var(--ink-2); margin: 2px 0 6px; }
.home-logos { display: flex; gap: 12px; align-items: center; margin-left: auto; }
.home-logos .game-logo { width: 120px; height: auto; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.home-tile { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px; cursor: pointer; color: var(--ink); min-height: 72px; }
.home-tile b { font: 700 1rem var(--font-head); }
.home-tile span { font-size: .82rem; color: var(--ink-3); line-height: 1.35; }
.home-tile:hover { border-color: var(--ink-3); }
.home-tile.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.home-tile.gold span { color: var(--gold-ink); }
.page-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.page-toc a { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font: 700 .82rem var(--font-head); color: var(--ink-2); text-decoration: none; }
.page-toc a:hover { border-color: var(--ink-3); color: var(--ink); }
/* ---- quiet: the old flourishes retire (motion only for meaning) ---- */
.to-top, .scroll-progress, .cmp-fab, .mm-ball, .road-tip, .hero-fact, .runner-track, .scroll-runner, .rail { display: none !important; }
html.has-rail { scrollbar-width: auto; --rail-w: 0px; } html.has-rail::-webkit-scrollbar { display: initial; width: auto; } html.has-rail body { padding-right: var(--gutter); }
.consent { bottom: calc(var(--shell-bottom) + 12px + env(safe-area-inset-bottom, 0px)); z-index: 84; }
.mm { bottom: calc(var(--shell-bottom) + 12px); } .mm-rescue { bottom: calc(var(--shell-bottom) + 10px); }
.reveal, .reveal.from-left, .reveal.from-right, .reveal.out-up { opacity: 1 !important; transform: none !important; transition: none !important; }
.reveal:not(.in) .stat-bar { transform: none; }
.tab-panel.active { animation: none; }
#tab-credits .sources, #tab-credits .site-foot { margin-top: 12px; text-align: left; border-top: 0; padding: 14px 16px; }
#tab-credits .site-foot h3 { margin-bottom: 6px; }
/* ---- stat labels never wrap (STYLE.md §2) ---- */
.fs-stat-l { white-space: nowrap; letter-spacing: .02em; }
.stat-label, .cmp-stat-l, .bd-head .stat-label { white-space: nowrap; }
/* ---- replay on wide screens: capped and centred, bigger sprites ---- */
.rp-stage { max-width: 980px; margin-left: auto; margin-right: auto; }
/* ---- phone ---- */
@media (max-width: 760px) {
  .sh-row1 { gap: 6px; padding: 6px 0; }
  .sh-word, .sh-here .sh-act-text, .sh .gsearch-cmp-text, .sh .theme-btn, .sh .post-switch { display: none; }
  .sh-brand { padding: 2px; } .sh-brand svg { width: 30px; height: 30px; }
  .sh .gsearch { min-height: 42px; padding: 2px 6px 2px 10px; min-width: 0; flex: 1 1 100px; }
  .sh .gsearch-in { flex: 1 1 0; min-width: 0; }
  .sh-here { display: none; }
  .sh .gsearch-in { font-size: .92rem; padding: 5px 2px; }
  .sh .gsearch-kbd { display: none; }
  .sh .gsearch-cmp { min-height: 38px; padding: 6px 8px; gap: 0; }
  .sh-here { min-height: 38px; padding: 6px 9px; }
  .sh-menu { display: inline-flex; }
  .sh-sections { display: none; }
  .sh-row3 { padding: 4px 16px; gap: 6px; }
  .sh-secbtn { display: inline-flex; align-items: center; gap: 6px; flex: none; border: 0; background: var(--ink); color: var(--surface); border-radius: 999px; padding: 7px 12px; font: 700 .86rem var(--font-head); cursor: pointer; }
  .sh-secbtn::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--sec-c, var(--red)); }
  .sh-caret { opacity: .8; }
  .sh-pages { border-left: 1px solid var(--line); padding-left: 6px; }
  .sh .sh-page { padding: 6px 10px; font-size: .84rem; }
  .fabs { right: 12px; bottom: calc(var(--shell-bottom) + 12px + env(safe-area-inset-bottom, 0px)); gap: 10px; }
  .fab { width: 60px; height: 60px; }
  .fab-grid, .fab-scroll { grid-template-columns: repeat(4, 1fr); } .fab-act { font-size: .74rem; padding: 8px 3px; }
  .sh-foot { padding: 5px 12px calc(5px + env(safe-area-inset-bottom, 0px)); font-size: .72rem; }
  .sh-foot-in { gap: 8px; min-height: 22px; }
  .sh-trivia { display: none; }
  .sh-foot-dim { display: none; }
  .home-hero h1 { font-size: 1.8rem; }
  .home-logos { margin-left: 0; } .home-logos .game-logo { width: 96px; }
  .home-grid { grid-template-columns: 1fr 1fr; gap: 8px; } .home-tile { padding: 10px 12px; min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { .jumped, .flash { animation: none; } .fab-ball, .sh-brand svg { transition: none; } }
/* ---- the reference pages (shell-pages.js) ---- */
.ty-picks .ty-pick { display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: 8px; align-items: start; margin-top: 8px; }
.ty-row { margin: 0; }
.ty-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 8px 0 12px; }
.ty-col { display: flex; flex-direction: column; gap: 6px; }
.ty-chart summary { cursor: pointer; }
.ty-full { margin-top: 8px; } .type-table.full th:first-child { font-size: .7rem; color: var(--ink-3); white-space: nowrap; }
.it-rows { display: flex; flex-direction: column; }
.it-row { display: grid; grid-template-columns: 13em minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.it-row:first-child { border-top: 0; }
.it-name { display: inline-flex; align-items: center; gap: 8px; text-align: left; font-weight: 700; }
.it-fx { font-size: .86rem; color: var(--ink-2); }
.ab-list { display: flex; flex-direction: column; gap: 8px; }
.ab-row { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 4px 12px; align-items: baseline; padding: 10px 14px; }
.ab-row .meta-note { grid-column: 2; }
.ab-fx { font-size: .9rem; color: var(--ink-2); }
.cmp-front { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.cmp-front .combo { flex: 1 1 220px; }
.cmp-vs { font: 700 .95rem var(--font-head); color: var(--ink-3); }
@media (max-width: 760px) {
  .ty-picks .ty-pick { grid-template-columns: 1fr; gap: 4px; }
  .it-row { grid-template-columns: 1fr; gap: 3px; padding: 8px 0; }
  .ab-row { grid-template-columns: 1fr; } .ab-row .meta-note { grid-column: 1; }
}

/* ---- featured runs: one at a time ---- */
.fs-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; margin: 0 0 14px; }
.fs-pick { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 12px; cursor: pointer; color: var(--ink); }
.fs-pick:hover { border-color: var(--ink-3); }
.fs-pick.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.fs-pick-who { font: 700 1rem var(--font-head); }
.fs-pick-what { grid-column: 1; font-size: .8rem; color: var(--ink-3); }
.fs-pick-team { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; width: 100px; justify-content: flex-end; }
.fs-pick-team img { width: 30px; height: 30px; image-rendering: pixelated; }
@media (max-width: 760px) { .fs-picks { grid-template-columns: 1fr; } }
/* ---- Journey › Areas ---- */
.ar-list { display: flex; flex-direction: column; gap: 8px; }
.ar { padding: 0; }
details.ar { padding: 0; margin: 0; border-width: 1px; border-color: var(--line); }
details.ar > .ar-sum { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 14px; cursor: pointer; list-style: none; font: inherit; }
details.ar > .ar-sum::before { content: none; display: none; }
details.ar > .ar-sum:hover { background: var(--surface-2); border-radius: var(--radius); }
details.ar[open] > .ar-sum .fight-chevron { transform: rotate(45deg); }
.ar-sum .fight-chevron { justify-self: center; }
.ar-sum::-webkit-details-marker { display: none; }
.ar-name { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.ar-sub { display: block; }
.ar-counts { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.ar-pill { font: 700 .72rem var(--font-body); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; color: var(--ink-2); white-space: nowrap; }
.ar-pill.now { border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); color: var(--ok); background: var(--ok-bg); }
.ar-pill.later { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); color: var(--warn); background: var(--warn-bg); }
.ar-pill.hidden { color: var(--ink-3); }
.ar-pill.ok { color: var(--ok); }
.ar-body { padding: 0 14px 14px 42px; display: flex; flex-direction: column; gap: 10px; }
.ar-about { margin: 0; color: var(--ink-2); font-size: .9rem; }
.ar-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ar-kids { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ar-group { display: flex; flex-direction: column; gap: 4px; }
.ar-group.later { border-top: 1px dashed var(--line); padding-top: 8px; }
.ar-items { display: flex; flex-direction: column; }
.ar-item { display: grid; grid-template-columns: 18px 14em auto auto auto minmax(0, 1fr); gap: 8px; align-items: center; padding: 4px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.ar-item:first-child { border-top: 0; }
.ar-item.done .ar-item-name { text-decoration: line-through; color: var(--ink-3); }
.ar-item-name { display: inline-flex; align-items: center; gap: 6px; text-align: left; font-weight: 700; }
.ar-item-where { font-size: .8rem; }
.ar-item .fact { justify-self: start; }
.ar-later { white-space: nowrap; }
.ar-gate { margin-top: 4px; }
.ar-gate-h { display: inline-block; font: 700 .78rem var(--font-body); color: var(--warn); margin: 4px 0 2px; }
@media (max-width: 760px) {
  details.ar > .ar-sum { grid-template-columns: 14px minmax(0, 1fr); grid-template-areas: "chev id" "chev counts"; row-gap: 6px; }
  .ar-sum .fight-chevron { grid-area: chev; align-self: start; margin-top: 8px; } .ar-sum .ar-id { grid-area: id; min-width: 0; } .ar-sum .ar-counts { grid-area: counts; justify-content: flex-start; }
  .ar-name { flex-wrap: wrap; }
  .ar-body { padding-left: 14px; }
  .ar-item { grid-template-columns: 18px minmax(0, 1fr); gap: 4px 8px; } .ar-item-where { grid-column: 2; } .ar-item .fact { grid-column: 2; }
}
.map-items-kid { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }

/* ---- About ---- */
.about { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 20px; align-items: start; padding: 20px; }
.about-photo { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 3px solid var(--line); }
.about-text h3 { font-size: 1.4rem; } .about-role { margin: 2px 0 10px; font-weight: 700; color: var(--ink-2); }
.about-text p { margin: 0 0 10px; color: var(--ink-2); max-width: 62ch; }
.about-links a { font-weight: 700; }
.about-support { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 18px; align-items: center; padding: 18px 20px; margin-top: 12px; }
.about-mark { width: 72px; height: 72px; border-radius: 16px; }
.about-support-text p { margin: 4px 0 10px; color: var(--ink-2); max-width: 62ch; }
.about-donate { text-decoration: none; display: inline-flex; }
.sh-foot-dr { display: inline-flex; align-items: center; gap: 4px; } .sh-foot-dr img { width: 14px; height: 14px; border-radius: 3px; }
.sh-support { color: var(--red) !important; font-weight: 800; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; justify-items: center; text-align: center; } .about-text p { text-align: left; } .about-support { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

.sh-toast { position: fixed; left: 50%; bottom: calc(var(--shell-bottom) + 16px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 12px); z-index: 90; max-width: min(560px, calc(100vw - 32px)); background: var(--ink); color: var(--surface); border-radius: 12px; padding: 10px 16px; font: 600 .9rem var(--font-body); box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; transition: opacity .25s, transform .25s; margin: 0; }
.sh-toast.in { opacity: 1; transform: translate(-50%, 0); }
/* ---- Replay v2 (Phase 9.6): a player — banner · stage · scrubber · timeline · transport; bigger, closer, clearer ---- */
.rp-player { display: flex; flex-direction: column; gap: 10px; margin: 0 0 10px; }
.rp-bosshead { display: none; }
.rp-banner { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rp-banner-art { width: 72px; height: 72px; object-fit: contain; }
.rp-banner-text { display: flex; flex-direction: column; min-width: 0; }
.rp-banner-role { font: 800 .72rem var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.rp-banner-name { font: 700 1.5rem var(--font-head); line-height: 1.15; }
.rp-banner-sub { font-size: .82rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-banner-prog { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.rp-banner-step { font: 700 .72rem var(--font-body); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; color: var(--ink-3); }
.rp-banner-step.done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); background: var(--ok-bg); }
.rp-banner-step.cur { color: var(--surface); background: var(--ink); border-color: var(--ink); }
.rp-arena { grid-template-columns: minmax(0, 1fr) 260px; }
.rp-arena .rp-stage { max-width: none; min-height: 460px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); justify-items: center; }
.rp-stand { width: 212px; height: 212px; }
.rp-art { width: 200px; height: 200px; }
.rp-pop { font-size: 1.35rem; padding: 4px 14px; }
.rp-pop.crit { font-size: 1.6rem; }
.rp-pop.death { font-size: 1.2rem; }
.rp-nowmain { font-size: 1.12rem; }
.rp-stand.shake { animation: rp-shake .52s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes rp-shake { 10%, 90% { transform: translate3d(-2px, 0, 0); } 20%, 80% { transform: translate3d(4px, 0, 0); } 30%, 50%, 70% { transform: translate3d(-8px, 0, 0); } 40%, 60% { transform: translate3d(8px, 0, 0); } }
.rp-splash { position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; gap: 22px; background: rgba(20, 22, 30, .78); color: #fff; animation: rp-splash 2.2s ease-out forwards; pointer-events: none; }
.rp-splash-vs { font: 900 3.2rem var(--font-head); color: var(--gold); letter-spacing: .04em; text-shadow: 0 3px 0 rgba(0,0,0,.35); }
.rp-splash img { width: 160px; height: 160px; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0,0,0,.5)); }
.rp-splash-text { display: flex; flex-direction: column; gap: 2px; }
.rp-splash-role { font: 800 .8rem var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.rp-splash-text strong { font: 700 2.4rem var(--font-head); line-height: 1.05; }
.rp-splash-sub { font-size: .9rem; color: rgba(255,255,255,.85); }
@keyframes rp-splash { 0% { opacity: 0; } 10% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
.rp-scrubrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.rp-scrub { width: 100%; accent-color: var(--red); height: 22px; margin: 0; }
.rp-scrubout { font: 700 .82rem var(--font-body); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-timeline { position: relative; display: flex; height: 34px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.rp-tl-boss { position: relative; height: 100%; border-right: 1px solid var(--line); cursor: pointer; min-width: 0; }
.rp-tl-boss:last-of-type { border-right: 0; }
.rp-tl-boss.cur { background: color-mix(in srgb, var(--gold) 28%, var(--surface)); }
.rp-tl-boss:hover { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); }
.rp-tl-name { position: absolute; left: 6px; top: 2px; font: 800 .68rem var(--font-body); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); pointer-events: none; white-space: nowrap; overflow: hidden; max-width: calc(100% - 8px); text-overflow: ellipsis; }
.rp-tl-turn { position: absolute; bottom: 0; width: 1px; height: 9px; border: 0; padding: 0; background: var(--ink-3); opacity: .55; cursor: pointer; }
.rp-tl-turn.done { background: var(--ok); opacity: .9; }
.rp-tl-mark { position: absolute; bottom: 10px; width: 9px; height: 9px; margin-left: -4px; border-radius: 50%; border: 1.5px solid var(--surface); padding: 0; cursor: pointer; z-index: 2; }
.rp-tl-mark.crit { background: var(--gold); } .rp-tl-mark.ko { background: var(--ink-3); } .rp-tl-mark.death { background: var(--bad); width: 12px; height: 12px; margin-left: -6px; bottom: 8px; } .rp-tl-mark.switch { background: var(--blue); } .rp-tl-mark.sash { background: var(--warn); }
.rp-tl-pos { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--red); z-index: 3; pointer-events: none; transition: left .12s linear; }
.rp-riskwrap { display: inline-flex; gap: 6px; align-items: center; }
.rp-keys { margin: -4px 0 8px; }
/* theater: the player alone, big, header and footer out of the way */
body.rp-theater { overflow: hidden; }
body.rp-theater .rp-player { position: fixed; inset: 0; z-index: 120; background: var(--bg); padding: 12px clamp(12px, 3vw, 40px); overflow: auto; max-width: none; margin: 0; }
body.rp-theater .rp-arena { grid-template-columns: minmax(0, 1fr); }
body.rp-theater .rp-arena .rp-stage { min-height: min(68vh, 720px); max-width: 1200px; margin: 0 auto; }
body.rp-theater .rp-side { display: none; }
body.rp-theater .rp-stand { width: 272px; height: 272px; } body.rp-theater .rp-art { width: 260px; height: 260px; }
body.rp-theater .sh, body.rp-theater .sh-foot, body.rp-theater .fab, body.rp-theater .mm { display: none !important; }
@media (max-width: 760px) {
  .rp-banner { grid-template-columns: 56px minmax(0, 1fr); } .rp-banner-art { width: 56px; height: 56px; } .rp-banner-name { font-size: 1.2rem; } .rp-banner-prog { grid-column: 1 / -1; justify-content: flex-start; }
  .rp-arena .rp-stage { min-height: 400px; }
  .rp-stand { width: 150px; height: 150px; } .rp-art { width: 140px; height: 140px; }
  .rp-splash { gap: 12px; flex-wrap: wrap; text-align: center; justify-content: center; } .rp-splash img { width: 110px; height: 110px; } .rp-splash-text strong { font-size: 1.6rem; } .rp-splash-vs { font-size: 2.2rem; }
  .rp-timeline { height: 28px; } .rp-tl-turn { display: none; }
  .rp-keys { display: none; }
  body.rp-theater .rp-stand { width: 170px; height: 170px; } body.rp-theater .rp-art { width: 160px; height: 160px; }
}
@media (prefers-reduced-motion: reduce) { .rp-splash { animation: none; opacity: 1; } .rp-stand.shake { animation: none; } .rp-tl-pos { transition: none; } }
/* ---- Dex › Pokémon ---- */
.dx-tools .tr-tools { margin-bottom: 8px; }
/* ---- v12.11 the Pokédex tile: one fixed rhythm top-down, so a row of tiles lines up and only a 4× pops ----
   rows: meta 16 · art disc 82 · name 22 · types 24 · matchups (auto). Top-aligned: a tile with fewer matchups ends early
   instead of floating. The disc behind the art is tinted in the Pokémon's own type colours (--t1/--t2 from typeRing) —
   the type is readable before the label is. WEAK (what kills it) sits above HITS (what it kills); glyph discs, 18 px
   on defence and 15 px on offence, so the hierarchy is carried by size and position rather than by louder colour. */
.dx-list.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; align-items: stretch; }
.dx-list.list { display: flex; flex-direction: column; gap: 6px; }
.dx-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 16px 82px 22px 24px auto; align-content: start; justify-items: center; row-gap: 3px; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 8px 10px 10px; cursor: pointer; color: var(--ink); text-align: center; font: inherit; max-width: none; margin: 0; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.dx-card:hover { border-color: var(--ink-3); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, .10); }
.dx-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.dx-card.post { opacity: .78; }
.dx-top { width: 100%; height: 16px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.dx-num { font: 700 .68rem var(--font-body); color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.dx-tag { font: 800 .54rem var(--font-body); text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; line-height: 1.3; white-space: nowrap; }
.dx-tag.rare { color: var(--gold-ink); border-color: var(--gold); background: color-mix(in srgb, var(--gold) 40%, transparent); }
.dx-stage { position: relative; width: 82px; height: 82px; display: grid; place-items: center; border-radius: 50%; --t1: #999; --t2: #999; background: radial-gradient(circle at 50% 44%, color-mix(in srgb, var(--t1) 24%, transparent) 0 50%, color-mix(in srgb, var(--t2) 12%, transparent) 60%, transparent 71%); }
.dx-sprite { width: 72px; height: 72px; image-rendering: pixelated; position: relative; }
.dx-name { font: 700 .95rem var(--font-head); line-height: 22px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-types { height: 24px; align-items: center; }
.dx-match { width: 100%; display: grid; row-gap: 3px; margin-top: 4px; padding-top: 7px; border-top: 1px dashed var(--line); }
.wk2.dots { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; column-gap: 8px; min-height: 20px; }
.wk2.dots .wk2-lbl { font: 800 .56rem var(--font-body); letter-spacing: .4px; text-align: left; }
.wk2.dots:not(.hits) .wk2-lbl { color: var(--bad); }
.wk2.dots.hits .wk2-lbl { color: var(--ok); }
.wk2.dots .wk2-types { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 4px; }
.wk2.dots.hits .wk2-types { gap: 3px 3px; }
.wk2.dots .type-icon { width: 18px; height: 18px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .10), 0 1px 1px rgba(0, 0, 0, .12); }
.wk2.dots.hits .type-icon { width: 15px; height: 15px; }
.wk2.dots .type-icon.x4 { position: relative; margin-right: 6px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--bad); }
.wk2.dots .type-icon.x4::after { content: "4×"; position: absolute; right: -9px; top: -7px; font: 800 .5rem var(--font-body); line-height: 1; background: var(--bad); color: #fff; border-radius: 999px; padding: 2px 3px 2px; box-shadow: 0 0 0 1.5px var(--surface); }
.wk2.dots .wk2-more { font-size: .54rem; padding: 1px 5px; }
.wk2.dots .wk2-none { font-size: .58rem; }
:root[data-theme="dark"] .wk2.dots .type-icon { box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), 0 1px 1px rgba(0, 0, 0, .4); }
:root[data-theme="dark"] .wk2.dots .type-icon.x4 { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--bad); }
/* the list view keeps the same parts in one row: number · art · name · types · matchups · stats */
.dx-list.list .dx-card { grid-template-columns: 52px 52px 11em auto minmax(0, 1fr) auto; grid-template-rows: auto; justify-items: start; align-items: center; gap: 10px; padding: 6px 12px; text-align: left; }
.dx-list.list .dx-top { width: auto; height: auto; flex-direction: column; align-items: flex-start; gap: 2px; }
.dx-list.list .dx-stage { width: 52px; height: 52px; }
.dx-list.list .dx-sprite { width: 48px; height: 48px; }
.dx-list.list .dx-match { width: auto; margin: 0; padding: 0; border: 0; row-gap: 2px; }
.dx-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) auto; gap: 6px; align-items: center; width: 100%; }
.dx-stat { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) 2.2em; gap: 4px; align-items: center; font-size: .72rem; }
.dx-stat-l { color: var(--ink-3); font-weight: 800; } .dx-stat b { font-variant-numeric: tabular-nums; text-align: right; }
.dx-stat-bar { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.dx-stat-fill { display: block; height: 100%; border-radius: 4px; }
.dx-stat-fill.s1 { background: #d9534f; } .dx-stat-fill.s2 { background: #f0ad4e; } .dx-stat-fill.s3 { background: #e8c93a; } .dx-stat-fill.s4 { background: #8fc14b; } .dx-stat-fill.s5 { background: #4ca864; } .dx-stat-fill.s6 { background: #2f8fd0; }
.dx-bst { font: 700 .75rem var(--font-body); color: var(--ink-2); white-space: nowrap; }
@media (max-width: 760px) {
  .dx-list.grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
  .dx-card { grid-template-rows: 14px 66px 20px 22px auto; padding: 6px 7px 8px; row-gap: 2px; border-radius: 12px; }
  .dx-top { height: 14px; } .dx-num { font-size: .62rem; } .dx-tag { font-size: .5rem; padding: 0 5px; }
  .dx-stage { width: 66px; height: 66px; } .dx-sprite { width: 56px; height: 56px; }
  .dx-name { font-size: .8rem; line-height: 20px; } .dx-types { height: 22px; }
  .dx-match { margin-top: 2px; padding-top: 5px; row-gap: 2px; }
  .wk2.dots { grid-template-columns: 24px minmax(0, 1fr); column-gap: 6px; min-height: 18px; }
  .wk2.dots .wk2-lbl { font-size: .5rem; letter-spacing: .2px; }
  .wk2.dots .wk2-types { gap: 2px 3px; }
  .wk2.dots .type-icon { width: 16px; height: 16px; } .wk2.dots.hits .type-icon { width: 14px; height: 14px; }
  .wk2.dots .type-icon.x4 { margin-right: 5px; } .wk2.dots .type-icon.x4::after { right: -8px; top: -6px; font-size: .46rem; }
  .dx-list.list .dx-card { grid-template-columns: 40px 48px minmax(0, 1fr); } .dx-list.list .dx-types, .dx-list.list .dx-match, .dx-list.list .dx-stats { grid-column: 2 / -1; } .dx-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dx-bst { grid-column: 1 / -1; }
}
/* ---- Dex › Evolutions ---- */
.ev-list { display: flex; flex-direction: column; gap: 8px; }
.ev-family { padding: 10px 14px; }
.ev-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.ev-stage { display: flex; flex-direction: column; gap: 6px; }
.ev-cell { display: flex; align-items: center; gap: 10px; }
.ev-mon { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 3px 10px 3px 4px; cursor: pointer; color: var(--ink); font: 700 .9rem var(--font-head); }
.ev-mon:hover { border-color: var(--ink-3); }
.ev-mon img { width: 44px; height: 44px; image-rendering: pixelated; }
.ev-how { display: inline-flex; flex-direction: column; align-items: center; min-width: 7em; max-width: 12em; text-align: center; font: 600 .74rem var(--font-body); color: var(--ink-2); line-height: 1.2; }
.ev-arrow { font-size: 1.1rem; color: var(--ink-3); line-height: 1; }
.ev-how.k-stone .ev-howtext { color: #7b4fc4; } .ev-how.k-trade .ev-howtext { color: var(--blue); } .ev-how.k-friendship .ev-howtext { color: var(--pearl); } .ev-how.k-place .ev-howtext { color: var(--ok); } .ev-how.k-item .ev-howtext { color: var(--warn); }
.ev-family.single { opacity: .85; }
/* ---- Dex › EV training ---- */
.evt-out { display: flex; flex-direction: column; gap: 8px; }
.evt-row { padding: 10px 14px; }
.evt-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.evt-score { margin-left: auto; font: 700 .78rem var(--font-body); color: var(--ok); white-space: nowrap; }
/* ---- Trainers: "show every team" strips ---- */
.tr-teamstrip { display: flex; flex-direction: column; gap: 2px; margin: -6px 0 10px; padding: 6px 12px 8px 54px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; background: var(--surface-2); }
.tr-ts-mon { display: grid; grid-template-columns: 13em auto minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; padding: 3px 0; border-top: 1px solid var(--line); font-size: .86rem; }
.tr-ts-mon:first-child { border-top: 0; }
.tr-ts-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-align: left; }
.tr-ts-name img { width: 36px; height: 36px; image-rendering: pixelated; }
.tr-ts-lv { color: var(--ink-3); font-weight: 600; }
.tr-ts-moves { display: flex; flex-wrap: wrap; gap: 2px 10px; }
@media (max-width: 760px) { .tr-teamstrip { padding-left: 12px; } .tr-ts-mon { grid-template-columns: 1fr; gap: 2px; padding: 6px 0; } }

/* ---------- v12.2 — the team tiles say "tap me": a small corner pill (+) that grows into "Stats & moves" on hover/focus,
   turns into × while the card is open, and pops in with a little stagger when a team appears (motion-gated) ---------- */
.boss-mon { position: relative; overflow: visible; }
.boss-mon .bm-hint { position: absolute; top: 5px; right: 5px; z-index: 1; display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); font: 800 .66rem/1 var(--font-head); letter-spacing: .02em; box-shadow: 0 1px 2px rgba(0,0,0,.08); pointer-events: none;
  transition: color .2s, background-color .2s, border-color .2s, box-shadow .2s, transform .25s cubic-bezier(.34,1.56,.64,1); }
.boss-mon .bm-plus { display: inline-block; width: 10px; height: 10px; position: relative; flex: none; transition: transform .28s cubic-bezier(.34,1.56,.64,1); }
.boss-mon .bm-plus::before, .boss-mon .bm-plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; border-radius: 1px; background: currentColor; transform: translate(-50%, -50%); }
.boss-mon .bm-plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.boss-mon .bm-txt { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; transition: max-width .3s ease, opacity .2s ease, margin .3s ease; }
.boss-mon:hover .bm-hint, .boss-mon:focus-visible .bm-hint { color: var(--red); border-color: var(--red); box-shadow: 0 3px 8px rgba(0,0,0,.14); transform: translateY(-1px); }
.boss-mon:hover .bm-txt, .boss-mon:focus-visible .bm-txt { max-width: 96px; opacity: 1; margin-right: 2px; }
.boss-mon.open .bm-hint { color: var(--surface); background: var(--ink); border-color: var(--ink); }
.boss-mon.open .bm-plus { transform: rotate(45deg); }
.boss-mon.open .bm-txt { max-width: 0; opacity: 0; margin-right: 0; }
.boss-mon.ace .bm-hint { top: 4px; right: 4px; }
/* the pills arrive a beat after the tile, one after another; the first one gives a little wave so the eye finds it */
@keyframes bm-pop { from { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } to { transform: scale(1); opacity: 1; } }
@keyframes bm-wave { 0%, 100% { transform: rotate(0) scale(1); } 20% { transform: rotate(-12deg) scale(1.18); } 45% { transform: rotate(10deg) scale(1.12); } 70% { transform: rotate(-5deg) scale(1.06); } }
.boss-mon .bm-hint { animation: bm-pop .45s cubic-bezier(.34,1.56,.64,1) both; animation-delay: calc(.25s + var(--bm-i, 0) * .07s); }
.boss-mon:first-child .bm-plus { animation: bm-wave .9s ease-in-out 1.1s 1; }
@media (hover: none) { .boss-mon .bm-txt { display: none; } }
@media (prefers-reduced-motion: reduce) { .boss-mon .bm-hint, .boss-mon:first-child .bm-plus { animation: none; } .boss-mon .bm-hint, .boss-mon .bm-plus, .boss-mon .bm-txt { transition: none; } }

/* ---------- v12.2 — Replay: build your own team ---------- */
.rp-builder-host { margin: var(--s3, 12px) 0; }
.rp-build { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 var(--s4, 16px) var(--s4, 16px); }
.rp-build > summary { padding: var(--s3, 12px) 0; cursor: pointer; font-size: 1.05rem; }
.rp-build > summary::before { content: none; }
.rpb-top { display: flex; flex-wrap: wrap; gap: var(--s3, 12px) var(--s4, 16px); align-items: flex-end; margin-bottom: var(--s3, 12px); }
.rpb-top .lbl { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.rpb-title { min-width: 200px; }
.rpb-bag { width: 72px; }
.rpb-topbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.rpb-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s3, 12px); }
.rpb-slot { border: 1px solid var(--line); border-radius: 12px; padding: var(--s3, 12px); background: var(--surface-2); display: flex; flex-direction: column; gap: var(--s2, 8px); min-width: 0; }
.rpb-slot.empty { justify-content: center; border-style: dashed; }
.rpb-head { display: flex; align-items: center; gap: var(--s2, 8px); min-width: 0; }
.rpb-n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--surface); font: 800 .72rem/22px var(--font-head); text-align: center; }
.rpb-art { flex: none; width: 72px; height: 72px; object-fit: contain; }
.rpb-id { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rpb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rpb-lv { width: 64px; }
.rpb-nick { width: 120px; }
.rpb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.rpb-grid .lbl { display: flex; flex-direction: column; gap: 3px; font-size: .74rem; font-weight: 700; color: var(--ink-3); min-width: 0; }
.rpb-grid .lbl > select, .rpb-grid .lbl > .combo { min-width: 0; width: 100%; }
.rpb-grid select, .rpb-grid .combo-input, .rpb-moves .combo-input { font-size: .86rem; }
.rpb-stats { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .78rem; font-variant-numeric: tabular-nums; }
.rpb-stat b { color: var(--ink-3); font-weight: 800; font-size: .72rem; }
.rpb-moves { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rpb-moves .combo { min-width: 0; }
.rpb-movefacts { font-size: .76rem; }
.rpb-actions { display: flex; gap: 6px; }
.rpb-opt { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.rpb-opt img { width: 28px; height: 28px; image-rendering: pixelated; }
.rpb-go { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2, 8px) var(--s4, 16px); margin-top: var(--s4, 16px); }
.rpb-cover { margin-top: var(--s3, 12px); font-size: .86rem; }
.rpb-cover summary { cursor: pointer; font-weight: 700; }
.rpb-cover ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }
.rpb-cover li { margin: 3px 0; }
@media (max-width: 760px) { .rpb-slots { grid-template-columns: 1fr; } .rpb-grid, .rpb-moves { grid-template-columns: 1fr; } .rpb-topbtns { margin-left: 0; } }
/* v12.2 — Dex card moves: the journey column and the over-cap level */
.dt-lv.over { color: var(--red); font-weight: 800; }
.dt-journey { cursor: pointer; font: 700 .74rem/1.25 var(--font-body, inherit); text-transform: none; white-space: normal; text-align: left; }
.opt-tag.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.opt-tag.warn { background: var(--warn-bg, color-mix(in srgb, var(--warn) 14%, var(--surface))); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.opt-tag.quiet { color: var(--ink-3); }

/* ---------- v12.3 — the big drawers (Compare, the Pokémon card) stand on the floor and reach up to the header: a fixed
   height, never a half-sheet sitting low on the screen. The small info cards (a move, an item…) stay bottom sheets sized
   by their content, capped under the header. ---------- */
.cmp { align-items: flex-start; padding-top: calc(var(--shell-top) + 10px); }
.cmp:not(.info) .cmp-panel { height: calc(100vh - var(--shell-top) - 10px); height: calc(100dvh - var(--shell-top) - 10px); max-height: none; }
.cmp.info { align-items: flex-end; padding-top: 0; }
.cmp.info .cmp-panel { max-height: calc(100vh - var(--shell-top) - 10px); max-height: calc(100dvh - var(--shell-top) - 10px); }
@media (max-width: 760px) {
  .cmp { padding-top: calc(var(--shell-top) + 4px); }
  .cmp:not(.info) .cmp-panel { height: calc(100vh - var(--shell-top) - 4px); height: calc(100dvh - var(--shell-top) - 4px); border-radius: 16px 16px 0 0; }
  .cmp.info .cmp-panel { max-height: calc(100dvh - var(--shell-top) - 4px); border-radius: 16px 16px 0 0; }
}

/* ---------- v12.3 — the companion map's attention: fades in when called for, tucks itself away when you look elsewhere ---------- */
.mm { opacity: var(--mm-op, .96); transition: opacity .5s ease, transform .5s ease, visibility 0s linear 0s; will-change: opacity, transform; }
.mm.mm-dozing { opacity: 0 !important; transform: translateY(12px) scale(.985); pointer-events: none; visibility: hidden; transition: opacity .55s cubic-bezier(.4, 0, .6, 1), transform .55s cubic-bezier(.4, 0, .6, 1), visibility 0s linear .55s; }
@keyframes mm-in { from { opacity: 0; transform: translateY(16px) scale(.96); } 60% { opacity: var(--mm-op, .96); } to { opacity: var(--mm-op, .96); transform: none; } }
.mm.mm-in { animation: mm-in .46s cubic-bezier(.2, .8, .2, 1) both; }
.mm.mm-in.mm-flash { animation: mm-in .46s cubic-bezier(.2, .8, .2, 1) both, mmflash .7s ease-out .3s; }
.mm-auto { font: 600 11px var(--font-body); color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 2px 4px; max-width: 150px; }
/* the Poké Ball carries a small blue badge while the map is tucked away; the ball nudges once when it happens */
.fab.has-map::after { content: ""; position: absolute; right: 1px; top: 1px; width: 18px; height: 18px; border-radius: 50%; background: #3466af; border: 3px solid var(--surface); box-shadow: 0 0 0 0 rgba(52, 102, 175, .55); animation: mm-badge 1.6s ease-out 2; }
@keyframes mm-badge { 0% { box-shadow: 0 0 0 0 rgba(52, 102, 175, .55); } 100% { box-shadow: 0 0 0 14px rgba(52, 102, 175, 0); } }
@keyframes fab-nudge { 0%, 100% { transform: none; } 25% { transform: translateY(-5px) rotate(-8deg); } 55% { transform: translateY(0) rotate(6deg); } 80% { transform: rotate(-3deg); } }
.fab.fab-nudge .fab-ball { animation: fab-nudge .75s ease-in-out 1; }
/* the two hints */
.mm-blurb { position: fixed; z-index: 86; max-width: 290px; background: var(--ink); color: var(--surface); border-radius: 12px; padding: 8px 30px 8px 12px; font: 600 .8rem/1.35 var(--font-body); box-shadow: 0 8px 24px rgba(0, 0, 0, .22); opacity: 0; transform: translateY(6px); transition: opacity .28s ease, transform .28s cubic-bezier(.2, .8, .2, 1); }
.mm-blurb.in { opacity: 1; transform: none; }
.mm-blurb::after { content: ""; position: absolute; width: 12px; height: 12px; background: var(--ink); transform: rotate(45deg); }
.mm-blurb-open::after { right: 22px; bottom: -5px; }
.mm-blurb-open.below::after { right: 22px; top: -5px; bottom: auto; }
.mm-blurb-dozed { right: 104px; bottom: calc(var(--shell-bottom) + 30px + env(safe-area-inset-bottom, 0px)); }
.mm-blurb-dozed::after { right: -5px; top: 50%; margin-top: -6px; }
.mm-blurb-x { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--surface); font: 700 15px/22px var(--font-head); cursor: pointer; opacity: .8; }
.mm-blurb-x:hover { opacity: 1; background: rgba(255, 255, 255, .15); }
@media (max-width: 760px) { .mm-blurb { max-width: min(290px, calc(100vw - 24px)); } .mm-blurb-dozed { right: 84px; } .mm-auto { max-width: 120px; } }
@media (prefers-reduced-motion: reduce) { .mm, .mm.mm-dozing, .mm-blurb { transition: none; } .mm.mm-in, .fab.fab-nudge .fab-ball, .fab.has-map::after { animation: none; } }

/* ---------- v12.3 — phone pass ---------- */
/* drawers stand between the header and the footer; the Poké Ball steps aside while one is open */
.cmp { bottom: var(--shell-bottom); }
.cmp:not(.info) .cmp-panel { height: calc(100vh - var(--shell-top) - var(--shell-bottom) - 10px); height: calc(100dvh - var(--shell-top) - var(--shell-bottom) - 10px); }
.cmp.info .cmp-panel { max-height: calc(100vh - var(--shell-top) - var(--shell-bottom) - 10px); max-height: calc(100dvh - var(--shell-top) - var(--shell-bottom) - 10px); }
body.cmp-open .fabs, body.cmp-open .mm-blurb { opacity: 0; pointer-events: none; transition: opacity .2s; }
/* the pages row: a soft fade on the right says "this scrolls" (phones), and the page pill is dropped when a section has one page */
.sh-row3 { position: relative; }
.sh-pages.can-scroll { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.sh-pages.at-end { -webkit-mask-image: none; mask-image: none; }
/* footer: short labels on phones, no overflow */
.sh-credits .sh-short { display: none; }
@media (max-width: 760px) {
  .cmp:not(.info) .cmp-panel { height: calc(100vh - var(--shell-top) - var(--shell-bottom) - 4px); height: calc(100dvh - var(--shell-top) - var(--shell-bottom) - 4px); }
  .cmp.info .cmp-panel { max-height: calc(100dvh - var(--shell-top) - var(--shell-bottom) - 4px); }
  .sh-foot-in { gap: 8px; flex-wrap: nowrap; overflow: hidden; }
  .sh-foot-brand { flex: none; white-space: nowrap; }
  .sh-foot-links { gap: 9px; margin-left: auto; flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; }
  .sh-foot-links .linkish, .sh-foot-links a { font-size: .74rem; }
  .sh-foot-sec { display: none; }
  .sh-credits .sh-full { display: none; } .sh-credits .sh-short { display: inline; }
  /* the Pokémon card's hero stacks on phones (the two-column hero squeezed the name off the edge) */
  .dex-hero { grid-template-columns: 1fr; gap: 10px; } .dex-sprite-wrap { justify-self: center; } .dex-name { font-size: 1.6rem; overflow-wrap: anywhere; }
  /* trainers: the filter chips become one scrolling row instead of three stacked rows */
  .tr-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .tr-filters::-webkit-scrollbar { display: none; } .tr-filters .chip { flex: none; }
  .tr-loc-head { gap: 6px 10px; } .tr-loc-head .meta-note { font-size: .78rem; }
  /* replay: controls in two columns; the builder's slot cards already stack */
  .rp-controls { display: grid; grid-template-columns: 1fr 1fr; } .rp-controls .rp-seedwrap { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; }
  .rp-controls .rp-sel, .rp-controls .rp-check { min-width: 0; width: 100%; box-sizing: border-box; }
}
.rp-honest > summary { cursor: pointer; font-weight: 700; } .rp-honest > summary::before { content: none; } .rp-honest > p { margin: 6px 0 0; }
/* replay on narrow screens: the arena stacks (stage over the side panel) and the stage goes one column — the v2 wide-screen
   rules above had out-ranked the earlier phone rules */
@media (max-width: 900px) { .rp-arena { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .rp-arena .rp-stage { grid-template-columns: 1fr; min-height: 0; justify-items: stretch; } .rp-stand { width: 160px; height: 160px; } .rp-art { width: 150px; height: 150px; } .rp-them, .rp-us { max-width: none; } }
@media (max-width: 640px) {
  /* each side: panel and stand side by side but inside the column — the stand shrinks first, the panel never leaves the edge */
  .rp-slot { width: 100%; max-width: 100%; justify-self: stretch; align-items: flex-end; gap: 8px; }
  .rp-them { justify-content: flex-end; } .rp-us { justify-content: flex-start; }
  .rp-stand { width: 136px; height: 136px; flex: none; } .rp-art { width: 128px; height: 128px; }
  .rp-panel { width: auto; flex: 1 1 auto; min-width: 0; max-width: 210px; }
}
@media (max-width: 760px) { .mm-foot { flex-wrap: wrap; row-gap: 4px; } .mm-auto { order: 5; flex: 1 1 100%; max-width: none; } .mm-open { white-space: nowrap; } }

/* ---------- v12.4 — Replay: the Forks panel (every coin flip, flippable) and the engine's new states ---------- */
.rp-forksbox { margin: var(--s2, 8px) 0 var(--s3, 12px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 var(--s3, 12px) var(--s3, 12px); }
.rp-forksbox > summary { padding: var(--s2, 8px) 0; cursor: pointer; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rp-forksbox > summary::before { content: none; }
.rp-forksbox .rp-sel.small { font-size: .78rem; padding: 2px 6px; margin-left: auto; }
.rp-forkhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; }
.rp-forklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 320px; overflow: auto; }
.rp-fork { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; background: var(--surface-2); font-size: .82rem; }
.rp-fork.past { opacity: .62; }
.rp-fork.forced { outline: 2px solid var(--gold); }
.rp-fork-at { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; font: 800 .7rem var(--font-head); padding: 2px 6px; cursor: pointer; color: var(--ink-2); }
.rp-fork-label { min-width: 0; overflow-wrap: anywhere; }
.rp-fork-out.yes { color: var(--ok); } .rp-fork-out.no { color: var(--ink-3); }
.rp-fork-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.rp-fork-acts .btn.small { padding: 3px 8px; font-size: .74rem; white-space: nowrap; }
.rp-forkcmp { border: 2px solid var(--gold); border-radius: 12px; padding: var(--s3, 12px); margin: 6px 0 10px; background: var(--surface); }
.rp-forkcmp-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.rp-forkcmp-verdict { margin: 6px 0; font-weight: 700; } .rp-forkcmp-verdict.ok { color: var(--ok); } .rp-forkcmp-verdict.bad { color: var(--bad); }
.rp-forkcmp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3, 12px); }
.rp-forkcmp-cols .rp-risklist li.diff { background: var(--warn-bg); border-radius: 6px; }
.rp-forkcmp-ev { list-style: none; margin: 6px 0 0; padding: 6px 0 0; border-top: 1px dashed var(--line); font-size: .78rem; display: grid; gap: 2px; }
.rp-forkcmp-ev li.ev-faint { color: var(--bad); font-weight: 700; } .rp-forkcmp-ev li.ev-say { color: var(--ink-3); font-style: italic; } .rp-forkcmp-ev li.ev-switch, .rp-forkcmp-ev li.ev-disable { color: var(--ink); font-weight: 700; } .rp-forkcmp-ev li.ev-turn { color: var(--ink-3); font-weight: 800; text-transform: uppercase; font-size: .7rem; margin-top: 4px; }
.rp-forkcmp-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.rp-tl-mark.theirs { background: var(--purple, #735797); } .rp-tl-mark.disable { background: #735797; border-radius: 2px; }
.rp-stand.st-frz .rp-art { filter: saturate(.4) brightness(1.15) drop-shadow(0 0 6px #96d9d6); }
@media (max-width: 760px) { .rp-forkcmp-cols { grid-template-columns: 1fr; } .rp-fork { grid-template-columns: auto minmax(0, 1fr); } .rp-fork-acts { grid-column: 1 / -1; justify-content: flex-start; } }

/* ===== v12.5 — at a glance: what a Pokémon is and what hits it (every tile), items along the ordering ===== */
/* the strip: [own type glyphs] ◎ [weak-to glyphs]; 4× ringed red; "+n" folds the rest; the tooltip spells it out */
.wk { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px 2px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); vertical-align: middle; line-height: 1; white-space: nowrap; }
.wk .type-icon { width: 16px; height: 16px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .9), 0 1px 1px rgba(0, 0, 0, .22); }
.wk-own, .wk-weak { display: inline-flex; align-items: center; gap: 2px; }
.wk-own .type-icon { width: 18px; height: 18px; }
.wk-hit { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--ink-3); position: relative; opacity: .8; }
.wk-hit::before, .wk-hit::after { content: ""; position: absolute; left: 50%; top: 50%; background: var(--ink-3); transform: translate(-50%, -50%); }
.wk-hit::before { width: 1.5px; height: 14px; } .wk-hit::after { width: 14px; height: 1.5px; }
.wk .type-icon.x4 { box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--bad), 0 1px 2px rgba(0, 0, 0, .25); }
.wk-more, .wk-none { font: 800 .62rem var(--font-body); color: var(--ink-3); padding: 0 2px; }
.wk.no-own { padding-left: 5px; }
.wk.mini { gap: 2px; padding: 1px 4px 1px 3px; } .wk.mini .type-icon { width: 13px; height: 13px; } .wk.mini .wk-hit { width: 10px; height: 10px; } .wk.mini .wk-hit::before { height: 11px; } .wk.mini .wk-hit::after { width: 11px; } .wk.mini .wk-more { font-size: .56rem; }
:root[data-theme="dark"] .wk .type-icon { box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 1px 1px rgba(0, 0, 0, .4); }
:root[data-theme="dark"] .wk .type-icon.x4 { box-shadow: 0 0 0 1px #000, 0 0 0 3px var(--bad); }
/* the type ring: a soft disc in the Pokémon's colour(s) behind its art — the type readable without a label (--t1/--t2 from Sinnoh.ui.typeRing) */
.boss-mon.typed, .tr-party-mon.typed, .dx-stage.typed { --t1: #999; --t2: #999; }
.boss-mon.typed { background-image: radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--t1) 26%, transparent) 0 30%, transparent 31%), linear-gradient(135deg, color-mix(in srgb, var(--t1) 9%, transparent), color-mix(in srgb, var(--t2) 9%, transparent)); }
.boss-mon.ace.typed { background-color: color-mix(in srgb, var(--red) 8%, var(--surface)); }
.bm-wk { display: block; margin-top: 2px; line-height: 1; }
.boss-mon .bm-wk:empty { display: none; }
.tr-party-mon.typed::before { content: ""; position: absolute; left: 50%; top: 48px; width: 58px; height: 58px; transform: translate(-50%, -50%); border-radius: 50%; z-index: 0; background: conic-gradient(from 200deg, color-mix(in srgb, var(--t1) 34%, transparent) 0 50%, color-mix(in srgb, var(--t2) 34%, transparent) 50% 100%); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--t1) 55%, transparent); }
.tr-party-mon img:first-child { position: relative; z-index: 1; }
.tr-party-mon .wk { margin-top: 2px; }
.tr-party-mon .wk-weak { flex-wrap: wrap; max-width: 60px; justify-content: center; row-gap: 2px; }
.tr-party-mon .wk.mini { white-space: normal; }
.tr-party-mon.typed:has(img.px)::before { top: 34px; width: 50px; height: 50px; }
@media (max-width: 760px) { .tr-party-mon.typed::before { top: 24px; width: 40px; height: 40px; } .tr-party-mon.typed:has(img.px)::before { top: 24px; } .tr-party-mon .wk.mini .type-icon { width: 11px; height: 11px; } .tr-party-mon .wk-weak { max-width: 48px; } }
.tr-ts-mon .wk { margin-left: 4px; }
.dx-card .wk { margin-top: 2px; }
.dx-list.list .dx-card .wk { grid-column: 1; }
/* items along the ordering — a strip under every place head on the Trainers › Story order page */
.tr-items { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -2px 0 10px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.tr-items-lbl { font: 700 .8rem var(--font-head); color: var(--ink-2); white-space: nowrap; }
.tr-items-list { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
.tr-item { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .78rem var(--font-body); cursor: pointer; transition: transform .15s, border-color .15s, opacity .2s; }
.tr-item:hover { transform: translateY(-1px); border-color: var(--ink-3); }
.tr-item .item-img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.tr-item .item-img.missing { visibility: hidden; width: 4px; }
.tr-item.done { opacity: .5; } .tr-item.done .tr-item-name { text-decoration: line-through; }
.tr-item.done::after { content: "✓"; font-weight: 800; color: var(--ok); margin-left: 2px; }
.tr-item.hidden-item { border-style: dashed; }
.tr-item.later { color: var(--ink-3); background: var(--surface-2); }
.tr-item-tag { font: 800 .6rem var(--font-body); text-transform: uppercase; letter-spacing: .4px; padding: 1px 5px; border-radius: 999px; background: var(--warn-bg, #fff3c4); color: var(--warn); }
.tr-item-tag.later { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }
.tr-items-more { font-size: .78rem; margin-left: auto; }
@media (max-width: 760px) { .tr-items { padding: 6px 8px; gap: 4px 6px; } .tr-item { font-size: .72rem; } .tr-item .item-img { width: 18px; height: 18px; } }
/* ---- v12.5 replay: the room each fight is drawn in, type-coloured platforms, a log you can seek with ---- */
.rp-stage[data-room]::before { background-image: var(--rp-room); background-size: cover; background-position: center bottom; background-repeat: no-repeat; opacity: 1; }
.rp-stage[data-room="forest"] { --rp-room: url("/assets/art/rooms/forest.svg"); }
.rp-stage[data-room="canyon"] { --rp-room: url("/assets/art/rooms/canyon.svg"); }
.rp-stage[data-room="lava"] { --rp-room: url("/assets/art/rooms/lava.svg"); }
.rp-stage[data-room="library"] { --rp-room: url("/assets/art/rooms/library.svg"); }
.rp-stage[data-room="hall"] { --rp-room: url("/assets/art/rooms/hall.svg"); }
.rp-stage[data-room] { border-color: color-mix(in srgb, var(--line) 60%, transparent); }
:root[data-theme="dark"] .rp-stage[data-room]::before { filter: brightness(.48) saturate(.8); }
/* the platform: an ellipse in the Pokémon's type colour(s) under its feet (--aura / --aura2 set per slot), the soft shadow on top */
.rp-plat { position: absolute; left: 50%; bottom: 0; width: 164px; height: 44px; transform: translateX(-50%); border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--aura, #9a9a9a) 42%, #fff) 0 38%, color-mix(in srgb, var(--aura2, var(--aura, #9a9a9a)) 34%, #fff) 60%, color-mix(in srgb, var(--aura2, var(--aura, #9a9a9a)) 18%, transparent) 78%, transparent 100%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--aura, #9a9a9a) 42%, transparent), 0 2px 6px rgba(0, 0, 0, .08); transition: background .4s, box-shadow .4s; }
.rp-plat::after { content: ""; position: absolute; left: 50%; top: 50%; width: 112px; height: 26px; transform: translate(-50%, -50%); border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--aura2, var(--aura, #9a9a9a)) 40%, #fff); opacity: .9; }
.rp-them .rp-plat { width: 150px; height: 40px; }
.rp-stand { padding-bottom: 10px; }
.rp-shadow { bottom: 12px; width: 100px; height: 18px; background: rgba(0, 0, 0, .16); filter: blur(3px); z-index: 0; }
.rp-art { z-index: 1; }
.rp-stand.gone .rp-plat, .rp-stand.faint .rp-plat, .rp-stand.out .rp-plat { opacity: .35; }
:root[data-theme="dark"] .rp-plat { background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--aura, #9a9a9a) 45%, #1a1a22) 0 38%, color-mix(in srgb, var(--aura2, var(--aura, #9a9a9a)) 34%, #1a1a22) 60%, color-mix(in srgb, var(--aura2, var(--aura, #9a9a9a)) 18%, transparent) 78%, transparent 100%); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--aura, #9a9a9a) 55%, transparent); }
:root[data-theme="dark"] .rp-plat::after { border-color: color-mix(in srgb, var(--aura2, var(--aura, #9a9a9a)) 50%, #000); }
:root[data-theme="dark"] .rp-shadow { background: rgba(0, 0, 0, .45); }
/* the log: every line is a seek target — hover lifts it, the line the stage is on is marked */
.rp-line.seek { cursor: pointer; border-radius: 8px; transition: background-color .15s, transform .15s; }
.rp-line.seek:hover, .rp-line.seek:focus-visible { background: color-mix(in srgb, var(--blue) 10%, var(--surface)); outline: none; }
.rp-line.seek:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }
.rp-line.seek::before { content: ""; display: inline-block; width: 0; height: 0; margin-right: 0; border: 4px solid transparent; border-left-color: var(--ink-3); opacity: 0; transition: opacity .15s, margin .15s; vertical-align: middle; }
.rp-line.seek:hover::before { opacity: 1; margin-right: 4px; }
.rp-line.cur { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); box-shadow: inset 3px 0 0 var(--gold); }
.rp-line.cur::before { opacity: 1; margin-right: 4px; border-left-color: var(--ink); }
.rp-log { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { .rp-log { scroll-behavior: auto; } }
/* ---- v12.5 reports: "spot something off?" — the sheet, the flags, the Reports page ---- */
.rep-sheet { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); background: rgba(20, 24, 40, .38); backdrop-filter: blur(2px); animation: rep-fade .18s ease; }
.rep-sheet[hidden] { display: none; }
.rep-box { width: min(560px, 100%); max-height: calc(100vh - 24px); overflow: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 50px rgba(0, 0, 0, .28); padding: 16px 18px 14px; animation: rep-pop .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes rep-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rep-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rep-sheet, .rep-box { animation: none; } }
.rep-form { display: grid; gap: 10px; }
.rep-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rep-head h3 { margin: 0; font: 800 1.2rem var(--font-head); }
.rep-close { font-size: 1.1rem; color: var(--ink-3); }
.rep-ctx { margin: 0; font: 600 .9rem var(--font-body); color: var(--ink-2); padding: 6px 10px; border-radius: 10px; background: var(--surface-2); }
.rep-ctx-lbl { color: var(--ink-3); }
.rep-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.rep-check { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font: 600 .86rem var(--font-body); color: var(--ink); transition: border-color .15s, background-color .15s, transform .15s; user-select: none; }
.rep-check:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.rep-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.rep-check-box { flex: none; width: 20px; height: 20px; border-radius: 7px; border: 2px solid var(--ink-3); position: relative; transition: background-color .15s, border-color .15s; }
.rep-check-box::after { content: ""; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); transition: transform .15s cubic-bezier(.2, .9, .3, 1.4); }
.rep-check:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); }
.rep-check:has(input:checked) .rep-check-box { background: var(--ok); border-color: var(--ok); }
.rep-check:has(input:checked) .rep-check-box::after { transform: rotate(45deg) scale(1); }
.rep-check:has(input:focus-visible) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 35%, transparent); }
.rep-detail { resize: vertical; min-height: 64px; font: 500 .92rem var(--font-body); }
.rep-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rep-who { flex: 1 1 200px; min-width: 0; }
.rep-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rep-send { min-width: 110px; }
.rep-msg { margin: 0; font: 600 .88rem var(--font-body); min-height: 0; }
.rep-msg.ok { color: var(--ok); padding: 8px 10px; border-radius: 10px; background: var(--ok-bg); }
.rep-msg.warn { color: var(--warn); }
.rep-form.sent .rep-checks, .rep-form.sent .rep-detail, .rep-form.sent .rep-row { display: none; }
.rep-foot { margin: 0; }
body.rep-open .fabs, body.rep-open .mm-blurb { visibility: hidden; }
/* the affordances */
.rep-btn::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; background: currentColor; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 2v20h2v-7h11l-2-5 2-5H7V2z'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 2v20h2v-7h11l-2-5 2-5H7V2z'/></svg>") center / contain no-repeat; }
.rep-flag { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 6px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink-3); cursor: pointer; vertical-align: middle; transition: color .15s, border-color .15s, transform .15s, background-color .15s; }
.rep-flag.small { width: 22px; height: 22px; }
.rep-flag-i { width: 12px; height: 12px; background: currentColor; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 2v20h2v-7h11l-2-5 2-5H7V2z'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 2v20h2v-7h11l-2-5 2-5H7V2z'/></svg>") center / contain no-repeat; }
.rep-flag.small .rep-flag-i { width: 10px; height: 10px; }
.rep-flag:hover, .rep-flag:focus-visible { color: var(--red); border-color: var(--red); transform: translateY(-1px) rotate(-8deg); background: color-mix(in srgb, var(--red) 8%, var(--surface)); outline: none; }
.dex-name .rep-flag { vertical-align: 4px; }
.fab-act.fab-report .fab-act-l { color: var(--red-dark, var(--red)); }
.rp-captionrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rp-captionrow .rp-caption { flex: 1 1 320px; margin: 0; }
.rp-captionrow .rep-btn { font-size: .8rem; padding: 4px 10px; }
/* the page */
.rep-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rep-tools .rep-filter { width: auto; }
.rep-legend { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.rep-legend-i { display: inline-flex; align-items: center; gap: 2px; font-size: .78rem; }
.rep-stats { flex-basis: 100%; margin: 0; }
.rep-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.rep-item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; display: grid; gap: 6px; }
.rep-item.mine { border-color: var(--blue); box-shadow: inset 4px 0 0 var(--blue); }
.rep-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rep-item-head > b { font: 800 .95rem var(--font-head); }
.rep-item-ctx { font: 600 .82rem var(--font-body); color: var(--ink-2); padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.rep-item-checks { display: flex; flex-wrap: wrap; gap: 4px; }
.rep-tag { font: 700 .72rem var(--font-body); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.rep-item-detail { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 500 .9rem var(--font-body); }
.rep-item-note { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--info-bg); color: var(--info-ink); font: 500 .88rem var(--font-body); white-space: pre-wrap; overflow-wrap: anywhere; }
.rep-status.ok { background: var(--ok-bg); color: var(--ok); } .rep-status.warn { background: #fff3c4; color: #7a5a00; } .rep-status.quiet { background: var(--surface-2); color: var(--ink-3); }
:root[data-theme="dark"] .rep-status.warn { background: #44380f; color: #ffe08a; }
@media (max-width: 760px) { .rep-box { padding: 14px 14px 12px; border-radius: 16px; } .rep-checks { grid-template-columns: 1fr 1fr; } .rep-check { font-size: .8rem; padding: 6px 8px; } }
/* ---- v12.5.1 "weak to" in words + badges (replaces the glyph strip, which read too small) ---- */
.wk2 { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; line-height: 1; }
.wk2-lbl { font: 800 .62rem var(--font-body); text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); white-space: nowrap; }
.wk2-types { gap: 3px; }
.wk2 .type-badge.abbr { font-size: .66rem; padding: 3px 6px 3px 4px; }
.wk2 .type-badge.x4 { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--bad); }
:root[data-theme="dark"] .wk2 .type-badge.x4 { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--bad); }
.wk2-more { font: 800 .64rem var(--font-body); color: var(--ink-2); padding: 2px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.wk2-none { font: 700 .64rem var(--font-body); color: var(--ink-3); }
/* under a small tile: the label on its own line, the badges stacked two a row, no glyphs (the colour + 3 letters carry it) */
.wk2.tile { flex-direction: column; align-items: center; gap: 3px; margin-top: 4px; }
.wk2.tile .wk2-types { justify-content: center; gap: 3px; max-width: 100%; }
.wk2.tile .type-badge.abbr { padding: 2px 5px; font-size: .62rem; min-width: 34px; }
.wk2.tile .type-badge.abbr::before { display: none; }
.wk2.tile .type-badge:hover { transform: none; box-shadow: none; }
.wk2.tile .type-badge.x4:hover { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--bad); }
.tr-party-mon .wk2.tile { width: 100%; }
.tr-party-mon .wk2-lbl { font-size: .56rem; }
.boss-mon .bm-wk .wk2.tile { margin-top: 2px; }
.boss-mon .wk2.tile .type-badge.abbr::before { display: inline-block; width: 12px; height: 12px; }
.boss-mon .wk2.tile .type-badge.abbr { padding: 2px 6px 2px 3px; }
.tr-ts-mon .wk2.row { margin-left: 6px; }
@media (max-width: 760px) { .tr-party-mon .wk2.tile .type-badge.abbr { min-width: 30px; padding: 1px 4px; font-size: .56rem; } .tr-party-mon .wk2-lbl { font-size: .5rem; } }
/* the old glyph strip is no longer rendered; keep the type disc behind the party sprites */
.wk { display: none; }
/* ---- v12.5.2 friendship moments ---- */
.rp-textbox.friend { border-color: #e2609b; background: #fff0f6; } .rp-textbox.friend .rp-nowmain { color: #b4306d; }
:root[data-theme="dark"] .rp-textbox.friend { background: #3a1a2b; } :root[data-theme="dark"] .rp-textbox.friend .rp-nowmain { color: #ffa7cf; }
.rp-pop.friend { color: #b4306d; background: #fff0f6; border-color: #e2609b; font-size: 1.3rem; }
.rp-line.friend { color: #b4306d; font-weight: 700; } :root[data-theme="dark"] .rp-line.friend { color: #ffa7cf; }
.rp-spark.friendspark { background: #ff86bb; }
/* ---- v12.6 exits: a sheet is never a trap — pinned head with a big ✕, a grip to swipe down, Cancel beside Send, the
   backdrop closes, Esc closes, and the phone's Back button closes it (core's Back tracker) ---- */
.sheet-grip { display: flex; justify-content: center; padding: 6px 0 4px; cursor: grab; touch-action: none; }
.sheet-grip span { width: 44px; height: 5px; border-radius: 3px; background: var(--line); }
.rep-box { padding-top: 0; }
.rep-top { position: sticky; top: 0; z-index: 3; margin: 0 -18px 0; padding: 2px 18px 8px; background: var(--surface); border-bottom: 1px solid var(--line); touch-action: none; cursor: grab; }
.rep-top:active { cursor: grabbing; }
.rep-top .rep-head { padding-top: 2px; }
.rep-close { font-size: 1.35rem; line-height: 1; min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; margin: -8px -10px -8px 0; border-radius: 12px; color: var(--ink-2); cursor: pointer; }
.rep-close:hover, .rep-close:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }
.rep-cancel { min-width: 92px; }
.rep-box.dragging { animation: none; transition: none; }
body.rep-open .consent { visibility: hidden; }   /* the storage notice (z 84) sat over the sheet's Cancel/Send row on a first visit */
@keyframes rep-rise { from { transform: translateY(48px); opacity: .5; } to { transform: none; opacity: 1; } }
@media (max-width: 760px) {
  .rep-sheet { place-items: end center; padding: max(12px, env(safe-area-inset-top)) 0 0; }
  .rep-box { width: 100%; max-height: min(92dvh, calc(100vh - 24px)); border-radius: 20px 20px 0 0; border-bottom: 0; padding: 0 14px calc(14px + env(safe-area-inset-bottom)); animation: rep-rise .24s cubic-bezier(.2, .9, .3, 1); }
  .rep-top { margin: 0 -14px 0; padding: 0 14px 8px; }
  .rep-row { justify-content: flex-end; }
  .rep-who { flex-basis: 100%; }
  .rep-cancel, .rep-send { flex: 1 1 120px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .rep-box { animation: none; } }
/* ---- v12.7 item cards with the whole answer (what · cost · who holds it · give it to · where exactly · growing · family) ---- */
.item-rule { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font: 600 .9rem var(--font-body); color: var(--ink); }
.item-price { margin: 4px 0 0; }
.item-held li, .item-picks li, .item-other li { margin: 0 0 8px; line-height: 1.5; }
.item-held .gt-mon { vertical-align: middle; margin: 0 2px; }
.item-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0 6px 0 4px; vertical-align: middle; }
.item-picks .chip.tiny, .item-tags .chip.tiny { font-size: .7rem; padding: 2px 7px; }
.chip.tiny.quiet { background: var(--surface-2); color: var(--ink-3); border-color: transparent; }
.item-other b { color: var(--ink); }
/* ---- v12.8 one place, the same way everywhere: the location panel (compass · trainers · wild · items · noteworthy) ---- */
.lp { display: grid; gap: 8px; margin: 8px 0 4px; }
.lp-loading { margin: 0; }
.lp-compass { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); }
.lp-compass-lbl { font: 800 .68rem var(--font-body); text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); margin-right: 2px; }
.lp-dir { gap: 6px; } .lp-dir .lp-arrow { font-weight: 900; font-size: 1.05em; line-height: 1; color: var(--blue); } .lp-dir.surf .lp-arrow { color: #2a7fd4; } .lp-dir.ferry .lp-arrow { color: var(--ink-3); } .lp-dir.inside .lp-arrow { color: var(--ink-3); }
.lp-need { font: 700 .66rem var(--font-body); padding: 1px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); }
.lp-sec { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.lp-sec > .lp-sum, .lp-wrap > .lp-wrap-sum, .lp-tr > .lp-tr-sum { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; font: inherit; }
.lp-sec > .lp-sum::-webkit-details-marker, .lp-wrap > .lp-wrap-sum::-webkit-details-marker, .lp-tr > .lp-tr-sum::-webkit-details-marker { display: none; }
.lp-sec > .lp-sum:hover, .lp-wrap > .lp-wrap-sum:hover, .lp-tr > .lp-tr-sum:hover { background: var(--surface-2); border-radius: 12px; }
.lp-sec[open] > .lp-sum .fight-chevron, .lp-wrap[open] > .lp-wrap-sum .fight-chevron, .lp-tr[open] > .lp-tr-sum .fight-chevron { transform: rotate(45deg); }
.lp-sum b { font: 800 .98rem var(--font-head); }
.lp-body { padding: 4px 12px 12px; display: grid; gap: 10px; }
.lp-group .cov-lbl { display: block; margin: 4px 0 6px; }
.lp-wilds, .lp-party { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.lp-wild, .lp-mon { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; align-items: start; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); --t1: var(--line); --t2: var(--line); box-shadow: inset 4px 0 0 var(--t1); }
.lp-wild.typed, .lp-mon.typed { box-shadow: inset 4px 0 0 var(--t1), inset 8px 0 0 var(--t2); }
.lp-mon-pic { border: 0; background: var(--surface-2); border-radius: 12px; padding: 2px; cursor: pointer; display: grid; place-items: center; width: 56px; height: 56px; }
.lp-mon-pic img { width: 52px; height: 52px; image-rendering: pixelated; }
.lp-mon-body { display: grid; gap: 4px; min-width: 0; }
.lp-mon-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } .lp-mon-head b { font: 800 .95rem var(--font-head); }
.lp-mon-lv { font: 700 .78rem var(--font-body); color: var(--ink-2); }
.lp-types { gap: 3px; }
.lp-badges { display: grid; gap: 3px; }
.lp-badges .wk2.tile { display: inline-flex; }
.lp-mon-meta { font-size: .8rem; }
.lp-moves { display: flex; flex-wrap: wrap; gap: 4px; } .lp-move { cursor: pointer; }
.lp-tr { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.lp-tr.done > .lp-tr-sum { opacity: .72; } .lp-tr.done > .lp-tr-sum .lp-tr-name b { text-decoration: line-through; }
.lp-tr.rematch { border-style: dashed; }
.lp-tr-name { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; } .lp-tr-name b { font: 800 .95rem var(--font-head); }
.lp-tr-meta { flex-basis: 100%; }
.lp-tr-party { display: inline-flex; flex-wrap: wrap; gap: 2px; margin-left: auto; } .lp-tr-party img { width: 28px; height: 28px; image-rendering: pixelated; border-radius: 8px; background: var(--surface-2); }
.lp-tick { display: inline-grid; place-items: center; } .lp-tick input { width: 18px; height: 18px; accent-color: var(--ok); }
.lp-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lp-items { display: grid; gap: 4px; }
.lp-item { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 3px 8px; align-items: center; padding: 5px 0; border-top: 1px solid var(--line); }
.lp-item:first-child { border-top: 0; } .lp-item input { width: 16px; height: 16px; accent-color: var(--ok); }
.lp-item-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; } .lp-item-tags, .lp-item-where { grid-column: 2; } .lp-item-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; } .lp-item-tags:empty { display: none; }
.lp-item.done .lp-item-name { text-decoration: line-through; opacity: .7; }
.chip.tiny.later { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); background: var(--warn-bg); }
.lp-note { margin: 0; font-size: .9rem; } .lp-gifts .cov-lbl { display: block; margin-bottom: 6px; }
.lp-wrap { margin: 6px 0 2px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface); }
.lp-wrap > .lp-wrap-sum b { font: 800 .92rem var(--font-head); }
.lp-wrap > div { padding: 0 10px 10px; }
.enc-row .enc-more { grid-column: 1 / -1; }
.tr-compass { margin: 4px 0 8px; } .tr-compass:empty { display: none; }
.wk2.hits .wk2-lbl { color: var(--ok); }
@media (max-width: 760px) {
  .lp-wilds, .lp-party { grid-template-columns: 1fr; }
  .lp-sec > .lp-sum, .lp-wrap > .lp-wrap-sum, .lp-tr > .lp-tr-sum { padding: 10px 10px; }
  .lp-body { padding: 2px 10px 10px; }
  .lp-tr-party { margin-left: 0; flex-basis: 100%; }
}
.lp-sec > .lp-sum::before, .lp-wrap > .lp-wrap-sum::before, .lp-tr > .lp-tr-sum::before, .lp-sec[open] > .lp-sum::before, .lp-wrap[open] > .lp-wrap-sum::before, .lp-tr[open] > .lp-tr-sum::before { content: none; display: none; }
/* ---- v12.9 balance: the same bubbly site, a notch calmer and tighter — one override layer, every page ----
   radius 14→12 · card/section padding and gaps on an 8-pt rhythm · lighter rings · headings closer to their content ·
   phone gutter 12 px. Nothing here changes colour or shape language; it changes how much air sits between things. */
:root { --radius: 12px; }
.card { padding: 14px; margin: 10px 0; border-width: 1.5px; }
@media (min-width: 761px) { .card { padding: clamp(12px, 1.8vw, 18px); } }
details { padding: 8px 12px; margin: 8px 0; border-width: 1.5px; }
.sec { padding: 12px 14px; gap: 8px; margin-top: 10px; border-radius: 12px; }
.sec-h h4 { font-size: 1.05rem; }
h2 { font-size: 1.45rem; margin: 20px 0 8px; }
h3 { font-size: 1.08rem; }
.lead { margin: 2px 0 10px; }
.tab-panel { padding-top: 6px; }
.btn { padding: 7px 12px; border-width: 1.5px; }
.chip { padding-top: 4px; padding-bottom: 4px; }
.tr-loc { margin-bottom: 14px; }
.ar-body { padding-top: 4px; }
.lp { margin: 6px 0 2px; gap: 6px; }
.lp-sec > .lp-sum, .lp-wrap > .lp-wrap-sum, .lp-tr > .lp-tr-sum { padding: 8px 10px; }
.lp-body { padding: 2px 10px 10px; gap: 8px; }
.cmp-body .sec { margin-top: 8px; }
@media (max-width: 760px) {
  :root { --gutter: 12px; }
  .card { padding: 12px; margin: 8px 0; }
  details { padding: 8px 10px; }
  .sec { padding: 10px 12px; }
  h2 { font-size: 1.32rem; margin: 16px 0 6px; }
}
/* the trail */
.trail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line); margin: 0 0 8px; }
.trail-lbl { font: 800 .66rem var(--font-body); text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); }
.trail-chips { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.trail .chip.on { border-color: var(--ink-2); }
.pal-trail { margin: 6px 0 8px; }
.sh-sheet-secname { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.sh-sheet-tip { font-weight: 500; font-size: .76rem; }
/* search results that say where they lead, with their sibling doors */
.pal-item { cursor: pointer; }
.pal-text { display: grid; gap: 2px; min-width: 0; }
.pal-leads { font: 600 .72rem var(--font-body); color: var(--ink-3); }
.pal-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.pal-act { cursor: pointer; } .pal-act:hover, .pal-act:focus-visible { border-color: var(--ink-2); outline: none; }

/* ---- v12.10 the Menu on every screen size: outline · trail · quick actions · on this page ---- */
.sh-sheet-quick { margin: 8px 0 4px; }
.sh-sheet-quick .cov-lbl, .sh-sheet-page .cov-lbl { margin-bottom: 6px; }
.sh-sheet-page { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.sh-sheet-page > summary { display: flex; align-items: baseline; gap: 8px; cursor: pointer; list-style: none; padding: 4px 0; }
.sh-sheet-page > summary::-webkit-details-marker { display: none; }
.sh-sheet-page > summary::before { content: "▸"; color: var(--ink-3); font-size: .8rem; }
.sh-sheet-page[open] > summary::before { content: "▾"; }
.sh-sheet-page .fab-scroll { margin: 6px 0 8px; }
.sh-sheet-page .fab-chapter-list { max-height: 260px; }
@media (min-width: 761px) {
  .sh-sheet { background: rgba(0, 0, 0, .25); }
  .sh-sheet-in { max-width: 760px; margin: 0 0 0 auto; border-radius: 0 0 18px 18px; border-left: 1px solid var(--line); padding: 12px 20px 22px; }
  .sh-sheet-sec { display: inline-block; vertical-align: top; width: calc(50% - 8px); box-sizing: border-box; margin-right: 8px; }
}
/* while the Menu is open nothing floats over it — the medallions, the companion map and its hint wait underneath */
body.sh-sheet-open .fabs, body.sh-sheet-open .mm, body.sh-sheet-open .mm-ball, body.sh-sheet-open .mm-rescue, body.sh-sheet-open .mm-blurb { visibility: hidden; }
.fab-act { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
