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

:root {
  --bg-cream: #f8f8f5;
  --text-navy: #1a1a2e;
  --gold-accent: #d4a574;
  --teal-highlight: #7cb5b5;
  --soft-pink: #e8d5d5;
  --lavender: #c9b8e8;
  --card-bg: #ffffff;
  --border-light: #e8e8e5;
}

body {
  font-family: 'Bricolage Grotesque', sans-serif;
  background: linear-gradient(135deg, var(--bg-cream) 0%, #f0efe8 50%, #ebe8e0 100%);
  min-height: 100vh;
  color: var(--text-navy);
}

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

/* Header */
.header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-navy);
}

.sparkle {
  color: var(--gold-accent);
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.adoption-badge {
  background: var(--text-navy);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Navigation */
.navigation {
  background: #e8e8e5;
  padding: 0 1.5rem;
}

.nav-tabs {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0;
}

.nav-tab {
  padding: 1rem 2rem;
  background: transparent;
  border: none;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-navy);
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.nav-tab:hover {
  opacity: 0.8;
}

.nav-tab.active {
  opacity: 1;
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--text-navy);
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

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

.view-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-navy);
}

.discover-button {
  background: linear-gradient(135deg, var(--gold-accent), #c49564);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
}

.discover-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 165, 116, 0.4);
}

/* Creature Grid */
.creature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Creature Card */
.creature-card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.creature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.creature-image-container {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

.creature-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.creature-card:hover .creature-image {
  transform: scale(1.05);
}

.sparkle-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(255, 255, 255, 0.1) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.creature-card:hover .sparkle-overlay {
  opacity: 1;
}

.creature-info {
  padding: 1.25rem;
}

.creature-name {
  font-family: 'Crimson Pro', serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-navy);
}

.trait-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.trait-badge {
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-navy);
  background: rgba(124, 181, 181, 0.1);
}

.adopt-button {
  width: 100%;
  padding: 0.75rem;
  background: var(--text-navy);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.adopt-button:hover:not(.adopted) {
  background: #2a2a4e;
  transform: translateY(-1px);
}

.adopt-button.adopted {
  background: linear-gradient(135deg, var(--teal-highlight), #5a9a9a);
  cursor: default;
}

.adopt-button.large {
  padding: 1rem 2rem;
  font-size: 1rem;
  border-radius: 25px;
  max-width: 300px;
}

/* Happiness Bar */
.happiness-bar-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.happiness-bar {
  flex: 1;
  height: 8px;
  background: #e8e8e5;
  border-radius: 4px;
  overflow: hidden;
}

.happiness-bar.large {
  height: 12px;
  border-radius: 6px;
}

.happiness-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal-highlight), var(--gold-accent));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.happiness-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-navy);
  min-width: 35px;
}

/* Creature Detail */
.creature-detail {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.back-button {
  background: none;
  border: none;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-navy);
  cursor: pointer;
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
  transition: opacity 0.3s ease;
}

.back-button:hover {
  opacity: 0.7;
}

.detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  background: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
  .detail-content {
    grid-template-columns: 1fr;
  }
}

.detail-image-section {
  aspect-ratio: 1;
  overflow: hidden;
}

.detail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info-section {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-name {
  font-family: 'Crimson Pro', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-navy);
}

.adopted-badge {
  background: var(--text-navy);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.detail-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.happiness-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.happiness-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-navy);
}

.detail-section {
  background: rgba(248, 248, 245, 0.8);
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.section-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  color: var(--text-navy);
}

.section-content {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #4a4a5e;
}

.care-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.care-button {
  flex: 1;
  min-width: 80px;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--teal-highlight), #5a9a9a);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.care-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(124, 181, 181, 0.3);
}

/* Care Log */
.care-log-view {
  animation: fadeIn 0.3s ease;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.log-entry {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

.log-entry:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.log-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 181, 181, 0.1);
  border-radius: 10px;
}

.log-content {
  flex: 1;
}

.log-text {
  font-size: 0.9rem;
  color: var(--text-navy);
}

.happiness-gain {
  display: inline-block;
  margin-left: 0.5rem;
  color: var(--teal-highlight);
  font-size: 0.75rem;
  font-weight: 600;
}

.log-time {
  font-size: 0.75rem;
  color: #888;
  white-space: nowrap;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #888;
}

.empty-state p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem;
  margin-top: auto;
}

.footer a {
  color: #888;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: var(--gold-accent);
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .header-title {
    font-size: 1rem;
  }
  
  .adoption-badge {
    font-size: 0.65rem;
    padding: 0.4rem 0.75rem;
  }
  
  .nav-tab {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
  }
  
  .main-content {
    padding: 1.5rem 1rem;
  }
  
  .view-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .creature-grid {
    grid-template-columns: 1fr;
  }
  
  .detail-info-section {
    padding: 1.5rem;
  }
  
  .detail-name {
    font-size: 1.5rem;
  }
  
  .care-actions {
    flex-direction: column;
  }
  
  .care-button {
    width: 100%;
  }
}