/* ===== CSS Variables ===== */
:root {
  --primary: #c9a84c;
  --primary-light: #e8d48b;
  --primary-dark: #a07e2e;
  --accent: #e8728a;
  --accent-light: #f4a5b5;
  --bg-dark: #1a1033;
  --bg-darker: #0f0a20;
  --bg-card: rgba(255, 255, 255, 0.06);
  --bg-card-hover: rgba(255, 255, 255, 0.1);
  --text: #f0eaff;
  --text-muted: #b8aed0;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --success: #4ecdc4;
  --error: #ff6b6b;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --font-main: 'Heebo', sans-serif;
  --font-display: 'Secular One', sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background: var(--bg-darker);
  color: var(--text);
  direction: rtl;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-darker); }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== Particles Background ===== */
#particles-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  animation: floatParticle linear infinite;
}

@keyframes floatParticle {
  0% { opacity: 0; transform: translateY(100vh) scale(0); }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('_uploads/ai_204eb1a656148cdd.jpg');
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 10, 32, 0.5) 0%,
    rgba(15, 10, 32, 0.7) 50%,
    rgba(15, 10, 32, 0.95) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  max-width: 700px;
}

.hero-badge {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  font-size: 0.9rem;
  color: var(--primary-light);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
  animation: fadeInDown 1s ease-out;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--primary-light);
  margin-bottom: 0.5rem;
  animation: fadeInUp 1s ease-out 0.2s both;
  text-shadow: 0 0 40px rgba(201, 168, 76, 0.3);
}

.hero h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  color: var(--accent-light);
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease-out 0.4s both;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--bg-darker);
  font-family: var(--font-display);
  font-size: 1.2rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  animation: fadeInUp 1s ease-out 0.8s both;
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.4);
  text-decoration: none;
}

.hero-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(201, 168, 76, 0.6);
}

.hero-btn .arrow {
  display: inline-block;
  transition: transform 0.3s;
}

.hero-btn:hover .arrow {
  transform: translateX(-5px);
}

/* ===== Scroll Indicator ===== */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bounce 2s infinite;
}

.scroll-indicator span {
  display: block;
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--primary-light);
  border-bottom: 2px solid var(--primary-light);
  transform: rotate(45deg);
  opacity: 0.5;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-15px); }
  60% { transform: translateX(-50%) translateY(-7px); }
}

/* ===== Stage Container ===== */
.stage-section {
  display: none;
  padding: 4rem 1.5rem;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  position: relative;
}

.stage-section.active {
  display: flex;
}

.stage-card {
  max-width: 650px;
  width: 100%;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2.5rem;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  animation: cardAppear 0.6s ease-out;
}

@keyframes cardAppear {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.stage-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--bg-darker);
  margin-bottom: 1rem;
}

.stage-card h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--primary-light);
  margin-bottom: 1rem;
}

.stage-card .riddle-text {
  font-size: 1.1rem;
  color: var(--text);
  background: rgba(201, 168, 76, 0.08);
  border-right: 3px solid var(--primary);
  padding: 1.2rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1.5rem;
  line-height: 1.9;
}

.stage-card .hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-style: italic;
}

/* ===== Input Styles ===== */
.input-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.riddle-input {
  flex: 1;
  padding: 0.9rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 1rem;
  direction: rtl;
  transition: var(--transition);
}

.riddle-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(201, 168, 76, 0.2);
}

.submit-btn {
  padding: 0.9rem 1.8rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--bg-darker);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.4);
}

.submit-btn:active {
  transform: translateY(0);
}

/* Multiple choice */
.choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.choice-btn {
  padding: 1rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.choice-btn:hover {
  background: rgba(201, 168, 76, 0.15);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.choice-btn.correct {
  background: rgba(78, 205, 196, 0.2);
  border-color: var(--success);
}

.choice-btn.wrong {
  background: rgba(255, 107, 107, 0.2);
  border-color: var(--error);
}

/* ===== Alphabet Grid ===== */
.alpha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 6px;
  margin: 1rem 0;
}

.alpha-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.alpha-cell:hover {
  background: rgba(201, 168, 76, 0.2);
  border-color: var(--primary);
}

.alpha-cell.selected {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--bg-darker);
  border-color: var(--primary);
  font-weight: 700;
}

/* ===== Gift Reveal ===== */
.gift-section {
  display: none;
  padding: 4rem 1.5rem;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}

.gift-section.active {
  display: flex;
}

.gift-card {
  max-width: 650px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  animation: giftReveal 0.8s ease-out;
}

@keyframes giftReveal {
  0% { opacity: 0; transform: scale(0.5) rotate(-5deg); }
  50% { transform: scale(1.05) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.gift-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: giftPulse 2s ease-in-out infinite;
}

@keyframes giftPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.gift-card h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--primary-light);
  margin-bottom: 1rem;
}

.gift-card p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.gift-details {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  text-align: right;
  margin-bottom: 1.5rem;
}

.gift-details .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.gift-details .detail-row:last-child {
  border-bottom: none;
}

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

.detail-value {
  color: var(--primary-light);
  font-weight: 600;
}

.gift-image-container {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--glass-border);
}

.gift-image-container img {
  width: 100%;
  display: block;
  transition: transform 0.5s;
}

.gift-image-container:hover img {
  transform: scale(1.05);
}

/* Comparison images */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.comparison-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  position: relative;
}

.comparison-item img {
  width: 100%;
  display: block;
}

.comparison-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem;
  background: rgba(15, 10, 32, 0.8);
  font-size: 0.8rem;
  text-align: center;
  color: var(--primary-light);
}

/* ===== Continue Button ===== */
.continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  background: linear-gradient(135deg, var(--accent), #c75070);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 1rem;
}

.continue-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(232, 114, 138, 0.4);
}

/* ===== Scratch Card ===== */
.scratch-container {
  position: relative;
  width: 280px;
  height: 200px;
  margin: 1.5rem auto;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: crosshair;
}

.scratch-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(201,168,76,0.1), rgba(232,114,138,0.1));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

.scratch-reveal img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.scratch-canvas {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.scratch-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ===== Progress Bar ===== */
.progress-bar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: rgba(255,255,255,0.05);
  z-index: 100;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.6s ease;
  border-radius: 0 0 0 2px;
}

/* ===== Confetti ===== */
.confetti-piece {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(-20px) rotate(0deg); }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg); }
}

/* ===== Feedback Messages ===== */
.feedback {
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  font-size: 0.95rem;
  animation: fadeIn 0.3s ease;
  display: none;
}

.feedback.show { display: block; }
.feedback.error {
  background: rgba(255, 107, 107, 0.15);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: var(--error);
}
.feedback.success {
  background: rgba(78, 205, 196, 0.15);
  border: 1px solid rgba(78, 205, 196, 0.3);
  color: var(--success);
}

/* ===== Finale Section ===== */
.finale-section {
  display: none;
  padding: 4rem 1.5rem;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.finale-section.active { display: flex; }

.finale-content {
  max-width: 600px;
  animation: fadeInUp 1s ease-out;
}

.finale-heart {
  font-size: 5rem;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.3); }
  30% { transform: scale(1); }
  45% { transform: scale(1.2); }
}

.finale-content h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--primary-light);
  margin: 1rem 0;
}

.finale-content p {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 2;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.shimmer-text {
  background: linear-gradient(90deg, var(--primary-light), var(--accent-light), var(--primary-light));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .stage-card, .gift-card .gift-details {
    padding: 1.5rem;
  }

  .choices-grid {
    grid-template-columns: 1fr;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .input-group {
    flex-direction: column;
  }

  .alpha-grid {
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  }

  .hero-bg {
    background-attachment: scroll;
  }
}

@media (max-width: 480px) {
  .stage-card {
    padding: 1.2rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero h2 {
    font-size: 1.3rem;
  }
}
