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

:root {
  --bg-dark: #0d0d1a;
  --bg-mid: #1a1a2e;
  --accent-yellow: #f7df1e;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-mid) 50%, #16162a 100%);
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
}

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

.floating-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.floating-element {
  position: absolute;
  opacity: 0.4;
  animation: float linear infinite;
}

.floating-element.star {
  color: var(--accent-yellow);
  animation: twinkle 3s ease-in-out infinite alternate, float 20s linear infinite;
}

.floating-element.planet {
  animation: orbit 40s linear infinite;
}

.floating-element.rocket {
  animation: rocketFly 30s linear infinite;
}

@keyframes float {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

@keyframes twinkle {
  0% { opacity: 0.2; transform: scale(0.8); }
  100% { opacity: 0.6; transform: scale(1.2); }
}

@keyframes orbit {
  0% { transform: translateX(0) translateY(0); }
  25% { transform: translateX(30px) translateY(-15px); }
  50% { transform: translateX(0) translateY(-30px); }
  75% { transform: translateX(-30px) translateY(-15px); }
  100% { transform: translateX(0) translateY(0); }
}

@keyframes rocketFly {
  0% { left: -10%; transform: rotate(45deg); }
  100% { left: 110%; transform: rotate(45deg); }
}

.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

.card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  border-radius: 24px;
  position: relative;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.animate-entrance {
  animation: entrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes entrance {
  0% { opacity: 0; transform: scale(0.9) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.title {
  font-family: 'Orbitron', monospace;
  font-size: 2.5rem;
  font-weight: 900;
  text-align: center;
  background: linear-gradient(135deg, var(--accent-yellow) 0%, #fbbf24 50%, var(--accent-yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px rgba(247, 223, 30, 0.3);
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
}

.subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 300;
  margin-bottom: 2rem;
}

.form-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-field, .select-field {
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 2px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: 'Space Grotesk', sans-serif;
  transition: all 0.3s ease;
}

.input-field::placeholder {
  color: var(--text-secondary);
}

.input-field:focus, .select-field:focus {
  outline: none;
  border-color: var(--accent-yellow);
  box-shadow: 0 0 20px rgba(247, 223, 30, 0.2);
}

.select-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a1a1aa'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.5rem;
}

.select-field option {
  background: var(--bg-dark);
  color: var(--text-primary);
}

.submit-btn {
  width: 100%;
  padding: 1.1rem 2rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent-yellow) 0%, #fbbf24 100%);
  color: #0d0d1a;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Orbitron', monospace;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.5rem;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(247, 223, 30, 0.4);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading State */
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0;
}

.crystal-ball {
  font-size: 5rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 40px rgba(139, 92, 246, 0.8)); }
}

.loading-text {
  font-family: 'Orbitron', monospace;
  font-size: 1.3rem;
  color: var(--accent-purple);
  letter-spacing: 2px;
}

.loading-bar {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink));
  border-radius: 2px;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* Result Card */
.result-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.result-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
  border: 2px solid;
  border-image: linear-gradient(135deg, var(--accent-purple), var(--accent-pink), var(--accent-yellow)) 1;
  text-align: center;
}

.animate-result {
  animation: resultEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes resultEntrance {
  0% { opacity: 0; transform: scale(0.5) rotateY(20deg); }
  60% { transform: scale(1.05) rotateY(-5deg); }
  100% { opacity: 1; transform: scale(1) rotateY(0); }
}

.result-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.result-name {
  font-weight: 700;
  font-size: 1.2rem;
}

.result-role {
  color: var(--text-secondary);
  font-size: 1rem;
}

.result-emoji {
  font-size: 4rem;
  margin: 1rem 0;
  filter: drop-shadow(0 0 30px rgba(247, 223, 30, 0.5));
}

.result-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-yellow), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.stat-value {
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-yellow);
}

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

.lucky-token {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(247, 223, 30, 0.1);
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.token-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.token-value {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent-yellow);
}

.fortune-text {
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 0 0.5rem;
  font-size: 0.95rem;
}

.card-footer-branding {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.action-btn {
  padding: 0.875rem 1.5rem;
  border-radius: 10px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.share-btn {
  background: #000;
  color: #fff;
  border: 1px solid #333;
}

.share-btn:hover {
  background: #1a1a1a;
  transform: translateY(-2px);
}

.download-btn {
  background: var(--accent-purple);
  color: #fff;
}

.download-btn:hover {
  background: #7c3aed;
  transform: translateY(-2px);
}

.reset-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

.reset-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

.footer p {
  margin-bottom: 0.5rem;
}

.disclaimer {
  font-size: 0.75rem;
  opacity: 0.7;
}

.footer-link {
  color: var(--accent-yellow);
  text-decoration: none;
  transition: opacity 0.3s ease;
  display: inline-block;
  margin-top: 0.5rem;
}

.footer-link:hover {
  opacity: 0.8;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .card {
    padding: 1.75rem;
    margin: 0 0.5rem;
  }

  .title {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .result-title {
    font-size: 1.3rem;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .stat-value {
    font-size: 1rem;
  }

  .stat-label {
    font-size: 0.6rem;
  }

  .action-buttons {
    flex-direction: column;
    width: 100%;
  }

  .action-btn {
    width: 100%;
  }

  .result-emoji {
    font-size: 3rem;
  }
}