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

:root {
  --primary-color: #ff9933;
  --secondary-color: #ffb347;
  --accent-color: #ffd700;
  --bg-dark: #0a0a1a;
  --bg-card: rgba(20, 20, 40, 0.9);
  --text-light: #e8e8f0;
  --text-muted: #a0a0b0;
  --fox-orange: #ff9933;
  --fox-pink: #ffb8d4;
}

body {
  font-family: 'Georgia', serif;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a2a 100%);
  min-height: 100vh;
  color: var(--text-light);
  overflow-x: hidden;
}

/* Starry background */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #fff, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 90px 40px, #fff, transparent),
    radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 230px 80px, #fff, transparent),
    radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 350px 200px, #fff, transparent),
    radial-gradient(2px 2px at 420px 50px, rgba(255,255,255,0.8), transparent);
  background-size: 500px 500px;
  animation: twinkle 8s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

/* Language Selector */
.language-selector {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 100;
}

.language-selector select {
  background: rgba(20, 20, 40, 0.8);
  color: var(--text-light);
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.language-selector select:hover {
  background: rgba(30, 30, 60, 0.9);
  border-color: var(--accent-color);
  box-shadow: 0 0 10px rgba(255, 153, 51, 0.3);
}

.language-selector select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.language-selector select option {
  background: #1a1a3a;
  color: var(--text-light);
  padding: 0.5rem;
}

/* RTL Support */
[dir="rtl"] .language-selector {
  right: auto;
  left: 1rem;
}

[dir="rtl"] .secondary-btn {
  direction: rtl;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

/* Kitsune Character */
.character-container {
  position: relative;
  margin-bottom: 1rem;
}

.kitsune {
  position: relative;
  width: 120px;
  height: 140px;
  margin: 0 auto;
  animation: float 3s ease-in-out infinite;
}

.fox-face {
  position: absolute;
  width: 80px;
  height: 70px;
  background: linear-gradient(180deg, #ffb347 0%, #ff9933 100%);
  border-radius: 50% 50% 45% 45%;
  top: 30px;
  left: 20px;
  box-shadow: inset 0 -10px 20px rgba(0,0,0,0.1);
}

.fox-face::before {
  content: '';
  position: absolute;
  width: 50px;
  height: 40px;
  background: #fff5eb;
  border-radius: 50%;
  bottom: 0;
  left: 15px;
}

.fox-ears .ear {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 35px solid #ffb347;
  top: 5px;
}

.fox-ears .ear::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 20px solid #ffb8d4;
  top: 10px;
  left: -10px;
}

.fox-ears .ear.left {
  left: 15px;
  transform: rotate(-15deg);
}

.fox-ears .ear.right {
  right: 15px;
  transform: rotate(15deg);
}

.fox-eyes {
  position: absolute;
  display: flex;
  gap: 20px;
  top: 20px;
  left: 15px;
}

.fox-eyes .eye {
  width: 16px;
  height: 16px;
  background: #2a1810;
  border-radius: 50%;
  position: relative;
  animation: blink 4s ease-in-out infinite;
}

.fox-eyes .eye .sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
}

@keyframes blink {
  0%, 90%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}

.fox-nose {
  position: absolute;
  width: 12px;
  height: 8px;
  background: #2a1810;
  border-radius: 50%;
  top: 40px;
  left: 34px;
}

.fox-mouth {
  position: absolute;
  width: 20px;
  height: 8px;
  border-bottom: 2px solid #2a1810;
  border-radius: 0 0 50% 50%;
  top: 48px;
  left: 30px;
}

.fox-cheeks .cheek {
  position: absolute;
  width: 14px;
  height: 8px;
  background: #ffb8d4;
  border-radius: 50%;
  top: 38px;
  opacity: 0.8;
}

.fox-cheeks .cheek.left {
  left: 5px;
}

.fox-cheeks .cheek.right {
  right: 5px;
}

.fox-body {
  position: absolute;
  width: 60px;
  height: 40px;
  background: linear-gradient(180deg, #ff9933 0%, #ffb347 100%);
  border-radius: 50% 50% 40% 40%;
  bottom: 10px;
  left: 30px;
}

.fox-tail {
  position: absolute;
  width: 35px;
  height: 50px;
  background: linear-gradient(90deg, #ffb347, #ff9933);
  border-radius: 50% 80% 20% 50%;
  bottom: 15px;
  right: 5px;
  transform: rotate(30deg);
  transform-origin: bottom left;
  animation: wagTail 1s ease-in-out infinite;
}

.fox-tail::after {
  content: '';
  position: absolute;
  width: 15px;
  height: 20px;
  background: #fff5eb;
  border-radius: 50%;
  bottom: 0;
  right: 5px;
}

@keyframes wagTail {
  0%, 100% { transform: rotate(30deg); }
  50% { transform: rotate(45deg); }
}

.magic-sparkles {
  position: absolute;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 30px;
  top: 10px;
  font-size: 1.2rem;
}

.magic-sparkles span {
  animation: sparkle 1.5s ease-in-out infinite;
}

.magic-sparkles span:nth-child(2) {
  animation-delay: 0.5s;
}

.magic-sparkles span:nth-child(3) {
  animation-delay: 1s;
}

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

.character-name {
  color: var(--accent-color);
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

/* Kitsune Speech Bubble */
.kitsune-speech {
  background: linear-gradient(135deg, rgba(255, 179, 71, 0.15), rgba(255, 153, 51, 0.1));
  border: 1px solid rgba(255, 179, 71, 0.3);
  border-radius: 20px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.kitsune-speech::before {
  content: '🦊';
  position: absolute;
  top: -15px;
  left: 20px;
  font-size: 1.5rem;
}

.kitsune-speech p {
  margin: 0;
  text-align: left;
  font-style: italic;
  color: var(--text-light);
}

.kitsune-speech.small {
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.kitsune-speech.small p {
  font-size: 0.95rem;
  text-align: center;
}

.kitsune-mini {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

/* Loading Animation for Kitsune */
.kitsune-thinking {
  font-size: 4rem;
  animation: thinking 1s ease-in-out infinite;
}

@keyframes thinking {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.loading-text {
  font-style: italic;
  color: var(--accent-color);
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 1rem;
}

.loading-dots span {
  animation: bounce 0.6s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.crystal-ball {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

h1 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.tagline {
  color: var(--text-muted);
  font-style: italic;
}

.card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 179, 71, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 50px rgba(255, 153, 51, 0.2);
}

.card h2 {
  color: var(--accent-color);
  margin-bottom: 1rem;
  text-align: center;
}

.card p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  text-align: center;
}

.question-area {
  margin-bottom: 1.5rem;
}

.question-area label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-light);
  font-size: 0.95rem;
}

textarea {
  width: 100%;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 179, 71, 0.3);
  background: rgba(10, 10, 26, 0.8);
  color: var(--text-light);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.3s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--fox-orange);
}

textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.primary-btn {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-family: inherit;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.primary-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 5px 25px rgba(255, 153, 51, 0.5);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.secondary-btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--fox-orange);
  border-radius: 50px;
  background: transparent;
  color: var(--fox-orange);
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.3s ease;
}

.secondary-btn:hover {
  background: rgba(255, 153, 51, 0.1);
}

/* Stripe Elements */
#card-element {
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 179, 71, 0.3);
  background: rgba(10, 10, 26, 0.8);
  margin-bottom: 1rem;
}

#card-errors {
  color: #ff6b6b;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-align: center;
}

/* Loading Animation */
.loading-animation {
  text-align: center;
  padding: 2rem;
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.loading-animation p {
  margin-top: 1rem;
  font-style: italic;
  animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Fortune Display */
.fortune-display {
  background: linear-gradient(135deg, rgba(255, 153, 51, 0.15), rgba(255, 179, 71, 0.1));
  border-radius: 15px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.fortune-text {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--text-light);
  text-align: center;
  font-style: italic;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

footer {
  text-align: center;
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .crystal-ball {
    font-size: 3rem;
  }
}
