/* Pokemerald homepage v2. Everything is scoped to #pm_home (the Pixwell composer section on the Home page). */
#pm_home{--h-ink:#1b1f3b;--h-mut:#565c84;--h-line:#e3e6f7;--h-tint:#f1f3ff;--h-card:#fff;--h-indigo:#4f46e5;--h-navy:#10143a;--h-navy2:#1c2260;--h-gold:#ffc83d;--h-em:#0fb77f;--h-sh:0 10px 28px rgba(28,34,96,.13);--h-r:18px;--h-gap:clamp(26px,3.2vw,38px)}
[data-theme="dark"] #pm_home{--h-ink:#eef0ff;--h-mut:#a9b0d8;--h-line:#2b3170;--h-tint:#141842;--h-card:#1a1f50;--h-sh:0 10px 28px rgba(0,0,0,.4)}

/* Helper blocks (stylesheet link + script) must not take space */
#pm_home #pm_css,#pm_home #pm_hero_js{display:none!important;margin:0!important}

/* One consistent vertical rhythm */
#pm_home .fw-block,#pm_home .fw-category{margin-top:0;margin-bottom:var(--h-gap)}
#pm_home #pm_hero,#pm_home #pm_chips,#pm_home #uid_53a779389{margin-bottom:0}

/* Pixwell gives .content-wrap a negative bottom margin; it pulls pagers into the cards and lets panels overflow */
#pm_home .content-wrap{margin-bottom:0!important}

/* Section headers share one look */
#pm_home .block-header{margin:0 0 18px}
#pm_home .block-title{font-size:clamp(1.3rem,2.2vw,1.7rem);background:none!important;color:var(--h-ink)!important;box-shadow:none}
#pm_home .block-title a{color:inherit!important;background:none!important}
#pm_home .fw-list-1 .block-title,#pm_home .fw-list-1 .block-title a{color:#fff!important}
#pm_home .block-view-more a{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:999px;background:var(--h-tint);color:var(--h-indigo);font-weight:700;font-size:.82rem;text-decoration:none}
#pm_home .block-view-more a:hover{background:var(--h-indigo);color:#fff}

/* ---------- Hero: one featured article + three smaller ones (server-rendered from the newest game posts) ---------- */
#pm_hero{margin-top:6px!important}
#pm_hero .load-animation{display:none}
#pm_hero .per-load,#pm_hero .pmh-stage{opacity:1!important;visibility:visible!important}
#pm_hero .content-wrap,#pm_hero .content-inner{padding:0;margin:0}
#pm_hero .pmh-stage{position:relative;display:grid;grid-template-columns:minmax(0,1.75fr) minmax(0,1fr);grid-template-rows:repeat(3,minmax(0,1fr));gap:12px;height:clamp(400px,38vw,520px);margin:0;border-radius:0;box-shadow:none;background:none;overflow:visible}
#pm_hero .pmh-stage .p-wrap{position:relative;display:none;min-height:0!important;height:auto;margin:0;border-radius:var(--h-r);overflow:hidden;background:linear-gradient(135deg,#2a2f78,#10143a);box-shadow:var(--h-sh);isolation:isolate;}
#pm_hero .pmh-stage:not(.pmh-js) .p-wrap:nth-child(-n+4){display:block}
#pm_hero .pmh-stage:not(.pmh-js) .p-wrap:nth-child(1){grid-column:1;grid-row:1/4}
#pm_hero .pmh-stage:not(.pmh-js) .p-wrap:nth-child(2){grid-column:2;grid-row:1}
#pm_hero .pmh-stage:not(.pmh-js) .p-wrap:nth-child(3){grid-column:2;grid-row:2}
#pm_hero .pmh-stage:not(.pmh-js) .p-wrap:nth-child(4){grid-column:2;grid-row:3}
#pm_hero .pmh-stage.pmh-js .p-wrap[data-slot]{display:block}
#pm_hero .pmh-stage.pmh-js .p-wrap[data-slot="0"]{grid-column:1;grid-row:1/4}
#pm_hero .pmh-stage.pmh-js .p-wrap[data-slot="1"]{grid-column:2;grid-row:1}
#pm_hero .pmh-stage.pmh-js .p-wrap[data-slot="2"]{grid-column:2;grid-row:2}
#pm_hero .pmh-stage.pmh-js .p-wrap[data-slot="3"]{grid-column:2;grid-row:3}
#pm_hero .pmh-stage.pmh-in .p-wrap[data-slot]{animation:pmhIn .5s ease both}
@keyframes pmhIn{from{opacity:.55;transform:scale(.985)}to{opacity:1;transform:none}}

#pm_hero .p-feat:after,#pm_hero .rb-iwrap:after,#pm_hero .p-feat:before,#pm_hero .rb-iwrap:before,#pm_hero .content-overlay:before{display:none!important;content:none!important}
#pm_hero .p-feat{position:absolute;inset:0;width:100%;height:100%;margin:0;border-radius:0}
#pm_hero .p-flink,#pm_hero .rb-iwrap{position:absolute;inset:0;display:block;width:100%;height:100%;margin:0;padding:0!important}
#pm_hero .rb-iwrap img{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:cover;object-position:center;transform:none;animation:none;transition:transform .6s ease}
#pm_hero .p-wrap:hover .rb-iwrap img{transform:scale(1.04)}
/* Subtle gradient only where the text sits (replaces the heavy dark overlay) */
#pm_hero .content-overlay{position:absolute;left:0;right:0;bottom:0;top:auto;z-index:2;display:block;height:auto;min-height:0;padding:0;background:linear-gradient(0deg,rgba(8,11,38,.74) 0%,rgba(8,11,38,.34) 48%,rgba(8,11,38,0) 100%);pointer-events:none}
#pm_hero .content-overlay .rbc-container{width:100%;max-width:none;margin:0;padding:46px 16px 14px}
#pm_hero .overlay-holder{max-width:none;text-align:left}
#pm_hero .overlay-holder>*{animation:none!important}
#pm_hero .p-cat-info{margin:0 0 8px;position:relative;z-index:4}
#pm_hero .p-cat-info a.cat-info-el{pointer-events:auto;padding:4px 10px;font-size:.7rem;letter-spacing:.04em;border-radius:999px}
#pm_hero .p-header{margin:0}
#pm_hero .entry-title{margin:0;color:#fff;font-size:clamp(.95rem,1.12vw,1.08rem);font-weight:800;line-height:1.25;letter-spacing:0;text-shadow:0 2px 12px rgba(0,0,0,.55);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#pm_hero .entry-title a{color:#fff;pointer-events:auto}
#pm_hero .p-url:after{content:"";position:absolute;inset:0;z-index:3}
#pm_hero .p-footer,#pm_hero .read-it-later,#pm_hero .p-meta-info{display:none}
#pm_hero .overlay-holder:after{display:none}
#pm_hero .pmh-stage .p-wrap[data-slot="0"] .content-overlay .rbc-container,#pm_hero .pmh-stage:not(.pmh-js) .p-wrap:nth-child(1) .content-overlay .rbc-container{padding:70px 24px 62px}
#pm_hero .pmh-stage .p-wrap[data-slot="0"] .entry-title,#pm_hero .pmh-stage:not(.pmh-js) .p-wrap:nth-child(1) .entry-title{max-width:640px;font-size:clamp(1.35rem,2.6vw,2.2rem);line-height:1.15;-webkit-line-clamp:3}
#pm_hero .pmh-stage .p-wrap[data-slot="0"] .p-cat-info a.cat-info-el{padding:5px 13px;font-size:.76rem}
#pm_hero .pmh-stage .p-wrap[data-slot="0"] .overlay-holder:after,#pm_hero .pmh-stage:not(.pmh-js) .p-wrap:nth-child(1) .overlay-holder:after{content:"View details \2192";display:inline-block;margin-top:12px;padding:9px 18px;border-radius:999px;background:var(--h-gold);color:#1b1f3b;font-weight:800;font-size:.84rem}

/* Hero controls (created by pm-home.js) */
#pm_hero .pmh-ctl{grid-column:1;grid-row:1/4;align-self:end;z-index:6;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px;pointer-events:none}
#pm_hero .pmh-ctl>*{pointer-events:auto}
#pm_hero .pmh-dots{display:flex;align-items:center;gap:6px}
#pm_hero .pmh-dot{display:block;width:8px;height:8px;padding:0;border:0;border-radius:99px;background:rgba(255,255,255,.55);cursor:pointer;transition:width .25s,background .25s}
#pm_hero .pmh-dot[aria-current="true"]{width:26px;background:var(--h-gold)}
#pm_hero .pmh-btns{display:flex;gap:8px}
#pm_hero .pmh-b{display:grid;place-items:center;width:40px;height:40px;padding:0;border:1px solid rgba(255,255,255,.4);border-radius:50%;background:rgba(10,13,46,.55);color:#fff;cursor:pointer;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
#pm_hero .pmh-b:hover,#pm_hero .pmh-b:focus-visible{background:var(--h-gold);border-color:var(--h-gold);color:#1b1f3b;outline:0}
#pm_hero .pmh-b svg{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
#pm_hero .pmh-b .i-play{display:none;fill:currentColor;stroke:none}
#pm_hero .pmh-paused .pmh-b .i-pause{display:none}
#pm_hero .pmh-paused .pmh-b .i-play{display:block}

/* ---------- Category chips: one compact row right under the hero ---------- */
#pm_chips .content-wrap,#pm_chips .content-inner{padding:0;margin:0}
#pm_home #pm_chips .pm-chips{display:flex;flex-wrap:wrap;align-items:center;gap:6px 5px;margin:0;padding:12px 0 0}
#pm_home #pm_chips .pm-chip{gap:6px;padding:5px 9px 5px 8px;font-size:.82rem}
#pm_home #pm_chips .pm-chip i{padding:2px 7px;font-size:.7rem}
#pm_home #pm_chips .pm-chips-label{margin-right:2px;font-size:.72rem}
@media(min-width:992px){#pm_home #pm_chips .pm-chips-label{display:none}#pm_home #pm_chips .pm-chips{justify-content:flex-start}}

/* ---------- Intro: existing heading + description in one compact card ---------- */
#pm_home #uid_53a779389{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);align-items:center;gap:6px 28px;margin:14px 0 0!important;padding:16px 22px;text-align:left;border:1px solid var(--h-line);border-left:6px solid var(--h-indigo);border-radius:var(--h-r);background:linear-gradient(120deg,var(--h-tint),var(--h-card) 72%)}
#pm_home #uid_53a779389 .hbox-title{margin:0;color:var(--h-ink);font-size:clamp(1.12rem,1.9vw,1.5rem);font-weight:800;line-height:1.22;letter-spacing:-.01em}
#pm_home #uid_53a779389 .hbox-description{margin:0;color:var(--h-mut);font-size:.98rem;line-height:1.5}
#pm_home #uid_53a779389 .hbox-description p{margin:0}

/* ---------- Console tiles: compact ---------- */
#pm_home #pm_consoles{margin-top:14px;margin-bottom:var(--h-gap)}
#pm_consoles .cat-list-wrap{padding:0}
#pm_consoles .cat-list-inner{display:grid;grid-template-columns:minmax(150px,210px) minmax(0,1fr);align-items:center;gap:14px 24px}
#pm_consoles .block-header{justify-content:flex-start!important;display:block!important}
#pm_consoles .cat-list-content{width:100%;max-width:none;margin:0;padding:0}
#pm_consoles .cat-list-header{width:auto!important;max-width:100%!important;min-width:0;margin:0!important;padding:0!important;text-align:left}
#pm_consoles .block-title{font-size:1.2rem;line-height:1.2;text-align:left}
#pm_consoles .element-desc{margin:6px 0 0!important;text-align:left;font-size:.88rem;line-height:1.4;color:var(--h-mut)}
#pm_home #pm_consoles .cat-list-content-inner{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0}
#pm_home #pm_consoles .cat-list-item{display:flex;flex-direction:row!important;align-items:center;gap:12px;margin:0;padding:8px 14px 8px 8px;border-radius:14px;background:var(--h-card);border:1px solid var(--h-line);box-shadow:none}
#pm_home #pm_consoles .cat-list-item:hover{transform:translateY(-2px);border-color:var(--h-indigo);box-shadow:var(--h-sh)}
#pm_consoles .cat-list-feat{flex:0 0 96px;width:96px;height:62px;padding:0!important;border-radius:10px;overflow:hidden;background:var(--h-tint)}
#pm_consoles .cat-list-feat img{display:block;width:100%;height:100%;object-fit:contain}
#pm_home #pm_consoles .cat-list-name{margin:0;font-size:1rem;font-weight:800;color:var(--h-ink);line-height:1.2;overflow-wrap:anywhere}

/* ---------- Cards shared by New Games / Fan Games / More ROM Hacks ---------- */
#pm_home .fw-grid-1 .content-inner,#pm_home .fw-masonry-1 .content-inner{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;margin:0}
#pm_home .fw-grid-1 .content-inner>[class*=rb-col-],#pm_home .fw-masonry-1 .content-inner>[class*=rb-col-]{width:auto;max-width:none;float:none;padding:0;margin:0}
#pm_home .fw-grid-1 .p-wrap,#pm_home .fw-masonry-1 .p-wrap{display:flex;flex-direction:column;height:100%;margin:0;border-radius:var(--h-r);overflow:hidden;background:var(--h-card);border:1px solid var(--h-line);box-shadow:var(--h-sh)}
#pm_home .fw-grid-1 .p-feat-holder,#pm_home .fw-masonry-1 .p-feat-holder,#pm_home .fw-grid-1 .p-feat,#pm_home .fw-masonry-1 .p-feat{position:relative;display:block;margin:0;border-radius:0}
#pm_home .fw-grid-1 .rb-iwrap,#pm_home .fw-masonry-1 .rb-iwrap{display:block;position:relative;aspect-ratio:3/2;height:auto;padding:0!important;overflow:hidden;background:var(--h-tint)}
#pm_home .fw-grid-1 .rb-iwrap img,#pm_home .fw-masonry-1 .rb-iwrap img{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:cover}
#pm_home .fw-grid-1 .p-cat-info.is-absolute,#pm_home .fw-masonry-1 .p-cat-info.is-absolute{left:12px;bottom:12px;top:auto}
#pm_home .fw-masonry-1 .p-cat-info.is-relative{margin:12px 16px 0;text-align:left}
#pm_home .fw-grid-1 .p-header,#pm_home .fw-masonry-1 .p-header{padding:14px 16px 0;margin:0;text-align:left}
#pm_home .fw-grid-1 .entry-title,#pm_home .fw-masonry-1 .entry-title{margin:0;font-size:1.02rem;line-height:1.3;font-weight:800;color:var(--h-ink);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#pm_home .fw-grid-1 .entry-title a,#pm_home .fw-masonry-1 .entry-title a{color:inherit}
#pm_home .fw-grid-1 .entry-summary,#pm_home .fw-masonry-1 .entry-summary{margin:8px 0 0;padding:0 16px;color:var(--h-mut);font-size:.9rem;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#pm_home .fw-grid-1 .p-footer,#pm_home .fw-masonry-1 .p-footer{margin-top:auto;padding:12px 16px 14px}
#pm_home .fw-grid-1 .p-wrap:hover,#pm_home .fw-masonry-1 .p-wrap:hover{transform:translateY(-3px)}

/* Section personalities (same cards, coordinated accents) */
#pm_home #pm_fan .block-title:before{background:linear-gradient(180deg,#7c3aed,#4f46e5)}
#pm_home #pm_hacks .block-title:before{background:linear-gradient(180deg,#0284c7,#4f46e5)}
#pm_home .fw-feat-1,#pm_home .fw-list-1{padding:28px clamp(16px,2.6vw,30px);border-radius:24px}
#pm_home .fw-feat-1 .content-inner{margin:0}
#pm_home .fw-feat-1,#pm_home .fw-list-1{display:flow-root}
#pm_home .fw-list-1 .content-wrap,#pm_home .fw-feat-1 .content-wrap{display:flow-root}
#pm_home .pagination-wrap{margin:22px 0 0;padding:0;text-align:center}
#pm_home #pm_hacks{margin-bottom:0}

/* Tablet */
@media(max-width:991px){
  #pm_hero .pmh-stage{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}
  #pm_consoles .cat-list-inner{grid-template-columns:minmax(0,1fr)}
  #pm_home #pm_consoles .cat-list-content-inner{grid-template-columns:repeat(2,minmax(0,1fr))}
  #pm_home .fw-grid-1 .content-inner,#pm_home .fw-masonry-1 .content-inner{grid-template-columns:repeat(2,minmax(0,1fr))}
  #pm_home #uid_53a779389{grid-template-columns:minmax(0,1fr)}
}
/* Phone */
@media(max-width:767px){
  #pm_home{--h-gap:28px}
  #pm_hero .pmh-stage{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:auto auto;gap:8px;height:auto}
  #pm_hero .pmh-stage:not(.pmh-js) .p-wrap:nth-child(1),#pm_hero .pmh-stage.pmh-js .p-wrap[data-slot="0"]{grid-column:1/4;grid-row:1;aspect-ratio:16/11}
  #pm_hero .pmh-stage:not(.pmh-js) .p-wrap:nth-child(2),#pm_hero .pmh-stage.pmh-js .p-wrap[data-slot="1"]{grid-column:1;grid-row:2;aspect-ratio:4/5}
  #pm_hero .pmh-stage:not(.pmh-js) .p-wrap:nth-child(3),#pm_hero .pmh-stage.pmh-js .p-wrap[data-slot="2"]{grid-column:2;grid-row:2;aspect-ratio:4/5}
  #pm_hero .pmh-stage:not(.pmh-js) .p-wrap:nth-child(4),#pm_hero .pmh-stage.pmh-js .p-wrap[data-slot="3"]{grid-column:3;grid-row:2;aspect-ratio:4/5}
  #pm_hero .pmh-ctl{grid-column:1/4;grid-row:1;padding:10px 12px}
  #pm_hero .content-overlay .rbc-container{padding:34px 9px 9px}
  #pm_hero .entry-title{font-size:.78rem;line-height:1.22;-webkit-line-clamp:3}
  #pm_hero .p-cat-info{margin-bottom:5px}
  #pm_hero .p-cat-info a.cat-info-el{padding:3px 7px;font-size:.62rem}
  #pm_hero .pmh-stage .p-wrap[data-slot="0"] .content-overlay .rbc-container,#pm_hero .pmh-stage:not(.pmh-js) .p-wrap:nth-child(1) .content-overlay .rbc-container{padding:56px 16px 58px}
  #pm_hero .pmh-stage .p-wrap[data-slot="0"] .entry-title,#pm_hero .pmh-stage:not(.pmh-js) .p-wrap:nth-child(1) .entry-title{font-size:1.22rem;-webkit-line-clamp:3}
  #pm_hero .pmh-stage .p-wrap[data-slot="0"] .overlay-holder:after,#pm_hero .pmh-stage:not(.pmh-js) .p-wrap:nth-child(1) .overlay-holder:after{display:none}
  #pm_hero .pmh-b{width:36px;height:36px}
  #pm_home #pm_chips .pm-chips{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding:10px 0 2px;margin-right:-16px;padding-right:16px}
  #pm_home #pm_chips .pm-chips::-webkit-scrollbar{display:none}
  #pm_home #uid_53a779389{padding:14px 16px}
  #pm_home #uid_53a779389 .hbox-description{font-size:.92rem}
  #pm_home #pm_consoles .cat-list-item{padding:6px 10px 6px 6px;gap:9px}
  #pm_consoles .cat-list-feat{flex-basis:64px;width:64px;height:44px;padding:0!important}
  #pm_home #pm_consoles .cat-list-name{font-size:.92rem}
  #pm_home .fw-grid-1 .content-inner,#pm_home .fw-masonry-1 .content-inner{gap:12px}
  #pm_home .fw-grid-1 .p-header,#pm_home .fw-masonry-1 .p-header{padding:10px 11px 0}
  #pm_home .fw-grid-1 .entry-title,#pm_home .fw-masonry-1 .entry-title{font-size:.9rem}
  #pm_home .fw-grid-1 .entry-summary,#pm_home .fw-masonry-1 .entry-summary{display:none}
  #pm_home .fw-grid-1 .p-footer,#pm_home .fw-masonry-1 .p-footer{padding:8px 11px 11px}
  #pm_home .fw-grid-1 .p-cat-info.is-absolute{left:8px;bottom:8px}
  #pm_home .fw-feat-1,#pm_home .fw-list-1{padding:22px 14px;border-radius:20px}
}
@media(max-width:380px){
  #pm_hero .entry-title{font-size:.72rem}
  #pm_consoles .cat-list-feat{flex-basis:50px;width:50px}
  #pm_home #pm_consoles .cat-list-item{gap:7px;padding-right:6px}
  #pm_home #pm_consoles .cat-list-name{font-size:.86rem}
}
@media(prefers-reduced-motion:reduce){#pm_hero .p-wrap,#pm_hero .rb-iwrap img,#pm_hero .pmh-dot{transition:none;animation:none!important}}
