
/* ============ Library Laser · estilo videojuego ============ */
.llp, .llp-404 {
  --red: #ca1c1d; --red-d: #8e1112; --red-dd: #4a0708;
  --wood: #f1d6a8; --wood-d: #c99a5e; --wood-dd: #8a5a2b;
  --gold: #ffc94a; --gold-d: #d99a14; --ink: #2a0a0a;
  font-family: 'Baloo 2', system-ui, sans-serif;
}
.llp *, .llp *::before, .llp *::after { box-sizing: border-box; }
.llp { box-sizing: border-box;
  position: relative; overflow: hidden; color: var(--ink); text-align: center;
  width: 100vw; max-width: 100vw; left: 50%; right: 50%; margin: -10px -50vw 0; /* ancho completo */
  padding: 34px 16px 46px; min-height: 640px;
  background:
    radial-gradient(ellipse at 50% -10%, #ff7a5c 0%, transparent 55%),
    radial-gradient(ellipse at 100% 100%, #5a0d10 0%, transparent 55%),
    linear-gradient(180deg, #e8413a 0%, var(--red) 40%, var(--red-dd) 100%);
}
html:has(.llp), body:has(.llp) { overflow-x: hidden; }
#columns:has(.llp), .columns-container:has(.llp) { overflow: visible; }

/* Piezas cortadas a láser flotando en el fondo */
.llp-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.llp-bg span {
  position: absolute; bottom: -120px; width: 64px; height: 64px; opacity: .22;
  border: 3px solid #fff; border-radius: 12px; animation: llp-float 16s linear infinite;
}
.llp-bg span:nth-child(3n) { border-radius: 50%; border-style: dashed; }
.llp-bg span:nth-child(3n+1) { clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: rgba(255,255,255,.35); border: 0; }
.llp-bg span:nth-child(4n) { background: repeating-linear-gradient(45deg, rgba(255,255,255,.5) 0 4px, transparent 4px 10px); }
@keyframes llp-float { from { transform: translateY(0) rotate(0); } to { transform: translateY(-130vh) rotate(360deg); } }

.llp-head { position: relative; z-index: 2; margin-bottom: 18px; }
.llp-big {
  font-size: clamp(64px, 14vw, 140px); font-weight: 800; line-height: .9; margin: 0; color: #fff; letter-spacing: 4px;
  text-shadow: 0 6px 0 var(--red-d), 0 12px 0 var(--red-dd), 0 18px 30px rgba(0,0,0,.4);
}
.llp-title {
  font-family: inherit; font-size: clamp(30px, 6vw, 56px) !important; font-weight: 800; line-height: 1; margin: 6px 0 0 !important;
  color: #fff !important; text-transform: none !important; letter-spacing: 1px; border: 0 !important; padding: 0 !important; background: none !important;
  text-shadow: 0 4px 0 var(--red-d), 0 8px 0 var(--red-dd), 0 14px 24px rgba(0,0,0,.4);
  animation: llp-bounce 2.4s ease-in-out infinite;
}
@keyframes llp-bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Panel tipo madera cortada a láser */
.llp-panel {
  position: relative; z-index: 2; max-width: 520px; margin: 0 auto 18px; padding: 22px 18px; border-radius: 28px;
  background:
    repeating-linear-gradient(92deg, rgba(138,90,43,.07) 0 3px, transparent 3px 11px),
    repeating-linear-gradient(88deg, rgba(255,255,255,.12) 0 2px, transparent 2px 17px),
    linear-gradient(180deg, #f7e2bb, var(--wood));
  box-shadow: 0 10px 0 var(--wood-d), 0 12px 0 var(--wood-dd), 0 26px 40px rgba(0,0,0,.4);
  animation: llp-pop .5s cubic-bezier(.3,1.7,.5,1);
}
.llp-panel::before { /* línea de corte láser */
  content: ''; position: absolute; inset: 8px; border-radius: 22px; border: 2px dashed rgba(138,90,43,.35); pointer-events: none;
}
.llp-lead { font-size: 19px; line-height: 1.35; font-weight: 700; margin: 0 0 16px; color: var(--ink); position: relative; }

.llp-rules { display: flex; gap: 10px; justify-content: center; margin-bottom: 22px; position: relative; }
.llp-rule {
  flex: 1; max-width: 140px; background: #fff; border-radius: 18px; padding: 10px 6px 8px;
  box-shadow: 0 5px 0 var(--wood-d); display: flex; flex-direction: column; align-items: center; line-height: 1.1;
}
.llp-rule span { font-size: 30px; }
.llp-rule b { font-size: 20px; color: var(--red); margin-top: 4px; }
.llp-rule small { font-size: 13px; color: #7a5a3a; font-weight: 700; }

/* Botones gruesos */
.llp-btn, a.llp-btn, button.llp-btn {
  font: inherit; font-weight: 800; font-size: 17px; border: 0; cursor: pointer; text-decoration: none !important;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px; border-radius: 18px; color: #fff !important; background: var(--red);
  box-shadow: 0 6px 0 var(--red-d), 0 10px 16px rgba(0,0,0,.25); transition: transform .1s, box-shadow .1s, filter .15s;
  position: relative;
}
.llp-btn:hover { filter: brightness(1.12); color: #fff !important; }
.llp-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--red-d); }
.llp-btn-xl { font-size: 22px; padding: 14px 34px; border-radius: 22px; }
.llp-btn.llp-btn-dark { background: #3a1a12; box-shadow: 0 6px 0 #160805, 0 10px 16px rgba(0,0,0,.25); }
.llp-btn.llp-btn-dark:active { box-shadow: 0 1px 0 #160805; }
.llp-btn.llp-btn-wa { background: #25d366; box-shadow: 0 6px 0 #128c4a, 0 10px 16px rgba(0,0,0,.25); font-size: 18px; margin-top: 16px; }
.llp-btn.llp-btn-wa:active { box-shadow: 0 1px 0 #128c4a; }
.llp-btn-wa svg { width: 24px; height: 24px; }
.llp-pulse { animation: llp-pulse 1.3s ease-in-out infinite; }
@keyframes llp-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* HUD */
.llp-hud { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; position: relative; }
.llp-pill {
  font: inherit; font-weight: 800; font-size: 18px; color: #fff; background: #3a1a12; border: 0;
  padding: 4px 16px; border-radius: 999px; box-shadow: 0 4px 0 #160805;
}
.llp-pill b { color: var(--gold); }
.llp-timer { background: var(--red); box-shadow: 0 4px 0 var(--red-d); min-width: 96px; font-size: 22px; }
.llp-timer.is-hurry { background: var(--gold); color: var(--ink); box-shadow: 0 4px 0 var(--gold-d); animation: llp-shake .4s infinite; }
.llp-sound { cursor: pointer; padding: 4px 12px; }
.llp-steps { display: flex; gap: 5px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; position: relative; }
.llp-steps i { width: 22px; height: 10px; border-radius: 6px; background: rgba(138,90,43,.3); }
.llp-steps i.is-done { background: var(--red); box-shadow: 0 0 8px rgba(202,28,29,.7); }
.llp-steps i.is-now { background: var(--gold); animation: llp-pulse 1s infinite; }

/* Tablero */
.llp-board-wrap { position: relative; }
.llp-board {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 18px; padding: 6px; display: grid; gap: 4px;
  background: linear-gradient(145deg, #5a3a22, #2e1a0e); box-shadow: inset 0 4px 12px rgba(0,0,0,.5);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.llp-tile {
  position: relative; border: 0; padding: 0; border-radius: 9px; cursor: pointer; background-repeat: no-repeat; background-color: #fff;
  box-shadow: 0 4px 0 rgba(0,0,0,.35), 0 6px 10px rgba(0,0,0,.25);
  transition: transform .25s cubic-bezier(.3,1.6,.5,1), box-shadow .2s;
}
.llp-tile::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(140deg, rgba(255,255,255,.45) 0%, rgba(255,255,255,0) 35%, rgba(0,0,0,0) 70%, rgba(0,0,0,.15) 100%); }
.llp-tile:hover { transform: translateY(-3px); }
.llp-tile.is-sel { transform: translateY(-8px) scale(1.06); z-index: 3; box-shadow: 0 0 0 4px var(--gold), 0 12px 18px rgba(0,0,0,.4); }
.llp-tile.is-ok { box-shadow: 0 0 0 2px rgba(255,201,74,.9), 0 4px 0 rgba(0,0,0,.3); }
.llp-tile.is-swap { animation: llp-pop .35s cubic-bezier(.3,1.7,.5,1); }
.llp-board.is-done { gap: 0; transition: gap .5s; }
.llp-board.is-done .llp-tile { border-radius: 0; box-shadow: none; }
.llp-board.is-done .llp-tile::after { display: none; }

/* Rayo láser que recorre el tablero al completarlo */
.llp-laser { position: absolute; left: 0; right: 0; top: 0; height: 4px; z-index: 4; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent, #ff3b3b, #fff, #ff3b3b, transparent); box-shadow: 0 0 18px 6px rgba(255,40,40,.8); }
.llp-board.is-done .llp-laser { animation: llp-scan 1s ease-in-out; }
@keyframes llp-scan { 0% { top: 0; opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

.llp-help { display: flex; align-items: center; gap: 12px; margin-top: 14px; text-align: left; font-weight: 700; color: #6a4a2a; font-size: 15px; line-height: 1.25; position: relative; }
.llp-preview { width: 70px; height: 70px; flex: 0 0 70px; object-fit: cover; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 4px 0 var(--wood-d); }

/* Tarjeta de rompecabezas completado */
.llp-win { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  background: rgba(42,10,10,.6); backdrop-filter: blur(3px); border-radius: 18px; padding: 12px; }
.llp-win[hidden] { display: none; }
.llp-card { background: #fff; border-radius: 24px; padding: 16px 16px 20px; width: 100%; max-width: 340px;
  box-shadow: 0 10px 0 var(--wood-d), 0 20px 40px rgba(0,0,0,.4); animation: llp-pop .5s cubic-bezier(.3,1.7,.5,1);
  display: flex; flex-direction: column; align-items: center; gap: 10px; }
.llp-stars { font-size: 30px; letter-spacing: 4px; animation: llp-bounce 1s infinite; }
.llp-card img { width: 120px; height: 120px; object-fit: cover; border-radius: 14px; background: #f5ece0; }
.llp-card img:not([src]) { display: none; }
.llp-card h3 { font-family: inherit; margin: 0; font-size: 19px; line-height: 1.15; color: var(--ink); text-transform: none; }
.llp-card .llp-btn { width: 100%; }

/* Resultado */
.llp-emoji { font-size: 76px; line-height: 1; margin-bottom: 8px; position: relative; }
.is-won .llp-emoji { animation: llp-win 1.2s ease-in-out infinite; }
.is-lost .llp-emoji { animation: llp-shake .5s ease-in-out 3; }
@keyframes llp-win { 0%,100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-20px) rotate(-8deg); } 60% { transform: translateY(0) rotate(6deg); } }
@keyframes llp-shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.llp-ticket { position: relative; background: var(--gold); border-radius: 18px; padding: 10px 18px 14px; margin: 0 auto 12px; display: inline-block;
  box-shadow: 0 6px 0 var(--gold-d); }
.llp-ticket small { display: block; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; color: #7a4a00; }
.llp-code { font: 800 30px/1 monospace; letter-spacing: 3px; color: var(--ink); border: 3px dashed var(--ink); border-radius: 12px; padding: 10px 16px; user-select: all; background: #fff7dc; }
.llp-actions { margin-top: 16px; position: relative; }
.llp-result .llp-btn-wa { position: relative; }

.llp-files-title { font-family: inherit; color: var(--red); font-size: 24px; margin: 0 0 12px; text-transform: none; position: relative; }
.llp-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; position: relative; }
.llp-file { display: block; background: #fff; border-radius: 16px; padding: 8px; text-decoration: none !important; color: var(--ink) !important;
  box-shadow: 0 5px 0 var(--wood-d); transition: transform .15s; }
.llp-file:hover { transform: translateY(-4px); }
.llp-file img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.llp-file span { display: block; font-size: 13px; font-weight: 700; line-height: 1.2; margin: 6px 0 2px; }
.llp-file em { font-style: normal; font-size: 12px; font-weight: 800; color: var(--red); }

.llp-ad { position: relative; z-index: 2; width: 100%; max-width: none; margin: 0 auto 18px; padding: 0; background: none; text-align: center; overflow: hidden; }
.llp-ad ins.adsbygoogle { margin: 0 auto; }
.llp-ad:empty { display: none; }
.llp-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }

@keyframes llp-pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (max-width: 600px) {
  .llp { padding: 22px 10px 34px; }
  .llp-panel { padding: 16px 12px; border-radius: 22px; }
  .llp-lead { font-size: 17px; }
  .llp-rule span { font-size: 24px; }
  .llp-rule b { font-size: 16px; }
  .llp-btn-xl { font-size: 19px; padding: 12px 24px; }
  .llp-code { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .llp *, .llp *::before, .llp *::after { animation: none !important; transition: none !important; }
}
.llp-panel { width: 100%; min-width: 0; }
.llp-rule { min-width: 0; }
.llp-rule b, .llp-rule small { max-width: 100%; overflow-wrap: anywhere; }
@media (max-width: 600px) { .llp-rules { gap: 6px; } .llp-rule small { font-size: 11px; } }

.llp-help { justify-content: center; text-align: center; }
.llp-wa-top { margin: 16px 0 0; font-size: 17px; padding: 9px 22px; animation: llp-pulse 1.8s ease-in-out infinite; }
.llp-soldout { position: relative; background: #3a1a12; color: #fff; font-weight: 700; border-radius: 16px; padding: 10px 14px; margin: 0 0 16px; box-shadow: 0 5px 0 #160805; }

/* ---------- Íconos SVG ---------- */
.llp-ic { width: 1em; height: 1em; vertical-align: -0.14em; flex: 0 0 auto; }
.llp-rule span { color: var(--red); line-height: 1; }
.llp-pill .llp-ic { color: var(--gold); }
.llp-timer .llp-ic { color: #fff; }
.llp-timer.is-hurry .llp-ic { color: var(--ink); }
.llp-sound .llp-ic { color: #fff; }
.llp-stars { color: var(--gold); filter: drop-shadow(0 3px 0 var(--gold-d)); }
.llp-emoji { color: var(--gold); filter: drop-shadow(0 6px 0 var(--gold-d)); }
.is-lost .llp-emoji { color: #3a1a12; filter: drop-shadow(0 6px 0 rgba(0,0,0,.25)); }
.llp-soldout .llp-ic { color: var(--gold); }

/* ---------- Textos más pequeños ---------- */
.llp-title { font-size: clamp(24px, 4.2vw, 40px) !important; }
.llp-btn.llp-wa-top { font-size: 15px; padding: 7px 18px; margin-top: 12px; }
.llp-btn.llp-wa-top svg { width: 20px; height: 20px; }

/* ---------- Banner grande en la página 404 ---------- */
.llp-404 {
  position: relative; overflow: hidden; box-sizing: border-box; text-align: center; color: #fff;
  width: 100vw; max-width: 100vw; left: 50%; right: 50%; margin: 0 -50vw 26px; padding: 40px 16px 46px;
  background:
    radial-gradient(ellipse at 50% -10%, #ff7a5c 0%, transparent 55%),
    radial-gradient(ellipse at 100% 100%, #5a0d10 0%, transparent 55%),
    linear-gradient(180deg, #e8413a 0%, var(--red) 45%, var(--red-dd) 100%);
}
html:has(.llp-404), body:has(.llp-404) { overflow-x: hidden; }
.llp-404 *, .llp-404 *::before { box-sizing: border-box; }
.llp-404-bg { position: absolute; inset: 0; pointer-events: none; }
.llp-404-bg span { position: absolute; bottom: -120px; width: 70px; height: 70px; border: 3px solid rgba(255,255,255,.25); border-radius: 14px; animation: llp-float 14s linear infinite; }
.llp-404-bg span:nth-child(1) { left: 5%; animation-delay: -2s; }
.llp-404-bg span:nth-child(2) { left: 20%; animation-delay: -9s; border-radius: 50%; border-style: dashed; }
.llp-404-bg span:nth-child(3) { left: 38%; animation-delay: -5s; width: 40px; height: 40px; }
.llp-404-bg span:nth-child(4) { left: 62%; animation-delay: -12s; border-radius: 50%; }
.llp-404-bg span:nth-child(5) { left: 78%; animation-delay: -7s; width: 50px; height: 50px; border-style: dashed; }
.llp-404-bg span:nth-child(6) { left: 92%; animation-delay: -3s; }
.llp-404-in { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; }
.llp-404-num { font-size: clamp(70px, 14vw, 140px); font-weight: 800; line-height: .9; letter-spacing: 4px;
  text-shadow: 0 6px 0 var(--red-d), 0 12px 0 var(--red-dd), 0 18px 30px rgba(0,0,0,.4); animation: llp-bounce 2.4s ease-in-out infinite; }
.llp-404-title { font-size: clamp(22px, 4vw, 34px); font-weight: 800; margin: 14px 0 4px; text-shadow: 0 3px 0 var(--red-d); }
.llp-404-text { font-size: clamp(16px, 2.4vw, 20px); font-weight: 700; margin: 0 auto 18px; max-width: 620px; text-shadow: 0 2px 6px rgba(0,0,0,.3); }
.llp-404-chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.llp-404-chips span { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--red); font-weight: 800; font-size: 18px;
  padding: 6px 16px; border-radius: 999px; box-shadow: 0 5px 0 rgba(0,0,0,.25); }
.llp-404 a.llp-btn, .llp-404 .llp-btn.llp-btn { background: var(--gold); color: var(--ink) !important; box-shadow: 0 7px 0 var(--gold-d), 0 12px 20px rgba(0,0,0,.3);
  font-size: 24px; padding: 14px 40px; border-radius: 22px; animation: llp-pulse 1.3s ease-in-out infinite; }
