Mudanças entre as edições de "Widget:Teste"

De Wiki Gla
Ir para navegação Ir para pesquisar
m
m
Linha 4: Linha 4:
         const $$ = (s, root = document) => Array.from(root.querySelectorAll(s));
         const $$ = (s, root = document) => Array.from(root.querySelectorAll(s));


         // ----- Tabs
         // Idempotent helpers
         const tabBtns = $$('.tab-btn');
         const ensureRemoved = sel => { Array.from(document.querySelectorAll(sel)).forEach(n => n.remove()); };
         const panels = $$('.tab-content');
         const onceFlag = (el, key) => { if (!el) return false; if (el.dataset[key]) return false; el.dataset[key] = '1'; return true; };


         tabBtns.forEach(btn => {
         // Basic DOM nodes
            btn.addEventListener('click', () => {
        const skillsTab = $('#skills');
                const id = btn.dataset.tab;
        const skinsTab = $('#skins');
                tabBtns.forEach(b => b.classList.remove('active'));
 
                panels.forEach(p => p.classList.remove('active'));
        // Clean up legacy nodes/titles/placeholders before building
                btn.classList.add('active');
        ensureRemoved('.top-rail');
                 const panel = document.getElementById(id);
        ensureRemoved('.content-card');
                 if (panel) panel.classList.add('active');
        ensureRemoved('.video-placeholder');
             });
        // remove old duplicated skins titles (text match)
        Array.from(document.querySelectorAll('.card-skins-title, .card-skins .card-skins-title, .cardskins-title, .rail-title')).forEach(t => {
            if ((t.textContent || '').trim().toLowerCase().includes('skins')) {
                 // keep only if it's inside a future top-rail.skins we will create; remove for now
                 t.remove();
             }
         });
         });


         // ----- Skills (classes novas)
         // Build top-rail for skills (only icon-bar, centered)
         const skillsTab = $('#skills');
        if (skillsTab) {
         const iconsBar = skillsTab ? $('.icon-bar', skillsTab) : null;
            const iconBar = skillsTab.querySelector('.icon-bar');
         const iconItems = iconsBar ? $$('.skill-icon', iconsBar) : [];
            if (iconBar) {
         const descBox = skillsTab ? $('.desc-box', skillsTab) : null;
                const rail = document.createElement('div');
         const videoBox = skillsTab ? $('.video-container', skillsTab) : null;
                rail.className = 'top-rail skills';
                // center icon bar inside rail
                rail.appendChild(iconBar);
                skillsTab.prepend(rail);
            }
        }
 
        // Build top-rail for skins (single title + keep carousel wrapper)
         if (skinsTab) {
            const wrapper = skinsTab.querySelector('.skins-carousel-wrapper');
            const rail = document.createElement('div');
            rail.className = 'top-rail skins';
            const title = document.createElement('div');
            title.className = 'rail-title';
            title.textContent = 'Skins & Spotlights';
            rail.appendChild(title);
            if (wrapper) {
                const card = document.createElement('div');
                card.className = 'content-card';
                card.appendChild(wrapper);
                skinsTab.prepend(rail);
                skinsTab.appendChild(card);
            } else {
                skinsTab.prepend(rail);
            }
        }
 
        // Create content-card for skills (description + video) and move nodes in
        if (skillsTab) {
            const details = skillsTab.querySelector('.skills-details');
            const videoContainer = skillsTab.querySelector('.video-container');
            const card = document.createElement('div');
            card.className = 'content-card skills-grid';
            if (details) card.appendChild(details);
            if (videoContainer) card.appendChild(videoContainer);
            skillsTab.appendChild(card);
        }
 
        // ----- Elements after build
         const iconsBar = $('#skills') ? $('.icon-bar', $('#skills')) : null;
         const iconItems = iconsBar ? Array.from(iconsBar.querySelectorAll('.skill-icon')) : [];
         const descBox = $('#skills') ? $('.desc-box', $('#skills')) : null;
         const videoBox = $('#skills') ? $('.video-container', $('#skills')) : null;


         const videosCache = {};
        // Video cache and state
         const videosCache = new Map();
         let totalVideos = 0, loadedVideos = 0, autoplay = false;
         let totalVideos = 0, loadedVideos = 0, autoplay = false;


         // Placeholder do vídeo
         // Single placeholder node (create but don't duplicate)
         let placeholder = null;
         let placeholder = videoBox ? videoBox.querySelector('.video-placeholder') : null;
         if (videoBox) {
         if (!placeholder && videoBox) {
             placeholder = document.createElement('div');
             placeholder = document.createElement('div');
             placeholder.className = 'video-placeholder';
             placeholder.className = 'video-placeholder';
Linha 37: Linha 85:
             videoBox.appendChild(placeholder);
             videoBox.appendChild(placeholder);
         }
         }
         // Smoothly remove placeholder; use transitionend if available, with timeout fallback
 
         // Robust removal: fade + transitionend + timeout
         const removePlaceholderSmooth = () => {
         const removePlaceholderSmooth = () => {
             if (!placeholder) return;
             if (!placeholder) return;
            // If already fading, do nothing
             if (placeholder.classList.contains('fade-out')) return;
             if (placeholder.classList.contains('fade-out')) return;
            // ensure transition style exists (CSS handles it)
             placeholder.classList.add('fade-out');
             placeholder.classList.add('fade-out');
             let removed = false;
             let done = false;
             const clean = () => {
             const clean = () => {
                 if (removed) return;
                 if (done) return;
                 removed = true;
                 done = true;
                 try { placeholder.remove(); } catch (e) { /* ignore */ }
                 try { placeholder.remove(); } catch (e) { /* ignore */ }
                 placeholder = null;
                 placeholder = null;
             };
             };
            // Remove on transitionend if possible
             placeholder.addEventListener('transitionend', clean, { once: true });
             placeholder.addEventListener('transitionend', clean, { once: true });
             // Fallback: ensure removal after 400ms
             setTimeout(clean, 500);
             setTimeout(clean, 450);
        };
        const showPlaceholder = () => {
            if (!videoBox) return;
            if (!placeholder) {
                placeholder = document.createElement('div');
                placeholder.className = 'video-placeholder';
                placeholder.innerHTML = '<img src="/images/d/d5/Icon_gla.png" alt="Carregando...">';
                videoBox.appendChild(placeholder);
                // force reflow so transition will apply later
                void placeholder.offsetWidth;
            }
            placeholder.classList.remove('fade-out');
            placeholder.style.display = 'flex';
        };
 
        // Utility: attach listener only once per element
        const addOnce = (el, ev, fn) => {
            if (!el) return;
            const key = `wired-${ev}`;
             if (el.dataset[key]) return;
            el.addEventListener(ev, fn);
            el.dataset[key] = '1';
         };
         };


         // Pré-carregar vídeos
         // Preload videos (idempotent: skip if present in map)
         iconItems.forEach(el => {
         if (iconItems.length && videoBox) {
            const src = (el.dataset.video || '').trim();
            iconItems.forEach(el => {
            const idx = el.dataset.index || '';
                const src = (el.dataset.video || '').trim();
            if (!src || !videoBox || videosCache[idx]) return;
                const idx = el.dataset.index || '';
                if (!src || videosCache.has(idx)) return;


            totalVideos++;
                totalVideos++;
            const v = document.createElement('video');
                const v = document.createElement('video');
            v.controls = true;
                v.setAttribute('controls', '');
            v.preload = 'auto';
                v.setAttribute('preload', 'auto');
            v.playsInline = true;
                v.setAttribute('playsinline', '');
            v.style.display = 'none';
                v.style.display = 'none';
            v.dataset.index = idx;
                v.dataset.index = idx;
                // make video responsive via CSS (aspect-ratio)
                v.style.width = '100%';
                v.style.height = 'auto';
                const source = document.createElement('source');
                source.src = src;
                source.type = 'video/webm';
                v.appendChild(source);


            const source = document.createElement('source');
                v.addEventListener('canplay', () => {
            source.src = src;
                    loadedVideos++;
            source.type = 'video/webm';
                    if (loadedVideos === 1) { try { v.pause(); v.currentTime = 0; } catch (e) { } }
            v.appendChild(source);
                    const active = $('.skill-icon.active', iconsBar);
                    if (active && active.dataset.index === idx) {
                        // remove placeholder for the active video
                        setTimeout(removePlaceholderSmooth, 180);
                    }
                    if (loadedVideos === totalVideos) autoplay = true;
                });


            v.addEventListener('canplay', () => {
                v.addEventListener('error', () => {
                loadedVideos++;
                    loadedVideos++;
                if (loadedVideos === 1) { v.pause(); v.currentTime = 0; }
                    removePlaceholderSmooth();
                const active = $('.skill-icon.active', iconsBar);
                    if (loadedVideos === totalVideos) autoplay = true;
                if (active && active.dataset.index === idx) setTimeout(removePlaceholder, 180);
                });
                if (loadedVideos === totalVideos) autoplay = true;
            });


            v.addEventListener('error', () => {
                videoBox.appendChild(v);
                loadedVideos++;
                 videosCache.set(idx, v);
                 removePlaceholder();
                if (loadedVideos === totalVideos) autoplay = true;
             });
             });
        }


            videoBox.appendChild(v);
         if (totalVideos === 0 && placeholder) {
            videosCache[idx] = v;
        });
 
         if (totalVideos === 0) {
             // no videos -> remove placeholder immediately
             // no videos -> remove placeholder immediately
             if (placeholder) { placeholder.remove(); placeholder = null; }
             placeholder.remove();
            placeholder = null;
         }
         }


         // Clique nas skills
         // Attach skill icon click handlers once
         iconItems.forEach(el => {
         iconItems.forEach(el => {
            if (el.dataset.wired) return;
            el.dataset.wired = '1';
             const name = el.dataset.nome || el.dataset.name || '';
             const name = el.dataset.nome || el.dataset.name || '';
             const desc = (el.dataset.desc || '').replace(/'''(.*?)'''/g, '<b>$1</b>');
             const desc = (el.dataset.desc || '').replace(/'''(.*?)'''/g, '<b>$1</b>');
Linha 107: Linha 186:


             el.title = name;
             el.title = name;
             el.addEventListener('click', () => {
             el.addEventListener('click', () => {
                 if (!autoplay && loadedVideos > 0) autoplay = true;
                 // update description area
 
                 if (descBox) {
                 if (descBox) {
                     descBox.innerHTML = `
                     descBox.innerHTML = `
Linha 117: Linha 194:
   <div class="desc">${desc}</div>
   <div class="desc">${desc}</div>
`;
`;
                 }
                 }


                 // alterna vídeos
                 // switch videos: hide all, show selected (if any)
                 Object.values(videosCache).forEach(v => { v.pause(); v.style.display = 'none'; });
                 videosCache.forEach(v => { try { v.pause(); } catch (e) { } v.style.display = 'none'; });
                 if (videoBox) {
                 if (videoBox) {
                        if (hasVideo && videosCache[idx]) {
                    if (hasVideo && videosCache.has(idx)) {
                         const v = videosCache[idx];
                         const v = videosCache.get(idx);
                         videoBox.style.display = 'block';
                         videoBox.style.display = 'block';
                         v.style.display = 'block';
                         v.style.display = 'block';
                         v.currentTime = 0;
                         try { v.currentTime = 0; } catch (e) {}
                            // if video is ready or becomes ready, ensure placeholder is removed
                        // show placeholder until this video can play
                            try {
                        if (v.readyState >= 3) {
                                // if video is already playable, remove placeholder immediately
                            removePlaceholderSmooth();
                                if (v.readyState >= 3) removePlaceholderSmooth();
                        } else {
                             } catch (e) {}
                             showPlaceholder();
                             if (autoplay) v.play().catch(() => { });
                            // ensure once it can play for this index we hide placeholder
                            const canplayHandler = () => { removePlaceholderSmooth(); v.removeEventListener('canplay', canplayHandler); };
                             v.addEventListener('canplay', canplayHandler);
                        }
                        if (autoplay) v.play().catch(() => { });
                     } else {
                     } else {
                        // no video for this skill
                         videoBox.style.display = 'none';
                         videoBox.style.display = 'none';
                        if (placeholder) { placeholder.remove(); placeholder = null; }
                     }
                     }
                 }
                 }


                 // estado ativo
                 // active state
                 iconItems.forEach(i => i.classList.remove('active'));
                 iconItems.forEach(i => i.classList.remove('active'));
                 el.classList.add('active');
                 el.classList.add('active');
                if (!autoplay && loadedVideos > 0) autoplay = true;
             });
             });
         });
         });


         // Seleciona a primeira skill por padrão
         // Select first skill by default (dispatch click once)
         if (iconItems.length) iconItems[0].click();
         if (iconItems.length) {
            const first = iconItems[0];
            if (first) {
                // ensure default active visual & trigger behavior
                if (!first.classList.contains('active')) first.classList.add('active');
                // trigger click after microtask so videos are ready to be shown
                setTimeout(() => first.click(), 0);
            }
        }


         // Scroll horizontal com a roda do mouse
         // horizontal scroll on wheel (attach once)
         if (iconsBar) {
         if (iconsBar) addOnce(iconsBar, 'wheel', (e) => {
            iconsBar.addEventListener('wheel', (e) => {
            if (e.deltaY) {
                if (e.deltaY) {
                e.preventDefault();
                    e.preventDefault();
                iconsBar.scrollLeft += e.deltaY;
                    iconsBar.scrollLeft += e.deltaY;
            }
                }
        });
            });
        }


         // ----- Skins: setas (classes já estavam ok)
         // skins carousel arrows init (idempotent)
         initSkinsArrows();
         (function initSkinsArrows() {
        function initSkinsArrows() {
             const carousel = $('.skins-carousel');
             const carousel = $('.skins-carousel');
             const wrapper = $('.skins-carousel-wrapper');
             const wrapper = $('.skins-carousel-wrapper');
Linha 166: Linha 254:
             const right = $('.skins-arrow.right');
             const right = $('.skins-arrow.right');
             if (!carousel || !left || !right || !wrapper) return;
             if (!carousel || !left || !right || !wrapper) return;
 
            if (wrapper.dataset.wired) return;
            wrapper.dataset.wired = '1';
             const scrollAmt = () => Math.round(carousel.clientWidth * 0.6);
             const scrollAmt = () => Math.round(carousel.clientWidth * 0.6);
             function setState() {
             function setState() {
                 const max = carousel.scrollWidth - carousel.clientWidth;
                 const max = carousel.scrollWidth - carousel.clientWidth;
Linha 191: Linha 279:
             new ResizeObserver(setState).observe(carousel);
             new ResizeObserver(setState).observe(carousel);
             setState();
             setState();
         }
         })();


         // ----- Atributos (ordem fixa, espaços "fantasmas" no fim)
         // Render attributes function (keeps empty rows above visible ones)
         function renderAttributes(str) {
         function renderAttributes(str) {
             const vals = (str || '').split(',').map(v => v.trim());
             const vals = (str || '').split(',').map(v => v.trim());
Linha 214: Linha 302:
             ];
             ];


                            // Put empty rows above visible rows so visible attributes sit
            const visible = rows.filter(([, v]) => v !== '-');
                            // directly below the title/description (no gap between desc and attrs).
            const empties = rows.length - visible.length;
                            const visible = rows.filter(([, v]) => v !== '-');
            const emptyHtml = Array.from({ length: empties }).map(() => `
                            const empties = rows.length - visible.length;
 
                            const emptyHtml = Array.from({ length: empties }).map(() => `
                 <div class="attr-row is-empty">
                 <div class="attr-row is-empty">
                     <span class="attr-label">&nbsp;</span>
                     <span class="attr-label">&nbsp;</span>
Linha 225: Linha 310:
                 </div>
                 </div>
             `).join('');
             `).join('');
 
            const visibleHtml = visible.map(([label, value]) => `
                            const visibleHtml = visible.map(([label, value]) => `
                 <div class="attr-row">
                 <div class="attr-row">
                     <span class="attr-label">${label}:</span>
                     <span class="attr-label">${label}:</span>
Linha 232: Linha 316:
                 </div>
                 </div>
             `).join('');
             `).join('');
 
            if (visible.length === 0) {
                            // if there are no visible attributes, keep one empty row to preserve layout
                // still keep one empty row to preserve spacing but on top
                            if (visible.length === 0) {
                return `<div class="attr-list">${emptyHtml || `\n      <div class="attr-row is-empty">\n        <span class="attr-label">&nbsp;</span>\n        <span class="attr-value">&nbsp;</span>\n      </div>\n    `}</div>`;
                                    return `<div class="attr-list">${emptyHtml || `\n      <div class="attr-row is-empty">\n        <span class="attr-label">&nbsp;</span>\n        <span class="attr-value">&nbsp;</span>\n      </div>\n    `}</div>`;
            }
                            }
            return `<div class="attr-list">${emptyHtml}${visibleHtml}</div>`;
 
                            return `<div class="attr-list">${emptyHtml}${visibleHtml}</div>`;
         }
         }
            // ====== Dynamic structure: create top-rail and content-card without rewriting HTML ======
            const mk = (tag, cls, text) => {
                const el = document.createElement(tag);
                if (cls) el.className = cls;
                if (text) el.textContent = text;
                return el;
            };
            try {
                // Skills tab: rail variant with only icons (no title)
                if (skillsTab) {
                    const iconBarNode = iconsBar; // existing node
                    const skillsDetails = skillsTab.querySelector('.skills-details');
                    const videoContainer = skillsTab.querySelector('.video-container');
                    const skillsRail = mk('div','top-rail skills');
                    if (iconBarNode) {
                        // move iconBar into rail (preserve node)
                        skillsRail.append(iconBarNode);
                    }
                    // create larger content card and move nodes inside
                    const card = mk('div','content-card skills-grid');
                    if (skillsDetails) card.append(skillsDetails);
                    if (videoContainer) card.append(videoContainer);
                    // insert rail and card into skillsTab
                    skillsTab.prepend(skillsRail);
                    skillsTab.append(card);
                        // placeholder might have been created before we moved nodes; if so,
                        // ensure it's appended to the (now moved) videoContainer so positioning is correct
                        try {
                            const newVideoContainer = skillsTab.querySelector('.video-container');
                            if (newVideoContainer && placeholder && placeholder.parentNode !== newVideoContainer) {
                                newVideoContainer.appendChild(placeholder);
                            }
                        } catch (e) { /* ignore */ }
                }
                // Skins tab
                const skinsTab = $('#skins');
                if (skinsTab) {
                    const skinsWrapper = skinsTab.querySelector('.skins-carousel-wrapper');
                    const skinsRail = mk('div','top-rail skins');
                    skinsRail.append(mk('div','rail-title','Skins & Spotlights'));
                    const card2 = mk('div','content-card');
                    if (skinsWrapper) card2.append(skinsWrapper);
                    skinsTab.prepend(skinsRail);
                    skinsTab.append(card2);
                }
            } catch (e) {
                // fail silently — DOM structure assumed, don't break page
                console.error('widget layout script error', e);
            }
     })();
     })();
</script>
</script>
Linha 306: Linha 334:
     }
     }


     video {
    /* video baseline; specific skill video sizing overridden below */
        max-height: 33.25em;
     video { max-height: none; }
        object-fit: fill;
    }


     .mw-body {
     .mw-body {
Linha 414: Linha 440:
     }
     }


     /* Artwork anchored to bottom-right of the header, fixed offsets and max sizes */
     /* artwork removed from layout (server still accepts param but we ignore rendering).
     .character-art {
      ensure it doesn't reserve space if present in legacy markup */
        width: auto;
     .character-art { display: none !important; width: 0 !important; height: 0 !important; overflow: hidden !important; }
        height: auto;
        max-width: min(42vw, 620px);
        max-height: min(62vh, 560px);
        position: absolute;
        right: clamp(12px, 2.5vw, 32px);
        bottom: 0;
        object-fit: contain;
        z-index: 1;
        pointer-events: none;
    }


     /* Class / tier chips */
     /* Class / tier chips */
Linha 719: Linha 735:




     :root {
    /* remove fixed skill pane height and let content decide height */
        --skill-pane-height: 36rem; /* base height (kept for legacy/consistency) */
     :root { --skill-pane-height: unset; }
    }
     .skills-container { align-items: flex-start; }
 
     .skills-container {
        align-items: stretch;
    }


     /* Video container: allow the video to display at its original size
     /* Video container: allow the video to display at its original size
Linha 732: Linha 744:
     .video-container {
     .video-container {
         position: relative;
         position: relative;
        flex: 0 0 auto;
         width: 100%;
         width: 100%;
         max-width: 100%;
         max-width: 100%;
        height: 100%; /* fill the grid row height */
         background: transparent;
         background: transparent; /* flattened */
         display: flex;
         display: flex;
         align-items: center;
         align-items: center;
Linha 742: Linha 752:
         border-radius: 10px;
         border-radius: 10px;
         box-shadow: none;
         box-shadow: none;
         overflow: hidden; /* for rounded corners */
         overflow: hidden; /* rounded corners */
         padding: 0; /* remove internal padding so video can fill column */
         padding: 0;
         z-index: 2; /* content layer */
         z-index: 2;
     }
     }


     .desc-box {
     /* skill video: occupy column width with 16:9 aspect, cover to avoid letterboxing */
        min-height: var(--skill-pane-height);
        z-index: 2; /* content layer */
    }
 
    /* Keep the video's original aspect and size. Constrain by max-width
      so it never overflows its container, but avoid object-fit that crops. */
     .video-container>video {
     .video-container>video {
        position: relative;
         width: 100%;
         width: 100%;
         height: 100%;
         height: auto;
         max-width: 100%;
         aspect-ratio: 16 / 9;
         object-fit: contain; /* scale inside the column preserving aspect */
         object-fit: cover;
         object-position: center;
         object-position: center;
         z-index: 2; /* video is part of content */
         z-index: 2;
         display: block;
         display: block;
         border-radius: 6px; /* round the video itself */
         border-radius: 6px;
        background: #000;
     }
     }


Linha 771: Linha 775:
         position: absolute;
         position: absolute;
         inset: 0;
         inset: 0;
         z-index: 6; /* placeholders/overlays above content */
         z-index: 6;
         display: flex;
         display: flex;
         align-items: center;
         align-items: center;
Linha 777: Linha 781:
         pointer-events: none;
         pointer-events: none;
         opacity: 1;
         opacity: 1;
         transition: opacity .28s ease; /* ensure transition exists before class is added */
         transition: opacity .28s ease;
        background: linear-gradient(rgba(0,0,0,0.0), rgba(0,0,0,0.0)); /* transparent overlay but keeps stacking context */
     }
     }


Linha 793: Linha 798:
     }
     }


     @media (max-width:1100px),
     @media (max-width:1100px) {
     (max-aspect-ratio:3/4) {
        .top-rail {
            flex-direction: column;
            align-items: stretch;
        }
        .top-rail .icon-bar {
            order: 2;
            width: 100%;
            flex-wrap: wrap;
        }
        .content-card.skills-grid { grid-template-columns: 1fr; }
    }
 
     @media (max-aspect-ratio: 3/4) {
        .character-header .character-art {
            display: none;
        }
 
         .video-container {
         .video-container {
             width: 80%;
             width: 80%;
            max-width: 820px;
            height: auto;
            aspect-ratio: 16 / 9;
            margin: 2% auto 0;
             border-radius: 3%;
             border-radius: 3%;
        }
            margin-top: 2%;
 
             align-self: center;
        .desc-box {
             min-height: unset;
         }
         }
     }
     }
Linha 882: Linha 897:
     /* Make the video column wider so the video has more space. */
     /* Make the video column wider so the video has more space. */
     .content-card.skills-grid {
     .content-card.skills-grid {
         display:grid;
         display: grid;
         grid-template-columns: 44% 56%; /* description | video (wider) */
         grid-template-columns: 60% 40%;
         gap:16px;
         gap: 16px;
         align-items: stretch; /* make both columns equal height */
         align-items: start; /* don't stretch items vertically */
         grid-auto-rows: 1fr;
         grid-auto-rows: auto;
         margin: 10px auto 0; /* remove extra bottom spacing */
         margin: 10px auto 0;
     }
     }


Linha 900: Linha 915:
             flex-wrap: wrap;
             flex-wrap: wrap;
         }
         }
         .content-card.skills-grid {
         .content-card.skills-grid { grid-template-columns: 1fr; }
            grid-template-columns: 1fr;
        }
     }
     }



Edição das 23h24min de 24 de agosto de 2025

<script>

   (function () {
       const $ = (s, root = document) => root.querySelector(s);
       const $$ = (s, root = document) => Array.from(root.querySelectorAll(s));
       // Idempotent helpers
       const ensureRemoved = sel => { Array.from(document.querySelectorAll(sel)).forEach(n => n.remove()); };
       const onceFlag = (el, key) => { if (!el) return false; if (el.dataset[key]) return false; el.dataset[key] = '1'; return true; };
       // Basic DOM nodes
       const skillsTab = $('#skills');
       const skinsTab = $('#skins');
       // Clean up legacy nodes/titles/placeholders before building
       ensureRemoved('.top-rail');
       ensureRemoved('.content-card');
       ensureRemoved('.video-placeholder');
       // remove old duplicated skins titles (text match)
       Array.from(document.querySelectorAll('.card-skins-title, .card-skins .card-skins-title, .cardskins-title, .rail-title')).forEach(t => {
           if ((t.textContent || ).trim().toLowerCase().includes('skins')) {
               // keep only if it's inside a future top-rail.skins we will create; remove for now
               t.remove();
           }
       });
       // Build top-rail for skills (only icon-bar, centered)
       if (skillsTab) {
           const iconBar = skillsTab.querySelector('.icon-bar');
           if (iconBar) {
               const rail = document.createElement('div');
               rail.className = 'top-rail skills';
               // center icon bar inside rail
               rail.appendChild(iconBar);
               skillsTab.prepend(rail);
           }
       }
       // Build top-rail for skins (single title + keep carousel wrapper)
       if (skinsTab) {
           const wrapper = skinsTab.querySelector('.skins-carousel-wrapper');
           const rail = document.createElement('div');
           rail.className = 'top-rail skins';
           const title = document.createElement('div');
           title.className = 'rail-title';
           title.textContent = 'Skins & Spotlights';
           rail.appendChild(title);
           if (wrapper) {
               const card = document.createElement('div');
               card.className = 'content-card';
               card.appendChild(wrapper);
               skinsTab.prepend(rail);
               skinsTab.appendChild(card);
           } else {
               skinsTab.prepend(rail);
           }
       }
       // Create content-card for skills (description + video) and move nodes in
       if (skillsTab) {
           const details = skillsTab.querySelector('.skills-details');
           const videoContainer = skillsTab.querySelector('.video-container');
           const card = document.createElement('div');
           card.className = 'content-card skills-grid';
           if (details) card.appendChild(details);
           if (videoContainer) card.appendChild(videoContainer);
           skillsTab.appendChild(card);
       }
       // ----- Elements after build
       const iconsBar = $('#skills') ? $('.icon-bar', $('#skills')) : null;
       const iconItems = iconsBar ? Array.from(iconsBar.querySelectorAll('.skill-icon')) : [];
       const descBox = $('#skills') ? $('.desc-box', $('#skills')) : null;
       const videoBox = $('#skills') ? $('.video-container', $('#skills')) : null;
       // Video cache and state
       const videosCache = new Map();
       let totalVideos = 0, loadedVideos = 0, autoplay = false;
       // Single placeholder node (create but don't duplicate)
       let placeholder = videoBox ? videoBox.querySelector('.video-placeholder') : null;
       if (!placeholder && videoBox) {
           placeholder = document.createElement('div');
           placeholder.className = 'video-placeholder';
           placeholder.innerHTML = '<img src="/images/d/d5/Icon_gla.png" alt="Carregando...">';
           videoBox.appendChild(placeholder);
       }
       // Robust removal: fade + transitionend + timeout
       const removePlaceholderSmooth = () => {
           if (!placeholder) return;
           if (placeholder.classList.contains('fade-out')) return;
           // ensure transition style exists (CSS handles it)
           placeholder.classList.add('fade-out');
           let done = false;
           const clean = () => {
               if (done) return;
               done = true;
               try { placeholder.remove(); } catch (e) { /* ignore */ }
               placeholder = null;
           };
           placeholder.addEventListener('transitionend', clean, { once: true });
           setTimeout(clean, 500);
       };
       const showPlaceholder = () => {
           if (!videoBox) return;
           if (!placeholder) {
               placeholder = document.createElement('div');
               placeholder.className = 'video-placeholder';
               placeholder.innerHTML = '<img src="/images/d/d5/Icon_gla.png" alt="Carregando...">';
               videoBox.appendChild(placeholder);
               // force reflow so transition will apply later
               void placeholder.offsetWidth;
           }
           placeholder.classList.remove('fade-out');
           placeholder.style.display = 'flex';
       };
       // Utility: attach listener only once per element
       const addOnce = (el, ev, fn) => {
           if (!el) return;
           const key = `wired-${ev}`;
           if (el.dataset[key]) return;
           el.addEventListener(ev, fn);
           el.dataset[key] = '1';
       };
       // Preload videos (idempotent: skip if present in map)
       if (iconItems.length && videoBox) {
           iconItems.forEach(el => {
               const src = (el.dataset.video || ).trim();
               const idx = el.dataset.index || ;
               if (!src || videosCache.has(idx)) return;
               totalVideos++;
               const v = document.createElement('video');
               v.setAttribute('controls', );
               v.setAttribute('preload', 'auto');
               v.setAttribute('playsinline', );
               v.style.display = 'none';
               v.dataset.index = idx;
               // make video responsive via CSS (aspect-ratio)
               v.style.width = '100%';
               v.style.height = 'auto';
               const source = document.createElement('source');
               source.src = src;
               source.type = 'video/webm';
               v.appendChild(source);
               v.addEventListener('canplay', () => {
                   loadedVideos++;
                   if (loadedVideos === 1) { try { v.pause(); v.currentTime = 0; } catch (e) { } }
                   const active = $('.skill-icon.active', iconsBar);
                   if (active && active.dataset.index === idx) {
                       // remove placeholder for the active video
                       setTimeout(removePlaceholderSmooth, 180);
                   }
                   if (loadedVideos === totalVideos) autoplay = true;
               });
               v.addEventListener('error', () => {
                   loadedVideos++;
                   removePlaceholderSmooth();
                   if (loadedVideos === totalVideos) autoplay = true;
               });
               videoBox.appendChild(v);
               videosCache.set(idx, v);
           });
       }
       if (totalVideos === 0 && placeholder) {
           // no videos -> remove placeholder immediately
           placeholder.remove();
           placeholder = null;
       }
       // Attach skill icon click handlers once
       iconItems.forEach(el => {
           if (el.dataset.wired) return;
           el.dataset.wired = '1';
           const name = el.dataset.nome || el.dataset.name || ;
           const desc = (el.dataset.desc || ).replace(/(.*?)/g, '$1');
           const attrs = el.dataset.atr || el.dataset.attrs || ;
           const idx = el.dataset.index || ;
           const hasVideo = !!(el.dataset.video && el.dataset.video.trim() !== );
           el.title = name;
           el.addEventListener('click', () => {
               // update description area
               if (descBox) {
                   descBox.innerHTML = `

${name}

 ${renderAttributes(attrs)}
${desc}

`;

               }
               // switch videos: hide all, show selected (if any)
               videosCache.forEach(v => { try { v.pause(); } catch (e) { } v.style.display = 'none'; });
               if (videoBox) {
                   if (hasVideo && videosCache.has(idx)) {
                       const v = videosCache.get(idx);
                       videoBox.style.display = 'block';
                       v.style.display = 'block';
                       try { v.currentTime = 0; } catch (e) {}
                       // show placeholder until this video can play
                       if (v.readyState >= 3) {
                           removePlaceholderSmooth();
                       } else {
                           showPlaceholder();
                           // ensure once it can play for this index we hide placeholder
                           const canplayHandler = () => { removePlaceholderSmooth(); v.removeEventListener('canplay', canplayHandler); };
                           v.addEventListener('canplay', canplayHandler);
                       }
                       if (autoplay) v.play().catch(() => { });
                   } else {
                       // no video for this skill
                       videoBox.style.display = 'none';
                       if (placeholder) { placeholder.remove(); placeholder = null; }
                   }
               }
               // active state
               iconItems.forEach(i => i.classList.remove('active'));
               el.classList.add('active');
               if (!autoplay && loadedVideos > 0) autoplay = true;
           });
       });
       // Select first skill by default (dispatch click once)
       if (iconItems.length) {
           const first = iconItems[0];
           if (first) {
               // ensure default active visual & trigger behavior
               if (!first.classList.contains('active')) first.classList.add('active');
               // trigger click after microtask so videos are ready to be shown
               setTimeout(() => first.click(), 0);
           }
       }
       // horizontal scroll on wheel (attach once)
       if (iconsBar) addOnce(iconsBar, 'wheel', (e) => {
           if (e.deltaY) {
               e.preventDefault();
               iconsBar.scrollLeft += e.deltaY;
           }
       });
       // skins carousel arrows init (idempotent)
       (function initSkinsArrows() {
           const carousel = $('.skins-carousel');
           const wrapper = $('.skins-carousel-wrapper');
           const left = $('.skins-arrow.left');
           const right = $('.skins-arrow.right');
           if (!carousel || !left || !right || !wrapper) return;
           if (wrapper.dataset.wired) return;
           wrapper.dataset.wired = '1';
           const scrollAmt = () => Math.round(carousel.clientWidth * 0.6);
           function setState() {
               const max = carousel.scrollWidth - carousel.clientWidth;
               const x = carousel.scrollLeft;
               const hasLeft = x > 5, hasRight = x < max - 5;
               left.style.display = hasLeft ? 'inline-block' : 'none';
               right.style.display = hasRight ? 'inline-block' : 'none';
               wrapper.classList.toggle('has-left', hasLeft);
               wrapper.classList.toggle('has-right', hasRight);
               carousel.style.justifyContent = (!hasLeft && !hasRight) ? 'center' : ;
           }
           function go(dir) {
               const max = carousel.scrollWidth - carousel.clientWidth;
               const next = dir < 0
                   ? Math.max(0, carousel.scrollLeft - scrollAmt())
                   : Math.min(max, carousel.scrollLeft + scrollAmt());
               carousel.scrollTo({ left: next, behavior: 'smooth' });
           }
           left.addEventListener('click', () => go(-1));
           right.addEventListener('click', () => go(1));
           carousel.addEventListener('scroll', setState);
           new ResizeObserver(setState).observe(carousel);
           setState();
       })();
       // Render attributes function (keeps empty rows above visible ones)
       function renderAttributes(str) {
           const vals = (str || ).split(',').map(v => v.trim());
           const pve = parseInt(vals[0], 10);
           const pvp = parseInt(vals[1], 10);
           const ene = parseInt(vals[2], 10);
           const cd = parseInt(vals[3], 10);
           const recargaVal = isNaN(cd) ? '-' : cd;
           const energiaLabel = isNaN(ene) ? 'Energia' : (ene >= 0 ? 'Ganho de energia' : 'Custo de energia');
           const energiaVal = isNaN(ene) ? '-' : Math.abs(ene);
           const poderVal = isNaN(pve) ? '-' : pve;
           const poderPvpVal = isNaN(pvp) ? '-' : pvp;
           const rows = [
               ['Recarga', recargaVal],
               [energiaLabel, energiaVal],
               ['Poder', poderVal],
               ['Poder PvP', poderPvpVal],
           ];
           const visible = rows.filter(([, v]) => v !== '-');
           const empties = rows.length - visible.length;
           const emptyHtml = Array.from({ length: empties }).map(() => `
                    
                    
           `).join();
           const visibleHtml = visible.map(([label, value]) => `
                   ${label}:
                   ${value}
           `).join();
           if (visible.length === 0) {
               // still keep one empty row to preserve spacing but on top

return `

${emptyHtml || `\n
\n  \n  \n
\n `}

`;

           }

return `

${emptyHtml}${visibleHtml}

`;

       }
   })();

</script>

<style>

   /* ===========================
  Base
  =========================== */
   img {
       pointer-events: none;
       user-select: none;
   }
   /* video baseline; specific skill video sizing overridden below */
   video { max-height: none; }
   .mw-body {
       padding: unset !important;
   }
   /* precisa de !important p/ MediaWiki */
   .mw-body-content {
       line-height: 1.5;
   }
   .mw-body-content p {
       display: none;
   }
   /* ===========================
  Banner
  =========================== */
   /* Hide the original banner element (we'll use the image as the template background)
      and keep the selector so existing markup doesn't break. */
   .banner { display: none !important; }
   /* Use the banner image as the background for the template container and add
      a subtle dark overlay via ::before to improve text contrast. */
   .character-box {
       /* ...existing properties... */
       background-image: url(https://i.imgur.com/RktmgO8.png);
       background-position: center top;
       background-repeat: no-repeat;
       background-size: cover;
       position: relative; /* ensure positioning context for ::before */
       z-index: 1; /* base layer for the box content */
   }
   /* overlay sits above the background image but below the content; darker bottom-to-top gradient */
   .character-box::before {
       content: "";
       position: absolute;
       inset: 0;
       pointer-events: none;
       background: linear-gradient(to bottom, rgba(0,0,0,.45), rgba(0,0,0,.60));
       z-index: 0; /* overlay: below content (content kept at z-index:1) */
   }
   /* ===========================
  Character topbar
  =========================== */
   .character-box {
       color: #000;
       font-family: 'Noto Sans', sans-serif;
       width: 100%;
       margin: auto;
       position: relative;
       user-select: none;
   }
   .character-box p {
       display: unset;
   }
   .character-topbar {
       display: flex;
       flex-direction: column;
       align-items: flex-start;
       padding: 8px 20px 0;
   z-index: 1; /* topbar above overlay */
   }
   .character-name-box {
       display: flex;
       align-items: center;
       gap: 14px;
   }
   .topbar-icon {
       margin-top: 8px;
       width: 100px;
       height: 100px;
       object-fit: none;
   }
   .character-name {
       color: #fff;
       font-size: 56px;
       font-family: 'Orbitron', sans-serif;
       font-weight: 900;
       text-shadow: 0 0 6px #000, 0 0 9px #000;
   }
   .topbar-description {
       display: none;
   }
   /* ===========================
  Header / Artwork
  =========================== */
   .character-header {
       position: relative;
       overflow: hidden; /* artwork must not 'vazar' */
       display: flex;
       gap: 10px;
       flex-direction: column;
       z-index: 1; /* header/topbar layer */
   }
   /* artwork removed from layout (server still accepts param but we ignore rendering).
      ensure it doesn't reserve space if present in legacy markup */
   .character-art { display: none !important; width: 0 !important; height: 0 !important; overflow: hidden !important; }
   /* Class / tier chips */
   .class-tags {
       display: flex;
       gap: 9px;
       flex-wrap: wrap;
       margin-left: .28rem;
   }
   .class-tag {
       background: #353420;
       color: #fff;
       outline: 2px solid #000;
       padding: 1px 6px;
       border-radius: 4px;
       font-size: .9em;
       font-weight: 700;
       box-shadow: 0 0 2px rgb(0 0 0 / 70%);
   }
   .character-info .tier,
   .character-info .class-tag {
       font-size: 18px;
       color: #bbb;
   }
   /* ===========================
  Tabs
  =========================== */
   .character-tabs {
       margin: 4px 0 4px 8px;
       display: flex;
       gap: 12px;
   }
   .tab-btn {
       padding: 5px 20px;
       background: #333;
       color: #fff;
       border: 2px solid transparent;
       border-radius: 8px;
       font-size: 20px;
       cursor: pointer;
       font-weight: 600;
       line-height: 1;
       transition: background .15s, border-color .15s;
   }
   .tab-btn.active {
       background: #156bc7;
       border-color: #156bc7;
   }
   .tab-content {
       display: none;
       padding: 0 8px 8px;
       position: relative;
   z-index: 2; /* content layer */
   }
   .tab-content.active {
       display: block;
   }
   /* ===========================
  Skills 
  =========================== */
   .skills-container {
       display: flex;
       gap: 20px;
   }
   .skills-details {
       flex: 1;
       display: flex;
       flex-direction: column;
       gap: 10px;
       width: auto; /* let grid control widths */
       justify-content: center;
   }
   .icon-bar {
       display: flex;
       flex-wrap: nowrap;
       gap: 10px;
       width: 100%;
       overflow-x: auto;
       overflow-y: hidden;
       padding: 10px 0 3px 3px;
       margin-bottom: 6px;
       scrollbar-width: thin;
       scrollbar-color: #ababab transparent;
       scroll-behavior: smooth;
       justify-content: flex-start;
       position: relative;
       z-index: 4;
   }
   .icon-bar::-webkit-scrollbar {
       height: 6px;
   }
   .icon-bar::-webkit-scrollbar-track {
       background: transparent;
   }
   .icon-bar::-webkit-scrollbar-thumb {
       background: #151515;
       border-radius: 3px;
   }
   :root {
       --icon-size: 39px;
       --icon-radius: 8px;
       --icon-idle: #bbb;
       --icon-active: #156bc7;
       --icon-active-ring: rgba(21, 107, 199, .35);
   }
   .icon-bar .skill-icon {
       width: var(--icon-size);
       height: var(--icon-size);
       position: relative;
       flex: 0 0 auto;
       border-radius: var(--icon-radius);
       overflow: hidden;
   }
   .icon-bar .skill-icon img {
       position: absolute;
       inset: 0;
       width: 100%;
       height: 100%;
       object-fit: cover;
       border-radius: var(--icon-radius);
       -webkit-clip-path: inset(0 round var(--icon-radius));
       clip-path: inset(0 round var(--icon-radius));
   }
   .icon-bar .skill-icon::after {
       content: "";
       position: absolute;
       inset: 0;
       border-radius: var(--icon-radius);
       border: 2px solid var(--icon-idle);
       box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
       pointer-events: none;
       z-index: 2;
   }
   .icon-bar .skill-icon:hover::after {
       border-color: #e0e0e0;
       box-shadow: inset 0 0 0 1px #e0e0e0;
   }
   .icon-bar .skill-icon.active::after {
       border-color: var(--icon-active);
       box-shadow: 0 0 0 2px var(--icon-active), 0 0 0 4px var(--icon-active-ring);
   }
   .icon-bar .skill-icon:active:not(.active) {
       transform: translateY(1px);
   }
   @media (prefers-reduced-motion: reduce) {
       .icon-bar .skill-icon {
           transition: none;
       }
   }
   /* Title description */
   .skill-title {
       margin: 0 0 12px;
       display: flex;
       justify-content: center;
       align-items: center;
   }
   .skill-title h3 {
       margin: 0;
       width: 100%;
       text-align: center;
       font-size: 1.6em;
       color: #fff;
   }
   /* Description */
   /* Description box: remove own card background/shadow so it doesn't stack
      on top of the outer .content-card. The .content-card remains the main
      visual container. Keep padding and readable colors. */
   .desc-box {
       min-height: 28.89rem;
       height: 100%;
       padding: 12px 18px; /* slightly larger padding for breathing room */
       background: transparent; /* flatten nested box */
       border-radius: 6px;
       position: relative;
       box-shadow: none; /* remove inner shadow */
       color: #fff;
       transition: all .3s ease;
       z-index: 2; /* keep above overlay but below placeholders if needed */
       overflow: visible;
       text-shadow: none;
   }
   .desc-box h3 {
       font-size: 2.7em;
       margin: 0;
       text-align: center;
       padding-top: 0;
   }
   .desc {
       font-size: 1.22em;
       line-height: 1.6;
       letter-spacing: .01em;
       max-height: 18.8em;
       overflow-y: auto;
       margin-top: 10px;
       padding-right: 8px;
       color: #f1efe9;
   }
   .desc b,
   .desc strong {
       font-weight: 700;
       color: #fff;
   }
   .desc::-webkit-scrollbar {
       width: 7px;
       height: 7px;
   }
   .desc::-webkit-scrollbar-thumb {
       background: #156bc7;
       border-radius: 10px;
   }
   .desc::-webkit-scrollbar-track {
       background: #151515a8;
       border-radius: 10px;
   }
   /* Attributes list */
   .attrs,
   .attr-list {
       display: block;
       margin: 6px 0 12px;
   }
   .desc-box .attrs,
   .desc-box .attr-list,
   .desc-box .attrs *,
   .desc-box .attr-list * {
       text-shadow: none;
       font-family: 'Noto Sans', sans-serif;
   }
   .attrs__row,
   .attr-row {
       display: flex;
       align-items: baseline;
       gap: 8px;
       min-height: 22px;
       line-height: 1.2;
   }
   .attrs__row--empty,
   .attr-row.is-empty {
       visibility: hidden;
   }
   .attrs__label,
   .attr-label {
       font-weight: 700;
       color: #f0c87b;
       font-size: .98rem;
       white-space: nowrap;
       margin: 0;
   }
   .attrs__value,
   .attr-value {
       color: #fff;
       font-weight: 800;
       font-size: 1.08rem;
       letter-spacing: .01em;
       margin: 0;
   }


   /* remove fixed skill pane height and let content decide height */
   :root { --skill-pane-height: unset; }
   .skills-container { align-items: flex-start; }
   /* Video container: allow the video to display at its original size
      while keeping it responsive (max-width:100%). Remove extra inner
      shadows so the .content-card is the primary card. Center content. */
   .video-container {
       position: relative;
       width: 100%;
       max-width: 100%;
       background: transparent;
       display: flex;
       align-items: center;
       justify-content: center;
       border-radius: 10px;
       box-shadow: none;
       overflow: hidden; /* rounded corners */
       padding: 0;
       z-index: 2;
   }
   /* skill video: occupy column width with 16:9 aspect, cover to avoid letterboxing */
   .video-container>video {
       width: 100%;
       height: auto;
       aspect-ratio: 16 / 9;
       object-fit: cover;
       object-position: center;
       z-index: 2;
       display: block;
       border-radius: 6px;
       background: #000;
   }
   /* Center the placeholder/logo while videos load. Keep it as an overlay
      so it doesn't shift layout. */
   .video-placeholder {
       position: absolute;
       inset: 0;
       z-index: 6;
       display: flex;
       align-items: center;
       justify-content: center;
       pointer-events: none;
       opacity: 1;
       transition: opacity .28s ease;
       background: linear-gradient(rgba(0,0,0,0.0), rgba(0,0,0,0.0)); /* transparent overlay but keeps stacking context */
   }
   .video-placeholder img {
       max-width: 160px;
       width: auto;
       height: auto;
       opacity: 0.98;
       display: block;
   }
   /* fade-out helper used by JS removePlaceholder() */
   .video-placeholder.fade-out {
       opacity: 0;
   }
   @media (max-width:1100px) {
       .top-rail {
           flex-direction: column;
           align-items: stretch;
       }
       .top-rail .icon-bar {
           order: 2;
           width: 100%;
           flex-wrap: wrap;
       }
       .content-card.skills-grid { grid-template-columns: 1fr; }
   }
   @media (max-aspect-ratio: 3/4) {
        .character-header .character-art {
            display: none;
        }
       .video-container {
           width: 80%;
           border-radius: 3%;
           margin-top: 2%;
           align-self: center;
       }
   }


   /* Tiers */
   .tier-bronze .topbar-icon,
   .tier-bronze .tier {
       outline: 2px solid #7b4e2f;
   }
   .tier-silver .topbar-icon,
   .tier-silver .tier {
       outline: 2px solid #d6d2d2;
   }
   .tier-gold .topbar-icon,
   .tier-gold .tier {
       outline: 2px solid #fcd300;
   }
   .tier-diamond .topbar-icon,
   .tier-diamond .tier {
       outline: 2px solid #60dae2;
   }
   /* Top rail: created dynamically by JS; styles for tabs header */
   .top-rail {
       display:flex;
       align-items:center;
       justify-content:center;
       width:max-content;
       max-width:96vw;
       margin:8px auto;
       padding:8px 12px;
       background:rgba(0,0,0,.55);
       border:2px solid rgba(255,255,255,.08);
       border-radius:12px;
       box-shadow:0 4px 12px rgba(0,0,0,.25);
       -webkit-backdrop-filter:blur(2px);
       backdrop-filter:blur(2px);
   }
   /* hide title by default (skills rail won't show it) */
   .top-rail .rail-title { display:none; }
   /* skins variant shows the title at left */
   .top-rail.skins .rail-title {
       display:block;
       font-weight:800;
       font-size:clamp(20px,2.2vw,28px);
       color:#fff;
       margin-right:auto;
   }
   /* center icons and keep scroll behavior if overflow */
   .top-rail .icon-bar {
       width:auto;
       justify-content:center;
       margin:0;
       overflow-x:auto; /* preserve horizontal scroll */
   }
   .content-card {
       width: min(1360px, 98%);
       margin: 10px auto;
       background: #26211C;
       border-radius: 12px;
       box-shadow: 0 8px 24px rgba(0,0,0,.30);
       padding: 18px;
       z-index: 2; /* above overlay */
   }
   /* layout specific for skills card: larger grid */
   /* Make the video column wider so the video has more space. */
   .content-card.skills-grid {
       display: grid;
       grid-template-columns: 60% 40%;
       gap: 16px;
       align-items: start; /* don't stretch items vertically */
       grid-auto-rows: auto;
       margin: 10px auto 0;
   }
   @media (max-width:1100px) {
       .top-rail {
           flex-direction: column;
           align-items: stretch;
       }
       .top-rail .icon-bar {
           order: 2;
           width: 100%;
           flex-wrap: wrap;
       }
       .content-card.skills-grid { grid-template-columns: 1fr; }
   }
   /* ===========================
  Skins
  =========================== */
   .card-skins {
       border-radius: 12px;
       user-select: none;
   }
   /* Title */
   .card-skins-title {
       display: block;
       width: 100%;
       margin: 6px 0 8px;
       padding: 4px 0;
       font-family: 'Noto Sans', sans-serif;
       font-weight: 700;
       font-size: clamp(18px, 2vw, 28px);
       line-height: 1.15;
       letter-spacing: .3px;
       color: #222;
       text-align: left;
       text-shadow: none;
   }
   .skins-carousel-wrapper {
   min-height: 28.89rem;
   max-height: 60%;
   padding: 0 16px 0;
   background: transparent; /* flattened to avoid nested cards */
   border-radius: 8px;
   position: relative;
   box-shadow: none;
   color: #fff;
   transition: all .3s ease;
   display: flex;
   gap: 10px;
   justify-content: center;
   align-items: center;
   overflow: visible;
   z-index: 2;
   }
   .skins-carousel-wrapper::before,
   .skins-carousel-wrapper::after {
       content: "";
       position: absolute;
       top: 0;
       width: 60px;
       height: 100%;
       pointer-events: none;
       opacity: 0;
       transition: opacity .4s ease;
       z-index: 3;
   }
   .skins-carousel-wrapper::before {
       left: 0;
       background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
   }
   .skins-carousel-wrapper::after {
       right: 0;
       background: linear-gradient(to left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
   }
   .skins-carousel-wrapper.has-left::before,
   .skins-carousel-wrapper.has-right::after {
       opacity: 1;
   }
   .skins-carousel {
       display: flex;
       gap: 1vw;
       overflow-x: auto;
       scroll-behavior: smooth;
       padding: 10px 0;
       flex-grow: 1;
   }
   .skins-carousel::-webkit-scrollbar {
       display: none;
   }
   .has-left {
       padding-left: 60px;
   }
   .has-left .skins-carousel {
       mask-image: linear-gradient(to right, transparent 0px, black 40px, black 100%);
   }
   .has-right {
       padding-right: 60px;
   }
   .has-right .skins-carousel {
       mask-image: linear-gradient(to right, black 0px, black calc(100% - 40px), transparent 100%);
   }
   .skins-arrow {
       background: none;
       border: none;
       color: #fff;
       font-size: 36px;
       cursor: pointer;
       padding: 8px;
       z-index: 5;
       transition: opacity .3s, transform .3s;
   }
   .skins-arrow.left {
       margin-right: 8px;
   }
   .skins-arrow.right {
       margin-left: 8px;
   }
   .skins-arrow.hidden {
       opacity: 0;
       transform: scale(.8);
       pointer-events: none;
       visibility: hidden;
   }
   .skin-card {
       position: relative;
       width: 12vw;
       height: 39vh;
       flex: 0 0 auto;
       border: 2px solid #697EC9;
       border-radius: 8px;
       overflow: hidden;
       box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
       background: #111;
   }
   .skin-card::before {
       content: "";
       position: absolute;
       inset: 0;
       border-radius: inherit;
       pointer-events: none;
       z-index: 2;
       box-shadow: inset 0 0 8px rgba(180, 180, 180, .18);
   }
   .skin-banner {
       width: 100%;
       height: 109%;
   }
   .skin-banner img {
       width: 100%;
       height: 100%;
       object-fit: cover;
       filter: brightness(.5);
       transform: scale(1.1);
   }
   .skin-sprite img {
       position: absolute;
       bottom: 10px;
       left: 50%;
       transform: translateX(-50%);
       height: 140px;
       width: auto;
       z-index: 2;
       transition: transform .2s;
   }
   /* ===========================
  Responsive
  =========================== */
   @media (max-aspect-ratio: 3/4) {
       .character-header .character-art {
           display: none;
       }
       .skills-container {
           flex-direction: column-reverse;
           gap: 20px;
       }
       .skills-details {
           width: 96%;
           align-self: center;
       }
       .video-container {
           width: 80%;
           border-radius: 3%;
           margin-top: 2%;
           align-self: center;
       }
       .icon-bar {
           width: 98%;
           place-self: center;
           padding: 10px 0 16px 1px;
       }
       .skill-icon {
           width: 80px;
           height: 80px;
       }
       .desc-box {
           padding: 22px;
       }
       .desc-box h3 {
           font-size: 3.6em;
           margin-top: -14px;
       }
       .desc-box p {
           font-size: 2.3em;
           margin-bottom: 5px;
       }
       .tab-btn {
           padding: 10px 20px;
           font-size: 26px;
       }
       .tab-content {
           padding: 0 8px 20px;
           z-index: 1;
       }
       .class-tag {
           padding: 0 5px;
           font-size: 1.4em;
       }
       .skins-carousel {
           gap: 20px;
       }
       .skin-card {
           width: 236px;
           height: 400px;
       }
       .skin-sprite img {
           height: 170px;
       }
       .card-skins-title {
           width: 100%;
       }
       .skins-arrow {
           display: none;
       }
       .skins-carousel-wrapper::before,
       .skins-carousel-wrapper::after {
           background: unset;
       }
       video::-webkit-media-controls {
           opacity: unset;
           transition: unset;
       }
       video:hover::-webkit-media-controls {
           opacity: unset;
       }
   }
   @media (max-width:1100px) {
       .character-header .character-art {
           display: none !important;
       }
       .skills-container {
           flex-direction: column-reverse;
           gap: 20px;
       }
       .skills-details {
           width: 100%;
           max-width: 820px;
           align-self: center;
       }
       .video-container {
           width: 80%;
           max-width: 820px;
           border-radius: 3%;
           margin-top: 2%;
           align-self: center;
       }
       .icon-bar {
           width: 100%;
           place-self: center;
           padding: 10px 0 16px 1px;
       }
       .skill-icon {
           width: 80px;
           height: 80px;
       }
       .tab-btn {
           padding: 10px 20px;
           font-size: 26px;
       }
       .tab-content {
           padding: 0 8px 20px;
           z-index: 1;
       }
   }

</style>