/* ==========================================================================
   STYLE.CSS - EL SECRETO DE LA HACIENDA EL ENIGMA
   Estética: Dark Academia Cafetero & Realismo Mágico Juvenil (Mobile-First)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,700;1,9..144,400&family=Plus+Jakarta+Sans:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

:root {
  /* Paleta Dark Academia Cafetero */
  --bg-primary: #0a1410;
  --bg-secondary: #13241d;
  --bg-card: rgba(22, 41, 33, 0.92);
  --bg-glass: rgba(14, 30, 24, 0.85);
  --border-gold: rgba(212, 175, 55, 0.35);
  --border-gold-glow: #d4af37;
  
  --text-main: #f0f7f3;
  --text-muted: #a6c0b5;
  --text-gold: #f4d068;
  --text-accent: #5eead4;
  
  --gold-gradient: linear-gradient(135deg, #d4af37 0%, #f6e27a 50%, #aa820a 100%);
  --terracotta: #c86446;
  --emerald-glow: rgba(16, 185, 129, 0.3);
  
  --font-title: 'Cinzel', 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-hand: 'Fraunces', cursive, serif;
  
  --font-size-base: 18px;
  --line-height-base: 1.65;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --transition-smooth: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  --shadow-lux: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 175, 55, 0.15);
}

/* Modo Pergamino */
body.theme-parchment {
  --bg-primary: #f4ecd8;
  --bg-secondary: #e6dbbf;
  --bg-card: rgba(248, 241, 227, 0.95);
  --bg-glass: rgba(235, 222, 199, 0.9);
  --border-gold: rgba(145, 105, 30, 0.4);
  --border-gold-glow: #8e6819;
  --text-main: #241c15;
  --text-muted: #5c4e3e;
  --text-gold: #825c0b;
  --text-accent: #0f766e;
  --shadow-lux: 0 10px 25px rgba(60, 40, 10, 0.2);
}

/* Modo Día */
body.theme-light {
  --bg-primary: #f8fafc;
  --bg-secondary: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.98);
  --bg-glass: rgba(241, 245, 249, 0.92);
  --border-gold: rgba(203, 213, 225, 0.8);
  --border-gold-glow: #0284c7;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-gold: #0369a1;
  --text-accent: #0284c7;
  --shadow-lux: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Fuente Dislexia */
body.font-dyslexic {
  --font-body: 'Comic Sans MS', 'Trebuchet MS', sans-serif !important;
  letter-spacing: 0.04em;
  word-spacing: 0.08em;
}

/* Reset y Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.4s ease, color 0.4s ease;
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* Partículas de Ambiente y Luciérnagas */
.ambient-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 20%, rgba(212, 175, 55, 0.06), transparent 60%);
  z-index: 0;
}

/* Contenedor Principal */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Barra de Navegación Superior */
.top-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  gap: 8px;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-back-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-gold);
  color: var(--text-gold);
  padding: 6px 12px;
  border-radius: 18px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.nav-back-btn:hover:not(:disabled) {
  background: var(--border-gold);
  color: #000;
  transform: translateX(-2px);
}

.nav-back-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-gold);
  white-space: nowrap;
  cursor: pointer;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-gold);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  touch-action: manipulation;
}

.icon-btn:hover, .icon-btn:active {
  background: var(--border-gold);
  color: #000;
  transform: translateY(-2px);
}

.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--terracotta);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

/* Tarjeta Principal de Lectura */
.reader-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lux);
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  animation: fadeIn 0.4s ease-out;
}

/* Marco de Ilustración de Escena con Zoom */
.scene-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 420px;
  background: #000;
  overflow: hidden;
  cursor: zoom-in;
}

.scene-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.scene-image-wrapper:hover .scene-image {
  transform: scale(1.03);
}

.zoom-hint-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-gold);
  color: var(--text-gold);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 12px;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-dossier-overlay-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(14, 30, 24, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-gold);
  color: var(--text-gold);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
  z-index: 6;
}

.view-dossier-overlay-btn:hover {
  background: var(--border-gold);
  color: #000;
  transform: translateY(-2px);
}

/* Hotspots Táctiles sobre la Imagen */
.hotspot {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.5);
  border: 2px solid var(--border-gold-glow);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  transform: translate(-50%, -50%);
  animation: pulseGlow 2s infinite;
  z-index: 5;
  touch-action: manipulation;
}

.hotspot:hover, .hotspot:active {
  transform: translate(-50%, -50%) scale(1.3);
  background: rgba(212, 175, 55, 0.9);
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.8); }
  70% { box-shadow: 0 0 0 16px rgba(212, 175, 55, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.badge-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-gold);
  color: var(--text-gold);
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* Cuerpo de la Historia */
.scene-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chapter-title {
  font-family: var(--font-title);
  font-size: 1.45rem;
  color: var(--text-gold);
  letter-spacing: 0.5px;
  line-height: 1.3;
}

/* Bocadillo Meme / Pensamiento */
.meme-bubble {
  background: rgba(212, 175, 55, 0.08);
  border-left: 4px solid var(--border-gold-glow);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-accent);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 10px;
}

.story-text-container p {
  margin-bottom: 14px;
  color: var(--text-main);
  line-height: var(--line-height-base);
}

.story-text-container strong {
  color: var(--text-gold);
}

/* Contenedor de Decisiones */
.choices-header {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
}

.choices-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  touch-action: manipulation;
}

.choice-btn:hover, .choice-btn:active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--border-gold-glow);
  transform: translateX(4px);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.choice-arrow {
  color: var(--text-gold);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.reader-bottom-nav {
  margin-top: 8px;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  padding-top: 12px;
}

.btn-back-inline {
  width: 100%;
  font-size: 0.9rem;
}

/* Toast de Alertas y Pistas */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: 20px;
  max-width: 450px;
  margin-left: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-gold);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lux);
  font-size: 0.88rem;
  animation: slideInUp 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes slideInUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

/* ==========================================================================
   MODALES (Puzles, Fichas de Personajes, Diario de Pistas, Tutorial, Ajustes)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lux);
  padding: 20px;
  position: relative;
  animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-gold);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.modal-title {
  font-family: var(--font-title);
  color: var(--text-gold);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.close-modal-btn:hover, .close-modal-btn:active {
  color: var(--text-gold);
  transform: rotate(90deg);
}

/* --- LIGHTBOX MODAL --- */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: zoom-out;
  animation: fadeIn 0.25s ease;
}

.lightbox-modal.hidden {
  display: none;
}

.lightbox-img {
  max-width: 95vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-gold);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9), 0 0 20px rgba(212, 175, 55, 0.3);
  animation: modalPop 0.3s ease;
}

.lightbox-caption {
  margin-top: 10px;
  color: var(--text-gold);
  font-family: var(--font-title);
  font-size: 1rem;
  text-align: center;
}

.lightbox-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-gold);
  color: #fff;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
}

/* --- FICHAS DE PERSONAJES (DOSSIER) --- */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.character-card-preview {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.character-card-preview:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--border-gold-glow);
  transform: translateY(-2px);
}

.char-avatar-thumb {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-gold);
}

.char-info-preview h4 {
  font-family: var(--font-title);
  color: var(--text-gold);
  font-size: 0.95rem;
}

.char-info-preview p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dossier-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dossier-hero {
  display: flex;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--border-gold);
  padding-bottom: 14px;
}

.dossier-portrait {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-gold-glow);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.dossier-hero-info h3 {
  font-family: var(--font-title);
  color: var(--text-gold);
  font-size: 1.25rem;
}

.dossier-hero-info .dossier-archetype {
  font-size: 0.85rem;
  color: var(--text-accent);
  font-style: italic;
}

.dossier-hero-info .dossier-role {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.dossier-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dossier-section h4 {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--text-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dossier-section p {
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.5;
}

.dossier-quote {
  background: rgba(212, 175, 55, 0.08);
  border-left: 3px solid var(--border-gold-glow);
  padding: 10px 14px;
  font-style: italic;
  font-size: 0.88rem;
  color: var(--text-gold);
  border-radius: var(--radius-sm);
}

/* --- ESTILOS DE PUZLES Y BOTÓN DE SALIDA --- */
.puzzle-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.puzzle-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid var(--border-gold);
  padding-bottom: 10px;
  margin-bottom: 8px;
}

.btn-exit-puzzle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-gold);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-exit-puzzle:hover {
  background: var(--terracotta);
  color: #fff;
  border-color: var(--terracotta);
}

.badge-quimbaya {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--border-gold);
  color: var(--text-gold);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

.lock-dials-container {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}

.dial-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dial-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-gold);
  color: var(--text-gold);
  width: 46px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.dial-btn:hover, .dial-btn:active {
  background: var(--border-gold);
  color: #000;
}

.dial-display {
  background: #000;
  border: 2px solid var(--border-gold);
  color: #fff;
  font-family: 'Courier New', monospace;
  font-size: 2rem;
  font-weight: 800;
  width: 52px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.btn {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.btn-gold {
  background: var(--gold-gradient);
  color: #1a0f0a;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-gold:hover, .btn-gold:active {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-gold);
  color: var(--text-main);
}

.btn-secondary:hover, .btn-secondary:active {
  background: rgba(255, 255, 255, 0.15);
}

/* Tarjeta de Pista Adaptativa */
.hint-card {
  background: rgba(212, 175, 55, 0.12);
  border: 1px dashed var(--border-gold-glow);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 14px;
  text-align: left;
  animation: fadeIn 0.4s ease;
}

.hint-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-gold);
  font-weight: 700;
  margin-bottom: 6px;
}

.hint-text {
  font-size: 0.88rem;
  color: var(--text-main);
}

/* Anagrama y Cifrador */
.cipher-word-display, .anagram-slots {
  display: flex;
  gap: 6px;
  margin: 12px 0;
  flex-wrap: wrap;
  justify-content: center;
}

.slot-letter, .anagram-slot {
  width: 40px;
  height: 48px;
  background: #000;
  border: 2px solid var(--border-gold);
  border-radius: var(--radius-sm);
  color: var(--text-gold);
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cipher-keys-grid, .anagram-tiles-pool {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 360px;
}

.cipher-key-btn, .anagram-tile {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-gold);
  color: #fff;
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  width: 42px;
  height: 46px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  touch-action: manipulation;
}

.cipher-key-btn:hover, .cipher-key-btn:active,
.anagram-tile:hover, .anagram-tile:active {
  background: var(--border-gold);
  color: #000;
  transform: translateY(-2px);
}

.anagram-tile.used {
  opacity: 0.3;
  pointer-events: none;
}

/* Galería de Finales */
.endings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.ending-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition-smooth);
}

.ending-card.locked {
  opacity: 0.5;
  filter: grayscale(1);
}

.ending-card.unlocked {
  border-color: var(--border-gold-glow);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

/* Inventario de Pistas */
.clues-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.clue-item-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.clue-icon {
  font-size: 2rem;
}

.clue-title {
  font-family: var(--font-title);
  color: var(--text-gold);
  font-size: 0.95rem;
}

.clue-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Animación de Sacudida */
.shake-anim {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* ==========================================================================
   OPTIMIZACIONES MÓVILES
   ========================================================================== */

@media (min-width: 601px) {
  .clues-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  .endings-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 600px) {
  .app-container {
    padding: 8px;
  }
  
  .top-navbar {
    padding: 8px 10px;
    margin-bottom: 10px;
  }
  
  .brand-badge .title {
    display: none;
  }

  .nav-back-btn .back-text {
    display: none;
  }

  .nav-back-btn {
    padding: 6px 8px;
  }

  .brand-badge .icon {
    font-size: 1.2rem;
  }

  .nav-actions {
    gap: 3px;
  }

  .icon-btn {
    width: 35px;
    height: 35px;
    font-size: 0.95rem;
  }

  .scene-body {
    padding: 16px 14px;
    gap: 14px;
  }

  .chapter-title {
    font-size: 1.2rem;
  }

  .story-text-container p {
    font-size: 0.95rem;
    margin-bottom: 12px;
  }

  .choice-btn {
    padding: 12px 14px;
    font-size: 0.92rem;
  }

  .lock-dials-container {
    gap: 6px;
  }

  .dial-btn {
    width: 40px;
    height: 36px;
    font-size: 1rem;
  }

  .dial-display {
    width: 44px;
    height: 56px;
    font-size: 1.7rem;
  }

  .modal-card {
    padding: 16px;
  }
}
