미디어위키:Template.css: 두 판 사이의 차이

편집 요약 없음
태그: 되돌려진 기여
(Nxdsxn (토론)의 1643 판 편집을 되돌림)
태그: 편집 취소
1번째 줄: 1번째 줄:
mw.loader.load('https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.13/cropper.min.js');
@import url('/index.php?title=MediaWiki:Template.Infobox.css&action=raw&ctype=text/css');


function loadLangScript(done) {
/* =========================================
    $.getScript('/index.php?title=미디어위키:Lang.js&action=raw&ctype=text/javascript')
  Proitem Animation
        .done(function() {
  ========================================= */
            if (typeof done === 'function') done();
        })
        .fail(function(a, b, c) {
            console.error('Lang.js load failed:', b, c);
            if (typeof done === 'function') done();
        });
}


$(function() {
.wip-stripe-layer {
     $('body').prepend(
     position: absolute;
        '<div class="WW-bg" style="position:fixed;top:0;left:0;width:100%;height:100vh;"></div>'
    top: 0;
    left: -280px;
    width: calc(100% + 560px);
    height: 100%;
    opacity: 0.08;
    background: repeating-linear-gradient(
        45deg,
        #969696,
        #969696 10px,
        transparent 10px,
        transparent 20px
     );
     );
});
    z-index: 0;
}


// 페이지 전환 사운드
.wip-active .wip-stripe-layer {
var transitionSound = new Audio('/index.php?title=특수:Redirect/file/Sfx-ui-001.mp3');
    animation: wip-stripe-move 8s linear infinite;
}


(function() {
.wip-standby .wip-stripe-layer {
    var master = parseFloat(localStorage.getItem('clbi-audio-master') || 80) / 100;
     animation: none;
    var sfx = parseFloat(localStorage.getItem('clbi-audio-sfx') || 60) / 100;
}
     var sfxOn = localStorage.getItem('clbi-audio-sfxOn') !== 'false';
    transitionSound.volume = sfxOn ? master * sfx : 0;
})();


function playStaticSound() {
@keyframes wip-stripe-move {
     var master = parseFloat(localStorage.getItem('clbi-audio-master') || 80) / 100;
     from { transform: translateX(0); }
     var sfx = parseFloat(localStorage.getItem('clbi-audio-sfx') || 60) / 100;
     to { transform: translateX(280px); }
    var sfxOn = localStorage.getItem('clbi-audio-sfxOn') !== 'false';
}


    if (!sfxOn) return;
/* =========================================
  Collapsible
  ========================================= */


     transitionSound.volume = master * sfx;
[id^="collapsible"] {
     transitionSound.currentTime = 0;
     overflow: hidden;
     transitionSound.play();
     transition: max-height .25s ease;
     max-height: 0;
}
}


// 현재 언어 감지
/* =========================================
function getCurrentLang() {
  Color
    var langData = document.getElementById('clbi-lang-data');
  ========================================= */
    return langData ? (langData.getAttribute('data-lang') || 'ko') : 'ko';
}


function normalizePageName(value) {
.color-text {
     return String(value || '')
     color: var(--text-color);
        .split('?')[0]
        .replace(/^\/index\.php\//, '')
        .replace(/_/g, ' ')
        .trim();
}
}


function buildWikiPath(title) {
.color-text a,
     return '/index.php/' + encodeURI(String(title || '').replace(/ /g, '_'));
.color-text a:visited,
.color-text a:hover,
.color-text a:active {
     color: var(--text-color) !important;
    text-decoration-color: var(--text-color) !important;
}
}


// 국가_및_조합 전용 왼쪽 사이드바 이미지
/* =========================================
function updateLeftSidebarNationsImage() {
  CRT Glitch Panel
    var imageId = 'clbi-left-nations-image';
  ========================================= */


     // SPA 이동 시 이전 문서에서 삽입했던 이미지를 먼저 제거한다.
.crt-glitch-panel {
     // 이 처리가 없으면 국가_및_조합에서 다른 문서로 이동했을 때 이미지가 남을 수 있다.
    position: relative;
     $('#' + imageId).remove();
     overflow: hidden;
    isolation: isolate;
     border-radius: 5px;
     box-shadow:
        inset 0 0 18px rgba(255,255,255,0.04),
        inset 0 0 42px rgba(133,67,105,0.10),
        0 0 18px rgba(133,67,105,0.20);
}


     // 현재 문서명이 국가 및 조합일 때만 삽입한다.
.crt-glitch-panel .vanishing-grid-bg {
     // wgPageName은 보통 국가_및_조합처럼 언더스코어를 포함하므로 normalizePageName으로 통일해서 비교한다.
     position: relative;
     var pageName = normalizePageName(mw.config.get('wgPageName'));
    overflow: hidden;
    var targetPage = normalizePageName('국가_및_조합');
     border-radius: 5px;
     background:
        radial-gradient(circle at 50% 45%, rgba(212,90,162,0.18) 0%, transparent 32%),
        linear-gradient(to bottom, #111 0%, #090909 58%, #030303 100%) !important;
}


    if (pageName !== targetPage) {
.crt-glitch-panel > * {
        return;
    position: relative;
     }
     z-index: 2;
}


     var $leftSidebar = $('#clbi-left-sidebar');
.crt-glow-content {
    position: relative;
     z-index: 2;
    text-shadow:
        -1px 0 0 rgba(80,160,255,0.75),
        1px 0 0 rgba(255,55,90,0.65),
        2px 0 0 rgba(255,210,70,0.45),
        0 0 2px rgba(255,255,255,0.35),
        0 0 6px rgba(212,90,162,0.22),
        0 0 12px rgba(133,67,105,0.18);
    filter: drop-shadow(0 0 5px rgba(212,90,162,0.18));
}


     if (!$leftSidebar.length) {
.crt-glow-content::before {
         return;
     content: "";
     }
    position: absolute;
    inset: -24px;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(
            circle at 50% 35%,
            rgba(255,255,255,0.08) 0%,
            rgba(212,90,162,0.10) 18%,
            rgba(133,67,105,0.08) 34%,
            transparent 68%
         );
    filter: blur(18px);
     opacity: 0.75;
}


     // 왼쪽 사이드바 기본 자식 순서:
.crt-glitch-panel .fake-h1,
    // 0 = 언어 섹션, 1 = 카테고리 섹션.
.crt-glitch-panel h1,
    // 이미지는 카테고리 섹션 바로 아래에 삽입한다.
.crt-glitch-panel h2,
    var $categoryBox = $leftSidebar.children('.clbi-left-box').eq(1);
.crt-glitch-panel strong {
     text-shadow:
        -1px 0 0 rgba(80,160,255,0.95),
        1px 0 0 rgba(255,55,90,0.85),
        2px 0 0 rgba(255,210,70,0.55),
        0 0 3px rgba(255,255,255,0.65),
        0 0 10px rgba(255,255,255,0.28),
        0 0 18px rgba(212,90,162,0.35),
        0 0 32px rgba(133,67,105,0.24);
}


     if (!$categoryBox.length) {
.crt-glitch-panel img {
         return;
     filter:
    }
        drop-shadow(-1px 0 0 rgba(80,160,255,0.65))
        drop-shadow(1px 0 0 rgba(255,55,90,0.55))
        drop-shadow(2px 0 0 rgba(255,210,70,0.35))
         drop-shadow(0 0 6px rgba(212,90,162,0.18));
}


    // 컨테이너나 테두리를 추가하지 않고 img 요소만 넣는다.
.crt-glitch-panel::before {
     // 실제 파일을 바꾸려면 Redirect/file 뒤 파일명만 교체하면 된다.
     content: "";
     $categoryBox.after(
     position: absolute;
        '<img id="' + imageId + '" ' +
    inset: -80px 0;
        'class="clbi-left-page-image" ' +
    z-index: 3;
        'src="/index.php?title=특수:Redirect/file/img-nations-sidebar-001.png" ' +
    pointer-events: none;
         'alt="" loading="lazy">'
    opacity: 0.22;
     );
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,0.08) 0px,
            rgba(255,255,255,0.08) 1px,
            transparent 2px,
            transparent 5px
         );
    mix-blend-mode: screen;
     animation: crt-scanlines-up 7s linear infinite;
}
}


// 사이드바 업데이트
.crt-glitch-panel::after {
function updateSidebar() {
    content: "";
    if (!window.LANG || !window.LANG_NAMES || !window.CAT_LINKS) {
    position: absolute;
         setTimeout(updateSidebar, 100);
    inset: 0;
        return;
    z-index: 4;
     }
    pointer-events: none;
    opacity: 0;
    background:
        linear-gradient(
            to bottom,
            transparent 0%,
            rgba(255,255,255,0.18) 48%,
            rgba(212,90,162,0.28) 50%,
            rgba(90,120,255,0.16) 52%,
            transparent 56%
         );
    mix-blend-mode: screen;
     animation: crt-glitch-band-up 6.5s steps(1, end) infinite;
}


    var langData = document.getElementById('clbi-lang-data');
/* =========================================
    var currentLang = getCurrentLang();
  Horizontal CRT Warp
    var t = (window.LANG && window.LANG[currentLang]) ? window.LANG[currentLang] : window.LANG.ko;
  ========================================= */
    var names = (window.LANG_NAMES && window.LANG_NAMES[currentLang]) ? window.LANG_NAMES[currentLang] : window.LANG_NAMES.ko;
    var cl = (window.CAT_LINKS && window.CAT_LINKS[currentLang]) ? window.CAT_LINKS[currentLang] : window.CAT_LINKS.ko;


    var allLangs = langData ? {
.crt-horizontal-warp {
        ko: langData.getAttribute('data-ko') || '',
    position: relative;
        en: langData.getAttribute('data-en') || '',
    overflow: hidden;
        zh: langData.getAttribute('data-zh') || '',
     isolation: isolate;
        ja: langData.getAttribute('data-ja') || ''
}
     } : {
        ko: '',
        en: '',
        zh: '',
        ja: ''
    };


     $('#clbi-lang-current').text(names[currentLang]);
.crt-horizontal-warp .crt-glow-content {
     animation: crt-base-drift 9s steps(1, end) infinite;
    background-image:
        repeating-linear-gradient(
            to bottom,
            rgba(120,180,255,0.00) 0px,
            rgba(120,180,255,0.00) 3px,
            rgba(120,180,255,0.05) 4px,
            rgba(255,80,170,0.035) 5px,
            rgba(120,180,255,0.00) 7px
        );
    background-blend-mode: screen;
}


     var langHtml = '';
.crt-horizontal-warp .crt-glow-content::after {
     $.each(['ko', 'en', 'zh', 'ja'], function(i, lang) {
    content: "";
         if (lang === currentLang) return;
    position: absolute;
     inset: 0;
     z-index: 6;
    pointer-events: none;
    opacity: 0;
    background:
        linear-gradient(
            to right,
            transparent 0%,
            rgba(120,180,255,0.18) 10%,
            rgba(255,255,255,0.18) 48%,
            rgba(212,90,162,0.20) 78%,
            transparent 100%
         );
    mix-blend-mode: screen;
    animation: crt-wide-horizontal-tear 3.8s steps(1, end) infinite;
}


        var target = allLangs[lang];
/* =========================================
        if (target) {
  CRT Animations
            langHtml += '<div class="clbi-lang-link"><a href="' + buildWikiPath(target) + '?uselang=' + lang + '">' + names[lang] + '</a></div>';
  ========================================= */
        } else {
            langHtml += '<div class="clbi-lang-wip">' + names[lang] + '</div>';
        }
    });
    $('#clbi-lang-list').html(langHtml);


    $('#clbi-title-language').text(t.language);
@keyframes crt-scanlines-up {
    $('#clbi-title-categories').text(t.categories);
     from {
    $('#clbi-title-links').text(t.links);
        transform: translateY(0);
    $('#clbi-title-search a').text(t.search);
     }
    $('#clbi-search-input').attr('placeholder', t.search + '...');
     $('#clbi-title-recent a').text(t.recentChanges);
    $('#clbi-title-guide').text(t.guide);
     $('#clbi-guide-link').text(t.getStarted);
    $('#clbi-title-playlist').text(t.playlist);


     $('#clbi-cat-main a').attr('href', buildWikiPath(cl.main));
     to {
     $('#clbi-cat-main .clbi-cat-label').text(t.mainMenu);
        transform: translateY(-80px);
     }
}


    $('#clbi-cat-nations a').attr('href', buildWikiPath(cl.nations));
@keyframes crt-glitch-band-up {
     $('#clbi-cat-nations .clbi-cat-label').text(t.nations);
    0%, 12%, 27%, 43%, 58%, 76%, 100% {
        opacity: 0;
        transform: translateY(100%);
     }


     $('#clbi-cat-corporations a').attr('href', buildWikiPath(cl.corporations));
     13% {
     $('#clbi-cat-corporations .clbi-cat-label').text(t.corporations);
        opacity: 0.75;
        transform: translateY(70%);
     }


     $('#clbi-cat-military a').attr('href', buildWikiPath(cl.military));
     14% {
    $('#clbi-cat-military .clbi-cat-label').text(t.military);
        opacity: 0.15;
        transform: translateY(62%) skewX(-2deg);
    }


     $('#clbi-cat-history a').attr('href', buildWikiPath(cl.history));
     28% {
     $('#clbi-cat-history .clbi-cat-label').text(t.history);
        opacity: 0.55;
        transform: translateY(35%);
     }


     $('#clbi-cat-personnel a').attr('href', buildWikiPath(cl.personnel));
     29% {
    $('#clbi-cat-personnel .clbi-cat-label').text(t.personnel);
        opacity: 0.18;
        transform: translateY(28%) skewX(2deg);
    }


     $('#clbi-btn-contribution').text(t.contribution);
     44% {
    $('#clbi-btn-watchlist').text(t.watchlist);
        opacity: 0.65;
    $('#clbi-btn-preferences').text(t.preferences);
        transform: translateY(10%);
    $('#clbi-btn-logout').text(t.logout);
     }
     $('#clbi-btn-login').text(t.login);


     var pageName = normalizePageName(mw.config.get('wgPageName'));
     45% {
     var specialPage = String(mw.config.get('wgCanonicalSpecialPageName') || '');
        opacity: 0.12;
        transform: translateY(4%) skewX(-1deg);
     }


     $('.clbi-cat-btn').removeClass('clbi-cat-active');
     59% {
    $.each(['main', 'nations', 'corporations', 'military', 'history', 'personnel'], function(i, key) {
        opacity: 0.5;
         if (cl[key] && pageName === normalizePageName(cl[key])) {
         transform: translateY(-20%);
            $('#clbi-cat-' + key).addClass('clbi-cat-active');
     }
        }
     });


     $('.clbi-user-btn').removeClass('clbi-user-btn-active');
     60% {
 
         opacity: 0.16;
    if (
         transform: translateY(-26%) skewX(2deg);
         specialPage === 'Contributions' ||
        specialPage === '기여' ||
        pageName.indexOf('특수:기여') === 0 ||
         pageName.indexOf('Special:Contributions') === 0
    ) {
        $('#clbi-btn-contribution').addClass('clbi-user-btn-active');
     }
     }


     if (specialPage === 'Watchlist') {
     77% {
         $('#clbi-btn-watchlist').addClass('clbi-user-btn-active');
         opacity: 0.55;
        transform: translateY(-55%);
     }
     }


     if (
     78% {
        specialPage === '설정' ||
         opacity: 0;
         pageName === '특수:설정' ||
         transform: translateY(-70%);
         pageName === 'Special:설정'
    ) {
        $('#clbi-btn-preferences').addClass('clbi-user-btn-active');
     }
     }
    $('.toggleBtn').each(function() {
        var btn = $(this);
        if (!$('#' + btn.data('target')).hasClass('folding-open')) {
            btn.text(t.expand);
        } else {
            btn.text(t.collapse);
        }
    });
    // 왼쪽 사이드바의 문서별 전용 삽입물을 갱신한다.
    // 현재는 국가_및_조합 문서에서만 카테고리 섹션 아래 이미지를 삽입한다.
    updateLeftSidebarNationsImage();
}
}


function canShowContentTools() {
@keyframes crt-base-drift {
     // 비로그인 사용자는 편집/역사/공유 버튼을 숨김
     0%, 88%, 100% {
    if (!mw.config.get('wgUserName')) {
        transform: translateX(0);
        return false;
        filter: drop-shadow(0 0 5px rgba(212,90,162,0.18));
     }
     }


     // MediaWiki가 현재 문서를 편집 가능하지 않다고 판단하면 숨김
     89% {
    var isEditable = mw.config.get('wgIsProbablyEditable');
        transform: translateX(-2px) skewX(-0.4deg);
    if (isEditable === false) {
        filter:
        return false;
            contrast(1.08)
            brightness(1.05)
            drop-shadow(0 0 7px rgba(212,90,162,0.24));
     }
     }


     var relevantEditable = mw.config.get('wgRelevantPageIsProbablyEditable');
     90% {
    if (relevantEditable === false) {
        transform: translateX(3px) skewX(0.5deg);
        return false;
     }
     }


     return true;
     91% {
}
        transform: translateX(-1px);
    }


function moveCatlinksToBottom() {
     92% {
    var main = $('.liberty-content-main');
         transform: translateX(0);
    var parserOutput = $('.liberty-content-main .mw-parser-output').first();
         filter: drop-shadow(0 0 5px rgba(212,90,162,0.18));
    var catlinks = $('.catlinks');
     }
 
     if (!main.length || !catlinks.length) return;
 
    catlinks.each(function () {
         var cat = $(this);
 
         if (parserOutput.length) {
            cat.appendTo(parserOutput);
        } else {
            cat.appendTo(main);
        }
     });
}
}


// 대문 스타일
@keyframes crt-wide-horizontal-tear {
function applyMainPageStyle() {
    0%, 8%, 17%, 29%, 43%, 61%, 78%, 100% {
    var specialPage = mw.config.get('wgCanonicalSpecialPageName');
        opacity: 0;
    if (specialPage === 'Preferences') return;
        transform: translateX(0);
        clip-path: inset(0 0 0 0);
    }


     var pageName = normalizePageName(mw.config.get('wgPageName'));
     9% {
    var hideTools = (pageName === '대문' || !canShowContentTools());
        opacity: 0.45;
        transform: translateX(-18px) skewX(-3deg);
        clip-path: inset(18% 0 70% 0);
    }


     // 모든 문서에서 분류 바를 본문 컨테이너 아래로 이동
     10% {
    moveCatlinksToBottom();
        opacity: 0.28;
        transform: translateX(24px) skewX(4deg);
        clip-path: inset(21% 0 64% 0);
    }


     if (pageName === '대문') {
     18% {
         $('.liberty-content-header').css('display', 'none');
         opacity: 0.38;
        $('.mw-page-title-main').addClass('clbi-hide');
         transform: translateX(32px) skewX(5deg);
         $('.catlinks').css('display', 'none');
         clip-path: inset(42% 0 47% 0);
         $('.liberty-content-main').css('border-radius', '5px 5px 0 0');
    }


         if ($('#clbi-main-logo').length === 0) {
    19% {
            $('.liberty-content').prepend(
         opacity: 0.16;
                '<div id="clbi-main-logo" style="text-align:center;padding:10px 0;">' +
        transform: translateX(-28px) skewX(-4deg);
                '<img src="/index.php?title=특수:Redirect/file/Img-clbi-001.png" style="width:900px;height:auto;">' +
        clip-path: inset(46% 0 43% 0);
                '</div>'
    }
            );
        }


         if ($('#clbi-main-crt-hero').length && $('#clbi-main-crt-hero-wrap').length === 0) {
    30% {
            var heroWrap = $('<div id="clbi-main-crt-hero-wrap"></div>');
        opacity: 0.48;
         transform: translateX(-36px) skewX(-6deg);
        clip-path: inset(58% 0 30% 0);
    }


            if ($('#clbi-main-logo').length) {
    31% {
                heroWrap.insertAfter('#clbi-main-logo');
        opacity: 0.18;
            } else {
        transform: translateX(20px) skewX(3deg);
                heroWrap.insertBefore('.liberty-content-main');
        clip-path: inset(61% 0 27% 0);
            }
    }


            $('#clbi-main-crt-hero').appendTo('#clbi-main-crt-hero-wrap');
    44% {
         }
         opacity: 0.36;
} else if ($('.screen-header').length > 0) {
         transform: translateX(18px) skewX(3deg);
        $('.liberty-content-header').css('display', 'none');
         clip-path: inset(8% 0 84% 0);
         $('.mw-page-title-main').addClass('clbi-hide');
    }
         $('.catlinks').css('display', '');
        $('.liberty-content-main').css('border-radius', '5px');
        $('#clbi-main-logo').remove();
        $('#clbi-main-crt-hero-wrap').remove();


         if ($('#clbi-tools-box').length === 0 && canShowContentTools()) {
    45% {
            var $toolsBox = $('<div id="clbi-tools-box" class="clbi-left-box"></div>');
         opacity: 0.12;
            var $toolsTitle = $('<div class="clbi-left-title"><span class="clbi-icon" style="--icon:var(--ic-ui-003)"></span> 관리</div>');
        transform: translateX(-14px) skewX(-2deg);
            var $toolsContent = $('<div class="clbi-left-content"></div>');
        clip-path: inset(11% 0 80% 0);
            $toolsContent.append($('.content-tools .btn-group').clone(true));
    }
            $toolsBox.append($toolsTitle).append($toolsContent);
            $('#clbi-left-sidebar').append($toolsBox);
        }


        $('.content-tools').css('display', 'none');
     62% {
        $('.liberty-content').addClass('content-tools-hidden');
         opacity: 0.44;
     } else {
         transform: translateX(-42px) skewX(-7deg);
         $('.liberty-content-header').css('display', '');
         clip-path: inset(73% 0 16% 0);
        $('.mw-page-title-main').removeClass('clbi-hide');
        $('.catlinks').css('display', '');
        $('.liberty-content-main').css('border-radius', '');
         $('#clbi-main-logo').remove();
        $('#clbi-main-crt-hero-wrap').remove();
         $('#clbi-tools-box').remove();
     }
     }
        $('.liberty-content-header').css('display', '');
 
        $('.mw-page-title-main').removeClass('clbi-hide');
    63% {
        $('.catlinks').css('display', '');
         opacity: 0.18;
         $('.liberty-content-main').css('border-radius', '');
         transform: translateX(30px) skewX(4deg);
         $('#clbi-main-logo').remove();
         clip-path: inset(76% 0 12% 0);
         $('#clbi-main-crt-hero-wrap').remove();
     }
     }


     if (hideTools) {
     79% {
         $('.content-tools').css('display', 'none');
         opacity: 0.42;
         $('.liberty-content').addClass('content-tools-hidden');
         transform: translateX(26px) skewX(4deg);
    } else {
         clip-path: inset(31% 0 58% 0);
         $('.content-tools').css('display', '');
        $('.liberty-content').removeClass('content-tools-hidden');
     }
     }


     updateSidebar();
     80% {
        opacity: 0.14;
        transform: translateX(-20px) skewX(-3deg);
        clip-path: inset(34% 0 54% 0);
    }
}
}


// 본문 기본 목차 제거
/* =========================================
function removeNativeTocFromContent() {
  Retro Horizon Grid Background
     $('.liberty-content-main #toc, .liberty-content-main .toc').remove();
  ========================================= */
 
.retro-grid-bg {
     position: relative;
    overflow: hidden;
    border-radius: 5px;
    background:
        linear-gradient(
            to bottom,
            rgba(13, 6, 19, 0.98) 0%,
            rgba(25, 9, 33, 0.82) 44%,
            rgba(53, 19, 56, 0.50) 60%,
            rgba(4, 4, 7, 0.96) 61%,
            rgba(2, 2, 4, 1) 100%
        ) !important;
}
}


// 왼쪽 목차: MediaWiki 문단 ID 가져오기
.retro-grid-bg .crt-glow-content {
function getHeadingId(heading) {
     position: relative;
     if (heading.id) {
    z-index: 5;
        return heading.id;
}
    }


     var headline = heading.querySelector('.mw-headline[id]');
.retro-grid-bg::before {
     if (headline && headline.id) {
    content: "";
        return headline.id;
     position: absolute;
    }
    left: -10%;
    right: -10%;
    top: 56%;
    height: 16%;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(
            ellipse at 50% 50%,
            rgba(230,210,225,0.28) 0%,
            rgba(204,94,168,0.30) 20%,
            rgba(184,56,142,0.20) 44%,
            transparent 76%
        );
     filter: blur(9px);
    opacity: 0.68;
}


     return '';
.retro-grid-bg::after {
     content: "";
    position: absolute;
    left: 50%;
    top: 61%;
    width: 150%;
    height: 115%;
    z-index: 2;
    pointer-events: none;
    background-image:
        linear-gradient(
            to right,
            rgba(204,64,156,0.72) 1px,
            transparent 1px
        ),
        linear-gradient(
            to bottom,
            rgba(204,64,156,0.70) 1px,
            transparent 1px
        );
    background-size:
        48px 100%,
        100% 26px;
    transform-origin: 50% 0%;
    transform:
        translateX(-50%)
        perspective(430px)
        rotateX(66deg);
    opacity: 0.78;
    filter:
        drop-shadow(0 0 3px rgba(204,64,156,0.58))
        drop-shadow(0 0 10px rgba(204,64,156,0.30));
    animation: retro-grid-flow 1.8s linear infinite;
    mask-image:
        linear-gradient(
            to bottom,
            transparent 0%,
            black 4%,
            black 82%,
            transparent 100%
        );
    -webkit-mask-image:
        linear-gradient(
            to bottom,
            transparent 0%,
            black 4%,
            black 82%,
            transparent 100%
        );
}
}


// 왼쪽 목차: MediaWiki 문단 제목 텍스트 가져오기
.retro-grid-bg .crt-glow-content::before {
function getHeadingText(heading) {
    content: "";
    var headline = heading.querySelector('.mw-headline');
    position: absolute;
     var source = headline || heading;
    inset: -42px;
     var clone = source.cloneNode(true);
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(
            ellipse at 50% 56%,
            rgba(220,220,225,0.05) 0%,
            rgba(204,64,156,0.07) 22%,
            rgba(96,152,204,0.05) 42%,
            transparent 70%
        );
     filter: blur(20px);
     opacity: 0.52;
}


    $(clone).find('.mw-editsection, .mw-editsection-bracket, .mw-editsection-divider').remove();
@keyframes retro-grid-flow {
    from {
        background-position:
            0 0,
            0 0;
    }


     return (clone.textContent || '')
     to {
         .replace(/\s+/g, ' ')
         background-position:
        .trim();
            0 0,
            0 -26px;
    }
}
}


// 왼쪽 목차: 긴 제목에 자동 스크롤 적용
/* =========================================
function initTocTitleScroll(root) {
  CRT Monitor Frame
    var $items = root
  ========================================= */
        ? $(root).find('.toc-scroll-text')
        : $('#side-toc-box .toc-scroll-text');


     $items.each(function () {
.crt-monitor-frame {
         var $text = $(this);
    position: relative;
         var $wrap = $text.closest('.toc-scroll-wrap');
    box-sizing: border-box;
    padding: 34px 46px 38px 46px;
    border-radius: 22px;
    background:
        linear-gradient(145deg, #303030 0%, #181818 22%, #080808 58%, #202020 100%);
    border: 2px solid #2f2f2f;
     box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.18),
        inset 0 -3px 0 rgba(0,0,0,0.85),
        inset 3px 0 0 rgba(255,255,255,0.06),
        inset -3px 0 0 rgba(0,0,0,0.75),
        0 0 0 3px #050505,
        0 0 0 5px #242424,
         0 12px 20px rgba(0,0,0,0.62),
         0 24px 42px rgba(0,0,0,0.52),
        0 42px 70px rgba(0,0,0,0.34);
}


         if (!$wrap.length) return;
.crt-monitor-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 22px;
    pointer-events: none;
    opacity: 0.16;
    background:
        repeating-linear-gradient(
            135deg,
            rgba(255,255,255,0.035) 0px,
            rgba(255,255,255,0.035) 1px,
            transparent 1px,
            transparent 5px
         ),
        radial-gradient(
            ellipse at 28% 12%,
            rgba(255,255,255,0.12) 0%,
            transparent 45%
        );
    mix-blend-mode: screen;
}


        var wrapW = Math.floor($wrap.width());
.crt-monitor-frame::after {
        var textW = Math.ceil(this.scrollWidth);
    content: none;
}


         // 왼쪽 목차: 레이아웃 계산이 끝나지 않았으면 이번 실행에서는 건드리지 않는다.
.crt-monitor-inner {
         if (!wrapW || !textW) return;
    position: relative;
    box-sizing: border-box;
    padding: 18px;
    border-radius: 16px;
    background:
         linear-gradient(145deg, #050505 0%, #111 44%, #070707 100%);
    border: 1px solid #050505;
    box-shadow:
        inset 0 5px 14px rgba(0,0,0,0.95),
        inset 0 -2px 4px rgba(255,255,255,0.06),
        inset 4px 0 10px rgba(0,0,0,0.85),
         inset -4px 0 10px rgba(0,0,0,0.85),
        0 1px 0 rgba(255,255,255,0.12);
}


         if (textW <= wrapW + 12) {
.crt-monitor-screen {
            // 왼쪽 목차: 칸을 넘지 않는 제목은 전체 텍스트를 그대로 보여준다.
    position: relative;
            $wrap.removeClass('is-scrolling');
    overflow: hidden;
    border-radius: 9px / 18px;
    background: #050505;
    border: 2px solid #050505;
    box-shadow:
        inset 0 0 0 2px #151515,
         inset 0 0 22px rgba(0,0,0,0.95),
        inset 0 0 48px rgba(0,0,0,0.75),
        0 0 0 1px rgba(255,255,255,0.08),
        0 0 18px rgba(133,67,105,0.18);
}


            if ($text.data('toc-scroll-enabled')) {
.crt-monitor-screen::before {
                $text.css({
    content: "";
                    animation: '',
    position: absolute;
                    'animation-delay': '',
    inset: 0;
                    '--scroll-dist': ''
    z-index: 20;
                });
    pointer-events: none;
                $text.removeData('toc-scroll-enabled');
    border-radius: 9px / 18px;
                $text.removeData('toc-scroll-key');
    background:
            }
        radial-gradient(
            ellipse at 50% 50%,
            transparent 0%,
            transparent 58%,
            rgba(0,0,0,0.22) 82%,
            rgba(0,0,0,0.58) 100%
        ),
        linear-gradient(
            105deg,
            transparent 0%,
            rgba(255,255,255,0.05) 18%,
            transparent 38%,
            transparent 100%
        );
    box-shadow:
        inset 0 0 28px rgba(255,255,255,0.04),
        inset 0 0 60px rgba(0,0,0,0.65);
}


            return;
.crt-monitor-screen .crt-glitch-panel,
        }
.crt-monitor-screen .retro-grid-bg {
    border-radius: 8px / 16px;
}


        var scrollDist = '-' + (textW - wrapW + 10) + 'px';
.crt-monitor-screen .crt-glitch-panel {
        var duration = Math.max(7, textW / 38) * 1.25;
    box-shadow: none;
        var scrollKey = scrollDist + '|' + duration;
}


        // 왼쪽 목차: 긴 제목에는 오른쪽 페이드와 스크롤을 적용한다.
#clbi-main-crt-hero-wrap {
        $wrap.addClass('is-scrolling');
    width: 100%;
    margin: 0 auto 14px auto;
}


        // 왼쪽 목차: 같은 값으로 이미 적용된 애니메이션은 다시 초기화하지 않는다.
#clbi-main-crt-hero {
        if ($text.data('toc-scroll-key') === scrollKey) {
    width: 100%;
            return;
}
        }


        $text.data('toc-scroll-enabled', true);
/* =========================================
        $text.data('toc-scroll-key', scrollKey);
  Compact CRT Media Frame
  ========================================= */


        $text.css({
.compact-crt-media {
            // 왼쪽 목차: 페이지 진입 직후에는 잠시 읽을 시간을 준 뒤 흐르게 한다.
    position: relative;
            animation: 'toc-scroll-blink-reset ' + duration + 's linear infinite',
    box-sizing: border-box;
             'animation-delay': '1s',
    width: fit-content;
            '--scroll-dist': scrollDist
    max-width: 100%;
         });
    margin: 6px auto;
     });
    padding: 10px 14px;
    border-radius: 10px;
    background:
        linear-gradient(
            145deg,
            #242424 0%,
            #141414 34%,
            #070707 70%,
             #171717 100%
        );
    border: 1px solid #2b2b2b;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.12),
        inset 0 -2px 0 rgba(0,0,0,0.82),
        inset 2px 0 0 rgba(255,255,255,0.035),
        inset -2px 0 0 rgba(0,0,0,0.62),
        0 0 0 2px #050505,
        0 0 0 3px #242424,
         0 4px 12px rgba(0,0,0,0.68);
     overflow: hidden;
}
}


// 목차를 왼쪽 사이드바에 새로 생성
.compact-crt-media .mw-default-size,
function moveTocToLeftSidebar() {
.compact-crt-media .mw-file-element,
     // 왼쪽 목차: MediaWiki가 만든 원래 목차는 본문에서 제거한다.
.compact-crt-media img {
     removeNativeTocFromContent();
     position: relative;
     z-index: 1;
}


     var leftSidebar = document.getElementById('clbi-left-sidebar');
.compact-crt-media img {
     if (!leftSidebar) return;
    max-width: 100%;
     height: auto;
    filter:
        drop-shadow(0 1px 3px rgba(0,0,0,0.72))
        drop-shadow(0 0 4px rgba(255,255,255,0.06));
     animation: compact-crt-image-jitter 1.25s steps(1, end) infinite;
}


     var content =
.compact-crt-media::before {
         document.querySelector('.liberty-content-main .mw-parser-output') ||
     content: "";
         document.querySelector('.liberty-content-main');
    position: absolute;
    inset: 6px;
    z-index: 3;
    border-radius: 7px;
    pointer-events: none;
    background:
         radial-gradient(
            ellipse at 50% 50%,
            transparent 0%,
            transparent 54%,
            rgba(0,0,0,0.20) 78%,
            rgba(0,0,0,0.58) 100%
        ),
        linear-gradient(
            105deg,
            transparent 0%,
            rgba(255,255,255,0.040) 18%,
            transparent 38%,
            transparent 100%
        ),
        linear-gradient(
            to bottom,
            rgba(255,255,255,0.030) 0%,
            transparent 34%,
            rgba(0,0,0,0.26) 100%
        );
    box-shadow:
        inset 0 0 18px rgba(255,255,255,0.028),
         inset 0 0 38px rgba(0,0,0,0.66);
}


     if (!content) return;
.compact-crt-media::after {
     content: "";
    position: absolute;
    inset: 6px;
    z-index: 4;
    border-radius: 7px;
    pointer-events: none;
    opacity: 0.34;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,0.070) 0px,
            rgba(255,255,255,0.070) 1px,
            transparent 2px,
            transparent 4px
        );
    mix-blend-mode: screen;
}


     var headings = Array.prototype.slice.call(
.compact-crt-static {
        content.querySelectorAll('h2, h3')
    position: absolute;
    ).filter(function (heading) {
    inset: 6px;
        if (heading.closest('#toc, .toc, #side-toc-box')) return false;
     z-index: 5;
    border-radius: 7px;
    pointer-events: none;
    opacity: 0.30;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 4px,
            rgba(255,255,255,0.10) 5px,
            transparent 6px,
            transparent 10px
        ),
        linear-gradient(
            to bottom,
            transparent 0%,
            transparent 43%,
            rgba(255,255,255,0.11) 49%,
            rgba(180,180,180,0.08) 50%,
            rgba(90,90,90,0.08) 51%,
            transparent 56%,
            transparent 100%
        );
    mix-blend-mode: screen;
    animation:
        compact-crt-static-roll 3.8s linear infinite,
        compact-crt-static-flicker 1.7s steps(1, end) infinite;
}


        var id = getHeadingId(heading);
.compact-crt-media:hover::after {
        var text = getHeadingText(heading);
    opacity: 0.40;
}


        if (!id || !text) return false;
.compact-crt-media:hover .compact-crt-static {
    opacity: 0.36;
}


        return true;
.compact-crt-media:hover img {
     });
     filter:
 
        drop-shadow(0 1px 3px rgba(0,0,0,0.78))
    var tocKey = headings.map(function (heading) {
         drop-shadow(0 0 5px rgba(255,255,255,0.08));
         return getHeadingId(heading) + '|' + getHeadingText(heading);
}
    }).join('||');


    var existingBox = document.getElementById('side-toc-box');
@keyframes compact-crt-static-roll {
 
     from {
     // 왼쪽 목차: 같은 문서에서 같은 목차를 이미 만들었다면 다시 지우고 만들지 않는다.
        background-position:
    if (existingBox && existingBox.getAttribute('data-toc-key') === tocKey) {
            0 0,
        initTocTitleScroll(existingBox);
            0 110%;
        return;
     }
     }


     if (existingBox) {
     to {
         existingBox.remove();
         background-position:
            0 -32px,
            0 -30%;
     }
     }
    if (!headings.length) return;
    var tocBox = document.createElement('div');
    tocBox.className = 'clbi-left-box';
    tocBox.id = 'side-toc-box';
    tocBox.setAttribute('data-toc-key', tocKey);
    var title = document.createElement('div');
    title.className = 'clbi-left-title';
    // 왼쪽 목차: 박스 제목은 Lang.js의 현재 UI 언어를 따른다.
    var currentLang = getCurrentLang();
    var t = (window.LANG && window.LANG[currentLang]) ? window.LANG[currentLang] : window.LANG.ko;
    var tocTitleText = (t && t.toc) ? t.toc : '목차';
    title.innerHTML =
        '<span class="clbi-icon" style="--icon:var(--ic-ui-002)"></span> ' + tocTitleText;
    var body = document.createElement('div');
    body.className = 'clbi-left-content toc-sidebar-content';
    var list = document.createElement('ul');
    list.className = 'generated-toc';
    headings.forEach(function (heading) {
        var id = getHeadingId(heading);
        var text = getHeadingText(heading);
        var level = heading.tagName.toLowerCase() === 'h3' ? 3 : 2;
        var item = document.createElement('li');
        item.className = 'toc-level-' + level;
        var link = document.createElement('a');
        link.setAttribute('href', '#' + id);
        // 왼쪽 목차: 긴 제목 스크롤을 위해 텍스트를 별도 span으로 감싼다.
        var textWrap = document.createElement('span');
        textWrap.className = 'toc-scroll-wrap';
        var textSpan = document.createElement('span');
        textSpan.className = 'toc-scroll-text';
        textSpan.textContent = text;
        textWrap.appendChild(textSpan);
        link.appendChild(textWrap);
        item.appendChild(link);
        list.appendChild(item);
    });
    body.appendChild(list);
    tocBox.appendChild(title);
    tocBox.appendChild(body);
    leftSidebar.appendChild(tocBox);
    // 왼쪽 목차: DOM 배치가 끝난 뒤 긴 제목 스크롤 여부를 계산한다.
    requestAnimationFrame(function () {
        initTocTitleScroll(tocBox);
        setTimeout(function () {
            initTocTitleScroll(tocBox);
        }, 120);
    });
}
}


// 초기화 함수
@keyframes compact-crt-static-flicker {
function initSidebars() {
    0%, 100% {
    var header = $('.liberty-content-header');
        transform: translateX(0);
    var content = $('.liberty-content');
        opacity: 0.26;
    }


     if (header.length && content.length) {
     11% {
         header.prependTo(content);
        transform: translateX(-1px);
         opacity: 0.36;
     }
     }


     if ($('#clbi-right-sidebar').length === 0) {
     12% {
         var username = mw.config.get('wgUserName');
         transform: translateX(1px);
         var isLoggedIn = username !== null;
         opacity: 0.22;
        var avatarSrc = isLoggedIn
    }
            ? '/index.php?title=특수:Redirect/file/Pfp-' + username + '.png'
            : '/index.php?title=특수:Redirect/file/Pfp-default.png';


        var userBox;
    36% {
         if (isLoggedIn) {
         transform: translateX(0);
            userBox =
         opacity: 0.30;
                '<div class="clbi-right-box">' +
    }
                    '<div style="display:flex;flex-direction:column;align-items:center;padding:14px 14px 10px;background:linear-gradient(to bottom, #171114 0%, #0a0909 100%);">' +
                        '<img src="' + avatarSrc + '" onerror="this.src=\'/index.php?title=특수:Redirect/file/Pfp-default.png\'" style="width:64px;height:64px;border-radius:5px;object-fit:cover;border:2px solid #854369;margin-bottom:8px;">' +
                        '<div style="position:relative;width:100%;margin-top:2px;height:18px;line-height:18px;text-align:center;">' +
                            '<button type="button" id="clbi-playlist-toggle" aria-label="플레이리스트" style="position:absolute;top:0;left:10px;background:none;border:none;padding:0;width:18px;height:18px;color:#E2E2E2;cursor:pointer;display:flex;align-items:center;justify-content:center;">' +
                                '<span class="clbi-icon" style="--icon:var(--ic-ui-009);width:16px;height:16px;"></span>' +
                            '</button>' +
                            '<a href="/index.php/사용자:' + username + '" style="font-size:13px;font-weight:700;color:#E2E2E2 !important;text-decoration:none !important;line-height:18px;display:inline-block;vertical-align:middle;max-width:calc(100% - 58px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + username + '</a>' +
                            '<button type="button" id="clbi-notification-toggle" aria-label="알림" style="position:absolute;top:0;right:10px;background:none;border:none;padding:0;width:18px;height:18px;color:#E2E2E2;cursor:pointer;display:flex;align-items:center;justify-content:center;">' +
                                '<span class="clbi-icon" style="--icon:var(--ic-ui-009);width:16px;height:16px;"></span>' +
                                '<span id="clbi-notification-badge" style="display:none;position:absolute;top:-6px;right:-8px;min-width:14px;height:14px;padding:0 3px;border-radius:999px;background:#854369;color:#fff;font-size:9px;line-height:14px;font-weight:700;text-align:center;"></span>' +
                            '</button>' +
                        '</div>' +
                    '</div>' +
                    '<div class="clbi-right-content" style="border-top:1px solid #2a2a2a;padding:8px;">' +
                        '<a href="/index.php/특수:기여/' + username + '" class="clbi-user-btn" id="clbi-btn-contribution">기여</a>' +
                        '<a href="/index.php/특수:주시문서목록" class="clbi-user-btn" id="clbi-btn-watchlist">주시문서 목록</a>' +
                        '<a href="/index.php/특수:설정" class="clbi-user-btn" id="clbi-btn-preferences">설정</a>' +
                        '<a href="/index.php?title=특수:로그아웃&returnto=대문" class="clbi-user-btn clbi-user-btn-logout" id="clbi-btn-logout">로그아웃</a>' +
                    '</div>' +
                '</div>';
         } else {
            userBox =
                '<div class="clbi-right-box">' +
                    '<div style="display:flex;flex-direction:column;align-items:center;padding:14px 14px 10px;background:linear-gradient(to bottom, #171114 0%, #0a0909 100%);">' +
                        '<img src="/index.php?title=특수:Redirect/file/Pfp-default.png" style="width:64px;height:64px;border-radius:5px;object-fit:cover;border:2px solid #854369;margin-bottom:8px;">' +
                        '<span style="font-size:13px;font-weight:700;color:#E2E2E2;">Guest</span>' +
                    '</div>' +
                    '<div class="clbi-right-content" style="border-top:1px solid #2a2a2a;padding:8px;">' +
                        '<a href="/index.php?title=특수:로그인&returnto=대문" class="clbi-user-btn" id="clbi-btn-login">로그인</a>' +
                    '</div>' +
                '</div>';
        }


         var recentBox =
    37% {
            '<div class="clbi-right-box">' +
         transform: translateX(1px);
                '<div class="clbi-right-title" id="clbi-title-recent"><span class="clbi-icon" style="--icon:var(--ic-ui-006)"></span> <a href="/index.php/특수:최근바뀜" style="color:#E2E2E2 !important;text-decoration:none !important;">최근 변경</a></div>' +
        opacity: 0.38;
                '<div class="clbi-right-content" id="clbi-recent-list">불러오는 중...</div>' +
    }
            '</div>';


         var linkBox =
    38% {
            '<div class="clbi-right-box">' +
         transform: translateX(-1px);
                '<div class="clbi-right-title" id="clbi-title-links"><span class="clbi-icon" style="--icon:var(--ic-ui-003)"></span> 링크</div>' +
        opacity: 0.24;
                '<div class="clbi-right-content clbi-link-box">' +
    }
                    '<ul>' +
                        '<li><a href="https://discord.gg/ctaeJ9d3Q5" target="_blank">Discord</a></li>' +
                        '<li><a href="https://www.youtube.com/@nxdsxn" target="_blank">YouTube</a></li>' +
                        '<li><a href="https://x.com/nxd_sxn" target="_blank">X</a></li>' +
                    '</ul>' +
                '</div>' +
            '</div>';


         var sidebar =
    64% {
            userBox +
         transform: translateX(0);
            '<div class="clbi-right-box">' +
        opacity: 0.32;
                '<div class="clbi-right-title" id="clbi-title-search"><span class="clbi-icon" style="--icon:var(--ic-ui-005)"></span> <a href="/index.php/특수:검색" style="color:#E2E2E2 !important;text-decoration:none !important;">검색</a></div>' +
    }
                '<div class="clbi-right-content">' +
                    '<input id="clbi-search-input" type="text" placeholder="검색...">' +
                    '<button id="clbi-search-btn">GO</button>' +
                '</div>' +
            '</div>' +
            recentBox +
            '<div class="clbi-right-box">' +
                '<div class="clbi-right-title" id="clbi-title-guide"><span class="clbi-icon" style="--icon:var(--ic-ui-007)"></span> 가이드</div>' +
                '<div class="clbi-right-content">' +
                    '<a href="/index.php/CLBI_Wiki/KR_시작하기_(CLBI)" id="clbi-guide-link">시작하기</a>' +
                '</div>' +
            '</div>' +
            linkBox;


        $('.content-wrapper').append('<div id="clbi-right-sidebar">' + sidebar + '</div>');
    65% {
 
         transform: translateX(-1px);
        $('#clbi-search-btn').click(function() {
         opacity: 0.40;
            var query = $('#clbi-search-input').val();
            if (query) {
                window.location.href = '/index.php?search=' + encodeURIComponent(query);
            }
         });
 
        $('#clbi-search-input').keypress(function(e) {
            if (e.which === 13) $('#clbi-search-btn').click();
         });
 
        $.getJSON(
            '/api.php?action=query&list=recentchanges&rclimit=5&rcprop=title|timestamp&format=json&rcnamespace=0&rctype=edit|new',
            function(data) {
                var items = data.query.recentchanges;
                var html = '';
 
                $.each(items, function(i, item) {
                    var label = timeAgo(item.timestamp);
                    html +=
                        '<div class="clbi-recent-item">' +
                            '<div class="clbi-recent-title-wrap">' +
                                '<a href="/index.php/' + encodeURIComponent(item.title) + '" class="clbi-recent-title">' + item.title + '</a>' +
                            '</div>' +
                            '<span class="clbi-recent-time">' + label + '</span>' +
                        '</div>';
                });
 
                $('#clbi-recent-list').html(html);
 
                $('#clbi-recent-list .clbi-recent-item').each(function() {
                    var wrap = $(this).find('.clbi-recent-title-wrap');
                    var title = $(this).find('.clbi-recent-title');
                    var wrapW = wrap.width();
                    var titleW = title[0].scrollWidth;
 
                    if (titleW > wrapW + 20) {
                        var duration = titleW / 40;
                        title.css({
                            animation: 'clbi-scroll ' + duration + 's linear infinite',
                            '--scroll-dist': '-' + (titleW - wrapW + 8) + 'px'
                        });
                    }
                });
            }
        ).fail(function() {
            $('#clbi-recent-list').html('불러오기 실패');
        });
     }
     }


     if ($('#clbi-left-sidebar').length === 0) {
     66% {
         var leftSidebar =
         transform: translateX(0);
            '<div id="clbi-left-sidebar">' +
         opacity: 0.26;
                '<div class="clbi-left-box">' +
                    '<div class="clbi-left-title"><span class="clbi-icon" style="--icon:var(--ic-ui-001)"></span> <span id="clbi-title-language">언어</span></div>' +
                    '<div class="clbi-left-content clbi-lang-box" id="clbi-lang-box">' +
                        '<div class="clbi-lang-current" id="clbi-lang-current">한국어</div>' +
                        '<div id="clbi-lang-list" style="display:none;"></div>' +
                    '</div>' +
                '</div>' +
                '<div class="clbi-left-box">' +
                    '<div class="clbi-left-title"><span class="clbi-icon" style="--icon:var(--ic-ui-002)"></span> <span id="clbi-title-categories">카테고리</span></div>' +
                    '<div class="clbi-left-content clbi-cat-box">' +
                        '<div class="clbi-cat-btn" id="clbi-cat-main"><a href="/index.php/대문"><div class="clbi-cat-text"><span class="clbi-cat-label">메인 메뉴</span><span class="clbi-cat-sub">MAIN MENU</span></div></a><div class="clbi-cat-arrow">▶</div></div>' +
                        '<div class="clbi-cat-btn" id="clbi-cat-nations"><a href="/index.php/국가_및_조합"><div class="clbi-cat-text"><span class="clbi-cat-label">국가 및 조합</span><span class="clbi-cat-sub">NATIONS & FACTIONS</span></div></a><div class="clbi-cat-arrow">▶</div></div>' +
                        '<div class="clbi-cat-btn" id="clbi-cat-corporations"><a href="/index.php/기업_및_공동체"><div class="clbi-cat-text"><span class="clbi-cat-label">기업 및 공동체</span><span class="clbi-cat-sub">CORPORATIONS & COMMUNITIES</span></div></a><div class="clbi-cat-arrow">▶</div></div>' +
                        '<div class="clbi-cat-btn" id="clbi-cat-military"><a href="/index.php/군_정치집단"><div class="clbi-cat-text"><span class="clbi-cat-label">군, 정치집단</span><span class="clbi-cat-sub">MILITARY & POLITICS</span></div></a><div class="clbi-cat-arrow">▶</div></div>' +
                        '<div class="clbi-cat-btn" id="clbi-cat-history"><a href="/index.php/역사적_사건"><div class="clbi-cat-text"><span class="clbi-cat-label">역사적 사건</span><span class="clbi-cat-sub">HISTORICAL EVENTS</span></div></a><div class="clbi-cat-arrow">▶</div></div>' +
                        '<div class="clbi-cat-btn" id="clbi-cat-personnel"><a href="/index.php/인물"><div class="clbi-cat-text"><span class="clbi-cat-label">인물</span><span class="clbi-cat-sub">KEY PERSONNEL</span></div></a><div class="clbi-cat-arrow">▶</div></div>' +
                    '</div>' +
                '</div>' +
            '</div>';
 
        $('.content-wrapper').prepend(leftSidebar);
 
        // 왼쪽 사이드바가 처음 생성된 직후에도 한 번 실행한다.
        // 이후 언어 갱신과 SPA 이동 시에는 updateSidebar()에서 다시 실행된다.
        updateLeftSidebarNationsImage();
 
         $(document).on('click', '#clbi-lang-current', function() {
            if ($('#clbi-lang-list').is(':hidden')) {
                $('#clbi-lang-current').css('margin-bottom', '8px');
                $('#clbi-lang-list').slideDown(200);
            } else {
                $('#clbi-lang-list').slideUp(200, function() {
                    $('#clbi-lang-current').css('margin-bottom', '0');
                });
            }
        });
     }
     }
    applyMainPageStyle();
    $('#side-toc-box').remove();
    mw.loader.using(['mediawiki.api']).then(function() {
        setTimeout(function() {
            initNotifications();
            initPlaylistPopup();
            initProfile();
            moveTocToLeftSidebar();
        }, 300);
        setTimeout(moveTocToLeftSidebar, 800);
        setTimeout(moveTocToLeftSidebar, 1500);
    });
}
}


$(function() {
@keyframes compact-crt-image-jitter {
     loadLangScript(function() {
     0%, 82%, 100% {
         setTimeout(function() {
         transform: translateX(0);
            initSidebars();
     }
        }, 100);
     });
});


// SPA 네비게이션
    83% {
function shouldSkip(url) {
        transform: translateX(-1px);
    return url.match(/action=edit|action=submit|action=history|action=delete|action=protect|action=purge|특수:로그인|특수:로그아웃|Special:UserLogin|Special:UserLogout|특수:사용자정보|특수:비밀번호바꾸기|uselang=/);
    }
}


$(function() {
    84% {
    if (window._spaInitialized) return;
        transform: translateX(1px);
     window._spaInitialized = true;
     }


     function isInternal(url) {
     85% {
         var a = document.createElement('a');
         transform: translateX(0);
        a.href = url;
        return a.hostname === window.location.hostname;
     }
     }


     function loadPage(url) {
     92% {
         fetch(url)
         transform: translateX(1px);
            .then(function(res) {
                return res.text();
            })
            .then(function(html) {
                var parser = new DOMParser();
                var doc = parser.parseFromString(html, 'text/html');
 
                var scripts = doc.querySelectorAll('script');
                for (var i = 0; i < scripts.length; i++) {
                    var src = scripts[i].textContent;
 
                    if (src.indexOf('wgNamespaceNumber') !== -1) {
                        var match = src.match(/"wgNamespaceNumber":(-?\d+)/);
                        if (match) mw.config.set('wgNamespaceNumber', parseInt(match[1], 10));
 
                        var matchTitle = src.match(/"wgTitle":"([^"]+)"/);
                        if (matchTitle) mw.config.set('wgTitle', matchTitle[1]);
 
                        var matchPage = src.match(/"wgPageName":"([^"]+)"/);
                        if (matchPage) mw.config.set('wgPageName', matchPage[1]);
 
                        var matchSpecial = src.match(/"wgCanonicalSpecialPageName":"([^"]+)"/);
                        if (matchSpecial) {
                            mw.config.set('wgCanonicalSpecialPageName', matchSpecial[1]);
                        } else {
                            mw.config.set('wgCanonicalSpecialPageName', false);
                        }
                        break;
                    }
                }
 
                var newContent = doc.querySelector('.liberty-content-main');
                var newTitle = doc.querySelector('.mw-page-title-main');
                var newHead = doc.querySelector('title');
                var newHeader = doc.querySelector('.liberty-content-header');
 
                if (newContent) {
                    $('#side-toc-box').remove();
                    $('.liberty-content-main').html(newContent.innerHTML);
                    $('.profile-card').remove();
                    $('body').removeClass('page-loading');
                }
 
                if (newTitle) {
                    $('.mw-page-title-main').html(newTitle.innerHTML);
                }
 
                if (newHead) {
                    document.title = newHead.textContent;
                }
 
                if (newHeader) {
                    $('.liberty-content-header').html(newHeader.innerHTML);
                }
 
                window.scrollTo(0, 0);
                $('#clbi-lang-list').hide();
                $('#clbi-lang-current').css('margin-bottom', '0');
 
                mw.hook('wikipage.content').fire($('.liberty-content-main'));
                applyMainPageStyle();
 
                $('#side-toc-box').remove();
                setTimeout(moveTocToLeftSidebar, 100);
                setTimeout(moveTocToLeftSidebar, 500);
                setTimeout(moveTocToLeftSidebar, 1200);
 
                mw.loader.using(['mediawiki.api']).then(function() {
                    initProfile();
                    moveTocToLeftSidebar();
                });
            });
     }
     }


// 목차 링크는 전용 처리
     93% {
$(document).on('click', '#side-toc-box a, #toc a, .toc a', function(e) {
         transform: translateX(-1px);
    var href = $(this).attr('href');
     if (!href || href.charAt(0) !== '#') return;
 
    var rawId = href.slice(1);
    if (!rawId) return;
 
    var decodedId = rawId;
 
    try {
         decodedId = decodeURIComponent(rawId);
    } catch (err) {
        decodedId = rawId;
     }
     }


     var target = document.getElementById(decodedId);
     94% {
 
         transform: translateX(0);
    if (!target && window.CSS && CSS.escape) {
         target = document.querySelector('#' + CSS.escape(decodedId));
     }
     }
}


     if (!target) return;
.compact-crt-media.compact-crt-portrait {
     padding: 4px 5px;
    border-radius: 8px;
}


     e.preventDefault();
.compact-crt-media.compact-crt-portrait::before {
     e.stopPropagation();
     inset: 3px;
     border-radius: 5px;
}


     var scrollTarget = target.closest('h2, h3') || target;
.compact-crt-media.compact-crt-portrait::after {
     inset: 3px;
    border-radius: 5px;
}


    scrollTarget.scrollIntoView({
.compact-crt-media.compact-crt-portrait .compact-crt-static {
        behavior: 'auto',
    inset: 3px;
        block: 'start'
    border-radius: 5px;
    });
}


    history.replaceState(null, '', '#' + rawId);
.compact-crt-media.compact-crt-portrait img,
});
.compact-crt-media.compact-crt-portrait .mw-file-element {
    display: block;
}


    $(document).on('click', 'a', function(e) {
/* =========================================
        var href = $(this).attr('href');
  Related Template Title
        if (!href) return;
  ========================================= */


        // 목차 링크는 별도 핸들러에서 처리
.related-template-title {
        if ($(this).closest('#side-toc-box, #toc, .toc').length) return;
    position: relative;
    overflow: hidden;
    width: 100%;
    border-radius: 5px;
    background: #111111;
    color: #fff;
    box-shadow:
        inset 1px 0 0 #494949,
        inset 0 -1px 0 #555;
}


         // 단순 해시 링크는 SPA 가로채기 제외
.related-template-title::before {
         if (href.startsWith('#')) return;
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    background:
         linear-gradient(
            to bottom,
            rgba(255,255,255,0.070) 0%,
            rgba(255,255,255,0.026) 18%,
            transparent 45%,
            rgba(0,0,0,0.18) 100%
         ),
        linear-gradient(
            105deg,
            transparent 0%,
            rgba(255,255,255,0.045) 18%,
            transparent 36%,
            transparent 100%
        );
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.026),
        inset 0 0 14px rgba(0,0,0,0.30);
}


         var link = document.createElement('a');
.related-template-title::after {
        link.href = href;
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0.20;
    background:
         repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,0.055) 0px,
            rgba(255,255,255,0.055) 1px,
            transparent 2px,
            transparent 4px
        );
    mix-blend-mode: screen;
}


        var samePath = decodeURIComponent(link.pathname) === decodeURIComponent(window.location.pathname);
.related-template-title > * {
        var sameSearch = (link.search || '') === (window.location.search || '');
    position: relative;
    z-index: 3;
}


        if (link.hash && samePath && sameSearch) return;
/* =========================================
  Page Top CRT Banner
  Template use:
  {{Banner|[[파일:example.png{{!}}1000px{{!}}link=]]|80px|20px}}
  2번 인자: 양수면 좌측 이동
  3번 인자: 양수면 아래 이동
  ========================================= */


         var currentBase = window.location.href.split('#')[0];
.crt-page-monitor-frame {
         var targetBase = link.href.split('#')[0];
    position: relative;
    box-sizing: border-box;
    width: 100%;
    aspect-ratio: 2560 / 580;
    margin: 0 auto 16px auto;
    padding: 14px 20px 16px 20px;
    border-radius: 18px;
    background:
         linear-gradient(
            145deg,
            #151515 0%,
            #0b0b0b 28%,
            #050505 58%,
            #181818 100%
        );
    border: 2px solid #242424;
    box-shadow:
        inset 0 3px 8px rgba(0,0,0,0.78),
         inset 0 -2px 0 rgba(255,255,255,0.030),
        inset 4px 0 10px rgba(0,0,0,0.72),
        inset -3px 0 0 rgba(0,0,0,0.78),
        0 0 0 3px #050505,
        0 0 0 5px #242424;
    overflow: hidden;
}


         if (link.hash && currentBase === targetBase) return;
.crt-page-monitor-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 18px;
    pointer-events: none;
    opacity: 0.08;
    background:
         linear-gradient(
            to bottom,
            rgba(0,0,0,0.38) 0%,
            transparent 20%,
            transparent 100%
        ),
        linear-gradient(
            to right,
            rgba(0,0,0,0.34) 0%,
            transparent 18%,
            transparent 100%
        );
    mix-blend-mode: normal;
}


        if (!isInternal(href)) return;
.crt-page-monitor-frame::after {
        if (shouldSkip(href)) return;
    content: none;
}


         e.preventDefault();
.crt-page-monitor-inner {
         playStaticSound();
    position: relative;
         $('body').addClass('page-loading');
    box-sizing: border-box;
         history.pushState(null, '', href);
    width: 100%;
         loadPage(href);
    height: 100%;
    });
    padding: 6px;
    border-radius: 13px;
    background:
         linear-gradient(
            145deg,
            #020202 0%,
            #080808 45%,
            #030303 100%
        );
    border: 1px solid #020202;
    box-shadow:
         inset 0 11px 24px rgba(0,0,0,0.98),
         inset 0 -2px 3px rgba(255,255,255,0.028),
        inset 8px 0 20px rgba(0,0,0,0.94),
         inset -8px 0 20px rgba(0,0,0,0.94),
         0 0 0 1px rgba(255,255,255,0.030);
}


     window.addEventListener('popstate', function() {
.crt-page-monitor-screen {
         loadPage(window.location.href);
     position: relative;
    });
    width: 100%;
});
    height: 100%;
    overflow: hidden;
    border-radius: 8px / 15px;
    background: #050505;
    border: 1px solid #060606;
    box-shadow:
        inset 0 0 18px rgba(0,0,0,0.88),
         inset 0 0 42px rgba(0,0,0,0.70),
        0 0 0 1px rgba(255,255,255,0.026);
}


// 시간 계산 함수
.crt-page-monitor-image,
function timeAgo(timestamp) {
.crt-page-monitor-image-base,
     var now = new Date();
.crt-page-monitor-image-bloom,
     var date = new Date(timestamp);
.crt-page-monitor-slice {
     var diff = Math.floor((now - date) / 1000);
     position: absolute;
     inset: 0;
     line-height: 0;
    overflow: hidden;
}


    if (diff < 60) return diff + '초 전';
.crt-page-monitor-image {
    if (diff < 3600) return Math.floor(diff / 60) + '분 전';
     z-index: 1;
     if (diff < 86400) return Math.floor(diff / 3600) + '시간 전';
    return Math.floor(diff / 86400) + '일 전';
}
}


// 펼접 토글
.crt-page-monitor-image-base {
// 펼접 토글
     z-index: 3;
function getFoldTexts() {
     var lang = getCurrentLang();
    return (window.LANG && window.LANG[lang])
        ? window.LANG[lang]
        : (window.LANG ? window.LANG.ko : { expand: '펼치기', collapse: '접기' });
}
}


function refreshOpenAncestors($start) {
.crt-page-monitor-image-bloom {
     $start.parents('[id^="collapsible"]').each(function () {
     z-index: 4;
         var $parent = $(this);
    pointer-events: none;
         if (!$parent.hasClass('folding-open')) return;
    opacity: 0.38;
    mix-blend-mode: normal;
    filter:
        blur(9px)
        brightness(0.92)
         contrast(1.02)
         saturate(1.04);
}


        // 이미 fully open 상태면 굳이 다시 잠그지 않음
.crt-page-monitor-image-base a,
        if ($parent.data('fold-state') === 'open') {
.crt-page-monitor-image-base span,
            return;
.crt-page-monitor-image-base .mw-file-description,
        }
.crt-page-monitor-image-base .mw-default-size,
.crt-page-monitor-image-base .mw-image-border,
.crt-page-monitor-image-bloom a,
.crt-page-monitor-image-bloom span,
.crt-page-monitor-image-bloom .mw-file-description,
.crt-page-monitor-image-bloom .mw-default-size,
.crt-page-monitor-image-bloom .mw-image-border,
.crt-page-monitor-slice a,
.crt-page-monitor-slice span,
.crt-page-monitor-slice .mw-file-description,
.crt-page-monitor-slice .mw-default-size,
.crt-page-monitor-slice .mw-image-border {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}


        $parent.css('max-height', this.scrollHeight + 'px');
.crt-page-monitor-image-base img,
     });
.crt-page-monitor-image-base .mw-file-element,
.crt-page-monitor-image-bloom img,
.crt-page-monitor-image-bloom .mw-file-element,
.crt-page-monitor-slice img,
.crt-page-monitor-slice .mw-file-element,
.crt-page-monitor-slice-img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center;
    border: 0 !important;
    transform:
        translate(
            calc(0px - var(--crt-img-left, 0px)),
            var(--crt-img-down, 0px)
        )
        scale(var(--crt-img-scale, 1.04));
     transform-origin: center center;
}
}


function bindInnerResizeUpdates($target) {
.crt-page-monitor-image-base img,
    // 이미지 늦게 로드될 때 높이 갱신
.crt-page-monitor-image-base .mw-file-element {
    $target.find('img').off('.foldimg').on('load.foldimg', function () {
    filter:
        if ($target.hasClass('folding-open')) {
        brightness(0.84)
            if ($target.data('fold-state') !== 'open') {
        contrast(1.08)
                $target.css('max-height', $target[0].scrollHeight + 'px');
         saturate(0.90);
            }
            refreshOpenAncestors($target);
         }
    });
}
}


function openFold($target, $btn) {
.crt-page-monitor-image-bloom img,
    var t = getFoldTexts();
.crt-page-monitor-image-bloom .mw-file-element {
    transform:
        translate(
            calc(0px - var(--crt-img-left, 0px)),
            var(--crt-img-down, 0px)
        )
        scale(calc(var(--crt-img-scale, 1.04) + 0.02));
}


    $target.data('fold-state', 'opening');
.crt-page-monitor-slice img,
    $target.addClass('folding-open');
.crt-page-monitor-slice .mw-file-element,
.crt-page-monitor-slice-img {
    filter:
        brightness(0.96)
        contrast(1.18)
        saturate(0.82);
}


     // 열린 뒤 자연 확장 가능하게 만들기 위해 먼저 px로 열기
.crt-page-monitor-image::after {
     $target.css('max-height', '0px');
    content: "";
     $target[0].offsetHeight;
    position: absolute;
     $target.css('max-height', $target[0].scrollHeight + 'px');
    inset: -3%;
     z-index: 6;
     pointer-events: none;
     opacity: 0.16;
     background:
        radial-gradient(
            ellipse at 50% 45%,
            rgba(220,235,230,0.12) 0%,
            rgba(170,190,185,0.05) 34%,
            rgba(70,85,82,0.03) 62%,
            transparent 100%
        ),
        linear-gradient(
            to bottom,
            rgba(255,255,255,0.04) 0%,
            rgba(255,255,255,0.014) 28%,
            transparent 70%,
            rgba(0,0,0,0.08) 100%
        );
    mix-blend-mode: normal;
}


     $btn.text(t.collapse);
.crt-page-monitor-slice {
    z-index: 5;
    opacity: 0;
     pointer-events: none;
    mix-blend-mode: screen;
    will-change: transform, opacity, clip-path, filter;
}


     bindInnerResizeUpdates($target);
.crt-page-monitor-slice-a {
     animation: crt-slice-tear-a 4.7s steps(1, end) infinite;
}


    // 바깥 펼접 즉시 갱신
.crt-page-monitor-slice-b {
     refreshOpenAncestors($target);
     animation: crt-slice-tear-b 6.1s steps(1, end) infinite;
}


    // 전환 끝나면 none으로 풀어서 중첩 펼접/동적 내용 증가를 자연스럽게 허용
.crt-page-monitor-slice-c {
     $target.off('transitionend.foldopen').on('transitionend.foldopen', function (e) {
     animation: crt-slice-tear-c 7.4s steps(1, end) infinite;
        if (e.target !== this) return;
}
        if (!$target.hasClass('folding-open')) return;


         $target.css('max-height', 'none');
.crt-page-monitor-screen::before {
         $target.data('fold-state', 'open');
    content: "";
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    border-radius: 8px / 15px;
    background:
        radial-gradient(
            ellipse at 50% 50%,
            transparent 0%,
            transparent 62%,
            rgba(0,0,0,0.16) 78%,
            rgba(0,0,0,0.42) 100%
        ),
        linear-gradient(
            to bottom,
            rgba(0,0,0,0.18) 0%,
            transparent 14%,
            transparent 82%,
            rgba(0,0,0,0.24) 100%
        ),
         linear-gradient(
            to right,
            rgba(0,0,0,0.18) 0%,
            transparent 8%,
            transparent 92%,
            rgba(0,0,0,0.18) 100%
        ),
        linear-gradient(
            105deg,
            transparent 0%,
            rgba(255,255,255,0.030) 18%,
            transparent 38%,
            transparent 100%
        );
    box-shadow:
         inset 0 0 20px rgba(255,255,255,0.018),
        inset 0 0 54px rgba(0,0,0,0.54);
}


         refreshOpenAncestors($target);
.crt-page-monitor-screen::after {
     });
    content: "";
    position: absolute;
    inset: -80px 0;
    z-index: 21;
    pointer-events: none;
    opacity: 0.20;
    background:
         repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,0.08) 0px,
            rgba(255,255,255,0.08) 1px,
            transparent 2px,
            transparent 5px
        );
     mix-blend-mode: screen;
    animation: crt-scanlines-up 7s linear infinite;
}


     // 늦게 렌더되는 콘텐츠 대응
.crt-page-monitor-glitch {
     requestAnimationFrame(function () {
     position: absolute;
        if ($target.hasClass('folding-open') && $target.data('fold-state') !== 'open') {
     inset: 0;
             $target.css('max-height', $target[0].scrollHeight + 'px');
    z-index: 22;
             refreshOpenAncestors($target);
    pointer-events: none;
        }
    opacity: 0;
     });
    background:
        linear-gradient(
            to bottom,
            transparent 0%,
            rgba(255,255,255,0.12) 48%,
            rgba(212,90,162,0.14) 50%,
             rgba(90,120,255,0.08) 52%,
             transparent 56%
        );
    mix-blend-mode: screen;
     animation: crt-soft-glitch-band 8.2s steps(1, end) infinite;
}


    setTimeout(function () {
.crt-page-monitor-tear {
        if ($target.hasClass('folding-open') && $target.data('fold-state') !== 'open') {
    position: absolute;
            $target.css('max-height', $target[0].scrollHeight + 'px');
    inset: 0;
            refreshOpenAncestors($target);
    z-index: 23;
        }
    pointer-events: none;
     }, 80);
     opacity: 0;
 
    background:
    setTimeout(function () {
        linear-gradient(
        if ($target.hasClass('folding-open') && $target.data('fold-state') !== 'open') {
            to right,
             $target.css('max-height', $target[0].scrollHeight + 'px');
            transparent 0%,
             refreshOpenAncestors($target);
            rgba(120,180,255,0.07) 10%,
        }
            rgba(255,255,255,0.11) 48%,
     }, 220);
             rgba(212,90,162,0.08) 78%,
             transparent 100%
        );
    mix-blend-mode: screen;
     animation: crt-soft-horizontal-tear 5.6s steps(1, end) infinite;
}
}


function closeFold($target, $btn) {
@keyframes crt-slice-tear-a {
    var t = getFoldTexts();
    0%, 11%, 100% {
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 100% 0);
    }


     // none 상태에서 닫으면 transition이 안 되므로 실제 높이로 고정
     12% {
    if ($target.css('max-height') === 'none' || $target.data('fold-state') === 'open') {
        opacity: 0.38;
         $target.css('max-height', $target[0].scrollHeight + 'px');
         transform: translateX(-18px);
    } else {
         clip-path: inset(17% 0 78% 0);
         $target.css('max-height', $target[0].scrollHeight + 'px');
     }
     }


     $target.data('fold-state', 'closing');
     13% {
    $target[0].offsetHeight;
        opacity: 0.22;
    $target.css('max-height', '0px');
        transform: translateX(11px);
     $target.removeClass('folding-open');
        clip-path: inset(18% 0 77% 0);
        filter: hue-rotate(-8deg);
     }


     $btn.text(t.expand);
     14% {
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 100% 0);
    }


     refreshOpenAncestors($target);
     63% {
        opacity: 0.30;
        transform: translateX(9px);
        clip-path: inset(24% 0 70% 0);
    }


     setTimeout(function () {
     64% {
         refreshOpenAncestors($target);
         opacity: 0;
         $target.data('fold-state', 'closed');
        transform: translateX(0);
     }, 250);
         clip-path: inset(0 0 100% 0);
     }
}
}


$(function () {
@keyframes crt-slice-tear-b {
     $(document)
     0%, 37%, 100% {
        .off('click.clbiToggle')
        opacity: 0;
        .on('click.clbiToggle', '.toggleBtn', function () {
        transform: translateX(0);
            var $btn = $(this);
        clip-path: inset(0 0 100% 0);
            var targetId = $btn.data('target');
    }
            var $target = $('#' + targetId);
            if (!$target.length) return;


            var scrollY = window.scrollY;
    38% {
        opacity: 0.42;
        transform: translateX(24px);
        clip-path: inset(43% 0 50% 0);
    }


            if ($target.hasClass('folding-open')) {
    39% {
                closeFold($target, $btn);
        opacity: 0.26;
            } else {
        transform: translateX(-14px);
                openFold($target, $btn);
        clip-path: inset(45% 0 48% 0);
            }
        filter: hue-rotate(10deg) brightness(1.08);
    }


            window.scrollTo(0, scrollY);
    40% {
         });
        opacity: 0;
});
         transform: translateX(0);
 
        clip-path: inset(0 0 100% 0);
// ========== 프로필 시스템 ==========
     }
function initProfile() {
     $('.profile-card').remove();


     var ns = mw.config.get('wgNamespaceNumber');
     78% {
    var title = mw.config.get('wgTitle');
        opacity: 0.34;
 
         transform: translateX(-20px);
    if (ns === 2) {
         clip-path: inset(51% 0 43% 0);
         var profileUser = title.split('/')[0];
         renderProfile(profileUser);
     }
     }


     if (mw.config.get('wgCanonicalSpecialPageName') === '사용자정보') {
     79% {
         initUserProfilePage();
        opacity: 0;
        transform: translateX(0);
         clip-path: inset(0 0 100% 0);
     }
     }
}
}


function renderProfile(username) {
@keyframes crt-slice-tear-c {
     var api = new mw.Api();
     0%, 21%, 100% {
    api.get({
         opacity: 0;
        action: 'query',
         transform: translateX(0);
        list: 'users',
         clip-path: inset(0 0 100% 0);
         ususers: username,
    }
         usprop: 'editcount'
    }).then(function(data) {
        var user = data.query.users[0];
         var contentEl = document.getElementById('mw-content-text');
        if (!contentEl) return;


         var pageContent = contentEl.querySelector('.mw-parser-output') || contentEl;
    22% {
         injectProfileCard(username, user, pageContent);
         opacity: 0.28;
     });
        transform: translateX(-30px);
}
         clip-path: inset(67% 0 25% 0);
     }


function injectProfileCard(username, userData, container) {
    23% {
    var isOwnPage = mw.config.get('wgUserName') === username;
        opacity: 0.18;
    var editCount = (userData && userData.editcount) ? userData.editcount : 0;
        transform: translateX(16px);
    var editBtn = isOwnPage
         clip-path: inset(68% 0 23% 0);
         ? '<a href="/index.php/특수:사용자정보" class="profile-edit-btn">프로필 수정</a>'
         filter: contrast(1.25) brightness(1.06);
         : '';
    }


     var card = document.createElement('div');
     24% {
    card.className = 'profile-card';
        opacity: 0;
    card.innerHTML =
         transform: translateX(0);
         '<div class="profile-header">' +
         clip-path: inset(0 0 100% 0);
            '<div class="profile-avatar">' +
    }
                '<img src="/index.php?title=특수:Redirect/file/Pfp-' + username + '.png&width=120"' +
                ' onerror="this.src=\'/index.php?title=특수:Redirect/file/Pfp-default.png&width=120\'"' +
                ' alt="' + username + '">' +
            '</div>' +
            '<div class="profile-info">' +
                '<h2 class="profile-username">' + username + '</h2>' +
                '<div class="profile-name" data-field="name"></div>' +
                '<div class="profile-role" data-field="role"></div>' +
                '<div class="profile-discord" data-field="discord"></div>' +
                '<div class="profile-bio" data-field="bio"></div>' +
                '<div class="profile-badges" data-field="badges"></div>' +
            '</div>' +
            editBtn +
         '</div>' +
        '<div class="profile-stats">' +
            '<div class="profile-stat">' +
                '<span class="clbi-stat-value">' + editCount + '</span>' +
                '<span class="clbi-stat-label">수정 횟수</span>' +
            '</div>' +
        '</div>';


     $('.profile-card').remove();
     91% {
    container.insertBefore(card, container.firstChild);
        opacity: 0.36;
    loadProfileFields(username, card);
        transform: translateX(18px);
}
        clip-path: inset(73% 0 18% 0);
    }


function loadProfileFields(username, card) {
     92% {
    var api = new mw.Api();
         opacity: 0;
     api.get({
         transform: translateX(0);
         action: 'userprofile',
         clip-path: inset(0 0 100% 0);
         user: username
     }
    }).then(function(data) {
        var profile = data.userprofile;
         updateProfileFields(card, {
            name: profile.name || '',
            discord: profile.discord || '',
            role: profile.role || '',
            bio: profile.bio || '',
            badges: profile.badges || ''
        });
    }).fail(function() {
        updateProfileFields(card, {
            name: '',
            discord: '',
            role: '',
            bio: '',
            badges: ''
        });
     });
}
}


function updateProfileFields(card, data) {
@keyframes crt-soft-glitch-band {
     var nameEl = card.querySelector('[data-field="name"]');
     0%, 52%, 100% {
    var roleEl = card.querySelector('[data-field="role"]');
        opacity: 0;
    var discordEl = card.querySelector('[data-field="discord"]');
        transform: translateY(80%);
    var bioEl = card.querySelector('[data-field="bio"]');
     }
     var badgesEl = card.querySelector('[data-field="badges"]');


     if (nameEl) nameEl.textContent = data.name || '';
     53% {
    if (roleEl) roleEl.textContent = data.role || '';
        opacity: 0.42;
    if (discordEl) discordEl.textContent = data.discord ? ('디스코드: ' + data.discord) : '';
        transform: translateY(36%);
     if (bioEl) bioEl.textContent = data.bio || '';
     }


     if (badgesEl) {
     54% {
         if (data.badges) {
         opacity: 0.16;
            var badges = data.badges.split(',');
        transform: translateY(20%) skewX(-1deg);
            var html = '';
    }
 
            for (var i = 0; i < badges.length; i++) {
                html += '<span class="clbi-badge">' + badges[i].trim() + '</span>';
            }


            badgesEl.innerHTML = html;
    55% {
         } else {
         opacity: 0;
            badgesEl.innerHTML = '';
         transform: translateY(-20%);
         }
     }
     }
}
}
// ========== 프로필 시스템 끝 ==========


// ========== 알림 시스템 ==========
@keyframes crt-soft-horizontal-tear {
function ensureNotificationPopup() {
    0%, 68%, 100% {
    if (document.getElementById('clbi-notification-popup')) return;
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 0 0);
    }


     var popup = document.createElement('div');
     69% {
    popup.id = 'clbi-notification-popup';
         opacity: 0.32;
    popup.style.cssText =
         transform: translateX(-16px);
         'display:none;position:fixed;z-index:99999;width:320px;max-height:420px;' +
         clip-path: inset(34% 0 58% 0);
         'background:#0a0909;border:2px solid #854369;border-radius:10px;' +
    }
         'box-shadow:0 0 0 1px #1a1a1a, 0 8px 24px rgba(0,0,0,0.55);overflow:hidden;';


     popup.innerHTML =
     70% {
         '<div style="padding:10px 12px;border-bottom:2px solid #854369;background:linear-gradient(to bottom, #171114 0%, #0a0909 100%);color:#E2E2E2;font-size:13px;font-weight:700;display:flex;align-items:center;justify-content:space-between;gap:8px;">' +
         opacity: 0.18;
            '<span>알림</span>' +
         transform: translateX(12px);
            '<button type="button" id="clbi-notification-readall" style="background:#171717;border:1px solid #854369;border-radius:6px;color:#E2E2E2;font-size:11px;font-weight:700;padding:4px 8px;cursor:pointer;">전체 읽음</button>' +
         clip-path: inset(37% 0 55% 0);
        '</div>' +
    }
         '<div id="clbi-notification-list" style="max-height:320px;overflow-y:auto;padding:8px 0;color:#E2E2E2;font-size:12px;">불러오는 중...</div>' +
         '<div style="padding:8px;border-top:1px solid #2a2a2a;background:#111;">' +
            '<a href="/index.php?title=Special:Notifications" id="clbi-notification-more" style="display:block;width:100%;text-align:center;padding:8px 10px;border-radius:6px;background:#171717;border:1px solid #854369;color:#E2E2E2 !important;text-decoration:none !important;font-size:12px;font-weight:700;">더보기</a>' +
        '</div>';


     document.body.appendChild(popup);
     71% {
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 0 0);
    }
}
}


function positionNotificationPopup() {
@media (prefers-reduced-motion: reduce) {
     var btn = document.getElementById('clbi-notification-toggle');
     .crt-page-monitor-slice-a,
     var popup = document.getElementById('clbi-notification-popup');
    .crt-page-monitor-slice-b,
     if (!btn || !popup) return;
    .crt-page-monitor-slice-c,
    .crt-page-monitor-screen::after,
     .crt-page-monitor-glitch,
     .crt-page-monitor-tear {
        animation: none !important;
    }


     var rect = btn.getBoundingClientRect();
     .crt-page-monitor-slice,
     var top = rect.bottom + 2;
     .crt-page-monitor-glitch,
     var left = rect.right - popup.offsetWidth;
     .crt-page-monitor-tear {
 
         opacity: 0 !important;
    if (left < 8) left = 8;
    if (left + popup.offsetWidth > window.innerWidth - 8) {
         left = window.innerWidth - popup.offsetWidth - 8;
     }
     }
    if (top + popup.offsetHeight > window.innerHeight - 8) {
        top = Math.max(8, window.innerHeight - popup.offsetHeight - 8);
    }
    popup.style.top = top + 'px';
    popup.style.left = left + 'px';
}
}


function parseNotificationItemsFromHtml(html) {
/* =========================================
    var parser = new DOMParser();
  Historical Events Timeline
    var doc = parser.parseFromString(html, 'text/html');
  ========================================= */


    var selectors = [
.timeline-event {
        '.mw-echo-ui-notificationItemWidget',
    position: relative;
        '.mw-echo-ui-notificationsInboxWidgetRow',
    display: block;
        '.echo-ui-notificationItemWidget',
    width: 100%;
        'li[data-notification-id]',
    box-sizing: border-box;
        '.mw-echo-notifications-list li'
    line-height: inherit;
     ];
     text-align: center;
}


     var items = [];
.timeline-title {
     for (var i = 0; i < selectors.length; i++) {
     position: relative;
        items = Array.prototype.slice.call(doc.querySelectorAll(selectors[i]));
     z-index: 2;
        if (items.length) break;
    display: inline-block;
    }
    text-align: center;
}


     return items.slice(0, 5).map(function(item) {
.timeline-event.he-linked::before {
        var link = item.querySelector('a[href]');
     content: "";
        var href = link ? link.getAttribute('href') : '/index.php?title=Special:Notifications';
    position: absolute;
         var text = (item.textContent || '').replace(/\s+/g, ' ').trim();
    top: -2px;
    left: 2px;
    right: 2px;
    height: 3px;
    border-radius: 999px;
    pointer-events: none;
    background:
        linear-gradient(
            to right,
            transparent 0%,
            color-mix(in srgb, var(--he-color) 18%, transparent) 8%,
            color-mix(in srgb, var(--he-color) 92%, transparent) 14%,
            color-mix(in srgb, var(--he-color) 92%, transparent) 86%,
            color-mix(in srgb, var(--he-color) 18%, transparent) 92%,
            transparent 100%
        );
    box-shadow:
         0 0 7px color-mix(in srgb, var(--he-color) 28%, transparent);
}


        var notificationId =
.timeline-event.he-root {
            item.getAttribute('data-notification-id') ||
    overflow: visible;
            item.getAttribute('data-id') ||
}
            item.getAttribute('data-notification') ||
            '';


         if (!notificationId) {
.timeline-event.he-root::before {
             var anyWithId = item.querySelector('[data-notification-id], [data-id], [data-notification]');
    content: "";
             if (anyWithId) {
    position: absolute;
                notificationId =
    left: 6%;
                    anyWithId.getAttribute('data-notification-id') ||
    right: 6%;
                    anyWithId.getAttribute('data-id') ||
    top: 50%;
                    anyWithId.getAttribute('data-notification') ||
    height: 16px;
                    '';
    transform: translateY(-50%);
             }
    border-radius: 999px;
         }
    pointer-events: none;
    background:
         linear-gradient(
            to bottom,
            rgba(255,255,255,0.05) 0%,
            rgba(0,0,0,0.24) 100%
        ),
        linear-gradient(
            to right,
            transparent 0%,
             color-mix(in srgb, var(--he-color) 10%, transparent) 8%,
            color-mix(in srgb, var(--he-color) 24%, transparent) 18%,
             color-mix(in srgb, var(--he-color) 36%, transparent) 50%,
            color-mix(in srgb, var(--he-color) 24%, transparent) 82%,
            color-mix(in srgb, var(--he-color) 10%, transparent) 92%,
            transparent 100%
        );
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        inset 0 -1px 0 rgba(0,0,0,0.42),
        0 0 8px color-mix(in srgb, var(--he-color) 16%, transparent);
    -webkit-mask-image:
        linear-gradient(
            to right,
            transparent 0%,
            black 10%,
            black 90%,
            transparent 100%
        );
    mask-image:
        linear-gradient(
            to right,
            transparent 0%,
            black 10%,
            black 90%,
             transparent 100%
         );
}


         if (href && href.indexOf('http') !== 0) {
.timeline-event.he-root::after {
             href = href.charAt(0) === '/'
    content: "";
                ? href
    position: absolute;
                : '/index.php' + (href.charAt(0) === '?' ? href : '/' + href);
    left: 10%;
        }
    right: 10%;
    top: 50%;
    height: 22px;
    transform: translateY(-50%);
    pointer-events: none;
    background:
         linear-gradient(
            to right,
            transparent 0%,
            color-mix(in srgb, var(--he-color) 48%, transparent) 16%,
             color-mix(in srgb, var(--he-color) 48%, transparent) 84%,
            transparent 100%
        ) top center / 100% 1px no-repeat,
        linear-gradient(
            to right,
            transparent 0%,
            color-mix(in srgb, var(--he-color) 24%, transparent) 16%,
            color-mix(in srgb, var(--he-color) 24%, transparent) 84%,
            transparent 100%
        ) bottom center / 100% 1px no-repeat;
}


        return {
.timeline-event.he-root .timeline-title {
            id: notificationId,
    text-shadow:
            href: href,
        0 0 4px color-mix(in srgb, var(--he-color) 34%, transparent),
            text: text || '알림'
         0 0 9px color-mix(in srgb, var(--he-color) 16%, transparent);
         };
    });
}
}


function renderNotificationPopup(items) {
/* =========================================
    var list = document.getElementById('clbi-notification-list');
  Tree List
    var badge = document.getElementById('clbi-notification-badge');
  ========================================= */
    if (!list) return;


    if (!items || !items.length) {
.tree-container {
        list.innerHTML = '<div style="padding:14px 12px;color:#999;">표시할 알림이 없습니다.</div>';
    margin: 0;
        if (badge) badge.style.display = 'none';
    padding: 0;
        return;
}
    }


    var html = '';
.tree-node {
    for (var i = 0; i < items.length; i++) {
    position: relative;
        html +=
    padding-left: 20px;
            '<a href="' + items[i].href + '" class="clbi-notification-item" data-notification-id="' + (items[i].id || '') + '" style="display:block;padding:10px 12px;color:#E2E2E2 !important;text-decoration:none !important;border-bottom:1px solid #1f1f1f;line-height:1.5;">' +
    margin: 0;
                items[i].text +
    text-indent: 0;
            '</a>';
    line-height: 1.55;
    }
}
    list.innerHTML = html;


     if (badge) {
.tree-node::before {
        badge.textContent = items.length;
    content: "";
        badge.style.display = 'block';
    position: absolute;
     }
    top: 0;
     left: 7px;
    width: 1.2px;
    height: 100%;
     background: #7F7F7F;
}
}


function loadNotificationsIntoPopup() {
.tree-node::after {
    var list = document.getElementById('clbi-notification-list');
     content: "";
     if (list) {
     position: absolute;
        list.innerHTML = '<div style="padding:14px 12px;color:#999;">불러오는 중...</div>';
     top: 12px;
     }
    left: 7px;
 
    width: 8px;
     fetch('/index.php?title=Special:Notifications', { credentials: 'same-origin' })
    height: 0;
        .then(function(res) {
    border-top: 1.2px solid #7F7F7F;
            return res.text();
        })
        .then(function(html) {
            var items = parseNotificationItemsFromHtml(html);
            renderNotificationPopup(items);
        })
        .catch(function(err) {
            console.error(err);
            if (list) {
                list.innerHTML = '<div style="padding:14px 12px;color:#999;">알림을 불러오지 못했습니다.</div>';
            }
        });
}
}


function markAllNotificationsRead() {
.tree-node:last-of-type::before {
    return new mw.Api().postWithToken('csrf', {
     height: 12px;
        action: 'echomarkread',
        list: 'all'
     });
}
}


function markNotificationReadById(notificationId) {
/* =========================================
    if (!notificationId) {
  Meeting Composition Panel
        return $.Deferred().resolve().promise();
  ========================================= */
    }


     return new mw.Api().postWithToken('csrf', {
.meeting-panel {
         action: 'echomarkread',
    position: relative;
         list: notificationId
    isolation: isolate;
     });
     z-index: 0;
    width: calc(100% + 4px);
    left: -2px;
    margin: 0 auto 15px auto;
    border: 2px solid #1a1a1a;
    border-radius: 5px;
    background:
        radial-gradient(
            ellipse at 50% 35%,
            rgba(255,255,255,0.025) 0%,
            transparent 46%
        ),
        linear-gradient(
            to bottom,
            #1A1A1A 0%,
            #181818 52%,
            #151515 100%
         );
    color: #FFF;
    box-shadow:
         0 4px 12px #000;
    text-align: center;
     font-size: 11px;
    box-sizing: border-box;
    overflow: visible;
}
}


function initNotifications() {
.meeting-panel::before {
     var btn = document.getElementById('clbi-notification-toggle');
     content: "";
     if (!btn) return;
    position: absolute;
    inset: -5px;
    z-index: -2;
    border-radius: 8px;
     background: #854369;
    pointer-events: none;
}


     ensureNotificationPopup();
.meeting-panel::after {
     loadNotificationsIntoPopup();
     content: "";
     position: absolute;
    inset: -3px;
    z-index: -1;
    border-radius: 7px;
    background: #1A1A1A;
    pointer-events: none;
}


     $(document)
.meeting-panel-body {
        .off('click.clbiNotificationToggle')
    width: 100%;
        .on('click.clbiNotificationToggle', '#clbi-notification-toggle', function(e) {
     color: #E4E4E4;
            e.preventDefault();
    padding: 4.5px 9px 9px 9px;
            e.stopPropagation();
    box-sizing: border-box;
    border-radius: 3px;
    background: transparent;
    overflow: hidden;
}


            var popup = document.getElementById('clbi-notification-popup');
.meeting-title-wrap {
            var playlistPopup = document.getElementById('clbi-playlist-popup');
    width: 100%;
            if (!popup) return;
    max-width: 760px;
    margin: 5px auto 8px auto;
}


            if (playlistPopup) {
.meeting-title-wrap .infobox-glass-title {
                playlistPopup.style.display = 'none';
    top: 0;
            }
    margin-top: 0;
    padding: 5px;
    line-height: 1.2;
}


            if (popup.style.display === 'none' || popup.style.display === '') {
.meeting-title-table {
                popup.style.display = 'block';
    width: auto;
                positionNotificationPopup();
    max-width: 100%;
                loadNotificationsIntoPopup();
    margin-left: auto;
            } else {
    margin-right: auto;
                popup.style.display = 'none';
    border: 2px solid transparent;
            }
    border-collapse: collapse;
        });
    table-layout: auto;
}


    $(document)
.meeting-title-table td,
        .off('click.clbiNotificationOutside')
.meeting-title-table th {
        .on('click.clbiNotificationOutside', function(e) {
    background: none !important;
            var popup = document.getElementById('clbi-notification-popup');
    border: none !important;
            var toggle = document.getElementById('clbi-notification-toggle');
    vertical-align: middle !important;
            if (!popup || !toggle) return;
}


            if (!popup.contains(e.target) && !toggle.contains(e.target)) {
.meeting-title-table .meeting-title-image-left {
                popup.style.display = 'none';
    width: auto;
            }
    text-align: right !important;
        });
    padding: 0 6px 0 0 !important;
    line-height: 0;
    white-space: nowrap;
}


    $(document)
.meeting-title-table .meeting-title-image-right {
        .off('click.clbiNotificationReadAll')
    width: auto;
        .on('click.clbiNotificationReadAll', '#clbi-notification-readall', function(e) {
    text-align: left !important;
            e.preventDefault();
    padding: 0 0 0 6px !important;
            e.stopPropagation();
    line-height: 0;
    white-space: nowrap;
}


            var button = this;
.meeting-title-table .meeting-title-cell {
            button.disabled = true;
    width: auto;
            button.textContent = '처리 중...';
    line-height: 1.15 !important;
    background: none !important;
    text-align: center !important;
    white-space: nowrap;
    padding: 0 !important;
}


            markAllNotificationsRead()
.meeting-title-image-left img,
                .then(function() {
.meeting-title-image-right img,
                    loadNotificationsIntoPopup();
.meeting-title-image-left .mw-file-element,
                })
.meeting-title-image-right .mw-file-element {
                .always(function() {
    display: block;
                    button.disabled = false;
    border: 0 !important;
                    button.textContent = '전체 읽음';
    vertical-align: middle;
                });
    filter:
        });
        drop-shadow(0 1px 2px rgba(0,0,0,0.75))
        drop-shadow(0 0 3px rgba(255,255,255,0.08));
}


    $(document)
.meeting-title-name {
        .off('click.clbiNotificationItem')
    display: block;
        .on('click.clbiNotificationItem', '.clbi-notification-item', function(e) {
    line-height: 1.15;
            e.preventDefault();
    text-align: center;
            e.stopPropagation();
}


            var href = this.getAttribute('href');
.meeting-title-meta {
            var notificationId = this.getAttribute('data-notification-id') || '';
    display: block;
    margin-top: 1px;
    color: #7F7F7F;
    font-size: 10px;
    font-weight: normal;
    line-height: 1.15;
    text-align: center;
}


            markNotificationReadById(notificationId).always(function() {
.meeting-seatmap {
                loadNotificationsIntoPopup();
    position: relative;
                if (href) {
    margin: 0 auto;
                    window.location.href = href;
    padding: 5px 0 4px 0;
                }
    background: transparent;
            });
    border-radius: 0;
        });
    overflow: visible;
}


     $(window)
.meeting-seatmap::before {
         .off('resize.clbiNotification')
    content: "";
        .on('resize.clbiNotification', function() {
    position: absolute;
             var popup = document.getElementById('clbi-notification-popup');
    left: 50%;
             if (popup && popup.style.display === 'block') {
    top: 84px;
                positionNotificationPopup();
    bottom: 145px;
             }
     width: 2px;
         });
    transform: translateX(-50%);
    background:
         linear-gradient(
            to bottom,
             transparent 0%,
             rgba(65,65,65,0.72) 18%,
            #414141 50%,
            rgba(65,65,65,0.72) 82%,
             transparent 100%
         );
    box-shadow: 0 0 6px rgba(65,65,65,0.16);
    pointer-events: none;
}
}
// ========== 알림 시스템 끝 ==========


// ========== 플레이리스트 팝업 시스템 ==========
.meeting-table-zone::before {
function ensurePlaylistPopup() {
    content: "";
     if (document.getElementById('clbi-playlist-popup')) return;
    position: absolute;
    left: 7%;
    right: 7%;
    top: 50%;
    height: 2px;
    transform: translateY(-50%);
     background:
        linear-gradient(
            to right,
            transparent 0%,
            rgba(65,65,65,0.72) 14%,
            #414141 50%,
            rgba(65,65,65,0.72) 86%,
            transparent 100%
        );
    box-shadow: 0 0 6px rgba(65,65,65,0.14);
    pointer-events: none;
}


     var popup = document.createElement('div');
.meeting-axis-label {
     popup.id = 'clbi-playlist-popup';
     position: relative;
     popup.style.cssText =
     z-index: 4;
        'display:none;position:fixed;z-index:99999;width:690px;height:540px;' +
     display: inline-block;
        'background:#0a0909;border:2px solid #854369;border-radius:10px;' +
    min-width: 42px;
        'box-shadow:0 0 0 1px #1a1a1a, 0 8px 24px rgba(0,0,0,0.55);overflow:hidden;';
    margin: 2px auto 4px auto;
    padding: 2px 9px;
    border-radius: 5px;
    background: #0c0c0c;
    color: #E4E4E4;
    font-weight: bold;
    line-height: 1.35;
    box-shadow:
        inset 0 -1px 0 #525252,
        0 0 0 3px #1A1A1A;
}


    popup.innerHTML =
.meeting-chair-line {
        '<div style="padding:10px 12px;border-bottom:2px solid #854369;background:linear-gradient(to bottom, #171114 0%, #0a0909 100%);color:#E2E2E2;font-size:13px;font-weight:700;">' +
    position: relative;
            '<span>플레이리스트</span>' +
    z-index: 3;
        '</div>' +
    display: flex;
        '<div style="padding:0;background:#111;height:calc(100% - 42px);">' +
    justify-content: center;
            '<iframe style="border:none;width:100%;height:100%;" src="https://open.spotify.com/embed/playlist/32l4ke6djdQn8LoBp1ipR9?utm_source=generator&theme=0" allowfullscreen allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy"></iframe>' +
    margin: 0 0 6px 0;
        '</div>';
    background: transparent;
}


     document.body.appendChild(popup);
.meeting-table-zone {
    position: relative;
    z-index: 3;
     display: grid;
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
    align-items: center;
    width: 100%;
    max-width: 980px;
    min-height: 210px;
    margin: 0 auto;
    background: transparent;
}
}


function positionPlaylistPopup() {
.meeting-side {
     var btn = document.getElementById('clbi-playlist-toggle');
     display: flex;
     var popup = document.getElementById('clbi-playlist-popup');
    flex-wrap: nowrap;
     if (!btn || !popup) return;
    justify-content: center;
     align-items: center;
    gap: 0;
    min-width: 0;
     background: transparent;
}


    var rect = btn.getBoundingClientRect();
.meeting-side-left {
     var top = rect.bottom + 2;
     padding-right: 4px;
    var left = rect.right - popup.offsetWidth;
}


    if (left < 8) left = 8;
.meeting-side-right {
    if (left + popup.offsetWidth > window.innerWidth - 8) {
     padding-left: 4px;
        left = window.innerWidth - popup.offsetWidth - 8;
}
    }
     if (top + popup.offsetHeight > window.innerHeight - 8) {
        top = Math.max(8, window.innerHeight - popup.offsetHeight - 8);
    }


     popup.style.top = top + 'px';
.meeting-center-spine {
     popup.style.left = left + 'px';
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    min-height: 210px;
     z-index: 4;
     background: transparent;
}
}


function initPlaylistPopup() {
.meeting-center-spine .meeting-axis-label {
     var btn = document.getElementById('clbi-playlist-toggle');
     position: absolute;
     if (!btn) return;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
     writing-mode: vertical-rl;
    text-orientation: mixed;
    min-width: 0;
    min-height: 42px;
    margin: 0;
    padding: 8px 3px;
}


     ensurePlaylistPopup();
.meeting-advisory-zone {
     position: relative;
    z-index: 3;
    margin-top: 6px;
    background: transparent;
}


    $(document)
.meeting-advisory-zone > .meeting-axis-label {
        .off('click.clbiPlaylistToggle')
    margin-bottom: 6px;
        .on('click.clbiPlaylistToggle', '#clbi-playlist-toggle', function(e) {
}
            e.preventDefault();
            e.stopPropagation();


            var popup = document.getElementById('clbi-playlist-popup');
.meeting-advisory-grid {
            var notificationPopup = document.getElementById('clbi-notification-popup');
    position: relative;
            if (!popup) return;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
}


             if (notificationPopup) {
.meeting-advisory-grid::before {
                notificationPopup.style.display = 'none';
    content: "";
            }
    position: absolute;
    left: 7%;
    right: 7%;
    top: 94px;
    height: 2px;
    background:
        linear-gradient(
            to right,
            transparent 0%,
             rgba(65,65,65,0.72) 14%,
            #414141 50%,
            rgba(65,65,65,0.72) 86%,
            transparent 100%
        );
    box-shadow: 0 0 6px rgba(65,65,65,0.14);
    pointer-events: none;
}


            if (popup.style.display === 'none' || popup.style.display === '') {
.meeting-person-card {
                popup.style.display = 'block';
    position: relative;
                positionPlaylistPopup();
    z-index: 3;
            } else {
    background: transparent;
                popup.style.display = 'none';
    color: #fff;
            }
    text-align: center;
        });
    vertical-align: top;
    padding: 0;
    box-sizing: border-box;
}


    $(document)
.meeting-chair-card {
        .off('click.clbiPlaylistOutside')
    width: 180px;
        .on('click.clbiPlaylistOutside', function(e) {
}
            var popup = document.getElementById('clbi-playlist-popup');
            var toggle = document.getElementById('clbi-playlist-toggle');
            if (!popup || !toggle) return;


            if (!popup.contains(e.target) && !toggle.contains(e.target)) {
.meeting-side .meeting-person-card {
                popup.style.display = 'none';
    width: 50%;
            }
    min-width: 0;
        });
}


    $(window)
.meeting-advisory-card {
        .off('resize.clbiPlaylist')
    width: 33.333%;
        .on('resize.clbiPlaylist', function() {
    min-width: 0;
            var popup = document.getElementById('clbi-playlist-popup');
            if (popup && popup.style.display === 'block') {
                positionPlaylistPopup();
            }
        });
}
}
// ========== 플레이리스트 팝업 시스템 끝 ==========


function initUserProfilePage() {
.meeting-person-inner {
     var saveBtn = document.getElementById('pref-save');
     display: flex;
     if (!saveBtn) return;
    justify-content: center;
     padding: 0;
    background: transparent;
}


    var adminEl = document.getElementById('pref-is-admin');
.meeting-person-stack {
     var isAdmin = adminEl && adminEl.getAttribute('data-admin') === '1';
    width: 90%;
     var api = new mw.Api();
     margin-top: 3px;
     var selectedFile = null;
     background: transparent;
     var cropper = null;
    display: flex;
     flex-direction: column;
     align-items: center;
}


    if (!document.getElementById('clbi-gallery-modal')) {
.meeting-side .meeting-person-stack {
        var gModal = document.createElement('div');
    width: 94%;
        gModal.id = 'clbi-gallery-modal';
}
        gModal.style.cssText =
            'display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.85);z-index:99999;align-items:center;justify-content:center;';


        gModal.innerHTML =
.meeting-advisory-card .meeting-person-stack {
            '<div style="background:#1e1e1e;border:2px solid #854369;border-radius:12px;padding:24px;max-width:480px;width:90%;display:flex;flex-direction:column;gap:16px;">' +
    width: 92%;
                '<div style="display:flex;justify-content:space-between;align-items:center;">' +
}
                    '<span style="font-size:14px;font-weight:700;color:#e2e2e2;">프로필 사진 선택</span>' +
                    '<button type="button" id="clbi-gallery-close" style="background:none;border:none;color:#aaa;font-size:18px;cursor:pointer;">✕</button>' +
                '</div>' +
                '<button type="button" id="clbi-gallery-upload-btn" style="background:#2a2a2a;border:2px dashed #854369;border-radius:8px;padding:32px;color:#e2e2e2;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:8px;font-size:13px;width:100%;">' +
                    '<span style="font-size:32px;">🖼️</span>새 사진 업로드' +
                '</button>' +
                '<div id="clbi-gallery-history-section" style="display:none;">' +
                    '<div style="font-size:11px;color:#888;margin-bottom:8px;">이전 사진 — 클릭하면 바로 적용</div>' +
                    '<div id="clbi-gallery-history" style="display:flex;gap:8px;flex-wrap:wrap;"></div>' +
                '</div>' +
            '</div>';


        document.body.appendChild(gModal);
.meeting-person-stack .compact-crt-media {
     }
    margin-left: auto;
     margin-right: auto;
    flex: 0 0 auto;
}


    if (!document.getElementById('clbi-crop-modal')) {
.meeting-person-stack .office-card-name-cell {
        var cModal = document.createElement('div');
    width: 170px;
        cModal.id = 'clbi-crop-modal';
    max-width: 100%;
        cModal.style.cssText =
    margin-top: 6px;
            'display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.85);z-index:99999;align-items:center;justify-content:center;';
    margin-left: auto;
    margin-right: auto;
    flex: 0 0 auto;
}


        cModal.innerHTML =
.meeting-chair-card .office-card-name-cell {
            '<div style="background:#1e1e1e;border:2px solid #854369;border-radius:12px;padding:24px;max-width:500px;width:90%;display:flex;flex-direction:column;gap:16px;">' +
    width: 170px;
                '<div style="font-size:14px;font-weight:700;color:#e2e2e2;">사진 조정</div>' +
}
                '<div style="width:100%;max-height:380px;overflow:hidden;border-radius:8px;">' +
                    '<img id="clbi-crop-image" style="max-width:100%;">' +
                '</div>' +
                '<div style="display:flex;gap:8px;justify-content:flex-end;">' +
                    '<button type="button" id="clbi-crop-cancel" style="background:#2a2a2a;color:#e2e2e2;border:1px solid #444;padding:8px 16px;border-radius:6px;cursor:pointer;">취소</button>' +
                    '<button type="button" id="clbi-crop-confirm" style="background:#854369;color:#fff;border:none;padding:8px 16px;border-radius:6px;cursor:pointer;">확정</button>' +
                '</div>' +
            '</div>';


        document.body.appendChild(cModal);
.meeting-advisory-card .office-card-name-cell {
    }
    width: 170px;
}


    var gModal = document.getElementById('clbi-gallery-modal');
.meeting-office {
     var cModal = document.getElementById('clbi-crop-modal');
    display: block;
     var cropImage = document.getElementById('clbi-crop-image');
    margin-top: 2px;
     var pfpInput = document.getElementById('pref-pfp-input');
    color: #7F7F7F;
     font-size: 10px;
     line-height: 1.3;
     font-weight: normal;
}


    function openGallery() {
/* =========================================
        gModal.style.display = 'flex';
  ScreenHeader
  ========================================= */


        var username = mw.config.get('wgUserName');
.liberty-content:has(.screen-header) .liberty-content-header .title {
        api.get({
    display: none !important;
            action: 'query',
}
            titles: '파일:Pfp-' + username + '.png',
            prop: 'imageinfo',
            iiprop: 'url|timestamp',
            iilimit: 6
        }).then(function(data) {
            var pages = data.query.pages;
            var page = pages[Object.keys(pages)[0]];
            if (!page.imageinfo || page.imageinfo.length === 0) return;


            var historyEl = document.getElementById('clbi-gallery-history');
.Liberty .content-wrapper .liberty-content:has(.screen-header) .liberty-content-main {
            var sectionEl = document.getElementById('clbi-gallery-history-section');
    position: relative !important;
            historyEl.innerHTML = '';
    box-sizing: border-box !important;
    background: #171717 !important;
    border: 2px solid #854369 !important;
    border-bottom: none !important;
}


            page.imageinfo.forEach(function(info, idx) {
.liberty-content:has(.screen-header) .screen-title-plate,
                var wrap = document.createElement('div');
.liberty-content:has(.screen-header) .screen-header-frame,
                wrap.style.cssText = 'position:relative;cursor:pointer;';
.liberty-content:has(.screen-header) .screen-header-inner,
.liberty-content:has(.screen-header) .screen-header-media,
.liberty-content:has(.screen-header) .screen-header-vignette,
.liberty-content:has(.screen-header) .screen-header-scanline,
.liberty-content:has(.screen-header) .screen-header-mask,
.liberty-content:has(.screen-header) .screen-header-glass,
.liberty-content:has(.screen-header) .screen-header-subtitle {
    display: none !important;
}


                var img = document.createElement('img');
.screen-header {
                img.src = info.url;
    position: relative !important;
                img.style.cssText =
    width: calc(100% + 32px) !important;
                    'width:72px;height:72px;object-fit:cover;border-radius:8px;border:2px solid #444;flex-shrink:0;';
    height: var(--screen-header-height, 360px) !important;
    margin: -16px -16px 0 -16px !important;
    padding: 8px 8px 4px 8px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    background: #171717 !important;
    border: 0 !important;
    border-bottom: 0 !important;
    isolation: isolate !important;
}


                if (idx === 0) {
.screen-header-recess {
                    img.style.borderColor = '#854369';
    position: relative !important;
                    var badge = document.createElement('div');
    width: 100% !important;
                    badge.textContent = '현재';
    height: 100% !important;
                    badge.style.cssText =
    margin: 0 !important;
                        'position:absolute;bottom:4px;left:50%;transform:translateX(-50%);background:#854369;color:#fff;font-size:9px;padding:1px 6px;border-radius:10px;';
    padding: 4px !important;
                    wrap.appendChild(badge);
    box-sizing: border-box !important;
                }
    overflow: hidden !important;
    background: #171717 !important;
    border: none !important;
    border-radius: 6px !important;
    box-shadow:
        inset 0 18px 30px rgba(0,0,0,0.55),
        inset 0 -9px 16px rgba(255,255,255,0.018),
        inset 18px 0 30px rgba(0,0,0,0.40),
        inset -18px 0 30px rgba(0,0,0,0.40) !important;
}


                img.addEventListener('mouseenter', function() {
.screen-header-recess::before {
                    if (idx !== 0) img.style.borderColor = '#854369';
    content: "";
                });
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.10;
    background:
        repeating-linear-gradient(
            135deg,
            rgba(255,255,255,0.030) 0px,
            rgba(255,255,255,0.030) 1px,
            transparent 1px,
            transparent 5px
        );
    mix-blend-mode: screen;
}


                img.addEventListener('mouseleave', function() {
.screen-header-recess::after {
                    if (idx !== 0) img.style.borderColor = '#444';
    content: "";
                });
    position: absolute;
    inset: 14px;
    z-index: 12;
    pointer-events: none;
    border-radius: 0;
    box-shadow:
        0 -20px 32px rgba(0,0,0,0.86),
        0 12px 18px rgba(255,255,255,0.024),
        -20px 0 32px rgba(0,0,0,0.78),
        20px 0 32px rgba(0,0,0,0.78),
        inset 0 0 0 1px rgba(255,255,255,0.018) !important;
}


                img.addEventListener('click', function() {
.screen-header .screen-header-crt {
                    fetch(info.url)
    position: relative !important;
                        .then(function(r) {
    z-index: 2 !important;
                            return r.blob();
    width: 100% !important;
                        })
    height: 100% !important;
                        .then(function(blob) {
    aspect-ratio: auto !important;
                            selectedFile = new File([blob], 'profile.png', { type: 'image/png' });
    margin: 0 !important;
                            document.getElementById('pref-pfp-preview').src = URL.createObjectURL(blob);
    padding: 0 !important;
                            gModal.style.display = 'none';
    box-sizing: border-box !important;
                            document.getElementById('pref-pfp-btn').textContent = '✓ 사진 선택됨';
    overflow: hidden !important;
                        });
    background: transparent !important;
                });
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}


                wrap.appendChild(img);
.screen-header .screen-header-crt::before,
                historyEl.appendChild(wrap);
.screen-header .screen-header-crt::after {
            });
    content: none !important;
}


            sectionEl.style.display = 'block';
.screen-header .crt-page-monitor-inner {
         });
    position: relative !important;
     }
    width: 100% !important;
    height: 100% !important;
    padding: 5px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    background:
        linear-gradient(
            145deg,
            #111111 0%,
            #1a1a1a 46%,
            #111111 100%
         ) !important;
    border: none !important;
     box-shadow:
        inset 0 10px 20px rgba(0,0,0,0.70),
        inset 0 -2px 4px rgba(255,255,255,0.022),
        inset 8px 0 18px rgba(0,0,0,0.55),
        inset -8px 0 18px rgba(0,0,0,0.55) !important;
}


     function openCrop(src) {
.screen-header .crt-page-monitor-screen {
         cropImage.src = src;
     position: relative !important;
         cModal.style.display = 'flex';
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    background: #050505 !important;
    border: 1px solid #050505 !important;
    box-shadow:
        inset 0 0 0 1px #111,
        inset 0 0 24px rgba(0,0,0,0.94),
         inset 0 0 64px rgba(0,0,0,0.80),
         inset 0 0 118px rgba(0,0,0,0.50),
        0 0 0 1px rgba(255,255,255,0.030) !important;
}


        if (cropper) {
.screen-header .crt-page-monitor-image,
            cropper.destroy();
.screen-header .crt-page-monitor-image-base,
            cropper = null;
.screen-header .crt-page-monitor-image-bloom,
        }
.screen-header .crt-page-monitor-slice {
    position: absolute !important;
    inset: 0 !important;
    border-radius: 0 !important;
}


        setTimeout(function() {
.screen-header .crt-page-monitor-image-base a,
            cropper = new Cropper(cropImage, {
.screen-header .crt-page-monitor-image-base span,
                aspectRatio: 1,
.screen-header .crt-page-monitor-image-base .mw-file-description,
                viewMode: 1,
.screen-header .crt-page-monitor-image-base .mw-default-size,
                dragMode: 'move',
.screen-header .crt-page-monitor-image-base .mw-image-border,
                autoCropArea: 0.8,
.screen-header .crt-page-monitor-image-bloom a,
                cropBoxResizable: true,
.screen-header .crt-page-monitor-image-bloom span,
                cropBoxMovable: true
.screen-header .crt-page-monitor-image-bloom .mw-file-description,
            });
.screen-header .crt-page-monitor-image-bloom .mw-default-size,
        }, 150);
.screen-header .crt-page-monitor-image-bloom .mw-image-border,
     }
.screen-header .crt-page-monitor-slice a,
.screen-header .crt-page-monitor-slice span,
.screen-header .crt-page-monitor-slice .mw-file-description,
.screen-header .crt-page-monitor-slice .mw-default-size,
.screen-header .crt-page-monitor-slice .mw-image-border {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
     height: 100% !important;
}


    document.getElementById('pref-pfp-btn').addEventListener('click', function() {
.screen-header .crt-page-monitor-image-base img,
        openGallery();
.screen-header .crt-page-monitor-image-base .mw-file-element,
     });
.screen-header .crt-page-monitor-image-bloom img,
.screen-header .crt-page-monitor-image-bloom .mw-file-element,
.screen-header .crt-page-monitor-slice img,
.screen-header .crt-page-monitor-slice .mw-file-element,
.screen-header .crt-page-monitor-slice-img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: var(--screen-image-position, center center) !important;
     border: 0 !important;
    border-radius: 0 !important;
}


     document.getElementById('clbi-gallery-upload-btn').addEventListener('click', function() {
.screen-header .crt-page-monitor-screen::before {
         pfpInput.click();
    content: "" !important;
    });
     position: absolute !important;
    inset: -4px !important;
    z-index: 20 !important;
    pointer-events: none !important;
    border-radius: 0 !important;
    background:
        radial-gradient(
            ellipse at 50% 50%,
            transparent 0%,
            transparent 62%,
            rgba(0,0,0,0.18) 78%,
            rgba(0,0,0,0.48) 100%
        ),
        linear-gradient(
            to bottom,
            rgba(0,0,0,0.20) 0%,
            transparent 14%,
            transparent 82%,
            rgba(0,0,0,0.28) 100%
        ),
        linear-gradient(
            to right,
            rgba(0,0,0,0.20) 0%,
            transparent 8%,
            transparent 92%,
            rgba(0,0,0,0.20) 100%
        ),
        linear-gradient(
            105deg,
            transparent 0%,
            rgba(255,255,255,0.030) 18%,
            transparent 38%,
            transparent 100%
        ) !important;
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.018),
        inset 0 0 24px rgba(255,255,255,0.015),
        inset 0 0 74px rgba(0,0,0,0.64),
        inset 0 22px 38px rgba(0,0,0,0.60),
        inset 0 -20px 36px rgba(0,0,0,0.44),
         inset 18px 0 36px rgba(0,0,0,0.56),
        inset -18px 0 36px rgba(0,0,0,0.56) !important;
}


     document.getElementById('clbi-gallery-close').addEventListener('click', function() {
.screen-header .crt-page-monitor-screen::after {
         gModal.style.display = 'none';
     content: "" !important;
     });
    position: absolute !important;
    inset: -80px -4px !important;
    z-index: 21 !important;
    pointer-events: none !important;
    opacity: 0.22 !important;
    border-radius: 0 !important;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,0.08) 0px,
            rgba(255,255,255,0.08) 1px,
            transparent 2px,
            transparent 5px
         ) !important;
    mix-blend-mode: screen !important;
     animation: crt-scanlines-up 7s linear infinite !important;
}


    pfpInput.addEventListener('change', function() {
.screen-header .crt-page-monitor-glitch,
        var file = this.files[0];
.screen-header .crt-page-monitor-tear {
        if (!file) return;
    inset: -4px !important;
    border-radius: 0 !important;
}


        gModal.style.display = 'none';
.screen-header .crt-page-monitor-glitch {
    z-index: 22 !important;
}


        var reader = new FileReader();
.screen-header .crt-page-monitor-tear {
        reader.onload = function(e) {
    z-index: 23 !important;
            openCrop(e.target.result);
}
        };
        reader.readAsDataURL(file);
    });


    document.getElementById('clbi-crop-cancel').addEventListener('click', function() {
.screen-header-title {
        cModal.style.display = 'none';
    position: absolute !important;
        if (cropper) {
    left: 5px !important;
            cropper.destroy();
    bottom: 5px !important;
            cropper = null;
    z-index: 40 !important;
        }
    margin: 0 !important;
        pfpInput.value = '';
    padding: 0 !important;
     });
    max-width: calc(100% - 10px) !important;
    box-sizing: border-box !important;
    background: transparent !important;
    border: 0 !important;
     box-shadow: none !important;
}


     document.getElementById('clbi-crop-confirm').addEventListener('click', function() {
.screen-header-title-main {
         if (!cropper) return;
    margin: 0 !important;
    padding: 0 0 8px 10px !important;
    border: 0 !important;
    background: transparent !important;
     box-shadow: none !important;
    color: #ffffff !important;
    font-family: 'BoldRound', sans-serif !important;
    font-size: 40px !important;
    font-weight: 700 !important;
    line-height: 0.95 !important;
    letter-spacing: 0.06em !important;
    text-shadow:
        3px 3px 0 rgba(0,0,0,0.98),
        0 0 6px rgba(0,0,0,0.98),
        0 0 14px rgba(0,0,0,0.95),
        0 0 26px rgba(0,0,0,0.92),
        -1px 0 0 rgba(80,160,255,0.24),
         1px 0 0 rgba(255,55,90,0.22) !important;
    white-space: nowrap !important;
}


        var canvas = cropper.getCroppedCanvas({ width: 256, height: 256 });
.screen-header-subtitle {
        if (!canvas) return;
    display: none !important;
}


        canvas.toBlob(function(blob) {
.screen-header + .screen-body {
            selectedFile = new File([blob], 'profile.png', { type: 'image/png' });
    border-top: 0 !important;
            document.getElementById('pref-pfp-preview').src = URL.createObjectURL(blob);
    margin-top: 0 !important;
            cModal.style.display = 'none';
}
            cropper.destroy();
            cropper = null;
            document.getElementById('pref-pfp-btn').textContent = '✓ 사진 선택됨';
        }, 'image/png');
    });


    var emailSaveBtn = document.getElementById('pref-email-save');
/* =========================================
    if (emailSaveBtn) {
  Document View System — doc-*
        emailSaveBtn.addEventListener('click', function() {
  ========================================= */
            var statusEl = document.getElementById('pref-email-status');
            var newEmail = document.getElementById('pref-new-email').value;
            var password = document.getElementById('pref-email-password').value;


            if (!newEmail || !password) {
.screen-body {
                statusEl.textContent = '이메일과 비밀번호를 입력해주세요.';
    position: relative;
                return;
    width: calc(100% + 32px);
            }
    margin: 0 -16px 0 -16px;
    padding: 4px 8px 4px 8px;
    box-sizing: border-box;
    background: #171717;
    box-shadow:
        inset 1px 0 0 #494949,
        inset 0 2px 8px rgba(0,0,0,0.60);
    border-top: 0;
    overflow: visible;
}


            statusEl.textContent = '변경 중...';
.doc-body {
    position: relative;
    z-index: 3;
    box-sizing: border-box;
    width: 100%;
    padding: 0;
    background: transparent;
}


            api.postWithToken('csrf', {
/* =========================================
                action: 'changeemail',
  doc-header
                email: newEmail,
  ========================================= */
                password: password
            }).then(function() {
                statusEl.textContent = '✓ 이메일 변경됨';
                document.getElementById('pref-new-email').value = '';
                document.getElementById('pref-email-password').value = '';


                setTimeout(function() {
.doc-header {
                    statusEl.textContent = '';
    position: relative;
                }, 3000);
    display: grid;
             }).fail(function(code, data) {
    grid-template-columns: 24px 1fr auto 24px;
                var msg = data && data.error && data.error.info ? data.error.info : '변경 실패';
    align-items: center;
                statusEl.textContent = msg;
    height: 28px;
            });
    margin-bottom: 7px;
        });
    padding: 0 8px;
     }
    box-sizing: border-box;
    background:
        linear-gradient(
            to bottom,
            #282828 0%,
             #1a1a1a 40%,
            #161616 100%
        );
    border-top: 1px solid #3a3a3a;
    border-bottom: 1px solid #0a0a0a;
    border-left: 1px solid #222;
    border-right: 1px solid #222;
     border-radius: 2px;
}


     saveBtn.addEventListener('click', function() {
.doc-header::before {
         var statusEl = document.getElementById('pref-status');
    content: "";
        statusEl.textContent = '저장 중...';
    position: absolute;
    inset: 0;
    pointer-events: none;
     opacity: 0.06;
    background: repeating-linear-gradient(
        135deg,
        rgba(255,255,255,0.08) 0px,
         rgba(255,255,255,0.08) 1px,
        transparent 1px,
        transparent 4px
    );
    border-radius: inherit;
}


        var promises = [];
.doc-header-id {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: #c0c0c0;
    text-shadow: 0 1px 0 rgba(0,0,0,0.80);
    position: relative;
    z-index: 1;
}


        if (selectedFile) {
.doc-screw {
            var username = mw.config.get('wgUserName');
    position: relative;
            promises.push(
    z-index: 1;
                api.postWithToken('csrf', {
    width: 10px;
                    action: 'upload',
    height: 10px;
                    filename: 'Pfp-' + username + '.png',
    border-radius: 50%;
                    ignorewarnings: true,
    background:
                    file: selectedFile,
        radial-gradient(circle at 36% 32%, rgba(255,255,255,0.35) 0%, transparent 28%),
                    format: 'json'
        linear-gradient(145deg, #505050 0%, #282828 55%, #0e0e0e 100%);
                }, {
    border: 1px solid #090909;
                    contentType: 'multipart/form-data'
    box-shadow:
                })
        inset 0 1px 0 rgba(255,255,255,0.15),
            );
        inset 0 -1px 0 rgba(0,0,0,0.60),
        }
        0 0 0 1px #333;
    justify-self: center;
}


        var fields = ['name', 'discord', 'role', 'bio'];
.doc-screw::after {
        if (isAdmin) fields.push('badges');
    content: "";
    position: absolute;
    top: 50%;
    left: 15%;
    right: 15%;
    height: 1px;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.55);
    border-radius: 1px;
}


        for (var i = 0; i < fields.length; i++) {
.doc-status {
            var el = document.getElementById('pref-' + fields[i]);
    display: flex;
            if (!el) continue;
    align-items: center;
    gap: 5px;
    position: relative;
    z-index: 1;
}


            promises.push(
.doc-status-lamp {
                api.postWithToken('csrf', {
    display: inline-block;
                    action: 'options',
    width: 8px;
                    optionname: 'profile-' + fields[i],
    height: 8px;
                    optionvalue: el.value
    border-radius: 50%;
                })
    background: #111;
            );
    border: 1px solid #060606;
        }
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.06),
        0 0 0 1px #252525;
}


        $.when.apply($, promises)
.doc-status-lamp.on {
            .then(function() {
    background: radial-gradient(circle at 38% 32%, #d9ff9d 0%, #7ec43e 45%, #253d18 100%);
                statusEl.textContent = '✓ 저장됨';
    box-shadow:
                selectedFile = null;
        inset 0 1px 0 rgba(255,255,255,0.28),
                document.getElementById('pref-pfp-btn').textContent = '사진 선택';
        0 0 0 1px #1a3010,
        0 0 5px rgba(100,200,50,0.45);
}


                setTimeout(function() {
.doc-status-lamp.warn {
                    statusEl.textContent = '';
    background: radial-gradient(circle at 38% 32%, #ffe8b0 0%, #d89a42 45%, #4d2a0d 100%);
                }, 2000);
    box-shadow:
            })
        inset 0 1px 0 rgba(255,255,255,0.28),
            .fail(function() {
        0 0 0 1px #3a1f06,
                statusEl.textContent = '저장 실패';
        0 0 5px rgba(220,140,40,0.45);
            });
    });
}
}


/* =========================================
/* =========================================
   Banner / CRT Page Monitor thumbnail slices
   doc-layout
  - base 이미지는 틀에 들어간 파일 문법 그대로 사용
  - slice 레이어에는 300px MediaWiki 썸네일만 삽입
   ========================================= */
   ========================================= */


(function ($, mw) {
.doc-layout {
     var thumbCache = {};
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) 320px;
    gap: 7px;
    align-items: stretch;
     min-height: 480px;
}


    function parseSliceWidth(value) {
.doc-layout-left,
        var parsed = parseInt(value, 10);
.doc-layout-center,
.doc-layout-right {
    min-width: 0;
}


        if (!isFinite(parsed) || parsed < 120) {
.doc-layout-center,
            return 300;
.doc-layout-right {
        }
    display: flex;
    flex-direction: column;
    gap: 7px;
}


        return parsed;
.doc-layout-lower {
     }
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
     gap: 7px;
    flex: 1;
}


    function getImageSrc(img) {
/* =========================================
        return img ? (img.currentSrc || img.getAttribute('src') || img.src || '') : '';
  doc-panel
    }
  ========================================= */


     function getFileNameFromSrc(src) {
.doc-panel {
        var a;
    position: relative;
        var parts;
    box-sizing: border-box;
        var fileName;
     width: 100%;
    min-width: 0;
    background: #1a1a1a;
    border-top: 1px solid #303030;
    border-bottom: 1px solid #080808;
    border-left: 1px solid #222;
    border-right: 1px solid #111;
    border-radius: 2px;
    overflow: hidden;
}


         if (!src) return '';
.doc-panel::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, rgba(255,255,255,0.25) 0%, transparent 40%),
         linear-gradient(145deg, #444 0%, #1e1e1e 100%);
    border: 1px solid #080808;
    box-shadow: 0 0 0 1px #2a2a2a;
    pointer-events: none;
    z-index: 10;
}


         a = document.createElement('a');
.doc-panel::after {
        a.href = src;
    content: "";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background:
         radial-gradient(circle at 35% 30%, rgba(255,255,255,0.25) 0%, transparent 40%),
        linear-gradient(145deg, #444 0%, #1e1e1e 100%);
    border: 1px solid #080808;
    box-shadow: 0 0 0 1px #2a2a2a;
    pointer-events: none;
    z-index: 10;
}


        parts = (a.pathname || '').split('/').filter(function (part) {
.doc-panel-title {
            return !!part;
    position: relative;
        });
    z-index: 3;
    box-sizing: border-box;
    padding: 6px 10px 5px 10px;
    font-family: 'Galmuri11', sans-serif !important;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    letter-spacing: 0.10em;
    color: #888;
    background: linear-gradient(to bottom, #161616 0%, #121212 100%);
    border-bottom: 1px solid #0d0d0d;
    text-shadow: 0 1px 0 rgba(0,0,0,0.80);
    text-transform: uppercase;
}


        if (!parts.length) return '';
.doc-panel-heading {
    padding: 10px 18px;
    font-size: 11px;
    font-weight: 700;
    color: #7a7a7a;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 0 rgba(0,0,0,0.80);
    position: relative;
    z-index: 3;
}


        fileName = parts.pop();
.doc-panel table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}


        /*
.doc-panel table th,
        * MediaWiki thumb URL 예시:
.doc-panel table td {
        * /images/thumb/a/ab/File.png/1000px-File.png
    background: transparent !important;
        * /images/thumb/a/ab/File.svg/1000px-File.svg.png
    border: none !important;
        *
    padding: 0 !important;
        * 이 경우 실제 파일명은 마지막 조각이 아니라 그 앞 조각이다.
    vertical-align: middle !important;
        */
}
        if (/^\d+px-/.test(fileName) && parts.length) {
            fileName = parts.pop();
        }


        fileName = fileName.replace(/^\d+px-/, '');
.doc-panel table th[style],
.doc-panel table td[style] {
    background: revert !important;
    border: revert !important;
    padding: revert !important;
}


        try {
/* =========================================
            fileName = decodeURIComponent(fileName);
  doc-display
        } catch (e) {}
  ========================================= */


         return fileName;
.doc-display {
    }
    position: relative;
    z-index: 3;
    box-sizing: border-box;
    padding: 4px 14px;
    margin-bottom: 0;
    min-height: 90px;
    line-height: 1.8;
    color: #d8d8d8;
    background: #111111;
    border-top: 1px solid #0a0a0a;
    box-shadow:
        inset 0 2px 6px rgba(0,0,0,0.55),
         inset 0 0 1px rgba(0,0,0,0.80);
}


    function resolveThumbUrl(img, width, callback) {
/* =========================================
        var src = getImageSrc(img);
  doc-info
        var fileName = getFileNameFromSrc(src);
  ========================================= */
        var cacheKey;
        var entry;


        if (!src) return;
.doc-info-row {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin: 7px 10px 0 10px;
}


        if (!fileName || !mw || !mw.loader) {
.doc-info-key {
            callback(src);
    font-size: 10px;
            return;
    font-weight: 700;
        }
    color: #7a7a7a;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 0 rgba(0,0,0,0.70);
}


         cacheKey = fileName + '|' + width;
.doc-info-value {
         entry = thumbCache[cacheKey];
    position: relative;
    overflow: hidden;
    text-align: right;
    border-radius: 2px;
    background: #0e0e0e;
    color: #d8d8d8;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 700;
    box-sizing: border-box;
    border-top: 1px solid #0a0a0a;
    border-bottom: 1px solid #252525;
    border-left: 1px solid #111;
    border-right: 1px solid #111;
    box-shadow:
         inset 0 2px 4px rgba(0,0,0,0.60),
         inset 1px 0 0 rgba(255,255,255,0.015);
}


         if (entry) {
.doc-info-value::after {
            if (entry.resolved) {
    content: "";
                callback(entry.url || src);
    position: absolute;
            } else {
    inset: 0;
                entry.callbacks.push(callback);
    z-index: 2;
            }
    pointer-events: none;
            return;
    opacity: 0.15;
        }
    background: repeating-linear-gradient(
         to bottom,
        rgba(255,255,255,0.055) 0px,
        rgba(255,255,255,0.055) 1px,
        transparent 2px,
        transparent 4px
    );
    mix-blend-mode: screen;
}


        entry = {
.doc-info-block {
            resolved: false,
    padding: 0 8px 6px 8px;
            url: '',
    background: #1a1a1a;
            callbacks: [callback]
}
        };


        thumbCache[cacheKey] = entry;
.doc-info-block-label {
    display: block;
    padding: 6px 2px 4px 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a9a9a;
    text-shadow: 0 1px 0 rgba(0,0,0,0.80);
}


        function finish(url) {
/* =========================================
            var callbacks = entry.callbacks.slice();
  doc-nav
            var i;
  ========================================= */


            entry.resolved = true;
.doc-nav {
            entry.url = url || src;
    height: 100%;
            entry.callbacks = [];
    display: flex;
    flex-direction: column;
}


            for (i = 0; i < callbacks.length; i++) {
.doc-nav-item {
                callbacks[i](entry.url);
    position: relative;
            }
    z-index: 3;
        }
    box-sizing: border-box;
    width: calc(100% - 16px);
    margin: 5px 8px 0 8px;
    padding: 7px 24px 7px 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    color: #666;
    background: linear-gradient(to bottom, #232323 0%, #1a1a1a 50%, #161616 100%);
    border-top: 1px solid #2e2e2e;
    border-bottom: 1px solid #0a0a0a;
    border-left: 1px solid #222;
    border-right: 1px solid #111;
    border-radius: 2px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.025),
        0 1px 0 rgba(255,255,255,0.012);
    cursor: pointer;
    display: block;
    text-decoration: none;
    text-shadow: 0 1px 0 rgba(0,0,0,0.70);
}


        mw.loader.using('mediawiki.api').done(function () {
.doc-nav-item::after {
            var api = new mw.Api();
    content: "›";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #333;
    font-size: 13px;
}


            api.get({
.doc-nav-item.active {
                action: 'query',
    color: #e8e8e8;
                titles: 'File:' + fileName,
    background: linear-gradient(to bottom, #5a2040 0%, #3d1a2f 52%, #2e1222 100%);
                prop: 'imageinfo',
    border-top-color: #7a3055;
                iiprop: 'url',
    border-bottom-color: #1a0810;
                iiurlwidth: width,
    border-left-color: #6a2848;
                formatversion: 2
    box-shadow:
            }).done(function (data) {
        inset 0 1px 0 rgba(255,255,255,0.06),
                var page;
        0 0 6px rgba(212,90,162,0.10);
                var info;
}


                if (
.doc-nav-item.active::after {
                    data &&
    color: #d45aa2;
                    data.query &&
}
                    data.query.pages &&
                    data.query.pages.length
                ) {
                    page = data.query.pages[0];


                    if (
/* =========================================
                        page &&
  doc-status-row
                        page.imageinfo &&
  ========================================= */
                        page.imageinfo.length
                    ) {
                        info = page.imageinfo[0];
                    }
                }


                finish((info && (info.thumburl || info.url)) || src);
.doc-status-row {
            }).fail(function () {
    position: relative;
                finish(src);
    z-index: 3;
            });
    display: flex;
        }).fail(function () {
    align-items: center;
            finish(src);
    gap: 7px;
        });
    margin: 5px 8px 0 8px;
    }
    padding: 5px 9px;
    box-sizing: border-box;
    font-size: 10px;
    font-weight: 700;
    color: #555;
    background: #111;
    border-top: 1px solid #0a0a0a;
    border-bottom: 1px solid #222;
    border-left: 1px solid #111;
    border-right: 1px solid #111;
    border-radius: 2px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.50);
    letter-spacing: 0.06em;
    text-shadow: 0 1px 0 rgba(0,0,0,0.80);
}


    function applySliceImages(frame, thumbUrl) {
/* =========================================
        var slices;
  doc-link
        var i;
  ========================================= */
        var img;


        if (!frame || !thumbUrl) return;
.doc-link {
    position: relative;
    z-index: 3;
    box-sizing: border-box;
    margin: 5px 10px 0 10px;
    padding: 6px 10px 6px 14px;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    background: linear-gradient(to bottom, #1a1a1a 0%, #151515 100%);
    border-top: 1px solid #242424;
    border-bottom: 1px solid #080808;
    border-left: 1px solid #1e1e1e;
    border-right: 1px solid #111;
    border-radius: 2px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.018);
    display: block;
    text-decoration: none;
    cursor: pointer;
    text-shadow: 0 1px 0 rgba(0,0,0,0.70);
}


        slices = frame.querySelectorAll('.crt-page-monitor-slice');
.doc-link::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 20%;
    bottom: 20%;
    width: 2px;
    background: #2e2e2e;
    border-radius: 1px;
}


        for (i = 0; i < slices.length; i++) {
.doc-link:hover {
            slices[i].innerHTML = '';
    color: #c0c0c0;
    background: linear-gradient(to bottom, #222 0%, #1a1a1a 100%);
    border-top-color: #333;
}


            img = document.createElement('img');
.doc-link:hover::before {
            img.className = 'crt-page-monitor-slice-img';
    background: #854369;
            img.src = thumbUrl;
}
            img.alt = '';
            img.decoding = 'async';
            img.loading = 'eager';
            img.setAttribute('aria-hidden', 'true');


            slices[i].appendChild(img);
/* =========================================
        }
  doc-tab-bar
  ========================================= */


        frame.setAttribute('data-crt-slices-ready', '1');
.doc-tab-bar {
     }
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 6px;
    background: linear-gradient(to bottom, #141414 0%, #111 100%);
     border-top: 1px solid #0a0a0a;
    box-shadow: inset 0 1px 0 rgba(0,0,0,0.60);
}


     function initBannerFrame(frame) {
.doc-tab-key {
        var baseImg;
    display: flex;
        var width;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
     gap: 3px;
    padding: 0 4px;
    user-select: none;
    white-space: nowrap;
}


        if (!frame) return;
.doc-tab-key kbd {
         if (frame.getAttribute('data-crt-slices-ready') === '1') return;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 10px;
    font-weight: 700;
    font-family: inherit;
    color: #e2e2e2;
    background: linear-gradient(to bottom, #2a2a2a 0%, #1e1e1e 100%);
    border-top: 1px solid #3a3a3a;
    border-bottom: 1px solid #080808;
    border-left: 1px solid #2e2e2e;
    border-right: 1px solid #111;
    border-radius: 2px;
    box-shadow:
         inset 0 1px 0 rgba(255,255,255,0.06),
        0 1px 0 rgba(255,255,255,0.02);
    text-shadow: 0 1px 0 rgba(0,0,0,0.80);
}


        baseImg = frame.querySelector('.crt-page-monitor-image-base img');
.doc-tab-key .doc-tab-arrow {
    font-size: 10px;
    color: #333;
    line-height: 1;
}


        if (!baseImg) return;
.doc-tab {
    flex: 1;
    box-sizing: border-box;
    padding: 6px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #e2e2e2;
    background: linear-gradient(to bottom, #1e1e1e 0%, #181818 100%);
    border-top: 1px solid #2a2a2a;
    border-bottom: 1px solid #080808;
    border-left: 1px solid #222;
    border-right: 1px solid #111;
    border-radius: 2px;
    cursor: pointer;
    text-align: center;
    text-shadow: 0 1px 0 rgba(0,0,0,0.80);
    text-transform: uppercase;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


        width = parseSliceWidth(frame.getAttribute('data-crt-slice-width'));
.doc-tab:hover {
    color: #ffffff;
    background: linear-gradient(to bottom, #242424 0%, #1a1a1a 100%);
    border-top-color: #333;
}


        resolveThumbUrl(baseImg, width, function (thumbUrl) {
.doc-tab.active {
            if (!frame || !frame.parentNode) return;
    color: #ffffff;
            applySliceImages(frame, thumbUrl);
    background: linear-gradient(to bottom, #2e1222 0%, #3d1a2f 52%, #5a2040 100%);
        });
     border-top-color: #7a3055;
     }
    border-bottom-color: #1a0810;
 
     border-left-color: #6a2848;
    function initBannerFrames(root) {
     box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
        var scope = root && root.querySelectorAll ? root : document;
}
        var frames = scope.querySelectorAll('.crt-page-monitor-frame');
        var i;
 
        for (i = 0; i < frames.length; i++) {
            initBannerFrame(frames[i]);
        }
    }
 
    $(function () {
        initBannerFrames(document);
     });
 
     if (mw && mw.hook) {
        mw.hook('wikipage.content').add(function ($content) {
            initBannerFrames($content && $content[0] ? $content[0] : document);
        });
    }
})(jQuery, window.mw);


/* =========================================
/* =========================================
   Doc Tab System — Q/E 단축키 탭 전환
   doc-footer
  글리치 플리커 + RGB split + 방향 슬라이드
   ========================================= */
   ========================================= */


(function () {
.doc-footer {
     'use strict';
    position: relative;
    display: grid;
    grid-template-columns: 1fr 110px 44px 110px 200px;
    gap: 12px;
    align-items: center;
    height: 44px;
    margin-top: 7px;
    padding: 0 10px;
    box-sizing: border-box;
    background: linear-gradient(to bottom, #282828 0%, #1a1a1a 40%, #161616 100%);
    box-shadow:
        inset 1px 0 0 #494949,
        inset 0 -1px 0 #555,
        inset 0 2px 6px rgba(0,0,0,0.55);
    border-top: 1px solid #3a3a3a;
    border-bottom: 1px solid #0a0a0a;
    border-left: 1px solid #222;
    border-right: 1px solid #222;
     border-radius: 2px;
}


var keydownBound = false;
.doc-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.05;
    background: repeating-linear-gradient(
        135deg,
        rgba(255,255,255,0.08) 0px,
        rgba(255,255,255,0.08) 1px,
        transparent 1px,
        transparent 4px
    );
}


    function initDocTabs() {
.doc-footer-sliders {
        var tabBars = document.querySelectorAll('.doc-tab-bar');
    display: flex;
        if (!tabBars.length) return;
    align-items: center;
    gap: 10px;
}


        tabBars.forEach(function (bar) {
.doc-slider {
            if (bar.getAttribute('data-tabs-init')) return;
    position: relative;
            bar.setAttribute('data-tabs-init', '1');
    width: 80px;
    height: 6px;
    background: #0a0a0a;
    border-top: 1px solid #080808;
    border-bottom: 1px solid #222;
    border-radius: 99px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.70);
}


            var tabs = Array.from(bar.querySelectorAll('.doc-tab'));
.doc-slider.short {
            if (!tabs.length) return;
    width: 54px;
}


            var panel = bar.closest('.doc-panel');
.doc-slider::after {
            var display = panel ? panel.querySelector('.doc-display') : null;
    content: "";
            if (!display) display = document.getElementById('doc-main-display');
    position: absolute;
            if (!display) return;
    top: -6px;
    left: 48%;
    width: 10px;
    height: 18px;
    border-radius: 2px;
    background: linear-gradient(to bottom, #c8c0b2 0%, #8a8278 100%);
    border-top: 1px solid #d8d0c2;
    border-bottom: 1px solid #2a2622;
    border-left: 1px solid #aaa49c;
    border-right: 1px solid #5a544e;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.30),
        0 1px 3px rgba(0,0,0,0.40);
}


            tabs.forEach(function (tab, i) {
.doc-date {
                tab.addEventListener('click', function () {
    box-sizing: border-box;
                    var currentIdx = tabs.findIndex(function (t) {
    height: 26px;
                        return t.classList.contains('active');
    display: flex;
                    });
    align-items: center;
                    if (currentIdx === i) return;
    justify-content: center;
                    switchTab(tabs, display, i, i > currentIdx ? 1 : -1);
    font-size: 10px;
                });
    font-weight: 700;
            });
    letter-spacing: 0.12em;
    color: #d45aa2;
    background: #0a0a0a;
    border-top: 1px solid #080808;
    border-bottom: 1px solid #2a1a22;
    border-left: 1px solid #0e0e0e;
    border-right: 1px solid #0e0e0e;
    border-radius: 2px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.70);
    text-shadow: 0 0 8px rgba(212,90,162,0.40);
}


            var initIdx = tabs.findIndex(function (t) { return t.classList.contains('active'); });
.doc-knob {
            if (initIdx !== -1) {
    justify-self: center;
                var initRef = tabs[initIdx].dataset.ref;
    width: 32px;
                var initEl = initRef ? document.getElementById(initRef) : null;
    height: 32px;
                display.innerHTML = initEl ? initEl.innerHTML : (tabs[initIdx].dataset.content || '');
    border-radius: 50%;
            }
    background:
         });
        radial-gradient(circle at 36% 28%, rgba(255,255,255,0.30) 0%, transparent 24%),
        linear-gradient(145deg, #c8bfb0 0%, #8a8278 48%, #464039 100%);
    border: 1px solid #2a2520;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.30),
        inset 0 -2px 0 rgba(0,0,0,0.22),
         0 2px 5px rgba(0,0,0,0.50);
}


        if (!keydownBound) {
.doc-keys {
            keydownBound = true;
    display: grid;
            document.addEventListener('keydown', function (e) {
    grid-template-columns: repeat(5, 1fr);
                var tag = document.activeElement.tagName;
    gap: 5px;
                if (tag === 'INPUT' || tag === 'TEXTAREA') return;
}


                var bar = document.querySelector('.doc-tab-bar');
.doc-keys span {
                if (!bar) return;
    height: 22px;
                var tabs = Array.from(bar.querySelectorAll('.doc-tab'));
    border-radius: 2px;
    background: linear-gradient(to bottom, #d8d4ca 0%, #a09890 55%, #6e6660 100%);
    border-top: 1px solid #e0dcd2;
    border-bottom: 1px solid #1e1c18;
    border-left: 1px solid #b8b0a8;
    border-right: 1px solid #4a4440;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.40),
        0 1px 2px rgba(0,0,0,0.30);
}


                var panel = bar.closest('.doc-panel');
.doc-keys span.red {
                var display = panel ? panel.querySelector('.doc-display') : null;
    background: linear-gradient(to bottom, #cc6058 0%, #922e28 55%, #521410 100%);
                if (!display) display = document.getElementById('doc-main-display');
    border-top-color: #d87070;
                if (!display) return;
    border-bottom-color: #1e0808;
}


                var activeIdx = tabs.findIndex(function (t) {
.doc-keys span.amber {
                    return t.classList.contains('active');
    background: linear-gradient(to bottom, #e4bc6c 0%, #b87c28 55%, #6c3e08 100%);
                });
    border-top-color: #ecd080;
                if (activeIdx === -1) return;
    border-bottom-color: #201008;
}


                if (e.key === 'q' || e.key === 'Q') {
/* =========================================
                    e.preventDefault();
  Responsive
                    var prev = (activeIdx - 1 + tabs.length) % tabs.length;
  ========================================= */
                    if (prev !== activeIdx) switchTab(tabs, display, prev, -1);
 
                } else if (e.key === 'e' || e.key === 'E') {
@media screen and (max-width: 1280px) {
                    e.preventDefault();
    .doc-layout {
                    var next = (activeIdx + 1) % tabs.length;
        grid-template-columns: 210px minmax(0, 1fr);
                    if (next !== activeIdx) switchTab(tabs, display, next, 1);
                }
            });
        }
     }
     }


     var isAnimating = false;
     .doc-layout-right {
 
         grid-column: 1 / -1;
    function switchTab(tabs, display, nextIdx, dir) {
         display: grid;
        if (isAnimating) return;
         grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        isAnimating = true;
         gap: 7px;
 
        tabs.forEach(function (t) { t.classList.remove('active'); });
         tabs[nextIdx].classList.add('active');
 
         var ref = tabs[nextIdx].dataset.ref;
        var nextContent;
         if (ref) {
            var refEl = document.getElementById(ref);
            nextContent = refEl ? refEl.innerHTML : '';
        } else {
            nextContent = tabs[nextIdx].dataset.content || '';
        }
 
        glitchOut(display, dir, function () {
            display.innerHTML = nextContent;
            glitchIn(display, dir, function () {
                isAnimating = false;
            });
         });
     }
     }


     function glitchOut(el, dir, cb) {
     .doc-footer {
         var duration = 160;
         grid-template-columns: 1fr 110px 44px 110px;
        var start = null;
        var slideX = dir * 16;
 
        function step(ts) {
            if (!start) start = ts;
            var p = Math.min((ts - start) / duration, 1);
            var ease = p * p;
 
            var tx = slideX * ease;
            var skew = dir * ease * 1.0;
            var opacity = 1 - ease;
            var rgb = ease * 5;
 
            el.style.transform = 'translateX(' + tx + 'px) skewX(' + skew + 'deg)';
            el.style.opacity = opacity;
            el.style.filter =
                'drop-shadow(' + (-rgb) + 'px 0 0 rgba(80,160,255,0.75)) ' +
                'drop-shadow(' + rgb + 'px 0 0 rgba(255,55,90,0.65)) ' +
                'brightness(' + (1 + ease * 0.25) + ')';
 
            if (p < 1) {
                requestAnimationFrame(step);
            } else {
                el.style.opacity = '0';
                cb();
            }
        }
        requestAnimationFrame(step);
     }
     }


     function glitchIn(el, dir, cb) {
     .doc-keys {
        var duration = 200;
         display: none;
        var start = null;
        var startX = -dir * 16;
 
        el.style.transform = 'translateX(' + startX + 'px) skewX(' + (-dir * 1.0) + 'deg)';
        el.style.opacity = '0';
 
        function step(ts) {
            if (!start) start = ts;
            var p = Math.min((ts - start) / duration, 1);
            var ease = 1 - Math.pow(1 - p, 3);
 
            var tx = startX * (1 - ease);
            var skew = -dir * 1.0 * (1 - ease);
            var opacity = ease;
            var rgb = (1 - ease) * 3;
            var brightness = 1 + (1 - ease) * 0.35;
 
            el.style.transform = 'translateX(' + tx + 'px) skewX(' + skew + 'deg)';
            el.style.opacity = opacity;
            el.style.filter =
                'drop-shadow(' + (-rgb) + 'px 0 0 rgba(80,160,255,0.65)) ' +
                'drop-shadow(' + rgb + 'px 0 0 rgba(255,55,90,0.55)) ' +
                'brightness(' + brightness + ')';
 
            if (p < 1) {
                requestAnimationFrame(step);
            } else {
                el.style.transform = '';
                el.style.opacity = '';
                el.style.filter = '';
                cb();
            }
        }
         requestAnimationFrame(step);
     }
     }
if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', initDocTabs);
} else {
    initDocTabs();
}
}


if (typeof mw !== 'undefined' && mw.hook) {
@media screen and (max-width: 980px) {
     mw.hook('wikipage.content').add(function () {
     .doc-layout,
         initDocTabs();
    .doc-layout-lower,
     });
    .doc-layout-right {
}
         grid-template-columns: 1fr;
     }


})();
    .doc-footer {
        grid-template-columns: 1fr;
        height: auto;
        padding: 8px 10px;
    }


/* =========================================
    .doc-footer-sliders {
  Doc Section Switch — 좌측 섹션 전환
        justify-content: center;
  ========================================= */
     }
 
$(document).on('click', '.doc-nav-item[data-section]', function () {
    var name = $(this).attr('data-section');
    var display = document.getElementById('doc-main-display');
    var titleEl = document.getElementById('doc-center-title');
    var tabBar = document.getElementById('doc-tab-bar-text');
 
     if (!display) return;


     $('.doc-nav-item[data-section]').removeClass('active');
     .doc-date,
    $('.doc-nav-item[data-section="' + name + '"]').addClass('active');
     .doc-knob {
 
         justify-self: center;
     if (name === 'text') {
        if (titleEl) titleEl.textContent = '개요';
        if (tabBar) $(tabBar).show();
        var activeTab = tabBar ? tabBar.querySelector('.doc-tab.active') : null;
        if (!activeTab && tabBar) activeTab = tabBar.querySelector('.doc-tab');
        if (activeTab) {
            var ref = activeTab.dataset.ref;
            var refEl = ref ? document.getElementById(ref) : null;
            display.innerHTML = refEl ? refEl.innerHTML : (activeTab.dataset.content || '');
        }
    } else {
         if (titleEl) titleEl.textContent = name === 'factions' ? '세력' : name === 'people' ? '인물' : name;
        if (tabBar) $(tabBar).hide();
        var refEl = document.getElementById('doc-content-' + name);
        display.innerHTML = refEl ? refEl.innerHTML : '';
     }
     }
});
}

2026년 5월 10일 (일) 09:25 판

@import url('/index.php?title=MediaWiki:Template.Infobox.css&action=raw&ctype=text/css');

/* =========================================
   Proitem Animation
   ========================================= */

.wip-stripe-layer {
    position: absolute;
    top: 0;
    left: -280px;
    width: calc(100% + 560px);
    height: 100%;
    opacity: 0.08;
    background: repeating-linear-gradient(
        45deg,
        #969696,
        #969696 10px,
        transparent 10px,
        transparent 20px
    );
    z-index: 0;
}

.wip-active .wip-stripe-layer {
    animation: wip-stripe-move 8s linear infinite;
}

.wip-standby .wip-stripe-layer {
    animation: none;
}

@keyframes wip-stripe-move {
    from { transform: translateX(0); }
    to { transform: translateX(280px); }
}

/* =========================================
   Collapsible
   ========================================= */

[id^="collapsible"] {
    overflow: hidden;
    transition: max-height .25s ease;
    max-height: 0;
}

/* =========================================
   Color
   ========================================= */

.color-text {
    color: var(--text-color);
}

.color-text a,
.color-text a:visited,
.color-text a:hover,
.color-text a:active {
    color: var(--text-color) !important;
    text-decoration-color: var(--text-color) !important;
}

/* =========================================
   CRT Glitch Panel
   ========================================= */

.crt-glitch-panel {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-radius: 5px;
    box-shadow:
        inset 0 0 18px rgba(255,255,255,0.04),
        inset 0 0 42px rgba(133,67,105,0.10),
        0 0 18px rgba(133,67,105,0.20);
}

.crt-glitch-panel .vanishing-grid-bg {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    background:
        radial-gradient(circle at 50% 45%, rgba(212,90,162,0.18) 0%, transparent 32%),
        linear-gradient(to bottom, #111 0%, #090909 58%, #030303 100%) !important;
}

.crt-glitch-panel > * {
    position: relative;
    z-index: 2;
}

.crt-glow-content {
    position: relative;
    z-index: 2;
    text-shadow:
        -1px 0 0 rgba(80,160,255,0.75),
        1px 0 0 rgba(255,55,90,0.65),
        2px 0 0 rgba(255,210,70,0.45),
        0 0 2px rgba(255,255,255,0.35),
        0 0 6px rgba(212,90,162,0.22),
        0 0 12px rgba(133,67,105,0.18);
    filter: drop-shadow(0 0 5px rgba(212,90,162,0.18));
}

.crt-glow-content::before {
    content: "";
    position: absolute;
    inset: -24px;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(
            circle at 50% 35%,
            rgba(255,255,255,0.08) 0%,
            rgba(212,90,162,0.10) 18%,
            rgba(133,67,105,0.08) 34%,
            transparent 68%
        );
    filter: blur(18px);
    opacity: 0.75;
}

.crt-glitch-panel .fake-h1,
.crt-glitch-panel h1,
.crt-glitch-panel h2,
.crt-glitch-panel strong {
    text-shadow:
        -1px 0 0 rgba(80,160,255,0.95),
        1px 0 0 rgba(255,55,90,0.85),
        2px 0 0 rgba(255,210,70,0.55),
        0 0 3px rgba(255,255,255,0.65),
        0 0 10px rgba(255,255,255,0.28),
        0 0 18px rgba(212,90,162,0.35),
        0 0 32px rgba(133,67,105,0.24);
}

.crt-glitch-panel img {
    filter:
        drop-shadow(-1px 0 0 rgba(80,160,255,0.65))
        drop-shadow(1px 0 0 rgba(255,55,90,0.55))
        drop-shadow(2px 0 0 rgba(255,210,70,0.35))
        drop-shadow(0 0 6px rgba(212,90,162,0.18));
}

.crt-glitch-panel::before {
    content: "";
    position: absolute;
    inset: -80px 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0.22;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,0.08) 0px,
            rgba(255,255,255,0.08) 1px,
            transparent 2px,
            transparent 5px
        );
    mix-blend-mode: screen;
    animation: crt-scanlines-up 7s linear infinite;
}

.crt-glitch-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    background:
        linear-gradient(
            to bottom,
            transparent 0%,
            rgba(255,255,255,0.18) 48%,
            rgba(212,90,162,0.28) 50%,
            rgba(90,120,255,0.16) 52%,
            transparent 56%
        );
    mix-blend-mode: screen;
    animation: crt-glitch-band-up 6.5s steps(1, end) infinite;
}

/* =========================================
   Horizontal CRT Warp
   ========================================= */

.crt-horizontal-warp {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.crt-horizontal-warp .crt-glow-content {
    animation: crt-base-drift 9s steps(1, end) infinite;
    background-image:
        repeating-linear-gradient(
            to bottom,
            rgba(120,180,255,0.00) 0px,
            rgba(120,180,255,0.00) 3px,
            rgba(120,180,255,0.05) 4px,
            rgba(255,80,170,0.035) 5px,
            rgba(120,180,255,0.00) 7px
        );
    background-blend-mode: screen;
}

.crt-horizontal-warp .crt-glow-content::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    background:
        linear-gradient(
            to right,
            transparent 0%,
            rgba(120,180,255,0.18) 10%,
            rgba(255,255,255,0.18) 48%,
            rgba(212,90,162,0.20) 78%,
            transparent 100%
        );
    mix-blend-mode: screen;
    animation: crt-wide-horizontal-tear 3.8s steps(1, end) infinite;
}

/* =========================================
   CRT Animations
   ========================================= */

@keyframes crt-scanlines-up {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-80px);
    }
}

@keyframes crt-glitch-band-up {
    0%, 12%, 27%, 43%, 58%, 76%, 100% {
        opacity: 0;
        transform: translateY(100%);
    }

    13% {
        opacity: 0.75;
        transform: translateY(70%);
    }

    14% {
        opacity: 0.15;
        transform: translateY(62%) skewX(-2deg);
    }

    28% {
        opacity: 0.55;
        transform: translateY(35%);
    }

    29% {
        opacity: 0.18;
        transform: translateY(28%) skewX(2deg);
    }

    44% {
        opacity: 0.65;
        transform: translateY(10%);
    }

    45% {
        opacity: 0.12;
        transform: translateY(4%) skewX(-1deg);
    }

    59% {
        opacity: 0.5;
        transform: translateY(-20%);
    }

    60% {
        opacity: 0.16;
        transform: translateY(-26%) skewX(2deg);
    }

    77% {
        opacity: 0.55;
        transform: translateY(-55%);
    }

    78% {
        opacity: 0;
        transform: translateY(-70%);
    }
}

@keyframes crt-base-drift {
    0%, 88%, 100% {
        transform: translateX(0);
        filter: drop-shadow(0 0 5px rgba(212,90,162,0.18));
    }

    89% {
        transform: translateX(-2px) skewX(-0.4deg);
        filter:
            contrast(1.08)
            brightness(1.05)
            drop-shadow(0 0 7px rgba(212,90,162,0.24));
    }

    90% {
        transform: translateX(3px) skewX(0.5deg);
    }

    91% {
        transform: translateX(-1px);
    }

    92% {
        transform: translateX(0);
        filter: drop-shadow(0 0 5px rgba(212,90,162,0.18));
    }
}

@keyframes crt-wide-horizontal-tear {
    0%, 8%, 17%, 29%, 43%, 61%, 78%, 100% {
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 0 0);
    }

    9% {
        opacity: 0.45;
        transform: translateX(-18px) skewX(-3deg);
        clip-path: inset(18% 0 70% 0);
    }

    10% {
        opacity: 0.28;
        transform: translateX(24px) skewX(4deg);
        clip-path: inset(21% 0 64% 0);
    }

    18% {
        opacity: 0.38;
        transform: translateX(32px) skewX(5deg);
        clip-path: inset(42% 0 47% 0);
    }

    19% {
        opacity: 0.16;
        transform: translateX(-28px) skewX(-4deg);
        clip-path: inset(46% 0 43% 0);
    }

    30% {
        opacity: 0.48;
        transform: translateX(-36px) skewX(-6deg);
        clip-path: inset(58% 0 30% 0);
    }

    31% {
        opacity: 0.18;
        transform: translateX(20px) skewX(3deg);
        clip-path: inset(61% 0 27% 0);
    }

    44% {
        opacity: 0.36;
        transform: translateX(18px) skewX(3deg);
        clip-path: inset(8% 0 84% 0);
    }

    45% {
        opacity: 0.12;
        transform: translateX(-14px) skewX(-2deg);
        clip-path: inset(11% 0 80% 0);
    }

    62% {
        opacity: 0.44;
        transform: translateX(-42px) skewX(-7deg);
        clip-path: inset(73% 0 16% 0);
    }

    63% {
        opacity: 0.18;
        transform: translateX(30px) skewX(4deg);
        clip-path: inset(76% 0 12% 0);
    }

    79% {
        opacity: 0.42;
        transform: translateX(26px) skewX(4deg);
        clip-path: inset(31% 0 58% 0);
    }

    80% {
        opacity: 0.14;
        transform: translateX(-20px) skewX(-3deg);
        clip-path: inset(34% 0 54% 0);
    }
}

/* =========================================
   Retro Horizon Grid Background
   ========================================= */

.retro-grid-bg {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    background:
        linear-gradient(
            to bottom,
            rgba(13, 6, 19, 0.98) 0%,
            rgba(25, 9, 33, 0.82) 44%,
            rgba(53, 19, 56, 0.50) 60%,
            rgba(4, 4, 7, 0.96) 61%,
            rgba(2, 2, 4, 1) 100%
        ) !important;
}

.retro-grid-bg .crt-glow-content {
    position: relative;
    z-index: 5;
}

.retro-grid-bg::before {
    content: "";
    position: absolute;
    left: -10%;
    right: -10%;
    top: 56%;
    height: 16%;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(
            ellipse at 50% 50%,
            rgba(230,210,225,0.28) 0%,
            rgba(204,94,168,0.30) 20%,
            rgba(184,56,142,0.20) 44%,
            transparent 76%
        );
    filter: blur(9px);
    opacity: 0.68;
}

.retro-grid-bg::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 61%;
    width: 150%;
    height: 115%;
    z-index: 2;
    pointer-events: none;
    background-image:
        linear-gradient(
            to right,
            rgba(204,64,156,0.72) 1px,
            transparent 1px
        ),
        linear-gradient(
            to bottom,
            rgba(204,64,156,0.70) 1px,
            transparent 1px
        );
    background-size:
        48px 100%,
        100% 26px;
    transform-origin: 50% 0%;
    transform:
        translateX(-50%)
        perspective(430px)
        rotateX(66deg);
    opacity: 0.78;
    filter:
        drop-shadow(0 0 3px rgba(204,64,156,0.58))
        drop-shadow(0 0 10px rgba(204,64,156,0.30));
    animation: retro-grid-flow 1.8s linear infinite;
    mask-image:
        linear-gradient(
            to bottom,
            transparent 0%,
            black 4%,
            black 82%,
            transparent 100%
        );
    -webkit-mask-image:
        linear-gradient(
            to bottom,
            transparent 0%,
            black 4%,
            black 82%,
            transparent 100%
        );
}

.retro-grid-bg .crt-glow-content::before {
    content: "";
    position: absolute;
    inset: -42px;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(
            ellipse at 50% 56%,
            rgba(220,220,225,0.05) 0%,
            rgba(204,64,156,0.07) 22%,
            rgba(96,152,204,0.05) 42%,
            transparent 70%
        );
    filter: blur(20px);
    opacity: 0.52;
}

@keyframes retro-grid-flow {
    from {
        background-position:
            0 0,
            0 0;
    }

    to {
        background-position:
            0 0,
            0 -26px;
    }
}

/* =========================================
   CRT Monitor Frame
   ========================================= */

.crt-monitor-frame {
    position: relative;
    box-sizing: border-box;
    padding: 34px 46px 38px 46px;
    border-radius: 22px;
    background:
        linear-gradient(145deg, #303030 0%, #181818 22%, #080808 58%, #202020 100%);
    border: 2px solid #2f2f2f;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.18),
        inset 0 -3px 0 rgba(0,0,0,0.85),
        inset 3px 0 0 rgba(255,255,255,0.06),
        inset -3px 0 0 rgba(0,0,0,0.75),
        0 0 0 3px #050505,
        0 0 0 5px #242424,
        0 12px 20px rgba(0,0,0,0.62),
        0 24px 42px rgba(0,0,0,0.52),
        0 42px 70px rgba(0,0,0,0.34);
}

.crt-monitor-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 22px;
    pointer-events: none;
    opacity: 0.16;
    background:
        repeating-linear-gradient(
            135deg,
            rgba(255,255,255,0.035) 0px,
            rgba(255,255,255,0.035) 1px,
            transparent 1px,
            transparent 5px
        ),
        radial-gradient(
            ellipse at 28% 12%,
            rgba(255,255,255,0.12) 0%,
            transparent 45%
        );
    mix-blend-mode: screen;
}

.crt-monitor-frame::after {
    content: none;
}

.crt-monitor-inner {
    position: relative;
    box-sizing: border-box;
    padding: 18px;
    border-radius: 16px;
    background:
        linear-gradient(145deg, #050505 0%, #111 44%, #070707 100%);
    border: 1px solid #050505;
    box-shadow:
        inset 0 5px 14px rgba(0,0,0,0.95),
        inset 0 -2px 4px rgba(255,255,255,0.06),
        inset 4px 0 10px rgba(0,0,0,0.85),
        inset -4px 0 10px rgba(0,0,0,0.85),
        0 1px 0 rgba(255,255,255,0.12);
}

.crt-monitor-screen {
    position: relative;
    overflow: hidden;
    border-radius: 9px / 18px;
    background: #050505;
    border: 2px solid #050505;
    box-shadow:
        inset 0 0 0 2px #151515,
        inset 0 0 22px rgba(0,0,0,0.95),
        inset 0 0 48px rgba(0,0,0,0.75),
        0 0 0 1px rgba(255,255,255,0.08),
        0 0 18px rgba(133,67,105,0.18);
}

.crt-monitor-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    border-radius: 9px / 18px;
    background:
        radial-gradient(
            ellipse at 50% 50%,
            transparent 0%,
            transparent 58%,
            rgba(0,0,0,0.22) 82%,
            rgba(0,0,0,0.58) 100%
        ),
        linear-gradient(
            105deg,
            transparent 0%,
            rgba(255,255,255,0.05) 18%,
            transparent 38%,
            transparent 100%
        );
    box-shadow:
        inset 0 0 28px rgba(255,255,255,0.04),
        inset 0 0 60px rgba(0,0,0,0.65);
}

.crt-monitor-screen .crt-glitch-panel,
.crt-monitor-screen .retro-grid-bg {
    border-radius: 8px / 16px;
}

.crt-monitor-screen .crt-glitch-panel {
    box-shadow: none;
}

#clbi-main-crt-hero-wrap {
    width: 100%;
    margin: 0 auto 14px auto;
}

#clbi-main-crt-hero {
    width: 100%;
}

/* =========================================
   Compact CRT Media Frame
   ========================================= */

.compact-crt-media {
    position: relative;
    box-sizing: border-box;
    width: fit-content;
    max-width: 100%;
    margin: 6px auto;
    padding: 10px 14px;
    border-radius: 10px;
    background:
        linear-gradient(
            145deg,
            #242424 0%,
            #141414 34%,
            #070707 70%,
            #171717 100%
        );
    border: 1px solid #2b2b2b;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.12),
        inset 0 -2px 0 rgba(0,0,0,0.82),
        inset 2px 0 0 rgba(255,255,255,0.035),
        inset -2px 0 0 rgba(0,0,0,0.62),
        0 0 0 2px #050505,
        0 0 0 3px #242424,
        0 4px 12px rgba(0,0,0,0.68);
    overflow: hidden;
}

.compact-crt-media .mw-default-size,
.compact-crt-media .mw-file-element,
.compact-crt-media img {
    position: relative;
    z-index: 1;
}

.compact-crt-media img {
    max-width: 100%;
    height: auto;
    filter:
        drop-shadow(0 1px 3px rgba(0,0,0,0.72))
        drop-shadow(0 0 4px rgba(255,255,255,0.06));
    animation: compact-crt-image-jitter 1.25s steps(1, end) infinite;
}

.compact-crt-media::before {
    content: "";
    position: absolute;
    inset: 6px;
    z-index: 3;
    border-radius: 7px;
    pointer-events: none;
    background:
        radial-gradient(
            ellipse at 50% 50%,
            transparent 0%,
            transparent 54%,
            rgba(0,0,0,0.20) 78%,
            rgba(0,0,0,0.58) 100%
        ),
        linear-gradient(
            105deg,
            transparent 0%,
            rgba(255,255,255,0.040) 18%,
            transparent 38%,
            transparent 100%
        ),
        linear-gradient(
            to bottom,
            rgba(255,255,255,0.030) 0%,
            transparent 34%,
            rgba(0,0,0,0.26) 100%
        );
    box-shadow:
        inset 0 0 18px rgba(255,255,255,0.028),
        inset 0 0 38px rgba(0,0,0,0.66);
}

.compact-crt-media::after {
    content: "";
    position: absolute;
    inset: 6px;
    z-index: 4;
    border-radius: 7px;
    pointer-events: none;
    opacity: 0.34;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,0.070) 0px,
            rgba(255,255,255,0.070) 1px,
            transparent 2px,
            transparent 4px
        );
    mix-blend-mode: screen;
}

.compact-crt-static {
    position: absolute;
    inset: 6px;
    z-index: 5;
    border-radius: 7px;
    pointer-events: none;
    opacity: 0.30;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 4px,
            rgba(255,255,255,0.10) 5px,
            transparent 6px,
            transparent 10px
        ),
        linear-gradient(
            to bottom,
            transparent 0%,
            transparent 43%,
            rgba(255,255,255,0.11) 49%,
            rgba(180,180,180,0.08) 50%,
            rgba(90,90,90,0.08) 51%,
            transparent 56%,
            transparent 100%
        );
    mix-blend-mode: screen;
    animation:
        compact-crt-static-roll 3.8s linear infinite,
        compact-crt-static-flicker 1.7s steps(1, end) infinite;
}

.compact-crt-media:hover::after {
    opacity: 0.40;
}

.compact-crt-media:hover .compact-crt-static {
    opacity: 0.36;
}

.compact-crt-media:hover img {
    filter:
        drop-shadow(0 1px 3px rgba(0,0,0,0.78))
        drop-shadow(0 0 5px rgba(255,255,255,0.08));
}

@keyframes compact-crt-static-roll {
    from {
        background-position:
            0 0,
            0 110%;
    }

    to {
        background-position:
            0 -32px,
            0 -30%;
    }
}

@keyframes compact-crt-static-flicker {
    0%, 100% {
        transform: translateX(0);
        opacity: 0.26;
    }

    11% {
        transform: translateX(-1px);
        opacity: 0.36;
    }

    12% {
        transform: translateX(1px);
        opacity: 0.22;
    }

    36% {
        transform: translateX(0);
        opacity: 0.30;
    }

    37% {
        transform: translateX(1px);
        opacity: 0.38;
    }

    38% {
        transform: translateX(-1px);
        opacity: 0.24;
    }

    64% {
        transform: translateX(0);
        opacity: 0.32;
    }

    65% {
        transform: translateX(-1px);
        opacity: 0.40;
    }

    66% {
        transform: translateX(0);
        opacity: 0.26;
    }
}

@keyframes compact-crt-image-jitter {
    0%, 82%, 100% {
        transform: translateX(0);
    }

    83% {
        transform: translateX(-1px);
    }

    84% {
        transform: translateX(1px);
    }

    85% {
        transform: translateX(0);
    }

    92% {
        transform: translateX(1px);
    }

    93% {
        transform: translateX(-1px);
    }

    94% {
        transform: translateX(0);
    }
}

.compact-crt-media.compact-crt-portrait {
    padding: 4px 5px;
    border-radius: 8px;
}

.compact-crt-media.compact-crt-portrait::before {
    inset: 3px;
    border-radius: 5px;
}

.compact-crt-media.compact-crt-portrait::after {
    inset: 3px;
    border-radius: 5px;
}

.compact-crt-media.compact-crt-portrait .compact-crt-static {
    inset: 3px;
    border-radius: 5px;
}

.compact-crt-media.compact-crt-portrait img,
.compact-crt-media.compact-crt-portrait .mw-file-element {
    display: block;
}

/* =========================================
   Related Template Title
   ========================================= */

.related-template-title {
    position: relative;
    overflow: hidden;
    width: 100%;
    border-radius: 5px;
    background: #111111;
    color: #fff;
    box-shadow:
        inset 1px 0 0 #494949,
        inset 0 -1px 0 #555;
}

.related-template-title::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    background:
        linear-gradient(
            to bottom,
            rgba(255,255,255,0.070) 0%,
            rgba(255,255,255,0.026) 18%,
            transparent 45%,
            rgba(0,0,0,0.18) 100%
        ),
        linear-gradient(
            105deg,
            transparent 0%,
            rgba(255,255,255,0.045) 18%,
            transparent 36%,
            transparent 100%
        );
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.026),
        inset 0 0 14px rgba(0,0,0,0.30);
}

.related-template-title::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0.20;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,0.055) 0px,
            rgba(255,255,255,0.055) 1px,
            transparent 2px,
            transparent 4px
        );
    mix-blend-mode: screen;
}

.related-template-title > * {
    position: relative;
    z-index: 3;
}

/* =========================================
   Page Top CRT Banner
   Template use:
   {{Banner|[[파일:example.png{{!}}1000px{{!}}link=]]|80px|20px}}
   2번 인자: 양수면 좌측 이동
   3번 인자: 양수면 아래 이동
   ========================================= */

.crt-page-monitor-frame {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    aspect-ratio: 2560 / 580;
    margin: 0 auto 16px auto;
    padding: 14px 20px 16px 20px;
    border-radius: 18px;
    background:
        linear-gradient(
            145deg,
            #151515 0%,
            #0b0b0b 28%,
            #050505 58%,
            #181818 100%
        );
    border: 2px solid #242424;
    box-shadow:
        inset 0 3px 8px rgba(0,0,0,0.78),
        inset 0 -2px 0 rgba(255,255,255,0.030),
        inset 4px 0 10px rgba(0,0,0,0.72),
        inset -3px 0 0 rgba(0,0,0,0.78),
        0 0 0 3px #050505,
        0 0 0 5px #242424;
    overflow: hidden;
}

.crt-page-monitor-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 18px;
    pointer-events: none;
    opacity: 0.08;
    background:
        linear-gradient(
            to bottom,
            rgba(0,0,0,0.38) 0%,
            transparent 20%,
            transparent 100%
        ),
        linear-gradient(
            to right,
            rgba(0,0,0,0.34) 0%,
            transparent 18%,
            transparent 100%
        );
    mix-blend-mode: normal;
}

.crt-page-monitor-frame::after {
    content: none;
}

.crt-page-monitor-inner {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: 6px;
    border-radius: 13px;
    background:
        linear-gradient(
            145deg,
            #020202 0%,
            #080808 45%,
            #030303 100%
        );
    border: 1px solid #020202;
    box-shadow:
        inset 0 11px 24px rgba(0,0,0,0.98),
        inset 0 -2px 3px rgba(255,255,255,0.028),
        inset 8px 0 20px rgba(0,0,0,0.94),
        inset -8px 0 20px rgba(0,0,0,0.94),
        0 0 0 1px rgba(255,255,255,0.030);
}

.crt-page-monitor-screen {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px / 15px;
    background: #050505;
    border: 1px solid #060606;
    box-shadow:
        inset 0 0 18px rgba(0,0,0,0.88),
        inset 0 0 42px rgba(0,0,0,0.70),
        0 0 0 1px rgba(255,255,255,0.026);
}

.crt-page-monitor-image,
.crt-page-monitor-image-base,
.crt-page-monitor-image-bloom,
.crt-page-monitor-slice {
    position: absolute;
    inset: 0;
    line-height: 0;
    overflow: hidden;
}

.crt-page-monitor-image {
    z-index: 1;
}

.crt-page-monitor-image-base {
    z-index: 3;
}

.crt-page-monitor-image-bloom {
    z-index: 4;
    pointer-events: none;
    opacity: 0.38;
    mix-blend-mode: normal;
    filter:
        blur(9px)
        brightness(0.92)
        contrast(1.02)
        saturate(1.04);
}

.crt-page-monitor-image-base a,
.crt-page-monitor-image-base span,
.crt-page-monitor-image-base .mw-file-description,
.crt-page-monitor-image-base .mw-default-size,
.crt-page-monitor-image-base .mw-image-border,
.crt-page-monitor-image-bloom a,
.crt-page-monitor-image-bloom span,
.crt-page-monitor-image-bloom .mw-file-description,
.crt-page-monitor-image-bloom .mw-default-size,
.crt-page-monitor-image-bloom .mw-image-border,
.crt-page-monitor-slice a,
.crt-page-monitor-slice span,
.crt-page-monitor-slice .mw-file-description,
.crt-page-monitor-slice .mw-default-size,
.crt-page-monitor-slice .mw-image-border {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

.crt-page-monitor-image-base img,
.crt-page-monitor-image-base .mw-file-element,
.crt-page-monitor-image-bloom img,
.crt-page-monitor-image-bloom .mw-file-element,
.crt-page-monitor-slice img,
.crt-page-monitor-slice .mw-file-element,
.crt-page-monitor-slice-img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center;
    border: 0 !important;
    transform:
        translate(
            calc(0px - var(--crt-img-left, 0px)),
            var(--crt-img-down, 0px)
        )
        scale(var(--crt-img-scale, 1.04));
    transform-origin: center center;
}

.crt-page-monitor-image-base img,
.crt-page-monitor-image-base .mw-file-element {
    filter:
        brightness(0.84)
        contrast(1.08)
        saturate(0.90);
}

.crt-page-monitor-image-bloom img,
.crt-page-monitor-image-bloom .mw-file-element {
    transform:
        translate(
            calc(0px - var(--crt-img-left, 0px)),
            var(--crt-img-down, 0px)
        )
        scale(calc(var(--crt-img-scale, 1.04) + 0.02));
}

.crt-page-monitor-slice img,
.crt-page-monitor-slice .mw-file-element,
.crt-page-monitor-slice-img {
    filter:
        brightness(0.96)
        contrast(1.18)
        saturate(0.82);
}

.crt-page-monitor-image::after {
    content: "";
    position: absolute;
    inset: -3%;
    z-index: 6;
    pointer-events: none;
    opacity: 0.16;
    background:
        radial-gradient(
            ellipse at 50% 45%,
            rgba(220,235,230,0.12) 0%,
            rgba(170,190,185,0.05) 34%,
            rgba(70,85,82,0.03) 62%,
            transparent 100%
        ),
        linear-gradient(
            to bottom,
            rgba(255,255,255,0.04) 0%,
            rgba(255,255,255,0.014) 28%,
            transparent 70%,
            rgba(0,0,0,0.08) 100%
        );
    mix-blend-mode: normal;
}

.crt-page-monitor-slice {
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    will-change: transform, opacity, clip-path, filter;
}

.crt-page-monitor-slice-a {
    animation: crt-slice-tear-a 4.7s steps(1, end) infinite;
}

.crt-page-monitor-slice-b {
    animation: crt-slice-tear-b 6.1s steps(1, end) infinite;
}

.crt-page-monitor-slice-c {
    animation: crt-slice-tear-c 7.4s steps(1, end) infinite;
}

.crt-page-monitor-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    border-radius: 8px / 15px;
    background:
        radial-gradient(
            ellipse at 50% 50%,
            transparent 0%,
            transparent 62%,
            rgba(0,0,0,0.16) 78%,
            rgba(0,0,0,0.42) 100%
        ),
        linear-gradient(
            to bottom,
            rgba(0,0,0,0.18) 0%,
            transparent 14%,
            transparent 82%,
            rgba(0,0,0,0.24) 100%
        ),
        linear-gradient(
            to right,
            rgba(0,0,0,0.18) 0%,
            transparent 8%,
            transparent 92%,
            rgba(0,0,0,0.18) 100%
        ),
        linear-gradient(
            105deg,
            transparent 0%,
            rgba(255,255,255,0.030) 18%,
            transparent 38%,
            transparent 100%
        );
    box-shadow:
        inset 0 0 20px rgba(255,255,255,0.018),
        inset 0 0 54px rgba(0,0,0,0.54);
}

.crt-page-monitor-screen::after {
    content: "";
    position: absolute;
    inset: -80px 0;
    z-index: 21;
    pointer-events: none;
    opacity: 0.20;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,0.08) 0px,
            rgba(255,255,255,0.08) 1px,
            transparent 2px,
            transparent 5px
        );
    mix-blend-mode: screen;
    animation: crt-scanlines-up 7s linear infinite;
}

.crt-page-monitor-glitch {
    position: absolute;
    inset: 0;
    z-index: 22;
    pointer-events: none;
    opacity: 0;
    background:
        linear-gradient(
            to bottom,
            transparent 0%,
            rgba(255,255,255,0.12) 48%,
            rgba(212,90,162,0.14) 50%,
            rgba(90,120,255,0.08) 52%,
            transparent 56%
        );
    mix-blend-mode: screen;
    animation: crt-soft-glitch-band 8.2s steps(1, end) infinite;
}

.crt-page-monitor-tear {
    position: absolute;
    inset: 0;
    z-index: 23;
    pointer-events: none;
    opacity: 0;
    background:
        linear-gradient(
            to right,
            transparent 0%,
            rgba(120,180,255,0.07) 10%,
            rgba(255,255,255,0.11) 48%,
            rgba(212,90,162,0.08) 78%,
            transparent 100%
        );
    mix-blend-mode: screen;
    animation: crt-soft-horizontal-tear 5.6s steps(1, end) infinite;
}

@keyframes crt-slice-tear-a {
    0%, 11%, 100% {
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 100% 0);
    }

    12% {
        opacity: 0.38;
        transform: translateX(-18px);
        clip-path: inset(17% 0 78% 0);
    }

    13% {
        opacity: 0.22;
        transform: translateX(11px);
        clip-path: inset(18% 0 77% 0);
        filter: hue-rotate(-8deg);
    }

    14% {
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 100% 0);
    }

    63% {
        opacity: 0.30;
        transform: translateX(9px);
        clip-path: inset(24% 0 70% 0);
    }

    64% {
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 100% 0);
    }
}

@keyframes crt-slice-tear-b {
    0%, 37%, 100% {
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 100% 0);
    }

    38% {
        opacity: 0.42;
        transform: translateX(24px);
        clip-path: inset(43% 0 50% 0);
    }

    39% {
        opacity: 0.26;
        transform: translateX(-14px);
        clip-path: inset(45% 0 48% 0);
        filter: hue-rotate(10deg) brightness(1.08);
    }

    40% {
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 100% 0);
    }

    78% {
        opacity: 0.34;
        transform: translateX(-20px);
        clip-path: inset(51% 0 43% 0);
    }

    79% {
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 100% 0);
    }
}

@keyframes crt-slice-tear-c {
    0%, 21%, 100% {
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 100% 0);
    }

    22% {
        opacity: 0.28;
        transform: translateX(-30px);
        clip-path: inset(67% 0 25% 0);
    }

    23% {
        opacity: 0.18;
        transform: translateX(16px);
        clip-path: inset(68% 0 23% 0);
        filter: contrast(1.25) brightness(1.06);
    }

    24% {
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 100% 0);
    }

    91% {
        opacity: 0.36;
        transform: translateX(18px);
        clip-path: inset(73% 0 18% 0);
    }

    92% {
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 100% 0);
    }
}

@keyframes crt-soft-glitch-band {
    0%, 52%, 100% {
        opacity: 0;
        transform: translateY(80%);
    }

    53% {
        opacity: 0.42;
        transform: translateY(36%);
    }

    54% {
        opacity: 0.16;
        transform: translateY(20%) skewX(-1deg);
    }

    55% {
        opacity: 0;
        transform: translateY(-20%);
    }
}

@keyframes crt-soft-horizontal-tear {
    0%, 68%, 100% {
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 0 0);
    }

    69% {
        opacity: 0.32;
        transform: translateX(-16px);
        clip-path: inset(34% 0 58% 0);
    }

    70% {
        opacity: 0.18;
        transform: translateX(12px);
        clip-path: inset(37% 0 55% 0);
    }

    71% {
        opacity: 0;
        transform: translateX(0);
        clip-path: inset(0 0 0 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .crt-page-monitor-slice-a,
    .crt-page-monitor-slice-b,
    .crt-page-monitor-slice-c,
    .crt-page-monitor-screen::after,
    .crt-page-monitor-glitch,
    .crt-page-monitor-tear {
        animation: none !important;
    }

    .crt-page-monitor-slice,
    .crt-page-monitor-glitch,
    .crt-page-monitor-tear {
        opacity: 0 !important;
    }
}

/* =========================================
   Historical Events Timeline
   ========================================= */

.timeline-event {
    position: relative;
    display: block;
    width: 100%;
    box-sizing: border-box;
    line-height: inherit;
    text-align: center;
}

.timeline-title {
    position: relative;
    z-index: 2;
    display: inline-block;
    text-align: center;
}

.timeline-event.he-linked::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 2px;
    right: 2px;
    height: 3px;
    border-radius: 999px;
    pointer-events: none;
    background:
        linear-gradient(
            to right,
            transparent 0%,
            color-mix(in srgb, var(--he-color) 18%, transparent) 8%,
            color-mix(in srgb, var(--he-color) 92%, transparent) 14%,
            color-mix(in srgb, var(--he-color) 92%, transparent) 86%,
            color-mix(in srgb, var(--he-color) 18%, transparent) 92%,
            transparent 100%
        );
    box-shadow:
        0 0 7px color-mix(in srgb, var(--he-color) 28%, transparent);
}

.timeline-event.he-root {
    overflow: visible;
}

.timeline-event.he-root::before {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    top: 50%;
    height: 16px;
    transform: translateY(-50%);
    border-radius: 999px;
    pointer-events: none;
    background:
        linear-gradient(
            to bottom,
            rgba(255,255,255,0.05) 0%,
            rgba(0,0,0,0.24) 100%
        ),
        linear-gradient(
            to right,
            transparent 0%,
            color-mix(in srgb, var(--he-color) 10%, transparent) 8%,
            color-mix(in srgb, var(--he-color) 24%, transparent) 18%,
            color-mix(in srgb, var(--he-color) 36%, transparent) 50%,
            color-mix(in srgb, var(--he-color) 24%, transparent) 82%,
            color-mix(in srgb, var(--he-color) 10%, transparent) 92%,
            transparent 100%
        );
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        inset 0 -1px 0 rgba(0,0,0,0.42),
        0 0 8px color-mix(in srgb, var(--he-color) 16%, transparent);
    -webkit-mask-image:
        linear-gradient(
            to right,
            transparent 0%,
            black 10%,
            black 90%,
            transparent 100%
        );
    mask-image:
        linear-gradient(
            to right,
            transparent 0%,
            black 10%,
            black 90%,
            transparent 100%
        );
}

.timeline-event.he-root::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    top: 50%;
    height: 22px;
    transform: translateY(-50%);
    pointer-events: none;
    background:
        linear-gradient(
            to right,
            transparent 0%,
            color-mix(in srgb, var(--he-color) 48%, transparent) 16%,
            color-mix(in srgb, var(--he-color) 48%, transparent) 84%,
            transparent 100%
        ) top center / 100% 1px no-repeat,
        linear-gradient(
            to right,
            transparent 0%,
            color-mix(in srgb, var(--he-color) 24%, transparent) 16%,
            color-mix(in srgb, var(--he-color) 24%, transparent) 84%,
            transparent 100%
        ) bottom center / 100% 1px no-repeat;
}

.timeline-event.he-root .timeline-title {
    text-shadow:
        0 0 4px color-mix(in srgb, var(--he-color) 34%, transparent),
        0 0 9px color-mix(in srgb, var(--he-color) 16%, transparent);
}

/* =========================================
   Tree List
   ========================================= */

.tree-container {
    margin: 0;
    padding: 0;
}

.tree-node {
    position: relative;
    padding-left: 20px;
    margin: 0;
    text-indent: 0;
    line-height: 1.55;
}

.tree-node::before {
    content: "";
    position: absolute;
    top: 0;
    left: 7px;
    width: 1.2px;
    height: 100%;
    background: #7F7F7F;
}

.tree-node::after {
    content: "";
    position: absolute;
    top: 12px;
    left: 7px;
    width: 8px;
    height: 0;
    border-top: 1.2px solid #7F7F7F;
}

.tree-node:last-of-type::before {
    height: 12px;
}

/* =========================================
   Meeting Composition Panel
   ========================================= */

.meeting-panel {
    position: relative;
    isolation: isolate;
    z-index: 0;
    width: calc(100% + 4px);
    left: -2px;
    margin: 0 auto 15px auto;
    border: 2px solid #1a1a1a;
    border-radius: 5px;
    background:
        radial-gradient(
            ellipse at 50% 35%,
            rgba(255,255,255,0.025) 0%,
            transparent 46%
        ),
        linear-gradient(
            to bottom,
            #1A1A1A 0%,
            #181818 52%,
            #151515 100%
        );
    color: #FFF;
    box-shadow:
        0 4px 12px #000;
    text-align: center;
    font-size: 11px;
    box-sizing: border-box;
    overflow: visible;
}

.meeting-panel::before {
    content: "";
    position: absolute;
    inset: -5px;
    z-index: -2;
    border-radius: 8px;
    background: #854369;
    pointer-events: none;
}

.meeting-panel::after {
    content: "";
    position: absolute;
    inset: -3px;
    z-index: -1;
    border-radius: 7px;
    background: #1A1A1A;
    pointer-events: none;
}

.meeting-panel-body {
    width: 100%;
    color: #E4E4E4;
    padding: 4.5px 9px 9px 9px;
    box-sizing: border-box;
    border-radius: 3px;
    background: transparent;
    overflow: hidden;
}

.meeting-title-wrap {
    width: 100%;
    max-width: 760px;
    margin: 5px auto 8px auto;
}

.meeting-title-wrap .infobox-glass-title {
    top: 0;
    margin-top: 0;
    padding: 5px;
    line-height: 1.2;
}

.meeting-title-table {
    width: auto;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    border: 2px solid transparent;
    border-collapse: collapse;
    table-layout: auto;
}

.meeting-title-table td,
.meeting-title-table th {
    background: none !important;
    border: none !important;
    vertical-align: middle !important;
}

.meeting-title-table .meeting-title-image-left {
    width: auto;
    text-align: right !important;
    padding: 0 6px 0 0 !important;
    line-height: 0;
    white-space: nowrap;
}

.meeting-title-table .meeting-title-image-right {
    width: auto;
    text-align: left !important;
    padding: 0 0 0 6px !important;
    line-height: 0;
    white-space: nowrap;
}

.meeting-title-table .meeting-title-cell {
    width: auto;
    line-height: 1.15 !important;
    background: none !important;
    text-align: center !important;
    white-space: nowrap;
    padding: 0 !important;
}

.meeting-title-image-left img,
.meeting-title-image-right img,
.meeting-title-image-left .mw-file-element,
.meeting-title-image-right .mw-file-element {
    display: block;
    border: 0 !important;
    vertical-align: middle;
    filter:
        drop-shadow(0 1px 2px rgba(0,0,0,0.75))
        drop-shadow(0 0 3px rgba(255,255,255,0.08));
}

.meeting-title-name {
    display: block;
    line-height: 1.15;
    text-align: center;
}

.meeting-title-meta {
    display: block;
    margin-top: 1px;
    color: #7F7F7F;
    font-size: 10px;
    font-weight: normal;
    line-height: 1.15;
    text-align: center;
}

.meeting-seatmap {
    position: relative;
    margin: 0 auto;
    padding: 5px 0 4px 0;
    background: transparent;
    border-radius: 0;
    overflow: visible;
}

.meeting-seatmap::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 84px;
    bottom: 145px;
    width: 2px;
    transform: translateX(-50%);
    background:
        linear-gradient(
            to bottom,
            transparent 0%,
            rgba(65,65,65,0.72) 18%,
            #414141 50%,
            rgba(65,65,65,0.72) 82%,
            transparent 100%
        );
    box-shadow: 0 0 6px rgba(65,65,65,0.16);
    pointer-events: none;
}

.meeting-table-zone::before {
    content: "";
    position: absolute;
    left: 7%;
    right: 7%;
    top: 50%;
    height: 2px;
    transform: translateY(-50%);
    background:
        linear-gradient(
            to right,
            transparent 0%,
            rgba(65,65,65,0.72) 14%,
            #414141 50%,
            rgba(65,65,65,0.72) 86%,
            transparent 100%
        );
    box-shadow: 0 0 6px rgba(65,65,65,0.14);
    pointer-events: none;
}

.meeting-axis-label {
    position: relative;
    z-index: 4;
    display: inline-block;
    min-width: 42px;
    margin: 2px auto 4px auto;
    padding: 2px 9px;
    border-radius: 5px;
    background: #0c0c0c;
    color: #E4E4E4;
    font-weight: bold;
    line-height: 1.35;
    box-shadow:
        inset 0 -1px 0 #525252,
        0 0 0 3px #1A1A1A;
}

.meeting-chair-line {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: center;
    margin: 0 0 6px 0;
    background: transparent;
}

.meeting-table-zone {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
    align-items: center;
    width: 100%;
    max-width: 980px;
    min-height: 210px;
    margin: 0 auto;
    background: transparent;
}

.meeting-side {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0;
    min-width: 0;
    background: transparent;
}

.meeting-side-left {
    padding-right: 4px;
}

.meeting-side-right {
    padding-left: 4px;
}

.meeting-center-spine {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    min-height: 210px;
    z-index: 4;
    background: transparent;
}

.meeting-center-spine .meeting-axis-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    min-width: 0;
    min-height: 42px;
    margin: 0;
    padding: 8px 3px;
}

.meeting-advisory-zone {
    position: relative;
    z-index: 3;
    margin-top: 6px;
    background: transparent;
}

.meeting-advisory-zone > .meeting-axis-label {
    margin-bottom: 6px;
}

.meeting-advisory-grid {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
}

.meeting-advisory-grid::before {
    content: "";
    position: absolute;
    left: 7%;
    right: 7%;
    top: 94px;
    height: 2px;
    background:
        linear-gradient(
            to right,
            transparent 0%,
            rgba(65,65,65,0.72) 14%,
            #414141 50%,
            rgba(65,65,65,0.72) 86%,
            transparent 100%
        );
    box-shadow: 0 0 6px rgba(65,65,65,0.14);
    pointer-events: none;
}

.meeting-person-card {
    position: relative;
    z-index: 3;
    background: transparent;
    color: #fff;
    text-align: center;
    vertical-align: top;
    padding: 0;
    box-sizing: border-box;
}

.meeting-chair-card {
    width: 180px;
}

.meeting-side .meeting-person-card {
    width: 50%;
    min-width: 0;
}

.meeting-advisory-card {
    width: 33.333%;
    min-width: 0;
}

.meeting-person-inner {
    display: flex;
    justify-content: center;
    padding: 0;
    background: transparent;
}

.meeting-person-stack {
    width: 90%;
    margin-top: 3px;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.meeting-side .meeting-person-stack {
    width: 94%;
}

.meeting-advisory-card .meeting-person-stack {
    width: 92%;
}

.meeting-person-stack .compact-crt-media {
    margin-left: auto;
    margin-right: auto;
    flex: 0 0 auto;
}

.meeting-person-stack .office-card-name-cell {
    width: 170px;
    max-width: 100%;
    margin-top: 6px;
    margin-left: auto;
    margin-right: auto;
    flex: 0 0 auto;
}

.meeting-chair-card .office-card-name-cell {
    width: 170px;
}

.meeting-advisory-card .office-card-name-cell {
    width: 170px;
}

.meeting-office {
    display: block;
    margin-top: 2px;
    color: #7F7F7F;
    font-size: 10px;
    line-height: 1.3;
    font-weight: normal;
}

/* =========================================
   ScreenHeader
   ========================================= */

.liberty-content:has(.screen-header) .liberty-content-header .title {
    display: none !important;
}

.Liberty .content-wrapper .liberty-content:has(.screen-header) .liberty-content-main {
    position: relative !important;
    box-sizing: border-box !important;
    background: #171717 !important;
    border: 2px solid #854369 !important;
    border-bottom: none !important;
}

.liberty-content:has(.screen-header) .screen-title-plate,
.liberty-content:has(.screen-header) .screen-header-frame,
.liberty-content:has(.screen-header) .screen-header-inner,
.liberty-content:has(.screen-header) .screen-header-media,
.liberty-content:has(.screen-header) .screen-header-vignette,
.liberty-content:has(.screen-header) .screen-header-scanline,
.liberty-content:has(.screen-header) .screen-header-mask,
.liberty-content:has(.screen-header) .screen-header-glass,
.liberty-content:has(.screen-header) .screen-header-subtitle {
    display: none !important;
}

.screen-header {
    position: relative !important;
    width: calc(100% + 32px) !important;
    height: var(--screen-header-height, 360px) !important;
    margin: -16px -16px 0 -16px !important;
    padding: 8px 8px 4px 8px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    background: #171717 !important;
    border: 0 !important;
    border-bottom: 0 !important;
    isolation: isolate !important;
}

.screen-header-recess {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 4px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    background: #171717 !important;
    border: none !important;
    border-radius: 6px !important;
    box-shadow:
        inset 0 18px 30px rgba(0,0,0,0.55),
        inset 0 -9px 16px rgba(255,255,255,0.018),
        inset 18px 0 30px rgba(0,0,0,0.40),
        inset -18px 0 30px rgba(0,0,0,0.40) !important;
}

.screen-header-recess::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.10;
    background:
        repeating-linear-gradient(
            135deg,
            rgba(255,255,255,0.030) 0px,
            rgba(255,255,255,0.030) 1px,
            transparent 1px,
            transparent 5px
        );
    mix-blend-mode: screen;
}

.screen-header-recess::after {
    content: "";
    position: absolute;
    inset: 14px;
    z-index: 12;
    pointer-events: none;
    border-radius: 0;
    box-shadow:
        0 -20px 32px rgba(0,0,0,0.86),
        0 12px 18px rgba(255,255,255,0.024),
        -20px 0 32px rgba(0,0,0,0.78),
        20px 0 32px rgba(0,0,0,0.78),
        inset 0 0 0 1px rgba(255,255,255,0.018) !important;
}

.screen-header .screen-header-crt {
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.screen-header .screen-header-crt::before,
.screen-header .screen-header-crt::after {
    content: none !important;
}

.screen-header .crt-page-monitor-inner {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    padding: 5px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    background:
        linear-gradient(
            145deg,
            #111111 0%,
            #1a1a1a 46%,
            #111111 100%
        ) !important;
    border: none !important;
    box-shadow:
        inset 0 10px 20px rgba(0,0,0,0.70),
        inset 0 -2px 4px rgba(255,255,255,0.022),
        inset 8px 0 18px rgba(0,0,0,0.55),
        inset -8px 0 18px rgba(0,0,0,0.55) !important;
}

.screen-header .crt-page-monitor-screen {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    background: #050505 !important;
    border: 1px solid #050505 !important;
    box-shadow:
        inset 0 0 0 1px #111,
        inset 0 0 24px rgba(0,0,0,0.94),
        inset 0 0 64px rgba(0,0,0,0.80),
        inset 0 0 118px rgba(0,0,0,0.50),
        0 0 0 1px rgba(255,255,255,0.030) !important;
}

.screen-header .crt-page-monitor-image,
.screen-header .crt-page-monitor-image-base,
.screen-header .crt-page-monitor-image-bloom,
.screen-header .crt-page-monitor-slice {
    position: absolute !important;
    inset: 0 !important;
    border-radius: 0 !important;
}

.screen-header .crt-page-monitor-image-base a,
.screen-header .crt-page-monitor-image-base span,
.screen-header .crt-page-monitor-image-base .mw-file-description,
.screen-header .crt-page-monitor-image-base .mw-default-size,
.screen-header .crt-page-monitor-image-base .mw-image-border,
.screen-header .crt-page-monitor-image-bloom a,
.screen-header .crt-page-monitor-image-bloom span,
.screen-header .crt-page-monitor-image-bloom .mw-file-description,
.screen-header .crt-page-monitor-image-bloom .mw-default-size,
.screen-header .crt-page-monitor-image-bloom .mw-image-border,
.screen-header .crt-page-monitor-slice a,
.screen-header .crt-page-monitor-slice span,
.screen-header .crt-page-monitor-slice .mw-file-description,
.screen-header .crt-page-monitor-slice .mw-default-size,
.screen-header .crt-page-monitor-slice .mw-image-border {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

.screen-header .crt-page-monitor-image-base img,
.screen-header .crt-page-monitor-image-base .mw-file-element,
.screen-header .crt-page-monitor-image-bloom img,
.screen-header .crt-page-monitor-image-bloom .mw-file-element,
.screen-header .crt-page-monitor-slice img,
.screen-header .crt-page-monitor-slice .mw-file-element,
.screen-header .crt-page-monitor-slice-img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: var(--screen-image-position, center center) !important;
    border: 0 !important;
    border-radius: 0 !important;
}

.screen-header .crt-page-monitor-screen::before {
    content: "" !important;
    position: absolute !important;
    inset: -4px !important;
    z-index: 20 !important;
    pointer-events: none !important;
    border-radius: 0 !important;
    background:
        radial-gradient(
            ellipse at 50% 50%,
            transparent 0%,
            transparent 62%,
            rgba(0,0,0,0.18) 78%,
            rgba(0,0,0,0.48) 100%
        ),
        linear-gradient(
            to bottom,
            rgba(0,0,0,0.20) 0%,
            transparent 14%,
            transparent 82%,
            rgba(0,0,0,0.28) 100%
        ),
        linear-gradient(
            to right,
            rgba(0,0,0,0.20) 0%,
            transparent 8%,
            transparent 92%,
            rgba(0,0,0,0.20) 100%
        ),
        linear-gradient(
            105deg,
            transparent 0%,
            rgba(255,255,255,0.030) 18%,
            transparent 38%,
            transparent 100%
        ) !important;
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.018),
        inset 0 0 24px rgba(255,255,255,0.015),
        inset 0 0 74px rgba(0,0,0,0.64),
        inset 0 22px 38px rgba(0,0,0,0.60),
        inset 0 -20px 36px rgba(0,0,0,0.44),
        inset 18px 0 36px rgba(0,0,0,0.56),
        inset -18px 0 36px rgba(0,0,0,0.56) !important;
}

.screen-header .crt-page-monitor-screen::after {
    content: "" !important;
    position: absolute !important;
    inset: -80px -4px !important;
    z-index: 21 !important;
    pointer-events: none !important;
    opacity: 0.22 !important;
    border-radius: 0 !important;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,0.08) 0px,
            rgba(255,255,255,0.08) 1px,
            transparent 2px,
            transparent 5px
        ) !important;
    mix-blend-mode: screen !important;
    animation: crt-scanlines-up 7s linear infinite !important;
}

.screen-header .crt-page-monitor-glitch,
.screen-header .crt-page-monitor-tear {
    inset: -4px !important;
    border-radius: 0 !important;
}

.screen-header .crt-page-monitor-glitch {
    z-index: 22 !important;
}

.screen-header .crt-page-monitor-tear {
    z-index: 23 !important;
}

.screen-header-title {
    position: absolute !important;
    left: 5px !important;
    bottom: 5px !important;
    z-index: 40 !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: calc(100% - 10px) !important;
    box-sizing: border-box !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.screen-header-title-main {
    margin: 0 !important;
    padding: 0 0 8px 10px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #ffffff !important;
    font-family: 'BoldRound', sans-serif !important;
    font-size: 40px !important;
    font-weight: 700 !important;
    line-height: 0.95 !important;
    letter-spacing: 0.06em !important;
    text-shadow:
        3px 3px 0 rgba(0,0,0,0.98),
        0 0 6px rgba(0,0,0,0.98),
        0 0 14px rgba(0,0,0,0.95),
        0 0 26px rgba(0,0,0,0.92),
        -1px 0 0 rgba(80,160,255,0.24),
        1px 0 0 rgba(255,55,90,0.22) !important;
    white-space: nowrap !important;
}

.screen-header-subtitle {
    display: none !important;
}

.screen-header + .screen-body {
    border-top: 0 !important;
    margin-top: 0 !important;
}

/* =========================================
   Document View System — doc-*
   ========================================= */

.screen-body {
    position: relative;
    width: calc(100% + 32px);
    margin: 0 -16px 0 -16px;
    padding: 4px 8px 4px 8px;
    box-sizing: border-box;
    background: #171717;
    box-shadow:
        inset 1px 0 0 #494949,
        inset 0 2px 8px rgba(0,0,0,0.60);
    border-top: 0;
    overflow: visible;
}

.doc-body {
    position: relative;
    z-index: 3;
    box-sizing: border-box;
    width: 100%;
    padding: 0;
    background: transparent;
}

/* =========================================
   doc-header
   ========================================= */

.doc-header {
    position: relative;
    display: grid;
    grid-template-columns: 24px 1fr auto 24px;
    align-items: center;
    height: 28px;
    margin-bottom: 7px;
    padding: 0 8px;
    box-sizing: border-box;
    background:
        linear-gradient(
            to bottom,
            #282828 0%,
            #1a1a1a 40%,
            #161616 100%
        );
    border-top: 1px solid #3a3a3a;
    border-bottom: 1px solid #0a0a0a;
    border-left: 1px solid #222;
    border-right: 1px solid #222;
    border-radius: 2px;
}

.doc-header::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.06;
    background: repeating-linear-gradient(
        135deg,
        rgba(255,255,255,0.08) 0px,
        rgba(255,255,255,0.08) 1px,
        transparent 1px,
        transparent 4px
    );
    border-radius: inherit;
}

.doc-header-id {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: #c0c0c0;
    text-shadow: 0 1px 0 rgba(0,0,0,0.80);
    position: relative;
    z-index: 1;
}

.doc-screw {
    position: relative;
    z-index: 1;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 36% 32%, rgba(255,255,255,0.35) 0%, transparent 28%),
        linear-gradient(145deg, #505050 0%, #282828 55%, #0e0e0e 100%);
    border: 1px solid #090909;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.15),
        inset 0 -1px 0 rgba(0,0,0,0.60),
        0 0 0 1px #333;
    justify-self: center;
}

.doc-screw::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 15%;
    right: 15%;
    height: 1px;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.55);
    border-radius: 1px;
}

.doc-status {
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    z-index: 1;
}

.doc-status-lamp {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #111;
    border: 1px solid #060606;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.06),
        0 0 0 1px #252525;
}

.doc-status-lamp.on {
    background: radial-gradient(circle at 38% 32%, #d9ff9d 0%, #7ec43e 45%, #253d18 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.28),
        0 0 0 1px #1a3010,
        0 0 5px rgba(100,200,50,0.45);
}

.doc-status-lamp.warn {
    background: radial-gradient(circle at 38% 32%, #ffe8b0 0%, #d89a42 45%, #4d2a0d 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.28),
        0 0 0 1px #3a1f06,
        0 0 5px rgba(220,140,40,0.45);
}

/* =========================================
   doc-layout
   ========================================= */

.doc-layout {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) 320px;
    gap: 7px;
    align-items: stretch;
    min-height: 480px;
}

.doc-layout-left,
.doc-layout-center,
.doc-layout-right {
    min-width: 0;
}

.doc-layout-center,
.doc-layout-right {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.doc-layout-lower {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px;
    flex: 1;
}

/* =========================================
   doc-panel
   ========================================= */

.doc-panel {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    background: #1a1a1a;
    border-top: 1px solid #303030;
    border-bottom: 1px solid #080808;
    border-left: 1px solid #222;
    border-right: 1px solid #111;
    border-radius: 2px;
    overflow: hidden;
}

.doc-panel::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, rgba(255,255,255,0.25) 0%, transparent 40%),
        linear-gradient(145deg, #444 0%, #1e1e1e 100%);
    border: 1px solid #080808;
    box-shadow: 0 0 0 1px #2a2a2a;
    pointer-events: none;
    z-index: 10;
}

.doc-panel::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, rgba(255,255,255,0.25) 0%, transparent 40%),
        linear-gradient(145deg, #444 0%, #1e1e1e 100%);
    border: 1px solid #080808;
    box-shadow: 0 0 0 1px #2a2a2a;
    pointer-events: none;
    z-index: 10;
}

.doc-panel-title {
    position: relative;
    z-index: 3;
    box-sizing: border-box;
    padding: 6px 10px 5px 10px;
    font-family: 'Galmuri11', sans-serif !important;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    letter-spacing: 0.10em;
    color: #888;
    background: linear-gradient(to bottom, #161616 0%, #121212 100%);
    border-bottom: 1px solid #0d0d0d;
    text-shadow: 0 1px 0 rgba(0,0,0,0.80);
    text-transform: uppercase;
}

.doc-panel-heading {
    padding: 10px 18px;
    font-size: 11px;
    font-weight: 700;
    color: #7a7a7a;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 0 rgba(0,0,0,0.80);
    position: relative;
    z-index: 3;
}

.doc-panel table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.doc-panel table th,
.doc-panel table td {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    vertical-align: middle !important;
}

.doc-panel table th[style],
.doc-panel table td[style] {
    background: revert !important;
    border: revert !important;
    padding: revert !important;
}

/* =========================================
   doc-display
   ========================================= */

.doc-display {
    position: relative;
    z-index: 3;
    box-sizing: border-box;
    padding: 4px 14px;
    margin-bottom: 0;
    min-height: 90px;
    line-height: 1.8;
    color: #d8d8d8;
    background: #111111;
    border-top: 1px solid #0a0a0a;
    box-shadow:
        inset 0 2px 6px rgba(0,0,0,0.55),
        inset 0 0 1px rgba(0,0,0,0.80);
}

/* =========================================
   doc-info
   ========================================= */

.doc-info-row {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin: 7px 10px 0 10px;
}

.doc-info-key {
    font-size: 10px;
    font-weight: 700;
    color: #7a7a7a;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 0 rgba(0,0,0,0.70);
}

.doc-info-value {
    position: relative;
    overflow: hidden;
    text-align: right;
    border-radius: 2px;
    background: #0e0e0e;
    color: #d8d8d8;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 700;
    box-sizing: border-box;
    border-top: 1px solid #0a0a0a;
    border-bottom: 1px solid #252525;
    border-left: 1px solid #111;
    border-right: 1px solid #111;
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.60),
        inset 1px 0 0 rgba(255,255,255,0.015);
}

.doc-info-value::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0.15;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,0.055) 0px,
        rgba(255,255,255,0.055) 1px,
        transparent 2px,
        transparent 4px
    );
    mix-blend-mode: screen;
}

.doc-info-block {
    padding: 0 8px 6px 8px;
    background: #1a1a1a;
}

.doc-info-block-label {
    display: block;
    padding: 6px 2px 4px 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a9a9a;
    text-shadow: 0 1px 0 rgba(0,0,0,0.80);
}

/* =========================================
   doc-nav
   ========================================= */

.doc-nav {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.doc-nav-item {
    position: relative;
    z-index: 3;
    box-sizing: border-box;
    width: calc(100% - 16px);
    margin: 5px 8px 0 8px;
    padding: 7px 24px 7px 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    color: #666;
    background: linear-gradient(to bottom, #232323 0%, #1a1a1a 50%, #161616 100%);
    border-top: 1px solid #2e2e2e;
    border-bottom: 1px solid #0a0a0a;
    border-left: 1px solid #222;
    border-right: 1px solid #111;
    border-radius: 2px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.025),
        0 1px 0 rgba(255,255,255,0.012);
    cursor: pointer;
    display: block;
    text-decoration: none;
    text-shadow: 0 1px 0 rgba(0,0,0,0.70);
}

.doc-nav-item::after {
    content: "›";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #333;
    font-size: 13px;
}

.doc-nav-item.active {
    color: #e8e8e8;
    background: linear-gradient(to bottom, #5a2040 0%, #3d1a2f 52%, #2e1222 100%);
    border-top-color: #7a3055;
    border-bottom-color: #1a0810;
    border-left-color: #6a2848;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.06),
        0 0 6px rgba(212,90,162,0.10);
}

.doc-nav-item.active::after {
    color: #d45aa2;
}

/* =========================================
   doc-status-row
   ========================================= */

.doc-status-row {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 5px 8px 0 8px;
    padding: 5px 9px;
    box-sizing: border-box;
    font-size: 10px;
    font-weight: 700;
    color: #555;
    background: #111;
    border-top: 1px solid #0a0a0a;
    border-bottom: 1px solid #222;
    border-left: 1px solid #111;
    border-right: 1px solid #111;
    border-radius: 2px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.50);
    letter-spacing: 0.06em;
    text-shadow: 0 1px 0 rgba(0,0,0,0.80);
}

/* =========================================
   doc-link
   ========================================= */

.doc-link {
    position: relative;
    z-index: 3;
    box-sizing: border-box;
    margin: 5px 10px 0 10px;
    padding: 6px 10px 6px 14px;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    background: linear-gradient(to bottom, #1a1a1a 0%, #151515 100%);
    border-top: 1px solid #242424;
    border-bottom: 1px solid #080808;
    border-left: 1px solid #1e1e1e;
    border-right: 1px solid #111;
    border-radius: 2px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.018);
    display: block;
    text-decoration: none;
    cursor: pointer;
    text-shadow: 0 1px 0 rgba(0,0,0,0.70);
}

.doc-link::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 20%;
    bottom: 20%;
    width: 2px;
    background: #2e2e2e;
    border-radius: 1px;
}

.doc-link:hover {
    color: #c0c0c0;
    background: linear-gradient(to bottom, #222 0%, #1a1a1a 100%);
    border-top-color: #333;
}

.doc-link:hover::before {
    background: #854369;
}

/* =========================================
   doc-tab-bar
   ========================================= */

.doc-tab-bar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 6px;
    background: linear-gradient(to bottom, #141414 0%, #111 100%);
    border-top: 1px solid #0a0a0a;
    box-shadow: inset 0 1px 0 rgba(0,0,0,0.60);
}

.doc-tab-key {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 3px;
    padding: 0 4px;
    user-select: none;
    white-space: nowrap;
}

.doc-tab-key kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 10px;
    font-weight: 700;
    font-family: inherit;
    color: #e2e2e2;
    background: linear-gradient(to bottom, #2a2a2a 0%, #1e1e1e 100%);
    border-top: 1px solid #3a3a3a;
    border-bottom: 1px solid #080808;
    border-left: 1px solid #2e2e2e;
    border-right: 1px solid #111;
    border-radius: 2px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.06),
        0 1px 0 rgba(255,255,255,0.02);
    text-shadow: 0 1px 0 rgba(0,0,0,0.80);
}

.doc-tab-key .doc-tab-arrow {
    font-size: 10px;
    color: #333;
    line-height: 1;
}

.doc-tab {
    flex: 1;
    box-sizing: border-box;
    padding: 6px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #e2e2e2;
    background: linear-gradient(to bottom, #1e1e1e 0%, #181818 100%);
    border-top: 1px solid #2a2a2a;
    border-bottom: 1px solid #080808;
    border-left: 1px solid #222;
    border-right: 1px solid #111;
    border-radius: 2px;
    cursor: pointer;
    text-align: center;
    text-shadow: 0 1px 0 rgba(0,0,0,0.80);
    text-transform: uppercase;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-tab:hover {
    color: #ffffff;
    background: linear-gradient(to bottom, #242424 0%, #1a1a1a 100%);
    border-top-color: #333;
}

.doc-tab.active {
    color: #ffffff;
    background: linear-gradient(to bottom, #2e1222 0%, #3d1a2f 52%, #5a2040 100%);
    border-top-color: #7a3055;
    border-bottom-color: #1a0810;
    border-left-color: #6a2848;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

/* =========================================
   doc-footer
   ========================================= */

.doc-footer {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 110px 44px 110px 200px;
    gap: 12px;
    align-items: center;
    height: 44px;
    margin-top: 7px;
    padding: 0 10px;
    box-sizing: border-box;
    background: linear-gradient(to bottom, #282828 0%, #1a1a1a 40%, #161616 100%);
    box-shadow:
        inset 1px 0 0 #494949,
        inset 0 -1px 0 #555,
        inset 0 2px 6px rgba(0,0,0,0.55);
    border-top: 1px solid #3a3a3a;
    border-bottom: 1px solid #0a0a0a;
    border-left: 1px solid #222;
    border-right: 1px solid #222;
    border-radius: 2px;
}

.doc-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.05;
    background: repeating-linear-gradient(
        135deg,
        rgba(255,255,255,0.08) 0px,
        rgba(255,255,255,0.08) 1px,
        transparent 1px,
        transparent 4px
    );
}

.doc-footer-sliders {
    display: flex;
    align-items: center;
    gap: 10px;
}

.doc-slider {
    position: relative;
    width: 80px;
    height: 6px;
    background: #0a0a0a;
    border-top: 1px solid #080808;
    border-bottom: 1px solid #222;
    border-radius: 99px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.70);
}

.doc-slider.short {
    width: 54px;
}

.doc-slider::after {
    content: "";
    position: absolute;
    top: -6px;
    left: 48%;
    width: 10px;
    height: 18px;
    border-radius: 2px;
    background: linear-gradient(to bottom, #c8c0b2 0%, #8a8278 100%);
    border-top: 1px solid #d8d0c2;
    border-bottom: 1px solid #2a2622;
    border-left: 1px solid #aaa49c;
    border-right: 1px solid #5a544e;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.30),
        0 1px 3px rgba(0,0,0,0.40);
}

.doc-date {
    box-sizing: border-box;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #d45aa2;
    background: #0a0a0a;
    border-top: 1px solid #080808;
    border-bottom: 1px solid #2a1a22;
    border-left: 1px solid #0e0e0e;
    border-right: 1px solid #0e0e0e;
    border-radius: 2px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.70);
    text-shadow: 0 0 8px rgba(212,90,162,0.40);
}

.doc-knob {
    justify-self: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 36% 28%, rgba(255,255,255,0.30) 0%, transparent 24%),
        linear-gradient(145deg, #c8bfb0 0%, #8a8278 48%, #464039 100%);
    border: 1px solid #2a2520;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.30),
        inset 0 -2px 0 rgba(0,0,0,0.22),
        0 2px 5px rgba(0,0,0,0.50);
}

.doc-keys {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.doc-keys span {
    height: 22px;
    border-radius: 2px;
    background: linear-gradient(to bottom, #d8d4ca 0%, #a09890 55%, #6e6660 100%);
    border-top: 1px solid #e0dcd2;
    border-bottom: 1px solid #1e1c18;
    border-left: 1px solid #b8b0a8;
    border-right: 1px solid #4a4440;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.40),
        0 1px 2px rgba(0,0,0,0.30);
}

.doc-keys span.red {
    background: linear-gradient(to bottom, #cc6058 0%, #922e28 55%, #521410 100%);
    border-top-color: #d87070;
    border-bottom-color: #1e0808;
}

.doc-keys span.amber {
    background: linear-gradient(to bottom, #e4bc6c 0%, #b87c28 55%, #6c3e08 100%);
    border-top-color: #ecd080;
    border-bottom-color: #201008;
}

/* =========================================
   Responsive
   ========================================= */

@media screen and (max-width: 1280px) {
    .doc-layout {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .doc-layout-right {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 7px;
    }

    .doc-footer {
        grid-template-columns: 1fr 110px 44px 110px;
    }

    .doc-keys {
        display: none;
    }
}

@media screen and (max-width: 980px) {
    .doc-layout,
    .doc-layout-lower,
    .doc-layout-right {
        grid-template-columns: 1fr;
    }

    .doc-footer {
        grid-template-columns: 1fr;
        height: auto;
        padding: 8px 10px;
    }

    .doc-footer-sliders {
        justify-content: center;
    }

    .doc-date,
    .doc-knob {
        justify-self: center;
    }
}