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

:root {
  --purple: #8844aa;
  --pink: #ff69b4;
  --berry: #ff3366;
  --dark: #0a0a0f;
  --darker: #050508;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--dark);
  min-height: 100vh;
  color: white;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--darker) 0%, #1a0a20 50%, #0f0a15 100%);
  position: relative;
}

.app-container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(136, 68, 170, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(255, 105, 180, 0.1) 0%, transparent 50%);
  pointer-events: none;
  animation: gradientShift 10s ease-in-out infinite alternate;
}

@keyframes gradientShift {
  0% { opacity: 0.8; }
  100% { opacity: 1; }
}

/* Floating Emojis */
#floating-emojis {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-emoji {
  position: absolute;
  bottom: -50px;
  font-size: 1.5rem;
  opacity: 0.4;
  animation: floatUp 20s linear forwards;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.4;
  }
  90% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(-110vh) rotate(360deg);
    opacity: 0;
  }
}

/* Header */
.header {
  text-align: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

.title {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple), var(--pink), var(--berry));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px rgba(136, 68, 170, 0.5);
  animation: titleGlow 3s ease-in-out infinite alternate;
}

.title-emoji {
  -webkit-text-fill-color: initial;
  cursor: pointer;
  display: inline-block;
  transition: transform 0.2s;
}

.title-emoji:hover {
  transform: scale(1.2);
}

@keyframes titleGlow {
  0% { filter: drop-shadow(0 0 20px rgba(136, 68, 170, 0.5)); }
  100% { filter: drop-shadow(0 0 30px rgba(255, 105, 180, 0.5)); }
}

.subtitle {
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.5rem;
}

.berry-mode-badge {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--berry), var(--pink));
  border-radius: 20px;
  font-weight: 600;
  animation: berryPulse 0.5s ease-in-out infinite alternate;
}

@keyframes berryPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

/* Crystal Ball */
.crystal-ball-wrapper {
  position: relative;
  width: min(350px, 90vw);
  height: min(350px, 90vw);
  margin-bottom: 2rem;
}

.crystal-ball-container {
  width: 100%;
  height: 100%;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.crystal-ball-container:hover {
  transform: scale(1.02);
}

.crystal-ball-container.shaking {
  animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-10px) rotate(-2deg); }
  75% { transform: translateX(10px) rotate(2deg); }
}

.ball-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(136, 68, 170, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

/* Input Section */
.input-section {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.question-input {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.question-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.question-input:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 20px rgba(255, 105, 180, 0.3);
}

.consult-button {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  border: none;
  border-radius: 15px;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.consult-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.consult-button:hover::before {
  left: 100%;
}

.consult-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(136, 68, 170, 0.4);
}

.consult-button:disabled {
  opacity: 0.8;
  cursor: wait;
}

.consult-button.loading {
  background: linear-gradient(135deg, var(--purple), var(--berry));
  animation: loadingPulse 1s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Fortune Card */
.fortune-card {
  width: 100%;
  max-width: 500px;
  margin-top: 2rem;
  animation: unfurl 0.5s ease-out;
}

@keyframes unfurl {
  0% {
    opacity: 0;
    transform: scaleY(0) translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: scaleY(1) translateY(0);
  }
}

.fortune-scroll {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
}

.fortune-question {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.question-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.question-text {
  font-family: 'Crimson Pro', serif;
  font-size: 1.2rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
}

.fortune-response {
  margin-bottom: 1.5rem;
}

.bot-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.fortune-response.bankr .bot-label {
  color: var(--purple);
}

.fortune-response.berry .bot-label {
  color: var(--pink);
}

.fortune-response p {
  font-family: 'Crimson Pro', serif;
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

.vibe-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  margin-bottom: 1rem;
}

.vibe-emoji {
  font-size: 1.5rem;
}

.vibe-label {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.share-button {
  width: 100%;
  padding: 0.75rem;
  background: rgba(29, 161, 242, 0.2);
  border: 1px solid rgba(29, 161, 242, 0.3);
  border-radius: 10px;
  color: #1da1f2;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.share-button:hover {
  background: rgba(29, 161, 242, 0.3);
  transform: translateY(-2px);
}

.disclaimer {
  text-align: center;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 1rem;
  font-style: italic;
}

/* History Section */
.history-section {
  width: 100%;
  max-width: 500px;
  margin-top: 2rem;
}

.history-toggle {
  width: 100%;
  padding: 0.75rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.history-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.history-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
}

.history-question {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80%;
}

.history-vibe {
  font-size: 1.2rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 3rem 1rem;
  position: relative;
  z-index: 1;
}

.collab-text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.5rem;
}

.collab-text a {
  color: var(--pink);
  text-decoration: none;
  transition: color 0.3s ease;
}

.collab-text a:hover {
  color: white;
}

.love-text {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  margin-bottom: 1rem;
}

.berrry-link {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: linear-gradient(135deg, var(--berry), var(--pink));
  border-radius: 20px;
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.berrry-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(255, 51, 102, 0.4);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .header {
    padding: 1.5rem 1rem;
  }

  .title {
    font-size: 1.4rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .crystal-ball-wrapper {
    width: 280px;
    height: 280px;
  }

  .fortune-scroll {
    padding: 1rem;
  }

  .fortune-response p {
    font-size: 1rem;
  }
}