/* ══════════════════════════════════════════════════════════
   LAYOUT NUEVO — sidebar + hero + tarjetas de imagen con título
   Se carga DESPUÉS de styles.css y sobreescribe lo necesario.
   ══════════════════════════════════════════════════════════ */
:root {
  --accent: #d3e6de;
  --accent-text: #12352b;
  --side-w: 176px;
}
[data-theme="dark"] {
  --accent: #24413a;
  --accent-text: #d6efe6;
}

.is-hidden { display: none !important; }
.m-only { display: none; }

.container { max-width: 1240px; padding-top: 28px; }

/* ── HEADER ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  padding: 0 0 22px;
}
.brand { text-align: left; }
.brand .main-title { justify-content: flex-start; }
.brand .subtitle { text-align: left; margin-top: 4px; }
.brand .subtitle { white-space: nowrap; }

/* ── SUBTÍTULO: ícono animado al final de cada frase (lo arma main.js) ──
   El contenedor mide 0x0 y el SVG se posiciona absoluto, así que aparecer/desaparecer
   no mueve nada del layout. Aparece al terminar de escribir y se va antes de borrar. */
.sub-ic {
  --ic-g: #3B6D11; --ic-p: #534AB7; --ic-a: #BA7517; --ic-b: #185FA5;
  display: inline-block;
  position: relative;
  width: 0; height: 0;
  margin-left: 6px;
  opacity: 0;
  transform: translateY(2px) scale(0.8);
  transform-origin: left center;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
[data-theme="dark"] .sub-ic { --ic-g: #97C459; --ic-p: #AFA9EC; --ic-a: #EF9F27; --ic-b: #85B7EB; }
.sub-ic.on { opacity: 1; transform: none; }
.sub-ic svg { position: absolute; left: 0; bottom: -4px; overflow: visible; }
.si-g { color: var(--ic-g); }
.si-p { color: var(--ic-p); }
.si-a { color: var(--ic-a); }
.si-t { color: var(--text-color); }
.sub-ic .si-b { color: var(--ic-b); }
.si-x { transform-box: fill-box; transform-origin: center; }
.si-fl   { animation: subic-fl 1s steps(2) infinite; }
.si-fall { animation: subic-fall 1.1s linear infinite; }
.si-rise { animation: subic-rise 1.8s ease-out infinite; }
.si-shk  { animation: subic-shk 0.14s linear infinite; }
.si-run  { animation: subic-run 0.3s ease-in-out infinite; }
.si-spin { animation: subic-spin 6s linear infinite; }
.si-rain { animation: subic-rain 1s linear infinite; }
@keyframes subic-fl   { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }
@keyframes subic-fall { 0% { transform: translateY(-6px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(22px); opacity: 0; } }
@keyframes subic-rise { 0% { transform: translateY(0) scale(0.6); opacity: 0.9; } 100% { transform: translateY(-10px) scale(1.5); opacity: 0; } }
@keyframes subic-shk  { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes subic-run  { 0%, 100% { transform: translateX(-1px); } 50% { transform: translateX(1px) rotate(4deg); } }
@keyframes subic-spin { to { transform: rotate(360deg); } }
@keyframes subic-rain { 0% { transform: translateY(-2px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(3px); opacity: 0; } }
/* ── OPCIÓN D (solo desktop): logo dentro de la barra lateral ──
   Logo arriba a la izquierda (con el ancho de la sidebar) y pegado a ella al scrollear,
   íconos sociales arriba a la derecha. En mobile (≤900px) no cambia nada.
   --brand-h = alto reservado para logo + subtítulo. Si se ve apretado, subilo a 110px. */
@media (min-width: 901px) {
  :root { --brand-h: 96px; }

  .container { position: relative; }

  /* El header "desaparece" como caja: .brand y .header-social pasan a ser hijos directos
     del container. Así el logo puede quedar pegajoso (sticky) igual que la sidebar. */
  .site-header { display: contents; }

  /* Logo: sticky con el mismo top que la sidebar, así se mueve junto con ella al scrollear.
     height: 0 para no empujar el layout (el contenido se desborda hacia abajo). */
  .brand {
    position: sticky;
    top: 52px;                       /* mismo top que tenía la sidebar: queda debajo de la marquesina fija */
    height: 0;
    z-index: 5;
    /* El navegador pasa un elemento sticky a su propia capa recién al scrollear, y ahí cambia
       el suavizado del texto (se ve "otra fuente muy parecida"). Con will-change lo dejamos
       en su capa desde el principio, así el texto se ve igual antes y después de scrollear. */
    will-change: transform;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin-left: 0;
    width: var(--side-w);
    padding-left: 12px;
  }
  /* Misma tipografía original (Courier Prime, peso 800, color del tema); solo cambia la escala.
     letter-spacing en em = los -2px de los 64px originales, proporcional. */
  .brand .main-title {
    font-size: 34px;
    letter-spacing: -0.03125em;
    font-weight: 800;
    color: var(--text-color);
    opacity: 1;
  }
  .brand .subtitle {
    font-size: 12px;
    min-height: 1.5em;
    margin-top: 6px;
    line-height: 1.3;
    font-family: 'Courier New', monospace;   /* igual que el subtítulo original */
    opacity: 0.8;
  }

  /* Íconos sociales: arriba a la derecha, fijos en la página (no acompañan el scroll) */
  .header-social {
    position: absolute;
    top: 28px; right: 0;
    z-index: 5;
    padding-right: 4px;
  }


  .sidebar { top: 52px; padding-top: var(--brand-h); }
  .main { padding-top: 44px; }                       /* franja para los íconos sociales */
}

.header-social { display: flex; align-items: center; gap: 14px; }
.header-ico {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  opacity: 0.8;
  transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.2s ease;
}
.header-ico:hover { opacity: 1; transform: translateY(-2px); background: rgba(0,0,0,0.05); }
.header-ico svg {
  width: 20px; height: 20px;
  stroke: currentColor; fill: none;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

.menu-btn {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-color);
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
}
.menu-btn svg {
  width: 20px; height: 20px;
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round;
}

/* ── LAYOUT: sidebar + contenido ── */
.layout {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  text-align: left;
}
#sidebar-backdrop { display: none; }

.sidebar {
  position: sticky;
  top: 52px;
}
.cat-nav { display: flex; flex-direction: column; gap: 4px; }
.cat-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: none;
  border-radius: 10px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-color);
  text-align: left;
  cursor: pointer;
  opacity: 0.7;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.15s ease;
}
.cat-btn svg {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.cat-btn:hover { opacity: 1; background: rgba(0,0,0,0.05); transform: translateX(2px); }
[data-theme="dark"] .cat-btn:hover { background: rgba(255,255,255,0.07); }
.cat-btn.active { background: var(--accent); color: var(--accent-text); opacity: 1; }
.cat-btn:focus-visible { outline: 2px solid var(--text-color); outline-offset: 2px; }

.side-social { display: none; }

/* ── HERO ──
   Imagen recomendada: 2400 x 900 px (relación 8:3).
   En desktop se ve completa (8:3); en mobile se recorta a 2:1 con object-fit: cover,
   por eso lo importante tiene que estar en el centro. */
.hero {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 8 / 3;
  background: linear-gradient(135deg, #2b3a2e, #3b2f22);
  box-shadow: 0 8px 28px rgba(0,0,0,0.14);
}
.hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ── GRILLA ── */
.grid { margin-top: 22px; gap: 14px; }

.grid .item {
  height: 250px;          /* misma altura de imagen que tenías antes */
  border: 0;
  border-radius: 14px;
  background: #1b1b1b;
}
.grid .item:not(.extra) .card-image-container {
  position: absolute;
  inset: 0;
  height: 100%;
  border: 0;
}
.grid .item:not(.extra) .card-image {
  opacity: 1;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
  backface-visibility: hidden;
}
.grid a.item:hover .card-image { transform: scale(1.05); }
/* El blur del fondo de .item (styles.css) no se ve nunca acá: la tarjeta es opaca. Pero obliga al navegador a
   armar una capa extra con recorte redondeado que se re-dibuja al terminar el hover (el corrimiento de unos px). */
.grid .item:not(.extra) { backdrop-filter: none; -webkit-backdrop-filter: none; }

.grid .item:not(.extra) .card-content {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  min-height: 0;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 38px 12px 11px 14px;
  text-align: left;
  background: linear-gradient(to top, rgba(0,0,0,0.82), rgba(0,0,0,0));
}
.grid .item:not(.extra) .card-main-title {
  flex: 1;
  min-width: 0;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.card-description { display: none !important; } /* títulos sin descripción */

.card-go {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: #111;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  padding-bottom: 2px;
  transition: transform 0.2s ease;
}
.grid a.item:hover .card-go { transform: translateX(3px); }

/* ── HOVER: TÍTULO AFICHE ──
   La capa .card-poster (creada en main.js) tapa la foto con un velo oscuro y muestra el
   nombre en tipografía gigante con contorno; la última palabra va rellena en amarillo.
   El título chico de abajo se esconde, pero el degradé y la flechita quedan.
   El tamaño de letra se calcula con la capa como contenedor (cqw/cqh) para que entre
   tanto en la tarjeta de PC como en la de celu. */
.grid .item:not(.extra) .card-content { z-index: 9; }
.grid .item:not(.extra) .card-main-title { transition: opacity 0.3s ease; }
.grid a.item:hover .card-main-title,
.grid a.item:focus-visible .card-main-title { opacity: 0; }

.card-poster {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 14px 16px 46px;
  container-type: size;
  background: linear-gradient(90deg, rgba(0,0,0,0.7), rgba(0,0,0,0.25));
  opacity: 0;
  transform: scale(1.25);
  transform-origin: center;
  will-change: transform, opacity;
  backface-visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card-poster-text {
  font-family: 'Courier Prime', monospace;
  font-weight: 700;
  font-size: 26px;   /* respaldo si el navegador no entiende cqw/cqh */
  font-size: min(40px, calc(100cqw / (var(--len, 8) * 0.56)), calc(100cqh / (var(--lines, 2) * 0.92)));
  white-space: nowrap;
  line-height: 0.92;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1.5px #fff;
  overflow-wrap: normal;
}
/* La parte amarilla también lleva trazo (del mismo color): así las dos mitades se dibujan igual
   y no se desfasan en altura mientras la capa escala. font-weight: inherit evita el "bolder" de <b>. */
.card-poster-text b { font-weight: inherit; color: #ffcc33; -webkit-text-stroke: 1.5px #ffcc33; }
/* Título de una sola palabra: capa base con contorno + la misma palabra en amarillo encima,
   recortada desde --cut (la mitad). Al ser el mismo texto, las dos mitades quedan siempre pegadas. */
.card-poster-text .cp-word { position: relative; display: inline-block; white-space: nowrap; }
.card-poster-text .cp-fill {
  position: absolute;
  left: 0; top: 0;
  color: #ffcc33;
  -webkit-text-stroke: 1.5px #ffcc33;
  clip-path: inset(-1em -4px -1em var(--cut, 50%));
}
.grid a.item:hover .card-poster,
.grid a.item:focus-visible .card-poster { opacity: 1; transform: scale(1); }

/* Tarjetas "extra" (idea y lista): mantienen su contenido propio */
.grid .item.extra {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}
.grid .item.extra .wip-sticky-top {
  height: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding: 10px 8px;
  container-type: inline-size;   /* el post-it se escala según el ancho real de la tarjeta */
}
/* El post-it original mide 230x190px (styles.css) y en la tarjeta de celu (200px de alto, ~160px de ancho) se salía y se recortaba,
   cortando la cinta de arriba y el borde de abajo. Acá se redefine en `em`, con el tamaño de letra atado al ancho de la tarjeta:
   queda idéntico al diseño original pero entero, y se adapta a cualquier pantalla. */
.grid .item.extra .wip-sticky-top .sticky {
  font-size: 10px;                                   /* respaldo */
  font-size: min(16px, calc(100cqw / 15.2));         /* 16px = tamaño original; nunca más grande */
  flex: none;
  width: 14.375em;                                   /* 230px */
  min-height: 11.875em;                              /* 190px */
  padding: 1.25em;                                   /* 20px */
  transform: rotate(3deg);
  box-shadow: 0.19em 0.25em 0.5em rgba(0,0,0,0.15), -0.06em -0.06em 0 rgba(0,0,0,0.05);
}
.grid .item.extra .wip-sticky-top .sticky::before { width: 3.125em; height: 0.44em; }   /* la cinta */
.grid .item.extra .wip-sticky-top .sticky-text { font-size: 1.25em; margin-bottom: 0.2em; }
.grid .item.extra .wip-sticky-top .sticky-check { gap: 0.375em; margin-top: 0.5em; }
.grid .item.extra .wip-sticky-top .sticky-box { width: 1em; height: 1em; border-width: 0.09em; border-radius: 0.125em; }
.grid .item.extra .wip-sticky-top .sticky-item { font-size: 1.0625em; }
.grid .item.extra .card-content { flex-grow: 0; min-height: 0; padding: 10px 12px 14px; }

/* Tarjeta de ideas: imagen completa de 250px y el formulario encima */
.grid .item.idea-card .card-content {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 6px;
}
.grid .item.idea-card .card-main-title { flex: none; }
.grid .item.idea-card #idea-success { color: #fff; }

/* ── SECCIONES MOBILE ── */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 10px;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  font-weight: 700;
}
.section-title svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.feat-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.feat-row::-webkit-scrollbar { display: none; }
.feat {
  position: relative;
  flex: 0 0 104px;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  scroll-snap-align: start;
  background: #1b1b1b;
}
.feat img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feat span {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 8px 8px;
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
  background: linear-gradient(to top, rgba(0,0,0,0.82), rgba(0,0,0,0));
}

/* ── BARRA INFERIOR (solo mobile) ── */
.bottom-nav { display: none; }

/* ══════════ TABLET / MOBILE ══════════ */
@media (max-width: 900px) {
  .container { padding: 18px 14px 20px; }
  .site-header { padding-bottom: 14px; }
  .header-social { display: none; }

  /* Título igual que en PC: Courier Prime 800, mismo color y misma escala */
  .brand .main-title {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 34px;
    letter-spacing: -0.03125em;
    font-weight: 800;
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
  }
  .brand .subtitle {
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.3;
    font-family: 'Courier New', monospace;
    opacity: 0.8;
  }

  .layout { grid-template-columns: 1fr; gap: 0; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 250px;
    z-index: 10001;
    background: var(--bg-color);
    padding: 64px 14px 96px;
    transform: translateX(-104%);
    transition: transform 0.3s ease, background-color var(--anim-speed) var(--anim-curve);
    box-shadow: 6px 0 30px rgba(0,0,0,0.25);
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }
  #sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  #sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
  .cat-btn { font-size: 13px; padding: 12px; }
  .side-social {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    padding: 16px 12px 0;
    border-top: 1px dashed var(--card-border);
  }

  .hero { aspect-ratio: 8 / 3; border-radius: 16px; }

  .grid { grid-template-columns: repeat(2, 1fr); margin-top: 16px; gap: 10px; scroll-margin-top: 44px; }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 10px; right: 10px; bottom: 10px;
    z-index: 10002;
    justify-content: space-around;
    padding: 8px 4px 7px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: 0 6px 22px rgba(0,0,0,0.15);
  }
  .bottom-nav button {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: none; border: 0;
    color: var(--text-color);
    font-family: 'Space Mono', monospace;
    font-size: 9px; font-weight: 700;
    opacity: 0.65;
    cursor: pointer;
    padding: 2px 0;
  }
  .bottom-nav button.active { opacity: 1; }
  .bottom-nav svg {
    width: 21px; height: 21px;
    stroke: currentColor; fill: none;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  }
  /* alto de la barra (~58px) + su separación (10px) + un respiro; el footer no suma padding extra acá */
  body { padding-bottom: 76px; }
  #balloon-btn { bottom: 96px; }
  /* Las nubecitas del globo (solo se ven con hover) sobresalían del borde derecho: en celu no hay hover */
  .b-clouds { display: none; }
}

/* Tarjetas: mismo diseño que en PC (foto completa + título abajo con degradé + flechita),
   en 2 columnas y con un alto menor para que entren bien en el ancho del celu. */
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid .item { height: 200px; border-radius: 14px; }
  .grid .item:not(.extra) { height: auto; aspect-ratio: 7 / 5; } /* fotos 700x500: se ven completas, sin recorte */
  .grid .item:not(.extra) .card-content { padding: 30px 8px 9px 10px; gap: 6px; }
  .grid .item:not(.extra) .card-main-title { font-size: 12px; line-height: 1.2; }
  .card-go { width: 18px; height: 18px; font-size: 14px; }
  .grid .item.extra .card-content { padding: 8px 10px 10px; }
  .grid .item.extra .card-main-title { font-size: 12px; }
}



/* ══════════ AVISO — VENTANA DE PAUSA RETRO + FOOTER ══════════ */
.pause-win {
  max-width: 640px;
  margin: 56px auto 0;
  color: var(--text-color);
  border-top: 3px solid var(--text-color);   /* la regla de la que cuelga Pérez */
  text-align: left;
  position: relative;
}
/* Dos zonas claras: a la izquierda Pérez (colgado de la regla) con sus botones; a la derecha el aviso, título y texto juntos */
.pause-body {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  grid-template-areas: "perez msg" "menu menu";
  column-gap: 16px;
  align-items: start;
  padding: 0;
}
.pause-perez { grid-area: perez; }
.pause-msg { grid-area: msg; min-width: 0; padding-top: 16px; }
.pause-title {
  /* Cartel de madera colgado de la regla, como Pérez */
  position: relative;
  display: block;
  width: fit-content;   /* se ajusta al texto y se centra en la columna */
  font-family: 'Space Mono', monospace;
  font-size: 16px; font-weight: 700; line-height: 1.15;
  white-space: nowrap;
  margin: 0 auto 12px;
  padding: 6px 12px;
  background: #8a5a35;
  color: #fdf3dc;
  border: 2px solid #4a2f1a;
  border-radius: 4px;
  transform-origin: 50% -16px;
  animation: cartelSwing 4.5s ease-in-out infinite;
}
/* las dos cuerditas que lo sujetan a la regla */
.pause-title::before,
.pause-title::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  width: 2px; height: 16px;
  background: var(--text-color);
}
.pause-title::before { left: 18%; }
.pause-title::after  { right: 18%; }
@keyframes cartelSwing { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@media (prefers-reduced-motion: reduce) { .pause-title { animation: none; } }
.pause-num {
  /* Nº pegado justo encima de la regla, en el extremo derecho (a la izquierda cuelga Pérez) */
  position: absolute; right: 0; bottom: 100%;
  margin: 0 0 5px;
  font-family: 'Space Mono', monospace; font-size: 11px; line-height: 1;
  opacity: 0.6;
}
/* La rama de Pérez queda justo sobre la regla; se balancea suave desde la rama para que no se despegue de la línea. */
.pause-win .perez-mascot-emoji {
  width: 92px; height: 92px;
  margin-top: -16px;
  transform-origin: 50% 16%;
  animation: perez-hang-soft 3s ease-in-out infinite;
}
@keyframes perez-hang-soft { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
.perez-bubble.visible { opacity: 1; transform: translateY(0) scale(1); }

/* ── PÉREZ (ventana de pausa): textos legibles ──
   Antes: nombre y contador a 7px con 35-40% de opacidad, y la burbuja a 8px: casi invisibles.
   Ahora 11-12px con buen contraste. La burbuja va ENCIMA de Pérez, anclada a su borde izquierdo (así no se sale de la pantalla con frases largas)
   y dentro del carril libre de arriba (.pause-body), por lo que no tapa ni el título ni el párrafo. */
.pause-win .perez-mascot-wrap { gap: 5px; }
.pause-win .perez-mascot-label {
  font-size: 11px;
  letter-spacing: 2px;
  opacity: 0.85;
}
.pause-win .perez-mascot-line { opacity: 0.3; }
.pause-win .perez-total-counter {
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0.3px;
  white-space: normal;
  max-width: 110px;
}
.pause-win .perez-total-counter.visible {
  opacity: 0.85;
  max-height: 44px;
  margin-top: 4px;
}
.pause-win #perez-total-num { font-weight: 700; }
.pause-win .perez-bubble {
  left: 0; right: auto;
  bottom: calc(100% + 1px);
  width: max-content;
  max-width: min(230px, calc(100vw - 80px));
  white-space: normal;
  font-size: 11px;
  line-height: 1.25;
  letter-spacing: 0.2px;
  padding: 4px 9px;
  color: var(--text-color);
  border-width: 1.5px;
  border-radius: 12px 12px 12px 3px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
  transform-origin: left bottom;
}

/* Columna de Pérez: él, su nombre, el contador y sus 4 botones en 2x2 (siempre visibles; antes aparecían solo al pasar el mouse / tocar a Pérez). */
.pause-win #perez-mascot .perez-mascot-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 0; min-width: 0;
}
.pause-win #perez-mascot .perez-mascot-line { display: none; }
.pause-win #perez-mascot .perez-total-counter { text-align: center; max-width: 92px; }
.pause-win .perez-bubble { left: 0; bottom: calc(100% + 16px); }   /* la burbuja sale arriba de la regla */
.pause-win .perez-mascot-actions {
  display: grid; grid-template-columns: repeat(2, 40px); gap: 6px;
  margin-top: 8px;
  opacity: 1; transform: none; pointer-events: all;
}
.pause-win .perez-action-btn {
  width: 40px; height: 40px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--text-color);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 3px 0 var(--text-color);   /* relieve de botón arcade */
  cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.pause-win .perez-action-btn .pix-ic {
  width: 28px; height: 28px;
  image-rendering: pixelated;
  pointer-events: none;   /* el click siempre cae en el botón */
}
.pause-win .perez-action-btn[data-action="leaf"]  { background: #e6f5d8; }
.pause-win .perez-action-btn[data-action="fruit"] { background: #ffeccc; }
.pause-win .perez-action-btn[data-action="water"] { background: #dff1ff; }
.pause-win .perez-action-btn[data-action="sleep"] { background: #e8e4ff; }
[data-theme="dark"] .pause-win .perez-action-btn { background: #2a2a2a; }
/* Estado de reposo FIJO: ni :hover ni :focus (que en el celu quedan pegados después de tocar) pueden cambiar tamaño, posición ni sombra.
   Esto también anula cualquier :hover/:focus que venga de styles.css. */
.pause-win .perez-action-btn,
.pause-win .perez-action-btn:hover,
.pause-win .perez-action-btn:focus {
  transform: none;
  scale: none;
  box-shadow: 0 3px 0 var(--text-color);
  -webkit-tap-highlight-color: transparent;
}
/* Levantarse al pasar el mouse: solo en dispositivos con mouse real */
@media (hover: hover) and (pointer: fine) {
  .pause-win .perez-action-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--text-color); }
}
/* Hundirse mientras se presiona (al soltar vuelve al reposo de arriba) */
.pause-win .perez-action-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--text-color); }
.pause-text {
  margin: 0;
  font-family: 'Courier Prime', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: inherit;
}
.pause-caret {
  display: inline-block;
  width: 7px; height: 13px;
  background: currentColor;
  margin-left: 4px;
  vertical-align: -2px;
  animation: pause-blink 1s steps(1) infinite;
}
@keyframes pause-blink { 50% { opacity: 0; } }
.pause-menu { grid-area: menu; padding: 18px 0 0; }

/* Los 3 chips siempre en la misma fila, repartiéndose el ancho */
.pause-links { display: flex; flex-wrap: nowrap; gap: 8px; }
.pause-links .disclaimer-stub-chip {
  flex: 1 1 0; min-width: 0;
  justify-content: center;
  gap: 4px;
  padding: 3px 6px 4px 4px;
  font-size: 10px;
  white-space: nowrap;
}
/* Cafecito en celeste Mercado Pago (pisa el marrón de styles.css, que carga antes que este archivo) */
.pause-links .chip-cafecito {
  background: #009ee3;
  border-color: #0079b0;
  box-shadow: 0 3px 0 #0079b0;
}
.pause-links .chip-cafecito .ic-circle { background: rgba(255, 255, 255, 0.25); }
/* X e Instagram: mismo relieve que cafecito (borde inferior + sombra sólida del tono oscuro de cada chip) */
.pause-links .chip-x,
.pause-links .chip-instagram {
  border-color: var(--chip-shadow);
  box-shadow: 0 3px 0 var(--chip-shadow);
}
/* PC: los chips suben a la columna derecha, justo debajo del último renglón del texto (a la par del final de los botones de Pérez).
   Celu: la columna del texto es angosta, así que los chips quedan abajo en todo el ancho. */
@media (min-width: 601px) {
  .pause-body { grid-template-areas: "perez msg" "perez menu"; grid-template-rows: auto 1fr; }
  .pause-menu { padding-top: 14px; }
}
.pause-win #easter-egg-stats { margin: 0; padding: 12px 0 0; border-top: 1px dashed var(--card-border); }

.pause-footer {
  text-align: center;
  margin: 22px 0 0;
  padding-bottom: 40px;
  font-size: 14px;
  line-height: 1.45;   /* renglones del footer más juntos */
}
@media (max-width: 900px) { .pause-footer { padding-bottom: 0; } }   /* con barra inferior: el espacio lo da el body */
.pause-footer a { font-weight: 700; }
.pause-footer .monster-footer { display: inline-block; animation: monsterShake 3s ease-in-out infinite; }
/* PC: el footer va en una sola línea (en celu se mantiene el salto) */
@media (min-width: 601px) { .pause-footer .footer-br { display: none; } }
@media (max-width: 600px) {
  .pause-win { margin-top: 44px; }
  .pause-body { column-gap: 14px; }
  .pause-title { font-size: clamp(11px, 3.5vw, 13px); padding: 6px 10px; }
  .pause-text { font-size: 12px; }
}

/* Pérez se balancea con la inclinación del celu (--perez-tilt la actualiza el script de index.php).
   Usa la propiedad `rotate`, que se suma a cualquier animación con transform que ya tenga. */
.pause-win .perez-mascot-emoji {
  transform-origin: 50% 10%;   /* pivotea desde la rama */
  rotate: var(--perez-tilt, 0deg);
}

/* ── CELU / TÁCTIL: de todo el hover de las tarjetas, solo queda el zoom de la foto ──
   En pantallas táctiles :hover/:focus quedan "pegados" después de tocar. Acá se anula el título afiche,
   el levantado + sombra y el desplazamiento de la flechita. El zoom (.card-image scale 1.05) no se toca. */
@media (hover: none) and (pointer: coarse) {
  a.item:hover,
  a.item:focus,
  .grid a.item:hover,
  .grid a.item:focus {
    transform: none;
    box-shadow: none;
  }
  .grid a.item:hover .card-main-title,
  .grid a.item:focus-visible .card-main-title { opacity: 1; }
  .grid a.item:hover .card-poster,
  .grid a.item:focus-visible .card-poster { opacity: 0; transform: scale(1.25); }
  .grid a.item:hover .card-go { transform: none; }
  .item:hover .card-counter,
  .item:focus .card-counter { opacity: inherit; }
}


/* ── GLOBO DE PÉREZ: hiedra en las esquinas ──
   Pegar al FINAL de layout.css (después de las reglas de .pause-win .perez-bubble).
   Las dos hiedras son pseudo-elementos con SVG embebido: no hace falta tocar index.php ni main.js.
   Funciona con cualquier largo de frase porque cada hiedra se ancla a su esquina. */
.pause-win #perez-bubble {
  background: #FAEEDA;
  border: 1.5px solid #854F0B;
  color: #412402;
  border-radius: 10px 10px 10px 3px;   /* la esquina de 3px sigue siendo la "cola" hacia Pérez */
  padding: 11px 24px;                  /* aire a los costados para que la hiedra no pise las letras */
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}
.pause-win #perez-bubble::before,
.pause-win #perez-bubble::after {
  content: '';
  position: absolute;
  width: 64px; height: 40px;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}
.pause-win #perez-bubble::before { top: -8px;    left: -8px;  background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 64 40%22%3E%3Cpath d=%22M2 32C6 20 16 14 28 14C40 12 46 18 56 14%22 stroke=%22%233B6D11%22 stroke-width=%221.8%22 fill=%22none%22 stroke-linecap=%22round%22/%3E%3Cpath transform=%22translate%2816 18%29 rotate%28-60%29 scale%280.8%29 translate%28-10 -10%29%22 d=%22M2 18C2 8 8 2 18 2C18 12 12 18 2 18Z%22 fill=%22%233B6D11%22/%3E%3Cpath transform=%22translate%2816 18%29 rotate%28-60%29 scale%280.8%29 translate%28-10 -10%29%22 d=%22M3 17L15 5%22 stroke=%22%2327500A%22 stroke-width=%221.2%22 fill=%22none%22/%3E%3Cpath transform=%22translate%2830 10%29 rotate%28-20%29 scale%280.75%29 translate%28-10 -10%29%22 d=%22M2 18C2 8 8 2 18 2C18 12 12 18 2 18Z%22 fill=%22%23639922%22/%3E%3Cpath transform=%22translate%2830 10%29 rotate%28-20%29 scale%280.75%29 translate%28-10 -10%29%22 d=%22M3 17L15 5%22 stroke=%22%2327500A%22 stroke-width=%221.2%22 fill=%22none%22/%3E%3Cpath transform=%22translate%2846 18%29 rotate%2820%29 scale%280.75%29 translate%28-10 -10%29%22 d=%22M2 18C2 8 8 2 18 2C18 12 12 18 2 18Z%22 fill=%22%233B6D11%22/%3E%3Cpath transform=%22translate%2846 18%29 rotate%2820%29 scale%280.75%29 translate%28-10 -10%29%22 d=%22M3 17L15 5%22 stroke=%22%2327500A%22 stroke-width=%221.2%22 fill=%22none%22/%3E%3Cpath transform=%22translate%2858 11%29 rotate%28-10%29 scale%280.7%29 translate%28-10 -10%29%22 d=%22M2 18C2 8 8 2 18 2C18 12 12 18 2 18Z%22 fill=%22%2397C459%22/%3E%3Cpath transform=%22translate%2858 11%29 rotate%28-10%29 scale%280.7%29 translate%28-10 -10%29%22 d=%22M3 17L15 5%22 stroke=%22%2327500A%22 stroke-width=%221.2%22 fill=%22none%22/%3E%3C/svg%3E"); }
.pause-win #perez-bubble::after  { bottom: -8px; right: -8px; background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 64 40%22%3E%3Cpath d=%22M62 8C58 20 48 26 36 26C24 28 18 22 8 26%22 stroke=%22%233B6D11%22 stroke-width=%221.8%22 fill=%22none%22 stroke-linecap=%22round%22/%3E%3Cpath transform=%22translate%2854 22%29 rotate%28120%29 scale%280.8%29 translate%28-10 -10%29%22 d=%22M2 18C2 8 8 2 18 2C18 12 12 18 2 18Z%22 fill=%22%233B6D11%22/%3E%3Cpath transform=%22translate%2854 22%29 rotate%28120%29 scale%280.8%29 translate%28-10 -10%29%22 d=%22M3 17L15 5%22 stroke=%22%2327500A%22 stroke-width=%221.2%22 fill=%22none%22/%3E%3Cpath transform=%22translate%2838 32%29 rotate%28160%29 scale%280.75%29 translate%28-10 -10%29%22 d=%22M2 18C2 8 8 2 18 2C18 12 12 18 2 18Z%22 fill=%22%23639922%22/%3E%3Cpath transform=%22translate%2838 32%29 rotate%28160%29 scale%280.75%29 translate%28-10 -10%29%22 d=%22M3 17L15 5%22 stroke=%22%2327500A%22 stroke-width=%221.2%22 fill=%22none%22/%3E%3Cpath transform=%22translate%2822 26%29 rotate%28200%29 scale%280.75%29 translate%28-10 -10%29%22 d=%22M2 18C2 8 8 2 18 2C18 12 12 18 2 18Z%22 fill=%22%233B6D11%22/%3E%3Cpath transform=%22translate%2822 26%29 rotate%28200%29 scale%280.75%29 translate%28-10 -10%29%22 d=%22M3 17L15 5%22 stroke=%22%2327500A%22 stroke-width=%221.2%22 fill=%22none%22/%3E%3Cpath transform=%22translate%2810 30%29 rotate%28170%29 scale%280.7%29 translate%28-10 -10%29%22 d=%22M2 18C2 8 8 2 18 2C18 12 12 18 2 18Z%22 fill=%22%2397C459%22/%3E%3Cpath transform=%22translate%2810 30%29 rotate%28170%29 scale%280.7%29 translate%28-10 -10%29%22 d=%22M3 17L15 5%22 stroke=%22%2327500A%22 stroke-width=%221.2%22 fill=%22none%22/%3E%3C/svg%3E"); }
