/* Pokémon Emerald wiki: compact layout (emerald-wiki.mjs), based on the Ruby/Sapphire and Gold/Silver wiki layouts. Uses the site palette variables. */
.emw{--emw-line:color-mix(in srgb,var(--line,#393732) 85%,#fff 15%);--emw-soft:color-mix(in srgb,var(--surface,#1c1c1c) 80%,#000 20%);font-size:15px;line-height:1.5;min-width:0}
.emw h1{font-size:clamp(1.45rem,1.1rem + 1.4vw,2rem);line-height:1.15;margin:.2rem 0 .5rem}
.emw-h1-sub{display:block;font-size:.55em;font-weight:600;color:var(--muted,#aaa69d);letter-spacing:.02em;margin-top:.2rem}
.emw h2{font-size:1.15rem;margin:1.6rem 0 .6rem;padding-bottom:.3rem;border-bottom:1px solid var(--emw-line)}
.emw h3{font-size:1rem;margin:0 0 .2rem}
.emw p{margin:.4rem 0}
.emw a{color:var(--accent,var(--gold))}
.emw small{display:block;color:var(--muted,#aaa69d);font-size:.8rem}
.emw-px{image-rendering:pixelated;image-rendering:crisp-edges}
.emw img{max-width:100%;height:auto}
.emw-muted{color:var(--muted,#aaa69d);font-size:.86rem}
.emw-lead{font-size:1.02rem;color:var(--text);max-width:70ch}
.emw-crumbs{font-size:.8rem;color:var(--muted);margin-bottom:.4rem}
.emw-crumbs a{color:var(--muted)}
.emw-scope{font-size:.82rem;color:var(--muted)}
.emw-facts{display:flex;flex-wrap:wrap;gap:6px;margin:.7rem 0;padding:0}
.emw-facts>div{background:var(--emw-soft);border:1px solid var(--emw-line);border-radius:6px;padding:4px 10px;min-width:0}
.emw-facts dt{font-size:.68rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.emw-facts dd{margin:0;font-weight:600;font-size:.9rem}
.emw-fig{margin:0}
.emw-fig figcaption{font-size:.8rem;color:var(--muted);margin-top:4px}
.emw-fig img{display:block;border-radius:4px;background:#000;width:100%}
/* inline item links with a tiny sprite */
.emw-item{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;margin:1px 6px 1px 0}
.emw-mini{width:18px;height:18px;object-fit:contain;flex:none}
.emw-chip{display:inline-block;font-size:.74rem;padding:1px 8px;border:1px solid var(--emw-line);border-radius:999px;text-decoration:none;margin-left:4px;white-space:nowrap}
/* dungeon page top */
.emw-top{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:14px;align-items:start;margin:.8rem 0}
.emw-panel{background:var(--emw-soft);border:1px solid var(--emw-line);border-radius:6px;padding:10px 12px}
.emw-panel h2{margin:0 0 .4rem;border:0;font-size:1rem}
.emw-kv{margin:0}
.emw-kv>div{padding:5px 0;border-top:1px solid var(--emw-line);font-size:.88rem}
.emw-kv>div:first-child{border-top:0}
.emw-kv dt{font-weight:700;font-size:.78rem;color:var(--secondary,var(--gold))}
.emw-kv dd{margin:0}
.emw-foe-row{display:flex;flex-wrap:wrap;gap:6px}
.emw-foe-row a{display:flex;align-items:center;gap:6px;text-decoration:none;color:var(--text);border:1px solid var(--emw-line);border-radius:6px;padding:4px 8px 4px 4px;font-size:.82rem;background:var(--emw-soft)}
.emw-foe-row a>span{width:34px;height:34px;display:grid;place-items:center;background:#000;border-radius:4px;flex:none}
.emw-foe-row img{max-width:30px;max-height:30px;width:auto;height:auto}
/* dungeons hub */
.emw-dgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px;margin:.6rem 0}
.emw-dcard{display:flex;flex-direction:column;border:1px solid var(--emw-line);border-radius:7px;overflow:hidden;text-decoration:none;background:var(--emw-soft);scroll-margin-top:80px}
.emw .emw-dcard{color:var(--text)}
.emw-dcard:hover,.emw-dcard:focus-visible{border-color:var(--accent,var(--gold))}
.emw-dshot{display:block;background:#000;aspect-ratio:8/7;overflow:hidden}
.emw-dshot img{display:block;width:100%;height:100%;object-fit:cover}
.emw-dbody{padding:8px 10px;display:grid;gap:1px;font-size:.84rem}
.emw-dbody strong{font-size:1.02rem}
.emw-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.emw-table{width:100%;border-collapse:collapse;font-size:.86rem}
.emw-table th,.emw-table td{padding:6px 8px;border-bottom:1px solid var(--emw-line);text-align:left;vertical-align:top}
.emw-table thead th{font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.emw-table tr{scroll-margin-top:80px}
.emw-table tr:target{background:var(--emw-soft);outline:2px solid var(--accent,var(--gold));outline-offset:-2px}
.emw-item-table th[scope=row]{display:flex;align-items:center;gap:8px;white-space:nowrap}
.emw-sprite{width:32px;height:32px;object-fit:contain;flex:none}
.emw-sprite-lg{width:64px;height:auto}
.emw-h2-pic{width:26px;height:26px;object-fit:contain;vertical-align:-6px;margin-right:8px}
.emw-tips ul,.emw-list,.emw-route{padding-left:1.3rem;margin:.3rem 0}
.emw-tips li,.emw-list li{margin:.25rem 0}
.emw-route li{margin:.35rem 0;padding-left:.2rem}
.emw-route strong{color:var(--secondary,var(--gold));margin-right:4px}
/* FAQ + sources */
.emw-faq details{border:1px solid var(--emw-line);border-radius:6px;padding:6px 10px;margin:6px 0;background:var(--emw-soft)}
.emw-faq summary{cursor:pointer;font-weight:600}
.emw-sources{margin-top:1.4rem;font-size:.82rem;color:var(--muted)}
.emw-sources summary{cursor:pointer}
.emw-sources ul{columns:2;column-gap:20px;padding-left:1.1rem}
.emw-sources li{overflow-wrap:anywhere}
/* home */
.emw-hero{display:grid;grid-template-columns:220px minmax(0,1fr);gap:16px;align-items:start}
.emw-hero>a img{width:220px;border-radius:5px;display:block}
.emw-cta a{font-weight:700}
.emw-topic-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:8px}
.emw-topic-grid a,.emw-related a{display:flex;gap:10px;align-items:center;text-decoration:none;color:var(--text);border:1px solid var(--emw-line);border-radius:7px;padding:8px;background:var(--emw-soft);font-size:.82rem}
.emw-topic-grid a:hover,.emw-related a:hover{border-color:var(--accent,var(--gold))}
.emw-topic-grid img,.emw-related img{width:56px;height:56px;object-fit:contain;flex:none;background:#000;border-radius:4px}
.emw-topic-grid strong{display:block;color:var(--accent,var(--gold));font-size:.95rem}
.emw-strip{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}
.emw-strip a{display:grid;gap:4px;text-decoration:none;font-size:.78rem;color:var(--text)}
.emw-strip img{width:100%;aspect-ratio:8/7;object-fit:cover;background:#000;border-radius:4px}
.emw-trivia{padding-left:1.2rem;font-size:.9rem}
.emw-related{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px;margin-top:1.4rem}
/* characters + enemies */
.emw-char-grid,.emw-enemy-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:8px}
.emw-char,.emw-enemy{display:flex;gap:10px;align-items:flex-start;border:1px solid var(--emw-line);border-radius:7px;padding:8px;background:var(--emw-soft);scroll-margin-top:80px}
.emw-char:target,.emw-enemy:target{border-color:var(--accent,var(--gold))}
.emw-char>a{flex:none;width:80px;height:100px;display:grid;place-items:center;background:#000;border-radius:5px;overflow:hidden}
.emw-char>a img{max-width:80px;max-height:100px;width:auto;height:auto;object-fit:contain}
.emw-char>a img.emw-px{min-width:40px}
.emw-char p,.emw-enemy p{font-size:.84rem;margin:.2rem 0}
.emw-role{color:var(--muted)}
.emw-enemy-pic{flex:none;width:64px;height:64px;display:grid;place-items:center;background:#000;border-radius:5px}
.emw-enemy-pic img{max-width:58px;max-height:58px;width:auto;height:auto}
.emw-enemy-pic img[width="16"],.emw-enemy-pic img[width="14"]{width:40px}
.emw-filter{display:flex;flex-wrap:wrap;gap:10px;align-items:end;margin:.6rem 0}
.emw-filter input{display:block;margin-top:3px;padding:6px 9px;border-radius:5px;border:1px solid var(--emw-line);background:var(--bg);color:var(--text);min-width:240px}
.emw-filter p{margin:0;color:var(--muted);font-size:.84rem}
.emw-jump{display:flex;flex-wrap:wrap;gap:5px;margin:.6rem 0}
.emw-jump a{font-size:.78rem;padding:3px 9px;border:1px solid var(--emw-line);border-radius:999px;text-decoration:none}
/* figures side by side */
.emw-side{display:grid;grid-template-columns:minmax(0,260px) minmax(0,1fr);gap:14px;align-items:start}
.emw-side>.emw-fig img{width:100%}
.emw-fig-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.emw-maps{grid-template-columns:repeat(2,minmax(0,1fr));margin:.8rem 0}
/* bosses */
/* pager */
.emw-pager{display:flex;justify-content:space-between;gap:10px;margin-top:1.2rem;flex-wrap:wrap}
.emw-pager a{border:1px solid var(--emw-line);border-radius:6px;padding:7px 12px;text-decoration:none;font-weight:600;font-size:.88rem}
/* gallery */
.emw-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}
.emw-gallery figure{margin:0;font-size:.74rem;text-align:center}
.emw-gallery figure>a{display:grid;place-items:center;aspect-ratio:1;background:#000;border-radius:5px;overflow:hidden}
.emw-gallery img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
.emw-gallery img.emw-px[width="16"],.emw-gallery img.emw-px[width="14"],.emw-gallery img.emw-px[width="24"],.emw-gallery img.emw-px[width="26"],.emw-gallery img.emw-px[width="28"],.emw-gallery img.emw-px[width="32"]{width:56px}
.emw-gallery figcaption{margin-top:3px;overflow-wrap:anywhere}
/* rail */
.emw-rail .infobox>a>img{display:block;width:100%;height:auto;max-height:220px;object-fit:contain}
.emw-rail-nav{border:1px solid var(--line);border-radius:6px;padding:10px;background:var(--surface);margin-top:12px}
.emw-rail-nav h2{font-size:.95rem;margin:0 0 .4rem}
.emw-rail-nav a{display:flex;gap:8px;align-items:center;padding:4px 0;text-decoration:none;font-size:.85rem;border-top:1px solid var(--line)}
.emw-rail-nav small{display:block;font-size:.7rem;color:var(--muted)}
.emw-rail-shot{width:48px;height:42px;object-fit:cover;background:#000;border-radius:3px;flex:none}
@media (max-width:900px){
 .emw-top{grid-template-columns:1fr}
 .emw-top .emw-fig{max-width:520px}
}
@media (max-width:640px){
 .emw-hero{grid-template-columns:110px minmax(0,1fr);gap:10px}
 .emw-hero>a img{width:110px}
 .emw-side{grid-template-columns:1fr}
 .emw-side>.emw-fig{max-width:340px}
 .emw-maps{grid-template-columns:1fr}
 .emw-sources ul{columns:1}
 .emw-dgrid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .emw-filter input{min-width:0;width:100%}
 .emw-filter label{flex:1}
 .emw-facts>div{padding:3px 8px}
}


/* Diamond and Pearl additions */
.emw-num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.emw-name{display:flex;align-items:center;gap:8px;min-width:150px}
.emw-top{grid-template-columns:minmax(0,340px) minmax(0,1fr)}
.emw-place-pic img{max-height:340px;object-fit:contain;background:#0b0b0b}
.emw-two{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start;margin:.8rem 0}
.emw-panel h3{font-size:.98rem;color:var(--accent,var(--gold));margin-bottom:.3rem}
.emw-connects,.emw-chapter{font-size:.88rem}
.emw-where{display:flex;align-items:center;gap:10px;font-size:.8rem;color:var(--muted)}
.emw-posmap{width:162px;height:auto;border-radius:4px;border:1px solid var(--emw-line)}
/* types and versions */
.emw-type{display:inline-block;font-size:.68rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase;padding:1px 6px;border-radius:4px;color:#fff;background:#777;margin:1px 2px 1px 0;line-height:1.5;vertical-align:middle}
.emw-t-normal{background:#8a8a6c}.emw-t-fire{background:#d9692b}.emw-t-water{background:#4a78d6}.emw-t-grass{background:#4f9a3a}.emw-t-electric{background:#c9a10f;color:#111}.emw-t-ice{background:#5fb6b6;color:#111}.emw-t-fighting{background:#a8302a}.emw-t-poison{background:#8b3f8f}.emw-t-ground{background:#b8954a;color:#111}.emw-t-flying{background:#8a76d4}.emw-t-psychic{background:#e0507a}.emw-t-bug{background:#8b9a1f}.emw-t-rock{background:#a08c3a}.emw-t-ghost{background:#5f4c8c}.emw-t-dragon{background:#5b34e0}.emw-t-dark{background:#5a4a40}.emw-t-steel{background:#8f8fa8}.emw-t-mixed{background:#666}
.emw-ver{display:inline-block;font-size:.72rem;font-weight:700;padding:1px 8px;border-radius:999px;white-space:nowrap}
.emw-d{background:#3b6fd1;color:#fff}.emw-p{background:#d97aa8;color:#111}.emw-both{background:var(--emw-soft);border:1px solid var(--emw-line);color:var(--text)}
/* Pokémon links */
.emw-mon{display:inline-flex;align-items:center;gap:4px;text-decoration:none;white-space:nowrap}
.emw-sprite{width:40px;height:40px;object-fit:contain;flex:none;image-rendering:pixelated}
.emw-mon-inline{margin:2px 8px 2px 0;font-size:.86rem}
.emw-mon-inline .emw-sprite{width:32px;height:32px}
.emw-sprite-lg{width:80px;height:80px;image-rendering:pixelated}
/* wild tables */
.emw-area{font-size:.95rem;margin:1rem 0 .3rem;color:var(--secondary,var(--gold))}
.emw-wild{margin-bottom:.6rem}
.emw-wild caption{text-align:left;font-weight:700;font-size:.86rem;padding:4px 0}
.emw-wild th[scope=row]{padding:2px 8px}
.emw-wild td{vertical-align:middle}
.emw-honey{font-size:.86rem}
.emw-honey small,.emw-catch small{display:inline}
.emw-items .emw-item-pic{width:30px;height:30px;flex:none;image-rendering:pixelated}
.emw-items td{min-width:200px}
/* gym and trainers */
.emw-gym-box{display:grid;grid-template-columns:110px minmax(0,1fr) minmax(0,220px);gap:14px;align-items:start;border:1px solid var(--emw-line);border-radius:7px;padding:10px;background:var(--emw-soft)}
.emw-gym-face img,.emw-trainer-head>a img{width:100px;height:auto;max-height:200px;object-fit:contain}
.emw-badge-no{font-size:.75rem;font-weight:600;color:var(--muted);margin-left:6px}
.emw-team{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:6px;margin:.4rem 0}
.emw-team-mon{display:grid;grid-template-columns:44px minmax(0,1fr);grid-template-rows:auto auto;column-gap:6px;align-items:center;text-decoration:none;color:var(--text);border:1px solid var(--emw-line);border-radius:6px;padding:3px 6px;background:var(--bg,#111);font-size:.8rem}
.emw .emw-team-mon{color:var(--text)}
.emw-team-mon img{grid-row:span 2}
.emw-team-mon strong{color:var(--accent,var(--gold))}
.emw-ace{border-color:var(--accent,var(--gold))}
.emw-types{display:block}
.emw-gym-pic img{max-height:220px;object-fit:contain;background:#0b0b0b}
.emw-trainer{border:1px solid var(--emw-line);border-radius:8px;padding:10px 12px;margin:1rem 0;background:var(--emw-soft);scroll-margin-top:80px}
.emw-trainer:target{border-color:var(--accent,var(--gold))}
.emw-trainer h2{border:0;margin:0 0 .3rem;padding:0;display:flex;align-items:center;gap:8px}
.emw-trainer-head{display:grid;grid-template-columns:110px minmax(0,1fr);gap:12px;align-items:start}
.emw-team-table td:nth-child(4){min-width:200px}
.emw-team-table small{display:block}
/* walkthrough */
.emw-part{scroll-margin-top:80px}
.emw-part-no{display:inline-block;font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;background:var(--accent,var(--gold));color:#111;border-radius:4px;padding:1px 6px;margin-right:6px;vertical-align:middle}
.emw-route{font-size:.86rem;color:var(--muted)}
.emw-gym-mini{display:grid;grid-template-columns:70px minmax(0,1fr);gap:10px;border:1px solid var(--emw-line);border-radius:7px;padding:8px;background:var(--emw-soft);margin:.5rem 0;align-items:start}
.emw-portrait-sm{width:64px;height:auto;max-height:130px;object-fit:contain}
.emw-tip{border-left:3px solid var(--accent,var(--gold));padding-left:10px;font-size:.88rem}
/* legendaries */
.emw-legend-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:8px}
.emw-legend{display:grid;grid-template-columns:84px minmax(0,1fr);gap:10px;border:1px solid var(--emw-line);border-radius:7px;padding:8px;background:var(--emw-soft);scroll-margin-top:80px}
.emw-legend:target{border-color:var(--accent,var(--gold))}
.emw-legend h3{font-size:1rem;margin:0}
.emw-legend p{font-size:.84rem}
.emw-legend .emw-facts{margin:.3rem 0}
.emw-special{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:8px}
.emw-special>div{border:1px solid var(--emw-line);border-radius:7px;padding:6px 10px;background:var(--emw-soft)}
.emw-special p{font-size:.84rem;margin:.2rem 0 0}
/* exclusives */
.emw-excl ul{list-style:none;padding:0;margin:0;display:grid;gap:4px}
.emw-excl li{display:flex;align-items:center;gap:8px;flex-wrap:wrap;border-bottom:1px solid var(--emw-line);padding:3px 0}
.emw-excl li small{display:inline;font-size:.78rem}
.emw-excl h3{display:flex;gap:8px;align-items:center}
/* hub, home */
.emw-region img{max-height:520px;object-fit:contain;background:#0b0b0b}
.emw-dgrid{grid-template-columns:repeat(auto-fill,minmax(180px,1fr))}
.emw-dshot{aspect-ratio:4/3}
.emw-dshot img{object-fit:cover}
.emw-dbody small{font-size:.76rem}
.emw-boxes{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.emw-hero{grid-template-columns:260px minmax(0,1fr)}
.emw-hero .emw-boxes img{width:100%;border-radius:4px;display:block}
.emw-badges{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:8px}
.emw-badges a{display:flex;gap:8px;align-items:center;text-decoration:none;color:var(--text);border:1px solid var(--emw-line);border-radius:7px;padding:6px;background:var(--emw-soft);font-size:.82rem}
.emw-badges strong{display:block;color:var(--accent,var(--gold))}
.emw-badges small{display:block}
.emw-badge-face{width:44px;height:64px;object-fit:contain;flex:none}
.emw-topic-grid img,.emw-related img{background:#111;object-fit:contain}
.emw-rail-face{width:28px;height:40px;object-fit:contain;flex:none}
.emw-gallery figure>a{background:#111}
.emw-gallery img{image-rendering:auto}
.emw-px{image-rendering:pixelated}
.emw-filter select{display:block;margin-top:3px;padding:6px 9px;border-radius:5px;border:1px solid var(--emw-line);background:var(--bg);color:var(--text)}
@media (max-width:900px){
 .emw-two{grid-template-columns:1fr}
 .emw-gym-box{grid-template-columns:90px minmax(0,1fr)}
 .emw-gym-pic{grid-column:1/-1;max-width:260px}
}
@media (max-width:640px){
 .emw-top{grid-template-columns:1fr}
 .emw-gym-box{grid-template-columns:1fr}
 .emw-gym-face img{width:80px}
 .emw-trainer-head{grid-template-columns:70px minmax(0,1fr)}
 .emw-trainer-head>a img{width:66px}
 .emw-hero{grid-template-columns:1fr}
 .emw-hero .emw-boxes{max-width:300px}
 .emw-dgrid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .emw-dbody{padding:6px 8px;font-size:.78rem}
 .emw-team{grid-template-columns:repeat(2,minmax(0,1fr))}
 .emw-wild-time thead th{font-size:.62rem;letter-spacing:0}
 .emw-wild th[scope=row]{padding:2px 4px}
 .emw-wild td,.emw-wild th{padding:4px 4px}
 .emw-wild .emw-mon span{white-space:normal}
 .emw-items td{min-width:0}
 .emw-items tr{display:grid;grid-template-columns:1fr;border-bottom:1px solid var(--emw-line);padding:4px 0}
 .emw-items thead{display:none}
 .emw-items th,.emw-items td{border:0;padding:2px 4px}
 .emw-team-table thead{display:none}
 .emw-team-table tr{display:grid;grid-template-columns:1fr auto;border-bottom:1px solid var(--emw-line);padding:4px 0}
 .emw-team-table th,.emw-team-table td{border:0;padding:2px 4px}
 .emw-team-table td:nth-child(4),.emw-team-table td:nth-child(5){grid-column:1/-1;min-width:0}
 .emw-legend-grid{grid-template-columns:1fr}
}
.emw-wild .emw-sprite{width:32px;height:32px}
.emw .emw-honey small,.emw .emw-catch small,.emw td small.emw-inline{display:inline}
.emw-nowrap{white-space:nowrap;display:inline-block}
@media (max-width:640px){
 .emw-team-table td:nth-child(2)::before{content:'Lv. ';color:var(--muted)}
}
.emw-catch{display:flex;flex-wrap:wrap;align-items:center;gap:2px 0}
.emw-catch strong{margin-right:8px}
.emw-starters,.emw-people{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px}
.emw-starters a,.emw-people a{display:flex;gap:10px;align-items:center;text-decoration:none;color:var(--text);border:1px solid var(--emw-line);border-radius:7px;padding:6px 8px;background:var(--emw-soft);font-size:.82rem}
.emw .emw-starters a,.emw .emw-people a{color:var(--text)}
.emw-starters strong,.emw-people strong{color:var(--accent,var(--gold))}
.emw-starters small,.emw-people small{display:block}
.emw-starter-art{width:72px;height:72px;object-fit:contain;flex:none}
.emw-person{width:52px;height:80px;object-fit:contain;flex:none}
.emw-gallery-preview{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}

/* Pokémon Yellow additions */
.emw-px{image-rendering:pixelated}
.emw-place-pic img{max-height:380px;width:auto;max-width:100%;margin:0 auto;object-fit:contain;background:#101418}
.emw-top{grid-template-columns:minmax(0,320px) minmax(0,1fr)}
.emw-posmap{width:240px;height:auto;border-radius:4px;border:1px solid var(--emw-line)}
.emw-where{align-items:flex-end}
.emw-dshot{background:#101418}
.emw-dshot img.emw-map-thumb{object-fit:cover;object-position:center;image-rendering:pixelated}
.emw-fig-row{grid-template-columns:repeat(auto-fill,minmax(180px,1fr))}
.emw-fig-row .emw-fig img{background:#101418;max-height:260px;object-fit:contain}
.emw-region img{max-width:480px;background:#101418}
.emw-side{grid-template-columns:minmax(0,340px) minmax(0,1fr)}
.emw-sprite{width:40px;height:40px}
.emw-sprite-sm{width:28px;height:28px;object-fit:contain;flex:none;image-rendering:pixelated}
.emw-sprite-lg{width:84px;height:84px}
.emw-wild caption small{color:var(--muted);font-weight:400}
.emw-fish .emw-rod{font-weight:700;font-size:.8rem;white-space:nowrap;vertical-align:middle;border-right:1px solid var(--emw-line)}
.emw-fish tr.emw-first td,.emw-fish tr.emw-first th{border-top:2px solid var(--emw-line)}
.emw-tr-pic{width:40px;height:40px;object-fit:contain;flex:none;image-rendering:pixelated}
.emw-tr-pic-lg{width:64px;height:64px;object-fit:contain;flex:none;image-rendering:pixelated}
.emw-trainers th[scope=row]{white-space:nowrap}
.emw-trainers td{vertical-align:middle}
.emw-team-inline{display:flex;flex-wrap:wrap;gap:2px 10px}
.emw-team-inline a{display:inline-flex;align-items:center;gap:2px;text-decoration:none;color:var(--text);font-size:.8rem;white-space:nowrap}
.emw .emw-team-inline a{color:var(--text)}
.emw-team-inline small{display:inline;color:var(--muted)}
.emw-scripted{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:8px;margin:.4rem 0 .8rem}
.emw-boss{display:grid;grid-template-columns:64px minmax(0,1fr);gap:10px;border:1px solid var(--emw-line);border-radius:7px;padding:8px;background:var(--emw-soft)}
.emw-boss h3{font-size:.95rem}
.emw-boss p{margin:.15rem 0}
.emw-chip{margin-left:0}
.emw-how-hidden{border-style:dashed}
.emw-how-gift,.emw-how-bought{border-color:var(--accent,var(--gold))}
.emw-how-trade{border-color:#b55}
.emw-shop{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:.88rem}
.emw-shop span{white-space:nowrap}
.emw-items th[scope=row]{white-space:normal}
.emw-dex th[scope=row]{min-width:190px}
.emw-dex td{vertical-align:middle}
.emw-dex small{font-size:.74rem}
.emw-src{display:inline-block;margin:1px 12px 1px 0;font-size:.84rem}
.emw-where-cell{font-size:.86rem}
.emw-evo{display:inline-flex;align-items:center;gap:4px;flex-wrap:wrap}
.emw-mons{display:flex;flex-wrap:wrap}
.emw-tm th[scope=row]{white-space:nowrap}
.emw-gallery-small{grid-template-columns:repeat(auto-fill,minmax(88px,1fr))}
.emw-gallery-small figure>a{background:#f4f4ec}
.emw-gallery figure>a{background:#101418}
.emw-gallery img.emw-px{width:auto;max-height:100%}
.emw-gallery-small img.emw-px{width:56px;height:56px;object-fit:contain}
.emw-starters a{min-width:0}
.emw-starter-art{width:56px;height:56px;image-rendering:pixelated}
.emw-badge-face,.emw-rail-face,.emw-portrait,.emw-portrait-sm{image-rendering:pixelated;background:#f4f4ec;border-radius:4px}
.emw-trainer-head>img{width:100px;height:100px;object-fit:contain}
.emw-gym-face img{width:100px;height:100px}
.emw-topic-grid img,.emw-related img{image-rendering:pixelated;background:#f4f4ec}
.emw-hero{grid-template-columns:220px minmax(0,1fr)}
.emw-hero>a img{width:100%}
.emw-hero-small{grid-template-columns:140px minmax(0,1fr)}
.emw-hero-small>a img{background:#f4f4ec;image-rendering:pixelated}
.emw-legend>img{background:#f4f4ec;border-radius:5px}
.emw-team-mon img{image-rendering:pixelated}
@media (max-width:900px){
 .emw-side{grid-template-columns:1fr}
}
@media (max-width:640px){
 .emw-top{grid-template-columns:1fr}
 .emw-posmap{width:200px}
 .emw-hero,.emw-hero-small{grid-template-columns:110px minmax(0,1fr)}
 .emw-trainers thead,.emw-dex thead,.emw-wild:not(.emw-fish) thead th:nth-child(2){display:none}
 .emw-wild:not(.emw-fish) td:nth-child(2){display:none}
 .emw-trainers tr{display:grid;grid-template-columns:1fr auto;border-bottom:1px solid var(--emw-line);padding:4px 0}
 .emw-trainers th,.emw-trainers td{border:0;padding:2px 4px}
 .emw-trainers td:nth-child(2){grid-column:1/-1;order:3}
 .emw-trainers td:nth-child(4){grid-column:1/-1;order:4;font-size:.78rem;color:var(--muted)}
 .emw-dex tr{display:grid;grid-template-columns:44px minmax(0,1fr);border-bottom:1px solid var(--emw-line);padding:4px 0}
 .emw-dex th,.emw-dex td{border:0;padding:2px 4px}
 .emw-dex td.emw-where-cell{grid-column:1/-1}
 .emw-dex th[scope=row]{min-width:0}
 .emw-scripted{grid-template-columns:1fr}
 .emw-starters{grid-template-columns:1fr 1fr}
 .emw-region img{max-width:100%}
}
.emw p.emw-route{padding-left:0}
.emw-table td.emw-num{vertical-align:middle}

/* FireRed and LeafGreen additions */
.emw-ver{display:inline-block;font-size:.7rem;font-weight:700;padding:1px 7px;border-radius:999px;white-space:nowrap;vertical-align:middle;margin-left:4px}
.emw-ru{background:#c8102e;color:#fff}.emw-sa{background:#1f5bd1;color:#fff}
.emw-ru-h{color:#f0707f}.emw-sa-h{color:#7ea6ff}
.emw-only-ru th[scope=row]{box-shadow:inset 3px 0 0 #c8102e}.emw-only-sa th[scope=row]{box-shadow:inset 3px 0 0 #1f5bd1}
.emw-muted{color:var(--muted,#aaa69d)}
.emw-posmap{width:288px;height:auto;image-rendering:pixelated;border-radius:4px;border:1px solid var(--emw-line)}
.emw-posmap-lg{width:100%;max-width:384px;height:auto;image-rendering:pixelated}
.emw-place-pic img{background:#101418}
.emw-maps-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:.8rem 0}
.emw-maps-row img{image-rendering:pixelated;width:100%;height:auto}
.emw-region img{max-width:100%}
.emw-tr-pic{background:#f4f4ec;border-radius:4px;width:40px;height:40px}
.emw-trainers th small{display:block;font-weight:400}
.emw-rail-boxes{display:grid!important;grid-template-columns:1fr 1fr;gap:4px}
.emw-rail .infobox .emw-rail-boxes img{max-height:150px}
.emw-boxes{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.emw-hero{grid-template-columns:280px minmax(0,1fr)}
.emw-hero .emw-boxes img{width:100%;display:block;border-radius:4px}
.emw-excl li small{display:inline}
.emw-dshot{background:#101418}
@media (max-width:900px){.emw-maps-row{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:640px){
 .emw-hero{grid-template-columns:1fr}
 .emw-hero .emw-boxes{max-width:300px}
 .emw-posmap{width:100%;max-width:288px}
 .emw-wild:not(.emw-fish) thead th:nth-child(2),.emw-wild:not(.emw-fish) td:nth-child(2){display:none}
 .emw-wild th,.emw-wild td{padding:4px 3px}
 .emw-wild thead th{font-size:.62rem;letter-spacing:0}
}
.emw-team-inline .emw-nolink{display:inline-flex;align-items:center;gap:2px;font-size:.8rem;white-space:nowrap}
.emw-team-inline .emw-nolink small{display:inline;color:var(--muted)}
span.emw-mon{display:inline-flex;align-items:center;gap:4px}
/* Ruby/Sapphire additions */
.emw-home-links{display:flex;flex-wrap:wrap;gap:6px;margin:.6rem 0 1rem}
.emw-home-links a{font-size:.82rem;padding:4px 10px;border:1px solid var(--line,#393732);border-radius:999px;text-decoration:none}
.emw-region{max-width:480px}
.emw-region img{width:100%;height:auto}
.emw-leaguebox{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px}
.emw-leaguebox a{display:flex;gap:8px;align-items:center;text-decoration:none;color:var(--text);border:1px solid var(--emw-line);border-radius:7px;padding:6px;background:var(--emw-soft);font-size:.85rem}
.emw-leaguebox small{display:block;color:var(--muted);font-size:.74rem}
.emw-posmap{width:240px}
.emw-posmap-lg{max-width:480px;width:100%}
@media (max-width:700px){.emw-posmap{width:100%;max-width:240px}}
@media (max-width:700px){.emw-where{flex-direction:column;align-items:flex-start}}
/* Gold/Silver-style League, rival, home and gallery additions */
.emw-rematch{margin-top:4px;font-size:.8rem}
.emw-rematch summary{cursor:pointer;color:var(--muted,#aaa69d)}
.emw-rematch>div{margin-top:4px}
.emw-profile{margin-top:.2rem}
.emw-trainer h3.emw-area{margin-top:.8rem}
.emw-gallery .reference-figure{margin:0}
/* Emerald additions: one box art, Frontier Brains */
.emw-boxes.emw-boxes-one{grid-template-columns:1fr;max-width:220px}
.emw-rail-boxes{grid-template-columns:1fr!important}
.emw-rail-boxes img{max-height:240px;width:auto;margin:0 auto}
.emw-rematch .emw-table-wrap{margin-top:.3rem}
.emw-brain{display:flex;gap:8px;align-items:center;border:1px solid var(--emw-line);border-radius:6px;padding:4px 8px;background:var(--emw-soft);font-size:.86rem}
.emw-brain small{display:block}
