/**
 * Estilos para Oráculo de bola de cristal y clarividencia
 * fijate.com/tools/bola-cristal/
 */

:root {
  --crys-bg: #070a12;
  --crys-surface: #101524;
  --crys-surface-card: #161e32;
  --crys-surface-hover: #1f2a44;
  --crys-border: rgba(147, 197, 253, 0.25);
  --crys-border-subtle: rgba(255, 255, 255, 0.08);

  --crys-gold: #d4af37;
  --crys-gold-light: #f6d365;

  --crys-text: #f0f4fc;
  --crys-text-muted: #9ba8c2;
  --crys-text-bright: #ffffff;

  --crys-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.8);
  --crys-radius-md: 14px;
  --crys-radius-lg: 20px;
}

[data-theme="light"] {
  --crys-bg: #f5f7fb;
  --crys-surface: #ffffff;
  --crys-surface-card: #eef2f8;
  --crys-surface-hover: #e2e8f4;
  --crys-border: rgba(99, 102, 241, 0.25);
  --crys-border-subtle: rgba(0, 0, 0, 0.08);

  --crys-gold: #9a6f14;
  --crys-gold-light: #b8861e;

  --crys-text: #1e293b;
  --crys-text-muted: #475569;
  --crys-text-bright: #0f172a;

  --crys-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.1);
}

body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--crys-bg);
  color: var(--crys-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  color: var(--crys-text-bright);
}

.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  flex: 1 0 auto;
}

/* Tarjeta principal de la bola de cristal */
.crystal-orb-card {
  background: radial-gradient(circle at 50% 30%, var(--crys-surface) 0%, var(--crys-bg) 100%);
  border: 1px solid var(--crys-border);
  border-radius: var(--crys-radius-lg);
  padding: 2.5rem 1.5rem;
  box-shadow: var(--crys-shadow);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.orb-wrapper {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto;
}

/* Base de soporte tridimensional de bronce labrado */
.orb-stand {
  width: 200px;
  height: 45px;
  background: linear-gradient(180deg, #aa771c 0%, #5b3d08 100%);
  border-radius: 50%;
  margin: -25px auto 1.5rem;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.9);
  border: 1px solid #d4af37;
  position: relative;
  z-index: 1;
}

/* Esfera de cristal */
.orb-sphere {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 45px rgba(56, 189, 248, 0.25), inset 0 0 50px rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.2) 0%, rgba(30, 58, 138, 0.4) 60%, rgba(15, 23, 42, 0.95) 100%);
  cursor: pointer;
  z-index: 2;
}

/* Reflejo especular blanco superior */
.orb-sphere::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 35px;
  width: 80px;
  height: 40px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 50%;
  transform: rotate(-30deg);
  pointer-events: none;
}

#crystal-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Símbolo que se revela en el centro de la esfera */
.orb-vision-display {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
  z-index: 5;
}

.orb-vision-display.revealed {
  opacity: 1;
}

.vision-symbol-glyph {
  font-size: 4rem;
  filter: drop-shadow(0 0 16px var(--crys-gold));
  animation: floatGlyph 3s ease-in-out infinite;
}

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

/* Botones y controles */
.btn-crys {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--crys-radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  border: none;
  transition: all 0.25s ease;
}

.btn-crys-primary {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #0b0f19;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.35);
}

.btn-crys-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #38bdf8, #7dd3fc);
  transform: translateY(-1px);
}

.btn-crys-secondary {
  background: var(--crys-surface-card);
  color: var(--crys-text);
  border: 1px solid var(--crys-border-subtle);
}

/* Tarjeta de interpretación oracular */
.vision-reading-card {
  background: var(--crys-surface);
  border: 1px solid var(--crys-border);
  border-radius: var(--crys-radius-lg);
  padding: 2rem;
  margin-top: 2rem;
  text-align: left;
  display: none;
  animation: fadeIn 0.6s ease;
}

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

/* Cuadrícula de la enciclopedia de visiones */
.visions-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.vision-mini-card {
  background: var(--crys-surface);
  border: 1px solid var(--crys-border-subtle);
  border-radius: var(--crys-radius-md);
  padding: 1.25rem;
  transition: all 0.25s ease;
}

.vision-mini-card:hover {
  border-color: var(--crys-border);
  transform: translateY(-2px);
}

@media (max-width: 600px) {
  .btn-crys {
    width: 100%;
  }
}
