:root {
  --primary: #7fff00;
  --primary-dark: #5fb000;
  --primary-glow: rgba(127, 255, 0, 0.5);
  --bg-dark: #0a0a0a;
  --bg-card: #1a1a1a;
  --bg-card-hover: #2a2a2a;
  --text-primary: #e0e0e0;
  --text-secondary: #888;
  --border-color: #333;
  --error: #ff4500;
  --success: #7fff00;
  --font-mono: 'Courier New', monospace;
  --font-main: 'Segoe UI', system-ui, sans-serif;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 300;
  letter-spacing: 1px;
}
.glow-text {
  color: var(--primary);
  text-shadow: 0 0 10px var(--primary-glow);
}
.mono {
  font-family: var(--font-mono);
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}
.section {
  margin-bottom: 3rem;
}
.main-header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}
.main-header h1 {
  color: var(--primary);
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 0 20px var(--primary-glow);
  animation: glow 3s ease-in-out infinite;
}
.main-header p {
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-style: italic;
  font-size: 1.1rem;
}
@keyframes glow {
  0%,
  100% {
    text-shadow: 0 0 20px var(--primary-glow);
  }
  50% {
    text-shadow:
      0 0 40px var(--primary-glow),
      0 0 60px var(--primary-glow);
  }
}
.card-click-counter {
  position: fixed;
  top: 20px;
  left: 20px;
  background: var(--bg-card);
  color: var(--primary);
  padding: 0.5rem 1.5rem;
  border-radius: 30px;
  font-size: 1.2rem;
  font-weight: bold;
  border: 2px solid var(--primary);
  z-index: 1000;
  box-shadow: 0 0 20px var(--primary-glow);
  backdrop-filter: blur(5px);
  font-family: var(--font-mono);
}
.watermark-top {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 3rem;
  opacity: 0.15;
  color: var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1000;
  pointer-events: none;
}
.watermark-top span {
  font-size: 1.2rem;
  background: var(--primary);
  color: var(--bg-dark);
  padding: 0.2rem 1rem;
  border-radius: 30px;
  margin-top: 5px;
  opacity: 0.8;
}
.depth-indicator {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: var(--primary);
  color: var(--bg-dark);
  padding: 0.5rem 1.5rem;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: bold;
  z-index: 1000;
  box-shadow: 0 0 20px var(--primary-glow);
  font-family: var(--font-mono);
}
.categorias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.categoria-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  border-left: 8px solid var(--primary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.categoria-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(127, 255, 0, 0.1),
    transparent
  );
  transition: left 0.5s;
}
.categoria-card:hover::before {
  left: 100%;
}
.categoria-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px var(--primary-glow);
  background: var(--bg-card-hover);
}
.categoria-titulo {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 1rem;
  font-weight: bold;
}
.categoria-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}
.libros-section,
.capitulos-section,
.escritos-section {
  background: var(--bg-card);
  border-radius: 30px;
  padding: 2rem;
  margin-top: 2rem;
  border: 2px solid var(--primary);
  animation: slideIn 0.5s ease;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.section-title {
  color: var(--primary);
  font-size: 2rem;
  font-weight: bold;
}
.section-title small {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-left: 1rem;
}
.libros-grid,
.capitulos-grid,
.escritos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}
.libro-item,
.capitulo-item {
  background: var(--bg-card-hover);
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}
.libro-item:hover,
.capitulo-item:hover {
  border-color: var(--primary);
  transform: scale(1.05);
  background: #3a3a3a;
  box-shadow: 0 10px 30px var(--primary-glow);
}
.libro-icono,
.capitulo-icono {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}
.libro-nombre,
.capitulo-nombre {
  color: var(--primary);
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}
.libro-etapa {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.escrito-card {
  background: var(--bg-card-hover);
  border-radius: 15px;
  padding: 1.5rem;
  border-left: 4px solid var(--primary);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.escrito-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px var(--primary-glow);
  background: #3a3a3a;
}
.escrito-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.escrito-referencia {
  color: var(--primary);
  font-size: 0.9rem;
  font-family: var(--font-mono);
  font-weight: bold;
  background: var(--bg-card);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--primary);
}
.escrito-contador {
  background: var(--bg-card);
  color: var(--primary);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  border: 1px solid var(--primary);
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.escrito-contador::before {
  content: '⚡';
  font-size: 0.9rem;
  filter: brightness(1.2);
}
.escrito-texto {
  color: #ddd;
  line-height: 1.6;
  font-size: 1rem;
  margin-bottom: 1rem;
  font-style: italic;
}
.escrito-pie {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.volver-btn {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 0.8rem 2rem;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
  font-size: 1rem;
  font-family: inherit;
}
.volver-btn:hover {
  background: var(--primary);
  color: var(--bg-dark);
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--primary-glow);
}
.btn-primario {
  background: var(--primary);
  color: var(--bg-dark);
  border: none;
  padding: 1rem 2rem;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1.1rem;
}
.btn-primario:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px var(--primary-glow);
}
.btn-secundario {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 1rem 2rem;
  border-radius: 60px;
  cursor: pointer;
  width: 100%;
  font-size: 1.2rem;
  transition: all 0.3s;
  font-weight: bold;
  font-family: inherit;
}
.btn-secundario:hover {
  background: var(--primary);
  color: var(--bg-dark);
  transform: scale(1.02);
}
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.98);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}
.modal-content {
  background: var(--bg-card);
  padding: 3rem;
  max-width: 500px;
  width: 90%;
  border-radius: 30px;
  border: 3px solid var(--primary);
  text-align: center;
  animation: modalAppear 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes modalAppear {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2rem;
  cursor: pointer;
  color: var(--primary);
  transition: transform 0.3s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.close:hover {
  transform: rotate(90deg);
}
.modal h2 {
  color: var(--primary);
  margin-bottom: 2rem;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}
.genero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}
.genero-btn {
  background: var(--bg-card-hover);
  border: none;
  color: white;
  padding: 2.5rem;
  border-radius: 30px;
  cursor: pointer;
  font-size: 4rem;
  transition: all 0.3s;
  border: 2px solid transparent;
}
.genero-btn:hover {
  border-color: var(--primary);
  transform: scale(1.1);
  box-shadow: 0 0 30px var(--primary-glow);
}
.genero-btn.mujer {
  background: #4a2a4a;
}
.genero-btn.hombre {
  background: #2a4a4a;
}
.reacciones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}
.reaccion-opcion {
  background: var(--bg-card-hover);
  border: 2px solid transparent;
  color: white;
  padding: 1.5rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 2.5rem;
  transition: all 0.2s;
}
.reaccion-opcion:hover {
  transform: scale(1.1);
  background: #3a3a3a;
}
.reaccion-opcion.seleccionada {
  background: var(--primary);
  color: var(--bg-dark);
  border-color: white;
  transform: scale(1.1);
  box-shadow: 0 0 30px var(--primary);
}
.explicacion-box {
  background: var(--bg-card-hover);
  padding: 2rem;
  border-radius: 20px;
  margin: 2rem 0;
  text-align: left;
  border-left: 4px solid var(--primary);
  font-size: 1.1rem;
  line-height: 1.8;
  color: #ddd;
}
.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}
.form-label {
  display: block;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-weight: bold;
}
.form-input {
  width: 100%;
  padding: 1rem;
  background: var(--bg-card-hover);
  border: 2px solid var(--primary);
  color: white;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s;
}
.form-input:focus {
  outline: none;
  box-shadow: 0 0 20px var(--primary-glow);
}
.form-radio-group {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin: 1rem 0;
}
.form-radio-label {
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.form-radio-label input[type='radio'] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}
.modal-venta {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.98);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}
.modal-venta-content {
  background: var(--bg-card);
  padding: 3rem;
  max-width: 500px;
  width: 90%;
  border-radius: 30px;
  border: 3px solid var(--error);
  text-align: center;
  animation: modalAppear 0.5s ease;
  position: relative;
}
.close-venta {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2rem;
  cursor: pointer;
  color: var(--error);
  transition: transform 0.3s;
}
.close-venta:hover {
  transform: rotate(90deg);
}
.precio-tag {
  font-size: 2.5rem;
  color: var(--primary);
  margin: 1rem 0;
  font-weight: bold;
}
.btn-comprar {
  background: var(--primary);
  color: var(--bg-dark);
  border: none;
  padding: 1.2rem;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1.2rem;
  width: 100%;
}
.btn-comprar:hover {
  background: #9fff00;
  transform: scale(1.05);
  box-shadow: 0 0 30px var(--primary);
}
.btn-ver {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 1.2rem;
  border-radius: 30px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.2rem;
  width: 100%;
  transition: all 0.3s;
}
.btn-ver:hover {
  background: var(--primary);
  color: var(--bg-dark);
}
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--primary);
  font-size: 1.5rem;
}
.loading::after {
  content: '...';
  animation: dots 1.5s steps(5, end) infinite;
}
@keyframes dots {
  0%,
  20% {
    content: '.';
  }
  40% {
    content: '..';
  }
  60%,
  100% {
    content: '...';
  }
}
.main-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-secondary);
}
.footer-links {
  margin: 1rem 0;
}
.footer-links a {
  color: var(--primary);
  text-decoration: none;
  margin: 0 1rem;
  transition: color 0.3s;
}
.footer-links a:hover {
  text-decoration: underline;
}
.text-center {
  text-align: center;
}
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 2rem;
}
.mt-4 {
  margin-top: 3rem;
}
.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 2rem;
}
.mb-4 {
  margin-bottom: 3rem;
}
.hidden {
  display: none !important;
}
.error-text {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}
.success-text {
  color: var(--success);
}
/* ============================================
   MENÚ ADMIN PARA CATEGORÍAS
   ============================================ */
.categoria-menu-container {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 20;
}

.categoria-menu {
  cursor: pointer;
  padding: 0 5px;
  font-size: 1.5rem;
  color: #7fff00;
  display: inline-block;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  line-height: 20px;
  text-align: center;
  transition: background 0.2s;
}

.categoria-menu:hover {
  background: rgba(127, 255, 0, 0.2);
}

.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 5px;
  min-width: 120px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  margin-top: 5px;
}

.menu-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #fff;
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.menu-item:hover {
  background: #333;
}

.menu-item:first-child:hover {
  border-radius: 5px 5px 0 0;
}

.menu-item:last-child:hover {
  border-radius: 0 0 5px 5px;
}
