/* ==========================================================================
   PIXEL KINGDOM — layout.css
   Header, hero, section rhythm, footer, and page scaffolding.
   ========================================================================== */

/* ==========================================================================
   HEADER
   ========================================================================== */
.pk-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(23, 27, 43, 0.94);
  border-bottom: 3px solid var(--pk-line-soft);
  backdrop-filter: blur(8px);
}

.pk-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: var(--pk-header-h);
}

/* —— Brand —— */
.pk-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  color: var(--pk-text);
}
.pk-brand:hover { color: var(--pk-text); }

.pk-brand__mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  filter: drop-shadow(3px 3px 0 rgba(9, 11, 21, 0.6));
}
.pk-brand__mark img { width: 100%; height: 100%; }

.pk-brand__text { display: flex; flex-direction: column; gap: 2px; }

.pk-brand__name {
  font-family: var(--pk-font-micro);
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--pk-text);
  text-transform: uppercase;
  white-space: nowrap;
}

.pk-brand__tag {
  font-family: var(--pk-font-micro);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.16em;
  color: var(--pk-green);
  text-transform: uppercase;
  white-space: nowrap;
}

/* —— Desktop nav —— */
.pk-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.pk-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  font-family: var(--pk-font-pixel);
  font-size: 15px;
  font-weight: 600;
  color: var(--pk-text-dim);
  white-space: nowrap;
  transition: color var(--pk-t), background var(--pk-t);
}
.pk-nav__link:hover,
.pk-nav__link:focus-visible { color: var(--pk-text); background: var(--pk-bg-2); }
.pk-nav__link.is-active { color: var(--pk-green); }

.pk-nav__link.is-active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 3px;
  background: var(--pk-green);
}

/* —— Header search —— */
.pk-search {
  position: relative;
  flex-shrink: 0;
  width: 240px;
}

.pk-search__field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--pk-bg-2);
  border: 3px solid var(--pk-line-soft);
  padding: 0 10px;
  height: 42px;
  transition: border-color var(--pk-t);
}
.pk-search__field:focus-within { border-color: var(--pk-green); }

.pk-search__field svg { width: 17px; height: 17px; color: var(--pk-text-mute); flex-shrink: 0; }

.pk-search__field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-family: var(--pk-font-body);
  font-size: 14px;
  color: var(--pk-text);
  padding: 0;
}
.pk-search__field input::placeholder { color: var(--pk-text-mute); }

.pk-search__hint {
  display: none;
  font-family: var(--pk-font-micro);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--pk-text-mute);
  border: 2px solid var(--pk-line-soft);
  padding: 2px 5px;
  flex-shrink: 0;
}

/* —— Header actions —— */
.pk-header__actions { display: none; gap: 8px; flex-shrink: 0; }

.pk-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 3px solid var(--pk-line-soft);
  background: var(--pk-bg-2);
  color: var(--pk-text);
  cursor: pointer;
  transition: background var(--pk-t), border-color var(--pk-t), transform var(--pk-t-fast);
}
.pk-icon-btn:hover { background: var(--pk-card); border-color: var(--pk-line); }
.pk-icon-btn:active { transform: translate(1px, 1px); }
.pk-icon-btn svg { width: 19px; height: 19px; }

/* ==========================================================================
   HERO  (desktop two-column editorial + illustration)
   ========================================================================== */
.pk-hero {
  position: relative;
  /* Height is driven by the viewport so the first ad's top edge lands at 42% of
     the screen: hero = 42vh - header - adMargin - residueSlack. Content inside
     is compact enough to fit at every supported size, so nothing is clipped. */
  min-height: calc(42vh - var(--pk-header-h) - 16px);
  padding: 10px 0 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
}

.pk-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 32px;
  align-items: center;
  min-height: 0;
  flex: 1 1 auto;
}

.pk-hero__copy {
  position: relative;
  z-index: 2;
  min-height: 0;
  min-width: 0;
}

.pk-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  margin-bottom: 8px;
  background: rgba(139, 212, 80, 0.12);
  border: 3px solid var(--pk-green);
  font-family: var(--pk-font-micro);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pk-green);
}
.pk-hero__badge img { width: 14px; height: 14px; }

.pk-hero__title {
  font-family: var(--pk-font-pixel);
  font-size: clamp(28px, 3.4vw, 46px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0 0 8px;
  color: var(--pk-text);
  text-shadow:
    3px 3px 0 var(--pk-ink),
    6px 6px 0 rgba(93, 173, 226, 0.28);
}

.pk-hero__title .pk-hero__title-accent {
  display: block;
  color: var(--pk-green);
  text-shadow:
    3px 3px 0 var(--pk-ink),
    6px 6px 0 rgba(139, 212, 80, 0.22);
}

.pk-hero__sub {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--pk-text-dim);
  max-width: 44ch;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pk-hero__cta-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.pk-hero__cta-row .pk-btn--lg { padding: 11px 18px; font-size: 15px; }
.pk-hero__cta-row .pk-btn { white-space: nowrap; }

/* —— Hero stats strip —— */
.pk-hero__stats {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  border-top: 2px solid var(--pk-line-soft);
  padding-top: 7px;
  max-width: 440px;
}

.pk-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-right: 22px;
  margin-right: 22px;
  border-right: 3px solid var(--pk-line-soft);
  white-space: nowrap;
}
.pk-stat:last-child { border-right: 0; margin-right: 0; padding-right: 0; }

.pk-stat__value {
  font-family: var(--pk-font-micro);
  font-size: 16px;
  line-height: 1;
  color: var(--pk-text);
  margin: 0;
}
.pk-stat__label {
  font-family: var(--pk-font-body);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--pk-text-mute);
  text-transform: uppercase;
  margin: 0;
}

/* —— Hero art — framed pixel landscape —— */
.pk-hero__art {
  position: relative;
  border: 3px solid var(--pk-line);
  background: var(--pk-bg-2);
  box-shadow: var(--pk-shadow-sm);
  aspect-ratio: 160 / 84;
  /* Bounded by viewport, not by the (circular) grid row height. */
  max-height: calc(var(--pk-firstfold) * 0.6);
  width: 100%;
  overflow: hidden;
}

.pk-hero__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* scanline sheen over the hero art */
.pk-hero__art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(15, 18, 32, 0.16) 0 1px,
    transparent 1px 3px
  );
  pointer-events: none;
  mix-blend-mode: multiply;
}

.pk-hero__art-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  font-family: var(--pk-font-micro);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--pk-ink);
  color: var(--pk-yellow);
  border: 3px solid var(--pk-line);
}
.pk-hero__art-badge--tl { top: 12px; left: 12px; }
.pk-hero__art-badge--br { bottom: 12px; right: 12px; border-color: var(--pk-green); color: var(--pk-green); }

.pk-hero__art-badge i {
  width: 6px; height: 6px;
  background: currentColor;
  display: block;
  animation: pk-blink 1.6s steps(2, end) infinite;
}

@keyframes pk-blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0.25; }
}

/* —— Hero ticker (marquee of worlds) —— */
.pk-ticker {
  margin-top: 0;
  border-top: 2px solid var(--pk-line-soft);
  border-bottom: 2px solid var(--pk-line-soft);
  background: var(--pk-bg-2);
  overflow: hidden;
  flex-shrink: 0;
}
.pk-ticker__track {
  display: flex;
  align-items: center;
  gap: 0;
  width: max-content;
  animation: pk-marquee 42s linear infinite;
}
.pk-ticker:hover .pk-ticker__track { animation-play-state: paused; }

.pk-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  font-family: var(--pk-font-micro);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pk-text-mute);
  white-space: nowrap;
}
.pk-ticker__item::after {
  content: '';
  width: 6px; height: 6px;
  background: var(--pk-green);
  margin-left: 10px;
}
.pk-ticker__item:last-child::after { display: none; }

@keyframes pk-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ==========================================================================
   SECTION RHYTHM
   ========================================================================== */
.pk-main { padding-bottom: 8px; }

.pk-section { padding: 56px 0 0; }

.pk-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.pk-section__heading { min-width: 0; }

.pk-section__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--pk-font-pixel);
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  color: var(--pk-text);
  margin: 0;
}

.pk-section__title::before {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--pk-green);
  flex-shrink: 0;
  box-shadow: 3px 3px 0 rgba(9, 11, 21, 0.5);
}

.pk-section--blue .pk-section__title::before { background: var(--pk-blue); }
.pk-section--orange .pk-section__title::before { background: var(--pk-orange); }
.pk-section--red .pk-section__title::before { background: var(--pk-red); }

.pk-section__desc {
  margin: 10px 0 0 22px;
  font-size: 14px;
  color: var(--pk-text-mute);
  max-width: 62ch;
}

.pk-section__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 9px 14px;
  border: 3px solid var(--pk-line);
  font-family: var(--pk-font-pixel);
  font-size: 14px;
  font-weight: 600;
  color: var(--pk-text-dim);
  transition: background var(--pk-t), color var(--pk-t), border-color var(--pk-t), transform var(--pk-t-fast);
}
.pk-section__more:hover {
  background: var(--pk-green);
  border-color: var(--pk-green);
  color: var(--pk-ink);
  transform: translate(-2px, -2px);
}
.pk-section__more svg { width: 13px; height: 13px; }

/* ==========================================================================
   AD SLOTS — visually distinct from game tiles
   ========================================================================== */
/* Ad slots are full-bleed: they span the viewport width and centre their unit,
   independent of the shell that wraps the surrounding sections. The dashed frame
   is drawn with borders so the container itself can be 100% wide. */
.pk-ad {
  width: 100%;
  margin: 16px 0 28px;
  padding: 14px var(--pk-gutter);
  border-top: 3px dashed var(--pk-line-soft);
  border-bottom: 3px dashed var(--pk-line-soft);
  background: rgba(37, 44, 67, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 96px;
  box-sizing: border-box;
}

/* When a slot has to escape a centred shell, pull it to the gutters. */
.pk-ad--bleed {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.pk-ad__label {
  font-family: var(--pk-font-micro);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--pk-text-mute);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pk-ad__label::before,
.pk-ad__label::after {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--pk-line-soft);
}

.pk-ad__unit {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  line-height: 0;
  min-height: 0;
  overflow: hidden;
}

.pk-ad__unit > [id^="div-gpt-ad"],
.pk-ad__unit > ins.adsbygoogle {
  display: inline-block !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin-inline: auto !important;
  line-height: normal;
  vertical-align: top;
}

.pk-ad__unit iframe[id^="google_ads_iframe"] {
  display: block;
  max-width: 100%;
  margin-inline: auto;
  vertical-align: top;
}

.pk-ad__unit > div[id$="__container__"] {
  max-width: 100% !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  margin-inline: auto !important;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.pk-footer {
  margin-top: 72px;
  border-top: 3px solid var(--pk-line-soft);
  background: var(--pk-bg-2);
  position: relative;
}

/* pixel battlements along the footer top edge */
.pk-footer::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 12px;
  background-image:
    linear-gradient(90deg, var(--pk-bg) 0 12px, transparent 12px 24px);
  background-size: 24px 12px;
  background-repeat: repeat-x;
  pointer-events: none;
}

.pk-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 40px;
  padding: 56px 0 32px;
}

.pk-footer__brand { display: flex; flex-direction: column; gap: 14px; }

.pk-footer__brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pk-footer__brand-row img { width: 36px; height: 36px; }

.pk-footer__name {
  font-family: var(--pk-font-micro);
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pk-text);
}

.pk-footer__blurb {
  font-size: 14px;
  color: var(--pk-text-mute);
  max-width: 34ch;
  margin: 0;
}

.pk-footer__pixel {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.pk-footer__pixel span {
  width: 8px; height: 8px;
  background: var(--pk-line);
}
.pk-footer__pixel span:nth-child(2) { background: var(--pk-green); }
.pk-footer__pixel span:nth-child(3) { background: var(--pk-blue); }
.pk-footer__pixel span:nth-child(4) { background: var(--pk-orange); }
.pk-footer__pixel span:nth-child(5) { background: var(--pk-red); }

.pk-footer__col h3 {
  font-family: var(--pk-font-micro);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pk-green);
  margin: 0 0 14px;
}

.pk-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.pk-footer__col a {
  font-size: 14px;
  color: var(--pk-text-dim);
  transition: color var(--pk-t);
}
.pk-footer__col a:hover { color: var(--pk-green); }

.pk-footer__bottom {
  border-top: 3px solid var(--pk-line-soft);
  padding: 18px 0 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pk-footer__copy {
  font-size: 12px;
  color: var(--pk-text-mute);
  margin: 0;
}

.pk-footer__legal {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.pk-footer__legal a {
  font-size: 12px;
  color: var(--pk-text-mute);
}
.pk-footer__legal a:hover { color: var(--pk-text); }

/* ==========================================================================
   SUBPAGE SCAFFOLD (category / detail / prose)
   ========================================================================== */
.pk-page-head {
  padding: 28px 0 6px;
}

.pk-page-head__crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--pk-font-micro);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pk-text-mute);
  margin-bottom: 10px;
}
.pk-page-head__crumb a {
  color: var(--pk-text-mute);
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-block: -8px;
}
.pk-page-head__crumb a:hover { color: var(--pk-green); }
.pk-page-head__crumb span[aria-current] { color: var(--pk-green); }

.pk-page-head h1 {
  font-family: var(--pk-font-pixel);
  font-size: clamp(28px, 3.4vw, 40px);
  text-transform: uppercase;
  margin: 0 0 8px;
}

.pk-page-head__desc {
  color: var(--pk-text-mute);
  font-size: 15px;
  max-width: 68ch;
  margin: 0;
}

/* ==========================================================================
   PROSE (legal pages)
   ========================================================================== */
.pk-prose { padding: 40px 0 20px; }
.pk-prose h2 {
  font-family: var(--pk-font-pixel);
  font-size: 24px;
  text-transform: uppercase;
  margin: 36px 0 10px;
}
.pk-prose h2:first-of-type { margin-top: 24px; }
.pk-prose h3 {
  font-family: var(--pk-font-pixel);
  font-size: 18px;
  margin: 24px 0 8px;
}
.pk-prose p, .pk-prose li {
  color: var(--pk-text-dim);
  font-size: 15px;
  overflow-wrap: anywhere;
}
.pk-prose ul { padding-left: 22px; }
.pk-prose li { margin-bottom: 6px; }
.pk-prose a {
  color: var(--pk-green);
  text-decoration: underline;
  text-underline-offset: 3px;
  /* inline links sit inside sentences; a small vertical pad lifts the touch
     height above the 24px floor without disturbing line rhythm */
  padding-block: 4px;
}
.pk-prose strong { color: var(--pk-text); }

.pk-note {
  border-left: 4px solid var(--pk-orange);
  /* Opaque tint, not alpha: the page's pixel grid texture would otherwise show
     through as vertical bands inside the block. */
  background: #2A2A38;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 14px;
  color: var(--pk-text-dim);
}
.pk-note strong { color: var(--pk-text); }
.pk-note a { color: var(--pk-green); }

/* ==========================================================================
   RESPONSIVE — layout shifts
   ========================================================================== */
@media (max-width: 1100px) {
  :root { --pk-gutter: 20px; }
  .pk-header__inner { gap: 18px; }
  .pk-search { width: 200px; }
  .pk-nav__link { padding: 9px 9px; font-size: 14px; }
  .pk-hero__grid { gap: 32px; }
  .pk-footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .pk-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .pk-nav { display: none; }
  .pk-search { display: none; }
  .pk-header__actions { display: flex; }
  .pk-header__inner { justify-content: space-between; }
  .pk-header { border-bottom-width: 2px; }

  /* Tablets keep the two-column hero: stacking it at this width made the block
     taller than the firstfold allowed. */
  .pk-hero__title { font-size: clamp(30px, 4vw, 48px); }

  .pk-section { padding-top: 44px; }
  .pk-section__head { align-items: flex-start; }
  .pk-section__desc { margin-left: 22px; }

  .pk-footer { margin-top: 52px; }
  .pk-footer__inner { padding-top: 40px; }
}

@media (max-width: 600px) {
  :root { --pk-gutter: 16px; }

  body { font-size: 15px; background-size: 32px 32px; }

  .pk-brand { min-height: 44px; }
  .pk-brand__mark { width: 34px; height: 34px; }
  .pk-brand__name { font-size: 12px; }
  .pk-brand__tag { font-size: 7px; letter-spacing: 0.12em; }

  /* Phones cannot stack the hero copy above a large landscape within the
     firstfold, so the art becomes a small square thumbnail beside the text.
     Everything stays visible; nothing is clipped. */
  .pk-hero { padding-top: 8px; gap: 8px; }
  .pk-hero__grid {
    grid-template-columns: 104px minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 12px;
    align-items: start;
  }
  .pk-hero__copy { grid-column: 2; grid-row: 1; max-height: none; }
  .pk-hero__art {
    grid-column: 1;
    grid-row: 1;
    aspect-ratio: 1 / 1;
    max-height: none;
    width: 100%;
    align-self: start;
    border-width: 2px;
    box-shadow: 3px 3px 0 rgba(9, 11, 21, 0.55);
  }
  .pk-hero__badge {
    font-size: 8px;
    padding: 3px 7px;
    margin-bottom: 5px;
    gap: 5px;
  }
  .pk-hero__badge img { width: 10px; height: 10px; }
  .pk-hero__title {
    font-size: clamp(19px, 6vw, 26px);
    margin-bottom: 6px;
    text-shadow: 2px 2px 0 var(--pk-ink);
  }
  .pk-hero__title .pk-hero__title-accent { text-shadow: 2px 2px 0 var(--pk-ink); }
  .pk-hero__sub {
    font-size: 11px;
    line-height: 1.35;
    margin-bottom: 6px;
    -webkit-line-clamp: 2;
  }
  /* Both CTAs share one row so the copy column fits the firstfold. */
  .pk-hero__cta-row { flex-wrap: nowrap; gap: 6px; margin-bottom: 8px; }
  .pk-hero__cta-row .pk-btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 5px;
    font-size: 9px;
    letter-spacing: 0;
    border-width: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pk-hero__cta-row .pk-btn--lg { padding: 8px 5px; font-size: 9px; }
  .pk-hero__cta-row .pk-btn svg { display: none; }
  .pk-hero__stats { padding-top: 6px; gap: 0; flex-wrap: nowrap; }
  .pk-stat { padding-right: 8px; margin-right: 8px; border-right-width: 2px; min-width: 0; }
  .pk-stat__value { font-size: 11px; }
  .pk-stat__label { font-size: 7px; letter-spacing: 0; }
  .pk-hero__art-badge { font-size: 8px; padding: 5px 7px; border-width: 2px; }
  .pk-hero__art-badge--tl { top: 8px; left: 8px; }
  .pk-hero__art-badge--br { bottom: 8px; right: 8px; }
  .pk-ticker__item { font-size: 9px; padding: 9px 12px; }
  .pk-ticker { margin-top: 12px; }

  /* First ad sits right below the hero on phones; a smaller top margin brings
     it inside the initial viewport without crowding the ticker. */
  .pk-ad { margin-top: 18px; }

  .pk-section { padding-top: 36px; }
  .pk-section__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
  }
  .pk-section__title { font-size: 22px; gap: 9px; }
  .pk-section__title::before { width: 8px; height: 8px; }
  .pk-section__desc { margin-left: 17px; font-size: 13px; }
  .pk-section__more { font-size: 13px; padding: 8px 11px; }

  .pk-ad { margin-top: 8px; padding: 9px; min-height: 76px; }
  .pk-ad__label { font-size: 8px; }
  .pk-ad__label::before, .pk-ad__label::after { width: 16px; }

  .pk-footer { margin-top: 40px; }
  .pk-footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 20px; padding: 34px 0 24px; }
  .pk-footer__blurb { font-size: 13px; }
  .pk-footer__col h3 { font-size: 9px; margin-bottom: 10px; }
  /* Footer links need a real touch height (WCAG 2.5.8 asks for 24px min; we
     use 40px so the row is comfortably thumbable). */
  .pk-footer__col ul { gap: 0; }
  .pk-footer__col a {
    display: flex;
    align-items: center;
    min-height: 40px;
    font-size: 13.5px;
  }
  .pk-footer__bottom { padding: 15px 0 22px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .pk-footer__legal { gap: 4px 18px; }
  .pk-footer__legal a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    font-size: 12.5px;
  }

  .pk-page-head { padding-top: 28px; }
  .pk-prose { padding-top: 26px; }
  .pk-prose h2 { font-size: 20px; margin-top: 28px; }
  .pk-prose p, .pk-prose li { font-size: 14.5px; }
}

/* ==========================================================================
   Small layout utilities
   Promoted out of inline `style` attributes so the markup carries no inline
   declarations. Each one is a single-purpose layout tweak.
   ========================================================================== */

/* Search overlay form fills the bar */
.pk-overlay__form {
  flex: 1;
  display: flex;
}

/* Block-level button */
.pk-btn--block { width: 100%; }

/* "Load more" wrap under the All Games grid */
.pk-allmore {
  text-align: center;
  margin-top: 28px;
}

/* Breadcrumb pulled closer to the title */
.pk-crumb-tight { margin-bottom: 12px; }

/* Section with a tighter top pad (world hub "Worlds" heading) */
.pk-section--tight { padding-top: 20px; }

/* Grid lead-in spacing */
.pk-grid-gap { margin-top: 24px; }
.pk-grid-gap-sm { margin-top: 18px; }

/* Section description aligned beside the pixel bullet */
.pk-desc-aside {
  margin-left: 22px;
  margin-top: -8px;
}

/* Quest-count line under the page description */
.pk-count-line {
  margin-left: 0;
  margin-top: 10px;
}

/* Section heading with a little more air beneath it */
.pk-title-gap { margin-bottom: 14px; }

/* ==========================================================================
   Category page — first-fold block
   The world hub's heading + world tiles must together occupy the firstfold
   height so the ad below them starts in the 0.40-0.45 viewport band. The block
   is a flex column that absorbs slack, and the tile rail keeps its full height.
   ========================================================================== */
#pk-cat-hub > .pk-shell:first-child {
  /* The ad follows this block, so its height is the ad's offset: 42% of the
     viewport minus the sticky header and the slot's own top margin. */
  min-height: calc(42vh - var(--pk-header-h) - 16px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding-top: 6px;
}

#pk-cat-hub > .pk-shell:first-child .pk-page-head {
  flex-shrink: 0;
  padding-top: 14px;
  padding-bottom: 0;
}

#pk-cat-hub > .pk-shell:first-child .pk-section--tight {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 12px;
  overflow: hidden;
}

#pk-cat-hub > .pk-shell:first-child .pk-worlds {
  flex-shrink: 0;
}

/* The filtered-grid view's heading also precedes its ad. */
#pk-cat-view > .pk-shell:first-child {
  min-height: calc(42vh - var(--pk-header-h) - 16px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
  padding-top: 10px;
}

/* ==========================================================================
   Home — ad gaps on tall viewports
   Section heights come from content, so at 1080p and above the same sections
   occupy fewer screens and the ad intervals would compress below two screens.
   Adding viewport-relative padding to the slots that follow a section restores
   the 2.0-3.5 band without touching the layout at laptop heights.
   ========================================================================== */
@media (min-height: 1000px) {
  body[data-page="home"] .pk-main > .pk-ad {
    margin-block: 24vh 20vh;
  }
  /* the first slot keeps its tight firstfold offset */
  body[data-page="home"] .pk-main > .pk-ad:first-of-type {
    margin-top: 16px;
  }
}
@media (min-height: 1300px) {
  body[data-page="home"] .pk-main > .pk-ad {
    margin-block: 42vh 40vh;
  }
  body[data-page="home"] .pk-main > .pk-ad:first-of-type {
    margin-top: 16px;
  }
}

/* ==========================================================================
   Very small phones (<=340px wide or <=600px tall)
   The hero copy is legible but the stat strip is the least useful line; hiding
   it lets the whole firstfold fit without clipping, so the ad below keeps its
   0.40-0.45 offset. The numbers are repeated in the page body.
   ========================================================================== */
@media (max-width: 340px), (max-height: 600px) {
  .pk-hero__stats { display: none; }
  .pk-hero__sub { -webkit-line-clamp: 2; }
  /* Stacked CTAs add height; trim the hero's own lead-in to compensate. */
  .pk-hero { padding-top: 0; gap: 4px; }
  .pk-hero__cta-row { gap: 4px; margin-bottom: 4px; }
  .pk-hero__sub { margin-bottom: 4px; }
}

/* Extremely small phones (iPhone SE 1st gen and similar): the hub heading and
   tile rail are tightened further so the ad still lands in band. */
@media (max-width: 340px) {
  #pk-cat-hub > .pk-shell:first-child { padding-top: 0; }
  #pk-cat-hub > .pk-shell:first-child .pk-page-head { padding-top: 4px; }
  #pk-cat-hub > .pk-shell:first-child h1 { font-size: 20px; margin-bottom: 4px; }
  #pk-cat-hub > .pk-shell:first-child .pk-page-head__crumb { margin-bottom: 4px; }
  #pk-cat-hub > .pk-shell:first-child .pk-section--tight { padding-top: 2px; }
  #pk-cat-hub > .pk-shell:first-child .pk-title-gap { margin-bottom: 6px; }
  #pk-cat-hub .pk-world { min-height: 56px; padding: 7px 8px; gap: 7px; }
  #pk-cat-view > .pk-shell:first-child { padding-top: 2px; }
  #pk-cat-view > .pk-shell:first-child .pk-page-head { padding-top: 6px; }
  #pk-cat-view > .pk-shell:first-child h1 { font-size: 20px; margin-bottom: 4px; }
  #pk-cat-view > .pk-shell:first-child .pk-page-head__desc { font-size: 12px; line-height: 1.4; }
  #pk-cat-view > .pk-shell:first-child .pk-page-head__crumb { margin-bottom: 4px; }
  #pk-cat-hub .pk-world__art { width: 30px; height: 30px; }
  #pk-cat-hub .pk-world__name { font-size: 13px; }
}

/* ==========================================================================
   Tight viewports — hero fallbacks
   The band is a fixed share of the screen, so on short screens the full copy
   cannot fit at readable sizes. Secondary lines drop out in priority order:
   stat strip first (its numbers repeat below), then the sub-paragraph.
   ========================================================================== */
@media (max-height: 940px) {
  .pk-hero__stats { display: none; }
}
@media (max-height: 860px) {
  .pk-hero__sub { -webkit-line-clamp: 2; }
}
@media (max-height: 820px) {
  .pk-hero__sub { display: none; }
}
@media (max-height: 780px) {
  .pk-hero__badge { display: none; }
  .pk-hero__title { font-size: clamp(26px, 3vw, 38px); }
}

/* Phones: a slightly taller hero block because the copy column is narrower and
   the artwork thumbnail sits beside it, which otherwise pulls the ad above the
   target band. */
@media (max-width: 700px) {
  .pk-hero { min-height: calc(45.5vh - var(--pk-header-h) - 16px); }
}

@media (max-width: 700px) {
  #pk-cat-hub > .pk-shell:first-child,
  #pk-cat-view > .pk-shell:first-child {
    min-height: calc(45.5vh - var(--pk-header-h) - 16px);
  }
}

/* ==========================================================================
   World hub — compact firstfold
   The heading, world tiles and their lead-in must fit the budget the ad needs.
   Spacing is tightened here (not content removed) so the ad lands in band.
   ========================================================================== */
#pk-cat-hub > .pk-shell:first-child {
  padding-top: 4px;
}
#pk-cat-hub > .pk-shell:first-child .pk-page-head {
  padding-top: 8px;
  padding-bottom: 0;
}
#pk-cat-hub > .pk-shell:first-child .pk-page-head__crumb {
  margin-bottom: 6px;
}
#pk-cat-hub > .pk-shell:first-child h1 {
  margin-bottom: 6px;
}
#pk-cat-hub > .pk-shell:first-child .pk-page-head__desc {
  font-size: 13px;
  line-height: 1.45;
}
#pk-cat-hub > .pk-shell:first-child .pk-section--tight {
  padding-top: 8px;
}
#pk-cat-hub > .pk-shell:first-child .pk-title-gap {
  margin-bottom: 10px;
}

@media (max-height: 820px) {
  /* On short screens the explanatory paragraph is the least essential line. */
  #pk-cat-hub > .pk-shell:first-child .pk-page-head__desc { display: none; }
  #pk-cat-hub > .pk-shell:first-child h1 { font-size: clamp(22px, 2.6vw, 32px); }
  #pk-cat-hub > .pk-shell:first-child .pk-section--tight { padding-top: 4px; }
}

/* 4:3 landscape tablets (e.g. 1024x768): the All Games grid holds fewer rows at
   this width, so the final gap needs a little less lead-in to stay under 3.5. */
@media (min-width: 1001px) and (max-height: 800px) {
  body[data-page="home"] .pk-main > .pk-ad:last-of-type {
    margin-top: 10vh;
  }
}

/* ==========================================================================
   Narrow phones — ad intervals
   At 320-360px the content blocks are compressed into few screens, so the
   spacing that keeps intervals at 2-3.5 screens on wider phones overshoots.
   The lead-in is reduced proportionally here.
   ========================================================================== */
@media (max-width: 340px) {
  body[data-page="home"] .pk-main > .pk-ad { margin-block: 0 0; }
  body[data-page="home"] .pk-main > .pk-ad:first-of-type { margin-top: 8px; }
}

/* Very narrow phones: two full-width CTAs stacked read better than two
   truncated labels side by side. */
@media (max-width: 380px) {
  .pk-hero__cta-row { flex-wrap: wrap; }
  .pk-hero__cta-row .pk-btn { flex: 1 1 100%; font-size: 10px; padding: 7px 10px; }
  .pk-hero__cta-row .pk-btn--lg { font-size: 10px; padding: 7px 10px; }
}

/* Laptop heights: the catalogue is shorter per section than on tall screens, so
   the final home slot needs a little more lead-in to clear two screens. */
@media (min-width: 1001px) and (max-height: 950px) {
  body[data-page="home"] .pk-main > .pk-ad:last-of-type {
    margin-top: 20vh;
  }
}
