/* Playful World — page shell: header, hero, sections, footer, overlays */

/* ============ Header ============ */
/* Static, not sticky: the navigation scrolls away with the page. */
.pw-header {
  position: relative;
  z-index: 80;
  background: var(--pw-bg);
  border-bottom: 1px solid rgba(240, 234, 224, 0.85);
}

.pw-header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--pw-header-h);
}

.pw-header__nav {
  display: none;
  align-items: center;
  gap: 2px;
  margin-inline: auto;
}

.pw-header__link {
  position: relative;
  padding: 9px 14px;
  border-radius: var(--pw-r-pill);
  color: var(--pw-ink-soft);
  font-family: var(--pw-font-body);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--pw-dur) var(--pw-ease), background-color var(--pw-dur) var(--pw-ease);
}

.pw-header__link:hover {
  color: var(--pw-ink);
  background: rgba(255, 255, 255, 0.85);
}

.pw-header__link.is-active {
  color: var(--pw-pink-ink);
  background: var(--pw-pink-soft);
}

.pw-header__search {
  display: none;
  flex: 0 0 auto;
}

.pw-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Under 480px the header keeps Logo + Search + Menu; saved games live in the
   drawer so three 44px targets never crowd a 320px viewport. */
@media (max-width: 479px) {
  .pw-header__actions #pw-fav-toggle {
    display: none;
  }

  .pw-header__inner {
    gap: 8px;
  }
}

@media (min-width: 1024px) {
  .pw-header__nav {
    display: flex;
  }

  .pw-header__actions {
    margin-left: 0;
  }

  /* Desktop navigation is always visible, so the drawer trigger is redundant.
     Specificity has to beat .pw-icon-btn in components.css. */
  .pw-header .pw-icon-btn--menu-mobile {
    display: none;
  }
}

@media (min-width: 1200px) {
  .pw-header__search {
    display: flex;
  }
}

/* Brand */
.pw-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.pw-brand__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--pw-pink) 0%, #FF7F9E 60%, var(--pw-orange) 100%);
  box-shadow: 0 6px 14px rgba(255, 139, 167, 0.35);
  color: #fff;
  flex-shrink: 0;
}

.pw-brand__mark svg {
  width: 24px;
  height: 24px;
}

.pw-brand__star {
  position: absolute;
  top: -4px;
  right: -5px;
  width: 15px;
  height: 15px;
  color: var(--pw-yellow);
  filter: drop-shadow(0 1px 2px rgba(38, 50, 56, 0.15));
}

.pw-brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pw-brand__name {
  font-family: var(--pw-font-display);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pw-brand__tag {
  font-family: var(--pw-font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pw-muted);
  line-height: 1.2;
}

@media (max-width: 359px) {
  .pw-brand__tag {
    display: none;
  }
}

/* ============ Hero ============ */
.pw-hero {
  position: relative;
  padding: 22px 0 10px;
  overflow: clip;
}

.pw-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.pw-hero__copy {
  min-width: 0;
}

.pw-hero__title {
  margin: 14px 0 0;
  font-size: clamp(2.15rem, 9vw, 3rem);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.035em;
  max-width: 13ch;
}

.pw-hero__title .pw-accent {
  position: relative;
  display: inline-block;
  color: var(--pw-pink-deep);
  white-space: nowrap;
}

.pw-hero__underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.16em;
  width: 100%;
  height: 0.22em;
  color: var(--pw-yellow);
}

.pw-hero__lede {
  margin-top: 16px;
  max-width: 46ch;
  color: var(--pw-muted-strong);
  font-size: 1rem;
  line-height: 1.65;
}

.pw-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.pw-hero__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 22px;
  padding: 0;
  list-style: none;
  color: var(--pw-muted);
  font-size: 12.5px;
  font-weight: 500;
}

.pw-hero__stats li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.pw-hero__stats strong {
  color: var(--pw-ink);
  font-family: var(--pw-font-ui);
  font-weight: 600;
}

.pw-hero__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #D9CFC0;
  flex-shrink: 0;
}

/* Hero art cluster */
.pw-hero__art {
  position: relative;
  height: clamp(250px, 64vw, 300px);
  margin-inline: auto;
  width: 100%;
  max-width: 520px;
}

.pw-hero__canvas {
  position: absolute;
  inset: 0;
  border-radius: 30px;
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 209, 102, 0.55) 0%, rgba(255, 209, 102, 0) 42%),
    radial-gradient(circle at 18% 82%, rgba(116, 185, 255, 0.4) 0%, rgba(116, 185, 255, 0) 46%),
    linear-gradient(160deg, #FFF3DF 0%, #FFE9EE 58%, #F3ECFF 100%);
  border: 1px solid #F6E7DA;
  overflow: hidden;
}

.pw-hero__canvas::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 22px;
  border: 1.5px dashed rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.pw-hero__tile {
  position: absolute;
  border-radius: 16px;
  background: #fff;
  padding: 5px;
  box-shadow: 0 14px 30px rgba(38, 50, 56, 0.16);
  overflow: hidden;
}

.pw-hero__tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.pw-hero__tile--a {
  top: 9%;
  left: 6%;
  width: 46%;
  aspect-ratio: 3 / 4;
  transform: rotate(-5deg);
  z-index: 2;
}

.pw-hero__tile--b {
  top: 17%;
  right: 5%;
  width: 42%;
  aspect-ratio: 3 / 4;
  transform: rotate(4deg);
  z-index: 3;
}

.pw-hero__tile--c {
  bottom: 7%;
  left: 30%;
  width: 34%;
  aspect-ratio: 3 / 4;
  transform: rotate(-2deg);
  z-index: 4;
}

.pw-hero__chip {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: var(--pw-r-pill);
  background: #fff;
  box-shadow: var(--pw-shadow-2);
  font-family: var(--pw-font-ui);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pw-ink);
  white-space: nowrap;
}

.pw-hero__chip--play {
  top: 7%;
  right: 34%;
}

.pw-hero__chip--live {
  bottom: 15%;
  right: 4%;
}

.pw-hero__chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pw-green);
  box-shadow: 0 0 0 3px var(--pw-green-soft);
}

.pw-hero__play-dot {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--pw-pink);
  color: #fff;
}

.pw-hero__play-dot svg {
  width: 10px;
  height: 10px;
  margin-left: 1px;
}

.pw-hero__spark {
  position: absolute;
  z-index: 5;
  color: var(--pw-yellow);
}

.pw-hero__spark--1 {
  top: 4%;
  left: 52%;
  width: 24px;
  height: 24px;
}

.pw-hero__spark--2 {
  bottom: 30%;
  left: 3%;
  width: 17px;
  height: 17px;
  color: var(--pw-pink);
}

.pw-hero__spark--3 {
  top: 46%;
  right: 1%;
  width: 14px;
  height: 14px;
  color: var(--pw-blue);
}

@media (min-width: 900px) {
  .pw-hero {
    padding: 30px 0 16px;
  }

  .pw-hero__grid {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    gap: 40px;
  }

  .pw-hero__title {
    font-size: clamp(2.8rem, 4.4vw, 4.1rem);
    max-width: 12ch;
  }

  .pw-hero__lede {
    font-size: 1.05rem;
    margin-top: 20px;
  }

  .pw-hero__art {
    height: clamp(330px, 32vw, 420px);
  }
}

/* ============ Section scaffolding ============ */
.pw-section {
  padding: 26px 0;
  /* The header scrolls away, so anchored sections only need a small gap. */
  scroll-margin-top: 12px;
}

.pw-section--tight {
  padding-top: 6px;
}

.pw-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.pw-section__titles {
  min-width: 0;
}

.pw-section__title {
  font-size: clamp(1.4rem, 4.4vw, 1.95rem);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.pw-section__sub {
  margin-top: 5px;
  color: var(--pw-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.pw-section__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 12px;
  margin-bottom: 2px;
  border-radius: var(--pw-r-pill);
  color: var(--pw-ink-soft);
  font-family: var(--pw-font-body);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--pw-dur) var(--pw-ease), color var(--pw-dur) var(--pw-ease);
}

.pw-section__more svg {
  width: 15px;
  height: 15px;
  transition: transform var(--pw-dur) var(--pw-ease);
}

.pw-section__more:hover {
  background: #fff;
  color: var(--pw-pink-ink);
}

.pw-section__more:hover svg {
  transform: translateX(2px);
}

@media (min-width: 720px) {
  .pw-section {
    padding: 34px 0;
  }

  .pw-section__head {
    margin-bottom: 20px;
  }
}

/* ============ Footer ============ */
.pw-footer {
  margin-top: 26px;
  padding: 30px 0 26px;
  background: var(--pw-surface-warm);
  border-top: 1px solid var(--pw-border);
}

.pw-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.pw-footer__brandline {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pw-footer__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--pw-pink) 0%, var(--pw-orange) 100%);
  color: #fff;
  flex-shrink: 0;
}

.pw-footer__mark svg {
  width: 21px;
  height: 21px;
}

.pw-footer__name {
  font-family: var(--pw-font-display);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.pw-footer__tag {
  color: var(--pw-muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.pw-footer__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 4px;
}

.pw-footer__nav a {
  padding: 8px 11px;
  border-radius: 10px;
  color: var(--pw-muted-strong);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color var(--pw-dur) var(--pw-ease), color var(--pw-dur) var(--pw-ease);
}

.pw-footer__nav a:hover {
  background: #fff;
  color: var(--pw-ink);
}

.pw-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--pw-border);
  color: #94A0A8;
  font-size: 12px;
  line-height: 1.5;
}

/* ============ Mobile drawer ============ */
.pw-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(38, 50, 56, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--pw-dur) var(--pw-ease);
}

.pw-drawer-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.pw-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 160;
  display: flex;
  flex-direction: column;
  width: min(330px, 88vw);
  padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
  background: var(--pw-bg);
  box-shadow: -18px 0 40px rgba(38, 50, 56, 0.14);
  transform: translateX(103%);
  transition: transform 260ms var(--pw-ease);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pw-drawer.is-open {
  transform: translateX(0);
}

.pw-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.pw-drawer__label {
  margin: 18px 0 8px;
  padding-left: 4px;
  color: var(--pw-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.pw-drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--pw-ink);
  font-family: var(--pw-font-body);
  font-size: 15px;
  font-weight: 600;
  transition: background-color var(--pw-dur) var(--pw-ease);
}

.pw-drawer__link:hover,
.pw-drawer__link.is-active {
  background: #fff;
}

.pw-drawer__link.is-active {
  color: var(--pw-pink-ink);
}

.pw-drawer__link svg {
  width: 17px;
  height: 17px;
  color: var(--pw-muted);
  flex-shrink: 0;
}

.pw-drawer__cta {
  margin-top: 18px;
}

@media (min-width: 1024px) {
  .pw-drawer,
  .pw-drawer-backdrop {
    display: none;
  }
}

/* ============ Search overlay (mobile + desktop panel) ============ */
.pw-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--pw-bg);
}

.pw-search-overlay__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px var(--pw-gutter);
  border-bottom: 1px solid var(--pw-border);
  background: #fff;
}

.pw-search-overlay__body {
  flex: 1;
  padding: 18px var(--pw-gutter) 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pw-search-results__count {
  margin: 0 0 14px;
  color: var(--pw-muted);
  font-size: 13px;
}

.pw-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: min(420px, 84vw);
  max-height: min(64vh, 520px);
  overflow-y: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--pw-border);
  border-radius: 18px;
  box-shadow: var(--pw-shadow-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--pw-dur) var(--pw-ease), transform var(--pw-dur) var(--pw-ease),
    visibility var(--pw-dur) var(--pw-ease);
}

.pw-search-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ============ Static pages ============ */
.pw-page {
  padding: 26px 0 40px;
}

.pw-page__head {
  max-width: 720px;
  margin-bottom: 24px;
}

.pw-page__title {
  margin-top: 10px;
  font-size: clamp(1.9rem, 5.4vw, 2.7rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.pw-page__lede {
  margin-top: 12px;
  color: var(--pw-muted-strong);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 62ch;
}

.pw-prose {
  max-width: 760px;
  color: var(--pw-ink-soft);
  font-size: 15.5px;
  line-height: 1.75;
}

.pw-prose h2 {
  margin: 30px 0 10px;
  font-size: 1.3rem;
  font-weight: 800;
}

.pw-prose h3 {
  margin: 22px 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
}

.pw-prose p,
.pw-prose ul,
.pw-prose ol {
  margin: 0 0 14px;
}

.pw-prose ul,
.pw-prose ol {
  padding-left: 22px;
}

.pw-prose li {
  margin-bottom: 7px;
}

.pw-prose a {
  color: var(--pw-pink-ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #FFC9D6;
  text-underline-offset: 2px;
}

.pw-prose strong {
  color: var(--pw-ink);
}

.pw-prose__note {
  padding: 14px 16px;
  border-radius: var(--pw-r-md);
  background: var(--pw-yellow-soft);
  color: #7A5A00;
  font-size: 14px;
}

/* ============ Play page ============ */
.pw-play {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: #11161A;
}

.pw-play__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #1B2228;
  color: #fff;
}

.pw-play__title {
  min-width: 0;
  font-family: var(--pw-font-ui);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pw-play__frame-wrap {
  flex: 1;
  min-height: 0;
}

.pw-play__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.pw-play__status {
  display: grid;
  place-items: center;
  height: 100%;
  color: #C6D2DA;
  font-size: 14px;
  text-align: center;
  padding: 24px;
}

/* Hero tile layer sits under the floating chips */
.pw-hero__tiles {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.pw-hero__chip,
.pw-hero__spark {
  z-index: 5;
}

/* ============ Advertisement slots ============ */
/* Height follows the injected ad creative; nothing reserves space when the
   slot is empty, so an unsold impression leaves no gap in the page. */
.pw-ad-slot {
  width: min(calc(100% - var(--pw-gutter) * 2), var(--pw-container));
  margin: 22px auto;
  min-width: 0;
}

.pw-ad-slot__unit {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  overflow: hidden;
  line-height: 0;
}

.pw-ad-slot__unit > [id^="div-gpt-ad"],
.pw-ad-slot__unit > ins.adsbygoogle,
.pw-ad-slot__unit > div[id$="__container__"] {
  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;
}

.pw-ad-slot__unit iframe[id^="google_ads_iframe"] {
  display: block;
  max-width: 100%;
  margin-inline: auto;
  vertical-align: top;
}

@media (min-width: 720px) {
  .pw-ad-slot {
    margin: 28px auto;
  }
}

/* An empty slot (no template substitution yet) should not create a gap. */
.pw-ad-slot__unit:empty {
  display: none;
}

/* Inside a .pw-shell the slot is already constrained by its parent, so drop the
   page-level width and margins. */
.pw-detail .pw-ad-slot,
.pw-page .pw-ad-slot {
  width: 100%;
  margin: 18px auto;
}

/* ============ Ad slot placeholder ============ */
/* Visible only while the slot is unsold / before the template injects a
   creative. The real ad arrives as a sibling inside .pw-ad-slot__unit, which
   hides the placeholder via :has(); browsers without :has() fall back to the
   hide rule in app-style JS-free ordering below. */
.pw-ad-slot__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 100px;
  margin: 0;
  border: 2px dashed #E2D3C0;
  border-radius: var(--pw-r-md);
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 246, 229, 0.9) 0 10px,
    rgba(255, 255, 255, 0.9) 10px 20px
  );
  color: #9A8B78;
  font-family: var(--pw-font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.4;
  padding: 10px 14px;
}

/* Once a real creative renders inside the unit, the placeholder steps aside.
   :empty cannot be used here because Velocity leaves whitespace behind. */
.pw-ad-slot__unit:has(iframe, ins, [id^="div-gpt-ad"], div[id$="__container__"])
  ~ .pw-ad-slot__placeholder,
.pw-ad-slot--filled .pw-ad-slot__placeholder {
  display: none;
}

@media (min-width: 720px) {
  .pw-ad-slot__placeholder {
    min-height: 120px;
    font-size: 13px;
  }
}

/* ============ In-hero ad slot ============ */
/* Lives inside the hero copy block, between the CTAs and the stats line, so the
   first impression is fully on screen even on a 375x667 phone. */
.pw-ad-slot--hero {
  width: 100%;
  margin: 16px auto 4px;
}

.pw-ad-slot--hero .pw-ad-slot__placeholder {
  min-height: 90px;
}

@media (min-width: 900px) {
  .pw-ad-slot--hero {
    margin: 20px auto 6px;
  }
}
