/* Pokémon X & Y zone — "Kalos Guide".
   Light 3DS battle-UI look: white panels with a soft bevel, a dark console bezel, the battle command menu
   on the Touch Screen and Holo Caster blue. The X/Y switch sets html[data-xy-version="y"], which swaps
   the accent from X blue to Y red and the hero legendary.
   Sections: tokens · shared parts · chrome · hero · sections · Pokédex · Gyms · party · Holo Caster · menu · save · footer · Kalos map · responsive */

/* ===== Tokens ===== */
body.zone-pokemon-x-and-y {
  color-scheme: light;
  --xy-primary: #1b6fd6;
  --xy-primary-deep: #13509c;
  --xy-ink: #2a2f36;
  --xy-muted: #eef2f5;
  --xy-muted-ink: #5f6873;
  --xy-border: #cfd8df;
  --xy-secondary: #f3f6f8;
  --xy-bezel: #2a2f36;
  --xy-bezel-ink: #e6ebef;
  --xy-holo: #1f9be0;
  --xy-display: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cmd-fight: #e0393e;
  --cmd-bag: #f2a71b;
  --cmd-mon: #3faa45;
  --cmd-run: #2f7fd8;

  --type-normal: #9fa19f; --type-fire: #e62829; --type-water: #2980ef; --type-grass: #3fa129;
  --type-electric: #e0ae00; --type-ice: #3dc7e8; --type-fighting: #ff8000; --type-poison: #9141cb;
  --type-ground: #915121; --type-flying: #81b9ef; --type-psychic: #ef4179; --type-bug: #91a119;
  --type-rock: #afa981; --type-ghost: #704170; --type-dragon: #5060e1; --type-dark: #624d4e;
  --type-steel: #60a1b8; --type-fairy: #ef70ef;

  /* Shared component tokens (site.css / zone.css) */
  --bg: #e6ebef;
  --card: #ffffff;
  --card-2: var(--xy-secondary);
  --line: var(--xy-border);
  --bevel: #c3ccd4;
  --ink: var(--xy-ink);
  --ink-2: #4a525c;
  --ink-3: var(--xy-muted-ink);
  --link: var(--xy-primary-deep);
  --btn-top: #ffffff;
  --btn-bot: #f2f5f7;
  --title-top: #ffffff;
  --title-bot: #f2f5f7;
  --shell: var(--xy-primary);
  --shell-hi: #8bb8f0;
  --shell-lo: var(--xy-primary-deep);
  --shell-ink: #ffffff;
  --cursor: var(--xy-primary);
  --cursor-2: #8bb8f0;
  --glow: color-mix(in oklab, var(--xy-primary) 30%, transparent);
  --radius: 20px;
  --z-display: var(--xy-display);
  --z-nav-bg: rgba(230, 235, 239, .9);

  background-color: var(--bg);
  background-image: radial-gradient(rgba(42, 47, 54, .06) 1px, transparent 1.6px);
  background-size: 20px 20px;
  color: var(--xy-ink);
}
html[data-xy-version="y"] body.zone-pokemon-x-and-y {
  --xy-primary: #d8262f;
  --xy-primary-deep: #a81820;
  --shell-hi: #f39a9f;
  --cursor-2: #f39a9f;
}

/* Version-only content: X shows by default, Y once the switch is set. */
html:not([data-xy-version="y"]) .zone-pokemon-x-and-y [data-only="y"],
html[data-xy-version="y"] .zone-pokemon-x-and-y [data-only="x"] { display: none !important; }

/* ===== Shared parts ===== */
.xy-panel { border: 2px solid var(--xy-border); border-radius: 20px; background: linear-gradient(#ffffff, #f5f8fa); box-shadow: inset 0 -3px rgba(42, 47, 54, .06), 0 3px rgba(42, 47, 54, .08); }
.xy-dialogue { border: 2px solid #ffffff; border-radius: 16px; background: #ffffff; box-shadow: 0 0 0 3px #9aa6b1, inset 0 0 0 2px #e3e9ee, 0 6px 0 3px rgba(0, 0, 0, .18); color: var(--xy-ink); }
.xy-outline, .xy-type, .xy-cmd-label, .xy-cmd small, .xy-badge-gem b {
  color: #ffffff;
  text-shadow: -1.5px -1.5px rgba(0, 0, 0, .35), 1.5px -1.5px rgba(0, 0, 0, .35), -1.5px 1.5px rgba(0, 0, 0, .35), 1.5px 1.5px rgba(0, 0, 0, .35), 0 2px rgba(0, 0, 0, .3);
}

.xy-ball { --s: 32px; position: relative; flex: none; display: inline-block; width: var(--s); height: var(--s); border: 2px solid var(--xy-bezel); border-radius: 50%; background: linear-gradient(var(--xy-primary) 0 46%, var(--xy-bezel) 46% 54%, #ffffff 54%); }
.xy-ball::after { content: ""; position: absolute; inset: 0; margin: auto; width: 38%; height: 38%; border: 2px solid var(--xy-bezel); border-radius: 50%; background: #ffffff; }
.xy-ball-md { --s: 36px; }
.xy-ball-xs { --s: 20px; }
.xy-ball-xs::after { border-width: 1.5px; }

.xy-types { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.xy-type { --t: #9fa19f; display: inline-flex; align-items: center; justify-content: center; min-width: 3.9rem; padding: 2px 9px; border-radius: 7px; background: linear-gradient(180deg, rgba(255, 255, 255, .35), transparent 55%), var(--t); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--t) 60%, #000); font-size: .74rem; font-weight: 800; letter-spacing: .02em; line-height: 1.5; white-space: nowrap; }
.xy-type-sm { min-width: 2.9rem; padding: 1px 6px; font-size: .66rem; }
.xy-only { padding: 2px 9px; border-radius: 99px; background: var(--xy-bezel); color: #ffffff; font-size: .7rem; font-weight: 900; }
.xy-only-x { background: #1b6fd6; }
.xy-only-y { background: #d8262f; }
.xy-chip-dark { display: inline-block; flex: none; padding: 2px 9px; border-radius: 99px; background: var(--xy-bezel); color: var(--xy-bezel-ink); font-size: .72rem; font-weight: 800; line-height: 1.5; white-space: nowrap; }

.xy-hp { display: flex; align-items: center; gap: 4px; margin: 0; padding: 2px; border-radius: 99px; background: var(--xy-bezel); }
.xy-hp-tag { padding: 0 6px; border-radius: 99px; background: var(--cmd-bag); color: var(--xy-bezel); font-family: var(--xy-display); font-size: .62rem; font-weight: 900; line-height: 1.5; }
.xy-hp-track { flex: 1; height: 8px; overflow: hidden; border-radius: 99px; background: rgba(95, 104, 115, .45); }
.xy-hp-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(180deg, rgba(255, 255, 255, .5) 0 35%, transparent 35%), var(--cmd-mon); }

/* ===== Chrome ===== */
.xy-header { padding: 12px 16px 0; }
.xy-header-inner { width: min(1180px, 100%); min-height: 60px; margin: 0 auto; padding: 8px 10px 8px 14px; display: flex; align-items: center; gap: 16px; }
.xy-brand { display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; color: inherit; text-decoration: none; }
.xy-brand-text { display: grid; min-width: 0; line-height: 1.15; }
.xy-brand strong { font-family: var(--xy-display); font-size: 1.12rem; font-weight: 900; }
.xy-brand small { color: var(--xy-muted-ink); font-size: .64rem; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; white-space: nowrap; }
.xy-exit { color: var(--xy-muted-ink); font-size: .82rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.xy-exit:hover { color: var(--xy-primary); text-decoration: underline; }
.zone-search.xy-search { width: min(280px, 28vw); height: 40px; background: var(--xy-muted); border: 2px solid var(--xy-border); box-shadow: none; }
.zone-search.xy-search:focus-within { border-color: var(--xy-primary); box-shadow: 0 0 0 3px var(--glow); }
.zone-search.xy-search button { background: var(--xy-primary); }

.xy-version { display: flex; flex: none; padding: 2px; border: 2px solid var(--xy-border); border-radius: 99px; background: var(--xy-muted); }
.xy-version[hidden] { display: none; }
.xy-version button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--xy-muted-ink); font-family: var(--xy-display); font-size: .95rem; font-weight: 900; cursor: pointer; }
.xy-version button:hover { color: var(--xy-ink); }
.xy-version button[aria-checked="true"] { background: var(--xy-primary); color: #ffffff; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); }
.xy-version button:focus-visible { outline: 3px solid var(--glow); outline-offset: 1px; }

.zone-pokemon-x-and-y .zone-nav { margin-top: 10px; border-bottom: 0; background: var(--z-nav-bg); }
.zone-pokemon-x-and-y .zone-nav-inner { height: 52px; gap: 2px; }
.zone-pokemon-x-and-y .zone-nav a { padding: 7px 13px; color: var(--xy-ink); font-size: .88rem; }
.zone-pokemon-x-and-y .zone-nav a:hover { background: #ffffff; color: var(--xy-primary); }
.zone-pokemon-x-and-y .zone-nav a[aria-current] { background: var(--xy-primary); color: #ffffff; }
.zone-pokemon-x-and-y .window-title .i { color: var(--xy-primary); }
html:has(.zone-pokemon-x-and-y) { scroll-padding-top: 72px; }

/* ===== Hero ===== */
.xy-hero { width: min(1180px, 100% - 32px); margin: 0 auto; padding-top: 30px; }
.xy-hero-head { display: grid; gap: 8px; padding: 0 4px 22px; }
.xy-kicker, .xy-eyebrow { margin: 0; color: var(--xy-primary); font-family: var(--xy-display); font-size: .74rem; font-weight: 900; letter-spacing: .22em; text-transform: uppercase; }
.xy-title { margin: 0; font-family: var(--xy-display); font-size: clamp(1.9rem, 4.4vw, 3rem); font-weight: 900; line-height: 1.08; letter-spacing: -.01em; text-wrap: balance; }
.xy-lede { max-width: 38rem; margin: 0; color: var(--xy-muted-ink); font-size: 1rem; line-height: 1.6; text-wrap: pretty; }

.xy-screens { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.xy-bezel { width: 100%; padding: 12px; border-radius: 28px; background: var(--xy-bezel); box-shadow: 0 8px 0 rgba(0, 0, 0, .15); }
.xy-bezel-bottom { width: 88%; }

.xy-top { position: relative; aspect-ratio: 5 / 3; overflow: hidden; border-radius: 12px; background: var(--xy-muted); container-type: inline-size; }
.xy-top-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.xy-top::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(42, 47, 54, .5), transparent 55%); pointer-events: none; }
.xy-foe { position: absolute; inset: 0; z-index: 1; }
.xy-hpbox { position: absolute; top: 6%; left: 4%; width: 44%; max-width: 270px; padding: 1.2cqw 2cqw; border-radius: 14px; }
.xy-hpbox-name { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 .6cqw; font-size: clamp(.68rem, 2.4cqw, 1.05rem); font-weight: 900; }
.xy-hpbox-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xy-hpbox-name span { font-family: var(--xy-display); }
.xy-foe-mon { position: absolute; top: 3%; right: 5%; width: 40%; display: flex; flex-direction: column; align-items: center; }
.xy-foe-mon img { position: relative; z-index: 1; width: 100%; height: auto; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .35)); }
.xy-foe-base { width: 90%; height: 0; padding-bottom: 13%; margin-top: -14%; border: 2px solid rgba(255, 255, 255, .7); border-radius: 50%; background: rgba(255, 255, 255, .4); }
.xy-float { animation: xy-float 3.2s ease-in-out infinite; }

.xy-hero-talk { position: absolute; z-index: 2; left: 3%; right: 3%; bottom: 5%; display: block; padding: 1.6cqw 3cqw; text-align: left; font: inherit; cursor: pointer; }
.xy-talk-text { display: block; min-height: 2.9em; font-size: clamp(.78rem, 2.3cqw, 1.18rem); font-weight: 700; line-height: 1.45; }
.xy-talk-arrow { position: absolute; right: 2.4cqw; bottom: 1.6cqw; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid var(--xy-primary); animation: xy-bob .9s ease-in-out infinite; }
.xy-hero-talk:hover { background: #fbfcfd; }
.xy-hero-talk:focus-visible { outline: 4px solid var(--glow); outline-offset: 4px; }

.xy-touch { position: relative; aspect-ratio: 4 / 3; overflow: hidden; display: flex; flex-direction: column; gap: 3%; padding: 4%; border-radius: 12px; background-color: #3a4048; background-image: radial-gradient(circle at 50% 0, rgba(255, 255, 255, .18), transparent 60%), repeating-linear-gradient(60deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 18px), repeating-linear-gradient(-60deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 18px); container-type: inline-size; }
.xy-touch-head { display: flex; align-items: center; justify-content: space-between; }
.xy-touch-ask { margin: 0; padding: 2px 13px; border-radius: 99px; background: rgba(255, 255, 255, .95); color: var(--xy-ink); font-size: clamp(.72rem, 3cqw, .95rem); font-weight: 800; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.xy-touch-tag { color: rgba(230, 235, 239, .7); font-family: var(--xy-display); font-size: clamp(.6rem, 2.4cqw, .76rem); font-weight: 900; letter-spacing: .2em; text-transform: uppercase; }

.xy-cmd { --c: var(--cmd-fight); position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0 8px; border: 3px solid color-mix(in oklab, var(--c) 65%, #000); border-radius: 20px; background: linear-gradient(180deg, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, .12) 48%, transparent 52%), var(--c); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -4px 0 rgba(0, 0, 0, .18), 0 4px 0 color-mix(in oklab, var(--c) 50%, #000); text-align: center; text-decoration: none; transition: transform .12s, box-shadow .12s, filter .12s; }
.xy-cmd:hover { filter: brightness(1.06); }
.xy-cmd:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -2px 0 rgba(0, 0, 0, .18), 0 1px 0 color-mix(in oklab, var(--c) 50%, #000); }
.xy-cmd:focus-visible { outline: 4px solid #ffffff; outline-offset: 2px; }
.xy-cmd-label { display: inline-flex; align-items: center; gap: .35em; font-size: clamp(.9rem, 5cqw, 1.3rem); font-weight: 900; line-height: 1.1; }
.xy-cmd-label .i { width: 1.05em; height: 1.05em; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .35)); }
.xy-cmd small { font-size: clamp(.62rem, 2.8cqw, .82rem); font-weight: 800; opacity: .95; }
.xy-cmd-main { flex: 1.15; margin: 0 6%; }
.xy-cmd-main .xy-cmd-label { font-size: clamp(1.4rem, 9cqw, 2.4rem); }
.xy-cmd-main small { font-size: clamp(.72rem, 3.4cqw, .95rem); }
.xy-cmd-row { flex: 1; display: grid; grid-template-columns: 1fr .8fr 1fr; align-items: end; gap: 3%; }
.xy-cmd-row .xy-cmd { height: 100%; }
.xy-cmd-row .xy-cmd-mid { height: 72%; }

/* ===== Sections ===== */
.xy-page { width: min(1180px, 100% - 32px); margin: 0 auto; padding-bottom: 20px; }
.xy-page > .ad-slot { margin-top: 28px; }
.xy-section { margin-top: 84px; scroll-margin-top: 72px; }
.xy-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 32px; margin-bottom: 22px; }
.xy-section-name { display: flex; align-items: center; gap: 12px; }
.xy-section-name h2 { margin: 2px 0 0; font-family: var(--xy-display); font-size: clamp(1.45rem, 3vw, 1.95rem); font-weight: 900; line-height: 1.15; text-wrap: balance; }
.xy-section-head > p { max-width: 30rem; margin: 0; color: var(--xy-muted-ink); font-size: .92rem; line-height: 1.6; text-wrap: pretty; }
.xy-subhead { display: flex; align-items: center; gap: 8px; margin: 34px 0 14px; font-family: var(--xy-display); font-size: 1.2rem; font-weight: 900; }
.xy-subhead .i { width: 22px; height: 22px; color: var(--xy-primary); }

.xy-guides { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 16px; padding: 12px 16px; border: 2px dashed var(--xy-border); border-radius: 16px; }
.xy-guides-title { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 900; font-size: .9rem; }
.xy-guides-title .i { width: 18px; height: 18px; color: var(--xy-primary); }
.xy-guides-title .count { margin-left: 2px; }
.xy-guides ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.xy-guides li a { display: inline-block; padding: 5px 12px; border: 2px solid var(--xy-border); border-radius: 99px; background: #ffffff; color: var(--xy-ink); font-size: .86rem; font-weight: 800; text-decoration: none; }
.xy-guides li a:hover { border-color: var(--xy-primary); color: var(--xy-primary); }
.xy-guides-empty { margin: 0; color: var(--xy-muted-ink); font-size: .88rem; }

/* ===== Pokédex ===== */
.xy-dex { display: grid; gap: 16px; }
.xy-dex-panels { display: grid; gap: 16px; }
.xy-ready .xy-dex-card:not(.is-active) { display: none; }
.xy-dex-card { overflow: hidden; display: flex; flex-direction: column; }
.xy-dex-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: var(--xy-primary); color: #ffffff; }
.xy-dex-bar p { display: flex; align-items: baseline; gap: 12px; margin: 0; }
.xy-dex-bar strong { font-size: 1.25rem; font-weight: 900; }
.xy-dex-cat { font-family: var(--xy-display); font-size: .86rem; font-weight: 800; opacity: .92; }
.xy-dex-no { font-family: var(--xy-display); font-size: .82rem; font-weight: 900; font-variant-numeric: tabular-nums; opacity: .9; }
.xy-dex-body { display: grid; gap: 18px; padding: 18px; }
.xy-dex-art { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.xy-dex-ring { display: grid; place-items: center; width: 100%; max-width: 250px; aspect-ratio: 1; border: 2px solid var(--xy-border); border-radius: 50%; background: repeating-radial-gradient(circle at center, var(--xy-muted) 0 10px, #ffffff 10px 20px); }
.xy-dex-ring img { width: 86%; height: auto; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .2)); }
.xy-dex-data { display: flex; flex-direction: column; gap: 14px; }
.xy-dex-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; text-align: center; }
.xy-dex-facts div { padding: 6px 8px; border-radius: 12px; background: var(--xy-muted); }
.xy-dex-facts dt { color: var(--xy-muted-ink); font-size: .7rem; font-weight: 800; }
.xy-dex-facts dd { margin: 0; font-weight: 900; font-size: .92rem; }
.xy-dex-sub { margin: 0; font-size: .9rem; font-weight: 900; }
.xy-stats { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.xy-stats li { display: grid; grid-template-columns: 4.2rem 2.2rem 1fr; align-items: center; gap: 8px; }
.xy-stats li > span:first-child { color: var(--xy-muted-ink); font-size: .74rem; font-weight: 800; }
.xy-stats b { font-family: var(--xy-display); font-size: .8rem; font-variant-numeric: tabular-nums; text-align: right; }
.xy-stat-track { height: 10px; overflow: hidden; border-radius: 99px; background: var(--xy-muted); }
.xy-stat-track span { display: block; height: 100%; border-radius: 99px; background: var(--xy-primary); }
.xy-dex-notes { display: grid; gap: 8px; margin: 0 18px 18px; padding: 14px 16px; border: 2px solid var(--xy-border); border-radius: 16px; background: var(--xy-secondary); }
.xy-dex-notes p { margin: 0; font-size: .92rem; line-height: 1.6; }
.xy-dex-notes .xy-chip-dark { margin-right: 8px; }
.xy-dex-tip { color: var(--xy-muted-ink); }

.xy-dex-side { display: flex; flex-direction: column; gap: 12px; padding: 12px; }
.xy-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 99px; background: var(--xy-muted); }
.xy-tabs[hidden] { display: none; }
.xy-tabs button { padding: 6px 4px; border: 0; border-radius: 99px; background: transparent; color: var(--xy-muted-ink); font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; }
.xy-tabs button:hover { color: var(--xy-ink); }
.xy-tabs button[aria-pressed="true"] { background: var(--xy-primary); color: #ffffff; }
.xy-dex-list { display: flex; flex-direction: column; gap: 6px; max-height: 330px; margin: 0; padding: 4px; overflow-y: auto; list-style: none; }
.xy-dex-list li[hidden] { display: none; }
.xy-dex-item { display: flex; align-items: center; gap: 10px; padding: 3px 14px 3px 5px; border: 2px solid var(--xy-border); border-radius: 99px; background: #ffffff; color: var(--xy-ink); text-decoration: none; transition: border-color .15s; }
.xy-dex-item:hover { border-color: color-mix(in oklab, var(--xy-primary) 50%, transparent); }
.xy-dex-item img { width: 40px; height: 40px; padding: 2px; border-radius: 50%; background: var(--xy-muted); object-fit: contain; }
.xy-dex-item .xy-dex-no { color: var(--xy-muted-ink); font-size: .74rem; }
.xy-dex-item strong { flex: 1; min-width: 0; overflow: hidden; font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.xy-dots { display: flex; gap: 4px; }
.xy-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--t); }
.xy-dex-item .xy-ball { opacity: .3; filter: grayscale(1); }
.xy-dex-item[aria-current="true"], .xy-member.is-lead { border-color: var(--xy-primary); animation: xy-cursor 1.4s ease-in-out infinite; }
.xy-dex-item[aria-current="true"] .xy-ball { opacity: 1; filter: none; }
.xy-dex-item:focus-visible { outline: 3px solid var(--glow); outline-offset: 2px; }

/* ===== Gyms ===== */
.xy-case { padding: 14px; border-radius: 28px; background: var(--xy-bezel); box-shadow: 0 8px 0 rgba(0, 0, 0, .15); }
.xy-case-head { display: flex; justify-content: space-between; padding: 0 8px 12px; color: rgba(230, 235, 239, .7); font-family: var(--xy-display); font-size: .74rem; font-weight: 900; letter-spacing: .22em; text-transform: uppercase; }
.xy-badges { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 12px; border-radius: 18px; background: rgba(230, 235, 239, .1); list-style: none; }
.xy-badge { --t: #9fa19f; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 4px; border-radius: 14px; color: rgba(230, 235, 239, .7); text-align: center; text-decoration: none; transition: background .15s; }
.xy-badge:hover, .xy-badge:focus-visible { background: rgba(230, 235, 239, .1); outline: none; }
.xy-badge-gem { display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid rgba(230, 235, 239, .3); border-radius: 9px; background: linear-gradient(135deg, rgba(255, 255, 255, .6), transparent 50%), var(--t); transform: rotate(45deg); transition: transform .15s; }
.xy-badge-gem b { font-family: var(--xy-display); font-size: 1rem; font-weight: 900; transform: rotate(-45deg); }
.xy-badge:hover .xy-badge-gem { transform: rotate(45deg) scale(1.1); }
.xy-badge-name { font-size: .74rem; font-weight: 800; line-height: 1.25; }
.xy-badge[aria-current="true"] { background: rgba(230, 235, 239, .15); color: #ffffff; }
.xy-badge[aria-current="true"] .xy-badge-gem { border-color: #ffffff; transform: rotate(45deg) scale(1.1); box-shadow: 0 0 16px 2px var(--t); }

.xy-gym { display: grid; gap: 18px; margin-top: 14px; padding: 22px; }
.xy-gym + .xy-gym { margin-top: 14px; }
.xy-ready .xy-gym:not(.is-active) { display: none; }
.xy-gym-main, .xy-gym-side { display: flex; flex-direction: column; gap: 12px; }
.xy-gym-where { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--xy-muted-ink); font-size: .88rem; font-weight: 800; }
.xy-gym-where .i { width: 17px; height: 17px; }
.xy-gym h3 { margin: 0; font-family: var(--xy-display); font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 900; }
.xy-gym-spec { font-size: .88rem; font-weight: 800; }
.xy-gym-ace { margin-top: 4px; padding: 14px; border-radius: 16px; background: var(--xy-muted); }
.xy-gym-label { margin: 0; color: var(--xy-muted-ink); font-size: .74rem; font-weight: 800; }
.xy-gym-acename { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; font-size: 1.15rem; font-weight: 900; }
.xy-gym-acename span { color: var(--xy-primary); font-family: var(--xy-display); }
.xy-gym-team { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.xy-gym-team li { padding: 3px 10px; border-radius: 99px; background: #ffffff; font-size: .8rem; font-weight: 800; }
.xy-gym-team span { color: var(--xy-muted-ink); }
.xy-gym-side h4 { margin: 0; font-size: .9rem; font-weight: 900; }
.xy-gym-scope { margin: -6px 0 0; color: var(--xy-muted-ink); font-size: .78rem; font-weight: 700; }
.xy-gym-tip { margin: 4px 0 6px; padding: 14px 16px; }
.xy-gym-tip p { margin: 0; font-size: .95rem; line-height: 1.6; text-wrap: pretty; }
.xy-gym-prize { display: grid; gap: 6px; margin: 0; }
.xy-gym-prize div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 8px 12px; border-radius: 12px; background: var(--xy-secondary); font-size: .86rem; }
.xy-gym-prize dt { color: var(--xy-muted-ink); font-weight: 800; }
.xy-gym-prize dd { margin: 0; font-weight: 900; }
.xy-gym-nav { display: flex; justify-content: space-between; gap: 10px; margin: 0; }
.xy-gym-nav[hidden] { display: none; }
.xy-gym-nav button { display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px; border: 2px solid var(--xy-border); border-radius: 99px; background: #ffffff; color: var(--xy-ink); font: inherit; font-size: .84rem; font-weight: 800; cursor: pointer; }
.xy-gym-nav button:hover:not(:disabled) { border-color: var(--xy-primary); color: var(--xy-primary); }
.xy-gym-nav button:disabled { opacity: .45; cursor: default; }
.xy-gym-nav .i { width: 16px; height: 16px; }

.xy-league { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.xy-league-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; }
.xy-league-role { margin: 0; color: var(--xy-muted-ink); font-size: .7rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.xy-league-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-size: 1.08rem; font-weight: 900; }
.xy-league-team { margin: 0; color: var(--xy-muted-ink); font-size: .8rem; line-height: 1.5; }
.xy-league-note { display: flex; align-items: flex-start; gap: 6px; margin: 2px 0 0; color: var(--xy-primary-deep); font-size: .78rem; font-weight: 800; line-height: 1.4; }
.xy-league-note .i { flex: none; width: 15px; height: 15px; margin-top: 1px; }
.xy-league-card.is-champ { border-color: var(--xy-primary); background: linear-gradient(color-mix(in oklab, var(--xy-primary) 8%, #ffffff), #ffffff); }
.xy-league-card.is-champ .xy-league-role { color: var(--xy-primary); }

/* ===== Party ===== */
.xy-party { padding: 18px; border: 4px solid var(--xy-bezel); border-radius: 28px; background-color: var(--xy-holo); background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .12) 0 12px, transparent 12px 24px); }
.xy-party-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.xy-member { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; }
.xy-member-art { position: relative; flex: none; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 18px; background: var(--xy-muted); }
.xy-member-art img { width: 88%; height: auto; }
.xy-member-art .xy-ball { position: absolute; top: -4px; left: -4px; }
.xy-member-art:focus-visible { outline: 3px solid var(--glow); outline-offset: 2px; }
.xy-member-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.xy-member-name { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; }
.xy-member-name strong { overflow: hidden; font-size: 1.02rem; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.xy-member-name span { font-family: var(--xy-display); font-size: .86rem; font-weight: 900; }
.xy-member-hp { margin: -2px 0 0; font-family: var(--xy-display); font-size: .74rem; font-weight: 900; font-variant-numeric: tabular-nums; text-align: right; }
.xy-member-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin: 0; }
.xy-member-foot .xy-types { gap: 4px; }
.xy-member-where { display: flex; align-items: center; gap: 4px; margin: 0; color: var(--xy-muted-ink); font-size: .76rem; font-weight: 800; }
.xy-member-where .i { width: 14px; height: 14px; }
.xy-party-note { margin: 12px 4px 0; color: #ffffff; font-size: .8rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }

/* ===== Holo Caster ===== */
.xy-holo { overflow: hidden; border: 4px solid var(--xy-bezel); border-radius: 28px; background-color: color-mix(in oklab, var(--xy-holo) 14%, #0f2233); background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 4px), radial-gradient(ellipse at 50% 0%, color-mix(in oklab, var(--xy-holo) 45%, transparent), transparent 70%); color: #ffffff; }
.xy-holo-bar { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 22px; border-bottom: 1px solid color-mix(in oklab, var(--xy-holo) 40%, transparent); color: var(--xy-holo); font-family: var(--xy-display); font-size: .74rem; font-weight: 900; letter-spacing: .24em; text-transform: uppercase; }
.xy-holo-bar .i { width: 18px; height: 18px; }
.xy-live { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--xy-holo); }
.xy-live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--xy-holo); animation: xy-ping 1.4s cubic-bezier(0, 0, .2, 1) infinite; }
.xy-holo-grid { display: grid; gap: 1px; background: color-mix(in oklab, var(--xy-holo) 25%, transparent); }
.xy-holo-lead { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; min-height: 290px; padding: 30px; overflow: hidden; background: rgba(42, 47, 54, .4); }
.xy-holo-lead::before { content: ""; position: absolute; inset: 0; z-index: -2; background: url("ui/hero-kalos-handmade.webp") center / cover; opacity: .35; mix-blend-mode: luminosity; }
.xy-holo-lead::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, var(--xy-bezel), rgba(42, 47, 54, .6) 50%, transparent); }
.xy-holo-lead h3 { margin: 0; font-family: var(--xy-display); font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 900; line-height: 1.2; text-wrap: balance; }
.xy-holo-lead > p:last-child { max-width: 32rem; margin: 0; color: rgba(230, 235, 239, .82); line-height: 1.6; }
.xy-holo-list { display: flex; flex-direction: column; gap: 1px; margin: 0; padding: 0; list-style: none; }
.xy-holo-list li { display: flex; flex-direction: column; gap: 6px; padding: 16px 24px; background: rgba(42, 47, 54, .4); transition: background .15s; }
.xy-holo-list li:hover { background: color-mix(in oklab, var(--xy-holo) 15%, transparent); }
.xy-holo-list h3 { margin: 0; font-size: 1rem; font-weight: 800; }
.xy-holo-list li > p:last-child { margin: 0; color: rgba(230, 235, 239, .72); font-size: .88rem; line-height: 1.55; }
.xy-holo h3 a { color: inherit; text-decoration: none; }
.xy-holo h3 a:hover { text-decoration: underline; }
.xy-holo-meta { display: flex; align-items: center; gap: 8px; margin: 0; }
.xy-holo-meta span { padding: 1px 10px; border: 1px solid color-mix(in oklab, var(--xy-holo) 75%, transparent); border-radius: 99px; color: var(--xy-holo); font-size: .72rem; font-weight: 800; }
.xy-holo-meta time, .xy-holo-meta em { color: rgba(230, 235, 239, .6); font-family: var(--xy-display); font-size: .72rem; font-style: normal; font-weight: 800; }

/* ===== Trainer menu ===== */
.xy-menu { margin-top: 0; }
.xy-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.xy-cat { padding: 14px 16px; scroll-margin-top: 80px; }
.xy-cat:target { border-color: var(--xy-primary); animation: xy-cursor 1.4s ease-in-out 3; }
.xy-cat-title { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 1rem; font-weight: 900; line-height: 1.25; }
.xy-cat-title > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.xy-cat-title small { color: var(--xy-muted-ink); font-size: .76rem; font-weight: 700; }
.xy-cat-icon { --c: var(--cmd-run); flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid color-mix(in oklab, var(--c) 65%, #000); border-radius: 13px; background: linear-gradient(180deg, rgba(255, 255, 255, .4), transparent 55%), var(--c); color: #ffffff; box-shadow: 0 3px 0 color-mix(in oklab, var(--c) 50%, #000); }
.xy-cat-icon .i { width: 20px; height: 20px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3)); }
.xy-cat-list { margin: 12px 0 0; padding: 0 0 0 52px; font-size: .9rem; }
.xy-cat-list li + li { margin-top: 4px; }
.xy-cat-list a { color: var(--xy-ink); font-weight: 700; }
.xy-cat-list a:hover { color: var(--xy-primary); }
.xy-cat-empty { margin: 10px 0 0 52px; color: var(--xy-muted-ink); font-size: .84rem; font-weight: 700; }
.xy-side { top: 76px; }
.xy-facts { padding: 16px 18px; }
.xy-facts h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1rem; font-weight: 900; }
.xy-facts h3 .i { width: 18px; height: 18px; color: var(--xy-primary); }
.xy-facts dl { display: grid; gap: 8px; margin: 0; }
.xy-facts dl div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--xy-border); font-size: .88rem; }
.xy-facts dl div:last-child { padding-bottom: 0; border-bottom: 0; }
.xy-facts dt { color: var(--xy-muted-ink); font-weight: 800; }
.xy-facts dd { margin: 0; font-weight: 900; text-align: right; }

/* ===== Save ===== */
.xy-save { display: grid; gap: 16px; align-items: end; margin-top: 84px; }
.xy-save-main { display: grid; gap: 14px; }
.xy-save-card { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 24px; margin: 0; padding: 16px 18px; }
.xy-save-card dt { color: var(--xy-muted-ink); font-size: .76rem; font-weight: 800; }
.xy-save-card dd { margin: 0; font-weight: 900; }
.xy-save-text { padding: 16px 22px; }
.xy-save-text p { margin: 0; font-size: 1.08rem; font-weight: 700; line-height: 1.5; }
.xy-save-choices { display: flex; gap: 4px; padding: 6px; }
.xy-save-choices[hidden] { display: none; }
.xy-save-choices button { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 12px; background: transparent; color: var(--xy-ink); font: inherit; font-size: 1rem; font-weight: 800; text-align: left; cursor: pointer; }
.xy-save-choices button::before { content: ""; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 8px solid var(--xy-primary); opacity: 0; transition: opacity .15s; }
.xy-save-choices button:hover, .xy-save-choices button:focus-visible { background: var(--xy-muted); outline: none; }
.xy-save-choices button:hover::before, .xy-save-choices button:focus-visible::before { opacity: 1; }

/* ===== Footer ===== */
.xy-footer { width: min(1180px, 100% - 32px); margin: 56px auto 0; padding: 24px 0 34px; border-top: 2px solid var(--xy-border); color: var(--xy-muted-ink); }
.xy-footer a { color: var(--xy-ink); }
.xy-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px 40px; }
.xy-footer-brand { display: flex; align-items: center; gap: 12px; max-width: 420px; }
.xy-footer-brand strong { color: var(--xy-ink); font-family: var(--xy-display); font-size: 1.05rem; font-weight: 900; }
.xy-footer-brand p { margin: 2px 0 0; font-size: .88rem; }
.xy-footer-links { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px 18px; max-width: 640px; font-size: .88rem; font-weight: 800; }
.xy-footer-links a, .xy-footer-base a { text-decoration: none; }
.xy-footer-links a:hover, .xy-footer-base a:hover { color: var(--xy-primary); text-decoration: underline; }
.xy-footer-base { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin-top: 22px; font-size: .84rem; font-weight: 800; }
.xy-footer-base .linklike { color: var(--xy-ink); }
.xy-legal { flex-basis: 100%; margin: 4px 0 0; font-size: .76rem; font-weight: 600; line-height: 1.6; }

/* ===== Kalos map (map.js; article with h2#kalos-map) ===== */
.xy-band { margin: 6px 0 0; padding: 0 16px; }
.xy-atlas { max-width: 1680px; margin: 0 auto; padding: 16px 18px 18px; border: 4px solid var(--xy-bezel); border-radius: 28px; background: linear-gradient(180deg, #353b44, var(--xy-bezel)); box-shadow: 0 30px 60px -34px rgba(20, 24, 30, .7); color: var(--xy-bezel-ink); }
.xy-map-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 14px; }
.xy-map-top h1 { flex: 1 1 300px; margin: 0; color: #ffffff; font-family: var(--xy-display); font-size: clamp(1.3rem, 2.4vw, 1.8rem); font-weight: 900; line-height: 1.15; }
.xy-map-area { display: flex; align-items: center; gap: 8px; flex: 1 1 300px; max-width: 460px; }
.xy-map-area label { font-size: .8rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.xy-map-area select, .xy-map-search input { width: 100%; height: 42px; padding: 0 12px; border: 2px solid var(--xy-border); border-radius: 14px; background: #ffffff; color: var(--xy-ink); font: inherit; font-weight: 800; box-shadow: inset 0 -3px rgba(42, 47, 54, .08); }
.xy-map-area select:focus-visible, .xy-map-search input:focus-visible { outline: 3px solid var(--xy-holo); outline-offset: 2px; }
.xy-map-search { position: relative; flex: 1 1 260px; max-width: 400px; }
.xy-map-results { position: absolute; inset: calc(100% + 6px) 0 auto 0; z-index: 30; max-height: 360px; margin: 0; padding: 6px; overflow-y: auto; border: 2px solid var(--xy-border); border-radius: 14px; background: #ffffff; color: var(--xy-ink); list-style: none; box-shadow: 0 16px 30px -12px rgba(20, 24, 30, .5); }
.xy-map-result { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.xy-map-result small { color: var(--xy-muted-ink); font-weight: 800; white-space: nowrap; }
.xy-map-result:hover, .xy-map-result[aria-selected="true"] { background: var(--xy-muted); }
.xy-map-none { padding: 8px 10px; color: var(--xy-muted-ink); }
.xy-map-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; }
.xy-map-view { position: relative; min-height: 360px; height: clamp(420px, 68vh, 780px); overflow: hidden; border: 3px solid #1d2128; border-radius: 18px; background: #8fb8de; touch-action: none; }
.xy-map-view canvas { display: block; }
.xy-atlas:not(.is-live) .xy-map-view { height: auto; min-height: 0; padding: 16px; background: #3a414b; }
.xy-atlas:not(.is-live) .xy-map-panel, .xy-atlas:not(.is-live) .xy-map-area { display: none; }
.xy-atlas:not(.is-live) .xy-map-body { grid-template-columns: minmax(0, 1fr); }
.xy-map-status { position: absolute; left: 50%; top: 50%; z-index: 5; margin: 0; padding: 10px 16px; border-radius: 12px; background: rgba(29, 33, 40, .85); color: #ffffff; font-weight: 800; transform: translate(-50%, -50%); }
.xy-map-status[hidden] { display: none; }
.xy-atlas:not(.is-live) .xy-map-status { position: static; transform: none; background: none; padding: 0; }
.xy-map-labels { position: absolute; top: 0; left: 0; pointer-events: none; }
.xy-map-label { padding: 3px 10px; border: 2px solid var(--xy-bezel); border-radius: 99px; background: rgba(255, 255, 255, .95); color: var(--xy-ink); font: 800 12px/1.3 var(--xy-display); white-space: nowrap; cursor: pointer; pointer-events: auto; box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.xy-map-label:hover, .xy-map-label:focus-visible { background: #fff2c2; outline: none; }
.xy-map-label.is-hit { background: var(--xy-primary); border-color: #ffffff; color: #ffffff; transform: scale(1.1); }
.xy-map-label.is-dim { opacity: .4; }
.xy-map-door { width: 14px; height: 14px; padding: 0; border: 2px solid #ffffff; border-radius: 4px; background: var(--xy-holo); cursor: pointer; pointer-events: auto; box-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.xy-map-door.is-named { width: auto; height: auto; margin-top: 30px; padding: 2px 8px 2px 6px; border-radius: 8px; color: #ffffff; font: 800 11px/1.3 var(--xy-display); white-space: nowrap; }
.xy-map-door.is-named::before { content: "\25B2  "; font-size: 9px; }
.xy-map-door:hover, .xy-map-door:focus-visible { background: var(--xy-primary); outline: none; }
.xy-map-layers { position: absolute; left: 10px; bottom: 10px; z-index: 4; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; max-width: calc(100% - 20px); padding: 6px 10px; border-radius: 12px; background: rgba(29, 33, 40, .8); color: #ffffff; font-size: .82rem; font-weight: 800; }
.xy-map-layers label { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.xy-map-layers button, .xy-map-back { padding: 3px 10px; border: 2px solid #ffffff; border-radius: 8px; background: transparent; color: #ffffff; font: inherit; cursor: pointer; }
.xy-map-scenebar { position: absolute; left: 10px; top: 10px; z-index: 4; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; max-width: calc(100% - 20px); padding: 6px 10px; border-radius: 12px; background: rgba(29, 33, 40, .85); color: #ffffff; font-size: .82rem; font-weight: 800; }
.xy-map-scenebar[hidden] { display: none; }
.xy-map-panel { max-height: clamp(420px, 68vh, 780px); overflow-y: auto; padding: 14px 16px; border: 3px solid #1d2128; border-radius: 18px; background: #ffffff; color: var(--xy-ink); }
.xy-map-phead h2, .xy-map-intro { margin: 0; font-family: var(--xy-display); font-size: 1.3rem; font-weight: 900; line-height: 1.2; }
.xy-map-phead p { margin: 2px 0 0; color: var(--xy-muted-ink); font-size: .86rem; font-weight: 700; }
.xy-map-sec { margin-top: 12px; padding-top: 10px; border-top: 1.5px solid var(--xy-muted); }
.xy-map-sec h3 { margin: 0 0 6px; font-size: .86rem; font-weight: 900; }
.xy-map-sec[class*="m-"] h3::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; background: #3faa45; }
.xy-map-sec.m-yellow_flowers h3::before { background: #f2c21b; } .xy-map-sec.m-purple_flowers h3::before { background: #a05ad6; }
.xy-map-sec.m-red_flowers h3::before { background: #e0393e; } .xy-map-sec.m-rough_terrain h3::before { background: #a8865a; }
.xy-map-sec.m-surf h3::before { background: #2f7fd8; } .xy-map-sec.m-rock_smash h3::before { background: #8a8f96; }
.xy-map-sec.m-old_rod h3::before, .xy-map-sec.m-good_rod h3::before, .xy-map-sec.m-super_rod h3::before { background: #1f9be0; }
.xy-map-sec.m-horde h3::before { background: #f2a71b; }
.xy-map-enc { width: 100%; border-collapse: collapse; font-size: .88rem; }
.xy-map-enc th { color: var(--xy-muted-ink); font-size: .72rem; font-weight: 900; text-align: left; text-transform: uppercase; }
.xy-map-enc td, .xy-map-enc th { padding: 3px 4px; }
.xy-map-enc td:not(:first-child), .xy-map-enc th:not(:first-child) { width: 56px; text-align: right; font-variant-numeric: tabular-nums; }
.xy-map-enc tr + tr td { border-top: 1px solid var(--xy-muted); }
.xy-map-link { padding: 0; border: 0; background: none; color: var(--xy-primary-deep); font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.xy-map-link:hover, .xy-map-link:focus-visible { text-decoration: underline; outline: none; }
.xy-map-list { margin: 0; padding: 0; list-style: none; font-size: .9rem; }
.xy-map-list li { padding: 3px 0; }
.xy-map-dim { color: var(--xy-muted-ink); font-weight: 600; }
.xy-map-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--xy-muted); color: var(--xy-muted-ink); font-size: .75rem; font-weight: 800; }
.xy-map-note { margin: 8px 0 0; color: var(--xy-muted-ink); font-size: .86rem; line-height: 1.45; }
.xy-map-cond { display: block; color: var(--xy-muted-ink); font-size: .8rem; font-weight: 600; }
/* Pokémon on the Pokédex page's owned list (localStorage "xy-dex-owned") get a small Poké Ball */
.xy-map-link.is-owned::after { content: ""; display: inline-block; width: 11px; height: 11px; margin-left: 5px; vertical-align: -1px; border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0 18%, #2a2f36 19% 30%, transparent 31%), linear-gradient(#e0393e 0 44%, #2a2f36 44% 56%, #ffffff 56%); box-shadow: 0 0 0 1.5px #2a2f36; }
.xy-map-tag.is-owned { background: #e0393e; color: #ffffff; }
.xy-map-dexlink { display: inline-block; margin: 2px 0 10px; font-weight: 800; color: var(--xy-primary-deep); }
.xy-map-owned { padding: 8px 10px; border-radius: 10px; background: var(--xy-muted); color: var(--xy-ink); }
.xy-map-legend { display: grid; gap: 8px; margin: 12px 0; padding: 0; list-style: none; font-size: .9rem; font-weight: 700; }
.xy-map-legend i { display: inline-block; margin-right: 8px; font-style: normal; vertical-align: middle; }
.xy-map-legend .d-place { padding: 1px 8px; border: 2px solid var(--xy-bezel); border-radius: 99px; font-size: .75rem; font-weight: 800; }
.xy-map-legend .d-door { width: 14px; height: 14px; border: 2px solid #ffffff; border-radius: 4px; background: var(--xy-holo); box-shadow: 0 0 0 1px var(--xy-border); }
.xy-map-legend .d-named { padding: 1px 8px; border-radius: 8px; background: var(--xy-holo); color: #ffffff; font-size: .75rem; font-weight: 800; }
.xy-map-wrap { padding-top: 18px; }
.xy-map-overview { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: #2a78b8; }
.xy-map-overview[hidden] { display: none; }
.xy-map-view.is-overview .xy-map-layers, .xy-map-view.is-overview .xy-map-labels { display: none; }
.xy-tm { position: relative; }
.xy-tm img { display: block; width: 100%; height: 100%; image-rendering: auto; user-select: none; }
.xy-tm-spot { position: absolute; width: 4.5%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; transform: translate(-50%, -50%); }
.xy-tm-spot.k-route { width: 3.4%; }
.xy-tm-spot::before { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 transparent; transition: box-shadow .15s; }
.xy-tm-spot:hover::before, .xy-tm-spot:focus-visible::before { box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px var(--xy-primary); }
.xy-tm-spot:focus-visible { outline: none; }
.xy-tm-spot span { position: absolute; left: 50%; bottom: calc(100% + 3px); padding: 1px 7px; border: 2px solid var(--xy-bezel); border-radius: 99px; background: rgba(255, 255, 255, .95); color: var(--xy-ink); font: 800 11px/1.3 var(--xy-display); white-space: nowrap; pointer-events: none; transform: translateX(-50%); opacity: 0; transition: opacity .15s; }
.xy-tm-spot.k-town span { opacity: 1; }
.xy-tm-spot:hover span, .xy-tm-spot:focus-visible span, .xy-tm-spot.is-hit span { z-index: 2; opacity: 1; }
.xy-tm-spot.is-hit::before { box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px var(--xy-primary); animation: xy-ping-ring 1.6s ease-out infinite; }
.xy-tm-spot.is-hit span { background: var(--xy-primary); border-color: #ffffff; color: #ffffff; }
.xy-tm-spot.is-dim span { opacity: 0; }
@keyframes xy-ping-ring { 0% { box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px var(--xy-primary); } 70% { box-shadow: 0 0 0 3px #ffffff, 0 0 0 14px transparent; } 100% { box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px var(--xy-primary); } }
@media (prefers-reduced-motion: reduce) { .xy-tm-spot.is-hit::before { animation: none; } }
@media (max-width: 720px) { .xy-tm-spot.k-town span { opacity: 0; } .xy-tm-spot.k-town:hover span, .xy-tm-spot.is-hit span { opacity: 1; } }
@media (max-width: 960px) {
  .xy-map-body { grid-template-columns: minmax(0, 1fr); }
  .xy-map-view { height: 62vh; }
  .xy-map-panel { max-height: none; }
}
@media (max-width: 560px) {
  .xy-band { padding: 0 8px; }
  .xy-atlas { padding: 12px 10px 14px; border-radius: 20px; }
  .xy-map-layers { font-size: .75rem; }
}

/* ===== Motion ===== */
@keyframes xy-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes xy-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes xy-ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }
@keyframes xy-cursor {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in oklab, var(--xy-primary) 30%, transparent), inset 0 -3px rgba(42, 47, 54, .06); }
  50% { box-shadow: 0 0 0 6px color-mix(in oklab, var(--xy-primary) 18%, transparent), inset 0 -3px rgba(42, 47, 54, .06); }
}
@media (prefers-reduced-motion: reduce) {
  .xy-float, .xy-talk-arrow, .xy-live::after, .xy-dex-item[aria-current="true"], .xy-member.is-lead, .xy-cat:target { animation: none; }
}

/* ===== Responsive ===== */
@media (min-width: 720px) {
  .xy-dex-body { grid-template-columns: 1fr 1.1fr; }
  .xy-gym { grid-template-columns: 1fr 1.3fr; padding: 26px; }
  .xy-save { grid-template-columns: minmax(0, 1fr) 170px; }
  .xy-save-choices { flex-direction: column; }
}
@media (min-width: 1024px) {
  .xy-screens { flex-direction: row; align-items: flex-start; gap: 20px; }
  .xy-bezel-top { flex: 5; }
  .xy-bezel-bottom { flex: 4; width: auto; }
  .xy-dex { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: stretch; }
  /* The list panel takes the card's height and scrolls inside it. */
  .xy-dex-side { contain: size; }
  .xy-dex-list { flex: 1; min-height: 0; max-height: none; }
  .xy-holo-grid { grid-template-columns: 1.2fr 1fr; }
}
@media (max-width: 860px) {
  .xy-exit { display: none; }
  .xy-badges { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .xy-party-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .xy-header { padding: 10px 10px 0; }
  .xy-header-inner { gap: 10px; }
  .xy-brand small { letter-spacing: .1em; }
  .xy-hero { width: calc(100% - 20px); padding-top: 20px; }
  .xy-page { width: calc(100% - 20px); }
  .xy-bezel { padding: 8px; border-radius: 22px; }
  .xy-bezel-bottom { width: 94%; }
  .xy-hpbox { border-radius: 10px; }
  .xy-section { margin-top: 64px; }
  .xy-case, .xy-party { padding: 10px; border-radius: 22px; }
  .xy-badges { gap: 4px; padding: 6px; }
  .xy-badge-gem { width: 36px; height: 36px; }
  .xy-badge-name { font-size: .68rem; }
  .xy-gym { padding: 16px; }
  .xy-dex-body { padding: 14px; }
  .xy-dex-ring { max-width: 200px; }
  .xy-dex-notes { margin: 0 14px 14px; }
  .xy-dex-bar strong { font-size: 1.1rem; }
  .xy-holo-lead { min-height: 230px; padding: 22px; }
  .xy-holo-list li { padding: 14px 18px; }
  .xy-save-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Encounter panel follows the Sun/Moon scene tabs and compact tables. */
.xy-map-phead { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.xy-map-scenes { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; max-height: 120px; overflow-y: auto; }
.xy-map-scene { padding: 4px 10px; border: 2px solid var(--xy-primary-deep); border-radius: 8px; background: transparent; color: var(--xy-primary-deep); font: inherit; font-size: .82rem; font-weight: 800; text-align: left; cursor: pointer; }
.xy-map-scene.is-on { background: var(--xy-primary-deep); color: #fff; }
.xy-map-match { font-size: 1rem; }
.xy-map-target { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--xy-muted); font-size: .86rem; }
.xy-map-target-actions { display: flex; gap: 12px; }
.xy-map-enc tr.is-target { background: var(--xy-muted); }
.xy-map-enc tr.is-target td:first-child { box-shadow: inset 3px 0 var(--xy-primary-deep); padding-left: 9px; }
.xy-map-view-menu { position: relative; }
.xy-map-view-menu summary { cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.xy-map-view-menu[open] summary { background: rgba(255,255,255,.15); }
.xy-map-view-menu > div { position: absolute; bottom: calc(100% + 14px); right: 0; width: 185px; display: grid; gap: 6px; padding: 10px; border-radius: 10px; background: #242b34; box-shadow: 0 4px 16px #0004; }
.xy-map-view-menu p { margin: 3px 0 0; font-size: .75rem; font-weight: 500; line-height: 1.4; color: #d3dce6; }
.xy-map-layers .xy-map-view-menu button { text-align: left; border: 0; padding: 6px 8px; }
.xy-map-layers .xy-map-view-menu button:hover { background: #ffffff20; }
.xy-map-scene:focus-visible, .xy-map-view-menu summary:focus-visible, .xy-map-target .xy-map-link:focus-visible { outline: 3px solid var(--xy-holo); outline-offset: 2px; }

.xy-map-mon-icon { display: inline-block; width: 40px; height: 30px; background-image: url("dex/icons.webp?v=6"); background-repeat: no-repeat; vertical-align: middle; margin: -3px 2px -3px -5px; }

.xy-map-link.is-target { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
