/* =========================================================================
   Doodle & Roar - Color & Play page
   Same brand tokens as style.css, extra-playful treatment for this page only.
   ========================================================================= */

.playzone {
  position: relative;
  overflow: hidden;
  padding: 44px 0 64px;
  background:
    radial-gradient(circle at 8% 15%, rgba(255,107,107,.22), transparent 40%),
    radial-gradient(circle at 92% 10%, rgba(78,168,222,.24), transparent 42%),
    radial-gradient(circle at 85% 90%, rgba(255,201,60,.28), transparent 45%),
    radial-gradient(circle at 12% 88%, rgba(155,93,229,.22), transparent 42%),
    linear-gradient(180deg, #fff3e2 0%, #ffe8f2 50%, #e8f7f4 100%);
}

.playzone .deco-float {
  position: absolute;
  font-size: 1.8rem;
  opacity: .55;
  animation: play-bob 5s ease-in-out infinite;
  pointer-events: none;
  user-select: none;
}
.deco-float--1 { top: 6%;  left: 4%;  font-size: 2.1rem; animation-delay: 0s; }
.deco-float--2 { top: 14%; right: 7%; animation-delay: .6s; }
.deco-float--3 { top: 52%; left: 2%;  font-size: 1.5rem; animation-delay: 1.2s; }
.deco-float--4 { bottom: 8%; right: 4%; font-size: 2.3rem; animation-delay: .3s; }
.deco-float--5 { bottom: 14%; left: 10%; animation-delay: .9s; }
.deco-float--6 { top: 36%; right: 2%; font-size: 1.4rem; animation-delay: 1.5s; }
.deco-float--7  { top: 24%; left: 12%; font-size: 1.6rem; animation-delay: .8s; }
.deco-float--8  { top: 45%; right: 13%; font-size: 1.5rem; animation-delay: 1.8s; }
.deco-float--9  { top: 63%; left: 5%;  font-size: 1.7rem; animation-delay: .4s; }
.deco-float--10 { top: 70%; right: 6%; font-size: 1.8rem; animation-delay: 1.1s; }
.deco-float--11 { top: 90%; left: 8%;  font-size: 1.7rem; animation-delay: .2s; }
.deco-float--12 { top: 95%; right: 10%; font-size: 1.6rem; animation-delay: 1.4s; }

@keyframes play-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(8deg); }
}

.playzone .head {
  max-width: 640px;
  margin: 0 auto 34px;
}
.playzone h1 {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  background: linear-gradient(100deg, var(--coral), var(--grape) 55%, var(--sky));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.playzone .lead { max-width: 46ch; margin-left: auto; margin-right: auto; }

/* ---- Picture gallery --------------------------------------------------- */
.play-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.pic-card {
  background: #fff;
  border: 4px solid #fff;
  outline: 3px dashed rgba(155,93,229,.3);
  outline-offset: -10px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease;
  font: inherit;
}
.pic-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.pic-card:active { transform: translateY(-1px) scale(.98); }
.pic-card img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #fff;
}
.pic-card__label {
  font-weight: 700;
  font-size: .92rem;
  color: var(--ink);
  text-align: center;
}

/* ---- Coloring tool modal ------------------------------------------------ */
.color-modal[hidden] { display: none; }
.color-modal {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-items: center; padding: 16px;
  background: rgba(43, 36, 64, .6);
  backdrop-filter: blur(3px);
}
.color-modal__box {
  background: var(--cream);
  border-radius: var(--radius-lg);
  width: min(760px, 100%);
  max-height: 94vh;
  overflow: auto;
  box-shadow: var(--shadow);
  position: relative;
  padding: 20px;
}
.color-modal__close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: #fff; box-shadow: var(--shadow-sm); font-size: 1.2rem; line-height: 1;
}
.color-modal__title {
  margin: 0 46px 14px 4px;
  font-size: 1.3rem;
}

.color-stage {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.color-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  touch-action: none;
  /* aspect-ratio & max-width are set inline in JS to match the loaded picture */
}
.color-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.color-layer { position: relative; z-index: 1; }
.line-layer {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.color-toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tool-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
}
.tool-group {
  display: flex;
  gap: 8px;
}
.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: #fff;
  border: 2px solid rgba(43,36,64,.12);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  min-width: 64px;
}
.tool-btn__icon { font-size: 1.3rem; }
.tool-btn[aria-pressed="true"] {
  border-color: var(--coral);
  color: var(--coral-dark);
  background: #fff5f2;
  box-shadow: 0 0 0 2px rgba(255,107,107,.18);
}
.tool-size {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.tool-size input[type="range"] { width: 120px; }

.palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}
@media (max-width: 520px) {
  .palette { grid-template-columns: repeat(6, 1fr); }
}

.color-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.color-actions .btn { flex: 1 1 auto; }

@media (max-width: 520px) {
  .color-modal__box { padding: 14px; }
  .tool-btn { padding: 7px 10px; min-width: 56px; }
}

.swatch {
  --sw: #fff;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sw);
  border: 3px solid rgba(43,36,64,.12);
  box-shadow: 0 4px 0 -1px rgba(43,36,64,.18);
  cursor: pointer;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.swatch:hover { transform: translateY(-2px) scale(1.06); }
.swatch:active { transform: translateY(1px) scale(.96); }
.swatch[aria-pressed="true"] {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink), 0 4px 0 -1px rgba(43,36,64,.18);
  animation: swatch-pop .28s ease;
}
@keyframes swatch-pop {
  0% { transform: scale(.85); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ---- CTA band below the stage ----------------------------------------- */
.play-cta {
  margin-top: 40px;
  text-align: center;
}
.play-cta p { max-width: 48ch; margin: 6px auto 18px; color: var(--ink-soft); }
