/* ================================================================
   h5gamespro replica — styles matched to the live site (measured values)
   Body gradient  #2d2b63 -> #141339
   Screen         #2b2f73 -> #2e3d79
   Left Joy-Con   #ffa90a -> #e8c40f (yellow)
   Right Joy-Con  #0d5cc5 -> #5ea4ff (blue)
   PLAY button    #5ea4ff   |  View More / accent  #f34064
   Fonts: Poppins (body)  +  'Press Start 2P' (pixel: logo screen text)
          +  'Post No Bills Colombo' (offline, selective .font-colombo spans)
   ================================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-top: #2d2b63;
  --bg-bottom: #141339;
  --screen-top: #2b2f73;
  --screen-bottom: #2e3d79;
  --yellow-top: #ffa90a;
  --yellow-bottom: #e8c40f;
  --blue-top: #0d5cc5;
  --blue-bottom: #5ea4ff;
  --play: #5ea4ff;
  --play-dark: #3d84e6;
  --pink: #f34064;
  --card: #ffffff;
  --text-dark: #20232e;
  --muted: #9a9ab0;

  --content: 100%;   /* centered column width (matches the ~975px live column) */
  --rail: 150px;      /* Joy-Con controller width */
  --font-colombo: 'Post No Bills Colombo', 'Poppins', sans-serif;
}

/* Apply to specific spans when you want the display font */
.font-colombo {
  font-family: var(--font-colombo);
}

html, body {
  min-height: 100%;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  color: #fff;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* Centered content column, shared by every section */
.inner { max-width: 100%; margin: 0 auto; padding: 0 200px; }

/* ============================ CONSOLE (hero) ============================
   Nintendo Switch-style handheld — outer yellow shells with rounded bottom
   corners, inner content blocks with subtle box-shadow to create a raised
   look. Screen has two nested layers: a purple gradient container that
   holds a dark navy rounded-rectangle "display" (matches the real site
   structure: .screen-area > .screen-container > .screen-content).           */

.console { width: 100%; overflow: hidden; }
.console__inner {
  width: 100%;
  min-height: 758px;
  margin: 0;
  display: flex;
  align-items: stretch;
  /* Dark strip under the console — matches the shadow beneath the screen
     container so the yellow/blue joy-con curves visually connect with no gap. */
  background: #103059;
}

/* --- Outer joy-con shell (both are yellow, blue is only on the inner) --- */
.control {
  width: 200px;
  flex-shrink: 0;
  padding-bottom: 20px;
  background: linear-gradient(180deg, var(--yellow-top), var(--yellow-bottom));
  position: relative;
}
.control--left  { border-radius: 0 0 0 110px; }
.control--right { border-radius: 0 0 110px 0; }

/* --- Inner content: the visible part of the joy-con with its own color --- */
.control__inner {
  height: 100%;
  padding: 13px 13px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.control--left  .control__inner {
  background: linear-gradient(180deg, var(--yellow-top), var(--yellow-bottom));
  border-radius: 0 0 0 110px;
  box-shadow: 0 4px 4px 0 var(--yellow-bottom);
}
.control--right .control__inner {
  background: linear-gradient(180deg, var(--blue-top), var(--blue-bottom));
  border-radius: 0 0 110px 0;
  box-shadow: 0 4px 4px 0 var(--blue-bottom);
}

.control__corner {                           /* the − / + pill at the top */
  align-self: flex-start;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: rgba(0,0,0,.55); font-size: 22px; font-weight: 700;
}
.control--right .control__corner { align-self: flex-start; }
.minus-icon{
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: flex-end;
  justify-self: flex-start;
  margin-bottom: 6.5rem;
}
.minus-icon::before{
  content: "";
  display: block;
  width: 100%;
  height: 14px;
  border-radius: .8rem;
  background-color: #1c1d1d;
}
.add-icon{
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: flex-start;
  margin-bottom: 6.5rem;
}
.add-icon::before,
.add-icon::after{
  content: "";
  position: absolute;
  background-color: #1c1d1d;
  border-radius: .8rem;
}
.add-icon::before{
  width: 100%;
  height: 14px;
}
.add-icon::after{
  width: 14px;
  height: 100%;
}

.joystick {
  width: 174px; height: 174px; margin: 8px 0;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.4));
}
.joystick img { width: 100%; height: 100%; object-fit: contain; }

/* D-pad (left) & face cluster (right) — 4 round buttons in a diamond */
.dpad, .face { position: relative; width: 160px; height: 160px; margin-top: 8px; }
.dpad__btn, .face__btn {
  position: absolute; width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,.45), inset 0 1px 2px rgba(255,255,255,.18);
}
.dpad__btn { background: radial-gradient(circle at 50% 36%, #4d4d57, #212127); border: 1px solid rgba(0,0,0,.4); }
.face__btn { background: radial-gradient(circle at 50% 36%, rgba(53,66,99,.95), #1b2338); border: 1px solid rgba(0,0,0,.45); }
.dpad__btn img { width: 26px; height: 13px; }
.face__btn svg { width: 25px; height: 25px; }
.pos-up    { top: 0;    left: 50px; }
.pos-down  { bottom: 10px; left: 50px; }
.pos-left  { left: 0;   top: 46px; }
.pos-right { right: 0;  top: 46px; }

/* audio / grip lines on the right Joy-Con */
.audio {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 64px;
  opacity: 1;
}
.audio span {
  display: block;
  width: 12px;
  border-radius: 999px;
  background: #021652;
  transform: rotate(-38deg);
}
.audio span:nth-child(1),
.audio span:nth-child(3) {
  height: 32px;
}
.audio span:nth-child(2) {
  height: 48px;
}

/* --- Screen area (outer wrapper for the purple container) --- */
.screen-area {
  flex: 1;
  min-width: 0;
  padding-bottom: 20px;
}
/* --- Screen container: purple gradient shell around the dark navy display --- */
.screen-container {
  position: relative;
  height: 100%;
  background: linear-gradient(180deg, var(--screen-top), var(--screen-bottom));
  box-shadow: 0 4px 4px 0 #103059;
  padding: 62px 50px 48px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* --- Screen content: dark navy rounded-rectangle inner "display" --- */
.screen-content {
  flex: 1;
  background: #082448;
  border-radius: 60px;
  box-shadow: 0 -1px 2px 0 rgba(0,0,0,.25), 0 2px 2px 0 #4a5c8d;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  overflow: hidden;
}
/* Legacy alias so older .screen selectors keep working */
.screen {
  flex: 1;
  min-width: 0;
  background: linear-gradient(180deg, var(--screen-top), var(--screen-bottom));
  position: relative;
  overflow: hidden;
}

/* Hamburger button (matches .collapse-menu on the real site) */
.collapse-menu {
  position: absolute; top: 16px; left: 18px; z-index: 20;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  color: #fff; opacity: .85;
  transition: opacity .15s ease, transform .15s ease;
}
.collapse-menu:hover { opacity: 1; transform: scale(1.08); }
.collapse-menu svg { width: 22px; height: 20px; }

/* Sliding tag menu (matches .tag-menu on the real site) */
.tag-menu {
  position: absolute; top: 0; left: 0; z-index: 15;
  min-width: 140px;
  background: var(--screen-top);
  border-radius: 0 0 8px 0;
  padding: 44px 0 10px;
  transform: translateX(-100%);
  transition: transform .3s ease;
  box-shadow: 3px 3px 12px rgba(0,0,0,.25);
}
.tag-menu.is-open { transform: translateX(0); }
.tag-menu li a {
  display: block;
  padding: 10px 20px;
  color: rgba(255,255,255,.8);
  font-size: 13px; font-weight: 500;
  transition: color .12s ease, background .12s ease;
}
.tag-menu li a:hover { color: #fff; background: rgba(255,255,255,.1); }

.screen__logo {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  height: 36px; z-index: 6;
}
.screen__logo img { height: 100%; width: auto; }

.screen__stage {
  position: relative;
  flex: 1;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 18% 12px;
}

/* ---- Hero carousel (h5gamespro-style scale open/close) ---- */
.hero-games {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9.4;
  flex: 0 0 auto;
}

.hero-item {
  position: absolute;
  transition: top .3s ease, left .3s ease, right .3s ease, width .3s ease,
              transform .3s ease, opacity .3s ease;
  transform-origin: center center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  overflow: hidden;
  border-radius: 16px;
  background-color: #fff;
}

.hero-item__box {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-item__square,
.hero-item__landscape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(0.2);
  transition: opacity .3s cubic-bezier(0.95, 0.05, 0.795, 0.035),
              transform .3s cubic-bezier(0.95, 0.05, 0.795, 0.035);
}

/* Side thumbs: square cover opens, landscape stays closed */
.hero-item:not(.hero-item--active) {
  border: 4px solid #fff;
  border-radius: 20px;
}
.hero-item:not(.hero-item--active) .hero-item__box {
  width: 100%;
  height: 0;
  padding-bottom: 100%;
}
.hero-item:not(.hero-item--active) .hero-item__square {
  opacity: 1;
  transform: scale(1);
  transition: opacity .3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              transform .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 2;
}

/* Active: landscape opens, square closes (the "game close" effect) */
.hero-item--active {
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  cursor: default;
  border-radius: 16px;
  transform: none;
}
.hero-item--active .hero-item__box {
  width: 100%;
  height: 100%;
  padding-bottom: 0;
}
.hero-item--active .hero-item__landscape {
  opacity: 1;
  transform: scale(1);
  transition: opacity .5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              transform .5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 3;
}
.hero-item--active .hero-item__square {
  opacity: 0.2;
  transform: scale(0);
  transition: opacity .35s ease, transform .35s ease;
  z-index: 1;
}

/* Side positions — larger (0) on top, smaller (1) below */
.hero-item--prev-0,
.hero-item--prev-1 {
  left: -7%;
  transform: translateX(-100%) scale(1);
  z-index: 5;
}
.hero-item--next-0,
.hero-item--next-1 {
  right: -7%;
  transform: translateX(100%) scale(1);
  z-index: 5;
}
.hero-item--prev-0,
.hero-item--next-0 {
  top: 10%;
  width: 22%;
}
.hero-item--prev-1,
.hero-item--next-1 {
  top: 58%;
  width: 19%;
}

/* Off-stage: fully closed */
.hero-item--hidden {
  top: 10%;
  left: 50%;
  width: 19%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0) scale(0);
  z-index: 1;
}


.hero-nav {
  position: absolute;
  top: 50%;
  z-index: 30;
  transform: translateY(-50%);
  width: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: .85;
  transition: opacity .15s, transform .1s;
}
.hero-nav:hover { opacity: 1; }
.hero-nav:active { transform: translateY(-45%); }
.hero-nav img { width: 100%; display: block; }
.hero-nav--prev { left: -8%; }
.hero-nav--next img { transform: scaleX(-1); }
.hero-nav--next { right: -8%; }

.hero-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 18px;
  z-index: 4;
}

.screen__title {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px; color: #fff; margin: 0 0 14px;
  text-align: center; letter-spacing: 1px;
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.screen__start {
  font-family: 'Press Start 2P', monospace;
  font-size: 26px; color: #fff; letter-spacing: 2px;
  text-shadow: 0 3px 0 rgba(0,0,0,.25);
  transition: transform .12s ease, color .12s ease;
}
.screen__start:hover { transform: scale(1.05); color: #cfe2ff; }

/* ============================ SECTIONS ============================ */
.section { padding: 30px 0 0; }
.section:last-child { padding-bottom: 30px; }
.section--band {           /* New Games full-width gradient band */
  background: linear-gradient(108deg, #2a77f2 0.5%, #ff7afd 100%);
  padding: 34px 0 44px;
  margin-top: 34px;
}
.section__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section__title { font-size: 30px; font-weight: 600; color: #fff; }
.section__more {
  background: var(--pink); color: #fff;
  font-size: 14px; font-weight: 600;
  padding: 9px 22px; border-radius: 10px;
  box-shadow: 0 6px 16px rgba(243,64,100,.4);
  transition: transform .15s ease, box-shadow .15s ease;
}
.section__more:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(243,64,100,.5); }
.section__foot { display: none; }

/* ---- icon rows (Arcade / Puzzle / Sim / top of Popular & New) ---- */
.row-icon {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}
.row-icon > :nth-child(n+6) { display: none; }
.row-icon--category > :nth-child(n+6) { display: block; }
.icard {
  aspect-ratio: 1; border-radius: 22px; overflow: hidden;
  background: #0d0c2a; box-shadow: 0 8px 18px rgba(0,0,0,.28);
  transition: transform .16s ease;
}
.icard:hover { transform: translateY(-5px) scale(1.02); }
.icard img { width: 100%; height: 100%; object-fit: cover; }

/* ---- banner cards (Trending / New) — h5gamespro: featured + smaller thumbs ---- */
.row-trending {
  display: flex;
  gap: 16px;
  width: 100%;
  align-items: stretch; /* equal total card height */
}
.row-trending .bcard {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.row-trending .bcard--feat {
  flex: 2.1 1 0; /* ~41rem / 19.5rem like h5gamespro */
}
.row-trending .bcard:nth-child(n+5) {
  display: none; /* hide 5th below ultra-wide */
}
.row-trending .bcard__cover {
  aspect-ratio: 1;
  flex: 1 1 auto; /* grow cover to fill when card is stretched */
  min-height: 0;
}
.row-trending .bcard--feat .bcard__cover { aspect-ratio: 16 / 9; }
.row-trending .bcard__info { flex: 0 0 auto; }
.row-trending .bcard__row { margin-top: 0; }

.row-new {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 26px;
}
.row-new .bcard:nth-child(n+3) {
  display: none; /* 2 cards below ultra-wide */
}

/* Icon rows — 6 columns from 1440px, 5 below */
@media (min-width: 1440px) {
  .row-icon { grid-template-columns: repeat(6, 1fr); }
  .row-icon > :nth-child(n+6) { display: block; }
  .row-icon--category { grid-template-columns: repeat(6, 1fr); }
}

/* Ultra-wide desktop (≥1920) — trending / new / originals */
@media (min-width: 1920px) {
  .row-trending .bcard:nth-child(n+5) { display: flex; }
  .row-new {
    grid-template-columns: repeat(3, 1fr);
  }
  .row-new .bcard:nth-child(n+3) { display: flex; }
  .row-original-feat {
    grid-template-columns: 1fr 1fr;
  }
  .row-original-feat .ofeat:nth-child(n+2) { display: block; }
  .row-original {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.bcard {
  position: relative;
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 1px 6px 10px rgba(0,0,0,.25);
  transition: transform .16s ease, box-shadow .16s ease;
  display: flex; flex-direction: column;
}
.bcard:hover { transform: translateY(-5px); box-shadow: 0 16px 30px rgba(0,0,0,.35); }
.bcard__cover { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0d0c2a; overflow: hidden; }
.bcard--feat .bcard__cover, .row-new .bcard__cover { aspect-ratio: 16 / 9; }
/* absolute-fill keeps portrait source images from stretching the card height */
.bcard__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bcard__info { padding: 10px 12px 12px; display: flex; justify-content: space-between;  gap: 3px; flex: 1; }
.bcard__title {
  font-size: 14px; font-weight: 600; color: var(--text-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-new .bcard__title { font-size: 17px; }
.bcard__dev {
  font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-new .bcard__dev { font-size: 12px; }
.bcard__row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }

/* ribbon / rank mark — chunky display font matches h5gamespro's NoBills look */
.mark {
  position: absolute; top: 12px; left: 0;
  font-family: 'Post No Bills Colombo', monospace;
  min-width: 46px; height: 34px; padding: 0 12px 4px 10px;
  border-radius: 8px 40px 40px 0;
  display: grid; place-items: center;
  color: #fff;
  /* font-family: 'Passion One', 'Poppins', sans-serif; */
  font-weight: 900; font-size: 33px;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0,0,0,.3);
  z-index: 3;
}
.mark img { width: 26px; }
.row-new .mark, .bcard--feat .mark {
  top: 14px; min-width: 62px; height: 44px; font-size: 34px;
}
.tcard__rank {                    /* if legacy trending numeric rank is used */
  font-family: 'Passion One', 'Poppins', sans-serif;
  font-weight: 900;
}

/* ---- PLAY button ---- */
.play-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--play); color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 6px 15px; border-radius: 8px;
  box-shadow: 2px 2px 4px rgba(0,0,0,.15); 
  
  transition: background .15s ease;
  width: 64px;
  height: 33px;
}
.play-btn:hover { background: var(--play-dark); }
.play-btn .tri { font-size: 9px; }

/* ---- Popular : 2-column compact rows (cover-left, no card bg) ---- */
.row-popular { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 34px; }
.pcard { display: flex; gap: 16px; align-items: center; }
.pcard__cover {
  width: 84px; height: 84px; border-radius: 16px; object-fit: cover;
  flex-shrink: 0; background: #0d0c2a; box-shadow: 0 6px 14px rgba(0,0,0,.3);
}
.pcard__body { min-width: 0; flex: 1; }
.pcard__title {
  font-size: 16px; font-weight: 600; color: #fff;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pcard__dev { font-size: 12px; color: rgba(255,255,255,.65); margin: 2px 0 8px; }

/* ---- Originals : 1 featured on tablet/desktop, 2 on ultra-wide ---- */
.row-original-feat {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 8px;
}
.row-original-feat .ofeat:nth-child(n+2) {
  display: none;
}
.row-original {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 36px;
  row-gap: 8px;
  container-type: inline-size;
}
.ofeat {
  position: relative; border-radius: 18px; overflow: hidden;
  aspect-ratio: 16 / 9; background: #0d0c2a; margin-bottom: 0;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.ofeat img { width: 100%; height: 100%; object-fit: cover; }
.ofeat__grad { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.8) 0%, rgba(0,0,0,0) 45%); }
.ofeat__meta { position: absolute; left: 22px; bottom: 18px; right: 22px; }
.ofeat__title { font-size: 26px; font-weight: 700; color: #fff; }
.ofeat__dev { font-size: 13px; color: rgba(255,255,255,.8); margin-top: 2px; }

.orow {
  display: flex;
  align-items: center;
  align-items: safe center;
  gap: 16px;
  margin-top: 12px;
  min-inline-size: 0;
}
.orow__cover {
  inline-size: clamp(80px, 28cqi, 168px);
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 14px;
  object-fit: cover;
  flex: 0 0 auto;
  background: #0d0c2a;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.orow__body { flex: 1 1 0; min-inline-size: 0; }
.orow__title {
  font-size: 18px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.orow__dev {
  font-size: 12px; color: rgba(255,255,255,.65);
  margin-block: 2px 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.orow .play-btn {
  flex: 0 0 auto;
  margin-inline-start: auto;
  white-space: nowrap;
}

/* ---- stars ---- */
.stars { display: inline-flex; align-items: center; color: #ffc107; }
.stars svg { width: 13px; height: 13px; display: block; }

/* ============================ BACK TO TOP ============================ */
.backtop-wrap { display: flex; justify-content: center; padding: 34px 0; }
.backtop {
  background: var(--play); color: #fff;
  font-size: 15px; font-weight: 600;
  padding: 11px 26px; border-radius: 22px;
  box-shadow: 0 8px 20px rgba(94,164,255,.45);
  transition: transform .15s ease;
}
.backtop:hover { transform: translateY(-3px); }

/* ============================ FOOTER ============================ */
.footer { padding: 8px 0 40px; background-color: #0073DD; }
.footer__row {
  display: flex;
  align-items: center;
  justify-content: center;
}
.footer ul { display: flex; gap: 34px; justify-content: center; }
.footer a { font-size: 15px; color: rgba(255,255,255,.7); transition: color .15s ease; }
.footer a:hover { color: #fff; }
.footer__handle {
  display: none;
  flex-shrink: 0;
  object-fit: contain;
}

/* ============================ INNER PAGES (Detail / Category) ============================
   Matched to https://www.h5gamespro.com/detail — navy header #2f3173, bright blue
   page #0073dd, gray pill search, 2-column white content area. */

html:has(.detail-page),
body:has(.detail-page) {
  background: #0073dd;
  color: #fff;
}
.app:has(.detail-page) .footer {
  background: #0073dd;
}
.app:has(.detail-page) .footer a { color: #fff; }
.app:has(.detail-page) .footer a:hover { color: #eef8ff; }

.detail-page {
  min-height: 100vh;
  background: #0073dd;
  padding-bottom: 40px;
  overflow-x: hidden;     /* stop the whole page from ever scrolling sideways */
  --page-w: 1180px;
}

/* Navy header bar (live site header is rgb(47, 49, 115)) */
.dhdr {
  background: #2f3173;
  height: 50px;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 30;
  display: flex;
  align-items: center;
}
.dhdr__inner {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.dhdr__logo img { height: 40px; display: block; }
.dhdr__search {
  flex: 1; max-width: 540px;
  display: flex; background: #e6e6e6; border-radius: 28px; overflow: hidden;
  box-shadow: 0 8px 15px rgba(75, 72, 72, .1);
}
.dhdr__search input {
  flex: 1; border: none; outline: none;
  height: 35px;
  padding: 10px 20px; font: 13px Arial, 'Poppins', sans-serif; color: #000;
  background: transparent;
}
.dhdr__search button {
  padding: 0 16px; color: #666; display: grid; place-items: center;
}
.dhdr__search button svg { width: 18px; height: 18px; }
.dhdr__search-toggle,
.dhdr__msearch { display: none; }

/* Top row of 12 game icons — static grid, no slider */
.dtop-wrap {
  max-width: var(--page-w); margin: 0 auto;
  padding-top: 16px;
}
.dtop {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
}
.dtop li { min-width: 0; }
.dtop img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  object-fit: cover;
  background: #0d0c2a;
  transition: transform .15s ease;
}
.dtop img:hover { transform: translateY(-3px); }

/* 2-column wrap: aside + article */
.dwrap {
  max-width: var(--page-w); margin: 16px auto 0;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}

/* Left sidebar list */
.dside { display: flex; flex-direction: column; gap: 10px; }
.dside__item {
  background: #fff; border-radius: 12px; padding: 8px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transition: transform .12s ease, box-shadow .12s ease;
}
.dside__item:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.15); }
.dside__item img {
  width: 54px; height: 54px; border-radius: 10px; object-fit: cover;
  flex-shrink: 0; background: #eef1f6;
}
.dside__body { min-width: 0; flex: 1; }
.dside__title {
  font-size: 13px; font-weight: 500; color: #20232e;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.dside__rate { display: flex; align-items: center; gap: 6px; }
.dside__rate > span:not(.stars) { font-size: 12px; color: #666; }

/* Main article — white card */
.dmain-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 2px 2px 12px; /* room so box-shadow is not clipped */
}
.dmain {
  background: #fff;
  border-radius: 16px;
  padding: 26px 30px;
  color: #20232e;
  box-shadow: 0 6px 24px rgba(0,0,0,.1);
  min-width: 0;   /* let inner scroll rows (screenshots) shrink to the grid cell */
}
.dside { min-width: 0; }

/* Game header */
.dhead {
  display: flex; align-items: center; gap: 20px;
  padding-bottom: 22px;
}
.dhead__icon {
  width: 100px; height: 100px; border-radius: 22px; object-fit: cover;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
  flex-shrink: 0;
}
.dhead__meta { flex: 1; min-width: 0; }
.dhead__title {
  font-size: 22px; font-weight: 500; color: #000;
  margin-bottom: 4px; line-height: 1.3;
}
.dhead__dev { font-size: 14px; color: #666; margin-bottom: 8px; }
.dhead__rate { display: flex; align-items: center; gap: 8px; }
.dhead__rate .stars svg { width: 14px; height: 14px; }
.dhead__num { font-size: 14px; color: #666; font-weight: 300; }
.msimple__store {
  margin-top: 10px;
  padding: 8px 14px;
  font-size: 13px;
}

/* Info tiles */
.dtiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
}
.dtile {
  display: flex;
  align-items: center;
  padding: 6px;
  border: 1px solid #e6e6e6;
  box-sizing: border-box;
}
.dtile__ic {
  width: 40px;
  height: 40px;
  margin-right: 10px;
  flex-shrink: 0;
  color: #000;
}
.dtile__k {
  font-size: 12px;
  font-weight: 400;
  color: #666;
  margin: 0;
}
.dtile__v {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #000;
}

.dhead-wrap{
  display: flex;
  justify-content: space-between;
  align-items: safe center;
  gap: 24px;
  margin-bottom: 8px;
}
.dhead-wrap__body {
  flex: 1 1 0;
  min-inline-size: 0;
}
.dads {
  /* flex: 0 0 300px;
  inline-size: 300px;
  block-size: 250px; */
  max-height: 300px;
  color: #9aa3b5;
  position: relative;
}
.dads__label {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dads--banner {
  flex: none;
  width: 100%;
  height: auto;
  inline-size: 100%;
  block-size: auto;
  overflow: visible;
  margin-inline: auto;
  margin-block: 20px 8px;
}
.dads__slot {
  display: flex;
  justify-content: center;
  max-inline-size: 100%;
  overflow: hidden;
}

/* Section heading */
.dsec-title {
  font-size: 17px; font-weight: 600; color: #20232e;
  margin: 26px 0 14px;
}

/* Screenshots */
.dshots {
  display: flex; gap: 10px; overflow-x: auto;
  padding-bottom: 8px; margin: 0 -6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.dshots::-webkit-scrollbar { display: none; }
.dshot {
  flex-shrink: 0;
  width: 130px; aspect-ratio: 9 / 16;
  border-radius: 12px; overflow: hidden;
  background: #0d0c2a;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.dshot img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 520px) { .dshot { width: 110px; } }
.dshot img { width: 100%; height: 100%; object-fit: cover; }

/* Discover more */
.ddiscover {
  background: #f6f8fb; border-radius: 12px;
  padding: 6px 0; margin: 8px 0 4px;
}
.ddiscover__head {
  padding: 12px 18px 8px; font-size: 14px; font-weight: 600; color: #20232e;
  border-bottom: 1px solid #e7eaf0;
}
.ddiscover__row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; font-size: 14px; color: #444;
  border-bottom: 1px solid #eef0f5; cursor: pointer;
  transition: background .12s ease;
}
.ddiscover__row:last-child { border-bottom: none; }
.ddiscover__row:hover { background: #eef2f8; }
.ddiscover__chev { color: #bbb; font-size: 18px; }

/* Text blocks */
.dtext p {
  font-size: 14px; line-height: 1.75; color: #444; margin-bottom: 12px;
}
.dtext h2 {
  font-size: 17px; color: #20232e; font-weight: 600;
  margin: 22px 0 10px;
}

/* Download the App — teal store cards */
.ddownload {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.ddl {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  padding: 16px 20px;
  border: 1.5px solid #0d9488; border-radius: 10px;
  background: #f0faf9; color: #1a1a1a;
  text-align: center;
  transition: background .12s ease, transform .12s ease;
}
.ddl:hover { background: #e6f7f5; transform: translateY(-2px); }
.ddl:focus-visible { outline: 2px solid #0d9488; outline-offset: 2px; }
.ddl__brand {
  display: flex; align-items: center; gap: 8px;
}
.ddl__logo {
  width: 22px; height: 24px; flex-shrink: 0; display: block;
}
.ddl__logo--apple { width: 18px; height: 22px; color: #111; }
.ddl b {
  font-size: 16px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2;
}
.ddl small {
  font-size: 13px; font-weight: 400; color: #6b7280; line-height: 1.3;
}

/* Online Games grid */
.dgrid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
}
.dgrid__item {
  aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
  transition: transform .15s ease;
}
.dgrid__item:hover { transform: translateY(-3px) scale(1.03); }
.dgrid__item img { width: 100%; height: 100%; object-fit: cover; }

/* ============================ MOBILE HERO (Game Boy) ============================ */

.mhome {
  background: #4eb8ef;
  padding-bottom: 18px;
}

/* Top navy nav bar */
.mnav {
  position: relative;
  background: #0c2d6a;
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
  color: #fff;
}
.mnav__menu, .mnav__home {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  color: #fff; background: transparent; border: none; cursor: pointer;
  border-radius: 8px;
  transition: background .12s ease;
  flex-shrink: 0;
}
.mnav__menu:hover, .mnav__home:hover { background: rgba(255,255,255,.1); }
.mnav__menu svg { width: 22px; height: 20px; }
.mnav__home svg { width: 22px; height: 22px; }
.mnav__logo {
  position: absolute; left: 50%; transform: translateX(-50%);
}
.mnav__logo img { height: 30px; display: block; }
.mnav__menu-panel {
  position: absolute; top: 100%; left: 0; z-index: 40;
  background: #0c2d6a;
  min-width: 150px; padding: 6px 0;
  border-radius: 0 0 10px 0;
  box-shadow: 4px 8px 20px rgba(0,0,0,.35);
}
.mnav__menu-panel li a {
  display: block; padding: 10px 20px;
  color: rgba(255,255,255,.8); font-size: 14px; font-weight: 500;
}
.mnav__menu-panel li a:hover { color: #fff; background: rgba(255,255,255,.1); }

/* Handheld console — navy shell + mint screen (title + START inside) */
.gb-wrap {
  background: #4eb8ef;
  padding: 18px 18px 8px;
}
.gb-console {
  position: relative;
  background: #0c2d6a;
  border-radius: 50px 50px 100px 50px;
  /* padding: 18px 16px 22px; */
  padding: 22px 27px 13px;
  /* border-bottom-right-radius: 50px; */
  box-shadow: 0 10px 24px rgba(8, 30, 80, .28);
}
.gb-screen {
  position: relative;
  background: #c6e89a;
  border-radius: 26px;
  padding: 16px 10px 18px;
  box-shadow: inset 0 3px 10px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gb-led {
  position: absolute; top: 50%; left: -13px; transform: translateY(-50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: #ff3b3b;
  box-shadow: 0 0 8px rgba(255, 50, 50, .7);
}
.gb-stage {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 2px;
}
.gb-arrow {
  flex: 0 0 22px;
  width: 22px; height: 28px;
  display: grid; place-items: center;
  color: #111;
  background: transparent; border: none; cursor: pointer;
  padding: 0;
}
.gb-arrow__icon {
  width: 14px; height: 24px;
  fill: currentColor;
  display: block;
}
.gb-arrow__icon--flip { transform: scaleX(-1); }
.gb-display {
  flex: 1;
  min-width: 0;
  aspect-ratio: 16 / 9;
  border-radius: 10px; overflow: hidden;
  background: #0d0c2a;
  box-shadow: 0 3px 10px rgba(0,0,0,.22);
}
.gb-display img { width: 100%; height: 100%; object-fit: cover; }
.gb-title {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #111;
  margin: 14px 0 6px;
  text-align: center;
  line-height: 1.3;
}
.gb-start {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 22px;
  color: #111;
  letter-spacing: 1px;
  background: transparent; border: none; cursor: pointer;
  padding: 2px 8px 4px;
  transition: transform .12s ease;
}
.gb-start:hover { transform: scale(1.05); }
.gb-brand {
  display: flex; justify-content: center; margin-top: 14px;
}
.gb-brand img {
  height: 16px;
  filter: brightness(0) invert(1);
}
.gb-grip {
  position: absolute; right: 0px; bottom: 0px;
  display: flex; gap: 4px;
  rotate: 320deg;
}
.gb-grip span:nth-child(2) {
  height: 24px;
}
.gb-grip span {
  width: 5px; height: 18px; border-radius: 10px;
  background: #061a42;
}

/* Single featured icon on the sky-blue band */
.mhome__row {
  display: flex;
  padding: 10px 18px 0;
}
.mhome__row li {
  width: calc((100% - 28px) / 3);
}
.mhome__row li a { display: block; }
.mhome__row li img {
  width: 100%; aspect-ratio: 1;
  border-radius: 18px; object-fit: cover;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,40,90,.18);
  border: 3px solid #fff;
}
.mhome__row-name {
  display: block;
  font-size: 11px; color: #2a3a55;
  margin-top: 6px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============================ MOBILE DETAIL ============================ */

.mdetail {
  min-height: 100vh;
  background: #fff;
  padding-bottom: 30px;
}
/* Compact game info block */
.msimple {
  display: flex; gap: 14px; align-items: center;
  padding: 16px;
}
.msimple__icon {
  width: 80px; height: 80px; border-radius: 18px; object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  flex-shrink: 0;
}
.msimple__body { flex: 1; min-width: 0; }
.msimple__title {
  font-size: 20px; font-weight: 600; color: #20232e;
  margin-bottom: 6px;
}
.msimple__rate { display: flex; align-items: center; gap: 8px; }
.msimple__rate .stars svg { width: 14px; height: 14px; }
.msimple__rate span { font-size: 13px; font-weight: 300; }

/* Info table */
.minfo {
  padding: 0 16px 12px;
}
.minfo ul { background: #f6f8fb; border-radius: 12px; padding: 4px 14px; }
.minfo li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e7eaf0;
  font-size: 14px;
}
.minfo li:last-child { border-bottom: none; }
.minfo li span:first-child { color: #666; font-weight: 500; }
.minfo li span:last-child { color: #20232e; font-weight: 600; text-align: right; }

/* Blue full-width Screenshots band */
.mshots-band {
  background: #0073dd;
  padding: 16px;
  margin-top: 12px;
}
.mshots-band__title {
  color: #fff; font-size: 17px; font-weight: 600;
  margin-bottom: 12px;
}

/* Sections wrapper */
.msection {
  padding: 16px;
}
.msection__title {
  font-size: 17px; font-weight: 600; color: #20232e;
  margin-bottom: 12px;
}
.mrecommend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mrecommend li a {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #0d0c2a;
}
.mrecommend li img { width: 100%; height: 100%; object-fit: cover; }

.mgames-band {
  background: #0073dd;
  padding: 16px 16px 22px;
  margin-top: 8px;
}
.mgames-band__title {
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 12px;
}
.mgames-band .mrecommend + .mgames-band__title {
  margin-top: 22px;
}
.mh5 {
  position: absolute;
  left: 0;
  bottom: 0;
  background: #28e0d2;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  padding: 3px 7px 2px;
}
html:has(.mdetail),
body:has(.mdetail) {
  background: #fff;
  color: #20232e;
}
.app:has(.mdetail) .footer {
  border-top: 1px solid #eef0f5;
}
.app:has(.mdetail) .footer a { color: #fff; }

/* Desktop screenshots slider arrows */
.dshots-wrap { position: relative; }
.dshots-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0, 115, 221, .95); color: #fff;
  font-size: 22px; line-height: 1;
  display: grid; place-items: center;
  cursor: pointer; border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  z-index: 5;
  transition: transform .12s ease, background .12s ease;
}
.dshots-arrow svg { width: 22px; height: 22px; display: block; }
.dshots-arrow:hover { transform: translateY(-50%) scale(1.1); background: rgba(0,115,221,1); }
.dshots-arrow--l { left: -6px; }
.dshots-arrow--r { right: -6px; }

/* Hide mobile/tablet hero chrome on desktop Joy-Con layout */
@media (min-width: 1025px) {
  .mhome, .mdetail { display: none; }
}

/* Tablet — same handheld hero, slightly roomier */
@media (min-width: 721px) and (max-width: 1024px) {
  .gb-wrap { padding: 24px 12px 12px; }
  .gb-console {
    max-width: 100%;
    margin: 0 auto;
    padding: 22px 20px 26px;
    border-radius: 50px 50px 100px 50px;
  }
  .gb-screen { padding: 20px 14px 22px; border-radius: 26px; }
  .gb-title { font-size: 15px; margin: 16px 0 8px; }
  .gb-start { font-size: 28px; }
  .gb-arrow { flex-basis: 28px; width: 28px; }
  .gb-brand img { height: 18px; }
  .mhome__row {
    margin: 8px auto 0;
    gap: 16px;
    padding: 10px 48px 0;
  }
}

/* ============================ CATEGORY PAGE ============================
   Google-Play-style masonry: first tile is 2x2, rest are 1x1. Light bg. */

.cat-page {
  min-height: 100vh;
  background: #f2f5f9;
  padding-bottom: 40px;
  overflow-x: hidden;
  --page-w: 1080px;
}
.cat-page .footer { background: #f2f5f9; }
.cat-page .footer a { color: #666; }
.cat-page .footer a:hover { color: #0073dd; }

.cat-wrap {
  max-width: var(--page-w); margin: 24px auto 0;
  padding: 0 20px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  list-style: none;
}
.cat-item2 { aspect-ratio: 1; }
.cat-item2--big { grid-column: span 2; grid-row: span 2; }
.cat-item2 a {
  display: block; width: 100%; height: 100%;
  border-radius: 22px; overflow: hidden;
  background: #0d0c2a;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  transition: transform .15s ease, box-shadow .15s ease;
}
.cat-item2 a:hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(0,0,0,.18); }
.cat-item2 img { width: 100%; height: 100%; object-fit: cover; }

.cat-desc {
  margin-top: 30px;
  padding: 20px 22px;
  background: #fff;
  border-radius: 10px;
  color: #666;
  font-size: 14px; line-height: 1.7;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

@media (max-width: 900px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .cat-item2 a { border-radius: 18px; }
}
@media (max-width: 520px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .cat-item2 a { border-radius: 14px; }
}

/* Disclaimer — white elevated card */
.disclaimer-card {
  background: #fff;
  border-radius: 8px;
  padding: 24px 28px;
  margin-top: 26px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.12),
    0 8px 28px rgba(0, 0, 0, 0.18);
}
.dmain-stack .disclaimer-card { margin-top: 0; }
.mdetail .disclaimer-card { margin: 10px 12px; }
.disclaimer-card__title {
  font-size: 17px;
  font-weight: 700;
  color: #20232e;
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f0f0;
}
.disclaimer-card__body { padding-top: 16px; }
.disclaimer-card p {
  font-size: 13px;
  line-height: 1.75;
  color: #666;
  margin: 0 0 14px;
}
.disclaimer-card p:last-child { margin-bottom: 0; }
.disclaimer-card a {
  color: #26a69a;
  text-decoration: none;
}
.disclaimer-card a:hover,
.disclaimer-card a:focus-visible {
  text-decoration: underline;
}

/* Responsive: collapse sidebar */
@media (max-width: 900px) {
  .dwrap { grid-template-columns: 1fr; }
  .dside { display: none; }
  .dmain { padding: 20px 18px; }
  .dgrid { grid-template-columns: repeat(3, 1fr); }
  .ddownload { grid-template-columns: 1fr; }
  .dhead-wrap { flex-wrap: wrap; justify-content: center; }
  .dhead-wrap__body { flex: 1 1 100%; }
}
@media (max-width: 1024px) {
  .dhdr {
    height: auto;
    min-height: 50px;
    padding: 0;
    flex-direction: column;
    align-items: stretch;
  }
  .dhdr__inner {
    height: 50px;
    padding: 0 16px;
    max-width: none;
  }
  .dhdr__inner > .dhdr__search { display: none; }
  .dhdr__search-toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    color: #fff;
    border-radius: 8px;
  }
  .dhdr__search-toggle svg { width: 22px; height: 22px; }
  .dhdr__search-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
  }
  .dhdr--search-open .dhdr__msearch {
    display: flex;
    width: 100%;
    background: #e6e6e6;
    box-shadow: 0 8px 15px rgba(75, 72, 72, .1);
  }
  .dhdr__msearch input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    height: 44px;
    padding: 10px 16px;
    font: 14px Arial, 'Poppins', sans-serif;
    color: #000;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
  }
  .dhdr__msearch button {
    padding: 0 16px;
    color: #666;
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
  .dhdr__msearch button svg { width: 20px; height: 20px; }
}
@media (max-width: 520px) {
  .dhead { flex-wrap: wrap; }
  .dgrid { grid-template-columns: repeat(2, 1fr); }
  .dhdr__inner { gap: 12px; }
  .dhdr__logo img { height: 32px; }
}


.static-page { padding-top: 40px; max-width: 760px; margin: 0 auto; }
.static-page h1 { font-size: 30px; margin-bottom: 18px; }
.static-page h2 { font-size: 19px; margin: 26px 0 10px; }
.static-page p { color: rgba(255,255,255,.78); line-height: 1.8; margin-bottom: 14px; font-size: 14px; }

/* ============================ LEGAL / PRIVACY PAGES ============================
   Matched to https://www.h5gamespro.com/privacy — navy header, white article,
   centered title, gray body copy, cyan footer. */

html:has(.legal-page),
body:has(.legal-page) {
  background: #fff;
  color: #000;
}
.app:has(.legal-page) .footer {
  background: #56c2ff;
  padding: 20px 0 28px;
}
.app:has(.legal-page) .footer ul {
  justify-content: center;
  gap: 48px;
}
.app:has(.legal-page) .footer a {
  color: #6e6e6e;
  font-size: 20px;
  font-weight: 400;
}
.app:has(.legal-page) .footer a:hover { color: #333; }
.app:has(.legal-page) .footer__games,
.app:has(.legal-page) .footer__handle { display: none; }

.legal-page {
  min-height: calc(100vh - 88px);
  background: #fff;
  color: #000;
}
.legal-page__content {
  max-width: 1262px;
  margin: 0 auto;
  padding: 40px 60px 60px;
}
.legal-page__content h1 {
  font-size: 28px;
  font-weight: 700;
  color: #000;
  text-align: center;
  margin: 0 0 20px;
}
.legal-page__content h2 {
  font-size: 20px;
  font-weight: 700;
  color: #000;
  margin: 25px 0 10px;
}
.legal-page__content p {
  font-size: 15px;
  font-weight: 400;
  line-height: 24px;
  color: #666;
  margin: 10px 0;
}
.legal-page__content a {
  color: #2ec2ca;
  text-decoration: none;
  word-break: break-word;
}
.legal-page__content a:hover { text-decoration: underline; }

@media (max-width: 1024px) {
  .legal-page__content { padding: 28px 20px 40px; }
  .app:has(.legal-page) .footer {
    padding: 32px 16px;
  }
  .app:has(.legal-page) .footer .inner { padding: 0; }
  .app:has(.legal-page) .footer ul {
    width: 100%;
    justify-content: space-evenly;
    gap: 8px;
  }
  .app:has(.legal-page) .footer a {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
  }
  .app:has(.legal-page) .footer a:hover { color: #fff; opacity: .9; }
}
@media (max-width: 720px) {
  .legal-page__content { padding: 22px 16px 32px; }
  .legal-page__content h1 { font-size: 22px; }
  .legal-page__content h2 { font-size: 18px; }
  .legal-page__content p { font-size: 14px; line-height: 22px; }
  .app:has(.legal-page) .footer { padding: 28px 10px; }
  .app:has(.legal-page) .footer a { font-size: 14px; }
}

/* ============================ RESPONSIVE ============================
   Desktop  ≥1025 — Joy-Con hero + multi-column grids
   Tablet   721–1024 — MobileHero (Game Boy) + tablet section grids
   Mobile   ≤720   — MobileHero + stacked / scroll layouts
==================================================================== */

/* Large tablet / small laptop */
@media (max-width: 1199px) {
  .inner { padding: 0 36px; }
  .control { width: 160px; }
  .console__inner { min-height: 600px; }
  .joystick { width: 130px; height: 130px; }
  .dpad, .face { width: 120px; height: 120px; }
  .dpad__btn, .face__btn { width: 46px; height: 46px; }
  .minus-icon, .add-icon { width: 40px; height: 40px; margin-bottom: 4rem; }
  .minus-icon::before { height: 11px; }
  .add-icon::before { height: 11px; }
  .add-icon::after { width: 11px; }
  .screen-container { padding: 40px 28px 0; }
  .screen-content { border-radius: 40px; }
  .screen__stage { padding: 14px 14% 10px; }
  .hero-item--prev-0,
  .hero-item--next-0 { width: 20%; }
  .hero-item--prev-1,
  .hero-item--next-1 { width: 17%; }
}

/* Trending — featured banner + 2×2 grid (mobile + tablet, below Joy-Con desktop) */
@media (max-width: 1024px) {
  .section--trending .section__head {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,.35);
  }
  .row-trending {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
  .row-trending .bcard,
  .row-trending .bcard--feat {
    flex: unset;
    min-width: 0;
  }
  .row-trending .bcard--feat {
    grid-column: 1 / -1;
  }
  .row-trending .bcard:nth-child(n+5) { display: flex; }
  .row-trending .bcard--feat .bcard__cover { aspect-ratio: 16 / 9; }
  .row-trending .bcard--feat .bcard__info { padding: 10px 12px 12px; gap: 4px; }
  .row-trending .bcard--feat .bcard__title { font-size: 16px; }
  .row-trending .bcard--feat .bcard__dev { display: none; }
  .row-trending .bcard--feat .bcard__row { padding-top: 2px; }
  .row-trending .bcard:not(.bcard--feat) .bcard__cover { aspect-ratio: 1; }
  .row-trending .bcard:not(.bcard--feat) .bcard__info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 8px;
    padding: 8px 8px 10px;
  }
  .row-trending .bcard:not(.bcard--feat) .bcard__title {
    grid-column: 1;
    grid-row: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .row-trending .bcard:not(.bcard--feat) .bcard__dev { display: none; }
  .row-trending .bcard:not(.bcard--feat) .bcard__row {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    padding: 0;
  }
  .row-trending .bcard:not(.bcard--feat) .stars { display: none; }
  .row-trending .play-btn { padding: 5px 10px; font-size: 11px; border-radius: 6px; }
  .row-trending .bcard--feat .play-btn { padding: 6px 14px; font-size: 12px; }
  .row-trending .stars svg { width: 11px; height: 11px; }
  .row-trending .mark {
    font-family: var(--font-colombo);
    top: 8px; min-width: 42px; height: 33px; font-size: 32px; font-weight: 800;
    padding: 0 8px 2px 8px; border-radius: 8px 28px 28px 0;
  }
  .row-trending .bcard--feat .mark {
    top: 10px; min-width: 46px; height: 34px; font-size: 28px;
  }
  .row-trending .mark img { width: 18px; }
  .row-trending .bcard--feat .mark img { width: 22px; }

  /* Home footer — 3 white links on a solid blue bar */
  .app:has(.home) .footer {
    background: #4eb8ef;
    padding: 32px 16px;
  }
  .app:has(.home) .footer .inner {
    padding: 0;
    max-width: none;
  }
  .app:has(.home) .footer ul {
    width: 100%;
    justify-content: space-evenly;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .app:has(.home) .footer a {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
  }
  .app:has(.home) .footer a:hover { color: #fff; opacity: .9; }
  .app:has(.home) .footer__games,
  .app:has(.home) .footer__handle { display: none; }
}

/* Tablet (iPad portrait / landscape-narrow) — keep multi-column like h5gamespro */
@media (max-width: 1024px) and (min-width: 721px) {
  .inner { padding: 0 28px; }
  .section__title { font-size: 24px; }

  /* Scaled Switch console — ~90–120px joy-cons like h5gamespro tablet */
  .control { width: 100px; }
  .console__inner { min-height: 480px; }
  .joystick { width: 84px; height: 84px; margin: 6px 0; }
  .dpad, .face { width: 88px; height: 88px; margin-top: 4px; }
  .dpad__btn, .face__btn { width: 34px; height: 34px; }
  .minus-icon, .add-icon {
    width: 32px; height: 32px; margin-bottom: 2.8rem;
  }
  .minus-icon::before,
  .add-icon::before { height: 9px; }
  .add-icon::after { width: 9px; }
  .audio { height: 44px; gap: 7px; margin-top: 10px; }
  .audio span { width: 8px; }
  .audio span:nth-child(1),
  .audio span:nth-child(3) { height: 22px; }
  .audio span:nth-child(2) { height: 32px; }
  .screen-container { padding: 28px 18px 0; }
  .screen-content { border-radius: 32px; }
  .screen__logo { height: 26px; top: 10px; }
  .screen__stage { padding: 10px 10% 8px; }
  .screen__title { font-size: 13px; margin: 0 0 10px; }
  .screen__start { font-size: 18px; }
  .hero-nav { width: 26px; }
  .hero-item--prev-0,
  .hero-item--next-0 { top: 8%; width: 18%; }
  .hero-item--prev-1,
  .hero-item--next-1 { top: 55%; width: 15%; }
  .hero-info { margin-top: 12px; }

  .row-icon { gap: 12px; }
  .row-icon--category { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .row-popular { grid-template-columns: 1fr 1fr; gap: 16px 24px; }
  .pcard__cover { width: 84px; height: 84px; }
  .pcard__title { font-size: 15px; }

  .row-new { grid-template-columns: 1fr 1fr; gap: 16px; }
  .row-new .bcard:nth-child(n+3) { display: none; }
  .row-new .bcard__title { font-size: 15px; }

  .row-original-feat { grid-template-columns: 1fr; gap: 16px; }
  .row-original-feat .ofeat:nth-child(n+2) { display: none; }
  .row-original { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .orow__title { font-size: 17px; }
  .ofeat__title { font-size: 22px; }
}

/* Mobile — same breakpoint as MobileHero (720) */
@media (max-width: 720px) {
  .inner { padding: 0 16px; }
  .section { padding: 22px 0 0; }
  .section__head { margin-bottom: 14px; }
  .section__title { font-size: 18px; }
  .section__more { padding: 7px 14px; font-size: 12px; }
  .section--band { padding: 24px 0 28px; margin-top: 22px; }

  .app:has(.home) .footer { padding: 28px 10px; }
  .app:has(.home) .footer a { font-size: 14px; }

  /* Trending — tighter spacing on narrow phones */
  .row-trending { gap: 10px; }
  .row-trending .bcard--feat .bcard__title { font-size: 15px; }
  .row-trending .bcard:not(.bcard--feat) .bcard__title { font-size: 12px; }
  .row-trending .play-btn { font-size: 10px; }
  .row-trending .bcard--feat .play-btn { font-size: 11px; }
  .row-trending .bcard--feat .mark { font-size: 24px; }

  /* Popular / New icon rows — 3-up grid on narrow screens */
  .row-icon:not(.row-icon--category) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .row-icon:not(.row-icon--category) > :nth-child(n+6) { display: block; }

  /* Category grids (Arcade / Puzzle / Simulation) — match h5gamespro mobile */
  .section--icon .section__head .section__more { display: none; }
  .section--icon .section__head {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,.35);
  }
  .section--icon .section__foot {
    display: flex;
    justify-content: center;
    margin-top: 18px;
  }
  .section--icon .section__more--foot {
    border-radius: 999px;
    padding: 9px 28px;
  }
  .section--icon .row-icon--category {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .section--icon .icard { border-radius: 14px; }

  .row-popular { grid-template-columns: 1fr; gap: 14px; }
  .pcard { gap: 12px; }
  .pcard__cover { width: 72px; height: 72px; border-radius: 12px; }
  .pcard__title { font-size: 14px; }
  .pcard__dev { font-size: 11px; }

  /* New — 2 stacked banners (h5gamespro new-list-count: 2) */
  .row-new { grid-template-columns: 1fr; gap: 12px; margin-bottom: 18px; }
  .row-new .bcard:nth-child(n+3) { display: none; }
  .row-new .bcard__title { font-size: 15px; }
  .row-new .mark { top: 10px; min-width: 48px; height: 34px; font-size: 22px; }

  /* Originals — stacked rows that shrink instead of overflowing */
  .row-original-feat,
  .row-original { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .orow { gap: 10px; margin-top: 0; }
  .orow__cover { border-radius: 10px; }
  .orow__title { font-size: 14px; }
  .orow__dev { font-size: 11px; margin-block: 1px 6px; }
  .orow .play-btn { padding: 5px 10px; font-size: 11px; }
  .ofeat__title { font-size: 18px; }
  .ofeat__dev { font-size: 12px; }
  .ofeat__meta { left: 14px; bottom: 12px; right: 14px; }

  /* Hide desktop console chrome leftovers */
  :root { --rail: 44px; }
  .control { padding: 8px 0 18px; }
  .joystick { width: 36px; height: 36px; margin: 6px 0; }
  .dpad, .face { transform: scale(.5); margin: 0; height: 60px; width: 90px; }
  .audio { display: none; }
  .hero-item--prev-0,
  .hero-item--prev-1,
  .hero-item--next-0,
  .hero-item--next-1,
  .hero-item--hidden,
  .hero-nav { display: none; }
  .screen__stage { padding: 40px 12px 20px; }
  .console { padding: 0; }
  .console__inner { min-height: 260px; }
  .screen__logo { height: 22px; }
  .screen__title { font-size: 11px; margin: 12px 0 10px; }
  .screen__start { font-size: 15px; }
}

@media (max-width: 420px) {
  .inner { padding: 0 12px; }
  .row-icon:not(.row-icon--category) { gap: 8px; }
  .section--icon .row-icon--category { gap: 8px; }
  .section--icon .icard { border-radius: 12px; }
  .section--icon .section__more--foot { padding: 8px 24px; font-size: 11px; }
  .orow { gap: 8px; }
  .orow__title { font-size: 13px; }
  .orow__dev { display: none; }
  .orow .stars svg { width: 11px; height: 11px; }
  .orow .play-btn { padding: 4px 8px; font-size: 10px; }
  .screen__title { font-size: 10px; }
  .screen__start { font-size: 13px; }
}

/* ============================ PLAY PAGE (HTML5 player) ============================
   Matched to https://www.h5gamespro.com/games/g/paper_wars — cyan header, 755+300
   two-column layout, 16:9 player with colored-dot loader, white info bar,
   recommended thumbs, instruction table, 2-col sidebar. */

html:has(.play-page),
body:has(.play-page) {
  background: #f2f5f9;
  color: #252525;
}
.app:has(.play-page) .footer {
  background: #56c2ff;
  padding: 20px 0 28px;
}
.app:has(.play-page) .footer a { color: #fff; }
.app:has(.play-page) .footer a:hover { color: #eef8ff; }
.app:has(.play-page) .backtop-wrap { display: none; }

.play-page {
  min-height: 100vh;
  background: #f2f5f9;
  color: #252525;
  overflow-x: clip;
}

.phdr {
  background: #56c2ff;
  height: 45px;
}
.phdr__inner {
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.phdr__logo img { height: 36px; display: block; }
.phdr__menu {
  display: flex;
  align-items: center;
  gap: 20px;
}
.phdr__menu a {
  color: #fff;
  font-size: 16px;
  font-weight: 400;
}
.phdr__menu a:hover { opacity: .85; }
.phdr__burger {
  display: none;
  color: #fff;
  width: 36px;
  height: 36px;
  place-items: center;
  flex-shrink: 0;
}
.phdr__burger svg { width: 22px; height: 20px; display: block; }

.play-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 15px 16px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 25px;
  align-items: start;
}
.play-main,
.play-stage {
  min-width: 0;
  max-width: 100%;
}

.play-iframe {
  background: linear-gradient(135deg, #ff8a80 0%, #82b1ff 40%, #69f0ae 70%, #ffd180 100%);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}
.play-area {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.play-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.play-area--live {
  background: #000;
}
.play-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  border: 0;
  background: #000;
  display: block;
}
.play-iframe:fullscreen .play-frame,
.play-iframe:-webkit-full-screen .play-frame {
  width: 100%;
  height: 100%;
}
.play-exitfs {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 18px;
}
.play-iframe:fullscreen,
.play-iframe:-webkit-full-screen {
  width: 100%;
  height: 100%;
  background: #000;
}
.play-iframe:fullscreen .play-area,
.play-iframe:-webkit-full-screen .play-area {
  aspect-ratio: auto;
  height: 100%;
}
.play-iframe:fullscreen .play-descbar,
.play-iframe:-webkit-full-screen .play-descbar { display: none; }

.play-loader {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 250px;
  height: 20px;
  transform: translate(-50%, -50%);
}
.play-loader__dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  animation: play-loader 3s ease-in-out infinite;
}
.play-loader__dot:nth-child(1) { background: #8cc759; animation-delay: .5s; }
.play-loader__dot:nth-child(2) { background: #8c6daf; animation-delay: .4s; }
.play-loader__dot:nth-child(3) { background: #ef5d74; animation-delay: .3s; }
.play-loader__dot:nth-child(4) { background: #f9a74b; animation-delay: .2s; }
.play-loader__dot:nth-child(5) { background: #60beeb; animation-delay: .1s; }
.play-loader__dot:nth-child(6) { background: #fbef5a; animation-delay: 0s; }
.play-loader__text {
  position: absolute;
  left: 50%;
  top: 28px;
  transform: translateX(-50%);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
  white-space: nowrap;
}
@keyframes play-loader {
  15% { transform: translateX(0); }
  45% { transform: translateX(230px); }
  65% { transform: translateX(230px); }
  95% { transform: translateX(0); }
}

.play-descbar {
  background: #fff;
  padding: 8px 30px;
}
.play-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.play-title { flex: 1; min-width: 0; }
.play-title h3 {
  font-size: 18px;
  font-weight: 700;
  color: #252525;
  line-height: 1.3;
  margin: 0;
}
.play-title p {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  color: #252525;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.play-title--open p {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.play-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 5px;
  flex-shrink: 0;
}
.play-howto, .play-fs {
  display: grid;
  place-items: center;
  background: transparent;
  padding: 0;
}
.play-howto svg { width: 29px; height: 31px; display: block; }
.play-fs svg { width: 35px; height: 35px; display: block; }
.play-back { display: none; }

.play-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 15px;
  padding: 12px 0 4px;
}
.play-thumb {
  display: block;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #e8edf4;
}
.play-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.play-thumb:hover { transform: translateY(-2px); }
.play-thumb { transition: transform .12s ease; }

.play-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 15px;
  padding: 10px 0 4px;
}

.play-inst { padding: 10px 0; }
.play-inst ul {
  border: 1px solid #666;
}
.play-inst li {
  display: grid;
  grid-template-columns: 40% 60%;
  align-items: start;
  padding: 0 10px;
  border-bottom: 1px solid #666;
}
.play-inst li:last-child { border-bottom: none; }
.play-inst__k {
  font-size: 14px;
  font-weight: 500;
  color: #000;
  padding: 10px 0;
  margin: 0;
}
.play-inst__v {
  font-size: 14px;
  font-weight: 400;
  color: #666;
  padding: 10px;
  margin: 0;
  overflow: hidden;
}
.play-inst__v--chips {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.play-inst__v--chips p { margin: 0; }

.play-side ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
}
.play-side img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  background: #e8edf4;
}
.play-side a:hover img { transform: scale(1.03); }
.play-side img { transition: transform .12s ease; }

.play-missing {
  max-width: 1080px;
  margin: 0 auto;
  padding: 80px 20px;
  text-align: center;
  color: #333;
}
.play-missing a { color: #0073dd; text-decoration: underline; }

/* Preview page (/games/p/) — cover + PLAY CTA before the iframe player */
.preview-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.preview-hero__cover {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.preview-hero__meta {
  flex: 1;
  min-width: 0;
}
.preview-hero__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  color: #000;
  line-height: 1.3;
}
.preview-hero__rate {
  display: flex;
  align-items: center;
  gap: 8px;
}
.preview-hero__num {
  font-size: 14px;
  font-weight: 400;
  color: #666;
}
.preview-hero__rate .stars svg {
  width: 14px;
  height: 14px;
}
.preview-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 40px;
  flex-shrink: 0;
  background: #56c2ff;
  color: #fafafa;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .04em;
  border-radius: 8px;
  text-decoration: none;
  transition: transform .12s ease, filter .12s ease;
  position: relative;
}
.preview-play:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.preview-inst {
  margin-top: 14px;
}

/* Mobile + tablet H5 chrome: every /games/p/:id and /games/g/:id page
   shares this layout and the bg-footer.svg wave (not just one game). */
@media (max-width: 1024px) {
  html:has(.preview-page),
  body:has(.preview-page) {
    background: #fff;
    color: #252525;
  }
  .preview-page {
    background: #fff;
  }
  html:has(.play-page),
  body:has(.play-page) {
    overflow-x: clip;
  }
  .preview-page .play-wrap,
  .play-page .play-wrap {
    padding: 0 0 8px;
    gap: 0;
    grid-template-columns: minmax(0, 1fr);
  }
  .preview-page .play-side,
  .play-page .play-side { display: none; }
  .play-page .play-inst { padding: 10px 16px; }
  .play-page .play-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px 10px 20px;
  }

  /* /games/g/:id on phone/tablet — game only, matching live h5gamespro fullscreen player */
  html:has(.play-page:not(.preview-page)),
  body:has(.play-page:not(.preview-page)) {
    overflow: hidden;
    background: #000;
  }
  .app:has(.play-page:not(.preview-page)) .footer { display: none; }
  .play-page:not(.preview-page) {
    min-height: 100dvh;
    overflow: hidden;
    background: #000;
  }
  .play-page:not(.preview-page) .phdr,
  .play-page:not(.preview-page) .play-inst,
  .play-page:not(.preview-page) .play-grid,
  .play-page:not(.preview-page) .play-descbar { display: none; }
  .play-page:not(.preview-page) .play-wrap {
    padding: 0;
    margin: 0;
    max-width: none;
  }
  .play-page:not(.preview-page) .play-iframe {
    position: fixed;
    inset: 0;
    z-index: 999;
    width: 100%;
    height: 100dvh;
    max-width: none;
    background: #49a9ff;
  }
  .play-page:not(.preview-page) .play-area {
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
  }
  .play-page:not(.preview-page) .play-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
  }
  .play-page:not(.preview-page) .play-back {
    display: flex;
    align-items: center;
    gap: 2px;
    position: absolute;
    top: 5px;
    left: 0;
    z-index: 4;
    height: 46px;
    padding: 0 8px 0 6px;
    background: #fff;
    border-radius: 0 15px 15px 0;
    color: #000;
  }
  .play-page:not(.preview-page) .play-back svg {
    width: 24px;
    height: 24px;
    display: block;
  }
  .play-page:not(.preview-page) .play-back img {
    height: 30px;
    width: auto;
    display: block;
  }

  .phdr__inner {
    position: relative;
    justify-content: space-between;
  }
  .phdr__burger { display: grid; }
  .phdr__menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 12px;
    z-index: 20;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-width: 160px;
    background: #56c2ff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
    padding: 6px 0 10px;
  }
  .phdr__menu.is-open { display: flex; }
  .phdr__menu a {
    display: block;
    padding: 10px 16px;
    font-size: 15px;
  }

  .preview-hero {
    flex-wrap: wrap;
    padding: 27px 22px 12px;
    gap: 12px;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
  }
  .preview-hero__cover {
    width: 94px;
    height: 94px;
    border-radius: 8px;
  }
  .preview-hero__title {
    font-size: 22px;
    font-weight: 500;
    color: #0a0a0a;
  }
  .preview-play {
    width: 100%;
    height: 30px;
    font-size: 18px;
    font-weight: 500;
    border-radius: 8px;
    box-shadow: 0 4px 4px rgba(0, 0, 0, .15);
    transform: none;
  }
  .preview-play:hover { transform: none; }

  .preview-page .play-inst {
    margin-top: 0;
    padding: 0 22px 8px;
  }
  .preview-page .play-inst ul { border: 0; }
  .preview-page .play-inst li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    border: 0;
    padding: 4px 0;
    grid-template-columns: none;
  }
  .preview-page .play-inst__k {
    color: #50478e;
    font-size: 16px;
    font-weight: 700;
    padding: 0;
  }
  .preview-page .play-inst__k::after { content: ':'; }
  .preview-page .play-inst__v {
    color: #50478e;
    font-size: 14px;
    font-weight: 400;
    padding: 0;
  }
  .preview-page .play-inst__v--chips { gap: 12px; }

  .preview-page .play-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px 10px 20px;
  }
  .preview-page .play-thumb { border-radius: 6px; }

  .app:has(.play-page) .footer {
    width: 100%;
    min-height: 180px;
    margin: 0;
    padding: 210px 24px 16px;
    background-color: #fff;
    background-image: url('/assets/bg-footer.svg');
    background-repeat: no-repeat;
    background-position: 50% 0;
    background-size: cover;
  }
  .app:has(.play-page) .footer .inner {
    max-width: none;
    width: 100%;
    padding: 0;
  }
  .app:has(.play-page) .footer__row {
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
  }
  .app:has(.play-page) .footer ul {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
  }
  .app:has(.play-page) .footer a {
    color: #6930c3;
    font-size: 12px;
    line-height: 17px;
  }
  .app:has(.play-page) .footer a:hover { color: #4a1f96; }
  .app:has(.play-page) .footer__handle {
    display: block;
    width: 120px;
    height: 80px;
  }
}

@media (max-width: 960px) {
  .play-wrap { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .play-side { max-width: 100%; }
  .play-row { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .play-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
}
@media (max-width: 720px) {
  .phdr__inner { padding: 0 12px; }
  .phdr__logo img { height: 28px; }
  .phdr__menu { gap: 12px; }
  .phdr__menu a { font-size: 14px; }
  .play-descbar { padding: 8px 14px; }
  .play-title h3 { font-size: 16px; }
  .play-title p { font-size: 13px; line-height: 20px; }
  .play-row { grid-template-columns: repeat(3, 1fr); }
  .play-grid { grid-template-columns: repeat(3, 1fr); }
  .play-inst li { grid-template-columns: 1fr; padding: 4px 10px 8px; }
  .play-inst__k { padding-bottom: 0; }
  .play-inst__v { padding: 4px 0 8px; }
  .play-howto svg { width: 24px; height: 26px; }
  .play-fs svg { width: 30px; height: 30px; }
}

/* ============================ SEARCH PAGE ============================
   Matched to https://www.h5gamespro.com/search?se=meo — navy logo header,
   teal #00c9a9 banner, overlapping white pill search, light #f2f5f9
   page, square result tiles with hover title overlay. */

html:has(.search-page),
body:has(.search-page) {
  background: #f2f5f9;
  color: #252525;
}
.app:has(.search-page) .footer {
  background: #f2f5f9;
}
.app:has(.search-page) .footer a { color: #6e6e6e; }
.app:has(.search-page) .footer a:hover { color: #0073dd; }

.search-page {
  min-height: 100vh;
  background: #f2f5f9;
  padding-bottom: 40px;
  overflow-x: hidden;
}

.search-page .dhdr__inner { justify-content: flex-start; }

.se-hero {
  height: 120px;
  background: #00c9a9;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.se-hero h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .25);
}
.se-hero__field {
  position: absolute;
  left: 50%;
  bottom: -24px;
  transform: translateX(-50%);
  width: min(700px, calc(100% - 40px));
  height: 56px;
  z-index: 2;
}
.se-hero__field input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  padding: 10px 20px;
  background: #fff;
  border-radius: 28px;
  font: 13px Arial, 'Poppins', sans-serif;
  color: #000;
  box-shadow: 0 8px 15px rgba(75, 72, 72, .1);
  transition: box-shadow .4s ease;
}
.se-hero__field input::placeholder { color: #bdbdbd; }
.se-hero__field input:focus {
  box-shadow: 0 9px 20px rgba(75, 72, 72, .3);
}

.se-results {
  max-width: 1360px;
  margin: 40px auto 0;
  padding: 0 30px;
}
.se-results h2 {
  margin: 0 0 20px;
  min-height: 28px;
  font-size: 20px;
  font-weight: 500;
  color: #000;
  text-indent: 40px;
}

.se-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 18px 10px;
  padding: 4px 2px 24px;
}
.se-grid li { min-width: 0; }

.se-card {
  display: block;
  position: relative;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  background: #e8e8e8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
  transform-origin: center center;
  transition: transform .5s cubic-bezier(.175, .585, .12, 1.575);
}
.se-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.se-card__title {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 65px;
  margin: 0;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  background: linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, .5));
  visibility: hidden;
  z-index: 2;
}
.se-card:hover,
.se-card:focus-visible {
  transform: scale(1.1);
  z-index: 5;
}
.se-card:hover .se-card__title,
.se-card:focus-visible .se-card__title { visibility: visible; }

@media (hover: none) {
  .se-card__title { visibility: visible; }
}

@media (max-width: 1199px) {
  .se-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 899px) {
  .se-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 719px) {
  .se-hero { height: 100px; }
  .se-hero h1 { font-size: 22px; }
  .se-hero__field { height: 48px; bottom: -20px; }
  .se-results { padding: 0 15px; margin-top: 36px; }
  .se-results h2 { font-size: 18px; text-indent: 16px; }
  .se-grid { grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
  .se-card__title { height: 48px; font-size: 12px; }
}
@media (max-width: 420px) {
  .se-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================ /game CATALOG ============================
   Matched to https://www.sveedy.com/mobilegames/ — light #f2f5f9 page,
   4–10 square columns, first game 2×2 at row 2 / col 2, ad on row 5. */

html:has(.game-page),
body:has(.game-page) {
  background: #f2f5f9;
  color: #252525;
}
.app:has(.game-page) .footer {
  background: #f2f5f9;
}
.app:has(.game-page) .footer a { color: #6e6e6e; }
.app:has(.game-page) .footer a:hover { color: #0073dd; }

.game-page {
  --game-cols: 3;
  --game-gap: 10px;
  min-height: 100vh;
  background: #f2f5f9;
  padding-bottom: 40px;
  overflow-x: hidden;
}
@media (min-width: 720px)  { .game-page { --game-cols: 5; --game-gap: 15px; } }
@media (min-width: 900px)  { .game-page { --game-cols: 6; } }
@media (min-width: 1200px) { .game-page { --game-cols: 8; } }
@media (min-width: 1366px) { .game-page { --game-cols: 9; } }
@media (min-width: 1440px) { .game-page { --game-cols: 10; } }

.game-wrap {
  width: calc(100% - 30px);
  margin-inline: auto;
  padding: 0;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(var(--game-cols), minmax(0, 1fr));
  gap: var(--game-gap);
  list-style: none;
  margin: 0;
  padding: 15px 0 20px;
}
.game-grid > li { min-inline-size: 0; }

/* First game sits at column 2, row 2 and spans 2×2 (Sveedy placement). */
.game-grid__feat {
  grid-column: 2 / span 2;
  grid-row: 2 / span 2;
}

/* Full-width banner after the first 4 game rows. */
.game-grid__ad {
  grid-column: 1 / span var(--game-cols);
  grid-row: 5 / span 1;
  align-self: center;
}
.game-grid__ad .dads--banner {
  margin-block: 0;
}

.game-grid__more {
  block-size: 1px;
}

.gcard {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
  text-decoration: none;
  transform-origin: center center;
  transition: transform .5s cubic-bezier(.175, .585, .12, 1.575);
}
.gcard:hover,
.gcard:focus-visible {
  transform: scale(1.1);
  z-index: 999;
}

.gcard__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  background: #e8e8e8;
}
.game-grid__feat .gcard__media {
  height: 100%;
  aspect-ratio: auto;
}
.gcard__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gcard__title {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 65px;
  margin: 0;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  background: linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, .5));
  visibility: hidden;
  z-index: 2;
  border-radius: 0 0 4px 4px;
}
.gcard:hover .gcard__title,
.gcard:focus-visible .gcard__title { visibility: visible; }

.gcard__meta {
  position: absolute;
  inset: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

@media (max-width: 719px) {
  .game-grid__feat {
    grid-column: auto;
    grid-row: auto;
  }
  .game-grid__feat .gcard__media {
    height: auto;
    aspect-ratio: 1;
  }
  .gcard__title,
  .gcard:hover .gcard__title,
  .gcard:focus-visible .gcard__title {
    display: none;
  }
}

@media (max-width: 520px) {
  .gcard__title { height: 48px; font-size: 12px; }
}
