/* ==========================================================================
   components.css — Playroom components
   --------------------------------------------------------------------------
   Inventory:
     .pop-btn          pill buttons (solid, sun, ghost, block)
     .pop-chip         category chips
     .pop-hero         split hero with a sticker collage
     .pop-tiles        bento mosaic of game tiles (replaces a uniform grid)
     .pop-tile         one mosaic tile, sized by data-size
     .pop-badge        floating achievement sticker
     .pop-hub          detail header card
     .pop-tabs         tabbed guide (play / how / tips / faq)
     .pop-faq          accordion
     .pop-card         journal / article cards
     .pop-legal        legal doc shell with a contents rail
     .pop-ad           reserved ad slot
     .pop-toast        transient message
     .pop-player       full-bleed play surface
     .pop-empty        empty state
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons & chips
   -------------------------------------------------------------------------- */
.pop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.7rem 1.35rem;
  border-radius: var(--pop-r-pill);
  background: var(--pop-white);
  box-shadow: var(--pop-shadow-sm);
  font-family: var(--pop-display);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--pop-ink);
  transition:
    transform var(--pop-fast) var(--pop-spring),
    box-shadow var(--pop-fast) var(--pop-ease),
    background var(--pop-fast) var(--pop-ease);
}

.pop-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(32, 41, 52, 0.1), var(--pop-shadow-md);
}

.pop-btn:active {
  transform: translateY(1px);
  box-shadow: var(--pop-shadow-sm);
}

.pop-btn svg {
  flex: 0 0 auto;
}

.pop-btn--solid {
  /* Ink on bright orange measures 5.19:1 — white would only reach 2.84:1. */
  background: var(--pop-orange);
  color: var(--pop-ink);
  box-shadow: inset 0 -3px 0 rgba(32, 41, 52, 0.2);
}

.pop-btn--solid:hover {
  background: #ff8555;
}

.pop-btn--ink {
  background: var(--pop-ink);
  color: var(--pop-white);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35);
}

.pop-btn--ink:hover {
  background: #2b3745;
}

.pop-btn--sun {
  background: var(--pop-sun);
  color: var(--pop-ink);
  box-shadow: inset 0 -3px 0 rgba(32, 41, 52, 0.16);
}

.pop-btn--sun:hover {
  background: #ffd05c;
}

.pop-btn--ghost {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--pop-line-strong);
}

.pop-btn--ghost:hover {
  background: var(--pop-white);
  box-shadow: inset 0 0 0 2px var(--pop-ink);
}

.pop-btn--lg {
  min-height: 3.3rem;
  padding: 0.85rem 1.7rem;
  font-size: 1.02rem;
}

.pop-btn--block {
  width: 100%;
}

.pop-btn--sm {
  min-height: 2.35rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

/* Text link with a bouncy arrow */
.pop-arrowlink {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--pop-display);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--pop-orange-text);
  transition: gap var(--pop-fast) var(--pop-spring);
}

.pop-arrowlink:hover {
  gap: 0.7rem;
}

.pop-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.6rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--pop-r-pill);
  background: var(--pop-white);
  box-shadow: var(--pop-shadow-sm);
  font-family: var(--pop-display);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--pop-ink-2);
  white-space: nowrap;
  transition:
    background var(--pop-fast) var(--pop-ease),
    color var(--pop-fast) var(--pop-ease),
    transform var(--pop-fast) var(--pop-spring);
}

.pop-chip b {
  font-weight: 600;
  font-size: 0.76rem;
  opacity: 0.66;
}

.pop-chip:hover {
  transform: translateY(-2px);
  color: var(--pop-ink);
}

.pop-chip[aria-pressed="true"] {
  background: var(--pop-ink);
  color: var(--pop-white);
}

.pop-chip[aria-pressed="true"] b {
  color: var(--pop-sun);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.pop-hero {
  position: relative;
  /* Kept deliberately compact: the first ad slot must be fully visible without
     scrolling, so the hero has to leave roughly 300px of the first viewport. */
  padding-block: clamp(0.5rem, 1.1vw, 0.9rem) clamp(0.6rem, 1.3vw, 1rem);
}

.pop-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.25rem);
}

.pop-hero__copy {
  position: relative;
  z-index: 2;
}

.pop-hero__title {
  margin-top: 0.5rem;
  font-size: clamp(1.8rem, 1.05rem + 2.8vw, 2.6rem);
  /* Fixed line box: the display webfont and its fallback have different
     metrics, and a shift here pushes the first ad slot down. */
  line-height: 1.02;
  letter-spacing: -0.025em;
  min-height: calc(3 * 1.02em);
}

/* Highlighter swipe behind a key phrase, drawn as a flat rounded block */
.pop-hero__title em {
  position: relative;
  font-style: normal;
  white-space: nowrap;
  padding: 0 0.18em;
  z-index: 0;
}

.pop-hero__title em::before {
  content: "";
  position: absolute;
  inset: 0.16em -0.02em 0.06em;
  z-index: -1;
  border-radius: 0.3em;
  background: var(--pop-sun);
  transform: rotate(-1.4deg);
}

.pop-hero__lede {
  max-width: 44ch;
  margin-top: 0.6rem;
  font-size: clamp(1rem, 0.95rem + 0.28vw, 1.1rem);
  line-height: 1.68;
  color: var(--pop-ink-2);
  /* Four lines at the widest wrap; reserving them stops the font swap from
     reflowing everything below. */
  min-height: calc(4 * 1.68em);
}

.pop-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 0.9rem;
  margin-top: 1.1rem;
}

/* Three little stat bubbles */
.pop-stats {
  display: flex;
  /* The three stats always share one row; they shrink rather than wrap. */
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-top: clamp(0.7rem, 1.4vw, 1rem);
}

/* The stats are a single compact row, so they no longer need to be hidden to
   make room for the first ad slot. Only genuinely tiny viewports drop them,
   where even one row would push the slot off screen. */
@media (max-height: 760px) and (max-width: 480px) {
  .pop-stats {
    display: none;
  }

  .pop-hero__copy > .pop-label {
    display: none;
  }

  .pop-hero__title {
    font-size: 1.4rem;
  }

  .pop-hero__lede {
    font-size: 0.86rem;
    line-height: 1.5;
  }

  .pop-hero__actions {
    margin-top: 0.55rem;
  }

  /* One action is enough on a phone this short; the journal link lives in the
     menu button anyway. */
  .pop-hero__actions .pop-arrowlink {
    display: none;
  }
}

.pop-stat {
  display: flex;
  /* Equal shares of the row, allowed to shrink below content width. */
  flex: 1 1 0;
  min-width: 0;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--pop-r-pill);
  background: var(--pop-white);
  box-shadow: var(--pop-shadow-sm);
}

.pop-stat b {
  font-family: var(--pop-display);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1;
}

.pop-stat span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pop-ink-2);
}

.pop-stat i {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  font-style: normal;
  font-size: 0.8rem;
}

/* Compact single-row layout for narrow viewports: the icon stays on the left
   while the number and label stack, which is far narrower than three pieces of
   text side by side. */
/* Short viewports: tighten the hero so the 250px ad slot still ends above the
   fold now that the stats row occupies space again. */
@media (max-height: 860px) {
  .pop-hero {
    padding-block: 0.35rem 0.45rem;
  }

  .pop-hero__title {
    margin-top: 0.3rem;
    font-size: clamp(1.55rem, 1rem + 2.2vw, 2.15rem);
  }

  .pop-hero__lede {
    margin-top: 0.4rem;
    font-size: 0.93rem;
    line-height: 1.55;
  }

  .pop-hero__actions {
    margin-top: 0.65rem;
  }

  .pop-stats {
    margin-top: 0.55rem;
  }
}

@media (max-width: 720px) {
  .pop-stats {
    gap: 0.35rem;
  }

  .pop-stat {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 0.35rem;
    padding: 0.4rem 0.5rem;
  }

  .pop-stat i {
    grid-row: 1 / 3;
    grid-column: 1;
    width: 1.35rem;
    height: 1.35rem;
    font-size: 0.68rem;
  }

  .pop-stat b {
    grid-row: 1;
    grid-column: 2;
    font-size: 0.85rem;
  }

  .pop-stat span {
    grid-row: 2;
    grid-column: 2;
    font-size: 0.6rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.pop-stat:nth-child(1) i {
  background: #ffe1d2;
}

.pop-stat:nth-child(2) i {
  background: #fff3d1;
}

.pop-stat:nth-child(3) i {
  background: #ddf7ee;
}

/* Sticker collage --------------------------------------------------------- */
.pop-hero__art {
  position: relative;
}

.pop-hero__stage {
  position: relative;
  isolation: isolate;
  padding: clamp(0.7rem, 1.6vw, 1.1rem);
  border-radius: var(--pop-r-xl);
  background: var(--pop-white);
  box-shadow: var(--pop-shadow-lg);
}

.pop-hero__stage img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--pop-r-lg);
}

/* Floating tiles around the stage */
.pop-float {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--pop-r-md);
  background: var(--pop-white);
  box-shadow: var(--pop-shadow-md);
  font-family: var(--pop-display);
  font-size: 0.82rem;
  font-weight: 600;
  animation: pop-bob 5s ease-in-out infinite;
}

.pop-float i {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  font-style: normal;
  font-size: 0.85rem;
}

.pop-float--a {
  top: 1.6rem;
  left: -0.6rem;
}

.pop-float--a i {
  background: var(--pop-sun);
}

.pop-float--b {
  right: -0.4rem;
  bottom: 2.6rem;
  animation-delay: -2.2s;
}

.pop-float--b i {
  background: var(--pop-mint);
}

@keyframes pop-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-1.4deg);
  }
  50% {
    transform: translateY(-7px) rotate(1.4deg);
  }
}

/* --------------------------------------------------------------------------
   Bento mosaic
   -------------------------------------------------------------------------- */
.pop-filters {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: clamp(1.1rem, 2.2vw, 1.6rem);
}

.pop-filters__scroll {
  display: flex;
  flex: 1 1 auto;
  gap: 0.5rem;
  padding-bottom: 0.25rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.pop-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(0, auto);
  gap: clamp(0.65rem, 1.4vw, 1.05rem);
}

/* Tile -------------------------------------------------------------------- */
.pop-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  min-height: 11.5rem;
  padding: 0.85rem;
  border-radius: var(--pop-r-lg);
  overflow: hidden;
  color: var(--pop-ink);
  box-shadow: var(--pop-shadow-sm);
  transition:
    transform var(--pop-mid) var(--pop-spring),
    box-shadow var(--pop-mid) var(--pop-ease);
}

.pop-tile:hover {
  transform: translateY(-5px) scale(1.012);
  box-shadow: var(--pop-shadow-lg);
}

.pop-tile:active {
  transform: translateY(-2px) scale(1.004);
}

/* Accent fills per tone */
.pop-tile[data-tone="marigold"] {
  background-color: #ffd977;
  background-image: linear-gradient(150deg, #ffe9b8, var(--pop-sun));
}

.pop-tile[data-tone="sage"] {
  background-color: #b6eddd;
  background-image: linear-gradient(150deg, #d9f7ee, var(--pop-mint));
}

.pop-tile[data-tone="coral"] {
  background-color: #ffc9b0;
  background-image: linear-gradient(150deg, #ffe0d2, #ffb894);
}

.pop-tile[data-tone="pine"] {
  background-color: #cfe8fb;
  background-image: linear-gradient(150deg, #dbeafe, var(--pop-sky));
}

.pop-tile[data-tone="lav"] {
  background-color: #e6e0ff;
  background-image: linear-gradient(150deg, #ece7ff, var(--pop-lav));
}

.pop-tile[data-tone="pink"] {
  background-color: #ffe8f0;
  background-image: linear-gradient(150deg, #ffe8f0, var(--pop-pink));
}

/* Mosaic spans: assigned by the renderer via data-size */
.pop-tile[data-size="hero"] {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 23.5rem;
  padding: clamp(1rem, 1.8vw, 1.4rem);
}

.pop-tile[data-size="wide"] {
  grid-column: span 2;
  min-height: 13.5rem;
}

/* Tile chrome ------------------------------------------------------------- */
.pop-tile__top {
  position: absolute;
  inset: 0.8rem 0.8rem auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  z-index: 2;
}

.pop-tile__glyph {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--pop-r-md);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 2px 0 rgba(32, 41, 52, 0.08);
  transition: transform var(--pop-mid) var(--pop-spring);
}

.pop-tile:hover .pop-tile__glyph {
  transform: rotate(-8deg) scale(1.07);
}

.pop-tile__glyph svg {
  width: 1.65rem;
  height: 1.65rem;
}

.pop-tile__score {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.24rem 0.5rem;
  border-radius: var(--pop-r-pill);
  background: rgba(255, 255, 255, 0.82);
  font-family: var(--pop-display);
  font-size: 0.74rem;
  font-weight: 600;
}

.pop-tile__score svg {
  color: var(--pop-orange-text);
}

.pop-tile__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: auto;
}

.pop-tile__name {
  font-family: var(--pop-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.pop-tile__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(32, 41, 52, 0.7);
}

.pop-tile__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}

.pop-tile__play {
  position: absolute;
  right: 0.8rem;
  bottom: 0.8rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--pop-ink);
  color: var(--pop-white);
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity var(--pop-fast) var(--pop-ease),
    transform var(--pop-fast) var(--pop-spring);
}

.pop-tile:hover .pop-tile__play,
.pop-tile:focus-visible .pop-tile__play {
  opacity: 1;
  transform: scale(1);
}

/* The hero tile gets larger type and a visible play button */
.pop-tile[data-size="hero"] .pop-tile__name {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem);
}

.pop-tile[data-size="hero"] .pop-tile__glyph {
  width: 3.6rem;
  height: 3.6rem;
}

.pop-tile[data-size="hero"] .pop-tile__glyph svg {
  width: 2rem;
  height: 2rem;
}

.pop-tile[data-size="hero"] .pop-tile__play {
  opacity: 1;
  transform: none;
  width: 3rem;
  height: 3rem;
}

.pop-tile[data-size="hero"] .pop-tile__desc {
  max-width: 40ch;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(32, 41, 52, 0.76);
}

.pop-tile[data-size="wide"] .pop-tile__name {
  font-size: 1.18rem;
}

/* Mosaic footer ----------------------------------------------------------- */
.pop-tiles__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: clamp(1.1rem, 2vw, 1.5rem);
}

.pop-tiles__count {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--pop-ink-2);
}

.pop-tiles__count b {
  color: var(--pop-ink);
}

/* --------------------------------------------------------------------------
   Feature strip (three little explainer cards)
   -------------------------------------------------------------------------- */
.pop-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.6vw, 1.15rem);
}

.pop-feature {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: clamp(1.1rem, 2vw, 1.5rem);
  border-radius: var(--pop-r-lg);
  background: var(--pop-white);
  box-shadow: var(--pop-shadow-sm);
  transition: transform var(--pop-mid) var(--pop-spring);
}

.pop-feature:hover {
  transform: translateY(-4px);
}

.pop-feature__icon {
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: var(--pop-r-md);
  font-size: 1.3rem;
}

.pop-feature:nth-child(1) .pop-feature__icon {
  background: #ffe1d2;
}

.pop-feature:nth-child(2) .pop-feature__icon {
  background: #fff3d1;
}

.pop-feature:nth-child(3) .pop-feature__icon {
  background: #ddf7ee;
}

.pop-feature h3 {
  font-size: 1.1rem;
}

.pop-feature p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--pop-ink-2);
}

/* --------------------------------------------------------------------------
   Daily challenge banner
   -------------------------------------------------------------------------- */
.pop-challenge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.4rem;
  padding: clamp(1.1rem, 2.4vw, 1.8rem);
  border-radius: var(--pop-r-xl);
  /* Solid colour first: a gradient-only background reports as transparent to
     contrast checkers and to forced-colors mode. */
  background-color: #ffb08c;
  background-image: linear-gradient(135deg, #ffc9ad, #ffb08c);
  color: var(--pop-ink);
  box-shadow: var(--pop-shadow-md);
}

.pop-challenge__badge {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: var(--pop-r-md);
  background: rgba(255, 255, 255, 0.62);
  font-size: 1.5rem;
}

.pop-challenge__copy {
  flex: 1 1 15rem;
  min-width: 0;
}

.pop-challenge__copy h2 {
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem);
  line-height: 1.2;
}

.pop-challenge__copy p {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #4a3527;
}

.pop-challenge .pop-btn {
  flex: 0 0 auto;
  background: var(--pop-white);
  color: var(--pop-orange-text);
  box-shadow: 0 3px 0 rgba(32, 41, 52, 0.14);
}

/* --------------------------------------------------------------------------
   Detail hub
   -------------------------------------------------------------------------- */
.pop-hub {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(1rem, 2.4vw, 1.75rem);
  align-items: stretch;
}

.pop-hub__art {
  position: relative;
  min-height: 12rem;
  border-radius: var(--pop-r-xl);
  overflow: hidden;
  background: var(--pop-cream-deep);
  box-shadow: var(--pop-shadow-md);
}

.pop-hub__art img {
  width: 100%;
  height: 100%;
  min-height: 12rem;
  max-height: 17rem;
  object-fit: cover;
}

.pop-hub__tag {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--pop-r-pill);
  background: rgba(255, 255, 255, 0.92);
  font-family: var(--pop-display);
  font-size: 0.78rem;
  font-weight: 600;
}

.pop-hub__panel {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: clamp(0.9rem, 1.5vw, 1.2rem);
  border-radius: var(--pop-r-xl);
  background: var(--pop-white);
  box-shadow: var(--pop-shadow-md);
}

.pop-hub__title {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.15rem);
  line-height: 1.04;
}

.pop-hub__sub {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--pop-ink-2);
}

.pop-hub__specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

@media (max-height: 820px) {
  .pop-hub__sub {
    display: none;
  }
}

.pop-hub__spec {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--pop-r-sm);
  background: var(--pop-cream);
}

.pop-hub__spec i {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--pop-white);
  font-style: normal;
  font-size: 0.78rem;
}

.pop-hub__spec span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.pop-hub__spec small {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pop-ink-2);
}

.pop-hub__spec b {
  font-family: var(--pop-display);
  font-size: 0.9rem;
  font-weight: 600;
}

.pop-hub__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: auto;
}

/* --------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */
.pop-tabsbar {
  display: flex;
  gap: 0.4rem;
  padding: 0.4rem;
  border-radius: var(--pop-r-pill);
  background: var(--pop-cream-deep);
  overflow-x: auto;
  scrollbar-width: none;
}

.pop-tabsbar::-webkit-scrollbar {
  display: none;
}

.pop-tab {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.6rem;
  padding: 0.5rem 1rem;
  border-radius: var(--pop-r-pill);
  font-family: var(--pop-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pop-ink-2);
  white-space: nowrap;
  transition:
    background var(--pop-fast) var(--pop-ease),
    color var(--pop-fast) var(--pop-ease),
    box-shadow var(--pop-fast) var(--pop-ease);
}

.pop-tab:hover {
  color: var(--pop-ink);
}

.pop-tab[aria-selected="true"] {
  background: var(--pop-white);
  color: var(--pop-ink);
  box-shadow: var(--pop-shadow-sm);
}

.pop-panel {
  padding-top: clamp(1.1rem, 2.2vw, 1.6rem);
}

.pop-panel[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   Detail: pre-render height reservation
   --------------------------------------------------------------------------
   The tabs, panels and aside lists are filled by JS after parse. Without a
   reservation the whole .pop-detail block grows by ~250px at fill time, which
   measured as a 0.15-0.37 CLS.

   The `[data-*-loading]` markers are removed by the renderer, so these rules
   only apply while the placeholders are still in the DOM. Heights come from
   measurements at three viewports.
   -------------------------------------------------------------------------- */
[data-tabs]:empty {
  min-height: 54px;
}

.pop-detail__main:has([data-panels-loading]) {
  min-height: 211px;
}

.pop-detail__side:has([data-list-loading]) {
  min-height: 745px;
}

/* Aside list heights: these matter on wide viewports, where the aside is the
   taller column and therefore drives the .pop-detail block height. */
.pop-mini[data-list-loading] {
  min-height: 113px;
}

[data-cross-shelf][data-list-loading] {
  min-height: 173px;
}


@media (max-width: 900px) {
  .pop-detail__main:has([data-panels-loading]) {
    min-height: 189px;
  }

  .pop-detail__side:has([data-list-loading]) {
    min-height: 745px;
  }
}

@media (max-width: 720px) {
  .pop-detail__main:has([data-panels-loading]) {
    min-height: 220px;
  }
}

.pop-panel__lead {
  max-width: 68ch;
  font-size: 1.02rem;
  line-height: 1.72;
}

.pop-panel__lead + .pop-panel__lead {
  margin-top: 0.9rem;
}

/* Step cards */
.pop-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
  counter-reset: step;
}

.pop-steps li {
  position: relative;
  padding: 1rem 1rem 1rem 3.1rem;
  border-radius: var(--pop-r-md);
  background: var(--pop-white);
  box-shadow: var(--pop-shadow-sm);
  font-size: 0.92rem;
  line-height: 1.6;
  counter-increment: step;
}

.pop-steps li::before {
  content: counter(step);
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--pop-sun);
  font-family: var(--pop-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pop-ink);
}

/* Tip cards */
.pop-tips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.pop-tips li {
  display: flex;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-radius: var(--pop-r-md);
  background: #fff3d1;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.55;
}

.pop-tips li svg {
  flex: 0 0 auto;
  margin-top: 0.15rem;
  color: var(--pop-orange-text);
}

/* --------------------------------------------------------------------------
   FAQ accordion
   -------------------------------------------------------------------------- */
.pop-faq {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.4rem;
}

.pop-faq details {
  border-radius: var(--pop-r-md);
  background: var(--pop-white);
  box-shadow: var(--pop-shadow-sm);
  overflow: hidden;
}

.pop-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-family: var(--pop-display);
  font-size: 0.98rem;
  font-weight: 600;
  list-style: none;
}

.pop-faq summary::-webkit-details-marker {
  display: none;
}

.pop-faq summary::after {
  content: "+";
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--pop-cream-deep);
  font-size: 1rem;
  line-height: 1;
  transition: transform var(--pop-fast) var(--pop-ease);
}

.pop-faq details[open] summary::after {
  transform: rotate(45deg);
  background: var(--pop-sun);
}

.pop-faq p {
  padding: 0 1rem 1rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--pop-ink-2);
}

/* --------------------------------------------------------------------------
   Cards (journal / related)
   -------------------------------------------------------------------------- */
.pop-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.8rem, 1.8vw, 1.25rem);
}

.pop-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--pop-r-lg);
  background: var(--pop-white);
  box-shadow: var(--pop-shadow-sm);
  overflow: hidden;
  transition:
    transform var(--pop-mid) var(--pop-spring),
    box-shadow var(--pop-mid) var(--pop-ease);
}

.pop-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--pop-shadow-lg);
}

.pop-card__media {
  position: relative;
  overflow: hidden;
}

.pop-card__media img {
  width: 100%;
  aspect-ratio: 25 / 17;
  object-fit: cover;
  transition: transform var(--pop-mid) var(--pop-ease);
}

.pop-card:hover .pop-card__media img {
  transform: scale(1.05);
}

.pop-card__tag {
  position: absolute;
  left: 0.7rem;
  top: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--pop-r-pill);
  background: var(--pop-white);
  font-family: var(--pop-display);
  font-size: 0.7rem;
  font-weight: 600;
}

.pop-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.05rem 1.15rem;
}

.pop-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--pop-ink-2);
}

.pop-card__title {
  font-family: var(--pop-display);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.22;
}

.pop-card:hover .pop-card__title {
  color: var(--pop-orange-text);
}

.pop-card__excerpt {
  font-size: 0.88rem;
  line-height: 1.58;
  color: var(--pop-ink-2);
}

.pop-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.7rem;
  font-family: var(--pop-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pop-ink-2);
}

.pop-card--lead {
  grid-column: span 2;
  flex-direction: row;
}

.pop-card--lead .pop-card__media {
  flex: 0 0 46%;
}

.pop-card--lead .pop-card__media img {
  height: 100%;
  aspect-ratio: auto;
  min-height: 13rem;
}

.pop-card--lead .pop-card__title {
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem);
}

/* Related mini list */
.pop-mini {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pop-mini a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--pop-r-md);
  background: var(--pop-cream);
  transition: background var(--pop-fast) var(--pop-ease), transform var(--pop-fast) var(--pop-spring);
}

.pop-mini a:hover {
  background: var(--pop-cream-deep);
  transform: translateX(3px);
}

.pop-mini__glyph {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: var(--pop-r-sm);
  background: var(--pop-white);
}

.pop-mini__glyph svg {
  width: 1.2rem;
  height: 1.2rem;
}

.pop-mini__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.pop-mini__text b {
  font-family: var(--pop-display);
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pop-mini__text span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--pop-ink-2);
}

/* --------------------------------------------------------------------------
   Detail layout
   -------------------------------------------------------------------------- */
.pop-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19rem;
  align-items: start;
  gap: clamp(1rem, 2.4vw, 1.75rem);
  margin-top: clamp(1.25rem, 2.6vw, 2rem);
}

.pop-detail > * {
  min-width: 0;
}

.pop-detail__main {
  display: flex;
  flex-direction: column;
  gap: clamp(0.9rem, 2vw, 1.3rem);
  min-width: 0;
}

.pop-detail__side {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  position: sticky;
  top: 6rem;
}

.pop-sidecard {
  padding: 1rem;
  border-radius: var(--pop-r-lg);
  background: var(--pop-white);
  box-shadow: var(--pop-shadow-sm);
}

.pop-sidecard h2 {
  margin-bottom: 0.6rem;
  font-family: var(--pop-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--pop-ink-2);
}

/* Breadcrumb */
.pop-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--pop-ink-2);
}

.pop-crumb a:hover {
  color: var(--pop-orange-text);
}

.pop-crumb span[aria-hidden] {
  opacity: 0.5;
}

/* --------------------------------------------------------------------------
   About & legal shells
   -------------------------------------------------------------------------- */
.pop-pagetail {
  padding-block: clamp(1.5rem, 3vw, 2.5rem);
}

.pop-pagetail__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.75rem);
}

.pop-pagetail h1 {
  margin-top: 0.75rem;
}

.pop-pagetail p {
  max-width: 46ch;
  margin-top: 0.9rem;
  color: var(--pop-ink-2);
  line-height: 1.7;
}

.pop-pagetail__art img {
  width: 100%;
  aspect-ratio: 14 / 9;
  object-fit: cover;
  border-radius: var(--pop-r-xl);
  box-shadow: var(--pop-shadow-lg);
}

.pop-legal {
  padding-block: clamp(1.5rem, 3vw, 2.5rem);
}

.pop-legal__grid {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.pop-legal__grid > * {
  min-width: 0;
}

.pop-legal__toc {
  position: sticky;
  top: 6rem;
  padding: 1rem;
  border-radius: var(--pop-r-lg);
  background: var(--pop-white);
  box-shadow: var(--pop-shadow-sm);
  overflow-wrap: anywhere;
}

.pop-legal__toc h2 {
  font-family: var(--pop-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--pop-ink-2);
}

.pop-legal__toc ol {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.6rem;
  padding-left: 1.1rem;
  list-style: decimal;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--pop-ink-2);
}

.pop-legal__toc li::marker {
  color: var(--pop-orange-text);
  font-weight: 800;
}

.pop-legal__toc a:hover {
  color: var(--pop-orange-text);
}

.pop-legal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 2px dashed var(--pop-line-strong);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--pop-ink-2);
}

/* ==========================================================================
   Ad slots
   --------------------------------------------------------------------------
   Real ad units are 336x250, so each slot reserves exactly that box. A plain
   wrapper (no styling of its own) holds the template output; only the inner
   `.pop-adslot` frame carries the reserved geometry, and that frame is removed
   from view once a creative is present so no chrome surrounds the ad.

   Spacing rule: consecutive slots are separated by 1.5-3 viewports of content.
   This is enforced by the page structure (three content blocks between the
   first and second slot, and again before the third) and verified by
   measurement in the build check.
   ========================================================================== */

/* Neutral wrapper the server-side template writes into. Deliberately has no
   padding, border or background so it never styles the injected markup. */
.pop-ad-slot {
  display: flex;
  justify-content: center;
  margin-block: clamp(0.75rem, 1.5vw, 1.25rem);
}

/* The reserved box: exactly 336x250, centred, with a subtle placeholder that
   disappears when the slot is filled. */
.pop-ad-slot__frame {
  display: grid;
  place-items: center;
  width: 336px;
  max-width: 100%;
  min-height: 250px;
  color: var(--pop-ink-2);
  font-family: var(--pop-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

/* Once the template injects real markup, the frame is no longer needed: the
   creative sits directly on the page with no surrounding chrome. */
.pop-ad-slot__frame:has(> :not(.pop-ad-slot__hint)) {
  display: block;
  min-height: 0;
  width: auto;
}

.pop-ad-slot__frame > .pop-ad-slot__hint {
  opacity: 0.55;
}

/* Below 336px of available width the box scales down proportionally rather
   than stretching, so the reserved aspect never distorts. */
@media (max-width: 360px) {
  .pop-ad-slot__frame {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Empty state & toast
   -------------------------------------------------------------------------- */
.pop-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: clamp(2.2rem, 5vw, 3.5rem) 1rem;
  border-radius: var(--pop-r-lg);
  background: var(--pop-white);
  box-shadow: var(--pop-shadow-sm);
  text-align: center;
}

.pop-empty__face {
  font-size: 2.25rem;
  line-height: 1;
}

.pop-empty h3 {
  font-size: 1.25rem;
}

.pop-empty p {
  max-width: 32ch;
  font-size: 0.9rem;
  color: var(--pop-ink-2);
}

.pop-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 250;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: calc(100vw - 2rem);
  padding: 0.7rem 1.1rem;
  border-radius: var(--pop-r-pill);
  background: var(--pop-ink);
  color: var(--pop-white);
  font-family: var(--pop-display);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--pop-shadow-lg);
  transform: translateX(-50%);
  animation: pop-toast-in 240ms var(--pop-spring);
}

@keyframes pop-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 14px) scale(0.94);
  }
}

/* --------------------------------------------------------------------------
   Play surface
   -------------------------------------------------------------------------- */
.pop-player {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--pop-ink);
}

.pop-player__bar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem clamp(0.7rem, 2vw, 1.1rem);
  background: var(--pop-ink);
  color: var(--pop-white);
}

.pop-player__bar a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--pop-display);
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.84);
  transition: color var(--pop-fast) var(--pop-ease);
}

.pop-player__bar a:hover {
  color: var(--pop-sun);
}

.pop-player__title {
  font-family: var(--pop-display);
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pop-player__frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #151c25;
}

.pop-player__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #151c25;
}

.pop-player__note {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.8rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--pop-white);
}

.pop-player__note h1,
.pop-player__note h2 {
  font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem);
  color: var(--pop-white);
}

.pop-player__note p {
  max-width: 42ch;
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
}

/* --------------------------------------------------------------------------
   Responsive components
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  /* Detail hub on phones: drop the banner and keep only the facts, which is
     what pulls the first ad slot into the first screen. */
  .pop-hub__art {
    display: none;
  }

  .pop-crumb {
    padding-top: 0;
    font-size: 0.76rem;
  }

  .pop-hub__title {
    font-size: 1.4rem;
  }

  .pop-main {
    padding-top: 0.4rem;
  }
}

@media (max-width: 860px) {
  .pop-hub__art img {
    min-height: 7.5rem;
    max-height: 7.5rem;
  }

  .pop-hub__sub {
    display: none;
  }

  .pop-hub__specs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .pop-hub__spec {
    padding: 0.35rem 0.5rem;
  }

  .pop-hub__spec small {
    display: none;
  }
}

@media (max-width: 1080px) {
  .pop-hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.88fr);
  }

  .pop-detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .pop-detail__side {
    position: static;
    order: 2;
  }

  .pop-hub {
    grid-template-columns: minmax(0, 1fr);
  }

  .pop-hub__art {
    min-height: 14rem;
    max-height: 20rem;
  }

  .pop-hub__art img {
    min-height: 14rem;
    max-height: 20rem;
  }
}

@media (max-width: 980px) {
  .pop-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pop-tile[data-size="hero"] {
    grid-column: span 2;
    min-height: 19rem;
  }

  .pop-features {
    grid-template-columns: minmax(0, 1fr);
  }

  .pop-pagetail__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pop-legal__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pop-legal__toc {
    position: static;
  }

  .pop-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pop-card--lead {
    grid-column: span 2;
  }
}

@media (max-width: 860px) {
  .pop-hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pop-hero__art {
    order: -1;
    max-width: 32rem;
  }

  /* The art is the single largest block in the hero; hiding it on phones is
     what keeps the first ad slot inside the first screen. */
  .pop-hero__art {
    display: none;
  }

  .pop-hero {
    padding-block: 0.4rem 0.5rem;
  }

  .pop-hero__title {
    font-size: clamp(1.65rem, 1.1rem + 3vw, 2.1rem);
  }

  .pop-hero__lede {
    margin-top: 0.5rem;
    font-size: 0.95rem;
  }

  .pop-hero__actions {
    margin-top: 0.85rem;
  }

  .pop-float--a {
    left: -0.2rem;
    top: 0.6rem;
  }

  .pop-float--b {
    right: -0.2rem;
    bottom: 1.2rem;
  }
}

@media (max-width: 720px) {
  .pop-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .pop-tile {
    min-height: 9.5rem;
    padding: 0.7rem;
    border-radius: var(--pop-r-md);
  }

  .pop-tile[data-size="hero"] {
    grid-column: span 2;
    grid-row: span 1;
    min-height: 15rem;
  }

  .pop-tile[data-size="wide"] {
    grid-column: span 2;
    min-height: 10.5rem;
  }

  .pop-tile__glyph {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: var(--pop-r-sm);
  }

  .pop-tile__glyph svg {
    width: 1.35rem;
    height: 1.35rem;
  }

  .pop-tile__name {
    font-size: 0.92rem;
  }

  .pop-tile__meta {
    font-size: 0.7rem;
  }

  .pop-tile__play {
    display: none;
  }

  .pop-tile[data-size="hero"] .pop-tile__play {
    display: grid;
  }

  .pop-tile[data-size="hero"] .pop-tile__desc {
    display: none;
  }

  .pop-hub__specs {
    grid-template-columns: minmax(0, 1fr);
  }

  .pop-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .pop-card--lead {
    grid-column: span 1;
    flex-direction: column;
  }

  .pop-card--lead .pop-card__media img {
    min-height: 10rem;
    aspect-ratio: 25 / 17;
  }

  .pop-challenge {
    gap: 0.85rem;
  }

  .pop-challenge .pop-btn {
    width: 100%;
  }

  .pop-float {
    font-size: 0.74rem;
    padding: 0.45rem 0.65rem;
  }

  .pop-tabsbar {
    border-radius: var(--pop-r-md);
  }

  .pop-tab {
    flex: 0 0 auto;
    padding: 0.45rem 0.8rem;
    font-size: 0.84rem;
  }
}

@media (max-width: 420px) {
  .pop-tiles {
    grid-template-columns: minmax(0, 1fr);
  }

  .pop-tile,
  .pop-tile[data-size="hero"],
  .pop-tile[data-size="wide"] {
    grid-column: span 1;
    min-height: 8.75rem;
  }

  .pop-tile[data-size="hero"] {
    min-height: 12rem;
  }
}

/* ==========================================================================
   Vertical genre sections (home catalogue)
   --------------------------------------------------------------------------
   Each genre is a stacked section: a heading rail on the left, then a card
   cluster whose layout rotates between four patterns so the page never reads
   as a uniform wall:

     spotlight  1 large feature on the left, 2 stacked on the right
     row        3 equal portrait cards
     split      1 tall lead + 2 wide rows
     banner     1 wide banner on top + 2 squares

   Every card remains a single anchor, so the entire area is clickable and the
   whole cluster is keyboard reachable in reading order.
   ========================================================================== */

.pop-genres {
  display: flex;
  flex-direction: column;
  gap: clamp(2.25rem, 4.5vw, 3.75rem);
}

.pop-genre {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  align-items: start;
  gap: clamp(1rem, 2.4vw, 2rem);
}

/* Left rail: number, name, blurb, count */
.pop-genre__rail {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.pop-genre__no {
  font-family: var(--pop-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--pop-orange-text);
}

.pop-genre__name {
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem);
  line-height: 1.1;
}

.pop-genre__blurb {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--pop-ink-2);
  min-height: calc(2 * 1.55em);
}

.pop-genre__count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: flex-start;
  margin-top: 0.2rem;
  padding: 0.22rem 0.6rem;
  border-radius: var(--pop-r-pill);
  background: var(--pop-white);
  box-shadow: var(--pop-shadow-sm);
  font-family: var(--pop-display);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--pop-ink-2);
}

/* Card cluster ------------------------------------------------------------ */
.pop-genre__cards {
  display: grid;
  min-width: 0;
  gap: clamp(0.6rem, 1.3vw, 0.95rem);
}

/* spotlight: big left, two stacked right */
.pop-genre__cards[data-layout="spotlight"] {
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.pop-genre__cards[data-layout="spotlight"] > :nth-child(1) {
  grid-row: span 2;
}

/* row: three equal portrait cards */
.pop-genre__cards[data-layout="row"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* split: tall lead + two wide rows */
.pop-genre__cards[data-layout="split"] {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.pop-genre__cards[data-layout="split"] > :nth-child(1) {
  grid-row: span 2;
}

/* reversed: mirror of spotlight — two stacked on the left, big card right */
.pop-genre__cards[data-layout="reversed"] {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.pop-genre__cards[data-layout="reversed"] > :nth-child(1) {
  grid-row: span 2;
  grid-column: 2;
}

/* strips: three full-width short rows, a list-like rhythm break */
.pop-genre__cards[data-layout="strips"] {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

/* banner: one wide card on top, two squares beneath */
.pop-genre__cards[data-layout="banner"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto;
}

.pop-genre__cards[data-layout="banner"] > :nth-child(1) {
  grid-column: span 2;
}

/* --------------------------------------------------------------------------
   Game card
   -------------------------------------------------------------------------- */
.pop-gcard {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  min-height: 11rem;
  padding: 0.8rem;
  border-radius: var(--pop-r-lg);
  overflow: hidden;
  color: var(--pop-ink);
  box-shadow: var(--pop-shadow-sm);
  isolation: isolate;
  transition:
    transform var(--pop-mid) var(--pop-spring),
    box-shadow var(--pop-mid) var(--pop-ease);
}

.pop-gcard:hover {
  transform: translateY(-5px) scale(1.012);
  box-shadow: var(--pop-shadow-lg);
}

.pop-gcard:active {
  transform: translateY(-2px) scale(1.004);
}

/* Tone fills, each with a solid fallback for forced-colours mode */
.pop-gcard[data-tone="marigold"] {
  background-color: #ffd977;
  background-image: linear-gradient(150deg, #ffe9b8, var(--pop-sun));
}

.pop-gcard[data-tone="sage"] {
  background-color: #b6eddd;
  background-image: linear-gradient(150deg, #d9f7ee, var(--pop-mint));
}

.pop-gcard[data-tone="coral"] {
  background-color: #ffc9b0;
  background-image: linear-gradient(150deg, #ffe0d2, #ffb894);
}

.pop-gcard[data-tone="pine"] {
  background-color: #cfe8fb;
  background-image: linear-gradient(150deg, #dbeafe, var(--pop-sky));
}

.pop-gcard[data-tone="lav"] {
  background-color: #e6e0ff;
  background-image: linear-gradient(150deg, #ece7ff, var(--pop-lav));
}

.pop-gcard[data-tone="pink"] {
  background-color: #ffe8f0;
  background-image: linear-gradient(150deg, #ffe8f0, var(--pop-pink));
}

/* Oversized decorative glyph bleeding off the corner */
.pop-gcard__watermark {
  position: absolute;
  top: -0.9rem;
  right: -0.9rem;
  z-index: 0;
  opacity: 0.26;
  transform: rotate(-12deg);
  pointer-events: none;
}

.pop-gcard__top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: auto;
}

.pop-gcard__glyph {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: var(--pop-r-sm);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 2px 0 rgba(32, 41, 52, 0.08);
  transition: transform var(--pop-mid) var(--pop-spring);
}

.pop-gcard:hover .pop-gcard__glyph {
  transform: rotate(-8deg) scale(1.08);
}

.pop-gcard__rating {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  padding: 0.2rem 0.45rem;
  border-radius: var(--pop-r-pill);
  background: rgba(255, 255, 255, 0.85);
  font-family: var(--pop-display);
  font-size: 0.7rem;
  font-weight: 600;
}

.pop-gcard__rating svg {
  color: var(--pop-orange-text);
}

.pop-gcard__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.pop-gcard__name {
  font-family: var(--pop-display);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.01em;
  /* Two lines reserved: card height stays constant across the font swap. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.18em);
}

.pop-gcard__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.45rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: rgba(32, 41, 52, 0.72);
}

.pop-gcard__play {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--pop-ink);
  color: var(--pop-white);
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity var(--pop-fast) var(--pop-ease),
    transform var(--pop-fast) var(--pop-spring);
}

.pop-gcard:hover .pop-gcard__play,
.pop-gcard:focus-visible .pop-gcard__play {
  opacity: 1;
  transform: scale(1);
}

/* The description is only shown on lead cards. */
.pop-gcard__desc {
  display: none;
}

/* Size variants ----------------------------------------------------------- */
.pop-gcard[data-size="lead"] {
  min-height: 17rem;
  padding: 1rem;
}

.pop-gcard[data-size="lead"] .pop-gcard__name {
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.65rem);
  line-height: 1.1;
}

.pop-gcard[data-size="lead"] .pop-gcard__glyph {
  width: 3rem;
  height: 3rem;
}

.pop-gcard[data-size="lead"] .pop-gcard__desc {
  display: block;
  max-width: 34ch;
  margin-top: 0.15rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: rgba(32, 41, 52, 0.78);
}

.pop-gcard[data-size="lead"] .pop-gcard__play {
  opacity: 1;
  transform: none;
  width: 2.6rem;
  height: 2.6rem;
}

.pop-gcard[data-size="wide"] {
  min-height: 8.25rem;
}

.pop-gcard[data-size="wide"] .pop-gcard__name {
  font-size: 1.06rem;
}

.pop-gcard[data-size="banner"] {
  min-height: 9.5rem;
}

.pop-gcard[data-size="banner"] .pop-gcard__name {
  font-size: 1.12rem;
}

/* Strip variant: horizontal composition so a strips section reads as rows */
.pop-gcard[data-size="strip"] {
  min-height: 5.5rem;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.8rem;
  padding: 0.7rem 0.9rem;
}

.pop-gcard[data-size="strip"] .pop-gcard__top {
  margin-bottom: 0;
  flex: 0 0 auto;
  align-items: center;
}

.pop-gcard[data-size="strip"] .pop-gcard__rating {
  display: none;
}

.pop-gcard[data-size="strip"] .pop-gcard__body {
  flex: 1 1 auto;
  min-width: 0;
}

.pop-gcard[data-size="strip"] .pop-gcard__name {
  font-size: 1.02rem;
}

.pop-gcard[data-size="strip"] .pop-gcard__watermark {
  top: -1.6rem;
  right: 1rem;
}

.pop-gcard[data-size="strip"] .pop-gcard__play {
  position: static;
  opacity: 1;
  transform: none;
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  background: rgba(32, 41, 52, 0.86);
}

/* Genre footer note */
.pop-genres__note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  padding-top: 1rem;
  border-top: 2px dashed var(--pop-line-strong);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--pop-ink-2);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .pop-genre {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
  }

  .pop-genre__rail {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
  }

  .pop-genre__blurb {
    flex-basis: 100%;
  }

  .pop-genre__count {
    margin-top: 0;
  }
}

@media (max-width: 720px) {
  .pop-gcard {
    min-height: 9rem;
    padding: 0.7rem;
    border-radius: var(--pop-r-md);
  }

  .pop-gcard[data-size="lead"] {
    min-height: 12.5rem;
  }

  .pop-gcard[data-size="lead"] .pop-gcard__desc {
    display: none;
  }

  .pop-gcard__glyph {
    width: 2rem;
    height: 2rem;
  }

  .pop-gcard__name {
    font-size: 0.9rem;
  }

  .pop-gcard__play {
    display: none;
  }

  .pop-gcard[data-size="lead"] .pop-gcard__play {
    display: grid;
    width: 2.3rem;
    height: 2.3rem;
  }
}

@media (max-width: 400px) {
  .pop-genre__cards[data-layout] {
    grid-template-columns: minmax(0, 1fr);
  }

  .pop-genre__cards[data-layout] > :nth-child(1) {
    grid-column: span 1;
  }
}

/* ==========================================================================
   Additional genre layouts
   --------------------------------------------------------------------------
   Three extra recipes, bringing the rotation to nine so adjacent shelves never
   repeat a composition:

     mosaic   one 2x2 lead + a wide card + tall card + 5 standards, packed
     feature  full-width hero row, then paired cards beneath
     duo      two tall columns of four, a magazine-style split

   Each recipe is written for eight cards (the shelf size) and degrades sanely
   when a shelf holds more or fewer.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Mosaic: an 2x2 anchor, one wide, one tall, then standards filling the rest
   -------------------------------------------------------------------------- */
.pop-genre__cards[data-layout="mosaic"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(0, auto);
}

/* Lead spans 2x2 */
.pop-genre__cards[data-layout="mosaic"] > :nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
}

/* Second card runs wide across the remaining two columns */
.pop-genre__cards[data-layout="mosaic"] > :nth-child(2) {
  grid-column: span 2;
}

/* Third card is tall, sitting beside the second */
.pop-genre__cards[data-layout="mosaic"] > :nth-child(3) {
  grid-row: span 2;
}

/* --------------------------------------------------------------------------
   Feature: a full-bleed hero, then a wide card, then paired standards
   -------------------------------------------------------------------------- */
.pop-genre__cards[data-layout="feature"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pop-genre__cards[data-layout="feature"] > :nth-child(1) {
  grid-column: span 2;
}

.pop-genre__cards[data-layout="feature"] > :nth-child(2) {
  grid-column: span 2;
}

/* --------------------------------------------------------------------------
   Duo: two tall columns, repeated in rows — a clean magazine spread
   -------------------------------------------------------------------------- */
.pop-genre__cards[data-layout="duo"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* --------------------------------------------------------------------------
   New card sizes
   -------------------------------------------------------------------------- */

/* Feature: the hero row of a feature layout */
.pop-gcard[data-size="feature"] {
  min-height: 13rem;
  padding: 1.05rem;
}

.pop-gcard[data-size="feature"] .pop-gcard__name {
  font-size: clamp(1.3rem, 1.08rem + 1vw, 1.8rem);
  line-height: 1.08;
}

.pop-gcard[data-size="feature"] .pop-gcard__glyph {
  width: 3.2rem;
  height: 3.2rem;
}

.pop-gcard[data-size="feature"] .pop-gcard__desc {
  display: block;
  max-width: 46ch;
  margin-top: 0.2rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(32, 41, 52, 0.78);
}

.pop-gcard[data-size="feature"] .pop-gcard__play {
  opacity: 1;
  transform: none;
  width: 2.8rem;
  height: 2.8rem;
}

/* Tall: a vertical card used by the duo and mosaic recipes */
.pop-gcard[data-size="tall"] {
  min-height: 19rem;
}

.pop-gcard[data-size="tall"] .pop-gcard__name {
  font-size: 1.14rem;
}

.pop-gcard[data-size="tall"] .pop-gcard__glyph {
  width: 2.6rem;
  height: 2.6rem;
}

/* Mosaic's lead gets a slightly different aspect from the spotlight lead */
.pop-genre__cards[data-layout="mosaic"] .pop-gcard[data-size="lead"] {
  min-height: 21rem;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  /* Mosaic drops to three columns: lead still anchors the block. */
  .pop-genre__cards[data-layout="mosaic"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pop-genre__cards[data-layout="mosaic"] > :nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
  }

  .pop-genre__cards[data-layout="mosaic"] > :nth-child(2) {
    grid-column: span 1;
  }

  .pop-genre__cards[data-layout="mosaic"] > :nth-child(3) {
    grid-row: span 1;
  }
}

@media (max-width: 720px) {
  /* All recipes collapse to the same predictable two-up rhythm on phones; the
     lead keeps the full row in every case for a single clear focal point. */
  .pop-genre__cards[data-layout] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }

  .pop-genre__cards[data-layout] > :nth-child(1) {
    grid-column: span 2;
    grid-row: auto;
  }

  .pop-genre__cards[data-layout] > :nth-child(2),
  .pop-genre__cards[data-layout="feature"] > :nth-child(2) {
    grid-column: span 2;
    grid-row: auto;
  }

  .pop-gcard[data-size="feature"],
  .pop-gcard[data-size="tall"] {
    min-height: 10rem;
  }

  .pop-gcard[data-size="tall"] .pop-gcard__name {
    font-size: 0.92rem;
  }

  .pop-gcard[data-size="feature"] .pop-gcard__desc {
    display: none;
  }

  .pop-genre__cards[data-layout="mosaic"] .pop-gcard[data-size="lead"] {
    min-height: 12.5rem;
  }
}

@media (max-width: 400px) {
  .pop-genre__cards[data-layout] {
    grid-template-columns: minmax(0, 1fr);
  }

  .pop-genre__cards[data-layout] > :nth-child(1),
  .pop-genre__cards[data-layout] > :nth-child(2) {
    grid-column: span 1;
  }
}
/* --------------------------------------------------------------------------
   Cover-art cards
   --------------------------------------------------------------------------
   Cards carry a real cover image when the catalogue provides one, with the tone
   gradient and procedural glyph underneath as a guaranteed backdrop. The scrim
   is painted on every art card, so the white title stays readable over the
   photograph *and* over the gradient when the image is unavailable.
   -------------------------------------------------------------------------- */
.pop-gcard--art {
  color: var(--pop-white);
}

.pop-gcard__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
}

.pop-gcard__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--pop-mid) var(--pop-ease);
}

.pop-gcard--art:hover .pop-gcard__bg img {
  transform: scale(1.06);
}

/* Painted over both the gradient and the photo, so contrast never depends on
   whether the cover downloaded. */
.pop-gcard--art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(24, 31, 40, 0.34) 0%,
    rgba(24, 31, 40, 0.58) 45%,
    rgba(24, 31, 40, 0.88) 100%
  );
  pointer-events: none;
}

/* The glyph underlay stays visible above the gradient but below the scrim, so
   an entry with no artwork still reads as a designed tile. */
.pop-gcard--art .pop-gcard__watermark {
  z-index: 0;
  opacity: 0.3;
}

.pop-gcard--art .pop-gcard__top,
.pop-gcard--art .pop-gcard__body,
.pop-gcard--art .pop-gcard__play {
  z-index: 3;
}

.pop-gcard--art .pop-gcard__glyph {
  background: rgba(255, 255, 255, 0.9);
}

.pop-gcard--art .pop-gcard__rating {
  background: rgba(255, 255, 255, 0.94);
  color: var(--pop-ink);
}

.pop-gcard--art .pop-gcard__name {
  color: var(--pop-white);
  text-shadow: 0 1px 3px rgba(12, 17, 24, 0.55);
}

.pop-gcard--art .pop-gcard__meta,
.pop-gcard--art .pop-gcard__desc {
  color: rgba(255, 255, 255, 0.9);
}

.pop-gcard--art .pop-gcard__play {
  background: rgba(255, 255, 255, 0.95);
  color: var(--pop-ink);
  opacity: 1;
  transform: none;
}
