/* ============================================================
   Play & Pricing — page-specific styles
   Builds on the shared kit in styles.css (v4 tokens + components).
   Mobile-first. All motion silenced under prefers-reduced-motion.
   ============================================================ */

/* Pastel ribbon colour for the flowing section dividers (playful mix) */
:root {
  --flow-accent: linear-gradient(90deg, var(--coral) 0%, var(--sky) 40%, var(--sage) 70%, var(--sun) 100%);
  /* section-rhythm washes — play's cool sky leading into a warm sun beat */
  --wash-1: #e1f2f8;  /* pale sky */
  --wash-2: #fdf1d0;  /* pale sun */
}

/* ---------- Hero: same recipe as Fusion — a single signature tile (toy
     blocks) repeated over a cool sky-blue gradient, with the wide Main Street
     beside the copy. Each interior hero shares this fusion skeleton but
     carries its own colour + bg motif. ---------- */
.page-hero.ph--play {
  background:
    url("../../img/play-tile-v3.svg") center / 132px repeat,
    linear-gradient(180deg, #C5E2EC 0%, #DCEDF2 58%, var(--base) 100%);
  padding-bottom: clamp(5.5rem, 4vw + 4rem, 7.5rem);
}
.ph--play .container {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
@media (min-width: 760px) {
  .ph--play .container { grid-template-columns: 1fr auto; }
  .ph--play .stat-strip { grid-column: 1 / -1; }
}
.ph--play .hero-art { max-width: 540px; }
.ph--play .hero-art img { width: 100%; height: auto; display: block; }
/* Sky-blue partner-tag eyebrow */
.ph--play .partner-tag {
  background: rgba(255,255,255,0.85);
  color: #1e5a72;
  border: 1px solid rgba(63,114,148,0.22);
}
/* ---------- Hero accent: sticker on the art ---------- */
.ph--play .hero-sticker-wrap {
  position: relative;
  display: inline-block;
}
.ph--play .hero-sticker-badge {
  position: absolute;
  top: 1.1rem;
  right: -0.6rem;
  z-index: 3;
  transform: rotate(6deg);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 0.5rem 0.85rem;
  background: var(--sun);
  color: #5a3d12;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  pointer-events: none;
}
@media (max-width: 700px) {
  .ph--play .hero-sticker-badge { font-size: 0.7rem; padding: 0.4rem 0.7rem; right: 0; }
}

/* ---------- Stat pill strip ---------- */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin: 1.8rem auto 0;
  max-width: 680px;
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1.5px solid rgba(79, 176, 208, 0.25);
  border-radius: var(--r-pill);
  padding: 0.5rem 1rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(4px);
}
.stat-pill .sp-icon {
  font-size: 1rem;
  line-height: 1;
}

/* ---------- Storefronts: Main Street cards ---------- */
.storefront-grid {
  display: grid;
  gap: clamp(1.1rem, 2.5vw, 1.8rem);
  grid-template-columns: 1fr;
  margin-top: clamp(1.8rem, 4vw, 2.8rem);
}
@media (min-width: 720px) {
  .storefront-grid { grid-template-columns: repeat(3, 1fr); }
}

.storefront-card {
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(80, 60, 30, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease;
}
/* Transform is owned by JS-driven .tilt-3d (mouse-follow 3D); we only lift the shadow on hover. */
.storefront-card:hover { box-shadow: var(--shadow-md); }

/* Coloured top band */
.storefront-cap {
  height: 10px;
  border-radius: 0;
  flex: none;
}
.storefront-card--grocery .storefront-cap  { background: var(--sage); }
.storefront-card--cafe    .storefront-cap  { background: var(--coral); }
.storefront-card--clinic  .storefront-cap  { background: var(--teal); }

.storefront-art {
  background: var(--base);
  display: grid;
  place-items: center;
  padding: 1.2rem 1rem 0.8rem;
  position: relative;
}
.storefront-art img,
.storefront-art svg {
  max-height: 180px;
  width: auto;
  max-width: 100%;
  height: auto;
}

/* Per-card art tints */
.storefront-card--grocery .storefront-art { background: var(--sage-tint); }
.storefront-card--cafe    .storefront-art { background: var(--coral-tint); }
.storefront-card--clinic  .storefront-art { background: var(--teal-tint); }

/* Floating corner sticker on each card */
.storefront-sticker {
  position: absolute;
  top: 0.65rem;
  right: 0.7rem;
  font-size: 0.72rem;
  font-family: var(--font-head);
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.02em;
  pointer-events: none;
}
.storefront-card--grocery .storefront-sticker { background: var(--sage); color: #243016; transform: rotate(-4deg); }
.storefront-card--cafe    .storefront-sticker { background: var(--coral); color: #6a2f15; transform: rotate(3deg); }
.storefront-card--clinic  .storefront-sticker { background: var(--teal); color: #08323d; transform: rotate(-3deg); }

.storefront-body {
  padding: clamp(1rem, 2.5vw, 1.4rem);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.storefront-body h3 { margin-bottom: 0.3rem; }
.storefront-body p  { margin-bottom: 0; color: var(--ink-soft); font-size: 0.97rem; flex: 1; }

/* Touch feedback */
@media (hover: none) {
  .storefront-card:active { transform: scale(1.015) !important; box-shadow: var(--shadow-md); }
}

/* ---------- "How it works" steps section ---------- */
.how-section { padding-block: clamp(2.8rem, 6vw, var(--space-6)); }

.steps-grid {
  display: grid;
  gap: clamp(1.4rem, 3vw, 2rem);
  grid-template-columns: 1fr;
  margin-top: clamp(1.8rem, 4vw, 2.8rem);
  counter-reset: play-step;
}
@media (min-width: 640px) {
  .steps-grid { grid-template-columns: repeat(3, 1fr); }
}

.play-step {
  text-align: center;
  padding: clamp(1.2rem, 2.5vw, 1.8rem);
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(80, 60, 30, 0.05);
}

.play-step-no {
  counter-increment: play-step;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 0.9rem;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.play-step-no::before { content: counter(play-step); }

.play-step:nth-child(1) .play-step-no { background: var(--coral); }
.play-step:nth-child(2) .play-step-no { background: var(--sky); }
.play-step:nth-child(3) .play-step-no { background: var(--sage); }

.play-step-emoji {
  display: block;
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}
.play-step h3 { font-size: 1.08rem; margin-bottom: 0.3rem; }
.play-step p  { font-size: 0.93rem; color: var(--ink-soft); margin-bottom: 0; }

/* ---------- Kids showcase ---------- */
.showcase-frame {
  position: relative;
  max-width: 820px;
  margin: 2rem auto 0;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--sky-tint);
}
.showcase-frame img,
.showcase-frame svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--r-xl);
}
/* Sticker overlaid on the frame */
.showcase-badge {
  position: absolute;
  bottom: 1.2rem;
  right: 1.2rem;
  background: var(--sun);
  color: #5a3d12;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
  transform: rotate(-2deg);
  pointer-events: none;
}
@media (max-width: 500px) {
  .showcase-badge { font-size: 0.73rem; padding: 0.4rem 0.8rem; bottom: 0.7rem; right: 0.7rem; }
}

/* ---------- Pricing section ---------- */
.pricing-section { padding-block: clamp(3rem, 7vw, var(--space-7)); }

.price-cards-wrap {
  display: grid;
  gap: clamp(1.1rem, 2.5vw, 2rem);
  grid-template-columns: 1fr;
  max-width: 780px;
  margin: 2.2rem auto 0;
}
@media (min-width: 640px) {
  .price-cards-wrap { grid-template-columns: 1fr 1fr; }
}

/* Bold price cards */
.pp-price-card {
  position: relative;
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  border: 2px solid rgba(80, 60, 30, 0.07);
  padding: clamp(1.4rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s ease;
}
.pp-price-card:hover { transform: translateY(-8px) scale(1.015); box-shadow: var(--shadow-lg); }

/* Featured card gets a vivid gradient top border */
.pp-price-card.featured {
  border-color: var(--sun);
  box-shadow: 0 0 0 3px var(--sun), var(--shadow-md);
}

.pp-card-art {
  background: var(--base);
  border-radius: var(--r-lg);
  padding: 1.1rem;
  margin-bottom: 1.1rem;
  display: grid;
  place-items: center;
}
.pp-card-art img { max-height: 130px; width: auto; max-width: 100%; }

.pp-price-tag {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 2.8rem);
  color: var(--accent);
  margin: 0.2rem 0 0.15rem;
  line-height: 1;
}
.pp-price-tag small {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.pp-price-list {
  list-style: none;
  margin: 1rem 0 1.5rem;
  padding: 0;
  text-align: left;
}
.pp-price-list li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.45rem 0;
  color: var(--ink-soft);
  font-size: 0.97rem;
  border-bottom: 1px solid rgba(80, 60, 30, 0.06);
}
.pp-price-list li:last-child { border-bottom: none; }
.pp-price-list li::before {
  content: "";
  flex: none;
  margin-top: 0.38rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sage-tint);
  box-shadow: inset 0 0 0 3px var(--sage);
}
.pp-price-card.featured .pp-price-list li::before {
  background: var(--sun-tint);
  box-shadow: inset 0 0 0 3px var(--sun);
}

.pp-price-card .btn { margin-top: auto; }

/* "Best value" sticker above the featured card */
.pp-sticker {
  position: absolute;
  top: -1rem;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  background: var(--sun);
  color: #5a3d12;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 0.4rem 1rem;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  z-index: 2;
}

/* Touch */
@media (hover: none) {
  .pp-price-card:active { transform: translateY(-4px) scale(1.012); box-shadow: var(--shadow-md); }
}

/* ---------- Member cross-link band ---------- */
.member-xlink {
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-top: clamp(2rem, 4vw, 3rem);
  position: relative;
}
.member-xlink-inner {
  padding: clamp(1.8rem, 4vw, 3rem) clamp(1.4rem, 3vw, 2.5rem);
  text-align: center;
  position: relative;
  z-index: 1;
}
/* Soft blob accents */
.member-xlink::before {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  right: -50px;
  top: -80px;
  background: rgba(255,255,255,0.18);
  border-radius: 46% 54% 58% 42% / 52% 44% 56% 48%;
  z-index: 0;
}
.member-xlink::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  left: -40px;
  bottom: -60px;
  background: rgba(255,255,255,0.13);
  border-radius: 54% 46% 40% 60% / 46% 56% 44% 54%;
  z-index: 0;
}
.member-xlink-inner h2 { margin-bottom: 0.5rem; }

/* ---------- Policy strips: friendlier ---------- */
.policy-row {
  display: grid;
  gap: clamp(1.1rem, 2.5vw, 1.8rem);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: clamp(1.4rem, 3vw, 2rem);
}

.pp-policy {
  border-radius: var(--r-xl);
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1.5px dashed rgba(140, 100, 40, 0.28);
  background: var(--wood-tint);
}
.pp-policy.pp-policy--teal {
  background: var(--teal-tint);
  border-color: rgba(127, 168, 160, 0.4);
}
.pp-policy.pp-policy--sage {
  background: var(--sage-tint);
  border-color: rgba(143, 178, 130, 0.4);
}

.pp-policy-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}
.pp-policy-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  background: var(--white);
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: var(--shadow-sm);
}
.pp-policy-icon svg { width: 22px; height: 22px; }
.pp-policy h3 {
  margin: 0;
  font-size: 1.08rem;
  color: var(--accent);
}
.pp-policy--teal h3 { color: var(--accent-teal); }
.pp-policy--sage h3 { color: var(--accent-sage); }

.pp-policy ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pp-policy ul li {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.38rem 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.pp-policy ul li::before {
  content: "";
  flex: none;
  margin-top: 0.42rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wood);
}
.pp-policy--teal ul li::before {
  background: var(--teal);
}
.pp-policy--sage ul li::before {
  background: var(--sage);
}

/* ---------- Reduced motion overrides ---------- */
@media (prefers-reduced-motion: reduce) {
  .storefront-card,
  .storefront-card:nth-child(odd),
  .storefront-card:nth-child(even),
  .pp-price-card,
  .play-step { transform: none !important; }

  .showcase-badge { transform: none !important; }
  .pp-sticker      { transform: translateX(-50%) !important; }
  .storefront-sticker { transform: none !important; }
  .ph--play .hero-sticker-badge { transform: none !important; }
}
/* (Inside-the-town glimpse styles live in shared styles.css so they work
   on both index and play-pricing.) */

/* ============================================================
   Play & Pricing — mobile refinement layer
   All rules are gated behind max-width queries; desktop is
   completely untouched. Build on top of the site-wide v13 layer
   in styles.css — never fight it.
   ============================================================ */

/* ---------- Hero: narrow-phone tightening ---------- */
@media (max-width: 760px) {
  /* Hide the hero art on phones — the logo image (currently a town
     mark placeholder) is redundant below the copy and wastes 30%+
     of the viewport. The stat-pill strip tells the story instead. */
  .ph--play .hero-art { display: none; }

  /* Give the copy a little more breathing room without the art. */
  .ph--play .container { gap: 1rem; }
}

@media (max-width: 480px) {
  /* Stat pills: tighten gap + slightly smaller type so all five pills
     wrap into a comfortable 2–3 line cluster rather than sprawling. */
  .stat-strip { gap: 0.45rem; margin-top: 1.2rem; }
  .stat-pill {
    font-size: 0.8rem;
    padding: 0.42rem 0.75rem;
    gap: 0.35rem;
  }
  .stat-pill .sp-icon img { width: 15px; height: 15px; }
}

/* ---------- Pricing cards: tighter fit + safe sticker at 320px ---------- */
@media (max-width: 600px) {
  /* Lift the card container padding so the rotated card shadow
     can't bleed outside the screen edge. */
  .pricing-section .cp-grid { padding-inline: 0.5rem; }

  /* .cp-cta — confirm 44px touch target (styles.css doesn't set min-height) */
  .cp-cta { min-height: 44px; }
}

@media (max-width: 400px) {
  /* At the very narrowest widths (320–400px) the ±1deg card rotation
     combined with the 7px offset shadow nudges a sliver past the
     viewport edge. Zero it out here — the cards still look great flat.
     Scoped to play-pricing via .pricing-section which only exists here. */
  .pricing-section .cp-grid--2 .cp-card:nth-child(1),
  .pricing-section .cp-grid--2 .cp-card:nth-child(2) { transform: none; }

  /* Make the feature list items a touch more spacious to read on small
     screens — the default 0.45rem padding is a bit tight finger-counting. */
  .cp-list li { padding-block: 0.5rem; font-size: 0.92rem; }
  .cp-price-amount { font-size: clamp(2rem, 10vw, 2.6rem); }
}

/* ---------- Policy grid: force single-column below 500px ----------
   The global auto-fit minmax(260px, 1fr) snaps to a single column
   at ~260px — but between 260 and 500px it can try to squeeze two
   260px columns into ~320px of viewport, causing overflow.  */
@media (max-width: 500px) {
  .policy-row { grid-template-columns: 1fr; }
}

/* ---------- Storefront cards: comfortable art height on phones ---------- */
@media (max-width: 480px) {
  /* Cap the logo art area so the grocery (tallest image) doesn't push
     the card body too far down. Keeps all three cards uniform height. */
  .storefront-art img,
  .storefront-art svg { max-height: 130px; }

  /* Tighten the art padding to reclaim vertical space. */
  .storefront-art { padding: 0.9rem 0.8rem 0.6rem; }

  /* Sticker: pull back any negative right offset to stay in-bounds. */
  .storefront-sticker { right: 0.45rem; top: 0.45rem; }
}

/* ---------- Photo glimpse strip: caption legibility at 2-up ---------- */
@media (max-width: 480px) {
  /* The 2-up grid is already set by styles.css; just ensure the gradient
     caption has enough height to be readable without overlapping the image. */
  .pp-glimpse-tile figcaption {
    padding: 1rem 0.5rem 0.55rem;
    font-size: 0.82rem;
  }
}

/* ---------- Showcase frame badge: stay in-bounds on tiny screens ---------- */
@media (max-width: 360px) {
  .showcase-badge { right: 0.4rem; bottom: 0.4rem; }
}

/* ---------- Member cross-link band: comfortable padding on phones ---------- */
@media (max-width: 480px) {
  .member-xlink-inner { padding: 1.5rem 1rem; }
}

/* ---------- Reduced-motion: mobile additions ---------- */
@media (prefers-reduced-motion: reduce) {
  /* The additions above that use transform: none for narrow screens
     are already transform-free by definition; nothing extra needed. */
}
