/* Weather Dress-up styles */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg-summer: linear-gradient(180deg, #d4f0ff 0%, #a9e0ff 60%, #88d462 60%, #6ab742 100%);
  --bg-rain: linear-gradient(180deg, #b0c9d9 0%, #8faec2 60%, #5d8196 60%, #46677a 100%);
  --bg-winter: linear-gradient(180deg, #e0edff 0%, #c4ddff 60%, #f0f6ff 60%, #d8e5f7 100%);
  --bg-autumn: linear-gradient(180deg, #fed7aa 0%, #fdba74 60%, #d97706 60%, #b45309 100%);
}

.dressup-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0.5rem 1rem 1rem;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Weather Selection Tabs */
.weather-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.75rem;
  width: 100%;
  max-width: 540px;
}

.weather-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.15s ease;
}

.weather-tab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.weather-tab-btn:active {
  transform: translateY(1px);
}

.weather-tab-btn.active {
  background: #fef08a;
  border-color: #f59e0b;
  color: #78350f;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

.weather-tab-icon {
  font-size: 1.25rem;
  line-height: 1;
}

/* Scenery Stage */
.scenery-stage {
  position: relative;
  width: 100%;
  height: 250px;
  border-radius: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  border: 3px solid #ffffff;
  transition: background 0.4s ease;
}

.scenery-summer { background: var(--bg-summer); }
.scenery-rain   { background: var(--bg-rain); }
.scenery-winter { background: var(--bg-winter); }
.scenery-autumn { background: var(--bg-autumn); }

/* Sun Glow & Weather Particles */
.sun-glow {
  position: absolute;
  top: 15px;
  right: 25px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: radial-gradient(circle, #fde047 30%, rgba(253, 224, 71, 0.3) 70%, transparent 100%);
  box-shadow: 0 0 25px #fde047;
  animation: pulse-sun 3s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes pulse-sun {
  0% { transform: scale(0.95); opacity: 0.85; }
  100% { transform: scale(1.1); opacity: 1; }
}

.weather-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  pointer-events: none;
}

.rain-drop {
  width: 2px;
  height: 16px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 1px;
  animation: fall-rain 0.6s linear infinite;
}

@keyframes fall-rain {
  0% { transform: translateY(-20px) rotate(15deg); opacity: 0.9; }
  100% { transform: translateY(270px) rotate(15deg); opacity: 0.2; }
}

.snow-flake {
  color: #ffffff;
  font-size: 1rem;
  animation: fall-snow 3s linear infinite;
  opacity: 0.85;
}

@keyframes fall-snow {
  0% { transform: translateY(-20px) rotate(0deg); }
  100% { transform: translateY(270px) rotate(360deg); }
}

.autumn-leaf {
  font-size: 1.1rem;
  animation: drift-leaf 3.5s ease-in-out infinite;
  opacity: 0.9;
}

@keyframes drift-leaf {
  0% { transform: translate(-20px, -20px) rotate(0deg); }
  50% { transform: translate(50px, 120px) rotate(180deg); }
  100% { transform: translate(120px, 270px) rotate(360deg); }
}

/* Character Doll */
.character-doll {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
  margin-bottom: 8px;
}

/* Animal Picker Switcher */
.animal-picker {
  position: absolute;
  top: -46px;
  display: flex;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.2rem 0.4rem;
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
}

.picker-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  border-radius: 9999px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.picker-btn:hover {
  transform: scale(1.15);
}

.picker-btn.active {
  background: #fef08a;
  transform: scale(1.18);
  box-shadow: 0 0 0 2px #f59e0b;
}

.picker-btn:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
}

/* Base Body & Clothes Overlay */
.doll-body-container {
  position: relative;
  width: 110px;
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 1.5rem;
}

.doll-body-container:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 4px;
}

.doll-base-head {
  font-size: 5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
  transition: transform 0.2s ease;
  animation: breathe 3s ease-in-out infinite alternate;
}

@keyframes breathe {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

/* Walking animation when celebrating outside */
.doll-body-container.walking {
  animation: happy-walk 0.5s ease-in-out infinite alternate;
}

@keyframes happy-walk {
  0% { transform: translateY(0) rotate(-3deg); }
  100% { transform: translateY(-12px) rotate(3deg); }
}

/* Clothing slots overlay */
.clothing-slot {
  position: absolute;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  left: 0;
  width: 100%;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.slot-hat {
  top: -16px;
  font-size: 2.8rem;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.slot-top {
  bottom: 12px;
  font-size: 3rem;
  z-index: 8;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.slot-shoes {
  bottom: -18px;
  font-size: 2.2rem;
  z-index: 9;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

.slot-acc {
  left: auto;
  width: auto;
  right: -18px;
  top: 36px;
  font-size: 2.6rem;
  z-index: 11;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

/* Reaction bubble */
.char-reaction {
  position: absolute;
  top: -24px;
  right: -24px;
  font-size: 2rem;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: scale(0.5);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
  pointer-events: none;
  z-index: 20;
}

.char-reaction.show {
  opacity: 1;
  transform: scale(1.15);
}

/* Ground effects */
.outdoor-ground {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  pointer-events: none;
  z-index: 2;
  box-sizing: border-box;
  padding: 0 1rem;
}

.puddle-fx {
  font-size: 2rem;
  animation: splash-pulse 1s ease-in-out infinite alternate;
}

@keyframes splash-pulse {
  0% { transform: scale(0.92); opacity: 0.8; }
  100% { transform: scale(1.08); opacity: 1; }
}

.snowman-fx {
  font-size: 2.4rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.flower-fx {
  font-size: 1.8rem;
}

/* Checklist of clothes needed */
.weather-checklist {
  position: absolute;
  top: 10px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.88);
  padding: 0.35rem 0.6rem;
  border-radius: 0.85rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(4px);
  z-index: 15;
}

.check-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.check-badge.done {
  color: #15803d;
}

/* Action button area */
.action-bar {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin: 0.6rem 0;
  min-height: 48px;
}

.action-pill-btn {
  padding: 0.65rem 1.6rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: pop-btn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.action-pill-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

.action-pill-btn:active {
  transform: translateY(1px) scale(0.98);
}

.next-weather-btn {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

@keyframes pop-btn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Wardrobe Rack Section */
.wardrobe-section {
  width: 100%;
  background: #ffffff;
  border-radius: 1.25rem;
  padding: 0.6rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border: 2px solid #e2e8f0;
}

.wardrobe-rack {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}

.wardrobe-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.25rem;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 64px;
}

.wardrobe-item:hover {
  transform: translateY(-2px);
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.wardrobe-item:active {
  transform: scale(0.95);
}

.wardrobe-item.is-worn {
  background: #ecfdf5;
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.wardrobe-item.shake {
  animation: shake 0.4s ease-in-out;
  border-color: #ef4444;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.item-icon {
  font-size: 1.85rem;
  line-height: 1.1;
  pointer-events: none;
}

.item-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  margin-top: 0.2rem;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Sparks & Stars Celebration */
.sparks-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}

.sparkle {
  position: absolute;
  font-size: 1.5rem;
  animation: burst 0.8s ease-out forwards;
}

@keyframes burst {
  0% { transform: translate(0, 0) scale(0.5); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.3); opacity: 0; }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .scenery-stage {
    height: 220px;
  }
  .doll-base-head {
    font-size: 4.2rem;
  }
  .slot-hat { font-size: 2.3rem; top: -14px; }
  .slot-top { font-size: 2.5rem; bottom: 8px; }
  .slot-shoes { font-size: 1.9rem; bottom: -14px; }
  .slot-acc { font-size: 2.1rem; right: -14px; }
  .wardrobe-rack {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
  }
  .item-icon { font-size: 1.55rem; }
  .item-name { font-size: 0.65rem; }
  .weather-tab-btn {
    padding: 0.4rem 0.3rem;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .doll-base-head,
  .sun-glow,
  .rain-drop,
  .snow-flake,
  .autumn-leaf,
  .puddle-fx,
  .sparkle,
  .doll-body-container.walking,
  .action-pill-btn {
    animation: none;
  }
}
