:root {
  --primary-color: #6c5ce7;
  --secondary-color: #00cec9;
  --accent-color: #fd79a8;
  --bg-dark: #0c0c0c;
  --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
  --text-light: #f8f9fa;
  --glow-color: #00b894;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-light);
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
}

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

.container {
  max-width: 600px;
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

h1 {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(45deg, var(--secondary-color), var(--accent-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  animation: shimmer 3s infinite;
}

.title-main, .title-end {
  display: block;
}

.magic-blank {
  font-family: 'Georgia', serif;
  font-style: italic;
  background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding: 0 0.5rem;
  opacity: 0.8;
  animation: shimmer 2s infinite alternate;
}

.subtitle {
  font-size: 1.3rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

.input-wrapper {
  margin: 1.5rem 0;
}

input {
  width: 100%;
  max-width: 450px;
  padding: 1.2rem 1.5rem;
  margin: 1rem auto;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  font-size: 1.1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus {
  outline: none;
  border-color: var(--secondary-color);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 20px rgba(0, 206, 201, 0.3);
}

input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.primary-btn, .secondary-btn, .reset-btn {
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  border: none;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4);
}

.secondary-btn, .reset-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.8rem 1.5rem;
  font-size: 0.9rem;
}

.secondary-btn:hover, .reset-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.ai-options {
  margin: 1.5rem 0;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.ai-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.8;
}

.no-ai-warning {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.loading {
  margin: 3rem 0;
}

.magic-circle {
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
  position: relative;
}

.circle-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid transparent;
  border-radius: 50%;
  animation: rotate 3s infinite linear;
}

.layer-1 {
  border-color: var(--secondary-color);
  animation-delay: 0s;
}

.layer-2 {
  border-color: var(--accent-color);
  animation-delay: -1s;
  transform: scale(0.8);
}

.layer-3 {
  border-color: var(--primary-color);
  animation-delay: -2s;
  transform: scale(0.6);
}

.runes {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--secondary-color);
  animation: pulse 2s infinite alternate;
}

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

@keyframes pulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

.deck {
  perspective: 1000px;
  margin: 2rem 0;
}

.tarot-card {
  width: 350px;
  height: 500px;
  margin: 0 auto;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.tarot-card.revealed {
  transform: rotateY(180deg);
}

.card-back, .card-content {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-back {
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
}

.card-back::before {
  content: '🌙';
  font-size: 4rem;
}

.card-content {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: rotateY(180deg);
  padding: 2rem;
}

.sigil {
  width: 100px;
  height: 100px;
  margin-bottom: 1.5rem;
}

.sigil img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#cardTitle {
  color: var(--secondary-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.result-text {
  line-height: 1.8;
  font-size: 1rem;
  max-height: 350px;
  overflow-y: auto;
  padding: 0 1rem;
}

.result-text::-webkit-scrollbar {
  width: 4px;
}

.result-text::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.result-text::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 2px;
}

.reading-actions {
  margin-top: 2rem;
}

.saved-readings {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.saved-reading {
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 8px;
  margin: 0.5rem;
  max-width: 500px;
  text-align: left;
}

.category-highlight {
  color: var(--accent-color);
  font-weight: 700;
  font-style: italic;
}

@keyframes shimmer {
  0% { background-position: -500px 0; }
  100% { background-position: 500px 0; }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .container {
    margin: 1rem;
    padding: 2rem 1rem;
  }
  
  h1 {
    font-size: 2.2rem;
  }
  
  .tarot-card {
    width: 300px;
    height: 420px;
  }
  
  .ai-options {
    flex-direction: column;
    align-items: center;
  }
}

.hidden {
  display: none !important;
}

