/* Fashion Studio - painting fabrics and dressing the doll.
   Shared shell, buttons and colours come from kids-common.css. */

.menu-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.save-btn {
  background: var(--kids-green);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
}

.save-btn:active,
.tool:active,
.swatch:active,
.style-btn:active {
  transform: scale(0.94);
}

.row-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--kids-ink-soft);
  margin: 12px 0 6px;
}

/* ===================== Fabric studio ===================== */

.studio {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.tile-wrap {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 3px dashed var(--kids-border);
  overflow: hidden;
  background: #fff;
}

#tile {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

/* The tile repeated, so the child sees it as a length of cloth. */
.bolt {
  flex: 0 0 34%;
  border-radius: 14px;
  border: 3px solid var(--kids-border);
  background-color: #fff;
  background-repeat: repeat;
  background-size: 50px 50px;
  position: relative;
}

.bolt-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--kids-ink);
}

.bolt-label span {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 2px 8px;
}

.tools,
.swatches,
.styles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool {
  min-width: 56px;
  min-height: 56px;
  border-radius: 14px;
  border: 3px solid var(--kids-border);
  background: var(--kids-card);
  font-family: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 6px;
  color: var(--kids-ink-soft);
}

.tool small {
  font-size: 0.62rem;
  font-weight: 800;
}

.tool.on {
  border-color: var(--kids-lilac);
  background: #eeecff;
}

.tool .dot {
  background: var(--kids-ink);
  border-radius: 50%;
  display: block;
}

.swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--kids-border);
  cursor: pointer;
  background-size: 22px 22px;
  flex-shrink: 0;
}

.swatch.square {
  border-radius: 12px;
  width: 52px;
  height: 52px;
}

.swatch.on {
  box-shadow: 0 0 0 4px var(--kids-lilac);
}

.swatch.rainbow {
  background: conic-gradient(#e0574b, #f4b942, #ffe45c, #8bd450, #3fa9f5, #7f77dd, #f47ec4, #e0574b);
}

/* ===================== Dress up ===================== */

.runway {
  position: relative;
  height: 44vh;
  min-height: 260px;
  max-height: 420px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 96%, rgba(127, 119, 221, 0.25) 0 22%, transparent 23%),
    linear-gradient(#fdf1fb, #eef3ff);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 8px 0 4px;
  flex-shrink: 0;
}

.runway .doll-svg {
  height: 100%;
  width: auto;
}

.runway.twirl .doll-svg {
  animation: fs-twirl 1.4s ease-in-out;
}

@keyframes fs-twirl {
  0% { transform: scaleX(1); }
  25% { transform: scaleX(-1); }
  50% { transform: scaleX(1) translateY(-10px); }
  75% { transform: scaleX(-1); }
  100% { transform: scaleX(1); }
}

.tabs {
  display: flex;
  gap: 5px;
  justify-content: center;
  padding: 10px 2px 4px;
  scrollbar-width: none;
}

.tabs .chip {
  min-width: 52px;
  padding: 6px 4px;
  flex-shrink: 0;
}

.style-btn {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  border: 3px solid var(--kids-border);
  background: var(--kids-card);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--kids-muted);
}

.style-btn.on {
  border-color: var(--kids-lilac);
  background: #eeecff;
}

.style-btn .doll-svg {
  width: 100%;
  height: 100%;
}

.dress-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.dress-actions .big-btn {
  flex: 1;
}

/* ===================== Wardrobe ===================== */

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
}

.shelf-item {
  position: relative;
  border-radius: 14px;
  border: 3px solid var(--kids-border);
  background: var(--kids-card);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  font-family: inherit;
}

.shelf-item.fabric {
  aspect-ratio: 1 / 1;
  background-size: 42px 42px;
}

.shelf-item.outfit {
  aspect-ratio: 1 / 2;
  background: linear-gradient(#fdf1fb, #eef3ff);
}

.shelf-item.outfit .doll-svg {
  width: 100%;
  height: 100%;
}

.shelf-item .remove {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 30px;
  height: 30px;
  border-radius: 15px;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--kids-red);
  font-family: inherit;
  font-weight: 900;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 8px;
}

.shelf-item .remove.sure {
  background: var(--kids-red);
  color: #fff;
}

.empty-note {
  color: var(--kids-muted);
  font-size: 0.95rem;
  padding: 8px 0;
}

@media (max-width: 380px) {
  .tool {
    min-width: 50px;
    min-height: 50px;
  }

  .swatch {
    width: 38px;
    height: 38px;
  }

  .style-btn {
    width: 66px;
    height: 66px;
  }
}
