/* ==========================================================================
   OBSERVATORIO CONCHO (ConChocimiento) — Hoja de Estilos Principal
   Diseño: Bosque Seco Nocturno (Guánica) + Ámbar Dorado + Cultura Pop PR
   ========================================================================== */

:root {
  /* Paleta principal */
  --bg-deep: #07100b;
  --bg-surface: #0e1d15;
  --bg-card: #14281d;
  --bg-card-hover: #1b3627;
  --border-subtle: rgba(245, 183, 0, 0.18);
  --border-strong: rgba(245, 183, 0, 0.45);

  /* Textos */
  --text-main: #f6f1e4;
  --text-muted: #b7c8bc;
  --text-dim: #7f9687;

  /* Acentos */
  --amber: #f5b700;
  --amber-bright: #ffd447;
  --emerald: #2dd488;
  --coral: #f05a47;
  --sky: #38bdf8;

  /* Tipografía y layout */
  --font-display: 'Syne', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shadow-card: 0 18px 45px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 32px rgba(245, 183, 0, 0.22);
  --max-w: 1140px;
  --transition: 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.65;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 15%, rgba(45, 212, 136, 0.08), transparent 40%),
    radial-gradient(circle at 85% 35%, rgba(245, 183, 0, 0.08), transparent 42%),
    var(--bg-deep);
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ==========================================================================
   HUD SUPERIOR (Psicología: Sensación de Progreso + Coleccionismo + Sorpresa)
   ========================================================================== */
.hud-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(7, 16, 11, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.hud-progress-track {
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
}

.hud-progress-fill {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, var(--emerald), var(--amber), var(--amber-bright));
  transition: width 0.4s ease;
}

.hud-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.65rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-main);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.hud-brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber);
}

.hud-status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  transition: var(--transition);
}

.hud-pill:hover {
  border-color: var(--amber);
  background: rgba(245, 183, 0, 0.14);
  transform: translateY(-1px);
}

.hud-pill--accent {
  background: rgba(245, 183, 0, 0.16);
  border-color: var(--border-strong);
  color: var(--amber-bright);
}

.hud-pill--rank {
  color: var(--emerald);
  border-color: rgba(45, 212, 136, 0.35);
}

/* Banner Zeigarnik ("Continúa donde te quedaste") */
.zeigarnik-banner {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 990;
  background: linear-gradient(135deg, #173123, #0f2017);
  border: 1px solid var(--amber);
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
  font-size: 0.88rem;
  max-width: 92vw;
}

.zeigarnik-banner[hidden] {
  display: none;
}

/* ==========================================================================
   HERO STAGE (Animación Frame-by-Frame en Canvas + Humor + Audio)
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 5.5rem 1.2rem 2.5rem;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #060d09;
}

.hero-canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
}

#concho-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  cursor: pointer;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 16, 11, 0.92) 0%, rgba(7, 16, 11, 0.72) 42%, rgba(7, 16, 11, 0.18) 78%, rgba(7, 16, 11, 0.45) 100%),
    linear-gradient(180deg, rgba(7, 16, 11, 0.5) 0%, transparent 25%, transparent 72%, var(--bg-deep) 100%);
}

/* Flash de cámara ("¡Debí Tirar Más Fotos!") */
.camera-flash {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
}

.camera-flash.is-flashing {
  animation: flashBurst 0.42s ease-out;
}

@keyframes flashBurst {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

/* Luciérnagas animadas en CSS */
.fireflies {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.firefly {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber-bright);
  box-shadow: 0 0 14px var(--amber-bright), 0 0 28px var(--amber);
  opacity: 0.65;
  animation: floatFirefly 7s ease-in-out infinite;
}

@keyframes floatFirefly {
  0%, 100% { transform: translate(0, 0) scale(0.8); opacity: 0.25; }
  50% { transform: translate(24px, -32px) scale(1.25); opacity: 0.9; }
}

.hero-grid {
  position: relative;
  z-index: 4;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 2rem;
  align-items: end;
}

.hero-content {
  max-width: 580px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(245, 183, 0, 0.14);
  border: 1px solid var(--border-strong);
  color: var(--amber-bright);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.6vw, 3.8rem);
  line-height: 1.06;
  margin: 0 0 1rem;
  color: var(--text-main);
}

.hero-title .highlight {
  color: var(--amber-bright);
  display: inline-block;
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--text-muted);
  margin: 0 0 1.35rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  text-decoration: none;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--amber), #ff9f1c);
  color: #141005;
  box-shadow: 0 10px 26px rgba(245, 183, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 32px rgba(245, 183, 0, 0.42);
}

.btn-secondary {
  background: rgba(20, 40, 29, 0.85);
  border-color: var(--border-strong);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(245, 183, 0, 0.16);
  border-color: var(--amber-bright);
  transform: translateY(-2px);
}

.btn-emerald {
  background: rgba(45, 212, 136, 0.16);
  border-color: rgba(45, 212, 136, 0.5);
  color: #8bf3c1;
}

.btn-emerald:hover {
  background: rgba(45, 212, 136, 0.28);
  transform: translateY(-2px);
}

/* Globo cómico del Sapo Concho en el Hero */
.hero-stage-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 1rem;
  min-height: 360px;
}

.speech-bubble {
  position: relative;
  max-width: 340px;
  background: rgba(14, 29, 21, 0.92);
  border: 2px solid var(--amber);
  border-radius: 20px;
  padding: 0.9rem 1.1rem;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.96rem;
  box-shadow: var(--shadow-card);
  animation: popIn 0.3s ease;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -11px;
  right: 48px;
  width: 18px;
  height: 18px;
  background: #0e1d15;
  border-right: 2px solid var(--amber);
  border-bottom: 2px solid var(--amber);
  transform: rotate(45deg);
}

.speech-tag {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--amber);
  margin-bottom: 0.2rem;
}

@keyframes popIn {
  from { transform: scale(0.92) translateY(6px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Tira de frames interactiva (Frame-by-Frame Inspector) */
.frame-strip {
  background: rgba(7, 16, 11, 0.82);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.8rem;
  backdrop-filter: blur(8px);
}

.frame-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.frame-thumbs {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.frame-thumb-btn {
  position: relative;
  width: 64px;
  height: 38px;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #0b1710;
  opacity: 0.62;
  transition: var(--transition);
}

.frame-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame-thumb-btn span {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 4px #000;
}

.frame-thumb-btn.is-active,
.frame-thumb-btn:hover {
  opacity: 1;
  border-color: var(--amber);
  transform: translateY(-2px);
}

.photo-counter {
  font-size: 0.84rem;
  color: var(--amber-bright);
  font-weight: 700;
}

/* ==========================================================================
   NAVEGACIÓN RÁPIDA DE ENCUENTROS
   ========================================================================== */
.encounters-nav {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.2rem;
  overflow-x: auto;
}

.encounters-nav-list {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
}

.encounters-nav-list a {
  white-space: nowrap;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition);
}

.encounters-nav-list a:hover,
.encounters-nav-list a.is-current {
  color: #141005;
  background: var(--amber);
  border-color: var(--amber);
}

/* ==========================================================================
   SECCIONES (ENCUENTROS 1–10)
   ========================================================================== */
main {
  position: relative;
}

.encuentro {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4.5rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.encuentro-header {
  margin-bottom: 2.2rem;
}

.encuentro-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--emerald);
  background: rgba(45, 212, 136, 0.12);
  border: 1px solid rgba(45, 212, 136, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.encuentro-quote {
  font-style: italic;
  color: var(--amber-bright);
  font-size: 1.05rem;
  margin: 0 0 0.45rem;
}

.encuentro-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.4vw, 2.65rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.8rem;
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.45rem;
  box-shadow: var(--shadow-card);
}

.card--humor {
  background: linear-gradient(145deg, rgba(245, 183, 0, 0.11), var(--bg-card));
  border-color: var(--border-strong);
}

.card h3 {
  font-family: var(--font-display);
  margin-top: 0;
  margin-bottom: 0.65rem;
  color: var(--amber-bright);
}

/* Figuras y créditos obligatorios de fotógrafos */
.photo-figure {
  margin: 0;
  background: #0a140e;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.photo-figure img {
  width: 100%;
  height: auto;
  cursor: zoom-in;
  transition: transform 0.35s ease;
}

.photo-figure img:hover {
  transform: scale(1.02);
}

.photo-figure figcaption {
  padding: 0.65rem 0.95rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.photo-credit {
  color: var(--amber);
  font-weight: 700;
}

/* ==========================================================================
   PSICOLOGÍA: BRECHA DE CURIOSIDAD Y REVELACIÓN PROGRESIVA (Spoilers / Puente)
   ========================================================================== */
.bridge-box {
  margin-top: 2.2rem;
  padding: 1.4rem 1.6rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(45, 212, 136, 0.1), rgba(245, 183, 0, 0.08));
  border: 1px dashed var(--amber);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.curiosity-reveal {
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  background: rgba(7, 16, 11, 0.65);
  border-left: 4px solid var(--emerald);
}

.curiosity-reveal[hidden] {
  display: none;
}

/* ==========================================================================
   ENCUENTRO 3: COMPARADOR ANTES/DESPUÉS + RAYOS-X + QUIZ DE IMPOSTOR
   ========================================================================== */
.compare-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border-strong);
  background: #000;
  user-select: none;
}

.compare-layer {
  position: absolute;
  inset: 0;
}

.compare-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare-layer--top {
  clip-path: inset(0 50% 0 0);
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--amber);
  box-shadow: 0 0 14px var(--amber);
  pointer-events: none;
  z-index: 4;
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--amber);
  color: #141005;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 5;
}

.compare-range {
  width: 100%;
  margin-top: 0.85rem;
  accent-color: var(--amber);
  cursor: ew-resize;
}

.compare-pins {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.compare-pins[hidden] {
  display: none;
}

.xray-pin {
  position: absolute;
  pointer-events: auto;
  background: rgba(14, 29, 21, 0.94);
  border: 2px solid var(--amber-bright);
  color: var(--amber-bright);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  animation: pulsePin 2s infinite;
}

@keyframes pulsePin {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 212, 71, 0.55); }
  50% { box-shadow: 0 0 0 10px rgba(255, 212, 71, 0); }
}

/* ==========================================================================
   QUIZZES Y PREDICCIÓN
   ========================================================================== */
.quiz-box {
  background: linear-gradient(160deg, #162e21, #0d1b13);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1.6rem;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.quiz-opt {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-weight: 700;
  text-align: left;
  transition: var(--transition);
}

.quiz-opt:hover {
  border-color: var(--amber);
  background: rgba(245, 183, 0, 0.12);
}

.quiz-opt.is-correct {
  border-color: var(--emerald);
  background: rgba(45, 212, 136, 0.2);
  color: #a9f9d3;
}

.quiz-opt.is-wrong {
  border-color: var(--coral);
  background: rgba(240, 90, 71, 0.18);
  color: #ffc2b8;
}

.quiz-feedback {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  border-left: 4px solid var(--amber);
  font-size: 0.95rem;
}

/* ==========================================================================
   ENCUENTRO 4: MAPA INTERACTIVO + LLUVIA
   ========================================================================== */
.map-interactive {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #fff;
}

.map-hotspot {
  position: absolute;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid #fff;
  font-size: 0.72rem;
  font-weight: 800;
  color: #111;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease;
}

.map-hotspot:hover,
.map-hotspot.is-active {
  transform: translate(-50%, -50%) scale(1.25);
  z-index: 4;
}

.map-hotspot--natural {
  background: var(--emerald);
}

.map-hotspot--reintro {
  background: var(--amber-bright);
}

.rain-stage {
  position: relative;
  overflow: hidden;
}

.rain-drop {
  position: absolute;
  top: -20px;
  width: 2px;
  height: 18px;
  background: linear-gradient(180deg, transparent, var(--sky));
  opacity: 0.75;
  animation: rainFall 0.7s linear infinite;
  pointer-events: none;
}

@keyframes rainFall {
  to { transform: translateY(340px); }
}

/* ==========================================================================
   ENCUENTRO 6: LÍNEA DEL TIEMPO INTERACTIVA
   ========================================================================== */
.timeline {
  display: grid;
  gap: 0.85rem;
  border-left: 3px solid var(--amber);
  padding-left: 1.25rem;
  margin-top: 1.5rem;
}

.timeline-item {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.15rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.7rem;
  top: 1.15rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid var(--bg-deep);
}

.timeline-year {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--amber-bright);
  margin-right: 0.5rem;
}

/* ==========================================================================
   ENCUENTRO 7: CICLO DE VIDA INTERACTIVO + CARRERA DE LA CHARCA
   ========================================================================== */
.lifecycle-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.2rem;
}

.lifecycle-tab {
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 700;
  transition: var(--transition);
}

.lifecycle-tab.is-active,
.lifecycle-tab:hover {
  background: var(--amber);
  color: #141005;
  border-color: var(--amber);
}

.pond-meter {
  margin-top: 1.25rem;
  padding: 1rem 1.2rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-sm);
}

.pond-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 0.5rem;
}

.pond-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--sky), var(--emerald));
  transition: width 0.4s ease;
}

/* ==========================================================================
   ENCUENTRO 8 y 9: TARJETAS VOLTEABLES (Flip Cards 3D)
   ========================================================================== */
.flip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.flip-card {
  perspective: 1100px;
  min-height: 255px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 255px;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.flip-front {
  background: linear-gradient(155deg, #173022, #102118);
  border: 1px solid var(--border-strong);
}

.flip-back {
  background: linear-gradient(155deg, #1e3b2b, #11241a);
  border: 1px solid var(--emerald);
  transform: rotateY(180deg);
  overflow-y: auto;
  font-size: 0.92rem;
}

.flip-cta {
  align-self: flex-start;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--amber-bright);
  background: rgba(245, 183, 0, 0.14);
  border: 1px solid var(--border-strong);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

/* Tabs de Google Trends */
.trends-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* ==========================================================================
   ENCUENTRO 10: CERTIFICADO / RESCATE DEL SAPO Y ÁLBUM
   ========================================================================== */
.certificate-card {
  background: radial-gradient(circle at top right, rgba(245, 183, 0, 0.2), transparent 50%),
              linear-gradient(145deg, #163022, #0b1811);
  border: 2px solid var(--amber);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-glow);
}

.input-text {
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(7, 16, 11, 0.85);
  color: var(--text-main);
  font-size: 1rem;
  min-width: 240px;
}

/* Modales (Álbum, Dato Curioso, Lightbox) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(4, 10, 7, 0.85);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 1.2rem;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--amber);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-weight: 800;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.album-badge {
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  opacity: 0.52;
  transition: var(--transition);
}

.album-badge.is-unlocked {
  opacity: 1;
  border-color: var(--amber);
  background: rgba(245, 183, 0, 0.12);
}

.album-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.35rem;
}

/* Animación de entrada por scroll */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.2rem 5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
}

footer a {
  color: var(--amber-bright);
}

@media (max-width: 860px) {
  .hero-grid,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .hero-stage-right {
    align-items: flex-start;
    min-height: auto;
  }

  .hud-inner {
    justify-content: center;
  }
}
