/* ============ Temáticas de temporada ============ */
.fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 35; }
.theme-deco { position: relative; z-index: 39; pointer-events: none; }

/* Cinta de saludo */
.theme-ribbon {
  position: relative; z-index: 2; overflow: hidden;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 85%, #000), color-mix(in srgb, var(--accent2) 85%, #000));
  color: #fff; font-family: var(--pixel); font-size: 13px; letter-spacing: .03em; text-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.theme-ribbon .container { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 36px; padding: 6px 0; text-align: center; flex-wrap: wrap; }
.theme-ribbon .em { display: inline-block; animation: bob 2.4s ease-in-out infinite; }
.theme-ribbon .em:last-child { animation-delay: -1.2s; }
.theme-ribbon::after { content: ""; position: absolute; top: 0; left: -40%; width: 30%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg); animation: ribbon-shine 5s ease-in-out infinite; }
@keyframes ribbon-shine { 0%, 55% { left: -40%; } 100% { left: 130%; } }
.ny-count { background: rgba(0,0,0,.3); border-radius: 8px; padding: 2px 10px; }

/* Decoración del logo */
.hero .logo { position: relative; display: inline-block; width: fit-content; }
.logo-deco { position: absolute; z-index: 2; pointer-events: none; background: center / contain no-repeat; image-rendering: pixelated; display: none; }
.theme-navidad .logo-deco { display: block; background-image: url(/img/theme/santa-hat.svg); width: 64px; height: 56px; top: -30px; right: -22px; transform: rotate(18deg); animation: hat 4s ease-in-out infinite; }
.theme-halloween .logo-deco { display: block; background-image: url(/img/theme/witch-hat.svg); width: 70px; height: 60px; top: -36px; right: -20px; transform: rotate(14deg); animation: hat 4s ease-in-out infinite; }
.theme-anonuevo .logo-deco { display: block; background-image: url(/img/theme/party-hat.svg); width: 56px; height: 50px; top: -34px; right: -8px; transform: rotate(16deg); animation: hat 3s ease-in-out infinite; }
@keyframes hat { 0%, 100% { transform: rotate(18deg) translateY(0); } 50% { transform: rotate(10deg) translateY(-4px); } }

/* Selector rápido (admins) */
.theme-switch { position: fixed; left: 18px; bottom: 18px; z-index: 90; }
.theme-switch .ts-btn { width: 52px; height: 52px; border-radius: 16px; border: 1px solid var(--accent); background: var(--card2); font-size: 24px; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.5), 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .15s; }
.theme-switch .ts-btn:hover { transform: translateY(-2px) rotate(-6deg); }
.theme-switch .ts-menu { position: absolute; left: 0; bottom: 62px; width: 220px; padding: 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line2); box-shadow: var(--shadow); display: none; flex-direction: column; gap: 2px; }
.theme-switch.open .ts-menu { display: flex; animation: pop .18s ease-out; }
.theme-switch .ts-title { font-weight: 800; padding: 6px 10px 8px; font-size: 13px; color: var(--muted); }
.theme-switch .ts-menu button { text-align: left; background: none; border: 0; color: var(--text); padding: 8px 10px; border-radius: 9px; font: 600 14px var(--sans); cursor: pointer; }
.theme-switch .ts-menu button:hover { background: var(--card2); }
.theme-switch .ts-menu button.on { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.theme-switch .ts-menu a { padding: 8px 10px 4px; font-size: 12.5px; }

/* ---------- Navidad ---------- */
body.theme-navidad { background:
  radial-gradient(900px 500px at 15% -120px, rgba(255,77,94,.16), transparent 70%),
  radial-gradient(900px 500px at 85% -120px, rgba(47,191,113,.14), transparent 70%), var(--bg); }
.theme-navidad .theme-deco { height: 26px; background: linear-gradient(#08080c, #0d0d12); }
.theme-navidad .lights { position: absolute; left: 0; right: 0; top: -2px; height: 28px; display: flex; justify-content: space-between; padding: 0 10px; overflow: hidden; }
.theme-navidad .lights::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 22px; border-bottom: 2px solid #1d3b2a; border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.theme-navidad .lights i { position: relative; width: 9px; height: 14px; margin-top: 6px; border-radius: 50% 50% 45% 45%; background: #ff4d5e; box-shadow: 0 0 10px 2px #ff4d5e; animation: bulb 1.6s ease-in-out infinite; }
.theme-navidad .lights i::before { content: ""; position: absolute; top: -4px; left: 2px; width: 5px; height: 5px; background: #2b3a33; border-radius: 1px; }
.theme-navidad .lights i:nth-child(4n+2) { background: #2fbf71; box-shadow: 0 0 10px 2px #2fbf71; animation-delay: -.4s; }
.theme-navidad .lights i:nth-child(4n+3) { background: #facc15; box-shadow: 0 0 10px 2px #facc15; animation-delay: -.8s; }
.theme-navidad .lights i:nth-child(4n) { background: #60a5fa; box-shadow: 0 0 10px 2px #60a5fa; animation-delay: -1.2s; }
.theme-navidad .lights i:nth-child(odd) { margin-top: 9px; }
@media (max-width: 700px) { .theme-navidad .lights i:nth-child(n+21) { display: none; } }
@keyframes bulb { 0%, 100% { opacity: 1; filter: brightness(1.15); } 50% { opacity: .35; filter: brightness(.7); box-shadow: none; } }
/* Nieve acumulada encima de las tarjetas */
.theme-navidad .card, .theme-navidad .pcard, .theme-navidad .sub-tile { border-top: 3px solid #eef3ff; box-shadow: var(--shadow), inset 0 6px 8px -6px rgba(255,255,255,.35); }
/* Botones de bastón de caramelo */
.theme-navidad .btn.primary { background: repeating-linear-gradient(-45deg, rgba(255,255,255,0) 0 12px, rgba(255,255,255,.16) 12px 24px), linear-gradient(180deg, #ff5a69, #d91f36); }
.theme-navidad .btn.primary, .theme-navidad .ip-pill .play { color: #fff; }
.snow-ground {
  position: relative; z-index: 1; height: 34px; margin-top: 50px; margin-bottom: -60px;
  background:
    radial-gradient(28px 18px at 20px 30px, #eef3ff 98%, transparent) 0 0 / 70px 34px repeat-x,
    radial-gradient(22px 14px at 50px 32px, #dfe7f7 98%, transparent) 0 0 / 70px 34px repeat-x,
    linear-gradient(transparent 24px, #eef3ff 24px);
  filter: drop-shadow(0 -4px 10px rgba(255,255,255,.15));
}
.theme-navidad footer.site { background: linear-gradient(#eef3ff0d, transparent 40px); }

/* ---------- Año Nuevo ---------- */
body.theme-anonuevo { background:
  radial-gradient(1000px 520px at 50% -160px, rgba(167,139,250,.22), transparent 70%),
  radial-gradient(600px 400px at 90% 30%, rgba(252,211,77,.07), transparent 70%), #0b0a16; }
.glow-line { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), var(--accent), transparent); background-size: 200% 100%; animation: glowline 4s linear infinite; box-shadow: 0 0 12px var(--accent); }
@keyframes glowline { to { background-position: -200% 0; } }

/* ---------- Halloween ---------- */
body.theme-halloween { background:
  radial-gradient(1000px 520px at 50% -160px, rgba(168,85,247,.22), transparent 70%),
  radial-gradient(800px 300px at 50% 110%, rgba(251,146,60,.12), transparent 70%), #0c0812; }
.theme-halloween .web-l, .theme-halloween .web-r { position: fixed; top: 54px; width: 170px; height: 170px; background: url(/img/theme/web.svg) no-repeat center / contain; z-index: 2; pointer-events: none; }
.theme-halloween .web-l { left: 0; }
.theme-halloween .web-r { right: 0; transform: scaleX(-1); }
@media (max-width: 700px) { .theme-halloween .web-l, .theme-halloween .web-r { width: 90px; height: 90px; } }
.theme-halloween .card, .theme-halloween .pcard { border-color: color-mix(in srgb, var(--accent2) 30%, var(--line)); }
.pumpkin-ground { position: relative; z-index: 1; display: flex; justify-content: space-around; margin-top: 40px; margin-bottom: -50px; font-size: 30px; filter: drop-shadow(0 0 14px rgba(251,146,60,.6)); }
.pumpkin-ground span { animation: bob 3s ease-in-out infinite; }
.pumpkin-ground span:nth-child(2n) { animation-delay: -1.5s; font-size: 22px; align-self: flex-end; }

/* ---------- Black Friday ---------- */
body.theme-blackfriday { --bg: #070707; --bg2: #0e0e0e; --card: #121212; --card2: #191919; --line: #262626; background: radial-gradient(1000px 500px at 50% -180px, rgba(250,204,21,.13), transparent 70%), #070707; }
.theme-blackfriday .card, .theme-blackfriday .pcard { border-color: #2c2610; }
.theme-blackfriday .theme-ribbon { background: linear-gradient(90deg, #000, #1a1503 30%, #1a1503 70%, #000); color: var(--accent); border-bottom: 1px solid #3a300a; }

/* ---------- San Valentín ---------- */
body.theme-sanvalentin { background: radial-gradient(1000px 520px at 50% -160px, rgba(244,114,182,.2), transparent 70%), #120a10; }

/* ---------- Pascua ---------- */
body.theme-pascua { background: radial-gradient(900px 480px at 20% -140px, rgba(134,239,172,.14), transparent 70%), radial-gradient(900px 480px at 80% -140px, rgba(196,181,253,.16), transparent 70%), var(--bg); }

/* ---------- Verano ---------- */
body.theme-verano { background: radial-gradient(900px 480px at 80% -160px, rgba(250,204,21,.18), transparent 70%), radial-gradient(1000px 500px at 10% -120px, rgba(56,189,248,.18), transparent 70%), #08111a; }

/* Las luciérnagas solo en el tema normal */
body:not(.theme-ninguna) .fireflies { display: none; }

/* Panel: tarjetas de temática */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.theme-card { position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--card); display: flex; flex-direction: column; gap: 8px; }
.theme-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.theme-card .sw { height: 64px; border-radius: 10px; display: grid; place-items: center; font-size: 32px; }
.theme-card h3 { margin: 4px 0 0; font-size: 16px; }
.theme-card p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.theme-card .now { position: absolute; top: 10px; right: 10px; }

@media (prefers-reduced-motion: reduce) {
  .fx-canvas { display: none; }
}

/* ============ Entrar con Minecraft ============ */
.mc-input { display: flex; align-items: center; gap: 10px; }
.mc-input img { width: 40px; height: 40px; border-radius: 8px; image-rendering: pixelated; flex: none; background: var(--card2); }
.mc-input input { flex: 1; }
.steps-mini { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.steps-mini li { background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 12.5px; color: var(--muted); text-align: center; }
.steps-mini li span { display: grid; place-items: center; width: 24px; height: 24px; margin: 0 auto 6px; border-radius: 7px; background: var(--accent); color: #111; font-weight: 800; }
.steps-mini li b { color: var(--text); }
@media (max-width: 480px) { .steps-mini { grid-template-columns: 1fr; } }
.login-head { width: 96px; height: 96px; border-radius: 16px; image-rendering: pixelated; animation: bob 3s ease-in-out infinite; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.login-code { display: block; width: 100%; font-size: 26px; text-align: center; color: var(--accent); cursor: pointer; margin: 6px 0 14px; letter-spacing: .06em; }
.login-code:hover { background: var(--card2); }
.login-wait { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; margin-bottom: 8px; }
.login-wait .spinner { width: 20px; height: 20px; border-width: 3px; }
.login-wait.ok { color: var(--ok); } .login-wait.bad { color: var(--bad); }

/* ============ Roles (web) y rangos (juego) ============ */
.rbadge, .mbadge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 800; white-space: nowrap; vertical-align: middle; line-height: 1.5; }
.rbadge { background: color-mix(in srgb, var(--rc) 18%, transparent); color: var(--rc); border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent); }
.mbadge { background: var(--rc); color: #0c0c10; font-family: var(--pixel); font-size: 10.5px; letter-spacing: .04em; text-shadow: 0 1px 0 rgba(255,255,255,.25); border-radius: 6px; }
.chip .lbl .rbadge, .chip .lbl .mbadge { font-size: 9.5px; padding: 0 6px; margin-left: 4px; }
.admin aside .me { display: flex; align-items: center; gap: 10px; margin: 0 4px 14px; padding: 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.admin aside .me img { width: 34px; height: 34px; border-radius: 8px; image-rendering: pixelated; }
.admin aside .me b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.nav-count { margin-left: auto; background: var(--bad); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; line-height: 18px; }
.role-list { display: flex; flex-direction: column; gap: 10px; }
.role-row { display: grid; grid-template-columns: 220px 1fr auto; gap: 16px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--rc); }
.role-name { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.role-perms { display: flex; flex-wrap: wrap; gap: 6px; }
.perm { font-size: 11.5px; padding: 3px 9px; border-radius: 8px; background: var(--card2); color: var(--muted); border: 1px solid var(--line); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.perm-group { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 800px) { .role-row { grid-template-columns: 1fr; } }
/* Página pública del equipo */
.staff-group + .staff-group { margin-top: 26px; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.staff-card { text-align: center; padding: 20px 12px 16px; border-radius: 16px; background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 14%, var(--card)), var(--card)); border: 1px solid color-mix(in srgb, var(--rc) 35%, var(--line)); transition: transform .2s; }
.staff-card:hover { transform: translateY(-4px); }
.staff-card img { width: 72px; height: 72px; image-rendering: pixelated; border-radius: 10px; margin-bottom: 10px; }
.staff-card b { display: block; margin-bottom: 6px; }
.staff-title { display: flex; align-items: center; gap: 10px; font-family: var(--pixel); color: var(--rc); font-size: 17px; margin-bottom: 12px; }
.staff-title::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--rc) 35%, transparent); }
.msg-who .rbadge, .msg-who .mbadge { margin-left: 6px; }
