* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Bricolage Grotesque', sans-serif;
  background: linear-gradient(135deg, #f8e1f4 0%, #e0f7fa 50%, #f0f4f8 100%);
  min-height: 100vh;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header */
#header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(255, 105, 180, 0.2);
  z-index: 100;
}

.header-content {
  display: flex;
  flex-direction: column;
}

#title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #FF69B4;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s;
}

#title:hover {
  transform: scale(1.02);
}

.subtitle {
  font-size: 0.85rem;
  color: #888;
  font-weight: 400;
}

.vibe-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #FDD835, #FFB300);
  padding: 8px 16px;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(253, 216, 53, 0.4);
}

.vibe-icon {
  font-size: 1.2rem;
}

#vibe-points {
  font-size: 1.3rem;
  font-weight: 800;
  color: #333;
  transition: transform 0.2s;
}

#vibe-points.pulse {
  transform: scale(1.3);
}

.vibe-label {
  font-size: 0.8rem;
  color: #666;
}

/* Main Container */
#main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebars */
#parts-palette, #properties-panel {
  width: 140px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}

#parts-palette h3, #properties-panel h3 {
  font-size: 0.9rem;
  color: #666;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(255, 105, 180, 0.2);
}

.part-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: none;
  background: linear-gradient(135deg, #fff, #f8f8f8);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.part-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
}

.part-btn:active {
  transform: scale(0.95);
}

.part-emoji {
  font-size: 1.5rem;
}

.part-label {
  font-size: 0.75rem;
  color: #666;
  font-weight: 600;
}

/* Scene Container */
#scene-container {
  flex: 1;
  position: relative;
  background: linear-gradient(180deg, #e8f4f8 0%, #f0f8ff 100%);
}

/* Properties Panel */
#no-selection {
  text-align: center;
  color: #999;
  padding: 20px 0;
}

.property-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.property-group label {
  font-size: 0.75rem;
  color: #666;
  font-weight: 600;
}

#part-color {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
}

#expression-select {
  padding: 10px;
  border: 2px solid #eee;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.transform-buttons {
  display: flex;
  gap: 4px;
}

.transform-btn {
  flex: 1;
  padding: 8px 4px;
  border: 2px solid #eee;
  background: #fff;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.transform-btn.active {
  background: #FF69B4;
  border-color: #FF69B4;
  color: #fff;
}

.transform-btn:hover:not(.active) {
  border-color: #FF69B4;
}

.delete-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
}

.delete-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* Toolbar */
#toolbar {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-top: 2px solid rgba(255, 105, 180, 0.2);
}

.toolbar-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.toolbar-btn.primary {
  background: linear-gradient(135deg, #FF69B4, #FF1493);
  color: white;
}

.toolbar-btn.accent {
  background: linear-gradient(135deg, #90CAF9, #42A5F5);
  color: white;
}

.toolbar-btn:not(.primary):not(.accent) {
  background: #fff;
  color: #333;
}

.toolbar-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.toolbar-btn:active {
  transform: translateY(0);
}

/* Footer */
#footer {
  text-align: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.5);
}

#footer a {
  color: #999;
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}

#footer a:hover {
  color: #FF69B4;
}

/* Toast */
#toast-container {
  position: fixed;
  bottom: 100px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: linear-gradient(135deg, #333, #222);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: translateX(120%);
  transition: transform 0.3s ease;
}

.toast.show {
  transform: translateX(0);
}

/* Confetti */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confetti-fall 2s ease-out forwards;
  pointer-events: none;
}

@keyframes confetti-fall {
  0% {
    top: -10px;
    opacity: 1;
    transform: rotate(0deg);
  }
  100% {
    top: 100vh;
    opacity: 0;
    transform: rotate(720deg);
  }
}

/* Loading Screen */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f8e1f4, #e0f7fa);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s, visibility 0.5s;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-berry {
  font-size: 4rem;
  animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-20px); }
}

#loading-screen p {
  margin-top: 20px;
  color: #666;
  font-size: 1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #main-container {
    flex-direction: column;
  }
  
  #parts-palette {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    order: 2;
    padding: 10px;
  }
  
  #parts-palette h3 {
    display: none;
  }
  
  .part-btn {
    flex-direction: row;
    padding: 8px 12px;
  }
  
  #scene-container {
    order: 1;
    min-height: 300px;
  }
  
  #properties-panel {
    width: 100%;
    order: 3;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
  }
  
  #properties-panel h3 {
    width: 100%;
  }
  
  .property-group {
    margin-bottom: 0;
  }
  
  #toolbar {
    flex-wrap: wrap;
  }
  
  .toolbar-btn {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
  
  #header {
    padding: 10px 12px;
  }
  
  #title {
    font-size: 1.4rem;
  }
  
  .vibe-counter {
    padding: 6px 12px;
  }
  
  #toast-container {
    bottom: 80px;
    right: 10px;
    left: 10px;
  }
  
  .toast {
    text-align: center;
  }
}

@media (max-width: 480px) {
  #parts-palette {
    gap: 6px;
  }
  
  .part-btn {
    padding: 6px 10px;
  }
  
  .part-emoji {
    font-size: 1.2rem;
  }
  
  .part-label {
    font-size: 0.65rem;
  }
  
  .toolbar-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
}