/* ===========================
   PAGE ORACLE — Fullscreen 9:16 Mobile-First
   =========================== */

* { box-sizing: border-box; }

.oracle-fullscreen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Centrer en mode desktop pour simuler le 9:16 */
  max-width: 500px;
  margin: 0 auto;
}

/* Sur desktop, fond sombre autour */
body.oracle-body {
  background: #0a0a0a;
  margin: 0;
  overflow: hidden;
}

/* ── Video plein ecran ── */
.oracle-video-wrap {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
}

.oracle-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.oracle-video-wrap .no-video-bg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a0a2e, #0a1a2e);
  font-family: 'Playfair Display', serif;
  font-size: 80px;
  color: rgba(99, 130, 241, 0.3);
}

/* ── Overlay d'accueil oracle (slide up) ── */
.oracle-intro-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 24px;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.5) 50%,
    rgba(0,0,0,0.3) 100%
  );
  opacity: 1;
  transition: opacity 0.4s ease;
}

.oracle-intro-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.oracle-intro-overlay .oracle-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--gold);
  margin-bottom: 4px;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0,0,0,0.8), 0 2px 8px rgba(0,0,0,0.6);
}

.oracle-intro-overlay .oracle-tagline {
  font-size: 18px;
  color: var(--gold-light);
  font-weight: 600;
  margin-bottom: 8px;
  font-family: 'Playfair Display', serif;
  text-shadow: 0 0 10px rgba(0,0,0,0.8), 0 2px 8px rgba(0,0,0,0.6);
}

.oracle-intro-overlay .oracle-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  max-width: 350px;
  line-height: 1.5;
  margin-bottom: 24px;
  text-shadow: 0 0 8px rgba(0,0,0,0.9), 0 2px 6px rgba(0,0,0,0.7);
}

.oracle-intro-overlay .tirage-title {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 10px;
}

.tirage-modes {
  display: flex;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}

.tirage-mode-btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.tirage-mode-btn.active {
  background: linear-gradient(135deg, #3b82f6, #4338ca);
  color: #fff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5), 0 0 24px rgba(99, 102, 241, 0.25);
}

.consulter-btn {
  padding: 14px 48px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(270deg, #1e3a8a, #4338ca, #1e3a8a);
  background-size: 200% 100%;
  animation: shimmer 4s ease infinite;
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 12px;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4), 0 0 30px rgba(99, 102, 241, 0.2);
}

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

.consulter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.6), 0 6px 24px rgba(99, 102, 241, 0.35);
}

.oracle-intro-overlay .cost-display {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

.oracle-intro-overlay .cost-display strong {
  color: var(--gold);
}

/* ── Tap zone (pour afficher/masquer l'overlay) ── */
.tap-zone {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: 120px; /* au-dessus de la bottom bar */
  z-index: 15;
  cursor: pointer;
}

/* ── Bottom bar (toujours visible) ── */
.bottom-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  background: linear-gradient(to top, rgba(0,0,0,0.95), rgba(0,0,0,0.7), transparent);
  padding: 60px 12px 12px;
}

.suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.suggestion-item {
  padding: 10px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.suggestion-item:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(99,130,241,0.3);
  color: #fff;
}

.input-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-bar input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
}

.input-bar input:focus {
  outline: none;
  border-color: var(--gold);
}

.input-bar input::placeholder {
  color: rgba(255,255,255,0.35);
}

.send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #4338ca);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4), 0 0 24px rgba(99, 130, 241, 0.2);
}

.send-btn:hover { transform: scale(1.1); box-shadow: 0 0 18px rgba(99, 102, 241, 0.6), 0 0 30px rgba(99, 130, 241, 0.3); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── Cards overlay (pendant la reponse) ── */
.cards-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 25;
  pointer-events: none;
  perspective: 1200px;
  perspective-origin: 50% 50%;
}

/* ── Card 3D system ── */
.card-wrapper {
  position: absolute;
  opacity: 0;
  transform-style: preserve-3d;
  transition: none;
  will-change: transform, left, top, width, height, opacity;
  pointer-events: auto;
}

.card-flip {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 600ms ease-in-out;
  transform: rotateY(0deg);
}

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

.card-back {
  position: absolute; width: 100%; height: 100%;
  backface-visibility: hidden; transform: rotateY(0deg);
  overflow: hidden; border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 15px rgba(99,130,241,0.15);
  border: 2px solid rgba(99,130,241,0.3);
  background: linear-gradient(135deg, #1a0a3e, #2a1a4e);
  display: flex; align-items: center; justify-content: center;
}

.card-back .card-back-symbol { font-size: 36px; color: var(--gold); }

.card-front {
  position: absolute; width: 100%; height: 100%;
  backface-visibility: hidden; transform: rotateY(180deg);
  overflow: hidden; border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 15px rgba(99,130,241,0.15);
  border: 2px solid rgba(99,130,241,0.4);
}

.card-front img,
.card-front video { width: 100%; height: 100%; object-fit: cover; display: block; }

.card-front .card-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #6b2fa0, #8b1a4a);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 8px;
}
.card-front .card-placeholder .card-num { font-size: 28px; color: #f0d080; font-family: 'Playfair Display', serif; }
.card-front .card-placeholder .card-name { font-size: 14px; color: #7db8f0; margin-top: 6px; font-family: 'Playfair Display', serif; }

.card-wrapper.revealing .card-front,
.card-wrapper.revealing .card-back {
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 40px rgba(99,130,241,0.4);
  border-color: var(--gold);
}

/* Zoom fluide au touch sur les cartes */
.card-wrapper {
  transform-origin: center center;
}

/* ── Sous-titres ── */
.subtitle-overlay {
  position: absolute;
  bottom: 80px; left: 16px; right: 16px;
  z-index: 28;
  text-align: center;
  display: none;
  pointer-events: none;
}

.subtitle-overlay.visible { display: block; }

.subtitle-text {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  border-radius: 8px;
  font-size: 15px;
  color: #fff;
  line-height: 1.5;
  max-width: 100%;
}

/* ── Interpretation (en bas, au-dessus de la bottom bar) ── */
.interpretation-overlay {
  position: absolute;
  bottom: 70px; left: 12px; right: 12px;
  z-index: 28;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 16px;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  border: 1px solid rgba(99,130,241,0.15);
}

.interpretation-overlay.visible { display: block; }

.interpretation-overlay .oracle-says {
  font-family: 'Playfair Display', serif;
  font-size: 11px; color: var(--gold);
  text-transform: uppercase; letter-spacing: 2px;
  margin-bottom: 8px;
}

.interpretation-overlay .interp-text {
  font-size: 14px; color: rgba(255,255,255,0.85);
  line-height: 1.6;
}

/* ── Loading state ── */
.loading-indicator {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 26;
  display: none;
}

/* Mode par defaut (pas de code custom) : centrer le contenu */
.loading-indicator.visible { display: block; }
.loading-indicator > #loading-content {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}

/* Spinner simple dore */
.loading-indicator .spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(99,130,241,0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 14px;
}

.loading-indicator .loading-label {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  padding: 10px 24px;
  border-radius: 10px;
  border: 1px solid rgba(99,130,241,0.12);
  position: relative;
  overflow: visible;
}

.loading-indicator .loading-label p {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  margin: 0;
  font-style: italic;
}

/* Particules etoiles autour du texte */
.loading-indicator .loading-label::before,
.loading-indicator .loading-label::after {
  content: '';
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
  animation: sparkle 2s ease-in-out infinite;
}

.loading-indicator .loading-label::before {
  top: -6px; left: 15%;
  animation-delay: 0s;
}

.loading-indicator .loading-label::after {
  bottom: -6px; right: 12%;
  animation-delay: 0.7s;
}

/* Etoiles supplementaires via box-shadow */
.loading-indicator .sparkles {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}

.loading-indicator .sparkles::before,
.loading-indicator .sparkles::after {
  content: '';
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: rgba(240,208,128,0.8);
  box-shadow: 0 0 4px rgba(99,130,241,0.6);
}

.loading-indicator .sparkles::before {
  top: -8px; right: 20%;
  animation: sparkle 1.8s ease-in-out infinite 0.3s;
}

.loading-indicator .sparkles::after {
  bottom: -8px; left: 25%;
  animation: sparkle 2.2s ease-in-out infinite 1.1s;
}

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

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

/* ── Audio player mini ── */
.audio-mini {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 30;
  display: none;
}

.audio-mini.visible { display: flex; }

.audio-mini button {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: var(--gold);
  border: 1px solid rgba(99,130,241,0.3);
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Back button ── */
.back-btn {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 30;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}

.back-btn:hover { background: rgba(0,0,0,0.8); }

/* ── Credits badge ── */
.credits-mini {
  position: absolute;
  top: 12px; right: 56px;
  z-index: 30;
  padding: 6px 12px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 16px;
  font-size: 12px;
  color: #60a5fa;
  font-weight: 600;
}

/* ── Desktop: simuler un telephone ── */
@media (min-width: 501px) {
  .oracle-fullscreen {
    border-left: 1px solid rgba(255,255,255,0.05);
    border-right: 1px solid rgba(255,255,255,0.05);
  }
}
