:root{
  --bg: #0b0e14;
  --text: #e6e9ef;
  --muted: #a8b0c2;
  --border: rgba(255,255,255,14);
  --shadow: 0 14px 40px rgba(0,0,0,55);
  --radius: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  min-height:100vh;

  /* Fondo base sólido */
  background-color: #0b0e14;

  /* Degradado profundo y continuo */
  background-image:
    radial-gradient(
      1400px 900px at 20% -10%,
      #1c2440 0%,
      rgba(28,36,64,.55) 35%,
      rgba(11,14,20,1) 70%
    ),
    linear-gradient(
      180deg,
      rgba(255,255,255,.03),
      rgba(0,0,0,.12)
    );

  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;

  color:var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}


.hidden{ display:none !important; }

/* ===== Barra superior con efecto glass dinámico ===== */
.topbar{
  padding:12px 14px;
  border-bottom:1px solid rgba(255,255,255,.10);

  background: rgba(10,12,18,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  position: sticky;
  top: 0;
  z-index: 20;

  transition:
    background 220ms ease,
    backdrop-filter 220ms ease,
    border-color 220ms ease;
}

/* Estado cuando hay scroll */
.topbar.scrolled{
  background: rgba(10,12,18,.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: rgba(255,255,255,.18);
}
.topbar.scrolled .title{
  letter-spacing: .4px;
}


.title{ font-weight:800; letter-spacing:.2px; }
.sub{ color:var(--muted); font-size:13px; margin-top:4px; }

.stage{
  display:grid;
  place-items:center;
  padding:22px 16px 44px;
  gap:14px;
}

.hint{
  color:var(--muted);
  font-size: 14px;
  text-align:center;
}

.actions{
  display:flex;
  gap:12px;
  justify-content:center;
  width:100%;
}

.btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,06);
  color:var(--text);
  padding:10px 14px;
  border-radius:12px;
  cursor:pointer;
  min-width: 120px;
}
.btn:hover{ background: rgba(255,255,255,10); }

.microhint{
  color: rgba(255,255,255,65);
  font-size:12px;
  text-align:center;
  max-width: 900px;
}

/* =========================
   VISTA ÚNICA (slide)
========================= */
.singleView{
  width:min(1100px, 96vw); /* igual que spread */
  display:grid;
  place-items:center;
}

.pageCard{
  width:100%;
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: rgba(0,0,0,12);
  overflow:hidden;
  position: relative;
  touch-action: pan-y;
  user-select: none;
}

.pageCanvas{
  width:100%;
  height:100%;
  display:block;
}

.pageCanvas.front,
.pageCanvas.back{
  position:absolute;
  inset:0;
}

/* base */
.pageCanvas.front{ transform: translateX(0); opacity: 1; }
.pageCanvas.back{ opacity: 1; transform: translateX(100%); }

/* slide next */
.pageCard.slide-next .pageCanvas.front{
  transform: translateX(-100%);
  transition: transform 280ms ease;
}
.pageCard.slide-next .pageCanvas.back{
  transform: translateX(0);
  transition: transform 280ms ease;
}

/* slide prev */
.pageCard.slide-prev .pageCanvas.front{
  transform: translateX(100%);
  transition: transform 280ms ease;
}
.pageCard.slide-prev .pageCanvas.back{
  transform: translateX(0);
  transition: transform 280ms ease;
}

/* efecto "abrir" */
.pageCard.opening{
  transform-origin: right center;
  animation: openFold 320ms ease forwards;
}
@keyframes openFold{
  from { transform: perspective(900px) rotateY(0deg); }
  to   { transform: perspective(900px) rotateY(-65deg); opacity: .85; }
}

/* =========================
   VISTA INTERIOR (3 paneles)
========================= */
.spreadView{
  width:min(1100px, 96vw);
  display:grid;
  place-items:center;
}

.trifold{
  width:100%;
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: rgba(0,0,0,12);
  overflow:hidden;
  position: relative;

  /* ✅ forzar 1 fila */
  display:flex;
  flex-wrap:nowrap;
}

.panel{
  border-right: none;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.12);
}
.panel:last-child{
  box-shadow: none;
}


.panelCanvas{
  width:100%;
  height:auto;
  display:block;
}
/* ===== Botones (estilo visual anterior / premium) ===== */
.actions{
  display:flex;
  gap:12px;
  justify-content:center;
  width:100%;
  flex-wrap: wrap;
  margin-top: 6px;
}

.btn{
  appearance: none;
  border: 1px solid rgba(255,255,255,.18);
  background: linear-gradient(
    180deg,
    rgba(255,255,255,.10),
    rgba(255,255,255,.06)
  );
  color: rgba(255,255,255,.92);
  padding: 11px 16px;
  border-radius: 14px;
  cursor: pointer;
  min-width: 140px;

  box-shadow:
    0 10px 28px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.10);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.btn:hover{
  border-color: rgba(255,255,255,.26);
  background: linear-gradient(
    180deg,
    rgba(255,255,255,.14),
    rgba(255,255,255,.08)
  );
  transform: translateY(-1px);
  box-shadow:
    0 14px 34px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.12);
}

.btn:active{
  transform: translateY(0px) scale(.99);
  box-shadow:
    0 10px 26px rgba(0,0,0,.38),
    inset 0 1px 0 rgba(255,255,255,.10);
}

.btn:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 3px rgba(255,255,255,.18),
    0 14px 34px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.12);
}

/* Tamaño más cómodo en móvil */
@media (max-width: 480px){
  .btn{
    min-width: 44vw;
    padding: 12px 14px;
    border-radius: 16px;
  }
}

/* ===== Desktop: panel individual más compacto (sin afectar móvil) ===== */
@media (min-width: 769px){
  /* reduce tamaño solo en vista única */
  .singleView{
    width: min(720px, 92vw);
  }

  /* opcional: botones un poquito más compactos en desktop */
  .actions{
    max-width: 720px;
  }
}

/* Hotspots (zonas clicables encima del canvas) */
.panel{ position: relative; }

.hotspots{
  position:absolute;
  inset:0;
  pointer-events:none;
}

.hotspot{
  position:absolute;
  pointer-events:auto;
  cursor:pointer;
  border-radius: 12px;
  background: rgba(255,255,255,0); /* invisible */
  /* Para ajustar visualmente, descomenta: */
  /*outline: 2px dashed rgba(0,255,0,.55); */
}

/* ===== Tooltip para hotspots ===== */
.hotspot{
  position:absolute;
  pointer-events:auto;
  cursor:pointer;
}

/* burbuja */
.hotspot::after{
  content: attr(data-tooltip);
  position:absolute;
  left:50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(6px);
  white-space: nowrap;

  padding: 6px 10px;
  font-size: 12px;
  color: #fff;
  background: rgba(20,22,30,.92);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0,0,0,.45);

  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

/* flechita */
.hotspot::before{
  content:"";
  position:absolute;
  left:50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(20,22,30,.92);

  opacity:0;
  transition: opacity 160ms ease;
}

/* hover desktop */
.hotspot:hover::after,
.hotspot:hover::before{
  opacity:1;
  transform: translateX(-50%) translateY(0);
}

/* visible por JS (móvil) */
.hotspot.show-tip::after,
.hotspot.show-tip::before{
  opacity:1;
  transform: translateX(-50%) translateY(0);
}

