@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Nunito:wght@600;700;800;900&display=swap');

:root {
  font-family: 'DM Sans', Arial, sans-serif;
  color: #171a19;
  background: #f7f4ef;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #171a19;
  --muted: #686965;
  --coral: #f35e48;
  --paper: #fbf9f5;
  --section: #ece9e1;
  --line: #d8d6d0;
  --round: 'Nunito', 'Arial Rounded MT Bold', Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; overflow-x: clip; background: #f7f4ef; color: var(--ink); }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.data-error { margin: 0 0 18px; padding: 13px 16px; border: 1px solid #cf6a54; border-radius: 12px; background: #fff2ed; color: #7c2618; font-size: 14px; line-height: 1.5; }
.data-notice { margin: 0 0 18px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--muted); font-size: 14px; line-height: 1.5; }
.topbar { width: min(100% - 64px, 1840px); min-height: 166px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 32px; border-bottom: 4px solid var(--section); }
.brand { min-width: 0; display: inline-flex; align-items: center; gap: 18px; text-decoration: none; }
.brand-mark { display: block; width: 88px; height: 88px; flex: 0 0 auto; }
.brand-copy { display: flex; flex-direction: column; gap: 0; }
.brand-copy strong { font: 900 clamp(30px, 3vw, 51px)/1 var(--round); letter-spacing: -.045em; white-space: nowrap; }
.brand-copy small { margin-top: 7px; color: var(--coral); font-size: clamp(11px, 1.1vw, 18px); font-weight: 900; letter-spacing: .19em; white-space: nowrap; }
.site-links { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 15px; }
.nav-pill { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 17px; border: 2px solid var(--coral); border-radius: 17px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 900; letter-spacing: .16em; text-decoration: none; white-space: nowrap; }
.nav-pill span { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: var(--coral); color: white; font-size: 13px; letter-spacing: 0; }
.nav-pill:hover, .nav-pill[aria-current="page"] { background: #fff8f4; color: var(--ink); }
main { width: min(100% - 64px, 1840px); margin: auto; }
.intro { min-height: 642px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(420px, .83fr); align-items: center; gap: clamp(36px, 5vw, 100px); padding: 44px 0 52px; }
.intro-copy { min-width: 0; }
.intro h1 { margin: 0; color: var(--ink); font: 900 clamp(58px, 6.5vw, 128px)/1.08 var(--round); letter-spacing: -.065em; }
.collect-word { position: relative; white-space: nowrap; }
.collect-word::after { content: ''; position: absolute; left: 0; right: 0; bottom: .1em; height: .085em; border-radius: 99px; background: var(--coral); }
.lede { max-width: 780px; margin: 30px 0 0; color: var(--muted); font: 800 clamp(18px, 1.8vw, 31px)/1.45 var(--round); }
.leaderboard-button { min-height: 60px; margin-top: 35px; display: inline-flex; align-items: center; gap: 14px; padding: 0 22px; border-radius: 17px; background: var(--coral); color: var(--ink); font-size: 16px; font-weight: 900; letter-spacing: .17em; text-decoration: none; }
.leaderboard-button span { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: white; color: var(--coral); font-size: 17px; letter-spacing: 0; }
.leaderboard-button:hover { background: #df4e3b; }
.daily-card { min-width: 0; min-height: 516px; display: flex; flex-direction: column; padding: 21px 23px 18px; border: 2px solid #858680; border-radius: 29px; background: var(--section); }
.daily-top, .daily-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 14px; font-weight: 900; letter-spacing: .18em; }
.type-badge { max-width: 55%; overflow: hidden; padding: 12px 20px; border-radius: 18px; background: #ffcf12; color: var(--ink); font-size: 13px; font-weight: 900; letter-spacing: .13em; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.daily-sprite-wrap { flex: 0 0 auto; width: 100%; height: clamp(240px, 31vw, 390px); margin: 20px auto 7px; display: flex; align-items: stretch; justify-content: center; gap: 16px; padding: 0; }
.daily-sprite-variant { width: calc(50% - 8px); height: 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.daily-sprite-variant img { display: block; flex: 0 1 auto; width: 100%; height: auto; max-height: calc(100% - 20px); aspect-ratio: 1; object-fit: contain; image-rendering: pixelated; }
.daily-sprite-variant span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.daily-bottom { margin-top: auto; align-items: center; }
.daily-bottom h2 { min-width: 0; flex: 1 1 auto; margin: 0; overflow: visible; font: 900 clamp(30px, 3.4vw, 58px)/1.12 var(--round); letter-spacing: -.055em; overflow-wrap: anywhere; }
.daily-number { flex: 0 0 auto; padding: 11px 13px; border-radius: 15px; background: var(--coral); color: var(--ink); font-size: 14px; font-weight: 900; letter-spacing: .12em; }
.daily-rarity { align-self: center; margin: 9px 0 0; padding: 5px 11px; border-radius: 999px; background: #e9e5dc; color: var(--muted); font-size: 12px; font-weight: 800; }
.daily-boost { margin: 10px 0 0; color: var(--muted); font: 800 13px/1.45 var(--round); text-align: center; }
.account-strip { margin: 0 0 17px; color: var(--muted); font-size: 12px; }
.community-section { position: relative; isolation: isolate; padding: 34px 0 54px; scroll-margin-top: 20px; }
.community-section::before { position: absolute; z-index: -1; inset: 0 50%; width: 100vw; transform: translateX(-50%); background: var(--section); content: ''; }
.community-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.community-heading h2 { margin: 0; font: 900 clamp(34px, 3vw, 52px)/1.1 var(--round); letter-spacing: -.045em; }
.community-controls { display: flex; align-items: center; gap: 15px; }
.search-wrap, .sort-wrap { height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 15px; border: 2px solid #858680; border-radius: 17px; background: var(--paper); color: var(--coral); }
.search-wrap { width: clamp(220px, 21vw, 390px); }
.search-wrap span { font-size: 24px; line-height: 1; }
.search-wrap input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: 800 13px 'DM Sans', Arial, sans-serif; }
.search-wrap input::placeholder { color: var(--muted); opacity: 1; }
.sort-wrap { min-width: 205px; color: var(--muted); }
.sort-wrap select { width: 100%; border: 0; outline: none; appearance: none; background: transparent; color: var(--muted); font: 900 12px 'DM Sans', Arial, sans-serif; letter-spacing: .13em; cursor: pointer; }
.sort-wrap::after { content: '⌄'; color: var(--muted); font-size: 19px; }
.icon-button { width: 48px; height: 48px; border: 2px solid #858680; border-radius: 17px; background: var(--paper); color: var(--muted); font-size: 25px; cursor: pointer; }
.icon-button:disabled { opacity: .55; cursor: wait; }
.status-message { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.trainer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.load-more { display: block; min-height: 48px; margin: 24px auto 0; padding: 0 22px; border: 2px solid var(--coral); border-radius: 15px; background: var(--paper); color: var(--ink); font: 900 12px 'DM Sans', Arial, sans-serif; letter-spacing: .13em; cursor: pointer; }
.load-more[hidden] { display: none; }
.load-more:hover { background: var(--coral); }
.load-more:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.trainer-card { min-width: 0; min-height: 162px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; padding: 16px; border: 2px solid var(--coral); border-radius: 25px; background: var(--paper); color: var(--ink); text-decoration: none; }
.trainer-card:hover, .trainer-card[aria-current="true"] { background: #fffdf9; }
.trainer-card[aria-current="true"] { outline: 3px solid #f35e4840; outline-offset: 2px; }
.trainer-card-top { min-width: 0; display: flex; align-items: center; gap: 11px; }
.rank-badge { flex: 0 0 auto; padding: 8px 12px; border-radius: 13px; background: var(--coral); color: var(--ink); font-size: 13px; font-weight: 900; letter-spacing: .11em; }
.trainer-name { min-width: 0; overflow: hidden; font: 900 clamp(20px, 1.8vw, 32px)/1.1 var(--round); letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.trainer-total { flex: 0 0 auto; margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.trainer-total strong { color: var(--coral); font-size: 17px; font-weight: 900; }
.trainer-sprites { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: center; gap: 7px; min-height: 82px; }
.trainer-sprites img { display: block; width: 100%; height: 76px; object-fit: contain; image-rendering: pixelated; }
.favorite-sprite { position: relative; display: block; min-width: 0; height: 76px; }
.favorite-sprite-star { position: absolute; top: 0; right: 0; color: #d5a826; font-size: 18px; line-height: 1; text-shadow: 0 1px 2px #fff; }
.trainer-sprites-empty { grid-column: 1/-1; padding: 10px; color: var(--muted); font-size: 12px; }
.collection-panel { margin-top: 38px; padding: 28px; border: 1px solid #d5d2cb; border-radius: 24px; background: var(--paper); scroll-margin-top: 18px; }
.collection-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.collection-heading h2 { margin: 0; font: 900 clamp(27px, 3vw, 40px)/1.1 var(--round); letter-spacing: -.04em; }
.profile-actions { display: flex; align-items: center; gap: 12px; }
.collection-count { color: var(--coral); font-size: 12px; font-weight: 900; }
.close-profile { padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--muted); font: 700 12px 'DM Sans', Arial, sans-serif; cursor: pointer; }
.collection-summary { margin: 12px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.collection-message { color: var(--muted); font-size: 13px; }
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.pokemon-card { position: relative; min-width: 0; min-height: 142px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 8px; border: 1px solid #e3e0d9; border-radius: 17px; background: #f5f2ec; overflow: hidden; }
.pokemon-card img { width: 78px; height: 78px; object-fit: contain; image-rendering: pixelated; }
.pokemon-name { max-width: 100%; overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.pokemon-rarity { max-width: 100%; margin-top: 3px; padding: 2px 6px; border-radius: 999px; background: #e9e5dc; color: var(--muted); font-size: 8px; font-weight: 800; white-space: nowrap; }
.pokemon-count { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 700; }
.favorite-star { position: absolute; top: 7px; right: 8px; color: #d5a826; }
.shiny-tag { position: absolute; top: 7px; left: 7px; color: #965eaa; font-size: 8px; font-weight: 800; }
footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 22px 0 30px; color: var(--muted); font-size: 11px; }
.footer-ball { color: var(--coral); font-size: 16px; vertical-align: middle; }

/* Shared inner pages */
.dex-page main, .commands-page main, .shop-page main { padding-top: 24px; }
.dex-intro, .shop-intro { margin: 0 0 20px; padding: 28px clamp(22px, 4vw, 44px); border: 1px solid var(--line); border-radius: 23px; background: var(--section); }
.dex-intro h1, .shop-intro h1, .commands-card h1 { margin: 0; color: var(--ink); font: 900 clamp(34px, 5vw, 56px)/1.05 var(--round); letter-spacing: -.055em; }
.dex-intro>p:last-child, .shop-intro>p:last-child { margin: 11px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.dex-panel { padding: 20px; border: 1px solid var(--line); border-radius: 21px; background: var(--paper); }
.dex-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.dex-search { height: 46px; max-width: 560px; flex: 1; display: flex; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; background: #fffdf9; color: var(--coral); }
.dex-search span { font-size: 22px; }
.dex-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: 500 13px 'DM Sans', sans-serif; }
.dex-count { flex: none; margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.dex-message { margin: 0 2px 12px; color: var(--muted); font-size: 12px; }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(218px, 1fr)); gap: 13px; }
.dex-card { min-width: 0; min-height: 330px; display: flex; flex-direction: column; align-items: center; padding: 14px 15px 13px; border: 1px solid #e3e0d9; border-radius: 17px; background: #f7f4ef; text-align: center; }
.dex-card-top { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.dex-id { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.dex-rarity { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--section); color: var(--muted); font-size: 9px; font-weight: 800; }
.dex-sprite { width: 120px; height: 120px; margin: 4px auto 0; object-fit: contain; image-rendering: pixelated; }
.dex-name { max-width: 100%; margin: 0 0 11px; overflow-wrap: anywhere; color: var(--ink); font: 900 18px/1.2 var(--round); letter-spacing: -.025em; }
.dex-types { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin: -5px 0 10px; }
.dex-type { padding: 4px 8px; border-radius: 999px; background: #ffcf12; color: var(--ink); font-size: 9px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.dex-type-unknown { background: var(--section); color: var(--muted); }
.dex-stats { width: 100%; display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 8px; text-align: left; }
.dex-stat { margin: 0; padding: 8px 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #e5e2dc; border-radius: 11px; background: #fffdf9; }
.dex-stat span, .dex-field-label { color: #85847f; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.dex-stat strong { margin: 3px 0 1px; color: var(--coral); font: 900 20px var(--round); }
.dex-stat small { color: var(--muted); font-size: 8px; }
.dex-evolution { min-width: 0; padding: 8px 9px; border: 1px solid #e5e2dc; border-radius: 11px; background: #fffdf9; }
.dex-evolution ul { margin: 4px 0 0; padding: 0; list-style: none; }
.dex-evolution li { padding: 3px 0; color: var(--muted); font-size: 9px; line-height: 1.35; overflow-wrap: anywhere; }
.dex-evolution li+li { border-top: 1px solid #f0ede8; }
.dex-final-form, .dex-note { color: var(--muted); font-size: 10px; line-height: 1.5; }
.dex-generation { margin-top: auto; padding-top: 11px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dex-note { margin: 18px 2px 0; }
.commands-card { max-width: 920px; margin: 18px auto 24px; padding: clamp(23px,5vw,48px); border: 1px solid var(--line); border-radius: 24px; background: var(--paper); }
.commands-card h1 { font-size: clamp(30px,5vw,48px); }
.commands-intro { max-width: 690px; margin: 13px 0 28px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.commands-card code { padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: #f2eee7; color: #8d3d31; font: 700 .92em ui-monospace,SFMono-Regular,Consolas,monospace; overflow-wrap: anywhere; }
.command-group { margin-top: 26px; }
.command-group h2 { margin: 0 0 9px; padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--ink); font: 900 21px var(--round); letter-spacing: -.025em; }
.command-list { margin: 0; }
.command-list>div { display: grid; grid-template-columns: minmax(205px,.8fr) minmax(0,1.5fr); gap: 10px; padding: 11px 2px; border-bottom: 1px solid #eeeae4; }
.command-list dt { color: var(--ink); font-weight: 700; line-height: 1.7; }
.command-list dt span { color: var(--muted); font-size: 11px; }
.command-list dd { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.commands-note { margin: 24px 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--section); color: var(--muted); font-size: 11px; line-height: 1.6; }
.commands-back { color: var(--coral); font-size: 12px; font-weight: 800; text-decoration: none; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(185px,1fr)); gap: 15px; }
.shop-item { min-width: 0; min-height: 245px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 17px 14px 15px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); color: var(--ink); font-family: 'DM Sans',Arial,sans-serif; cursor: pointer; }
.shop-item:hover, .shop-item:focus-visible { border-color: var(--coral); }
.shop-item-visual { width: 100%; height: 145px; display: grid; place-items: center; }
.shop-item-visual img { width: 135px; height: 135px; object-fit: contain; image-rendering: pixelated; }
.shop-item[data-item="evo"] .shop-item-visual img { width: 45px; height: 45px; }
.shop-item-name { margin-top: 7px; color: var(--ink); font: 900 18px var(--round); }
.shop-item-price { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.shop-dialog { max-width: min(430px,calc(100vw - 30px)); width: 100%; padding: 29px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--ink); }
.shop-dialog::backdrop { background: #171a1970; }
.shop-dialog>form:first-child { position: absolute; right: 12px; top: 12px; }
.shop-dialog-close { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--section); color: var(--muted); font-size: 23px; line-height: 1; cursor: pointer; }
.shop-dialog h2 { margin: 0; font: 900 27px var(--round); }
.shop-dialog>p:not(.eyebrow) { margin: 12px 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.shop-dialog>code { display: block; padding: 12px; border-radius: 11px; background: var(--section); color: #8d3d31; font: 800 12px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace; overflow-wrap: anywhere; }
.shop-dialog>form:last-child { text-align: right; }
.shop-dialog-ok { margin-top: 17px; padding: 9px 15px; border: 0; border-radius: 10px; background: var(--coral); color: white; font: 800 11px 'DM Sans',sans-serif; cursor: pointer; }

/* Pokémon type colors and shared detail view */
.type-badge[data-type="normal"], .dex-type[data-type="normal"] { background: #a8a77a; color: #fff; }
.type-badge[data-type="fire"], .dex-type[data-type="fire"] { background: #ee8130; color: #fff; }
.type-badge[data-type="water"], .dex-type[data-type="water"] { background: #6390f0; color: #fff; }
.type-badge[data-type="electric"], .dex-type[data-type="electric"] { background: #f7d02c; color: #29250f; }
.type-badge[data-type="grass"], .dex-type[data-type="grass"] { background: #7ac74c; color: #17220f; }
.type-badge[data-type="ice"], .dex-type[data-type="ice"] { background: #96d9d6; color: #18302f; }
.type-badge[data-type="fighting"], .dex-type[data-type="fighting"] { background: #c22e28; color: #fff; }
.type-badge[data-type="poison"], .dex-type[data-type="poison"] { background: #a33ea1; color: #fff; }
.type-badge[data-type="ground"], .dex-type[data-type="ground"] { background: #e2bf65; color: #302612; }
.type-badge[data-type="flying"], .dex-type[data-type="flying"] { background: #a98ff3; color: #211a35; }
.type-badge[data-type="psychic"], .dex-type[data-type="psychic"] { background: #f95587; color: #fff; }
.type-badge[data-type="bug"], .dex-type[data-type="bug"] { background: #a6b91a; color: #20240b; }
.type-badge[data-type="rock"], .dex-type[data-type="rock"] { background: #b6a136; color: #fff; }
.type-badge[data-type="ghost"], .dex-type[data-type="ghost"] { background: #735797; color: #fff; }
.type-badge[data-type="dragon"], .dex-type[data-type="dragon"] { background: #6f35fc; color: #fff; }
.type-badge[data-type="dark"], .dex-type[data-type="dark"] { background: #705746; color: #fff; }
.type-badge[data-type="steel"], .dex-type[data-type="steel"] { background: #b7b7ce; color: #252532; }
.type-badge[data-type="fairy"], .dex-type[data-type="fairy"] { background: #d685ad; color: #fff; }
.dex-card { cursor: pointer; }
.dex-card:hover, .pokemon-card:hover { border-color: var(--coral); }
.dex-card:focus-visible, .pokemon-card:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.dex-card-top { position: relative; }
.dex-shiny-toggle { padding: 4px 8px; border: 1px solid #e9b4a9; border-radius: 999px; background: #fff8f4; color: #9a3e30; font: 800 9px 'DM Sans',sans-serif; cursor: pointer; }
.dex-shiny-toggle[aria-pressed="true"] { border-color: #b996cf; background: #f7effa; color: #69467d; }
.pokemon-card { cursor: pointer; }
.collection-sort-label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.collection-sort-label select { max-width: 150px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: 700 11px 'DM Sans',sans-serif; letter-spacing: normal; }
.pokemon-detail-dialog { position: fixed; width: min(760px,calc(100vw - 32px)); max-width: none; max-height: min(86vh,700px); padding: clamp(20px,4vw,36px); overflow: auto; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); color: var(--ink); box-shadow: 0 18px 70px #171a1930; }
.pokemon-detail-dialog::backdrop { background: #171a1975; }
.pokemon-detail-close { position: absolute; z-index: 1; top: 12px; right: 13px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--section); color: var(--muted); font-size: 25px; line-height: 1; cursor: pointer; }
.pokemon-detail-layout { display: grid; grid-template-columns: minmax(190px,.85fr) minmax(0,1.15fr); align-items: center; gap: clamp(20px,4vw,38px); }
.pokemon-detail-visual { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pokemon-detail-sprite { width: min(100%,300px); aspect-ratio: 1; object-fit: contain; image-rendering: pixelated; }
.pokemon-detail-shiny { padding: 9px 14px; border: 1px solid #e9b4a9; border-radius: 12px; background: #fff8f4; color: #9a3e30; font: 800 11px 'DM Sans',sans-serif; cursor: pointer; }
.pokemon-detail-info .eyebrow { font-size: 9px; }
.pokemon-detail-info h2 { margin: 8px 0 4px; font: 900 clamp(28px,5vw,44px)/1.05 var(--round); letter-spacing: -.04em; }
.pokemon-detail-rarity { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.pokemon-detail-types { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.pokemon-detail-facts { margin: 0; border-top: 1px solid var(--line); }
.pokemon-detail-facts>div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.pokemon-detail-facts dt { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.pokemon-detail-facts dd { margin: 5px 0 0; color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.5; }
.pokemon-detail-evolutions { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pokemon-detail-evolutions li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pokemon-detail-evolution-link { padding: 0; border: 0; background: none; color: var(--coral); font: inherit; font-weight: 900; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.pokemon-detail-evolution-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.pokemon-detail-evolution-method { color: var(--muted); font-size: 11px; font-weight: 700; }

@media (max-width: 1100px) {
  .topbar, main { width: min(100% - 44px, 1840px); }
  .topbar { min-height: 116px; }
  .brand-mark { width: 70px; height: 70px; }
  .site-links { gap: 8px; }
  .nav-pill { min-height: 43px; padding-inline: 12px; font-size: 10px; letter-spacing: .1em; }
  .intro { min-height: 500px; grid-template-columns: minmax(0,1.1fr) minmax(330px,.9fr); gap: 32px; }
  .daily-card { min-height: 430px; }
  .trainer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .trainer-name { font-size: clamp(19px,2.4vw,29px); }
}
@media (max-width: 700px) {
  .community-section::before { left: -16px; right: auto; width: calc(100% + 32px); transform: none; }
  .topbar { width: calc(100% - 32px); min-height: auto; padding: 15px 0; align-items: flex-start; flex-direction: column; gap: 15px; }
  .brand { gap: 11px; }
  .brand-mark { width: 50px; height: 50px; }
  .brand-copy strong { font-size: 27px; }
  .brand-copy small { margin-top: 4px; font-size: 9px; letter-spacing: .15em; }
  .site-links { width: 100%; justify-content: flex-start; gap: 7px; }
  .nav-pill { min-height: 39px; gap: 6px; padding-inline: 8px; border-radius: 13px; font-size: 8px; letter-spacing: .07em; }
  .nav-pill span { width: 17px; height: 17px; font-size: 11px; }
  main { width: calc(100% - 32px); }
  .intro { min-height: 0; grid-template-columns: 1fr; gap: 30px; padding: 42px 0 35px; }
  .intro h1 { font-size: clamp(47px,11vw,74px); line-height: 1.03; }
  .lede { margin-top: 21px; font-size: 17px; }
  .leaderboard-button { min-height: 52px; margin-top: 23px; padding-inline: 16px; font-size: 13px; }
  .daily-card { width: 100%; min-height: 365px; padding: 15px; border-radius: 22px; }
  .eyebrow { font-size: 10px; }
  .type-badge { padding: 9px 11px; border-radius: 12px; font-size: 10px; }
  .daily-sprite-wrap { height: clamp(210px, 58vw, 285px); margin-top: 16px; gap: 12px; }
  .daily-sprite-variant { width: calc(50% - 6px); }
  .daily-bottom h2 { font-size: clamp(30px,8vw,48px); line-height: 1.1; }
  .daily-number { padding: 9px 10px; font-size: 11px; }
  .daily-boost { font-size: 11px; }
  .daily-rarity { margin-top: 7px; font-size: 11px; }
  .community-section { padding: 28px 0 38px; }
  .community-heading { align-items: stretch; flex-direction: column; gap: 16px; }
  .community-heading h2 { font-size: 34px; }
  .community-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .search-wrap { width: auto; min-width: 0; height: 44px; grid-column: 1/-1; border-radius: 14px; }
  .sort-wrap { min-width: 0; height: 44px; border-radius: 14px; }
  .icon-button { width: 44px; height: 44px; border-radius: 14px; }
  .trainer-grid { grid-template-columns: 1fr; gap: 10px; }
  .trainer-card { min-height: 145px; gap: 10px; padding: 13px; border-radius: 20px; }
  .trainer-card-top { gap: 8px; }
  .rank-badge { padding: 7px 9px; border-radius: 10px; font-size: 10px; }
  .trainer-name { font-size: clamp(19px,6vw,26px); }
  .trainer-total { font-size: 10px; }
  .trainer-total strong { font-size: 13px; }
  .trainer-sprites { min-height: 66px; gap: 4px; }
  .trainer-sprites img { height: 63px; }
  .favorite-sprite { height: 63px; }
  .collection-panel { margin-top: 25px; padding: 18px 13px; border-radius: 18px; }
  .collection-heading { align-items: flex-start; }
  .collection-heading h2 { font-size: 25px; }
  .profile-actions { flex-direction: column; align-items: flex-end; gap: 5px; }
  .collection-summary { font-size: 11px; }
  .collection-grid { grid-template-columns: repeat(auto-fill,minmax(94px,1fr)); gap: 7px; }
  .pokemon-card { min-height: 122px; }
  .pokemon-card img { width: 66px; height: 66px; }
  footer { align-items: flex-start; flex-direction: column; padding-bottom: 22px; }
  .dex-page main, .commands-page main, .shop-page main { padding-top: 15px; }
  .dex-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .dex-card { min-height: 310px; padding: 9px 7px; }
  .dex-sprite { width: 100px; height: 100px; }
  .dex-name { font-size: 16px; }
  .dex-stats { grid-template-columns: 1fr; gap: 5px; }
  .dex-stat { padding: 5px; }
  .dex-evolution { padding: 6px; }
  .dex-toolbar { align-items: stretch; flex-direction: column; gap: 8px; }
  .dex-search { max-width: none; flex: auto; }
  .dex-count { text-align: right; }
  .command-list>div { grid-template-columns: 1fr; gap: 3px; padding: 10px 0; }
  .commands-card { margin: 0 auto 18px; padding: 22px 17px; border-radius: 18px; }
  .commands-intro { font-size: 12px; }
  .shop-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .shop-item { min-height: 205px; padding: 12px 8px; }
  .shop-item-visual { height: 120px; }
  .shop-item-visual img { width: 112px; height: 112px; }
  .shop-item-name { font-size: 16px; }
  .shop-item-price { text-align: center; font-size: 10px; }
  .pokemon-detail-layout { grid-template-columns: 1fr; gap: 12px; }
  .pokemon-detail-sprite { width: min(55vw,210px); }
  .pokemon-detail-visual { gap: 6px; }
  .pokemon-detail-info .eyebrow { font-size: 8px; }
  .pokemon-detail-facts>div { padding: 8px 0; }
  .collection-sort-label { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .nav-pill { padding-inline: 6px; font-size: 7px; }
  .trainer-card-top { flex-wrap: wrap; }
  .trainer-total { margin-left: 0; }
  .trainer-sprites { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .trainer-sprites img:nth-of-type(n+6) { display: none; }
  .trainer-sprites > .favorite-sprite:nth-child(n+6) { display: none; }
  .dex-grid { grid-template-columns: 1fr; }
}
