/* css/escena.css — «GN Escena» en La Guarida (1.5.0, 2026-11-17, BL-091 ESC-6)
   La estética de mi sitio (pablosnchz.github.io/shiruvana) llevada a La Guarida, con
   lo que Pablo eligió en la maqueta ESC-0 (todas las ★):
   - fondo «Taller»: cuadrícula tenue, luz ámbar arriba a la izquierda y violeta abajo
     a la derecha, y chispas que suben (las pone js/escena.js);
   - secciones en una cápsula, con la activa en ámbar;
   - paneles apenas translúcidos, con la línea de color de su sección arriba, que entran
     de a uno al abrir;
   - 1.1.0 (ESC-2): mi globo abajo a la derecha, con mi cara y el gato robot sentado
     encima; adentro va el consejo del día. Se pliega a la cara y el gato;
   - 1.2.0 (ESC-3): yo de cuerpo entero cuando una sección está vacía y en el buscador
     (Ctrl K), fundida con el fondo como en mi sitio;
   - 1.3.0 (ESC-4): la bienvenida del día, los ojos del gato y el saludo (unos 3 s);
   - 1.4.0 (ESC-5): la paleta exacta de mi sitio y mis poses SIN fondo: ya no se funden
     con mix-blend (en el buscador dejaba un rectángulo negro); usan los recortes que hace
     js/escena.js (--esc-p-<pose>). El resto del restyle vive en css/universo.css;
   - 1.5.0 (ESC-6): sin reglas nuevas acá; la cabecera que se esfuma y el buscador sin mi
     cara están en css/universo.css 1.1.0 (la versión acompaña a js/escena.js).
   SOLO con el theme Gato Negro: cada regla cuelga de body[data-theme="gato"] (lo único
   suelto es esconder lo nuevo) y los otros 18 themes quedan exactamente como estaban.
   Sin backdrop-filter ni transform en la cabecera: los menús de «⋯» usan position: fixed
   en el celular y no deben moverse.
   Volver atrás: quitar esta hoja y js/escena.js de index.html. */

/* ---- Fondo «Taller», fijo detrás de todo ---- */
body[data-theme="gato"]::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55% 60% at 82% 70%, rgba(155, 130, 255, .18), transparent 70%),
    radial-gradient(40% 40% at 10% 12%, rgba(232, 179, 75, .1), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px) 0 0 / 48px 100%;
}

/* ---- Chispas: ocultas salvo con el theme Gato Negro ---- */
.esc-chispas { display: none; }
body[data-theme="gato"] .esc-chispas { display: block; position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
body[data-theme="gato"] .esc-chispas i {
  position: absolute; bottom: -10px; left: calc(3% + var(--i) * 7%); width: 3px; height: 3px; border-radius: 50%; opacity: 0;
  background: #E8B34B; box-shadow: 0 0 8px #E8B34B;
  animation: escChispa calc(9s + var(--i) * .5s) linear calc(var(--i) * -1.1s) infinite;
}
body[data-theme="gato"] .esc-chispas i:nth-child(3n) { background: #9B82FF; box-shadow: 0 0 8px #9B82FF; }

/* ---- Cabecera: deja ver el escenario, opaca a la vista ---- */
body[data-theme="gato"] .app-header { background: rgba(11, 11, 16, .92); }

/* ---- Secciones en cápsula ---- */
body[data-theme="gato"] .app-nav {
  justify-self: center; flex-wrap: nowrap; gap: 2px; padding: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  border: 1px solid var(--border); border-radius: 999px; background: rgba(21, 21, 29, .8);
}
body[data-theme="gato"] .app-nav::-webkit-scrollbar { display: none; }
body[data-theme="gato"] .app-tab {
  min-height: 32px; padding: 0 14px; border-bottom: 0; border-radius: 999px; font-size: .85rem;
  transition: color var(--transition-speed) ease, background var(--transition-speed) ease;
}
body[data-theme="gato"] .app-tab:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
/* #111 sobre el ámbar: 10:1 */
body[data-theme="gato"] .app-tab[aria-current="true"] { background: #E8B34B; color: #111111; font-weight: 700; }

/* ---- Paneles sobre el escenario ---- */
body[data-theme="gato"] .gn-panel {
  background: rgba(21, 21, 29, .9); border-top: 3px solid var(--esc-color, var(--border));
  animation: escSube .5s ease-out calc(var(--esc-orden, 0) * 80ms) both;
}
body[data-theme="gato"] #seccionWidgets { --esc-color: #9B82FF; --esc-orden: 1; }
body[data-theme="gato"] #seccionFavoritos { --esc-color: #E8B34B; --esc-orden: 2; }
body[data-theme="gato"] #seccionCategorias { --esc-color: #9B82FF; --esc-orden: 3; }
body[data-theme="gato"] #launcherPanel { --esc-color: #2EC4B6; --esc-orden: 4; }

/* ---- ESC-2: mi globo con el gato encima ---- */
.esc-globo { display: none; }
/* Debajo del portal (9000), del editor (10000) y de los avisos del kit (10002) */
body[data-theme="gato"] .esc-globo {
  position: fixed; right: 20px; bottom: 20px; z-index: 7000; width: min(400px, calc(100vw - 40px));
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 14px 16px;
  border: 1px solid var(--border); border-radius: 18px; background: rgba(21, 21, 29, .97);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5); color: var(--text);
  animation: escSube .4s ease-out .3s both;
}
/* Con un menú abierto (＋ o ⋯) el globo se corre: en el celular el menú llega hasta abajo */
body[data-theme="gato"]:has(details.gn-menu[open]) .esc-globo { display: none; }
/* Que el globo no tape lo último de la página */
body[data-theme="gato"] .app-main { padding-bottom: 150px; }
body[data-theme="gato"] .esc-cara {
  flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #000; box-shadow: 0 0 0 2px #E8B34B;
}
body[data-theme="gato"] .esc-dice { flex: 1; min-width: 0; }
/* Ámbar sobre el globo: 9,4:1 */
body[data-theme="gato"] .esc-nombre { margin: 0; font-size: .7rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #E8B34B; }
body[data-theme="gato"] .esc-texto { margin: 2px 0 0; font-size: .9rem; line-height: 1.45; }
body[data-theme="gato"] .esc-plegar {
  flex: none; width: 28px; height: 28px; border: 1px solid transparent; border-radius: 8px; background: none;
  color: var(--gn-muted); font: inherit; font-size: 1rem; line-height: 1; cursor: pointer;
}
body[data-theme="gato"] .esc-plegar:hover { color: var(--text); border-color: var(--border); }

/* El gato, sentado sobre el borde del globo */
body[data-theme="gato"] .esc-gato {
  position: absolute; right: 44px; bottom: calc(100% - 14px); width: 88px; padding: 0; border: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5));
}
body[data-theme="gato"] .esc-gato[hidden] { display: none; }
body[data-theme="gato"] .esc-gato img { display: block; width: 100%; height: auto; }
body[data-theme="gato"] .esc-gato.is-salta img { animation: escSalta .6s ease both; }
/* #111 sobre el ámbar: 10,4:1 */
body[data-theme="gato"] .esc-gato-dice {
  position: absolute; right: 136px; bottom: calc(100% + 30px); padding: 5px 11px; border-radius: 12px;
  background: #E8B34B; color: #111111; font-size: .8rem; font-weight: 650; white-space: nowrap; pointer-events: none;
}
body[data-theme="gato"] .esc-gato-dice:empty { display: none; }

/* Con consejo: habla el consejo, con su propia cara (explica, u ojo si es del backup) */
body[data-theme="gato"] .esc-globo.con-consejo .esc-cara,
body[data-theme="gato"] .esc-globo.con-consejo .esc-nombre,
body[data-theme="gato"] .esc-globo.con-consejo .esc-texto { display: none; }
body[data-theme="gato"] .esc-slot .gn-toast {
  position: static; width: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; animation: none;
}
body[data-theme="gato"] .esc-slot .gn-toast[hidden] { display: none; }
body[data-theme="gato"] .esc-slot .gn-toast__avatar { width: 44px; height: 44px; box-shadow: 0 0 0 2px #E8B34B; }
body[data-theme="gato"] .esc-slot .gn-toast__who { letter-spacing: .04em; color: #E8B34B; }

/* Plegado: solo la cara y el gato */
body[data-theme="gato"] .esc-globo.is-plegado { width: auto; padding: 8px; border-radius: 999px; align-items: center; }
body[data-theme="gato"] .esc-globo.is-plegado .esc-dice { display: none; }
body[data-theme="gato"] .esc-globo.is-plegado .esc-cara { display: block; }
body[data-theme="gato"] .esc-globo.is-plegado .esc-gato { right: 30px; width: 64px; }
body[data-theme="gato"] .esc-globo.is-plegado .esc-gato-dice { right: 0; }

/* ---- ESC-3: yo de cuerpo entero en los estados vacíos ----
   1.4.0: la pose va sin fondo (el recorte de js/escena.js, --esc-p-<pose>); hasta que
   está lista, solo el texto. El texto dice qué hacer. */
body[data-theme="gato"] #favoritesGrid:not(:has(.fav-card))::before,
body[data-theme="gato"] #categoriesGrid:not(:has(.category-card))::before,
body[data-theme="gato"] .launcher-grid:not(:has(.launcher-item))::before {
  grid-column: 1 / -1; display: flex; align-items: flex-end; min-height: 170px; padding: 0 8px 18px 140px;
  background-repeat: no-repeat; background-position: 8px bottom; background-size: auto 170px;
  color: var(--gn-muted); font-size: .85rem; line-height: 1.45;
}
body[data-theme="gato"] #favoritesGrid:not(:has(.fav-card))::before {
  content: "Todavía no tenés favoritos. Soltá un enlace acá o tocá «+ Favorito» y te lo dejo a un clic.";
  background-image: var(--esc-p-sentada, none);
}
body[data-theme="gato"] #categoriesGrid:not(:has(.category-card))::before {
  content: "Todavía no armaste categorías. Con «+ Categoría» agrupamos tus enlaces por tema.";
  background-image: var(--esc-p-saluda, none);
}
body[data-theme="gato"] .launcher-grid:not(:has(.launcher-item))::before {
  min-height: 130px; padding-left: 104px; background-size: auto 130px;
  content: "Nada por acá todavía. Tocá «+» y lo dejo a un clic.";
  background-image: var(--esc-p-pensando, none);
}

/* ---- ESC-3: yo en el buscador, en lugar del retrato ---- */
.esc-portal-pose { display: none; }
body[data-theme="gato"] .gh-portal-fig { display: none; }
body[data-theme="gato"] .esc-portal-pose {
  display: block; flex: none; align-self: flex-start; width: auto; height: 320px; margin: -10px 4px 0 0; pointer-events: none;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55)) drop-shadow(0 0 22px rgba(155, 130, 255, .25));
  animation: escSube .3s ease-out both;
}
body[data-theme="gato"] .esc-portal-pose[hidden] { display: none; }
@media (max-width: 1000px) { body[data-theme="gato"] .esc-portal-pose { display: none; } }

/* ---- ESC-4: la bienvenida del día ----
   Encima de todo (los avisos del kit usan 10002) y solo unos 3 s: se apaga sola a los
   2,2 s y js/escena.js la saca a los 3,2 s, con un toque o con cualquier tecla. */
.esc-bienvenida { display: none; }
body[data-theme="gato"] .esc-bienvenida {
  position: fixed; inset: 0; z-index: 10005; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: #000000; color: #F4F6FA; cursor: pointer; animation: escApaga .9s ease 2.2s both;
}
body[data-theme="gato"] .esc-ojos { display: flex; gap: 46px; }
body[data-theme="gato"] .esc-ojos i {
  width: 46px; height: 22px; border-radius: 50%; background: #E8B34B;
  box-shadow: 0 0 26px #E8B34B, 0 0 60px rgba(232, 179, 75, .5); animation: escParpadeo 1.2s ease .2s both;
}
body[data-theme="gato"] .esc-bv-saludo { margin: 0; font-size: 1.6rem; font-weight: 800; animation: escSube .6s ease-out 1s both; }
/* Gris claro sobre negro: 9,9:1 */
body[data-theme="gato"] .esc-bv-pasar { margin: 0; font-size: .85rem; color: #A9B0BC; animation: escSube .6s ease-out 1.3s both; }

@keyframes escChispa { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: .6; } 80% { opacity: .35; } 100% { transform: translateY(-105vh); opacity: 0; } }
@keyframes escSube { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes escSalta { 0%, 100% { transform: none; } 40% { transform: translateY(-12px) rotate(-4deg); } }
@keyframes escApaga { to { opacity: 0; visibility: hidden; } }
@keyframes escParpadeo { 0% { transform: scaleY(0); } 40% { transform: scaleY(1); } 55% { transform: scaleY(.1); } 70%, 100% { transform: scaleY(1); } }

/* Celular: el globo ocupa el ancho de abajo; plegado, se corre a la derecha */
@media (max-width: 760px) {
  body[data-theme="gato"] .esc-globo { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
  body[data-theme="gato"] .esc-globo.is-plegado { width: auto; }
  body[data-theme="gato"] .esc-gato { width: 72px; }
}

/* Con «reducir movimiento», escenario quieto: sin chispas, entradas ni saltos */
@media (prefers-reduced-motion: reduce) {
  body[data-theme="gato"] .esc-chispas { display: none; }
  body[data-theme="gato"] .gn-panel { animation: none; }
  body[data-theme="gato"] .esc-globo { animation: none; }
  body[data-theme="gato"] .esc-gato.is-salta img { animation: none; }
  body[data-theme="gato"] .esc-portal-pose { animation: none; }
  body[data-theme="gato"] .esc-bienvenida { display: none; }
}
