/* =====================================================
   ESTILOS VISOR 3D - Tema Morado + Rojo Mistico
   ===================================================== */

:root {
  --mystique-deep: #0a0508;
  --mystique-dark: #1a0f1e;
  --mystique-purple: #7c3aed;
  --mystique-violet: #a855f7;
  --mystique-red: #dc2626;
  --mystique-crimson: #991b1b;
  --mystique-magenta: #ec4899;
  --mystique-gold: #fbbf24;
  --mystique-text: #e8d5b0;
  --mystique-muted: #9e7c6b;
  --mystique-glow: rgba(168, 85, 247, 0.3);
  --mystique-border: rgba(168, 85, 247, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--mystique-deep);
  color: var(--mystique-text);
  font-family: 'Cinzel', serif;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ==================== FONDO ANIMADO ==================== */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ==================== NAVBAR ==================== */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(10, 5, 8, 0.97) 0%, rgba(26, 15, 30, 0.95) 100%);
  backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--mystique-purple);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 8px 32px rgba(168, 85, 247, 0.15);
}

.top-logo {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.9rem;
  background: linear-gradient(90deg, #a855f7, #ec4899, #dc2626);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: bold;
  letter-spacing: 0.1em;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.4));
}

.top-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.top-links a {
  color: var(--mystique-muted);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--mystique-border);
  border-radius: 2px;
  transition: all 0.3s;
  position: relative;
}

.top-links a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(220, 38, 38, 0.1));
  opacity: 0;
  border-radius: 2px;
  transition: opacity 0.3s;
  pointer-events: none;
}

.top-links a:hover,
.top-links a.active {
  color: var(--mystique-gold);
  border-color: var(--mystique-purple);
  background: rgba(168, 85, 247, 0.08);
}

.top-links a.active::before {
  opacity: 1;
}

/* ==================== HERO ==================== */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 8rem 2rem 3rem;
  background: radial-gradient(ellipse 70% 50% at 50% 100%, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
  border-bottom: 2px solid var(--mystique-purple);
  margin-bottom: 2rem;
}

.hero-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.5em;
  color: var(--mystique-magenta);
  text-transform: uppercase;
  margin-bottom: 1rem;
  animation: fadeDown 0.8s ease both;
}

.hero h1 {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  background: linear-gradient(150deg, #ec4899 0%, #a855f7 35%, #7c3aed 70%, #dc2626 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(168, 85, 247, 0.5));
  margin-bottom: 0.5rem;
  animation: blazeIn 1s ease both;
}

.hero-sub {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  color: var(--mystique-muted);
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

.hero-sub small {
  display: block;
  font-size: 0.8rem;
  color: var(--mystique-purple);
  margin-top: 0.5rem;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes blazeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ==================== CONTROLES ==================== */
.controls-bar {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 1.2rem 1.5rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(26, 15, 30, 0.6), rgba(10, 5, 8, 0.6));
  border: 1px solid var(--mystique-border);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.1);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.control-group label {
  color: var(--mystique-text);
  font-weight: 500;
  white-space: nowrap;
}

.beast-select,
.slider {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--mystique-purple);
  color: var(--mystique-text);
  font-family: 'Cinzel', serif;
  border-radius: 4px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  transition: all 0.25s;
  outline: none;
}

.beast-select:hover,
.beast-select:focus {
  border-color: var(--mystique-magenta);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}

.slider {
  width: 120px;
  accent-color: var(--mystique-magenta);
  cursor: pointer;
}

.control-group input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--mystique-magenta);
  width: 16px;
  height: 16px;
}

.btn-reset {
  background: linear-gradient(135deg, var(--mystique-purple), var(--mystique-magenta));
  color: #fff;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  transition: all 0.25s;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.btn-reset:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}

/* ==================== VIEWER CONTAINER ==================== */
.viewer-container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

.canvas-3d {
  width: 100%;
  height: 600px;
  background: radial-gradient(ellipse at 50% 50%, rgba(168, 85, 247, 0.05), rgba(220, 38, 38, 0.05));
  border: 2px solid var(--mystique-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.2), inset 0 0 40px rgba(220, 38, 38, 0.1);
}

#canvas3d canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ==================== INFORMACION DE BESTIA ==================== */
.beast-info {
  background: linear-gradient(135deg, rgba(26, 15, 30, 0.8), rgba(10, 5, 8, 0.8));
  border: 1px solid var(--mystique-border);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.15);
  backdrop-filter: blur(10px);
  max-height: 600px;
  overflow-y: auto;
}

.info-header {
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--mystique-border);
  padding-bottom: 0.8rem;
}

.info-header h2 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.3rem;
  color: var(--mystique-magenta);
  margin-bottom: 0.3rem;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.3));
}

.info-element {
  font-size: 0.75rem;
  color: var(--mystique-purple);
  letter-spacing: 0.1em;
}

.info-description {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 0.8rem;
  color: var(--mystique-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.info-abilities {
  font-size: 0.75rem;
}

.ability-item {
  background: rgba(168, 85, 247, 0.08);
  border-left: 2px solid var(--mystique-magenta);
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
  border-radius: 2px;
}

.ability-key {
  color: var(--mystique-magenta);
  font-weight: bold;
  display: inline-block;
  margin-right: 0.4rem;
}

.ability-name {
  color: var(--mystique-gold);
  font-weight: 500;
}

/* ==================== LOADING ==================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 5, 8, 0.95);
  backdrop-filter: blur(10px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: float 2s ease-in-out infinite;
}

.loading-overlay p {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  color: var(--mystique-muted);
  font-size: 1rem;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
}

/* ==================== FOOTER ==================== */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--mystique-border);
  color: var(--mystique-muted);
  font-size: 0.85rem;
  margin-top: 1rem;
}

footer a {
  color: var(--mystique-purple);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--mystique-magenta);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .viewer-container {
    grid-template-columns: 1fr;
  }

  .canvas-3d {
    height: 500px;
  }

  .beast-info {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 6rem 1.5rem 2rem;
  }

  .controls-bar {
    flex-direction: column;
    gap: 1rem;
  }

  .control-group {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .beast-select {
    width: 100%;
  }

  .canvas-3d {
    height: 400px;
  }

  .top-bar {
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }

  .top-links {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .canvas-3d {
    height: 300px;
  }

  .controls-bar {
    font-size: 0.75rem;
    padding: 0.8rem;
  }

  .control-group label {
    font-size: 0.75rem;
  }
}

/* ==================== SCROLLBAR ==================== */
.beast-info::-webkit-scrollbar {
  width: 6px;
}

.beast-info::-webkit-scrollbar-track {
  background: rgba(168, 85, 247, 0.05);
  border-radius: 3px;
}

.beast-info::-webkit-scrollbar-thumb {
  background: var(--mystique-purple);
  border-radius: 3px;
}

.beast-info::-webkit-scrollbar-thumb:hover {
  background: var(--mystique-magenta);
}