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

body {
  font-family: "Arial", sans-serif;
  min-height: 100vh;
}

.game-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

h1 {
  font-size: 2.2rem;
}

.back-button {
  padding: 0.5rem 1rem;
  border-radius: 50px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.back-button:hover {
  transform: scale(1.05);
}

.dress-up-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .dress-up-layout {
    flex-direction: row;
    align-items: flex-start;
  }
}

.pig-stage {
  flex: 1;
  background: linear-gradient(180deg, #1e1e1e 0%, #2a1f2e 100%);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  text-align: center;
  min-width: 0;
}

#animal-svg {
  width: 100%;
  max-width: 380px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

.animal.hidden {
  display: none;
}

.animal-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

@media (min-width: 480px) {
  .animal-picker {
    grid-template-columns: repeat(3, 1fr);
  }
}

.animal-btn.active {
  background-color: #4a2040;
  border-color: #2dd4bf;
}

.pig-name {
  margin-top: 1rem;
  font-size: 1.4rem;
  font-weight: bold;
}

.controls-panel {
  flex: 1;
  background-color: #1e1e1e;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  max-height: 85vh;
  overflow-y: auto;
}

.control-section {
  margin-bottom: 1.25rem;
}

.control-section h2 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.accessory-colors-section {
  background-color: #252525;
  border-radius: 12px;
  padding: 1rem !important;
  border: 1px solid #3a3a3a;
}

.accessory-colors-section[hidden] {
  display: none;
}

.acc-color-pickers {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.acc-color-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.acc-color-label input[type="color"] {
  width: 44px;
  height: 44px;
  border: 3px solid #444;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  padding: 2px;
}

.acc-color-hint {
  font-size: 0.8rem;
  margin: -0.25rem 0 0.75rem;
}

#pig-name-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #333;
  border-radius: 10px;
  background-color: #2a2a2a;
  color: white;
  font-size: 1rem;
}

#pig-name-input:focus {
  outline: none;
  border-color: #2dd4bf;
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.color-picker-row input[type="color"] {
  width: 48px;
  height: 48px;
  border: 3px solid #444;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  padding: 2px;
}

.color-label {
  font-size: 0.9rem;
}

.preset-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.color-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #444;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.color-btn:hover {
  transform: scale(1.12);
}

.color-btn.active {
  border-color: #2dd4bf;
  box-shadow: 0 0 0 2px #2dd4bf;
}

.accessory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.outfit-row {
  margin-top: 0.5rem;
}

.outfit-heading {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

button {
  background-color: #2a2a2a;
  color: white;
  border: 2px solid transparent;
  padding: 0.65rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

button:hover {
  background-color: #3a3a3a;
  transform: translateY(-1px);
}

.acc-btn.active {
  background-color: #4a2040;
  border-color: #2dd4bf;
}

.acc-none {
  grid-column: span 2;
  opacity: 0.85;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #333;
}

.action-btn {
  flex: 1;
  min-width: 7.5rem;
  padding: 0.85rem;
  font-weight: bold;
  font-size: 1rem;
}

.action-btn.save {
  background: linear-gradient(90deg, #42a5f5, #7e57c2);
}

.action-btn.save:hover {
  background: linear-gradient(90deg, #1e88e5, #5e35b1);
}

.action-btn.primary {
  background: linear-gradient(90deg, #ff4081, #2dd4bf);
}

.action-btn.primary:hover {
  background: linear-gradient(90deg, #f50057, #ff4081);
}

.accessory.hidden {
  display: none;
}

#sparkles.hidden {
  display: none;
}

#sparkles text {
  animation: twinkle 1.5s ease-in-out infinite alternate;
}

#sparkles text:nth-child(2) {
  animation-delay: 0.3s;
}

#sparkles text:nth-child(3) {
  animation-delay: 0.6s;
}

#sparkles text:nth-child(4) {
  animation-delay: 0.9s;
}

@keyframes twinkle {
  from {
    opacity: 0.4;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1.1);
  }
}
