* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

.container {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #3730a3 100%);
  padding: 1rem;
  position: relative;
}

/* Background Icons */
.background-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.icon {
  position: absolute;
  opacity: 0.3;
  transition: opacity 0.3s;
}

.icon img {
  width: 80px;
  height: 80px;
}

.icon-1 {
  left: 10%;
  top: 20%;
  animation: bounce-horizontal 15s ease-in-out infinite;
}

.icon-2 {
  left: 80%;
  top: 20%;
  animation: bounce-horizontal-reverse 15s ease-in-out infinite 1s;
}

.icon-3 {
  left: 10%;
  top: 70%;
  animation: bounce-vertical 15s ease-in-out infinite 2s;
}

.icon-4 {
  left: 80%;
  top: 70%;
  animation: bounce-vertical-reverse 15s ease-in-out infinite 3s;
}

/* Animations */
@keyframes bounce-horizontal {
  0%,
  100% {
    transform: translateX(0) rotate(0deg) scale(1);
  }
  50% {
    transform: translateX(60vw) rotate(180deg) scale(1.1);
  }
}

@keyframes bounce-horizontal-reverse {
  0%,
  100% {
    transform: translateX(0) rotate(0deg) scale(1);
  }
  50% {
    transform: translateX(-60vw) rotate(-180deg) scale(1.1);
  }
}

@keyframes bounce-vertical {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  50% {
    transform: translateY(-40vh) rotate(180deg) scale(1.1);
  }
}

@keyframes bounce-vertical-reverse {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  50% {
    transform: translateY(40vh) rotate(-180deg) scale(1.1);
  }
}

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  z-index: 10;
}

.logo-container {
  margin-bottom: 2rem;
}

.logo {
  width: 200px;
  height: px;
}

/* Selection Slots */
.selection-container {
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 32rem;
}

.selection-slots {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.slot {
  width: 80px;
  height: 80px;
  border-radius: 0.5rem;
  border: 3px dashed #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
}

.slot:hover {
  border-color: #6b7280;
}

.slot.filled {
  background: #fbbf24;
  border-color: #f59e0b;
  border-style: solid;
}

.slot.filled:hover {
  background: #fcd34d;
}

.slot-placeholder {
  color: #9ca3af;
  font-size: 1.5rem;
}

.slot-content {
  position: relative;
}

.slot-content img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.slot-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.clear-button {
  display: block;
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  background: linear-gradient(to right, #ef4444, #9333ea);
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-button:hover {
  background: linear-gradient(to right, #dc2626, #7c3aed);
}

/* Input Container */
.input-container {
  margin-bottom: 2rem;
  width: 100%;
  max-width: 28rem;
}

.input-container > div {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  max-width: 24rem;
  margin: 0 auto;
}

.username-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: white;
  color: #374151;
  border: 2px solid #d1d5db;
  font-size: 0.875rem;
  outline: none;
}

.username-input:focus {
  border-color: #60a5fa;
}

.generate-button {
  padding: 0.5rem 1rem;
  background: #22c55e;
  color: white;
  font-weight: bold;
  font-size: 0.875rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
  text-shadow: 1px 1px 0px black, -1px -1px 0px black, 1px -1px 0px black, -1px 1px 0px black;
}

.generate-button:hover {
  background: #16a34a;
}

/* Note */
.note {
  margin-bottom: 2rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: black;
  text-align: center;
  padding: 0.5rem 1rem;
  border: 2px solid #d1d5db;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Pet Grid */
.pet-grid {
  margin-top: 1rem;
  width: 100%;
  max-width: 96rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .pet-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .pet-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.pet-card {
  border-radius: 0.5rem;
  padding: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  height: 128px;
  background: rgba(34, 197, 94, 0.2);
}

.pet-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  background: rgba(249, 250, 251, 1);
}

.pet-card.selected {
  background: #fbbf24;
  border: 3px solid #f59e0b;
  transform: scale(1.05);
}

.pet-image-container {
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
}

.pet-image {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.pet-name-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  padding: 0.25rem 0.5rem;
  border-radius: 0 0 0.5rem 0.5rem;
}

.pet-name {
  font-weight: bold;
  color: #1f2937;
  font-size: 0.75rem;
}

.selected-indicator {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #22c55e;
  border-radius: 50%;
  padding: 0.25rem;
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

/* Popup */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

.popup-overlay.hidden {
  display: none;
}

.popup-content {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 28rem;
  width: 100%;
  margin: 1rem;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.loading-text {
  margin-bottom: 2rem;
}

.loading-text h2 {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #1f2937;
}

.loading-text h2.verification {
  color: #ef4444;
}

.loading-text div {
  font-size: 0.875rem;
  color: #6b7280;
}

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d1d5db;
  transition: all 0.3s;
}

.dot.active {
  background: #22c55e;
}

.verify-section {
  margin-bottom: 1.5rem;
}

.verify-section.hidden {
  display: none;
}

.verify-button {
  padding: 0.75rem 2rem;
  background: #22c55e;
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.verify-button:hover {
  background: #16a34a;
}

.selected-items {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.selected-items.hidden {
  display: none;
}

.selected-items p {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.items-preview {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preview-item {
  width: 32px;
  height: 32px;
  border-radius: 0.25rem;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
}

.toast {
  background: white;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #22c55e;
  max-width: 20rem;
  animation: slideIn 0.3s ease-out;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast-title {
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.toast-description {
  font-size: 0.875rem;
  color: #6b7280;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
