@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Lora:ital@0;1&display=swap');

body {
  font-family: 'Lora', serif;
  background: #0c0c0c url('https://websim.ai/tarot_bg.jpg') no-repeat center center fixed;
  background-size: cover;
  color: #e0e0e0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
}

h1 {
  font-family: 'Cinzel', serif;
  font-size: 2.5em;
  margin-bottom: 10px;
  text-align: center;
  color: #d4af37;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

.grammar-box {
  background: rgba(20, 10, 30, 0.8);
  border: 1px solid #d4af37;
  padding: 15px 25px;
  border-radius: 8px;
  margin-bottom: 30px;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.grammar-box p {
  margin: 5px 0;
  font-size: 1.1em;
}

.grammar-box strong {
  color: #d4af37;
  font-family: 'Cinzel', serif;
}

.master-card-container {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  width: 100%;
}

.card.master {
  width: 320px;
  height: 520px;
  filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.6));
}

.card.master .card-front {
  background-image: url('eye_of_fate.png');
  border: 3px solid #d4af37;
}

.card.master:hover {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

@keyframes shuffle-animation {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-10px, 5px) rotate(-2deg); }
  50% { transform: translate(10px, -5px) rotate(2deg); }
  75% { transform: translate(-5px, -5px) rotate(-1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.shuffling {
  animation: shuffle-animation 0.1s infinite;
  pointer-events: none;
}

/* Destiny Overlay Styles */
#destiny-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#destiny-overlay.visible {
  display: flex;
  opacity: 1;
}

.revealed-card-container {
  position: relative;
  width: 320px;
  height: 520px;
  margin-bottom: 30px;
  perspective: 1000px;
}

.revealed-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: rotateY(0deg);
}

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

.revealed-card-front, .revealed-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  border: 4px solid #d4af37;
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
}

.revealed-card-front {
  background: url('tarot_card_back.png') center/cover;
}

.revealed-card-back {
  transform: rotateY(180deg);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.destiny-info {
  text-align: center;
  max-width: 500px;
  color: #fff;
  padding: 0 20px;
}

.destiny-info h2 {
  font-family: 'Cinzel', serif;
  color: #d4af37;
  font-size: 2.2em;
  margin: 10px 0;
}

.close-overlay {
  margin-top: 30px;
  padding: 12px 30px;
  background: #d4af37;
  color: #000;
  border: none;
  border-radius: 5px;
  font-family: 'Cinzel', serif;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

.close-overlay:hover {
  transform: scale(1.1);
  background: #f1c40f;
}

#tarot-deck, #post-it-deck {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: 1200px;
  margin-bottom: 40px;
}

.section-title {
  font-family: 'Cinzel', serif;
  font-size: 2em;
  color: #d4af37;
  margin: 40px 0 20px;
  text-align: center;
  width: 100%;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

.post-it {
  width: 280px;
  height: 480px;
  background: #fdf5e6;
  background-image: linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px);
  background-size: 100% 1.5em;
  color: #2c1e0f;
  padding: 30px 20px;
  box-sizing: border-box;
  border-radius: 2px;
  box-shadow: 5px 5px 15px rgba(0,0,0,0.5), inset 0 0 50px rgba(0,0,0,0.1);
  position: relative;
  transform: rotate(var(--rotation));
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(0,0,0,0.1);
}

.post-it::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: rgba(212, 175, 55, 0.3);
  border-bottom: 1px solid rgba(212, 175, 55, 0.5);
}

.post-it-title {
  font-family: 'Cinzel', serif;
  font-weight: bold;
  font-size: 1.4em;
  margin-bottom: 20px;
  color: #4a3728;
  border-bottom: 2px solid #d4af37;
  padding-bottom: 5px;
  z-index: 1;
}

.post-it-content {
  font-family: 'Lora', serif;
  font-size: 1.1em;
  line-height: 1.6;
  font-style: italic;
  z-index: 1;
}

.post-it-label {
  font-family: 'Cinzel', serif;
  font-size: 0.8em;
  font-weight: bold;
  color: #d4af37;
  margin-bottom: 10px;
  z-index: 1;
}

.card {
  width: 280px;
  height: 480px;
  perspective: 1200px;
  cursor: pointer;
}

.card-inner {
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  position: relative;
}

.card:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  background-size: cover;
  background-position: center;
}

.card-front {
  background-image: url('tarot_card_back.png');
}

.card-back {
  transform: rotateY(180deg);
  background-color: #1a1a1a;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
  overflow: hidden;
  border: 2px solid #d4af37;
}

.card-image-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.card-info-overlay {
  position: relative;
  z-index: 2;
  background: linear-gradient(transparent, rgba(0,0,0,0.95) 35%);
  width: 100%;
  padding: 25px 20px 20px;
  box-sizing: border-box;
  max-height: 75%;
  overflow-y: auto;
}

.card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5em;
  font-weight: bold;
  margin-bottom: 8px;
  color: #d4af37;
  text-shadow: 2px 2px 4px rgba(0,0,0,1);
}

.card-hint, .card-prediction, .card-past {
  font-size: 1.1em;
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 10px;
  color: #ffffff;
  text-shadow: 1px 1px 3px rgba(0,0,0,1);
}

#reading {
  margin-top: 40px;
  padding: 20px;
  background: rgba(0,0,0,0.7);
  border-radius: 10px;
  text-align: center;
  max-width: 800px;
}

#reading h2 {
  font-family: 'Cinzel', serif;
  color: #d4af37;
  margin-bottom: 15px;
}

#reading-text {
  font-size: 1.1em;
  line-height: 1.6;
}