@keyframes marquee { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }
.animate-marquee { display: inline-block; animation: marquee 15s linear infinite; }
.game-hover:hover { transform: translateY(-3px); box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.3); }

.modal {
    display: none; 
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal[style*="display: block"] {
    display: flex !important;
}

.modal-content {
    width: 95% !important;
    max-width: 900px !important;
    max-height: 88vh !important;
    margin: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    position: relative;
    border-radius: 2rem;
    background: inherit;
}

.modal-content {
    border-radius: 2rem !important;
    max-height: 88vh !important; 
    overflow-y: auto !important; 
    overscroll-behavior-y: contain;
}

.modal-content::-webkit-scrollbar {
    width: 18px; 
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
    margin-top: 2rem;   
    margin-bottom: 2rem; 
}

.modal-content::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 100px;
    border: 6px solid transparent; 
    background-clip: content-box; 
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}


        .item-box .scroll-name { display: none; width: 100%; text-align: center; }
        .item-box .truncate-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; text-align: center; }
        
        .group:hover .item-box .scroll-name,
        input[type="radio"]:checked ~ .item-box .scroll-name {
            display: block;
        }
        
        .group:hover .item-box .truncate-name,
        input[type="radio"]:checked ~ .item-box .truncate-name {
            display: none;
        }

        .group:hover .item-box .scroll-name span,
        input[type="radio"]:checked ~ .item-box .scroll-name span {
            display: inline-block;
            white-space: nowrap;
            animation: true-marquee 5s linear infinite; 
        }


        @keyframes true-marquee {
            0%, 15%   { transform: translateX(0); opacity: 1; }
            57.5%     { transform: translateX(-120%); opacity: 1; } 
            57.51%    { transform: translateX(-120%); opacity: 0; }
            57.52%    { transform: translateX(120%); opacity: 0; }
            57.53%    { transform: translateX(120%); opacity: 1; }
            100%      { transform: translateX(0); opacity: 1; }
        }
        }

.no-scrollbar::-webkit-scrollbar { display: none; }
.custom-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.custom-scroll::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.4); border-radius: 10px; }


/* 高级弹窗背景 */
.draw-modal-bg { background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(8px); }

/* --- 幸运转盘高级样式 (已修复绝对正圆与防挤压) --- */
.roulette-outer {
    width: 330px;  /* 强制固定尺寸 */
    height: 330px; /* 强制固定尺寸，确保宽高1:1 */
    border-radius: 50%; /* 绝对正圆 */
    background: linear-gradient(145deg, #ffca28, #ff8f00);
    box-shadow: 0 0 30px rgba(255, 143, 0, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.5);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* 禁止被外层 flex 弹性盒子挤压变形 */
    margin: 0 auto;
}
.roulette-lights {
    position: absolute; inset: 6px; border-radius: 50%;
    border: 4px dashed rgba(255, 255, 255, 0.7);
    animation: spinLights 15s linear infinite;
    pointer-events: none; /* 防止遮挡点击 */
}
@keyframes spinLights { 100% { transform: rotate(360deg); } }
.roulette-inner {
    width: 300px; /* 内部也强制正圆尺寸 */
    height: 300px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: inset 0 0 25px rgba(0,0,0,0.6);
    position: relative;
}
.roulette-pointer-box {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 80px; height: 80px; border-radius: 50%;
    background: radial-gradient(circle, #ff5252, #b71c1c);
    border: 4px solid #ffe082;
    box-shadow: 0 5px 25px rgba(0,0,0,0.7), inset 0 0 10px rgba(255,255,255,0.4);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #fffde7; font-weight: 900; font-size: 18px; cursor: pointer; z-index: 20;
    transition: transform 0.2s;
}
.roulette-pointer-box:active { transform: translate(-50%, -50%) scale(0.95); }
.roulette-pointer-box::after {
    content: ''; position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
    border-width: 0 16px 26px 16px; border-style: solid;
    border-color: transparent transparent #ffe082 transparent; filter: drop-shadow(0 -3px 3px rgba(0,0,0,0.4));
}
.r-item {
    position: absolute; top: 0; left: 50%; width: 100px; height: 50%;
    transform-origin: 50% 100%; margin-left: -50px;
    display: flex; flex-direction: column; align-items: center; padding-top: 18px;
    font-weight: 900; color: #333333; z-index: 10;
}

/* --- 盲盒红包高级样式 (恢复完整) --- */
.env-container { width: 280px; height: 360px; position: relative; perspective: 1200px; margin-top: 20px; }
.env-body {
    width: 100%; height: 100%; background: linear-gradient(135deg, #e53935, #b71c1c);
    border-radius: 16px; position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 0 25px rgba(255,255,255,0.1);
    border: 1px solid #ef5350; overflow: visible;
}
.env-flap {
    position: absolute; top: 0; left: 0; width: 100%; height: 150px;
    background: linear-gradient(180deg, #f44336, #c62828);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: top; transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 15; border-top-left-radius: 16px; border-top-right-radius: 16px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.3);
}
.env-flap.open { transform: rotateX(180deg); z-index: 1; opacity: 0.9; }
.env-btn {
    position: absolute; top: 110px; left: 50%; transform: translateX(-50%);
    width: 90px; height: 90px; border-radius: 50%;
    background: linear-gradient(135deg, #ffecb3, #ffb300);
    border: 3px solid #fff3e0; box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: #d84315; cursor: pointer; z-index: 20;
    transition: all 0.3s;
}
.env-btn:hover { transform: translateX(-50%) scale(1.08) rotate(15deg); }
.env-btn.hide { opacity: 0; pointer-events: none; transform: translateX(-50%) scale(0); }
.env-paper {
    position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%);
    width: 90%; height: 0; background: linear-gradient(to bottom, #fffde7, #fff9c4);
    border-radius: 10px; transition: height 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
    z-index: 5; overflow: hidden; display: flex; flex-direction: column; align-items: center;
    box-shadow: 0 -10px 20px rgba(0,0,0,0.3); border: 2px solid #ffe082;
}
.env-paper.open { height: 260px; padding-top: 20px; }

@media (min-width: 1024px) {
    #right-sidebar-wrapper { overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
    #right-sidebar-content { transform-origin: center center; width: 100%; flex-shrink: 0; display: flex; flex-direction: column; justify-content: space-between; }
}