/* ============================================================
   doll.css  -  Doll container & SVG layers
   ============================================================ */

/* ---------- Two-panel layout ---------- */
.doll-page {
  display: flex;
  gap: 24px;
  min-height: calc(100vh - 80px);
}

.doll-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
}

.doll-panel h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  color: var(--purple-dark);
}

/* ---------- Dolls row (two dolls side-by-side) ---------- */
.dolls-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.doll-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Doll container ---------- */
.doll-container {
  position: relative;
  width: 220px;
  height: 330px;
  margin: 0 auto;
  cursor: pointer;
  border: 3px solid transparent;
  border-radius: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.doll-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.doll-layer svg {
  width: 100%;
  height: 100%;
}

/* z-index layers */
.doll-layer-hair-back    { z-index: 10; }
.doll-layer-body         { z-index: 20; }
.doll-layer-bottom       { z-index: 30; }
.doll-layer-bottom-over  { z-index: 35; }
.doll-layer-dress        { z-index: 40; }
.doll-layer-overalls     { z-index: 42; }
.doll-layer-gloves       { z-index: 45; }
.doll-layer-shoes        { z-index: 50; }
.doll-layer-costume      { z-index: 55; }
.doll-layer-necklace     { z-index: 58; }
.doll-layer-hair-front   { z-index: 60; }
.doll-layer-mask         { z-index: 65; }
.doll-layer-acc-head     { z-index: 70; }
.doll-layer-winter-hat   { z-index: 75; }
.doll-layer-acc-hand     { z-index: 80; }
.doll-layer-pet          { z-index: 90; }

/* Layers no longer need pixel padding: every item, drawn or emoji, is
   positioned inside its own SVG viewBox and scales with the doll.
   The pet keeps its shadow so it reads as a separate little friend. */
.doll-layer-pet svg {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

/* ---------- "Tap me" state when item selected ---------- */
.doll-unit.can-receive .doll-container {
  border-color: var(--pink);
  border-style: dashed;
  animation: pulse-glow 1.2s ease-in-out infinite;
}

/* ---------- Equipped chips strip ---------- */
.equipped-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 8px;
  max-width: 220px;
  min-height: 28px;
}

.equipped-chip {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  border: 2px solid var(--pink);
  transition: transform 0.2s;
}

.equipped-chip:hover {
  transform: scale(1.2);
  background: #FFB3B3;
}

/* ---------- Doll action buttons ---------- */
.doll-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .doll-page {
    flex-direction: column;
  }
  .doll-panel {
    padding: 16px 12px;
  }
  .dolls-row .doll-container {
    width: 155px;
    height: 232px;
  }
  .dolls-row {
    gap: 8px;
  }
  .equipped-chips {
    max-width: 155px;
  }
  .equipped-chip {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }
}
