:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --accent: #38bdf8;
  --accent-hover: #0284c7;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Control de Vistas */
.view {
  display: none;
  min-height: 100vh;
  padding: 2rem 1.2rem;
  animation: fadeIn 0.45s ease;
}

.view.active {
  display: flex;
  flex-direction: column;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Botón Flotante de Música */
.music-btn {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  z-index: 900;
  background: rgba(30, 41, 59, 0.85);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  font-size: 0.85rem;
}

.hidden { display: none !important; }

/* ==================== PORTADA MAIN ==================== */
#view-main {
  position: relative;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.15) 0%, rgba(15, 23, 42, 0.98) 75%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.cover-frame {
  width: 240px;
  height: 240px;
  margin: 0 auto 1.5rem;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.subtitle {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.main-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 1.8rem;
  line-height: 1.15;
}

/* Botones Generales */
.btn-primary {
  background: var(--accent);
  color: #0f172a;
  font-weight: 600;
  border: none;
  padding: 0.85rem 2rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-2px);
}

.btn-back {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-back:hover {
  color: var(--text-main);
  border-color: var(--accent);
}

/* ==================== CONTENEDORES Y CABECERAS ==================== */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

/* ==================== MENÚ PRINCIPAL ==================== */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.menu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: left;
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.menu-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.menu-card .icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 1rem;
}

.menu-card h3 {
  margin-bottom: 0.4rem;
  font-size: 1.25rem;
}

.menu-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ==================== ÁLBUM MULTIMEDIA ==================== */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}

.album-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

.album-item:hover {
  transform: scale(1.02);
}

.album-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: #0b1120;
}

.album-info {
  padding: 0.85rem;
}

.album-info span {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
}

.album-info p {
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Modal Visor */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal-content {
  max-width: 800px;
  width: 100%;
  text-align: center;
  position: relative;
}

.close-btn {
  background: var(--bg-card);
  color: #fff;
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 1rem;
}

#modal-media-container img,
#modal-media-container video {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 12px;
}

.modal-caption {
  margin-top: 1rem;
  color: var(--text-muted);
}

/* ==================== PUZZLE Y ACERCA DE ==================== */
.puzzle-box, .about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  line-height: 1.6;
}

.badge {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.puzzle-box h3 {
  margin: 0.8rem 0;
}

.hint-text {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.input-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.input-group input {
  flex: 1;
  min-width: 200px;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  color: var(--text-main);
  font-size: 1rem;
}

.feedback {
  margin-top: 0.8rem;
  font-size: 0.9rem;
}

.reward-box {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.reward-box img {
  margin-top: 1rem;
  max-width: 100%;
  border-radius: 12px;
}

.about-card p + p {
  margin-top: 1rem;
  color: var(--text-muted);
}