/* Tema de Halloween (1 al 31 de octubre; el 1 de noviembre desaparece, ver includes/halloween.php): se carga solo en
   esos días y todo cuelga de html.halloween. Respeta el modo claro/oscuro del
   sitio: los colores propios van en variables --hw-* que cambian por modo. */
@import url('https://fonts.googleapis.com/css2?family=Creepster&display=swap');

/* ---------- Modo claro (por defecto) ---------- */
html.halloween {
  --bg: #fff6ec;
  --bg-grid: #f8e9da;
  --border: #efdcc9;
  --hw-noche: #2a1438;
  --hw-naranja: #f25a00;
  --hw-naranja-2: #ff9d3d;
  --hw-deco: rgba(74,24,110,.42);
  --hw-murcielago: #3a1257;
  --hw-hero-capa: linear-gradient(180deg, rgba(255,246,236,.45), rgba(255,246,236,.92) 85%);
  --hw-hero-texto: #2a1438;
  --hw-hero-sub: #4a3560;
  --hw-nav: #5b4570;
  --hw-borde-hero: rgba(42,20,56,.3);
  --hw-menu-fondo: #fff6ec;
}
/* ---------- Modo oscuro (sistema o elegido con el botón) ---------- */
@media (prefers-color-scheme: dark) {
  html.halloween:not([data-theme="light"]) {
    --bg: #110a1b; --bg-grid: #1a1028; --surface: #1d1029; --surface-2: #26153a; --border: #35214a;
    --text-muted: #b2a3c8;
    --hw-deco: rgba(255,255,255,.55); --hw-murcielago: #0a0410;
    --hw-hero-capa: linear-gradient(180deg, rgba(13,7,22,.55), rgba(13,7,22,.93));
    --hw-hero-texto: #fff; --hw-hero-sub: #e0d4ef; --hw-nav: #cdbfe0; --hw-borde-hero: rgba(255,255,255,.35); --hw-menu-fondo: #150b22;
    --hw-naranja: #ff6a13;
  }
}
html.halloween[data-theme="dark"] {
  --bg: #110a1b; --bg-grid: #1a1028; --surface: #1d1029; --surface-2: #26153a; --border: #35214a;
  --text-muted: #b2a3c8;
  --hw-deco: rgba(255,255,255,.55); --hw-murcielago: #0a0410;
  --hw-hero-capa: linear-gradient(180deg, rgba(13,7,22,.55), rgba(13,7,22,.93));
  --hw-hero-texto: #fff; --hw-hero-sub: #e0d4ef; --hw-nav: #cdbfe0; --hw-borde-hero: rgba(255,255,255,.35); --hw-menu-fondo: #150b22;
  --hw-naranja: #ff6a13;
}

/* ---------- Decoración (la arma assets/js/halloween.js) ---------- */
.hw-deco { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.hw-telarana { position: absolute; top: 0; width: 190px; color: var(--hw-deco); }
.hw-telarana.izq { left: 0; }
.hw-telarana.der { right: 0; transform: scaleX(-1); }
.hw-luna { position: absolute; border-radius: 50%; background: radial-gradient(circle at 38% 38%, #fff6d8, #ffd27a 55%, #e99a2c);
  box-shadow: 0 0 60px 18px rgba(255,190,90,.35), 0 0 160px 60px rgba(255,120,30,.18); }
.hw-murcielago { position: absolute; color: var(--hw-murcielago); filter: drop-shadow(0 0 2px rgba(255,170,90,.9)) drop-shadow(0 0 8px rgba(255,106,19,.5));
  animation: hwAleteo .35s ease-in-out infinite alternate; }
.hw-murcielago svg { display: block; width: 100%; }
@keyframes hwAleteo { to { transform: scaleY(.7) translateY(-3px); } }
.hw-arana { position: absolute; top: 0; display: flex; flex-direction: column; align-items: center; animation: hwBajar 4s ease-in-out infinite alternate; }
.hw-arana i { width: 1px; height: 120px; background: var(--hw-deco); }
.hw-arana span { font-size: 24px; line-height: 1; }
@keyframes hwBajar { to { transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) { .hw-murcielago, .hw-arana { animation: none; } }

/* ---------- Index: portada ---------- */
html.halloween .lp-hero { background: var(--bg); color: var(--hw-hero-texto); }
html.halloween .lp-hero .hero-slide::after { background: radial-gradient(circle at 75% 20%, rgba(255,106,19,.22), transparent 45%), var(--hw-hero-capa); }
html.halloween .lp-hero .hw-luna { top: 96px; right: 40%; width: 120px; height: 120px; }
html.halloween .lp-hero .hw-arana { left: 38%; top: 74px; }
html.halloween .lp-brand, html.halloween .lp-brand:hover { color: var(--hw-hero-texto); }
html.halloween .lp-nav { border-bottom-color: var(--hw-borde-hero); }
html.halloween .lp-nav-links a { color: var(--hw-nav); }
html.halloween .lp-nav-links a:hover { color: var(--hw-hero-texto); }
html.halloween .lp-nav-links a.lp-nav-cta { color: #fff; }
html.halloween .lp-nav .theme-toggle, html.halloween .lp-menu-btn { color: var(--hw-hero-texto); border-color: var(--hw-borde-hero); background: transparent; }
html.halloween .lp-pill { color: var(--hw-naranja); border-color: var(--hw-naranja); background: var(--surface); }
html.halloween .lp-hero h1 { color: var(--hw-hero-texto); }
html.halloween .lp-hero h1 span { font-family: 'Creepster', 'Bebas Neue', cursive; color: var(--hw-naranja); letter-spacing: .03em; text-shadow: 0 0 24px rgba(255,106,19,.45); }
html.halloween .lp-hero-tagline { color: var(--hw-hero-sub); }
html.halloween .lp-btn-ghost { color: var(--hw-hero-texto); border-color: var(--hw-borde-hero); }
html.halloween .lp-login { position: relative; border: 1px solid rgba(255,106,19,.35); box-shadow: 0 24px 60px rgba(0,0,0,.35), 0 0 50px rgba(255,106,19,.15); }
html.halloween .lp-login::after { content: '🎃'; position: absolute; top: -28px; right: -14px; font-size: 54px; transform: rotate(12deg); filter: drop-shadow(0 0 12px rgba(255,106,19,.7)); }
@media (max-width: 900px) {
  html.halloween .lp-nav-links { background: var(--hw-menu-fondo); }
  html.halloween .lp-hero .hw-luna { top: 70px; right: 16px; width: 84px; height: 84px; }
  html.halloween .lp-hero .hw-telarana { width: 120px; }
  html.halloween .lp-login::after { font-size: 44px; top: -22px; right: -6px; }
}

/* Banner del reto en el index */
.hw-reto { position: relative; z-index: 3; max-width: 1180px; margin: -64px auto 0; box-sizing: border-box;
  display: flex; align-items: center; gap: 24px; padding: 24px 30px; border-radius: 22px; color: #fff;
  background: linear-gradient(120deg, #2a0e45, #4a1350 55%, #7a2a12); border: 1px solid rgba(255,140,60,.35); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.hw-reto-calabaza { font-size: 3.4rem; filter: drop-shadow(0 0 12px rgba(255,106,19,.7)); }
.hw-reto h2 { margin: 0; font-family: 'Creepster', 'Bebas Neue', cursive; font-weight: 400; font-size: 2.3rem; letter-spacing: .03em; color: #ffb35c; }
.hw-reto p { margin: 4px 0 0; color: #ece0f7; }
.hw-reto-premios { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hw-reto-premios span { background: rgba(0,0,0,.3); border: 1px solid rgba(255,140,60,.35); border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: .9rem; }
.hw-reto-fecha { margin-left: auto; text-align: center; background: rgba(0,0,0,.35); border: 1px solid rgba(255,140,60,.35); border-radius: 16px; padding: 10px 18px; flex-shrink: 0; }
.hw-reto-fecha b { display: block; font-family: 'Bebas Neue', sans-serif; font-size: 2.6rem; line-height: 1; }
.hw-reto-fecha small { color: #cdbfe0; text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; }
@media (max-width: 760px) {
  /* En celular no se encima sobre el inicio de sesión: va abajo, con su espacio. */
  .hw-reto { margin: 28px 16px 0; flex-direction: column; text-align: center; gap: 8px; padding: 22px 18px; }
  .hw-reto-premios { justify-content: center; }
  .hw-reto-fecha { margin: 6px 0 0; }
}

/* ---------- Paneles (cliente y staff) ---------- */
.hw-esquina { position: fixed; top: 0; right: 0; width: 150px; height: 150px; pointer-events: none; z-index: 1; opacity: .7; }
.hw-esquina .hw-telarana { width: 150px; }
.hw-saludo { font-family: 'Creepster', 'Bebas Neue', cursive !important; font-weight: 400; letter-spacing: .03em; color: var(--hw-naranja); text-shadow: 0 0 22px rgba(255,106,19,.35); }

/* Tarjeta del reto en el panel del cliente */
.hw-amrap { position: relative; overflow: hidden; border-radius: 20px; padding: 22px 24px; margin: 0 0 22px; color: #fff;
  background: linear-gradient(120deg, #2a0e45, #4a1350 55%, #7a2a12); border: 1px solid rgba(255,140,60,.35); box-shadow: 0 16px 40px rgba(42,14,69,.35); }
.hw-amrap-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: center; }
.hw-amrap .hw-tag { font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #ffb35c; }
.hw-amrap h3 { margin: 6px 0 4px; font-family: 'Creepster', 'Bebas Neue', cursive; font-weight: 400; font-size: 2rem; letter-spacing: .03em; color: #fff; text-transform: none; }
.hw-amrap p { margin: 0; color: #ece0f7; }
.hw-cuenta { display: flex; gap: 10px; margin-top: 14px; }
.hw-cuenta div { flex: 1; text-align: center; background: rgba(0,0,0,.32); border: 1px solid rgba(255,140,60,.3); border-radius: 14px; padding: 10px 6px; }
.hw-cuenta b { display: block; font-family: 'Bebas Neue', sans-serif; font-size: 2.3rem; line-height: 1; }
.hw-cuenta small { color: #cdbfe0; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }
.hw-podio { display: flex; flex-direction: column; gap: 8px; }
.hw-podio-fila { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 9px 12px; }
.hw-podio-fila b { flex: 1; }
.hw-podio-fila small { color: #ffb35c; font-weight: 700; white-space: nowrap; }
.hw-podio-fila.tu { border-color: #ffb35c; background: rgba(255,106,19,.18); }
.hw-mi-resultado { margin-top: 12px; font-weight: 600; }
@media (max-width: 760px) {
  .hw-amrap-grid { grid-template-columns: 1fr; }
  .hw-amrap h3 { font-size: 1.7rem; }
  .hw-esquina { width: 110px; height: 110px; } .hw-esquina .hw-telarana { width: 110px; }
}

/* Página del staff */
.amrap-premios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0 24px; }
.amrap-premio { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.amrap-premio span { display: block; font-weight: 700; }
.amrap-premio b { font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem; color: var(--ember); line-height: 1.1; }
.amrap-premio small { color: var(--text-muted); margin-left: 4px; }
@media (max-width: 560px) { .amrap-premios { grid-template-columns: 1fr; } }
.hw-disfraz { margin-top: 8px !important; font-weight: 700; color: #ffd34d !important; }
