:root {
  --bg-primary: #070714;
  --bg-secondary: #0d0d1a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-gold: #fbbf24;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --accent-orange: #f97316;
  --accent-blue: #3b82f6;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: block;
}

.landing-content {
  max-width: 500px;
  margin: 0 auto;
  padding: 60px 20px;
  text-align: center;
}

h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 10px;
}

h1 span {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 40px;
}

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 40px;
}

.search-box input {
  flex: 1;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s;
}

.search-box input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

.search-box button {
  padding: 16px 28px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  border: none;
  border-radius: 12px;
  color: #000;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.search-box button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(251, 191, 36, 0.3);
}

.features {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 40px;
}

.feature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.feature-icon {
  font-size: 1.3rem;
}

.quick-links {
  display: flex;
  justify-content: center;
  gap: 30px;
}

.quick-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.pet-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px;
}

.pet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.back-btn, .share-btn {
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.back-btn:hover, .share-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.pet-address {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-stage {
  position: relative;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: radial-gradient(circle at center, rgba(251, 191, 36, 0.05) 0%, transparent 70%);
  border-radius: 20px;
}

.pet-display {
  position: relative;
  z-index: 2;
  transform-origin: center bottom;
}

.pet-aura {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

.pet-info {
  text-align: center;
  margin-bottom: 25px;
}

.pet-name-section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.stage-label {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pet-traits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
}

.trait-tag {
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 15px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.trait-tag.rare {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(249, 115, 22, 0.2));
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.status-bars {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.status-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.status-label span:first-child {
  color: var(--text-secondary);
}

.status-label span:last-child {
  color: var(--text-primary);
  font-weight: 600;
}

.bar-track {
  height: 10px;
  background: var(--bg-secondary);
  border-radius: 5px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s ease;
}

.bar-fill.health {
  background: linear-gradient(90deg, var(--accent-red), var(--accent-green));
}

.bar-fill.hunger {
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-gold));
}

.bar-fill.happiness {
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink));
}

.evolution-section {
  margin-bottom: 25px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.evolution-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.evolution-path {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.evo-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.evo-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1.2rem;
  transition: all 0.3s;
}

.evo-stage.current .evo-icon {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  border-color: var(--accent-gold);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
  transform: scale(1.1);
}

.evo-stage.completed .evo-icon {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.evo-stage.locked .evo-icon {
  opacity: 0.4;
}

.evo-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-align: center;
}

.evo-arrow {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.badges-section {
  margin-bottom: 25px;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
}

.badge.earned {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
  border-color: var(--accent-green);
}

.badge.locked {
  opacity: 0.4;
}

.badge-icon {
  font-size: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 25px;
}

.stat-card {
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: center;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.feed-hint {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

.hint-title {
  font-weight: 600;
  margin-bottom: 10px;
}

.hint-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.warning {
  margin-top: 15px;
  padding: 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--accent-red);
  border-radius: 10px;
  color: var(--accent-red);
  font-size: 0.85rem;
}

.leaderboard-container, .graveyard-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}

.screen-header h2 {
  font-size: 1.5rem;
}

.leaderboard-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.tab {
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab.active {
  background: var(--accent-gold);
  color: #000;
  border-color: var(--accent-gold);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.leaderboard-item:hover {
  background: var(--bg-secondary);
  transform: translateX(5px);
}

.lb-rank {
  font-size: 1.2rem;
  font-weight: 700;
  width: 40px;
  text-align: center;
}

.lb-rank.gold { color: var(--accent-gold); }
.lb-rank.silver { color: #c0c0c0; }
.lb-rank.bronze { color: #cd7f32; }

.lb-pet {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 12px;
  font-size: 1.5rem;
}

.lb-info {
  flex: 1;
}

.lb-address {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.lb-stats {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.lb-value {
  font-weight: 600;
  color: var(--accent-cyan);
}

.graveyard-intro {
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 25px;
  font-style: italic;
}

.graveyard-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.grave-item {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.grave-icon {
  font-size: 2rem;
  filter: grayscale(1);
  opacity: 0.6;
}

.grave-info {
  flex: 1;
}

.grave-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.grave-details {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.grave-epitaph {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 8px;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 25px;
  max-width: 400px;
  width: 100%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-content h3 {
  margin-bottom: 20px;
  text-align: center;
}

.share-card {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.share-actions {
  display: flex;
  gap: 10px;
}

.share-actions button {
  flex: 1;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.share-actions button:hover {
  background: var(--accent-gold);
  color: #000;
  border-color: var(--accent-gold);
}

.pet-display.dead {
  filter: grayscale(1);
  opacity: 0.5;
}

.pet-display.dead::after {
  content: '&#128128;';
  position: absolute;
  font-size: 3rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.pet-display.shiny::before {
  content: '&#10024;';
  position: absolute;
  font-size: 1.5rem;
  top: -10px;
  right: -10px;
  animation: sparkle 1s ease-in-out infinite;
}

.loading {
  color: var(--text-muted);
  font-size: 1rem;
}

.error {
  color: var(--accent-red);
  font-size: 1rem;
}

@media (max-width: 500px) {
  h1 { font-size: 2.2rem; }

  .search-box {
    flex-direction: column;
  }

  .pet-stage {
    height: 220px;
  }

  .evolution-path {
    flex-wrap: wrap;
  }

  .evo-arrow {
    display: none;
  }
}
