/* =====================================================================
   Patshi — TilePlayground styles
   ---------------------------------------------------------------------
   A transparent interaction ZONE in the hero (not a component). Nine
   product tiles float over the hero background and can be dragged; a very
   soft radial gradient hints the boundary without drawing a box. A quiet
   animated "P" mascot sits bottom-right.

   Physics + drag live in scripts/tile-playground.js. Brand tokens come from
   styles.css (:root vars). Motion is GPU-friendly (transform/opacity only)
   and calmed/disabled under prefers-reduced-motion and body.no-motion.
   ===================================================================== */

:root {
  /* zone geometry — JS reads --tile-size so CSS is the single source of truth */
  --tp-h: 640px;             /* interaction-zone height (drag + fall area) */
  --tile-size: 124px;        /* rounded-square tile edge */

  /* Nine DISTINCT tile colours — no two families sit close on the wheel.
     a = light face, b = deep base (used for the 3D bottom edge + icon tint). */
  --tint-blue-a:   #4d8cff;  --tint-blue-b:   #2f5fd8;   /* Electronics */
  --tint-pink-a:   #ff5f9e;  --tint-pink-b:   #d83574;   /* Skincare    */
  --tint-amber-a:  #ffab3d;  --tint-amber-b:  #ef7d1a;   /* Footwear    */
  --tint-purple-a: #a06bff;  --tint-purple-b: #6f3fd6;   /* Apparel     */
  --tint-green-a:  #3ecf7e;  --tint-green-b:  #1fa35c;   /* Home        */
  --tint-red-a:    #ff6d5a;  --tint-red-b:    #e0402e;   /* Fitness     */
  --tint-teal-a:   #2fd6c0;  --tint-teal-b:   #12a493;   /* Accessories */
  --tint-yellow-a: #f6c53d;  --tint-yellow-b: #e0a213;   /* Nutrition   */
  --tint-violet-a: #b07bff;  --tint-violet-b: #7c4bd6;   /* Personal Care */
}

/* ---------------------------------------------------------------------
   WRAPPER + TRANSPARENT ZONE
   No border, no glass — just a bounded, mostly-invisible drag area with a
   whisper-soft radial glow so the space feels present without being a box.
   --------------------------------------------------------------------- */
.playground-wrap { position: relative; }

.playground {
  position: relative;
  width: 100%;
  margin-inline: auto;
}

.tp-stage {
  position: relative;
  width: 100%;
  height: var(--tp-h);
  min-height: 600px;
  /* Fully transparent — no glow, no box. The tiles are the only visual; the
     zone dissolves into the hero background so there is no visible edge. */
  background: transparent;
  border: none;
  overflow: visible;         /* no clipped rectangle edge; JS keeps tiles inside */
  touch-action: none;        /* pointer drag owns gestures inside */
}

/* ---------------------------------------------------------------------
   TILES — colourful rounded squares, soft 3D depth, white icon + label.
   Positioned via --tile-x/y (translate3d). The engine writes those every
   frame, so we only transition shadow/opacity — never transform.
   --------------------------------------------------------------------- */
.tile {
  position: absolute; left: 0; top: 0;
  width: var(--tile-size); height: var(--tile-size);
  transform: translate3d(var(--tile-x, 0), var(--tile-y, 0), 0);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 14px 10px;
  border: none; border-radius: 22px; cursor: grab;
  color: #fff; font: inherit;
  background: linear-gradient(155deg, var(--t-a), var(--t-b));
  /* soft ambient drop shadow + a subtle darker "bottom edge" for 3D depth */
  box-shadow:
    0 14px 26px rgba(6,10,24,.30),
    0 4px 0 rgba(0,0,0,.14),
    inset 0 1px 0 rgba(255,255,255,.40),
    inset 0 -8px 16px rgba(0,0,0,.16);
  transition: box-shadow .25s var(--ease), filter .25s var(--ease);
  will-change: transform;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
}

/* gentle staggered pop-in on load (JS staggers via --pop-delay) */
.tile.tp-pop { animation: tilePop 420ms var(--ease-spec) both; animation-delay: var(--pop-delay, 0ms); }
@keyframes tilePop {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

.tile:hover  { box-shadow: 0 20px 34px rgba(6,10,24,.36), 0 4px 0 rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.45), inset 0 -8px 16px rgba(0,0,0,.18); }
.tile:active { cursor: grabbing; }
.tile:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* lifted while dragging OR picked up via keyboard — floats a touch higher */
.tile.is-dragging, .tile.is-picked {
  cursor: grabbing; z-index: 50;
  box-shadow: 0 32px 50px rgba(4,8,20,.44), 0 6px 0 rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.5), inset 0 -8px 18px rgba(0,0,0,.2);
  filter: saturate(1.05) brightness(1.02);
}
.tile.is-picked { outline: 3px dashed rgba(255,255,255,.85); outline-offset: 3px; }

/* keyboard Escape snap-back easing (pointer drops use JS physics, not this) */
.tile.is-snapping { transition: transform .5s var(--ease), box-shadow .25s var(--ease); }

/* icon puck + label */
.tile-ico {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.94);
  display: grid; place-items: center; flex: none;
  box-shadow: 0 4px 10px rgba(0,0,0,.16), inset 0 -2px 4px rgba(0,0,0,.06);
}
.tile-ico::before {
  content: ""; width: 25px; height: 25px;
  background: var(--t-b);
  -webkit-mask: var(--icon-url) center / contain no-repeat;
          mask: var(--icon-url) center / contain no-repeat;
}
.tile-label { font-size: 12px; font-weight: 700; letter-spacing: .01em; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.28); }

/* tint families */
.tile[data-tint="blue"]   { --t-a: var(--tint-blue-a);   --t-b: var(--tint-blue-b); }
.tile[data-tint="pink"]   { --t-a: var(--tint-pink-a);   --t-b: var(--tint-pink-b); }
.tile[data-tint="amber"]  { --t-a: var(--tint-amber-a);  --t-b: var(--tint-amber-b); }
.tile[data-tint="purple"] { --t-a: var(--tint-purple-a); --t-b: var(--tint-purple-b); }
.tile[data-tint="green"]  { --t-a: var(--tint-green-a);  --t-b: var(--tint-green-b); }
.tile[data-tint="red"]    { --t-a: var(--tint-red-a);    --t-b: var(--tint-red-b); }
.tile[data-tint="teal"]   { --t-a: var(--tint-teal-a);   --t-b: var(--tint-teal-b); }
.tile[data-tint="yellow"] { --t-a: var(--tint-yellow-a); --t-b: var(--tint-yellow-b); }
.tile[data-tint="violet"] { --t-a: var(--tint-violet-a); --t-b: var(--tint-violet-b); }

/* inline SVG glyphs as data-URI masks (single colour, scale cleanly) */
.tile[data-icon="laptop"]   { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M4 5h16a1 1 0 0 1 1 1v10h-18V6a1 1 0 0 1 1-1zm-3 12h22v1a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-1z"/></svg>'); }
.tile[data-icon="jar"]      { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M7 8h10a2 2 0 0 1 2 2v7a3 3 0 0 1-3 3H8a3 3 0 0 1-3-3v-7a2 2 0 0 1 2-2zm1-4h8v2H8z"/></svg>'); }
.tile[data-icon="shoe"]     { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M2 16c0-1 .5-2 1-3l4-2 3 2 5 1c2 .3 5 1 6 2.5.6.5 1 1.2 1 2v1H2v-3.5zM7 9l2 2"/></svg>'); }
.tile[data-icon="shirt"]    { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M8 3l4 2 4-2 5 4-3 3-1-1v11H7V9L6 10 3 7l5-4z"/></svg>'); }
.tile[data-icon="home"]     { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M12 3l9 8h-2v9h-5v-6H10v6H5v-9H3z"/></svg>'); }
.tile[data-icon="dumbbell"] { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M2 9h2v6H2zm3-2h2v10H5zm12 0h2v10h-2zm3 2h2v6h-2zM8 11h8v2H8z"/></svg>'); }
.tile[data-icon="watch"]    { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M9 2h6l-1 4.2A6 6 0 0 1 14 17.8L15 22H9l1-4.2A6 6 0 0 1 10 6.2zm3 5a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm-.8 2h1.5v3l2 1.2-.8 1.3L11.2 13z"/></svg>'); }
.tile[data-icon="leaf"]     { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M17 8C8 10 5.9 16.2 5 21c3.8-.7 9.5-2.3 12-8 1.5-3.4 2-8 2-11-2 1-4.5 1.5-7 2C9.5 4.5 8 6 8 8c0 1.2.5 2 1.5 2.5C11 8.5 14 8 17 8z"/></svg>'); }
.tile[data-icon="pump"]     { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M11 2h3v2l2 1v2l-3 1-2 2h5a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2V6l-2-1V3h3z"/></svg>'); }

/* ---------------------------------------------------------------------
   MASCOT — the Patshi "P" mark as a quiet, softly-floating presence.
   No text, no bubble. Gentle bob + tilt; low visual weight.
   --------------------------------------------------------------------- */
/* Mascot now lives beside the "One score." headline (not in the tile zone).
   Sits inline after the gradient word, gently floating. Decorative only. */
.hero-mascot {
  display: inline-block; vertical-align: -0.22em;
  width: 88px; height: 88px; margin-left: 14px;
  pointer-events: none; user-select: none;
  /* the PNG carries its own soft glow; keep the CSS shadow light */
  filter: drop-shadow(0 8px 20px rgba(20,80,220,.28));
  transform-origin: 50% 80%;
  animation: mascotFloat 6s ease-in-out infinite;
}
@keyframes mascotFloat {
  0%,100% { transform: translateY(0) rotate(-3deg); }
  50%     { transform: translateY(-8px) rotate(3deg); }
}

/* ---------------------------------------------------------------------
   WAITLIST SECTION (below the hero) — unchanged layout home.
   --------------------------------------------------------------------- */
.waitlist-section {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(8px, 3vh, 32px) clamp(16px, 4vw, 40px) clamp(24px, 5vh, 56px);
}
.waitlist-section .card-wrap { max-width: 560px; margin-inline: auto; }

/* ---------------------------------------------------------------------
   RESPONSIVE — stack under the headline on tablet/phone; shrink the zone.
   --------------------------------------------------------------------- */
@media (max-width: 880px) {
  .playground-wrap { order: 2; width: 100%; }
  .playground { width: 100%; }
}
@media (max-width: 600px) {
  :root { --tp-h: 520px; --tile-size: 100px; }
  .hero-mascot { width: 60px; height: 60px; margin-left: 10px; vertical-align: -0.18em; }
}
@media (max-width: 380px) {
  :root { --tile-size: 84px; }
}

/* ---------------------------------------------------------------------
   REDUCED MOTION — no pop-in, no mascot float; keep everything static.
   The JS physics engine also downgrades to instant placement.
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .tile.tp-pop { animation: none; opacity: 1; }
  .tile.is-snapping { transition: box-shadow .25s var(--ease); }
  .hero-mascot { animation: none; }
}
body.no-motion .tile.tp-pop { animation: none; opacity: 1; }
body.no-motion .tile.is-snapping { transition: box-shadow .25s var(--ease); }
body.no-motion .hero-mascot { animation: none; }
