/* ============================================================
   MODO NAVIDAD (navidad.js)
   Papel recortado: guirnalda de luces arriba, copos que caen despacio,
   colinas nevadas abajo con un abeto, regalos y un muñeco de nieve.
   La capa va detrás del juego y no se puede tocar.
   ============================================================ */
@media screen {
  .nv-layer {
    position: fixed; inset: 0; z-index: -1;
    pointer-events: none; overflow: hidden; contain: strict;
  }
  .nvp > * { position: absolute; }
  .nvp svg { display: block; width: 100%; height: auto; overflow: visible; }
  .nvp .hwp-defs { width: 0; height: 0; }

  /* un poco de frío arriba (sin tapar el color de cada nivel) */
  .nvp .nvp-cielo {
    inset: 0;
    background:
      radial-gradient(90% 40% at 50% -6%, rgba(205, 228, 255, 0.45), transparent 70%),
      radial-gradient(120% 30% at 50% 108%, rgba(255, 255, 255, 0.55), transparent 70%);
  }

  /* guirnalda de bombillas: las luces se encienden por turnos (solo opacidad, a saltitos) */
  .nvp .nvp-guirnalda { top: -2px; left: 0; right: 0; }
  .nvp-luz { opacity: 0.18; animation: nvp-luz 2.4s steps(1, end) infinite; }
  .nvp-luz-1 { animation-delay: -0.8s; }
  .nvp-luz-2 { animation-delay: -1.6s; }
  @keyframes nvp-luz { 0%, 100% { opacity: 0.18; } 33% { opacity: 0.55; } 66% { opacity: 0.3; } }

  /* copos de papel que caen balanceándose */
  .nvp .nvp-copos { inset: 0; }
  .nvp-copo {
    position: absolute; top: -60px;
    width: calc(30px * var(--s, 1)); height: calc(30px * var(--s, 1));
    animation: nvp-cae var(--t, 20s) linear infinite; animation-delay: var(--d, 0s);
    will-change: transform;
  }
  .nvp-copo svg { height: 100%; }
  @keyframes nvp-cae {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(var(--v, 20px), 28vh) rotate(60deg); }
    50% { transform: translate(0, 56vh) rotate(120deg); }
    75% { transform: translate(calc(var(--v, 20px) * -1), 84vh) rotate(180deg); }
    100% { transform: translate(0, calc(100vh + 80px)) rotate(240deg); }
  }

  /* abajo: nieve, abeto, regalos y muñeco */
  /* el borde de abajo va por encima de todo (marco de la web): no se toca y deja su hueco al cuerpo */
  .nv-borde {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000;
    height: clamp(40px, 9vh, 110px); pointer-events: none;
  }
  html.navidad.nv-con-borde body { padding-bottom: clamp(40px, 9vh, 110px); box-sizing: border-box; }
  .nvp .nvp-colinas { left: 0; right: 0; bottom: 0; height: clamp(40px, 9vh, 110px); }
  .nvp .nvp-colinas svg { height: 100%; }
  .nvp .nvp-abeto { left: clamp(2px, 1.4vw, 28px); bottom: 4px; width: clamp(66px, 9vw, 150px); rotate: -2deg; }
  .nvp .nvp-regalo { bottom: 6px; width: clamp(30px, 3.6vw, 60px); }
  .nvp .nvp-regalo-1 { left: calc(clamp(2px, 1.4vw, 28px) + clamp(60px, 8.4vw, 140px)); rotate: 5deg; }
  .nvp .nvp-regalo-2 { right: calc(clamp(4px, 1.6vw, 30px) + clamp(56px, 8vw, 132px)); width: clamp(26px, 3vw, 50px); rotate: -6deg; }
  .nvp .nvp-muneco { right: clamp(4px, 1.6vw, 30px); bottom: 2px; width: clamp(60px, 8.4vw, 140px); rotate: 3deg; }

  /* en pantallas pequeñas, menos cosas para que no estorbe */
  @media (max-width: 600px) {
    .nvp .nvp-regalo-2 { display: none; }
    .nvp .nvp-abeto, .nvp .nvp-muneco { opacity: 0.9; }
  }
  /* en Navidad no se ofrece el modo Halloween */
  html.navidad .hw-toggle { display: none !important; }
  /* los recortes sueltos de la mesa se quedan, pero más discretos */
  html.recortes.navidad .rc-desk { opacity: 0.5; }
}

@media print {
  .nv-layer, .nv-borde { display: none !important; }
}
/* reducir movimiento: copos quietos y luces fijas */
@media (prefers-reduced-motion: reduce) {
  .nv-layer *, .nv-layer *::before, .nv-layer *::after, .nv-borde * { animation: none !important; }
  .nvp-copo { top: auto; transform: translateY(calc(var(--s, 1) * 30vh)); }
  .nvp-luz { opacity: 0.4; }
}

  /* Piezas de Navidad para los juegos (27-28/10): cada juego las coloca con html.navidad.recortes … */
:root {
  --nv-acebo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 42'%3E%3Cg transform='translate(1.5 2.5)' fill='%232b1206' opacity='.3'%3E%3Cpath d='M5.4 28.3 L10.1 29.6 L14.0 29.0 L18.8 30.4 L21.5 27.4 L25.6 27.2 L27.6 22.7 L30.5 20.1 L32.6 15.7 L32.6 15.7 L27.9 14.4 L24.0 15.0 L19.2 13.6 L16.5 16.6 L12.4 16.8 L10.4 21.3 L7.5 23.9 L5.4 28.3Z' fill='%232b1206'/%3E%3Cpath d='M7.6 27.3L30.4 16.7' stroke='%23a8d08d' stroke-width='1.2' opacity='.7'/%3E%3Cpath d='M27.4 15.7 L29.5 20.1 L32.4 22.7 L34.4 27.2 L38.5 27.4 L41.2 30.4 L46.0 29.0 L49.9 29.6 L54.6 28.3 L54.6 28.3 L52.5 23.9 L49.6 21.3 L47.6 16.8 L43.5 16.6 L40.8 13.6 L36.0 15.0 L32.1 14.4 L27.4 15.7Z' fill='%232b1206'/%3E%3Cpath d='M29.6 16.7L52.4 27.3' stroke='%23a8d08d' stroke-width='1.2' opacity='.7'/%3E%3Ccircle cx='30' cy='26' r='7'/%3E%3C/g%3E%3Cpath d='M5.4 28.3 L10.1 29.6 L14.0 29.0 L18.8 30.4 L21.5 27.4 L25.6 27.2 L27.6 22.7 L30.5 20.1 L32.6 15.7 L32.6 15.7 L27.9 14.4 L24.0 15.0 L19.2 13.6 L16.5 16.6 L12.4 16.8 L10.4 21.3 L7.5 23.9 L5.4 28.3Z' fill='%232f7a3b'/%3E%3Cpath d='M7.6 27.3L30.4 16.7' stroke='%23a8d08d' stroke-width='1.2' opacity='.7'/%3E%3Cpath d='M27.4 15.7 L29.5 20.1 L32.4 22.7 L34.4 27.2 L38.5 27.4 L41.2 30.4 L46.0 29.0 L49.9 29.6 L54.6 28.3 L54.6 28.3 L52.5 23.9 L49.6 21.3 L47.6 16.8 L43.5 16.6 L40.8 13.6 L36.0 15.0 L32.1 14.4 L27.4 15.7Z' fill='%233d8f47'/%3E%3Cpath d='M29.6 16.7L52.4 27.3' stroke='%23a8d08d' stroke-width='1.2' opacity='.7'/%3E%3Ccircle cx='27' cy='25' r='4.2' fill='%23d33a2c'/%3E%3Ccircle cx='25.5' cy='23.5' r='1.3' fill='%23fff' opacity='.7'/%3E%3Ccircle cx='33' cy='22' r='4.2' fill='%23d33a2c'/%3E%3Ccircle cx='31.5' cy='20.5' r='1.3' fill='%23fff' opacity='.7'/%3E%3Ccircle cx='31' cy='30' r='4.2' fill='%23d33a2c'/%3E%3Ccircle cx='29.5' cy='28.5' r='1.3' fill='%23fff' opacity='.7'/%3E%3C/svg%3E");
  --nv-guirnalda: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 88 24'%3E%3Cpath d='M0 12 Q22 6 44 12 T88 12' stroke='%232b5e2f' stroke-width='2' fill='none'/%3E%3Cpath d='M-2.3 8.2 L-0.5 11.4 L1.7 13.1 L3.5 16.3 L6.5 16.2 L8.7 18.2 L12.1 16.9 L15.0 17.0 L18.3 15.8 L18.3 15.8 L16.5 12.6 L14.3 10.9 L12.5 7.7 L9.5 7.8 L7.3 5.8 L3.9 7.1 L1.0 7.0 L-2.3 8.2Z' fill='%233d8f47'/%3E%3Cpath d='M-0.7 8.8L16.7 15.2' stroke='%23a8d08d' stroke-width='1.2' opacity='.7'/%3E%3Cpath d='M19.7 15.8 L23.0 17.0 L25.9 16.9 L29.3 18.2 L31.5 16.2 L34.5 16.3 L36.3 13.1 L38.5 11.4 L40.3 8.2 L40.3 8.2 L37.0 7.0 L34.1 7.1 L30.7 5.8 L28.5 7.8 L25.5 7.7 L23.7 10.9 L21.5 12.6 L19.7 15.8Z' fill='%232f7a3b'/%3E%3Cpath d='M21.3 15.2L38.7 8.8' stroke='%23a8d08d' stroke-width='1.2' opacity='.7'/%3E%3Cpath d='M41.7 8.2 L43.5 11.4 L45.7 13.1 L47.5 16.3 L50.5 16.2 L52.7 18.2 L56.1 16.9 L59.0 17.0 L62.3 15.8 L62.3 15.8 L60.5 12.6 L58.3 10.9 L56.5 7.7 L53.5 7.8 L51.3 5.8 L47.9 7.1 L45.0 7.0 L41.7 8.2Z' fill='%233d8f47'/%3E%3Cpath d='M43.3 8.8L60.7 15.2' stroke='%23a8d08d' stroke-width='1.2' opacity='.7'/%3E%3Cpath d='M63.7 15.8 L67.0 17.0 L69.9 16.9 L73.3 18.2 L75.5 16.2 L78.5 16.3 L80.3 13.1 L82.5 11.4 L84.3 8.2 L84.3 8.2 L81.0 7.0 L78.1 7.1 L74.7 5.8 L72.5 7.8 L69.5 7.7 L67.7 10.9 L65.5 12.6 L63.7 15.8Z' fill='%232f7a3b'/%3E%3Cpath d='M65.3 15.2L82.7 8.8' stroke='%23a8d08d' stroke-width='1.2' opacity='.7'/%3E%3Ccircle cx='19' cy='14' r='3.4' fill='%23d33a2c'/%3E%3Ccircle cx='17.8' cy='12.8' r='1.1' fill='%23fff' opacity='.7'/%3E%3Ccircle cx='63' cy='14' r='3.4' fill='%23d33a2c'/%3E%3Ccircle cx='61.8' cy='12.8' r='1.1' fill='%23fff' opacity='.7'/%3E%3Ccircle cx='41' cy='10' r='3.2' fill='%23d33a2c'/%3E%3Ccircle cx='39.9' cy='8.9' r='1.0' fill='%23fff' opacity='.7'/%3E%3Ccircle cx='85' cy='10' r='3.2' fill='%23d33a2c'/%3E%3Ccircle cx='83.9' cy='8.9' r='1.0' fill='%23fff' opacity='.7'/%3E%3C/svg%3E");
  --nv-nieve: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 18'%3E%3Cpath d='M0 0H120V9 Q112.5 16 105 9 Q97.5 13 90 10 Q82.5 16 75 9 Q67.5 13 60 10 Q52.5 16 45 9 Q37.5 13 30 10 Q22.5 16 15 9 Q7.5 13 0 10Z' transform='translate(0 2)' fill='%231e3c6e' opacity='.18'/%3E%3Cpath d='M0 0H120V9 Q112.5 16 105 9 Q97.5 13 90 10 Q82.5 16 75 9 Q67.5 13 60 10 Q52.5 16 45 9 Q37.5 13 30 10 Q22.5 16 15 9 Q7.5 13 0 10Z' fill='%23fffdf8'/%3E%3Cpath d='M0 3H120' stroke='%23fff' stroke-width='2' opacity='.8'/%3E%3C/svg%3E");
  --nv-lazo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'%3E%3Cg transform='translate(1.5 2.5)' fill='%232b1206' opacity='.3'%3E%3Cpath d='M30 18C18 2 4 6 8 16C11 24 24 22 30 18ZM30 18C42 2 56 6 52 16C49 24 36 22 30 18Z'/%3E%3C/g%3E%3Cpath d='M28 20L18 38L24 36L28 40L31 22Z' fill='%23a82820'/%3E%3Cpath d='M32 20L42 38L36 36L32 40L29 22Z' fill='%23b92d24'/%3E%3Cpath d='M30 18C18 2 4 6 8 16C11 24 24 22 30 18Z' fill='%23d33a2c'/%3E%3Cpath d='M30 18C42 2 56 6 52 16C49 24 36 22 30 18Z' fill='%23c8312a'/%3E%3Cpath d='M14 13C18 11 23 13 26 16' stroke='%23f2867b' stroke-width='1.6' fill='none'/%3E%3Cellipse cx='30' cy='18' rx='5' ry='4.5' fill='%23e04b3c'/%3E%3C/svg%3E");
  --nv-copo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-50 -50 100 100'%3E%3Cg stroke='%23fffdf8' stroke-width='9' stroke-linecap='round' fill='none'%3E%3Cg transform='rotate(0)'%3E%3Cpath d='M0 0V-46M0-26L-12-38M0-26L12-38'/%3E%3C/g%3E%3Cg transform='rotate(60)'%3E%3Cpath d='M0 0V-46M0-26L-12-38M0-26L12-38'/%3E%3C/g%3E%3Cg transform='rotate(120)'%3E%3Cpath d='M0 0V-46M0-26L-12-38M0-26L12-38'/%3E%3C/g%3E%3Cg transform='rotate(180)'%3E%3Cpath d='M0 0V-46M0-26L-12-38M0-26L12-38'/%3E%3C/g%3E%3Cg transform='rotate(240)'%3E%3Cpath d='M0 0V-46M0-26L-12-38M0-26L12-38'/%3E%3C/g%3E%3Cg transform='rotate(300)'%3E%3Cpath d='M0 0V-46M0-26L-12-38M0-26L12-38'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  --nv-nevada: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 200 200'%3E%3Cdefs%3E%3Cg id='c' stroke='%23fffdf8' stroke-width='9' stroke-linecap='round' fill='none'%3E%3Cg transform='rotate(0)'%3E%3Cpath d='M0 0V-46M0-26L-12-38M0-26L12-38'/%3E%3C/g%3E%3Cg transform='rotate(60)'%3E%3Cpath d='M0 0V-46M0-26L-12-38M0-26L12-38'/%3E%3C/g%3E%3Cg transform='rotate(120)'%3E%3Cpath d='M0 0V-46M0-26L-12-38M0-26L12-38'/%3E%3C/g%3E%3Cg transform='rotate(180)'%3E%3Cpath d='M0 0V-46M0-26L-12-38M0-26L12-38'/%3E%3C/g%3E%3Cg transform='rotate(240)'%3E%3Cpath d='M0 0V-46M0-26L-12-38M0-26L12-38'/%3E%3C/g%3E%3Cg transform='rotate(300)'%3E%3Cpath d='M0 0V-46M0-26L-12-38M0-26L12-38'/%3E%3C/g%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23c' transform='translate(20 30) scale(0.14) rotate(39)'/%3E%3Cuse href='%23c' transform='translate(95 12) scale(0.09) rotate(16)'/%3E%3Cuse href='%23c' transform='translate(160 60) scale(0.12) rotate(47)'/%3E%3Cuse href='%23c' transform='translate(60 95) scale(0.08) rotate(22)'/%3E%3Cuse href='%23c' transform='translate(130 130) scale(0.15) rotate(50)'/%3E%3Cuse href='%23c' transform='translate(30 165) scale(0.1) rotate(44)'/%3E%3Cuse href='%23c' transform='translate(175 175) scale(0.09) rotate(47)'/%3E%3Cuse href='%23c' transform='translate(100 190) scale(0.07) rotate(41)'/%3E%3C/svg%3E");
  --nv-gancho: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 30'%3E%3Cpath d='M20 2C14 2 14 10 20 10' stroke='%239a7a2c' stroke-width='2.4' fill='none'/%3E%3Crect x='11' y='10' width='18' height='12' rx='2' fill='%23e3b341'/%3E%3Crect x='11' y='10' width='18' height='4' rx='2' fill='%23f7d27a'/%3E%3Cpath d='M14 14V22M20 14V22M26 14V22' stroke='%23b8892a' stroke-width='1.4'/%3E%3C/svg%3E");
}
/* Las piezas que navidad.js cuelga en cada juego (ADORNOS en navidad.js) */
.nv-adorno { position: absolute; z-index: 3; display: block; pointer-events: none; background: no-repeat center / contain; }
.nv-nieve-arriba { top: -7px; left: 6px; right: 6px; height: 17px; background: var(--nv-nieve) repeat-x 0 0 / 96px 100%; }
.nv-acebo-esq { top: -16px; left: -12px; width: clamp(44px, 6vw, 64px); aspect-ratio: 60 / 42; background-image: var(--nv-acebo); rotate: -14deg; }
.nv-acebo-der { top: -16px; right: -12px; width: clamp(44px, 6vw, 64px); aspect-ratio: 60 / 42; background-image: var(--nv-acebo); rotate: 14deg; }
.nv-acebo-abajo { bottom: -14px; right: -10px; width: clamp(40px, 5vw, 56px); aspect-ratio: 60 / 42; background-image: var(--nv-acebo); rotate: 8deg; }
.nv-lazo-arriba { top: -22px; left: 50%; width: clamp(42px, 5.5vw, 60px); aspect-ratio: 60 / 40; translate: -50% 0; background-image: var(--nv-lazo); }
.nv-lazo-esq { top: -16px; right: -10px; width: clamp(34px, 4.4vw, 48px); aspect-ratio: 60 / 40; background-image: var(--nv-lazo); rotate: 12deg; }
.nv-guirnalda-arriba { top: -11px; left: 0; right: 0; height: 24px; background: var(--nv-guirnalda) repeat-x 0 0 / 88px 100%; }
.nv-gancho { top: -15px; left: 50%; width: 26px; aspect-ratio: 40 / 30; translate: -50% 0; background-image: var(--nv-gancho); }
/* nevada suave dentro de un escenario: una tira de copos que baja en bucle */
.nv-nevada { inset: 0; z-index: 2; overflow: hidden; background: none; }
.nv-nevada::before, .nv-nevada::after {
  content: ""; position: absolute; left: 0; right: 0; top: -200px; bottom: 0;
  background: var(--nv-nevada) repeat 0 0 / 200px 200px;
  animation: nv-nevada 10s steps(40, end) infinite;
}
.nv-nevada::after { background-position: 90px 60px; background-size: 140px 140px; top: -140px; opacity: 0.7; animation-duration: 8s; --nv-paso: 140px; }
@keyframes nv-nevada { to { transform: translateY(var(--nv-paso, 200px)); } }
@media (max-width: 600px) { .nv-acebo-esq, .nv-acebo-der { top: -12px; left: -6px; } .nv-acebo-der { left: auto; right: -6px; } }
@media print { .nv-adorno { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .nv-nevada::before, .nv-nevada::after { animation: none; } }
.nv-nieve-fina { top: -5px; left: 3px; right: 3px; height: 11px; background-size: 60px 100%; }
.nv-gancho-mini { top: -10px; width: 16px; }
