/* ═══════════════════════════════════════════════════════════════════
   Tema HALLOWEEN de soykoru.net — «Noche de brujas en el server»
   Pixel art en el idioma de Minecraft (el juego del stream): calabazas talladas,
   murciélagos de dos cuadros, la luna, el sombrero de bruja sobre el avatar.
   TODO va bajo html[data-tema="halloween"]: con el tema «normal» este archivo
   no cambia NADA y la página se ve exactamente como siempre (ver /tema.js).
   ═══════════════════════════════════════════════════════════════════ */

/* ── Panel del dueño (se ve en cualquier tema) ─────────────────────── */
.tema-opciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 14px 0; }
.tema-op { position: relative; display: grid; gap: 4px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--bg-card-2); cursor: pointer; transition: border-color .2s, transform .15s; }
.tema-op:hover { transform: translateY(-2px); }
.tema-op input { position: absolute; opacity: 0; pointer-events: none; }
.tema-op:has(input:checked) { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(34, 211, 238, .18); }
.tema-op small { color: var(--muted); font-size: 12px; }
.tema-muestra { display: block; height: 64px; border-radius: 10px; margin-bottom: 6px; }
.tema-muestra.normal { background: radial-gradient(120px 60px at 80% 0%, #221a52, transparent 70%), linear-gradient(135deg, #8b5cf6, #22d3ee 140%), #0b0a17; }
.tema-muestra.halloween {
  background:
    linear-gradient(#f4e6b0, #f4e6b0) 82% 26% / 14px 14px no-repeat,
    linear-gradient(#ff8a1a, #ff8a1a) 12% 82% / 18px 14px no-repeat,
    linear-gradient(#ff8a1a, #ff8a1a) 30% 88% / 12px 10px no-repeat,
    linear-gradient(180deg, #1b0f2e, #0c0712);
  image-rendering: pixelated;
}

/* ── Paleta: noche violeta, calabaza y luz de vela ─────────────────── */
html[data-tema="halloween"] {
  --bg: #0c0712;
  --bg-card: #170e1f;
  --bg-card-2: #22142c;
  --accent: #ff8a1a;
  --accent-2: #ffc94a;
  --accent-grad: linear-gradient(135deg, #ff8a1a, #c2410c);
  --text: #fff4e6;
  --muted: #b8a3a8;
  --good: #8fe35a;
  --border: #36213f;
  --shadow: 0 10px 34px rgba(0, 0, 0, .55);
  --hw-pixel: "Pixelify Sans", "Outfit", system-ui, sans-serif;
  --hw-brasa: #7a2e05;
}
html[data-tema="halloween"] body {
  background:
    radial-gradient(700px 420px at 84% -6%, rgba(255, 214, 120, .10) 0%, transparent 62%),
    radial-gradient(900px 600px at -10% 10%, rgba(88, 34, 140, .34) 0%, transparent 60%),
    radial-gradient(1200px 520px at 50% 118%, rgba(255, 110, 20, .16) 0%, transparent 62%),
    var(--bg);
  background-attachment: fixed;
}
html[data-tema="halloween"] ::selection { background: rgba(255, 138, 26, .45); }

/* ── Letra pixel con sombra dura (como un cartel de Minecraft) ─────── */
html[data-tema="halloween"] .welcome-title,
html[data-tema="halloween"] .section-title,
html[data-tema="halloween"] .brand-name {
  font-family: var(--hw-pixel);
  font-weight: 700;
  letter-spacing: .02em;
  text-shadow: 3px 3px 0 var(--hw-brasa);
}
html[data-tema="halloween"] .section-title { color: #ffd08a; }
html[data-tema="halloween"] .welcome-title .accent,
html[data-tema="halloween"] .brand-name .accent { color: var(--accent); }

/* ── Barra superior y franja de temporada ──────────────────────────── */
html[data-tema="halloween"] .topbar { background: rgba(12, 7, 18, .86); border-bottom: 2px solid #3a1d10; box-shadow: 0 2px 0 rgba(255, 138, 26, .25); }
#hw-franja { display: none; }
html[data-tema="halloween"] #hw-franja {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 14px; font-family: var(--hw-pixel); font-weight: 500; font-size: 14px; letter-spacing: .03em;
  color: #2a1204; text-align: center;
  background:
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(0, 0, 0, .08) 22px 24px),
    linear-gradient(180deg, #ffad3b, #ff8a1a);
  border-bottom: 3px solid var(--hw-brasa);
}
html[data-tema="halloween"] .hw-franja-ic { width: 24px; height: 24px; image-rendering: pixelated; flex: none; }

/* ── Avatar con sombrero de bruja ──────────────────────────────────── */
html[data-tema="halloween"] .hw-con-sombrero { position: relative; }
.hw-sombrero { display: none; }
html[data-tema="halloween"] .hw-sombrero {
  display: block; position: absolute; left: -10px; top: -30px; width: 64px; height: 48px;
  image-rendering: pixelated; transform: rotate(-14deg); z-index: 2; pointer-events: none;
  filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, .45));
}
html[data-tema="halloween"] .welcome-avatar { border-color: var(--accent); box-shadow: 0 0 0 3px var(--hw-brasa), 0 0 22px rgba(255, 138, 26, .35); }

/* ── Tarjetas, saldo y botones: luz de vela ────────────────────────── */
html[data-tema="halloween"] .card { border-color: #2e1b36; }
html[data-tema="halloween"] .card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(255, 138, 26, .4), 0 12px 32px -12px rgba(255, 120, 20, .6); }
html[data-tema="halloween"] .card-badge { color: #ffd08a; border-color: rgba(255, 138, 26, .55); box-shadow: 0 2px 10px rgba(0, 0, 0, .5), 0 0 12px rgba(255, 138, 26, .3); }
html[data-tema="halloween"] .card-mult-tag { background: linear-gradient(135deg, #ff8a1a, #c2410c); box-shadow: 0 3px 12px rgba(255, 138, 26, .45); }
html[data-tema="halloween"] .balance-card { background: linear-gradient(150deg, #ff9a2a 0%, #e0640e 45%, #6b2a8c 100%); box-shadow: 0 0 0 3px var(--hw-brasa), 0 16px 40px rgba(255, 100, 20, .3); }
.hw-saldo-murcielago { display: none; }
html[data-tema="halloween"] .hw-saldo-murcielago {
  display: block; position: absolute; top: 12px; right: 14px; width: 48px; height: 24px; z-index: 1;
  background-size: 200% 100%; background-repeat: no-repeat; image-rendering: pixelated;
  animation: hw-aleteo .32s steps(1) infinite;
}
html[data-tema="halloween"] .welcome::before { height: 4px; background: repeating-linear-gradient(90deg, #ff8a1a 0 16px, #1b0f22 16px 20px, #8fe35a 20px 28px, #1b0f22 28px 32px); }
html[data-tema="halloween"] .admin-panel { border-color: rgba(255, 138, 26, .5); }
html[data-tema="halloween"] .stream-status.online { background: rgba(143, 227, 90, .1); color: var(--good); }

/* ── La noche: luna, murciélagos, fantasma, huerto de calabazas ────── */
#hw-capa { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
html:not([data-tema="halloween"]) #hw-capa { display: none; }
#hw-capa img { image-rendering: pixelated; position: absolute; }
.hw-luna { top: 150px; right: 5vw; width: 96px; height: 96px; filter: drop-shadow(0 0 26px rgba(255, 226, 150, .35)); }
.hw-murcielago {
  position: absolute; left: -90px; width: 64px; height: 32px;
  background-size: 200% 100%; background-repeat: no-repeat; image-rendering: pixelated;
  animation: hw-vuela linear infinite, hw-aleteo .3s steps(1) infinite;
}
.hw-m1 { top: 17%; animation-duration: 20s, .28s; animation-delay: -3s, 0s; }
.hw-m2 { top: 31%; width: 48px; height: 24px; animation-duration: 26s, .32s; animation-delay: -11s, 0s; }
.hw-m3 { top: 11%; width: 40px; height: 20px; animation-duration: 30s, .3s; animation-delay: -17s, 0s; }
.hw-m4 { top: 47%; animation-duration: 23s, .26s; animation-delay: -7s, 0s; }
.hw-m5 { top: 63%; width: 40px; height: 20px; animation-duration: 33s, .34s; animation-delay: -22s, 0s; }
@keyframes hw-aleteo { 0% { background-position: 0 0; } 50% { background-position: 100% 0; } }
@keyframes hw-vuela {
  0% { transform: translate(0, 0); }
  25% { transform: translate(28vw, -5vh); }
  50% { transform: translate(56vw, 3vh); }
  75% { transform: translate(84vw, -3vh); }
  100% { transform: translate(118vw, 2vh); }
}
.hw-fantasma { left: 3vw; bottom: 24vh; width: 60px; height: 70px; opacity: .6; filter: drop-shadow(0 0 14px rgba(220, 210, 255, .45)); animation: hw-flota 6s ease-in-out infinite; }
@keyframes hw-flota { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(12px, -20px); } }
.hw-c { bottom: 0; filter: drop-shadow(0 0 16px rgba(255, 140, 30, .55)); animation: hw-vela 2.6s steps(1) infinite; }
.hw-c1 { left: 1.6vw; width: 96px; height: 96px; }
.hw-c2 { left: calc(1.6vw + 88px); width: 64px; height: 64px; animation-delay: -1.1s; }
.hw-c3 { right: 1.6vw; width: 80px; height: 80px; animation-delay: -.6s; }
.hw-c4 { right: calc(1.6vw + 74px); width: 48px; height: 48px; animation-delay: -1.8s; }
/* La vela titila a saltos, como la luz de un bloque. */
@keyframes hw-vela { 0% { filter: drop-shadow(0 0 16px rgba(255, 140, 30, .55)) brightness(1); } 33% { filter: drop-shadow(0 0 10px rgba(255, 140, 30, .4)) brightness(.9); } 66% { filter: drop-shadow(0 0 20px rgba(255, 160, 40, .65)) brightness(1.06); } }
.hw-niebla { position: absolute; left: -10%; right: -10%; bottom: -40px; height: 170px;
  background: radial-gradient(60% 70% at 30% 70%, rgba(190, 170, 230, .10), transparent 70%), radial-gradient(50% 60% at 75% 80%, rgba(255, 150, 80, .08), transparent 70%);
  filter: blur(8px); animation: hw-niebla 18s ease-in-out infinite alternate; }
@keyframes hw-niebla { from { transform: translateX(-3%); } to { transform: translateX(3%); } }

/* Araña colgando de la barra */
.hw-arana { display: none; }
html[data-tema="halloween"] .hw-arana { display: block; position: absolute; top: 100%; right: 64px; width: 27px; pointer-events: none; animation: hw-baja 7s ease-in-out infinite; z-index: 1; }
html[data-tema="halloween"] .hw-arana-img { display: block; width: 27px; height: 21px; image-rendering: pixelated; }
html[data-tema="halloween"] .hw-hilo { display: block; width: 2px; height: 48px; margin: 0 auto; background: rgba(255, 255, 255, .35); }
@keyframes hw-baja { 0%, 100% { transform: translateY(-38px); } 45%, 60% { transform: translateY(0); } }

/* En el teléfono: menos cosas y más chicas (que no tapen nada). */
@media (max-width: 640px) {
  .hw-luna { display: none; }
  .hw-m4, .hw-m5 { display: none; }
  .hw-fantasma { display: none; }
  .hw-c1 { width: 64px; height: 64px; }
  .hw-c2 { left: calc(1.6vw + 58px); width: 40px; height: 40px; }
  .hw-c3 { width: 56px; height: 56px; }
  .hw-c4 { display: none; }
  html[data-tema="halloween"] #hw-franja { font-size: 12.5px; }
  html[data-tema="halloween"] .hw-arana { display: none; }
  html[data-tema="halloween"] .hw-sombrero { width: 52px; height: 39px; left: -8px; top: -24px; }
}
@media (prefers-reduced-motion: reduce) {
  .hw-murcielago, .hw-fantasma, .hw-c, .hw-niebla,
  html[data-tema="halloween"] .hw-arana, html[data-tema="halloween"] .hw-saldo-murcielago { animation: none !important; }
  .hw-murcielago { display: none; }
}
