* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

:root {
    --primary-color: #00a8ff;
    --origin-color: #9b59b6;
    --new-badge-color: #ff4757;
    
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --glass-bg: rgba(20, 20, 30, 0.7); 
    --glass-card-bg: rgba(255, 255, 255, 0.05);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-blur: blur(12px);
    
    --text-main: #e0e0e0;
    --text-muted: #aaa;
}

body {
    background-image: var(--bg-gradient);
    background-attachment: fixed; 
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-y: scroll;
}

/* header {
    background: transparent; 
    padding: 0;
    position: sticky; 
    top: 0;
    z-index: 1001;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-bottom: var(--glass-border);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-container button {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-main);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-container button:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
} */

#toggle-origin-mode {
    --gold-color: #FFD700; 
    
    border-color: var(--gold-color) !important;
    color: var(--gold-color) !important;
    font-weight: bold;
    
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.2);
    
    display: flex;
    align-items: center;
    gap: 8px; 
    padding: 8px 15px;
    border-radius: 6px; 
    transition: all 0.3s ease;
}

#toggle-origin-mode::before {
    content: '🐉';
    font-size: 1.4em;
    line-height: 1;
    filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.5));
}

#toggle-origin-mode.active {
    background: linear-gradient(135deg, var(--origin-color), #4a235a) !important;
    color: var(--gold-color) !important;
    border-color: var(--gold-color) !important;
    
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), inset 0 0 10px var(--origin-color) !important;
}

#toggle-origin-mode:hover {
    background: rgba(255, 215, 0, 0.1); 
    border-color: var(--gold-color);
    transform: translateY(-2px); 
}

.menu {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 300px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-right: var(--glass-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content {
    padding: 20px 40px;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 769px) {
    .menu {
        transform: translateX(0) !important;
    }
    .content {
        margin-left: 300px !important;
    }

    body.menu-hidden .menu {
        transform: translateX(-300px) !important;
    }
    body.menu-hidden .content {
        margin-left: 0 !important;
    }
}

@media (max-width: 768px) {
    .menu {
        width: 85%;
        max-width: 300px;
        transform: translateX(-100%) !important;
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    }

    .content {
        margin-left: 0 !important;
        padding: 15px;
    }

    .menu.show {
        transform: translateX(0) !important;
    }
}

@media (max-width: 768px) {
    .menu {
        width: 100%;
        transform: translateX(-100%);
    }
    .menu.show {
        transform: translateX(0);
    }
}

#character-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    color: var(--text-main);
    text-align: left;
    transition: background 0.2s;
    position: relative;
}

#character-menu button:hover {
    background: rgba(255,255,255,0.1);
}

#character-menu button img.avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.2);
}

.character-button img.avatar {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
}

.avatar-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-wrapper img.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    border: none;
    margin: 0;
}

.new-badge {
    position: absolute;
    top: 3px;
    left: -22px;
    transform: rotate(-45deg);
    width: 60px;
    background-color: #d9534f;
    color: white;
    font-size: 0.44rem;
    font-weight: bold;
    text-align: center;
    line-height: 9px;
    padding: 1px 0;
    z-index: 10;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    margin: 0;
    border-radius: 0;
}

.thumbnail, .skill-gif {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

#filter-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 6px; 
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#filter-tabs button {
    width: 100%;
    min-height: 50px; 
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 2px; 
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.7;
    
    display: flex;
    align-items: center;
    justify-content: center;
}

#filter-tabs button img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
    margin: 0;
}

#class-filter-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 6px; 
    padding: 10px;
}

#class-filter-tabs button {
    width: 90%;
    padding: 0; 
    border: none;
    background: transparent;
    border-radius: 6px; 
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
    overflow: hidden;
    aspect-ratio: 2.2 / 1; 
    
    display: flex;
    align-items: center;
    justify-content: center;
}

#class-filter-tabs button img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
}

#filter-tabs button:hover, #class-filter-tabs button:hover {
    opacity: 1;
    transform: translateY(-2px);
    background: rgba(255,255,255,0.15);
}

#filter-tabs button.active {
    opacity: 1;
    border-color: var(--primary-color);
    background: rgba(0, 168, 255, 0.2);
    box-shadow: 0 0 8px rgba(0, 168, 255, 0.4);
}

#class-filter-tabs button.active {
    opacity: 1;
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    box-shadow: 0 0 8px rgba(0, 168, 255, 0.4);
    transform: scale(1.05);
}

body.origin-mode .menu button:not(.is-origin) {
    display: none;
}

body.origin-mode .menu button.is-origin {
    border-left: 3px solid var(--origin-color);
    background: linear-gradient(90deg, rgba(155, 89, 182, 0.2), transparent);
}

.origin-skill-view {
    animation: fadeIn 0.5s ease;
    max-width: 800px; 
    margin: 0 auto;
}

.origin-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--origin-color);
}

.origin-header img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--origin-color);
    box-shadow: 0 0 20px var(--origin-color);
    margin-bottom: 15px;
}

.origin-header h2 {
    color: var(--origin-color);
    font-size: 2rem;
    margin: 0;
    text-shadow: 0 0 10px rgba(155, 89, 182, 0.5);
}

.origin-content-body h3 { 
    color: #fff;
    background: linear-gradient(90deg, var(--origin-color), transparent);
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 30px;
}

.origin-content-body strong {
    color: #f1c40f; 
}

.origin-content-body ul {
    background: var(--glass-card-bg);
    border: var(--glass-border);
    border-radius: 12px;
    padding: 20px 40px;
    margin: 15px 0 30px 0;
    list-style-type: circle;
}

.origin-content-body li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.origin-content-body p {
    white-space: pre-wrap;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.4);
}


blockquote {
    margin: 20px 0;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    color: #ddd;
    font-style: italic;
    font-size: 0.95em;
    line-height: 1.6;
    text-align: justify;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
}

blockquote p {
    margin: 0;
    padding: 0;
}

.origin-skill-view blockquote {
    border-left-color: var(--origin-color);
    background: rgba(155, 89, 182, 0.1);
    color: #e0c0e0;
}

.vip-text {
    background: linear-gradient(
        90deg,
        #ff9a9e, 
        #fecfef, 
        #fff6b3,
        #a8e6cf, 
        #dcedc1,
        #a6c0fe, 
        #c3a6fe, 
        #ff9a9e
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: rainbow-move 3s linear infinite;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.vip-icon {
    margin-right: 5px;
    font-size: 1.1em;
}

.system-nav { display: flex; gap: 5px; }
.tools-nav { display: flex; gap: 5px; }
/* .nav-btn {
    background: transparent; border: 1px solid rgba(255,255,255,0.2);
    color: #ccc; padding: 8px 15px; border-radius: 6px; cursor: pointer;
    transition: 0.3s;
}
.nav-btn:hover, .nav-btn.active {
    background: var(--primary-color); color: white; border-color: var(--primary-color);
} */
.mobile-only { display: none; }
@media (max-width: 768px) { .mobile-only { display: block; } }

/* Floating action dock: compact, bottom-right, and kept away from article text. */
.floating-actions-wrapper {
    position: fixed;
    top: auto;
    right: 18px;
    bottom: 18px;
    z-index: 1100;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    opacity: 0.62;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.floating-actions-wrapper:hover,
.floating-actions-wrapper:focus-within,
.floating-actions-wrapper.active {
    opacity: 1;
}

.fab-child-btn {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(8, 11, 20, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.28);
}

.fab-child-btn:hover,
.fab-child-btn:focus-visible {
    transform: translateY(-2px);
    border-color: currentColor;
    background: rgba(8, 11, 20, 0.92);
    outline: none;
}

#fab-origin-jump { color: #b48cff; border-color: rgba(155, 89, 182, 0.8); font-size: 0.95rem; font-weight: 800; }
#fab-gif-toggle { color: #2ecc71; border-color: rgba(46, 204, 113, 0.8); }
#fab-gif-toggle.gif-disabled { color: #a8b0b7; border-color: rgba(127, 140, 141, 0.8); }
#fab-build { color: #f1c40f; border-color: rgba(241, 196, 15, 0.8); }

.fab-child-btn.active {
    background: currentColor;
    color: #111;
    box-shadow: 0 0 12px currentColor;
}

.fab-label {
    position: absolute;
    right: 50%;
    bottom: 52px;
    transform: translateX(50%) translateY(4px);
    background: rgba(4, 6, 12, 0.92);
    color: white;
    padding: 5px 9px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    font-size: 0.78rem;
    line-height: 1.15;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.fab-child-btn:hover .fab-label,
.fab-child-btn:focus-visible .fab-label {
    opacity: 1;
    visibility: visible;
    transform: translateX(50%) translateY(0);
}

/* Desktop: show the action buttons as one small horizontal dock. */
.fab-main-btn {
    display: none;
}

.fab-items {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 5px;
    border-radius: 999px;
    background: rgba(5, 8, 15, 0.22);
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.floating-actions-wrapper.disabled {
    display: none !important;
}

/* A normal in-page anchor target needs clearance for the sticky header. */
.origin-skill-anchor {
    scroll-margin-top: 90px;
}

/* GIF off state: a single compact line instead of preserving the old GIF height. */
.skill-gif-placeholder {
    width: fit-content !important;
    max-width: calc(100% - 24px) !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 10px auto !important;
    padding: 6px 11px !important;
    border: 1px dashed rgba(255,255,255,0.22);
    border-radius: 999px;
    background: rgba(0,0,0,0.18);
    color: #aab3bc;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
}

.skill-gif-placeholder span {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Keep the scroll-to-top button above the action dock so controls never overlap. */
.scroll-top-btn {
    bottom: 76px;
}

@media (max-width: 768px) {
    .floating-actions-wrapper {
        top: auto;
        right: 10px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        flex-direction: column;
        align-items: flex-end;
        gap: 7px;
        opacity: 0.78;
        /* The wrapper itself must not steal taps from the back-to-top button. */
        pointer-events: none;
    }

    .fab-main-btn {
        display: flex;
        width: 42px;
        height: 42px;
        pointer-events: auto;
        border-radius: 50%;
        background: rgba(12, 17, 30, 0.9);
        color: white;
        border: 1px solid rgba(255,255,255,0.25);
        font-size: 1.15rem;
        cursor: pointer;
        box-shadow: 0 3px 10px rgba(0,0,0,0.32);
        align-items: center;
        justify-content: center;
        padding: 0;
        position: relative;
        transform: none;
        transition: transform 0.2s ease, background 0.2s ease;
        order: 2;
    }

    .fab-main-btn .icon-close { display: none; }
    .fab-main-btn .icon-menu { display: block; }

    .floating-actions-wrapper.active .fab-main-btn {
        transform: none;
        background: #c0392b;
        border-radius: 50%;
        font-size: 1.2rem;
        padding: 0;
        margin: 0;
    }
    .floating-actions-wrapper.active .icon-menu { display: none; }
    .floating-actions-wrapper.active .icon-close { display: block; }

    .fab-items {
        position: absolute;
        right: 0;
        bottom: calc(100% + 7px);
        flex-direction: column-reverse;
        gap: 7px;
        margin: 0;
        padding: 0;
        background: transparent;
        box-shadow: none;
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px) scale(0.96);
        transform-origin: bottom right;
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
        pointer-events: none;
        order: 1;
    }

    .floating-actions-wrapper.active .fab-items {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    .fab-child-btn {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        font-size: 1.08rem;
    }

    .fab-label {
        right: 50px;
        bottom: 50%;
        transform: translateY(50%) translateX(4px);
    }

    .floating-actions-wrapper.active .fab-label {
        opacity: 0;
        visibility: hidden;
    }

    .fab-child-btn:hover .fab-label,
    .fab-child-btn:focus-visible .fab-label {
        transform: translateY(50%) translateX(0);
    }

    .origin-skill-anchor {
        scroll-margin-top: 78px;
    }

    .skill-gif-placeholder {
        max-width: calc(100% - 16px) !important;
        padding: 5px 9px !important;
        margin: 8px auto !important;
    }

    .scroll-top-btn {
        right: 10px;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px));
        width: 40px;
        height: 40px;
    }
}

.build-view-wrapper {
    display: flex;
    justify-content: center;
    padding-bottom: 50px;
    animation: fadeIn 0.5s;
}

.build-card {
    width: 100%;
    max-width: 600px;
    background: linear-gradient(180deg, rgba(30, 30, 40, 0.95), rgba(15, 15, 25, 0.98));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 0 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

.build-card-header {
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.2), rgba(155, 89, 182, 0.2));
    padding: 30px 20px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.build-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f1c40f;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.6);
    margin-bottom: 15px;
    background: #000;
}

.build-card-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: #fff;
}

.build-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.build-section-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    position: relative;
}

.build-section-title {
    position: absolute;
    top: -12px;
    left: 20px;
    background: #240b36;
    padding: 0 10px;
    color: #f1c40f;
    font-weight: bold;
    font-size: 0.9rem;
    border-radius: 4px;
    border: 1px solid rgba(241, 196, 15, 0.3);
}

.build-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 5px;
}

.build-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.build-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px;
    transition: transform 0.2s;
}

.build-item:hover img {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.build-item span {
    font-size: 0.75rem;
    color: #ccc;
    margin-top: 5px;
    text-align: center;
    line-height: 1.2;
}

.main-pet img {
    border-color: #e74c3c;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.4);
}

#toast-container {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 8px;
    animation: toast-in 0.3s forwards;
    pointer-events: auto;
}

.toast.warning span { color: #f1c40f; }
.toast.error span { color: #e74c3c; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
    to { opacity: 0; transform: translateY(-10px); }
}

.build-info-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255,255,255,0.1);
    font-size: 0.9rem;
    color: #ccc;
    width: 100%;
}

.build-info-label {
    color: var(--build-color);
    font-weight: bold;
    margin-right: 5px;
    font-size: 0.85rem;
}

.build-tips-box {
    background: rgba(255, 255, 0, 0.05);
    border-left: 3px solid var(--build-color);
    padding: 15px;
    margin-top: 5px;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #eee;
    font-size: 0.9rem;
    line-height: 1.5;
}

.rune-layout {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.rune-img-box {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border: 2px solid #f1c40f;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.3);
}

.rune-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rune-info-box {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: left;
    flex: 1;
}

.rune-name {
    color: #f1c40f;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 5px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.rune-stat-line {
    font-size: 0.9rem;
    color: #e0e0e0;
    display: flex;
    align-items: baseline;
}

.rune-stat-label {
    color: #aaa;
    font-size: 0.8rem;
    margin-right: 8px;
    min-width: 70px;
    font-weight: 600;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #ccc;
    font-size: 12px;
    margin-left: 8px;
    cursor: pointer;
    transition: all 0.2s;
    vertical-align: middle;
}

.help-icon:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.clickable-item {
    cursor: pointer;
    position: relative;
}

.clickable-item:hover img {
    box-shadow: 0 0 15px var(--primary-color);
    border-color: var(--primary-color) !important;
}

.clickable-item:hover::after {
    content: '👁️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    text-shadow: 0 0 5px black;
    pointer-events: none;
    opacity: 0.8;
}

.modal-overlay {
    position: fixed; 
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85); 
    backdrop-filter: blur(5px);
    z-index: 9999; 
    
    display: none; 
    justify-content: center; 
    align-items: center;
}

.modal-content {
    background: #1a1a2e;
    border: 1px solid #f1c40f;
    width: 90%; 
    max-width: 800px; 
    max-height: 80vh; 
    border-radius: 15px; 
    padding: 25px;
    position: relative; 
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    color: #e0e0e0;
}

#close-modal {
    position: absolute; 
    top: 10px; 
    right: 15px;
    background: rgba(255, 255, 255, 0.1); 
    border: 1px solid #555; 
    color: #fff; 
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem; 
    cursor: pointer;
    z-index: 100;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}

#close-modal:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    transform: rotate(90deg);
}

#modal-title {
    margin-top: 0;
    color: #f1c40f;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
    padding-right: 40px;
}

.tip-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    vertical-align: middle;
    margin: 0 4px;
    background: rgba(0,0,0,0.3); 
    border: 1px solid rgba(255,255,255,0.2);
    display: inline-block;
}

.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select {
    position: relative;
    display: flex;
    flex-direction: column;
}

.custom-select__trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #555;
    border-radius: 5px;
    cursor: pointer;
    color: #fff;
    min-height: 40px;
}

.custom-select__trigger img {
    width: 30px; height: 30px; 
    object-fit: contain; margin-right: 10px; 
    border-radius: 4px;
}

.custom-options {
    position: absolute;
    display: block;
    top: 100%; left: 0; right: 0;
    background: #1a1a2e;
    border: 1px solid #555;
    border-top: 0;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 100;
    opacity: 0; visibility: hidden;
    pointer-events: none;
    transform: translateY(-15px);
    transition: all 0.2s;
    max-height: 250px; overflow-y: auto;
}

.custom-select.open .custom-options {
    opacity: 1; visibility: visible;
    pointer-events: all;
    transform: translateY(0);
}

.custom-option {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.custom-option:hover {
    background: var(--primary-color);
    color: #fff;
}

.custom-option img {
    width: 30px; height: 30px;
    object-fit: contain; margin-right: 10px;
    background: rgba(0,0,0,0.3); border-radius: 4px;
}

.custom-option.selected {
    background: rgba(255,255,255,0.1);
    font-weight: bold;
    color: #f1c40f;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 5px;
    margin-bottom: 5px;
}

.rune-checkbox-label {
    display: flex;
    align-items: center;
    padding: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: #ccc;
    transition: 0.2s;
    border: 1px solid transparent;
}

.rune-checkbox-label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.rune-checkbox-label input {
    margin-right: 8px;
    accent-color: var(--primary-color);
}

.rune-checkbox-label.checked {
    color: #f1c40f;
    border-color: #f1c40f;
    background: rgba(241, 196, 15, 0.1);
    font-weight: bold;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-view-anim {
    animation: fadeInUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.info-view-anim h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.info-view-anim h2 {
    color: var(--primary-color);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
    margin-top: 30px;
}

.info-view-anim p {
    font-size: 1.05rem;
    color: #ddd;
}

.info-view-anim h1.vip-text {
    background-image: linear-gradient(
        90deg, 
        #ff9a9e, 
        #fecfef, 
        #fff6b3,
        #a8e6cf, 
        #dcedc1,
        #a6c0fe, 
        #c3a6fe, 
        #ff9a9e
    ) !important;
    
    background-size: 200% auto !important;
    
    -webkit-background-clip: text !important;
    background-clip: text !important;
    
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    
    animation: rainbow-move 3s linear infinite !important;
    
    display: inline-block !important;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.5));
}

@keyframes rainbow-move {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

.sub-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    min-height: 10px;
}

.sub-preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    border: 1px solid #555;
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sub-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.sub-preview-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.sub-preview-delete {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #e74c3c;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.featured-team-container {
    padding: 20px;
    animation: fadeInUp 0.5s;
}
.build-your-own-btn {
    display: block; width: 100%; padding: 15px; 
    background: linear-gradient(45deg, #3498db, #8e44ad);
    color: white; text-align: center; text-decoration: none;
    font-size: 1.2rem; font-weight: bold; border-radius: 10px;
    margin-bottom: 30px; box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}
.build-your-own-btn:active { transform: scale(0.98); }

.team-card {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; padding: 15px; margin-bottom: 20px;
}
.team-card h3 { color: #f1c40f; margin-bottom: 10px; border-bottom: 1px solid #444; padding-bottom: 5px; }
.team-desc { font-size: 0.95rem; color: #ddd; margin-bottom: 15px; line-height: 1.6; }
.team-mini-board { 
    max-width: 300px; margin: 0 auto;
}

.mini-board-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    grid-auto-flow: column; 
    direction: rtl;         
    gap: 4px;
    width: 100%;
    aspect-ratio: 1/1;
    background: rgba(255,255,255,0.05);
    padding: 5px;
    border-radius: 8px;
    border: 1px solid #444;
}

.mini-board-slot {
    direction: ltr; 
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px dashed #555;
    border-radius: 4px;
    position: relative; 
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}

/* .mini-board-slot img {
    width: 100%; height: 100%; object-fit: cover; display: block;
} */
.mini-board-slot > img:first-child {
    width: 100%; height: 100%; object-fit: cover; display: block;
}

.pet-overlay {
    position: absolute; top: 2px; left: 2px; 
    width: 30% !important; height: 30% !important;
    border-radius: 50%; border: 1px solid #e74c3c; z-index: 5; background: #000;
}

.rune-overlay {
    position: absolute; bottom: 2px; left: 2px; 
    width: 30% !important; height: 30% !important;
    border-radius: 2px; border: 1px solid #2ecc71; z-index: 5; background: #000;
}

.clone-ghost {
    opacity: 0.5; filter: sepia(0.8) hue-rotate(180deg) saturate(2);
    pointer-events: none; display: block; 
    width: 100% !important; height: 100% !important;
}

.mini-board-slot.role-hero { border: 3px solid #f1c40f !important; z-index: 2; }
.mini-board-slot.role-token { border: 3px solid #9b59b6 !important; z-index: 2; }

.mini-board-slot.link-summon-source { box-shadow: 0 0 8px 1px #00ffea !important; z-index: 1; }
.mini-board-slot.link-summon-target { border: 3px dashed #00ffea !important; box-shadow: 0 0 5px #00ffea !important;}

.mini-board-slot.link-element-source { box-shadow: 0 0 8px 1px #e74c3c !important; z-index: 1; }
.mini-board-slot.link-element-target { border: 3px dashed #e74c3c !important; box-shadow: 0 0 5px #e74c3c !important;}

.mini-board-slot.role-hero.link-summon-target {
    border: 3px dashed #f1c40f !important;
}

header {
    background: rgba(20, 20, 35, 0.85); /* Nền tối mờ */
    backdrop-filter: blur(10px); /* Hiệu ứng kính */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-height: 60px; /* Reserve space to prevent CLS */
}

.header-container {
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px; /* Ensure header buttons don't cause shift */
}

.system-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

#toggle-menu {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    margin-right: 5px;
    display: none;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #aaa;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-btn.active {
    background: linear-gradient(135deg, #00a8ff, #0097e6);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 10px rgba(0, 168, 255, 0.5);
}

.tools-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn, #toggle-lang {
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Hình tròn */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    font-size: 1.2rem;
    color: #fff;
}

.icon-btn:hover, #toggle-lang:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1); /* Phóng to nhẹ khi di chuột */
}

.icon-btn.active {
    background: #f1c40f;
    color: #000;
    box-shadow: 0 0 10px #f1c40f;
    border-color: transparent;
}

#toggle-lang img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes zoomOut {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0.8); opacity: 0; }
}

.glass-panel {
    animation: zoomIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.modal-closing .glass-panel {
    animation: zoomOut 0.25s ease-in forwards;
}

@media (max-width: 768px) {
    #toggle-menu {
        display: block;
    }
    
    .nav-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .header-container {
        padding: 0 10px;
    }
    
    .system-nav {
        gap: 5px;
    }
}

@media (max-width: 768px) {
    .build-card-body {
        padding: 15px;
        gap: 15px;
    }

    .build-section-box {
        padding: 12px;
    }

    .build-section-box:first-child .build-row {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        justify-items: center;
    }

    .build-item {
        width: 100%;
    }

    .build-item img {
        width: 50px;
        height: 50px;
    }

    .build-item span {
        font-size: 0.7rem;
        white-space: nowrap;
    }

    .rune-layout {
        padding: 10px;
        gap: 12px;
    }

    .rune-img-box {
        width: 65px;
        height: 65px;
    }

    .rune-name {
        font-size: 1rem;
        margin-bottom: 2px;
    }

    .rune-stat-line {
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .rune-stat-label {
        min-width: 60px;
    }

    .build-section-box:nth-child(3) .build-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

/* --- MODAL LỌC HIỆU ỨNG (3 TAB STYLE) --- */

/* 1. Container của các Nút Tab */
#effect-tabs-container {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
    overflow-x: auto; /* Cho phép cuộn ngang trên điện thoại nhỏ */
    white-space: nowrap;
    scrollbar-width: none; /* Ẩn thanh cuộn */
}
#effect-tabs-container::-webkit-scrollbar { display: none; }

/* 2. Style cho từng Nút Tab */
#effect-tabs-container button {
    background: transparent;
    border: none;
    color: #888;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 3px solid transparent; /* Viền dưới ẩn */
    transition: all 0.3s ease;
    border-radius: 5px 5px 0 0;
}

#effect-tabs-container button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
}

/* (JS sẽ thêm inline-style màu vàng, nhưng CSS này hỗ trợ thêm) */
#effect-tabs-container button.active-tab { 
    /* Nếu sau này bạn muốn dùng class thay vì inline style */
    color: #f1c40f !important;
    border-bottom-color: #f1c40f !important;
}

/* --- FIX LỖI HIỂN THỊ MODAL 3 TAB --- */

#filter-effects-grid {
    /* Quan trọng: Đổi từ grid sang block để div con bung full chiều rộng */
    display: block !important; 
    
    width: 100%;
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    
    /* Reset các thuộc tính grid cũ nếu có */
    grid-template-columns: none !important;
    gap: 0 !important;
}

/* Tùy chỉnh thêm cho cái Group Div (cái chứa checkbox) */
div[id^="effect-group-"] {
    /* JS đã set grid 2 cột rồi, nhưng thêm width 100% cho chắc */
    width: 100%;
    padding-bottom: 10px;
}

/* 4. Từng ô Checkbox (Giao diện thẻ) */
.effect-checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05); /* Nền tối mờ */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
    color: #ddd;
    user-select: none;
}

.effect-checkbox-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px); /* Nổi nhẹ lên */
}

/* Khi được chọn (Input Checked) - Hiệu ứng phát sáng */
.effect-checkbox-item:has(input:checked) {
    background: rgba(46, 204, 113, 0.15); /* Nền xanh lá nhạt */
    border-color: #2ecc71; /* Viền xanh lá */
    color: #fff;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.2);
}

/* Style cho cái ô vuông input */
.effect-checkbox-item input[type="checkbox"] {
    accent-color: #2ecc71; /* Màu xanh khi tích */
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* --- NÚT LỌC EFFECT & BADGE SỐ LƯỢNG --- */

#btn-special-filter {
    position: relative; /* Điểm tựa cho số lượng bay lơ lửng */
    overflow: visible !important; /* Cho phép số lòi ra ngoài viền nút */
}

/* Con số tròn đỏ (Badge) */
.filter-badge {
    position: absolute;
    top: -5px;    /* Thò lên trên */
    right: -5px;  /* Thò sang phải */
    
    width: 20px;
    height: 20px;
    background-color: #ff3b30; /* Màu đỏ nổi bật */
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 50%; /* Tròn xoe */
    border: 2px solid #1a1a2e; /* Viền trùng màu nền web để tách biệt */
    
    display: flex; /* Căn giữa số */
    align-items: center;
    justify-content: center;
    
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    z-index: 10;
    pointer-events: none; /* Bấm vào số vẫn ăn click của nút */
    
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}


.char-bg-layer {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    z-index: -2; 
    
    background-image: var(--bg-desktop); 
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
    
    /* Performance: Use GPU acceleration and cache layers */
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    contain: layout style paint;
}

@media (max-width: 768px) {
    .char-bg-layer {
        background-image: var(--bg-mobile) !important;
        background-position: center top; 
    }
}

.char-bg-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; 
    height: 100vh;
    height: 100dvh;
    z-index: -1;
    
    background: linear-gradient(
        to bottom,
        rgba(15, 15, 30, 1) 0%,
        rgba(15, 15, 30, 0.3) 40%, 
        rgba(15, 15, 30, 0.95) 100%
    );
    
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    
    /* Performance: Reduce repaint with will-change and containment */
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    contain: layout style paint;
}

body.has-custom-bg .char-bg-layer,
body.has-custom-bg .char-bg-overlay {
    opacity: 1;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 600px) {
    /* Trên điện thoại, modal full màn hình hoặc gần full */
    .glass-panel {
        width: 95% !important;
        height: 80vh !important; /* Cố định chiều cao để cuộn hoạt động */
    }
    
    div[id^="effect-group-"] { 
        grid-template-columns: 1fr !important; 
    }
    
    .effect-checkbox-item {
        padding: 10px; /* Nhỏ gọn hơn chút */
        font-size: 0.85rem;
    }
}

.messenger-overlay {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 35% !important;
    height: 35% !important;
    border-radius: 3px;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    /* object-fit: cover !important; */
    z-index: 5;
    background: #000;
}

.slot:hover .messenger-overlay,
.mini-board-slot:hover .messenger-overlay {
    transform: scale(1.2);
    transition: 0.2s;
}


.fab-child-btn.hidden {
    display: none !important;
}

#fab-youtube.active {
    background: #e74c3c;
    color: white;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

/* Header cho phần YouTube */
.playlist-header-yt {
    padding: 10px;
    background: #c0392b; /* Đỏ */
    color: #fff;
    font-weight: bold;
    border-radius: 4px 4px 0 0;
    font-size: 0.9rem;
}

/* Header cho phần Tham Khảo */
.playlist-header-ref {
    padding: 10px;
    background: #2980b9; /* Xanh dương */
    color: #fff;
    font-weight: bold;
    margin-top: 15px; /* Cách phần trên ra một chút */
    border-radius: 4px 4px 0 0;
    font-size: 0.9rem;
}



#youtube-mode {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); 
    
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    transition: all 0.3s ease;
    z-index: 2000;
    flex-direction: column; 
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

#youtube-header {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

#youtube-header h2 {
    color: #f1c40f;
    margin: 0;
    font-size: 1.5rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-video-player {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    align-items: flex-start;
    padding: 15px;
}

.video-wrapper {
    flex: 2;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#yt-player-iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.video-playlist {
    flex: 1;
    background: #1a1a2e;
    border-radius: 8px;
    border: 1px solid #333;
    max-height: 400px;
    overflow-y: auto;
    display: flex; flex-direction: column;
}

.video-playlist ul {
    list-style: none; padding: 0; margin: 0;
    background: #1a1a2e;
    border: 1px solid #333;
    border-top: none;
}
.video-playlist li {
    padding: 12px 10px;
    border-bottom: 1px solid #2a2a3e;
    cursor: pointer;
    font-size: 0.9rem;
    color: #bbb;
    transition: 0.2s;
    display: flex; gap: 8px;
}
.video-playlist li:hover { background: #2a2a3e; color: #fff; }

.video-playlist li.active {
    background: #e74c3c22;
    color: #e74c3c;
    border-left: 3px solid #e74c3c;
}

.video-left-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 2;
    min-width: 0;
}

@media (max-width: 768px) {
    .custom-video-player {
        flex-direction: column;
        padding: 10px;
    }

    .video-left-column {
        width: 100%;
        flex: none;
    }

    .video-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .video-playlist {
        width: 100%;
        max-height: 300px;
        margin-top: 15px;
    }
}

.video-description-box {
    margin-top: 15px;
    padding: 15px;
    background: #1a1a2e;
    border-radius: 8px;
    border: 1px solid #333;
}
#desc-title-desktop { margin: 0 0 10px 0; color: #f1c40f; }
#desc-content-desktop { white-space: pre-wrap; color: #ccc; font-size: 0.95rem; }

.mobile-desc-btn {
    display: none;
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

@media (max-width: 768px) {
    #desktop-video-desc { display: none; }
    
    .mobile-desc-btn { display: block; }
}

.nav-arrow {
    background: rgba(255,255,255,0.1);
    border: 1px solid #555;
    color: white;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
}
.nav-arrow:hover {
    background: #f1c40f;
    color: black;
    border-color: #f1c40f;
}
.group-card {
    border: 1px solid #9b59b6;
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.2);
}

.anim-slide-next {
    animation: slideInRight 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.anim-slide-prev {
    animation: slideInLeft 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.group-card {
    overflow: hidden; 
}

.ann-item {
    margin-bottom: 8px;
    border: 1px solid #333;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.ann-header {
    padding: 10px 15px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    user-select: none;
}

.ann-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.ann-arrow {
    color: #f1c40f;
    font-size: 0.8rem;
    width: 15px;
}

.ann-title {
    font-weight: bold;
    color: #eee;
    flex: 1;
}

.ann-date {
    color: #888;
    font-size: 0.85rem;
}

.ann-body {
    padding: 15px;
    border-top: 1px solid #333;
    background: rgba(0, 0, 0, 0.4);
    color: #ccc;
    line-height: 1.6;
}

.ann-body img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 10px 0;
    display: block;
    border: 1px solid #444;
    
    cursor: zoom-in;
    transition: all 0.3s ease-in-out;
    z-index: 1;
}

@media (min-width: 768px) {
    .ann-body img {
        width: auto;
        max-width: 50%;
        max-height: 400px;
    }
}

.image-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    
    overflow-y: auto; 
    
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    cursor: zoom-out;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease-out;
}

.lightbox-image {
    display: block;
    width: auto;
    height: auto; 
    max-width: 100%; 
    
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (min-width: 768px) {
    .lightbox-image {
        max-width: 80%;
    }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.ann-body p { margin-bottom: 10px; }
.ann-body ul { padding-left: 20px; margin-bottom: 10px; }

.ann-item.active {
    border-color: #555;
}
.ann-item.active .ann-header {
    background: rgba(241, 196, 15, 0.1);
}

.scroll-top-btn {
    position: fixed;
    bottom: 82px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(241, 196, 15, 0.2);
    border: 1px solid #f1c40f;
    border-radius: 50%;
    color: #f1c40f;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1090;
    pointer-events: auto;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.scroll-top-btn:hover {
    background: #f1c40f;
    color: #000;
    transform: translateY(-3px);
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

#fab-group {
    display: none;
    transition: opacity 0.3s;
}

/* On small screens, the expanded action dock occupies the same corner as the
   scroll-to-top button. Hide the latter only while the dock is open. */
@media (max-width: 768px) {
    /* This block intentionally lives after the legacy .scroll-top-btn rule above. */
    .scroll-top-btn {
        right: 10px;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px));
        width: 40px;
        height: 40px;
        z-index: 1090;
    }

    .floating-actions-wrapper.active ~ .scroll-top-btn {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none;
    }
}

#bg-video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    display: none;
}

#bg-video-player {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

#bg-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.btn-toggle-bg {
    position: fixed;
    bottom: 20px;
    right: 70px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #555;
    color: #fff;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    z-index: 1000;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.3s;
}

.btn-toggle-bg:hover {
    background: #f1c40f;
    color: #000;
    border-color: #f1c40f;
}

.btn-toggle-bg.active {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
    color: #2ecc71;
}

.inline-game-icon {
    height: 3em !important;
    width: auto !important;
    vertical-align: middle;
    margin: 0 2px;
    border: none !important;
    border-radius: 0 !important;
    display: inline-block !important;
    background: none !important;
    box-shadow: none !important;
    cursor: help;
}
.inline-game-icon:hover {
    transform: scale(1.2);
    transition: 0.2s;
}

#char-bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 0;
    transition: opacity 0.5s ease;
    
    /* GPU Acceleration & Performance Optimization */
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-gpu: translateZ(0);
    -webkit-transform: translate3d(-50%, -50%, 0);
    
    /* Disable animations during video playback for smoothness */
    image-rendering: auto;
    -webkit-appearance: none;
}

.hidden-bg-video {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: none;
}

/* --- THANH TIẾN HÓA LƠ LỬNG (ĐÃ FIX & MAKEUP) --- */
.evolution-nav-bar {
    position: fixed;
    bottom: 25px; /* Nâng cao lên xíu cho đỡ dính lề */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    display: flex;
    align-items: center;
    background: rgba(15, 12, 41, 0.95); /* Nền tối hơn để làm nổi avatar */
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    animation: slideUpEvo 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.evo-avatar-btn {
    flex-shrink: 0; /* CHỐNG BỊ XẸP/MÉO HÌNH CỰC KỲ QUAN TRỌNG */
    background: #000;
    border: 2px solid #333;
    padding: 2px;
    border-radius: 50%; 
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 48px;  /* Cho to ra xíu nhìn cho sướng mắt */
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    position: relative;
    
    /* TRẠNG THÁI CHƯA CHỌN: Làm xám 100% và tối đi 60% */
    filter: grayscale(100%) brightness(0.4); 
}

.evo-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Đảm bảo ảnh luôn full viền tròn */
    border-radius: 50%;
}

/* Hiệu ứng khi lướt chuột qua (Nhá hàng) */
.evo-avatar-btn:hover {
    transform: scale(1.1);
    filter: grayscale(0%) brightness(0.9); /* Trả lại màu */
    border-color: #888;
    z-index: 5;
}

/* TRẠNG THÁI ĐANG CHỌN (Sáng rực rỡ) */
.evo-avatar-btn.active {
    transform: scale(1.25);
    filter: grayscale(0%) brightness(1); /* Hủy chế độ mù màu */
    border-color: var(--glow-color);
    box-shadow: 0 0 15px var(--glow-color), inset 0 0 10px var(--glow-color);
    pointer-events: none; /* Khóa click vào chính nó */
    z-index: 10;
}

/* Dây xích nối (Căn giữa hoàn hảo) */
.evo-chain {
    display: flex;
    align-items: center; /* Ép xích nằm giữa theo chiều dọc */
    gap: -4px; 
    margin: 0 8px;
}

.evo-chain-link {
    width: 8px;
    height: 8px;
    border: 2px solid #666;
    border-radius: 50%;
    display: inline-block;
    margin-left: -4px;
    background: #222; /* Cho ruột xích màu tối để nhìn giống kim loại */
}

@keyframes slideUpEvo {
    from { bottom: -50px; opacity: 0; }
    to { bottom: 25px; opacity: 1; }
}

.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0f0c29;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.app-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #00a8ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loader-text {
    color: #00a8ff;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 2px;
    animation: pulseText 1.5s infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pulseText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#main-view {
    padding-bottom: 100px !important; 
}

.clickable-zh {
    cursor: pointer;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.3);
    padding-bottom: 2px;
    transition: all 0.3s ease;
    display: inline-block;
}

.clickable-zh:hover {
    color: #f1c40f;
    border-bottom-color: #f1c40f;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.build-row {
    display: flex;
    flex-wrap: wrap !important;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.build-item {
    flex: 1;
    min-width: 85px;
    max-width: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.build-item span {
    white-space: normal !important;
    word-break: break-word;
    font-size: 0.8rem; 
    line-height: 1.3;
    margin-top: 6px;
    width: 100%;
}

.build-item img {
    max-width: 50px;
    height: auto;
    object-fit: contain;
}

img {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

p, span, h1, h2, h3, h4, div, label, li {
    -webkit-touch-callout: default;
    -webkit-user-select: auto;
    user-select: auto;
}

.custom-img-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(10, 10, 20, 0.9);
    backdrop-filter: blur(8px);
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-img-modal.show {
    opacity: 1;
    visibility: visible;
}

.custom-img-modal img {
    max-width: 90%; 
    max-height: 65vh;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    margin-bottom: 25px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-img-modal.show img {
    transform: scale(1);
}

.custom-img-actions {
    display: flex; 
    gap: 15px; 
    flex-wrap: wrap; 
    justify-content: center;
}

.custom-img-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white; 
    border: none;
    padding: 10px 20px; 
    border-radius: 25px; 
    font-weight: bold;
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.2s;
}

.custom-img-btn.close {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.custom-img-btn:active { transform: scale(0.92); }

#custom-copy-bubble {
    position: absolute;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 9999999;
    display: none;
    transform: translate(-50%, -100%);
    margin-top: -10px; 
    transition: transform 0.1s;
}

#custom-copy-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #2980b9 transparent transparent transparent;
}

#custom-copy-bubble:active {
    transform: translate(-50%, -100%) scale(0.92);
}

.tier-list-banner { background: linear-gradient(135deg, #e67e22, #d35400); color: white; padding: 15px 25px; border-radius: 12px; margin-bottom: 25px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 5px 20px rgba(211, 84, 0, 0.4); transition: transform 0.2s; border: 1px solid rgba(255,255,255,0.2); }
.tier-list-banner:hover { transform: translateY(-3px); }
.tier-list-banner h3 { margin: 0; font-size: 1.3rem; display: flex; align-items: center; gap: 10px; }

.tier-list-container { padding: 20px; background: rgba(15, 12, 41, 0.6); border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); }
.tier-row { display: flex; margin-bottom: 12px; background: rgba(255,255,255,0.05); border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,0.05); }
.tier-label { width: 90px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.5rem; color: #111; flex-shrink: 0; }
.tier-t0 { background: linear-gradient(135deg, #ff4757, #ff6b81); } 
.tier-t05 { background: linear-gradient(135deg, #ffa502, #ff7f50); } 
.tier-t1 { background: linear-gradient(135deg, #eccc68, #f1c40f); } 
.tier-t2 { background: linear-gradient(135deg, #7bed9f, #2ed573); } 
.tier-t3 { background: linear-gradient(135deg, #70a1ff, #1e90ff); } 
.tier-items { flex: 1; display: flex; flex-wrap: wrap; gap: 12px; padding: 12px; }
.tier-item { width: 65px; height: 65px; cursor: pointer; transition: transform 0.2s; }
.tier-item:hover { transform: scale(1.15) translateY(-3px); z-index: 10; }
.tier-item img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; background: rgba(0,0,0,0.3); border: 2px solid #555; }
.tier-item.vip img { border-color: #f1c40f; box-shadow: 0 0 10px rgba(241, 196, 15, 0.5); }

@media (max-width: 768px) {
    .tier-item { 
        width: 42px;
        height: 42px; 
    }
    .tier-items { 
        gap: 6px;
        padding: 8px; 
    }
    .tier-label { 
        width: 50px;
        font-size: 1.1rem; 
    }
    .tier-list-container {
        padding: 10px;
    }
}
/* ==========================================================
   INLINE NOTES / GHI CHÚ TRÊN TRANG CHÍNH
   ========================================================== */
.aoqi-note-term {
    color: var(--aoqi-note-color, #f1c40f);
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--aoqi-note-color, #f1c40f);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    cursor: pointer;
    border-radius: 4px;
    padding: 0 2px;
    transition: background .16s ease, box-shadow .16s ease, filter .16s ease;
}

.aoqi-note-term:hover,
.aoqi-note-term:focus-visible,
.aoqi-note-term.note-open {
    background: rgba(255,255,255,.06);
    background: color-mix(in srgb, var(--aoqi-note-color, #f1c40f) 15%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--aoqi-note-color, #f1c40f) 48%, transparent);
    outline: none;
}

.aoqi-note-popover {
    position: fixed;
    z-index: 12000;
    width: min(380px, calc(100vw - 20px));
    max-height: min(460px, calc(100vh - 30px));
    overflow: auto;
    padding: 14px 38px 14px 15px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(11, 14, 27, .96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 16px 48px rgba(0,0,0,.48), 0 0 0 1px rgba(0,0,0,.22);
    color: #e9edf2;
    line-height: 1.55;
    animation: aoqiNotePopIn .14s ease-out;
}

.aoqi-note-popover::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    left: 50%;
    background: rgba(11, 14, 27, .96);
    border-left: 1px solid rgba(255,255,255,.16);
    border-top: 1px solid rgba(255,255,255,.16);
    transform: translateX(-50%) rotate(45deg);
}

.aoqi-note-popover[data-placement="below"]::before {
    top: -6px;
}

.aoqi-note-popover[data-placement="above"]::before {
    bottom: -6px;
    transform: translateX(-50%) rotate(225deg);
}

.aoqi-note-popover-close {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: #dfe6e9;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.aoqi-note-popover-content > :first-child { margin-top: 0; }
.aoqi-note-popover-content > :last-child { margin-bottom: 0; }
.aoqi-note-popover-content p { margin: 0 0 9px; }
.aoqi-note-popover-content ul,
.aoqi-note-popover-content ol { margin: 6px 0 10px; padding-left: 22px; }
.aoqi-note-popover-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px auto 2px;
    border-radius: 9px;
    cursor: zoom-in;
    box-shadow: 0 5px 18px rgba(0,0,0,.32);
}

@keyframes aoqiNotePopIn {
    from { opacity: 0; transform: translateY(4px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
    .aoqi-note-popover.mobile-note-popover {
        width: auto;
        max-height: min(52dvh, 430px);
        border-radius: 14px;
        padding: 13px 36px 13px 14px;
    }

    .aoqi-note-popover.mobile-note-popover::before {
        display: none;
    }

    .aoqi-note-term {
        text-underline-offset: 2px;
    }
}

/* ==========================================================
   NOTE V2: thẻ Tinh Linh liên quan trong bong bóng ghi chú
   ========================================================== */
.aoqi-note-character-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 11px;
    padding: 8px 9px;
    border-radius: 11px;
    border: 1px solid rgba(0,168,255,.25);
    background: linear-gradient(135deg, rgba(0,168,255,.11), rgba(155,89,182,.08));
    color: #eef4f8;
    cursor: pointer;
    text-align: left;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.aoqi-note-character-card:hover,
.aoqi-note-character-card:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(0,168,255,.58);
    background: linear-gradient(135deg, rgba(0,168,255,.17), rgba(155,89,182,.12));
    outline: none;
}

.aoqi-note-character-card img,
.aoqi-note-character-fallback {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.05);
}

.aoqi-note-character-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f1c40f;
    font-size: 1.25rem;
}

.aoqi-note-character-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.aoqi-note-character-meta small {
    color: #8fa4b7;
    font-size: .72rem;
    line-height: 1.25;
}

.aoqi-note-character-meta strong {
    color: #f5f8fb;
    font-size: .92rem;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}

.aoqi-note-character-arrow {
    flex: 0 0 auto;
    color: #55c7ff;
    font-size: 1.55rem;
    line-height: 1;
}

.aoqi-note-character-card + .aoqi-note-popover-content {
    padding-top: 9px;
    border-top: 1px solid rgba(255,255,255,.08);
}

@media (max-width: 640px) {
    .aoqi-note-character-card {
        padding: 7px 8px;
        margin-bottom: 9px;
    }

    .aoqi-note-character-card img,
    .aoqi-note-character-fallback {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }
}

/* ==========================================================
   NOTE V3: nhiều Tinh Linh liên quan
   ========================================================== */
.aoqi-note-popover.has-related-characters {
    width: min(540px, calc(100vw - 20px));
}

.aoqi-note-related-characters {
    margin: 0 0 11px;
}

.aoqi-note-related-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 8px;
    color: #b9dff3;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.aoqi-note-related-title span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(0,168,255,.14);
    color: #6dd3ff;
    font-size: .7rem;
}

.aoqi-note-related-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.aoqi-note-related-grid .aoqi-note-character-card {
    min-width: 0;
    margin: 0;
    padding: 7px 8px;
}

.aoqi-note-related-grid .aoqi-note-character-card img,
.aoqi-note-related-grid .aoqi-note-character-fallback {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 9px;
}

.aoqi-note-related-grid .aoqi-note-character-meta strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: .82rem;
    line-height: 1.25;
}

.aoqi-note-related-characters + .aoqi-note-popover-content {
    padding-top: 9px;
    border-top: 1px solid rgba(255,255,255,.08);
}

@media (max-width: 640px) {
    .aoqi-note-popover.has-related-characters.mobile-note-popover {
        width: auto;
        max-height: min(64dvh, 560px);
    }

    .aoqi-note-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .aoqi-note-related-grid .aoqi-note-character-card {
        gap: 6px;
        padding: 6px;
    }

    .aoqi-note-related-grid .aoqi-note-character-card img,
    .aoqi-note-related-grid .aoqi-note-character-fallback {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }

    .aoqi-note-related-grid .aoqi-note-character-arrow {
        display: none;
    }

    .aoqi-note-related-grid .aoqi-note-character-meta strong {
        font-size: .76rem;
    }
}

/* ==========================================================
   NOTE V3.1: compact popup khi chỉ có 1 Tinh Linh liên quan
   ========================================================== */
.aoqi-note-popover.has-related-characters:has(
    .aoqi-note-related-grid > .aoqi-note-character-card:only-child
) {
    width: min(370px, calc(100vw - 20px));
}

.aoqi-note-related-grid:has(> .aoqi-note-character-card:only-child) {
    grid-template-columns: minmax(0, 1fr);
}

.aoqi-note-related-grid > .aoqi-note-character-card:only-child {
    padding: 8px 10px;
}

.aoqi-note-related-grid > .aoqi-note-character-card:only-child img,
.aoqi-note-related-grid > .aoqi-note-character-card:only-child .aoqi-note-character-fallback {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
}

.aoqi-note-related-grid > .aoqi-note-character-card:only-child .aoqi-note-character-meta strong {
    font-size: .88rem;
    -webkit-line-clamp: 2;
}

/* Nếu note chỉ có card liên quan mà không có nội dung chữ, bỏ khoảng trống thừa dưới card. */
.aoqi-note-popover.has-related-characters:not(:has(.aoqi-note-popover-content)) .aoqi-note-related-characters {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .aoqi-note-popover.has-related-characters.mobile-note-popover:has(
        .aoqi-note-related-grid > .aoqi-note-character-card:only-child
    ) {
        left: auto !important;
        right: 10px !important;
        width: min(330px, calc(100vw - 20px));
    }

    .aoqi-note-related-grid > .aoqi-note-character-card:only-child {
        gap: 8px;
        padding: 7px 8px;
    }

    .aoqi-note-related-grid > .aoqi-note-character-card:only-child .aoqi-note-character-arrow {
        display: inline-block;
    }
}

/* ==========================================================
   MOBILE: NÚT CUỘN NGUYÊN KHỞI LUÔN HIỆN 1 CHẠM
   Tách nút #fab-origin-jump ra khỏi menu ☰ về mặt hiển thị,
   đặt cố định ngay dưới header ở góc trên bên phải.
   ========================================================== */
@media (max-width: 768px) {
    /* Giữ container các FAB "tồn tại" để nút Nguyên Khởi có thể thoát ra fixed,
       còn các nút khác vẫn ẩn khi menu ☰ chưa mở. */
    .floating-actions-wrapper .fab-items {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        pointer-events: none !important;
    }

    .floating-actions-wrapper .fab-items > .fab-child-btn:not(#fab-origin-jump) {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(8px) scale(.96);
        transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    }

    .floating-actions-wrapper.active .fab-items > .fab-child-btn:not(#fab-origin-jump) {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }

    /* Nút Nguyên Khởi: luôn 1 chạm, nằm ngay dưới header và sát mép phải. */
    #fab-origin-jump {
        position: fixed !important;
        top: calc(env(safe-area-inset-top, 0px) + 82px) !important;
        right: 10px !important;
        bottom: auto !important;
        left: auto !important;
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        flex: 0 0 48px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 50% !important;
        z-index: 1180 !important;
        opacity: .92 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        touch-action: manipulation;
        transform: none !important;
        background: rgba(25, 16, 43, .88) !important;
        border-color: rgba(180, 140, 255, .92) !important;
        box-shadow: 0 5px 18px rgba(0, 0, 0, .36), 0 0 12px rgba(180, 140, 255, .16) !important;
        -webkit-backdrop-filter: blur(9px);
        backdrop-filter: blur(9px);
    }

    #fab-origin-jump:active {
        transform: scale(.92) !important;
    }

    /* Trên mobile chỉ cần ký hiệu ◇↓ để nút gọn và không che nội dung. */
    #fab-origin-jump .fab-label {
        display: none !important;
    }

    /* Khi menu ☰ mở, nút Nguyên Khởi vẫn ở vị trí riêng phía trên,
       không bị kéo trở lại cụm GIF/Build. */
    .floating-actions-wrapper.active #fab-origin-jump {
        position: fixed !important;
        top: calc(env(safe-area-inset-top, 0px) + 82px) !important;
        right: 10px !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
    }
}

/* =========================================================
   TEAM UI SYNC — đồng bộ khu Đội Hình Đề Cử với /team
   Chỉ áp dụng cho danh sách đội hình ở trang chính.
   ========================================================= */
.featured-team-container {
    --team-accent: #ffd23f;
    --team-cyan: #55d9ff;
    --team-panel: rgba(14, 25, 39, .92);
    width: min(100%, 1480px);
    margin: 0 auto;
    padding: clamp(12px, 2.2vw, 30px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr));
    align-items: stretch;
    gap: 18px;
    animation: fadeInUp .35s ease both;
}

.featured-team-container > .build-your-own-btn,
.featured-team-container > h2 {
    grid-column: 1 / -1;
}

.featured-team-container > h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 2px !important;
    padding: 0 0 12px;
    color: var(--team-accent) !important;
    font-size: clamp(1.25rem, 2.2vw, 1.8rem);
    font-weight: 850;
    letter-spacing: .01em;
    border-bottom: 1px solid rgba(255, 210, 63, .26);
    text-shadow: 0 0 18px rgba(255, 210, 63, .12);
}

.featured-team-container > .build-your-own-btn {
    width: 100%;
    margin: 0;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid rgba(101, 218, 255, .48);
    border-radius: 14px;
    background: linear-gradient(110deg, rgba(19, 115, 157, .96), rgba(91, 69, 169, .96));
    box-shadow: 0 10px 28px rgba(0, 0, 0, .24), inset 0 1px rgba(255,255,255,.12);
    color: #f2fbff;
    font-size: clamp(.95rem, 1.5vw, 1.12rem);
    font-weight: 800;
    letter-spacing: .01em;
    transition: transform .18s ease, border-color .18s ease, filter .18s ease;
}

.featured-team-container > .build-your-own-btn:hover,
.featured-team-container > .build-your-own-btn:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(101, 218, 255, .9);
    filter: brightness(1.08);
    outline: none;
}

.featured-team-container > p {
    grid-column: 1 / -1;
    margin: 0;
    padding: 24px 16px;
    text-align: center;
    border: 1px dashed rgba(141, 174, 203, .25);
    border-radius: 14px;
    color: #a8b9ca !important;
    background: rgba(5, 13, 24, .5);
}

.featured-team-container .team-card {
    min-width: 0;
    margin: 0;
    padding: clamp(12px, 1.6vw, 20px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid rgba(112, 158, 193, .24);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(29, 45, 62, .96), rgba(12, 22, 35, .98));
    box-shadow: 0 12px 30px rgba(0, 0, 0, .2), inset 0 1px rgba(255,255,255,.035);
    overflow: hidden;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.featured-team-container .team-card:hover {
    transform: translateY(-2px);
    border-color: rgba(85, 217, 255, .42);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .27), 0 0 20px rgba(48, 164, 214, .06);
}

.featured-team-container .team-card h3 {
    margin: 0;
    padding: 0 0 10px;
    color: var(--team-accent);
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.35;
    overflow-wrap: anywhere;
    border-bottom: 1px solid rgba(255, 210, 63, .22);
}

.featured-team-container .team-desc {
    margin: 0;
    color: #d5e0eb;
    font-size: .92rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.featured-team-container .team-desc > :first-child { margin-top: 0; }
.featured-team-container .team-desc > :last-child { margin-bottom: 0; }
.featured-team-container .team-desc a { color: var(--team-cyan); }
.featured-team-container .team-desc img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.featured-team-container .team-mini-board {
    width: min(100%, 390px);
    max-width: 390px;
    margin: 4px auto 8px;
    flex: 0 0 auto;
}

.featured-team-container .mini-board-grid {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: clamp(4px, .8vw, 7px);
    padding: clamp(5px, 1vw, 9px);
    border: 1px solid rgba(136, 174, 207, .24);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(3, 12, 23, .34));
    box-shadow: inset 0 1px rgba(255,255,255,.045), 0 10px 24px rgba(0,0,0,.16);
}

.featured-team-container .mini-board-slot {
    position: relative;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px dashed rgba(133, 164, 190, .34);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(8, 17, 28, .7), rgba(29, 43, 57, .75));
    box-shadow: inset 0 1px 4px rgba(0,0,0,.24);
}

.featured-team-container .mini-board-slot > img:first-child {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-team-container .mini-board-slot.role-hero {
    border: 2px solid #ffd23f !important;
    box-shadow: 0 0 12px rgba(255, 210, 63, .24), inset 0 0 8px rgba(255, 210, 63, .08) !important;
}
.featured-team-container .mini-board-slot.role-token {
    border: 2px solid #b48cff !important;
    box-shadow: 0 0 12px rgba(180, 140, 255, .22), inset 0 0 8px rgba(180, 140, 255, .08) !important;
}
.featured-team-container .mini-board-slot.link-summon-source,
.featured-team-container .mini-board-slot.link-summon-target {
    border-color: #55e8ed !important;
    box-shadow: 0 0 10px rgba(85, 232, 237, .2) !important;
}
.featured-team-container .mini-board-slot.link-summon-target,
.featured-team-container .mini-board-slot.link-element-target {
    border-style: dashed !important;
}
.featured-team-container .mini-board-slot.link-element-source,
.featured-team-container .mini-board-slot.link-element-target {
    border-color: #ff866f !important;
    box-shadow: 0 0 10px rgba(255, 134, 111, .18) !important;
}

.featured-team-container .pet-overlay,
.featured-team-container .rune-overlay,
.featured-team-container .messenger-overlay {
    pointer-events: none;
    object-fit: cover;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.7));
}
.featured-team-container .pet-overlay { border-color: #5edbff; }
.featured-team-container .rune-overlay { border-color: #b99bff; }


.featured-team-container .copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    max-width: 100%;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid rgba(85, 217, 255, .36);
    border-radius: 10px;
    background: rgba(20, 127, 169, .13);
    color: #80e5ff !important;
    text-decoration: none;
    font-weight: 800;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.featured-team-container .copy-btn:hover,
.featured-team-container .copy-btn:focus-visible {
    background: rgba(20, 127, 169, .24);
    border-color: rgba(85, 217, 255, .72);
    transform: translateY(-1px);
    outline: none;
}

.featured-team-container .group-header {
    gap: 12px;
    border-bottom-color: rgba(180, 140, 255, .3) !important;
    padding-bottom: 12px !important;
    margin-bottom: 12px !important;
}
.featured-team-container .group-header h3 {
    color: #d3baff !important;
    border: 0;
    padding: 0;
}
.featured-team-container .group-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.featured-team-container .group-nav span { color: #d0d9e5 !important; font-variant-numeric: tabular-nums; }
.featured-team-container .nav-arrow {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(180, 140, 255, .42);
    border-radius: 9px;
    background: rgba(115, 78, 174, .16);
    color: #e1d0ff;
    cursor: pointer;
}
.featured-team-container .nav-arrow:hover { background: rgba(115, 78, 174, .32); }

@media (min-width: 1250px) {
    .featured-team-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .featured-team-container { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px; }
    .featured-team-container .team-card { border-radius: 14px; padding: 12px; }
    .featured-team-container .team-mini-board { width: min(100%, 360px); }
    .featured-team-container > .build-your-own-btn { padding: 13px 12px; border-radius: 12px; }
    .featured-team-container .group-header { align-items: flex-start !important; }
    .featured-team-container .group-nav { gap: 5px; }
    .featured-team-container .nav-arrow { width: 31px; height: 31px; }
}

.sync-team-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
}

.sync-cp-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid rgba(241, 196, 15, 0.3);
}
.sync-cp-label {
    font-size: 0.76rem;
    color: #ccc;
    font-weight: 700;
    margin-bottom: 4px;
}
.sync-cp-track {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 38px;
}
.sync-cp-item {
    display: inline-flex;
    align-items: center;
}
.sync-cp-item img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #f1c40f;
    object-fit: cover;
    display: block;
}
.sync-cp-arrow {
    margin: 0 5px;
    color: #f1c40f;
    font-weight: bold;
    font-size: 0.85rem;
}

.sync-stats-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
}
.sync-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.74rem;
    color: #ddd;
    font-weight: 700;
}
.sync-stat-pill img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
}

.sync-board-grid {
    position: relative;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-flow: column !important;
    direction: rtl !important;
    gap: 12px !important;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    padding: 12px 12px 12px 16px !important; 
    overflow: visible !important;   
    border-radius: 14px !important;
    background: linear-gradient(145deg, rgba(255,255,255,0.075), rgba(255,255,255,0.025)) !important;
    border: 1px solid rgba(136, 174, 207, 0.24) !important;
    box-shadow: 0 16px 40px rgba(0,0,0,0.22), inset 0 1px rgba(255,255,255,0.04) !important;
}

.sync-board-cell {
    position: relative;
    width: 100%;
    height: 100%;
    direction: ltr !important;
    overflow: visible !important;
}

.sync-board-cell .mini-board-slot {
    direction: ltr !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px dashed #555 !important;
    border-radius: 9px !important;
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.sync-board-cell .mini-board-slot > img:first-child {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 0 !important;
}

.sync-board-cell .mini-board-slot.role-hero {
    border: 2px solid #f1c40f !important;
    box-shadow: 0 0 10px #f1c40f, inset 0 0 10px #f1c40f !important;
}
.sync-board-cell .mini-board-slot.role-token {
    border: 2px solid #9b59b6 !important;
    box-shadow: 0 0 10px #9b59b6, inset 0 0 10px #9b59b6 !important;
}
.sync-board-cell .mini-board-slot.link-summon-source {
    border: 2px solid #00ffea !important;
    box-shadow: 0 0 10px #00ffea !important;
}
.sync-board-cell .mini-board-slot.link-summon-target {
    border: 2px dashed #00ffea !important;
    box-shadow: 0 0 5px #00ffea !important;
}
.sync-board-cell .mini-board-slot.link-element-source {
    border: 2px solid #e74c3c !important;
    box-shadow: 0 0 10px #e74c3c !important;
}
.sync-board-cell .mini-board-slot.link-element-target {
    border: 2px dashed #e74c3c !important;
    box-shadow: 0 0 5px #e74c3c !important;
}

.sync-board-cell .pet-overlay {
    position: absolute !important;
    top: 0px !important;
    right: 0px !important;
    left: auto !important;
    width: 35% !important;
    height: 35% !important;
    border-radius: 4px !important;
    border: 1px solid #5edbff !important;
    box-shadow: 0 0 5px rgba(0,0,0,0.8) !important;
    z-index: 5 !important;
    background: #000 !important;
    object-fit: cover !important;
}

.sync-board-cell .rune-overlay {
    position: absolute !important;
    bottom: 0px !important;
    left: 0px !important;
    width: 35% !important;
    height: 35% !important;
    border-radius: 4px !important;
    border: 1px solid #b99bff !important;
    box-shadow: 0 0 5px rgba(0,0,0,0.8) !important;
    z-index: 5 !important;
    background: #000 !important;
    object-fit: cover !important;
}

.sync-board-cell .messenger-overlay {
    position: absolute !important;
    bottom: 2px !important;
    right: 2px !important;
    width: 35% !important;
    height: 35% !important;
    border-radius: 3px !important;
    border: 2px solid #00ffea !important;
    box-shadow: 0 0 5px rgba(0,0,0,0.8) !important;
    z-index: 5 !important;
    background: #000 !important;
    object-fit: cover !important;
}

.sync-origin-tray {
    position: absolute !important;
    top: 0px !important;
    left: -8px !important;
    width: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    z-index: 8 !important;
    pointer-events: none !important;
}

.sync-origin-btn {
    width: 20px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    border: 1px solid rgba(212, 188, 255, .88);
    background: linear-gradient(180deg, rgba(132,95,198,.95), rgba(81,57,131,.98));
    color: #fff;
    font-family: "Segoe UI", system-ui, sans-serif;
    font-size: 13.5px;
    line-height: 1;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,.72);
    box-shadow: 0 3px 7px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.14);
}
.sync-origin-btn.branch-ii {
    background: linear-gradient(180deg, rgba(52,152,219,.96), rgba(31,98,166,.98));
    border-color: rgba(140,220,255,.96);
}
.sync-origin-btn.branch-iii {
    background: linear-gradient(180deg, rgba(230,182,39,.98), rgba(148,100,18,.98));
    border-color: rgba(255,230,128,.99);
    color: #fff8da;
}
.sync-origin-btn.branch-x {
    background: linear-gradient(180deg, rgba(104, 108, 122, .98), rgba(52, 55, 66, .98));
    border-color: rgba(236, 238, 245, .96);
    color: #ffffff;
}

.sync-board-cell .clone-label {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(155, 89, 182, 0.9);
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 10;
}

.sync-board-text-layer {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    direction: ltr;
    overflow: hidden;
    border-radius: inherit;
}
.sync-board-textbox {
    position: absolute;
    display: flex;
    align-items: stretch;
    border-radius: 8px;
}
.sync-board-textbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 4px 6px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.18;
    text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.sync-board-textbox.bg-dark .sync-board-textbox-content {
    background: rgba(5,8,15,.68);
    border-radius: 7px;
}
.sync-board-textbox.bg-light .sync-board-textbox-content {
    background: rgba(255,255,255,.84);
    border-radius: 7px;
    text-shadow: none;
}

.sync-messenger-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
}
.sync-messenger-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid rgba(0, 238, 255, .22);
    border-radius: 10px;
    background: rgba(5, 15, 26, .55);
}
.sync-messenger-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    color: #c7dce9;
    font-weight: 700;
}
.sync-messenger-item img {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    border: 1px solid rgba(0, 238, 255, .45);
    object-fit: cover;
}
.featured-team-container .mini-board-slot {
    overflow: visible !important;
}

.featured-team-container .mini-board-slot > img:first-child {
    border-radius: 8px;
}

.featured-team-container .pet-overlay {
    top: 0px !important;
    right: 0px !important;
    left: auto !important;
    width: 35% !important;
    height: 35% !important;
    border-radius: 4px !important;
    border: 1px solid #5edbff !important;
    box-shadow: 0 0 5px rgba(0,0,0,0.8);
}

.featured-team-container .rune-overlay {
    bottom: 0px !important;
    left: 0px !important;
    width: 35% !important;
    height: 35% !important;
    border-radius: 4px !important;
    border: 1px solid #b99bff !important;
    box-shadow: 0 0 5px rgba(0,0,0,0.8);
}

.featured-team-container .origin-branch-tray.has-origin {
    position: absolute !important;
    top: 0px !important;
    left: -8px !important;
    width: 20px !important;
    display: flex !important;
    flex-direction: column;
    gap: 3px !important;
    z-index: 12;
    pointer-events: none;
}

.featured-team-container .origin-branch-btn {
    width: 20px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    border: 1px solid rgba(212, 188, 255, .88);
    background: linear-gradient(180deg, rgba(132,95,198,.95), rgba(81,57,131,.98));
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 3px 7px rgba(0,0,0,.30);
}
.featured-team-container .origin-branch-btn.branch-ii,
.featured-team-container .origin-branch-btn.branch-2 {
    background: linear-gradient(180deg, rgba(52,152,219,.96), rgba(31,98,166,.98));
    border-color: rgba(140,220,255,.96);
}
.featured-team-container .origin-branch-btn.branch-iii,
.featured-team-container .origin-branch-btn.branch-3 {
    background: linear-gradient(180deg, rgba(230,182,39,.98), rgba(148,100,18,.98));
    border-color: rgba(255,230,128,.99);
    color: #fff8da;
}
.featured-team-container .origin-branch-btn.branch-x {
    background: linear-gradient(180deg, rgba(104, 108, 122, .98), rgba(52, 55, 66, .98));
    border-color: rgba(236, 238, 245, .96);
}

.featured-team-container .cp-panel-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 390px;
    margin: 0 auto 6px;
    background: rgba(0,0,0,0.45);
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(241, 196, 15, 0.28);
}
.featured-team-container .cp-panel-mini-title {
    font-size: 0.75rem;
    color: #ccc;
    font-weight: 700;
    margin-bottom: 4px;
}
.featured-team-container .cp-panel-mini-track {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
}
.featured-team-container .cp-panel-mini-track img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #f1c40f;
    object-fit: cover;
}
.featured-team-container .cp-panel-mini-arrow {
    color: #f1c40f;
    font-weight: bold;
    font-size: 0.8rem;
    margin: 0 2px;
}