:root {
  --accent: #b2ff24;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Arial", sans-serif;
}
body {
  background: #111;
  color: white;
  overflow: hidden;
}

.screen {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 10;
}
.screen.active {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  animation: screenAppear 0.5s ease;
}
@keyframes screenAppear {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scan-box {
  position: relative;
  width: 220px;
  height: 220px;
  border: 3px solid var(--accent);
  border-radius: 20px;
  overflow: hidden;
  animation: pulse 2s infinite;
}

/* Barrido lateral (luz que se mueve) */
.scan-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(178, 255, 36, 0.2), transparent);
  animation: scanLine 1.8s linear infinite;
  pointer-events: none;
}

/* Línea horizontal que simula escaneo */
.scan-box::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: #b2ff24;
  box-shadow: 0 0 10px #b2ff24;
  transform: translateY(-50%);
  animation: sweep 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

@keyframes scanLine {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes sweep {
  0% { left: -100%; opacity: 1; }
  50% { left: 100%; opacity: 1; }
  51% { left: -100%; opacity: 0; }
  100% { left: -100%; opacity: 0; }
}
.scan-text {
  margin-top: 20px;
  font-size: 22px;
  color: var(--accent);
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 6px var(--accent);
  }
  50% {
    box-shadow: 0 0 20px var(--accent);
  }
  100% {
    box-shadow: 0 0 6px var(--accent);
  }
}

.top-bar {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  animation: slideDown 0.4s ease;
  z-index: 25;
}
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#screenTitle {
  padding: 8px 25px;
  border-radius: 20px;
  font-size: 18px;
  background: var(--accent);
  color: black;
  transition: transform 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
#screenTitle:hover {
  transform: scale(1.05);
}

.nav-btn {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  color: black;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.3s ease;
  flex-shrink: 0;
}
.nav-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px var(--accent);
}
.nav-btn:active {
  transform: scale(0.9);
}

.content-area {
  flex: 1;
  width: 100%;
}

.menu-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 55px;
  height: 55px;
  font-size: 22px;
  color: black;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.3s ease;
  z-index: 30;
}
.menu-btn:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 0 20px var(--accent);
}

.filter-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -300px;
  height: 300px;
  background: rgba(0, 0, 0, 0.96);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  transition: bottom 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 25px;
  z-index: 40;
  backdrop-filter: blur(10px);
}
.filter-menu.active {
  bottom: 0;
}

.close-menu {
  position: absolute;
  top: 10px;
  right: 15px;
  background: var(--accent);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  color: black;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.close-menu:hover {
  transform: rotate(90deg);
}

.filter-track {
  margin-top: 60px;
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding: 10px 20px 30px 20px;
  width: 100%;
  scroll-snap-type: x mandatory;
  align-items: center;
}
.filter-track::-webkit-scrollbar {
  display: none;
}

.filter {
  min-width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: black;
  border: 4px solid transparent;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  cursor: pointer;
}
.filter:hover {
  transform: scale(1.1);
}
.filter.active {
  border-color: white;
  box-shadow: 0 0 20px var(--accent);
  transform: scale(1.15);
  animation: filterPulse 2s infinite;
}
@keyframes filterPulse {
  0% {
    box-shadow: 0 0 10px var(--accent);
  }
  50% {
    box-shadow: 0 0 25px var(--accent);
  }
  100% {
    box-shadow: 0 0 10px var(--accent);
  }
}

.screen-overlay {
  position: absolute;
  top: 80px;
  left: 15px;
  right: 15px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid var(--accent);
  border-radius: 15px;
  text-align: center;
  font-size: 16px;
  backdrop-filter: blur(10px);
  z-index: 15;
  animation: overlayAppear 0.4s ease;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
}
.screen-overlay:hover {
  box-shadow: 0 0 20px var(--accent);
}
@keyframes overlayAppear {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.context-buttons {
  position: absolute;
  bottom: 90px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 15px;
  z-index: 20;
  animation: buttonsAppear 0.5s ease;
  flex-wrap: wrap;
  padding: 0 15px;
}
@keyframes buttonsAppear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.context-btn {
  background: var(--accent);
  border: none;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 14px;
  color: black;
  font-weight: bold;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.3s ease;
  min-width: 110px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.context-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px var(--accent);
}
.context-btn:active {
  transform: scale(0.95);
}

.popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(5px);
}
.popup.active {
  display: flex;
  animation: popupFadeIn 0.3s ease;
}
@keyframes popupFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.popup-content {
  background: #111;
  border: 2px solid var(--accent);
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  width: 100%;
  max-width: 400px;
  margin: 0 20px;
  animation: popupScale 0.3s ease;
}
@keyframes popupScale {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
#closePopup {
  background: var(--accent);
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  margin-top: 15px;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.2s ease;
}
#closePopup:hover {
  transform: scale(1.05);
}

/* ===== LOADER CIRCULAR ===== */
#loading {
  background: radial-gradient(circle at center, #0a0f1e, #03060c);
  transition: opacity 0.5s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.loader {
  width: 120px;        /* Ajusta el tamaño a tu gusto */
  height: 120px;
  border: 5px solid rgba(178, 255, 36, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
  box-shadow: 0 0 15px rgba(178, 255, 36, 0.3);
}

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

/* Botón de información (si lo quieres dentro del loader) */
.info-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--accent, #b2ff24);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 22px;
  font-weight: bold;
  color: var(--accent, #b2ff24);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1010;
}

.info-btn:hover {
  transform: scale(1.05);
  background: var(--accent, #b2ff24);
  color: #000;
}

/* Botón de información (se mantiene igual) */
.info-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--accent, #b2ff24);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 22px;
  font-weight: bold;
  color: var(--accent, #b2ff24);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.info-btn:hover {
  transform: scale(1.05);
  background: var(--accent, #b2ff24);
  color: #000;
}
.debug-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.95);
  color: #0f0;
  padding: 15px;
  border-radius: 5px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  z-index: 1000;
  display: none;
  max-width: 300px;
  pointer-events: none;
  border: 1px solid #0f0;
}
.debug-panel.show {
  display: block;
}

.instructions {
  position: fixed;
  bottom: 10px;
  left: 0;
  width: 100%;
  text-align: center;
  color: white;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px;
  z-index: 5;
  font-size: 11px;
  pointer-events: none;
  backdrop-filter: blur(5px);
}

.error-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 50, 50, 0.95);
  color: white;
  padding: 20px;
  border-radius: 10px;
  z-index: 10000;
  text-align: center;
  display: none;
}
.error-message.show {
  display: block;
}
.reload-btn {
  margin-top: 10px;
  padding: 10px 20px;
  background: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
}

.a-scene {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1 !important;
}
.screen.active {
  pointer-events: auto;
}
.context-buttons,
.menu-btn,
.filter-menu,
.nav-btn,
#closePopup,
.reload-btn {
  pointer-events: auto;
}

/* Fireworks button - responsive */
.fireworks-btn {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: var(--accent);
  border: none;
  padding: 10px 15px;
  border-radius: 30px;
  font-size: 14px;
  color: black;
  font-weight: bold;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.3s ease;
  z-index: 25;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
@media (min-width: 768px) {
  .fireworks-btn {
    padding: 12px 20px;
    font-size: 15px;
  }
}
.fireworks-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--accent);
}
.fireworks-btn:active {
  transform: scale(0.95);
}

/* Seed selector - responsive */
.seed-selector {
  position: absolute;
  bottom: 80px;
  left: 20px;
  display: flex;
  gap: 8px;
  z-index: 25;
  animation: buttonsAppear 0.4s ease;
  flex-wrap: wrap;
  max-width: 200px;
}
.seed-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
@media (min-width: 768px) {
  .seed-btn {
    width: 35px;
    height: 35px;
  }
}
.seed-btn.active-seed {
  border-color: white;
  transform: scale(1.15);
  box-shadow: 0 0 12px currentColor;
}

/* Trivia / Galería mejorado */
.trivia-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.98);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 15px;
}
.trivia-container.active {
  display: flex;
}
.trivia-container .trivia-content {
  background: linear-gradient(145deg, #1a1a1a, #111);
  border: 2px solid var(--accent);
  border-radius: 25px;
  padding: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 0 30px rgba(178, 255, 36, 0.2);
}
.trivia-question {
  font-size: 18px;
  margin-bottom: 20px;
  line-height: 1.4;
}
.trivia-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}
.trivia-option {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--accent);
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.trivia-option:hover {
  background: var(--accent);
  color: black;
  transform: scale(1.02);
}
.trivia-option.correct {
  background: #4caf50;
  border-color: #4caf50;
  color: white;
}
.trivia-option.incorrect {
  background: #f44336;
  border-color: #f44336;
  color: white;
}
.trivia-score {
  font-size: 28px;
  font-weight: bold;
  color: var(--accent);
  margin: 20px 0;
}
.trivia-progress {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  margin: 15px 0;
  overflow: hidden;
}
.trivia-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* Carrusel mejorado - más vistoso */
.carousel-container {
  position: relative;
  width: 100%;
  margin: 20px 0;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.carousel-slide {
  display: none;
  width: 100%;
  text-align: center;
  background: linear-gradient(45deg, #222, #000);
  padding: 10px 0;
}
.carousel-slide.active {
  display: block;
  animation: zoomEffect 0.5s ease;
}
@keyframes zoomEffect {
  from {
    opacity: 0.4;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.carousel-slide img,
.carousel-slide video {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 15px;
  background: #000;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
.carousel-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  gap: 10px;
}
.carousel-btn {
  background: var(--accent);
  border: none;
  color: black;
  font-size: 22px;
  font-weight: bold;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.carousel-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px var(--accent);
}
.carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.carousel-indicators {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 15px 0;
}
.carousel-dot {
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.carousel-dot.active {
  background: var(--accent);
  transform: scale(1.3);
  box-shadow: 0 0 15px var(--accent);
}
.carousel-title {
  font-size: 18px;
  margin: 10px 0;
  color: var(--accent);
  font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .context-buttons {
    bottom: 100px;
    gap: 10px;
  }
  .context-btn {
    padding: 10px 12px;
    min-width: 90px;
    font-size: 13px;
  }
  .fireworks-btn {
    bottom: 15px;
    left: 15px;
    padding: 8px 12px;
    font-size: 12px;
  }
  .seed-selector {
    bottom: 70px;
    left: 15px;
    max-width: 160px;
  }
  .seed-btn {
    width: 28px;
    height: 28px;
  }
  .screen-overlay {
    top: 70px;
    padding: 15px;
    font-size: 14px;
  }
}
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
}

a-scene {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}

video,
canvas {
  object-fit: cover !important;
}

.a-canvas,
.a-video,
.a-scene video,
.a-scene canvas {
  width: 100% !important;
  height: 100% !important;
  left: 0 !important;
  top: 0 !important;
}



/* Botón de información dentro del cargador */
.info-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--accent, #b2ff24);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 22px;
  font-weight: bold;
  color: var(--accent, #b2ff24);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.info-btn:hover {
  transform: scale(1.05);
  background: var(--accent, #b2ff24);
  color: #000;
}


.modal-instructions {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.modal-instructions.active {
  visibility: visible;
  opacity: 1;
}

.modal-inner {
  background: #11161f;
  border-radius: 28px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--accent, #b2ff24);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #2a2f3a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: var(--accent, #b2ff24);
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #ccc;
  cursor: pointer;
}

.modal-content {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  font-size: 1rem;
  line-height: 1.5;
  color: #eee;
}

.modal-content p {
  margin: 12px 0;
}

.modal-content ul {
  padding-left: 20px;
}

.modal-content li {
  margin: 8px 0;
}


/* Contenedor de botones de acción (fuegos + animación) */
.action-buttons {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  gap: 12px;
  z-index: 25;
}
.action-btn {
  background: var(--accent);
  border: none;
  padding: 10px 15px;
  border-radius: 30px;
  font-size: 14px;
  color: black;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
@media (min-width: 768px) {
  .action-btn {
    padding: 12px 20px;
    font-size: 15px;
  }
}
.action-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--accent);
}
.action-btn:active {
  transform: scale(0.95);
}


/* ── Filtros de Galería ── */
.gallery-filters-wrap {
  margin-top: 14px;
  background: rgba(0,0,0,0.35);
  border-radius: 14px;
  padding: 10px 8px 8px;
}

.gallery-filters-title {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 8px 4px;
  font-weight: bold;
}

.gallery-filters-track {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* Hereda el estilo de .filter del menú de cámara */
.gallery-filter-btn {
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 58px;
  height: auto;
  padding: 8px 4px;
  font-size: 20px;
}

.gallery-filter-label {
  font-size: 9px;
  color: #ccc;
  text-align: center;
  line-height: 1.2;
  display: block;
}

.gallery-filter-btn.active .gallery-filter-label {
  color: var(--accent);
}

/* Imagenes del modal de instrucciones */
.instruction-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.instruction-img {
  display: flex;
  justify-content: center;
}

.instruction-img img {
  width: clamp(150px, 46vw, 210px);
  max-width: 100%;
  height: auto;
  max-height: 360px;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  border-radius: 14px;
  background: #05070b;
}

@media (max-width: 480px) {
  .modal-inner {
    width: calc(100% - 24px);
    max-height: 86vh;
    border-radius: 20px;
  }

  .modal-content {
    padding: 16px;
  }

  .instruction-img img {
    width: clamp(140px, 58vw, 180px);
    max-height: 320px;
  }
}
