/* ══════════════════════════════════════════════════════════════════════════
   carta-estetica.css — piezas de estética para TU carta (bloque 7, oct-2026)
   Solo visual: el OVR y el precio no cambian. Las pone static/carta-estetica.js
   sobre un "anfitrión" (.card-front de la carta grande, .al-card del álbum,
   .pf-carta-foto del perfil) con la clase .ce y una clase .ce-<id> por pieza:
     .ce-fondo  (detrás del contenido)   .ce-efecto (encima, deja pasar el toque)
     .ce-marco  (el borde)               .ce-insignia (esquina)
   La letra del nombre va en el elemento marcado .ce-nom.
   Las animaciones solo usan transform/opacity y se apagan con
   prefers-reduced-motion.
   ══════════════════════════════════════════════════════════════════════════ */

.ce { isolation: isolate; }
.ce:not(.card-front):not(.pf-carta-foto) { position: relative; }
.ce > .ce-capa { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.ce > .ce-fondo { z-index: -1; }
.ce > .ce-efecto { z-index: 3; overflow: hidden; }
.ce > .ce-marco { z-index: 4; overflow: hidden; padding: var(--ce-mw, 3px);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; }
.al-card.ce > .ce-marco, .pf-carta-foto.ce > .ce-marco { --ce-mw: 2px; }

/* ── Fondos ───────────────────────────────────────────────────────────── */
.ce-f_noche > .ce-fondo {
  background:
    radial-gradient(1px 1px at 18% 22%, #fff 99%, transparent), radial-gradient(1px 1px at 72% 14%, #dfe8ff 99%, transparent),
    radial-gradient(1.5px 1.5px at 40% 64%, #fff 99%, transparent), radial-gradient(1px 1px at 86% 48%, #fff 99%, transparent),
    radial-gradient(1px 1px at 12% 82%, #cfe0ff 99%, transparent), radial-gradient(1.5px 1.5px at 62% 88%, #fff 99%, transparent),
    radial-gradient(1px 1px at 30% 40%, #fff 99%, transparent), radial-gradient(1px 1px at 92% 78%, #dfe8ff 99%, transparent),
    linear-gradient(170deg, #0d1a3a 0%, #0a1230 45%, #050a1c 100%); }
.ce-f_carbono > .ce-fondo {
  background:
    linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.035) 75%),
    linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.035) 75%),
    linear-gradient(160deg, #1d1f24, #0c0d10 60%, #17191d);
  background-size: 8px 8px, 8px 8px, 100% 100%; background-position: 0 0, 4px 4px, 0 0; }
.ce-f_estadio > .ce-fondo {
  background:
    radial-gradient(60% 34% at 18% 0%, rgba(255,255,235,.45), transparent 70%),
    radial-gradient(60% 34% at 82% 0%, rgba(255,255,235,.45), transparent 70%),
    linear-gradient(180deg, transparent 66%, rgba(36,120,60,.28) 66.5%, rgba(20,80,40,.42)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 14px, transparent 14px 28px),
    linear-gradient(180deg, #102030, #0b1a14); }
.ce-f_brasas > .ce-fondo {
  background:
    radial-gradient(120% 60% at 50% 110%, rgba(255,120,30,.75), transparent 60%),
    radial-gradient(80% 40% at 20% 100%, rgba(255,60,20,.55), transparent 70%),
    linear-gradient(180deg, #1a0604, #2a0a05 55%, #4a1206); }
.ce-f_galaxia > .ce-fondo {
  background:
    radial-gradient(1px 1px at 22% 30%, #fff 99%, transparent), radial-gradient(1px 1px at 78% 20%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 60% 70%, #fff 99%, transparent), radial-gradient(1px 1px at 35% 85%, #e9d5ff 99%, transparent),
    radial-gradient(55% 40% at 30% 35%, rgba(168,85,247,.55), transparent 70%),
    radial-gradient(50% 40% at 75% 65%, rgba(59,130,246,.5), transparent 70%),
    radial-gradient(40% 30% at 60% 20%, rgba(236,72,153,.35), transparent 70%),
    linear-gradient(160deg, #0b0620, #120a2e 50%, #060312); }

/* ── Marcos ───────────────────────────────────────────────────────────── */
.ce-m_plata > .ce-marco { background: linear-gradient(135deg, #f4f6f8, #9aa3ad 30%, #eef1f4 55%, #7d8590 80%, #dfe3e8); }
.ce-m_oro > .ce-marco { --ce-mw: 4px; background: linear-gradient(135deg, #fff3b0, #d4a017 25%, #fff0a0 50%, #a8780a 75%, #ffe27a); }
.ce-m_rubi > .ce-marco { --ce-mw: 4px; background: linear-gradient(135deg, #ff9aa8, #b0102a 30%, #ff5c74 55%, #6e0718 80%, #ff8090); }
.ce-m_neon > .ce-marco { background: linear-gradient(135deg, #22d3ee, #e879f9 50%, #22d3ee); }
.ce-m_holo > .ce-marco::before { content: ""; position: absolute; inset: -60%;
  background: conic-gradient(#ff4d4d, #ffb84d, #fff84d, #5cff7a, #4dd8ff, #6b6bff, #e44dff, #ff4d4d); }
.al-card.ce-m_oro > .ce-marco, .al-card.ce-m_rubi > .ce-marco,
.pf-carta-foto.ce-m_oro > .ce-marco, .pf-carta-foto.ce-m_rubi > .ce-marco { --ce-mw: 3px; }

/* ── Efectos ──────────────────────────────────────────────────────────── */
.ce-e_brillo > .ce-efecto::before { content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.38) 50%, transparent);
  transform: translateX(0) skewX(-12deg); opacity: .8; }
.ce-e_aura > .ce-efecto { box-shadow: inset 0 0 18px 3px rgba(125,211,252,.55), inset 0 0 40px 6px rgba(232,121,249,.22); }
.ce-e_holo > .ce-efecto::before { content: ""; position: absolute; inset: -50%; mix-blend-mode: color-dodge; opacity: .2;
  background: linear-gradient(115deg, #ff4d4d, #ffb84d, #fff84d, #5cff7a, #4dd8ff, #6b6bff, #e44dff, #ff4d4d); }
.ce-efecto > i { position: absolute; bottom: -6px; width: 4px; height: 4px; border-radius: 50%; display: none;
  background: #ffe9a8; box-shadow: 0 0 6px 2px rgba(255,190,80,.75); opacity: 0; }
.ce-e_chispas > .ce-efecto > i { display: block; }
.ce-efecto > i:nth-child(1) { left: 12%; } .ce-efecto > i:nth-child(2) { left: 30%; width: 3px; height: 3px; }
.ce-efecto > i:nth-child(3) { left: 48%; } .ce-efecto > i:nth-child(4) { left: 64%; width: 3px; height: 3px; }
.ce-efecto > i:nth-child(5) { left: 80%; } .ce-efecto > i:nth-child(6) { left: 92%; width: 3px; height: 3px; }

/* ── Letra del nombre ─────────────────────────────────────────────────── */
.ce-l_clasica .ce-nom { font-family: Georgia, 'Times New Roman', serif !important; font-weight: 700 !important; letter-spacing: .01em !important; }
.ce-l_firma .ce-nom { font-family: 'Caveat', cursive !important; font-weight: 700 !important; text-transform: none !important;
  letter-spacing: 0 !important; font-size: 1.22em !important; line-height: 1.05 !important; }
.ce-l_digital .ce-nom { font-family: 'Orbitron', sans-serif !important; font-weight: 700 !important; letter-spacing: .05em !important;
  font-size: .82em !important; color: #a5f3fc !important; text-shadow: 0 0 6px rgba(34,211,238,.55) !important; }
.ce-l_graffiti .ce-nom { font-family: 'Bungee', sans-serif !important; font-weight: 400 !important; letter-spacing: .01em !important;
  font-size: .86em !important; color: #fff6e0 !important; text-shadow: 2px 2px 0 #000, 3px 3px 0 rgba(255,90,0,.7) !important; }
.ce-l_dorada .ce-nom { font-family: 'Bebas Neue', sans-serif !important; letter-spacing: .04em !important;
  background: linear-gradient(100deg, #a8780a, #ffe27a 30%, #fff8d0 45%, #d4a017 60%, #ffe27a 80%, #a8780a);
  -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-fill-color: transparent;
  text-shadow: none !important; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }

/* ── Insignias ────────────────────────────────────────────────────────── */
.ce > .ce-insignia { position: absolute; z-index: 5; width: 24px; height: 24px; pointer-events: auto;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: rgba(8,10,14,.78); border: 1px solid rgba(255,255,255,.22); box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.ce > .ce-insignia svg { width: 15px; height: 15px; display: block; }
.card-front.ce > .ce-insignia { bottom: 64px; right: 10px; width: 28px; height: 28px; }
.card-front.ce > .ce-insignia svg { width: 17px; height: 17px; }
.al-card.ce > .ce-insignia { top: 26px; right: 5px; width: 20px; height: 20px; }
.al-card.ce > .ce-insignia svg { width: 12px; height: 12px; }
.pf-carta-foto.ce > .ce-insignia { top: 4px; right: 4px; width: 20px; height: 20px; }
.pf-carta-foto.ce > .ce-insignia svg { width: 12px; height: 12px; }
.ce-i_capitan > .ce-insignia { color: #ffd35a; }
.ce-i_estrella > .ce-insignia { color: #ffe27a; }
.ce-i_corona > .ce-insignia { color: #ffcf33; }
.ce-i_rayo > .ce-insignia { color: #67e8f9; }
.ce-i_llama > .ce-insignia { color: #ff8a3d; }
.ce-i_diamante > .ce-insignia { color: #a5f3fc; border-color: rgba(165,243,252,.5); }

/* ── Animaciones (solo si el sistema no pide reducir movimiento) ──────── */
@media (prefers-reduced-motion: no-preference) {
  .ce-m_neon > .ce-marco { animation: ceLate 2.4s ease-in-out infinite; }
  .ce-m_holo > .ce-marco::before { animation: ceGira 6s linear infinite; }
  .ce-e_brillo > .ce-efecto::before { animation: ceCruza 4.5s ease-in-out infinite; }
  .ce-e_aura > .ce-efecto { animation: ceLate 3.2s ease-in-out infinite; }
  .ce-e_holo > .ce-efecto::before { animation: ceDeriva 7s ease-in-out infinite alternate; }
  .ce-e_chispas > .ce-efecto > i { animation: ceSube 3.6s linear infinite; }
  .ce-efecto > i:nth-child(2) { animation-delay: -1.2s !important; animation-duration: 4.2s !important; }
  .ce-efecto > i:nth-child(3) { animation-delay: -2.4s !important; }
  .ce-efecto > i:nth-child(4) { animation-delay: -.6s !important; animation-duration: 4.6s !important; }
  .ce-efecto > i:nth-child(5) { animation-delay: -3s !important; }
  .ce-efecto > i:nth-child(6) { animation-delay: -1.8s !important; animation-duration: 3.9s !important; }
  .ce-i_diamante > .ce-insignia svg { animation: ceLate 2.8s ease-in-out infinite; }
}
/* Con movimiento reducido: todo quieto, las chispas quedan como puntitos */
@media (prefers-reduced-motion: reduce) {
  .ce-e_chispas > .ce-efecto > i { opacity: .55; }
  .ce-efecto > i:nth-child(odd) { bottom: 22%; } .ce-efecto > i:nth-child(even) { bottom: 58%; }
  .ce-e_brillo > .ce-efecto::before { left: 30%; opacity: .45; }
}
@keyframes ceLate { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes ceGira { to { transform: rotate(360deg); } }
@keyframes ceCruza { 0%, 55% { transform: translateX(0) skewX(-12deg); } 100% { transform: translateX(420%) skewX(-12deg); } }
@keyframes ceDeriva { from { transform: translate(-12%, -8%); } to { transform: translate(12%, 8%); } }
@keyframes ceSube { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: .8; }
  100% { transform: translateY(-420px); opacity: 0; } }
/* En la cartita y en la foto del perfil las chispas suben menos */
@media (prefers-reduced-motion: no-preference) {
  .al-card.ce-e_chispas > .ce-efecto > i, .pf-carta-foto.ce-e_chispas > .ce-efecto > i,
  .ct-pz-mini.ce-e_chispas > .ce-efecto > i { animation-name: ceSubeCorto; }
}
@keyframes ceSubeCorto { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: .8; }
  100% { transform: translateY(-200px); opacity: 0; } }

/* ── Vitrina: la carta grande fuera de /jugador (carnet, tienda) ──────── */
/* Lo mismo que ajusta /jugador para que las etiquetas de la carta no se encimen */
.ce-vitrina.carta-section { padding: 6px 0 4px; }
.ce-vitrina.carta-section .card { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ce-vitrina.carta-section .c-globrow { gap: 3px 4px; margin: 5px 0; max-height: none; }
.ce-vitrina.carta-section .c-glbl { font-size: 8px; padding: 2px 6px; }
.ce-vitrina.carta-section .c-catsarea { gap: 3px; }
.ce-vitrina.carta-section .c-crow { gap: 1px; margin: 0; }
.ce-vitrina.carta-section .c-cbarbg { height: 3px; }
.ce-vitrina.carta-section .c-back-footer { margin-top: 6px; }
.ce-vitrina .carta-hint { font-size: .74rem; color: var(--gdt-text-lo, #8892a4); }
