:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --danger-color: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --hp-color: #10b981;
    --glass-blur: blur(12px);
    --online-color: #22c55e;
    --offline-color: #64748b;
    --accent-color: #f59e0b;
}

/* =========================================================================
   ANTI-AI DYNAMIC MOVING FORENSIC WATERMARK (GLOBAL SECURITY STANDARD)
   ========================================================================= */
.anti-ai-watermark-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    overflow: hidden;
    opacity: 0.65;
    will-change: transform;
    contain: strict;
}

.anti-ai-watermark-track {
    white-space: nowrap;
    font-family: 'JetBrains Mono', 'Orbitron', monospace;
    font-size: 0.82rem;
    font-weight: 900;
    color: #fbbf24;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
    animation: watermarkDriftLeft 11s linear infinite;
}

.anti-ai-watermark-track:nth-child(even) {
    color: #f43f5e;
    text-shadow: 0 0 8px rgba(244, 63, 94, 0.6);
    animation: watermarkDriftRight 13s linear infinite;
}

@keyframes watermarkDriftLeft {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

@keyframes watermarkDriftRight {
    0% { transform: translate3d(-50%, 0, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

.main-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 1rem;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Primary Area (Dominant) */
.primary-container {
    flex: 7; 
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Secondary Area (Widget Hub) */
.widget-hub {
    flex: 3; 
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.widget-box {
    margin-bottom: 0;
}
.widget-box h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.1rem;
    text-align: center;
    color: var(--accent-color);
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.3);
}

/* Rank Badge Styles */
.rank-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}
.rank-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}
#rank-info { flex-grow: 1; }
#rank-name { font-size: 1.1rem; font-weight: 600; }
#upgrade-rank-btn {
    background: var(--accent-color);
    border: none;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

/* Boss HUD */
.boss-hud {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    position: relative;
}
.boss-hud h2 {
    margin-bottom: 0.5rem;
    color: var(--danger-color);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    letter-spacing: 2px;
    font-size: 1.2rem;
}
.hp-bar-container {
    width: 100%;
    height: 25px; 
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.25rem;
    border: 2px solid var(--border-color);
}
.hp-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #059669, #10b981);
    transition: width 0.3s ease-out, background-color 0.3s;
}
.hp-bar.low {
    background: linear-gradient(90deg, #dc2626, #ef4444);
}
#boss-hp-text {
    font-size: 1rem;
    font-weight: bold;
}

/* CSS Monster Animation with Overlaid Feed */
.monster-container {
    margin: 1rem auto;
    width: 100%;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; /* For absolute positioning of feed */
}
.boss-monster {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #4c1d95 30%, #1e1b4b 100%);
    border-radius: 20px;
    box-shadow: 0 0 20px #8b5cf6, inset 0 0 20px #c4b5fd;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.1s;
    z-index: 1; /* Monster behind feed */
}
.monster-eye {
    width: 40px;
    height: 20px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 15px #fca5a5;
    display: flex;
    justify-content: center;
    align-items: center;
}
.monster-pupil {
    width: 10px;
    height: 10px;
    background: #450a0a;
    border-radius: 50%;
}

.idle {
    animation: monsterIdle 3s infinite ease-in-out;
}
.hit {
    animation: monsterHit 0.3s forwards;
}

@keyframes monsterIdle {
    0% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.05) translateY(-5px); box-shadow: 0 0 30px #8b5cf6, inset 0 0 20px #c4b5fd; }
    100% { transform: scale(1) translateY(0); }
}

@keyframes monsterHit {
    0% { transform: scale(1) translateX(0); filter: brightness(1); }
    25% { transform: scale(0.9) translateX(-10px); filter: brightness(2) hue-rotate(-50deg); }
    50% { transform: scale(0.95) translateX(10px); filter: brightness(2) hue-rotate(-50deg); background: #ef4444; }
    75% { transform: scale(0.9) translateX(-10px); filter: brightness(2) hue-rotate(-50deg); }
    100% { transform: scale(1) translateX(0); filter: brightness(1); }
}

/* Battle Feed Overlaid */
.battle-feed-container.overlaid-feed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent; /* Invisible background */
    border: none;
    z-index: 2; /* Feed in front */
    pointer-events: none; /* Let clicks pass through if needed */
    padding: 0.5rem;
    overflow: hidden;
}

.battle-feed {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    min-height: 100%;
}

.log-entry {
    font-size: 0.9rem;
    margin-top: 6px;
    animation: slideUpFade 0.3s ease-out forwards;
}
.log-damage { color: #fcd34d; font-weight: bold; }
@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Question Panel */
.question-panel {
    width: 100%;
    text-align: left;
    margin-bottom: 0;
}
.question-panel h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
    font-size: 1rem;
}
.question-text {
    font-size: 1.05rem !important; 
    margin-bottom: 0.75rem;
    line-height: 1.6 !important;
    font-weight: 500 !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    hyphens: none !important;
    white-space: normal !important;
}
.options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.option-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.6rem; 
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-align: left;
    user-select: none; /* Prevent text selection on double tap */
    -webkit-user-select: none;
}
.option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}
.option-btn.selected {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.primary-btn {
    background: var(--danger-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.primary-btn:hover:not(:disabled) {
    background: #dc2626;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
    transform: translateY(-2px);
}

.primary-btn:disabled {
    background: rgba(239, 68, 68, 0.3);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    box-shadow: none;
    border-color: transparent;
}

.hint-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1rem;
    padding: 0.5rem;
}
#cooldown-timer {
    font-size: 0.9rem;
    color: #fca5a5;
}

/* Alliance Presence */
.presence-list {
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
}
.presence-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.presence-dot {
    width: 10px; height: 10px; border-radius: 50%;
    margin-right: 10px; background-color: var(--offline-color);
}
.presence-dot.online {
    background-color: var(--online-color);
    box-shadow: 0 0 8px var(--online-color);
}
.presence-name { font-size: 0.9rem; }

/* Multi-Tab Leaderboard */
.tab-buttons {
    display: flex; margin-bottom: 0.5rem; border-radius: 6px; overflow: hidden;
    background: rgba(0,0,0,0.3);
}
.tab-btn {
    flex: 1; background: transparent; border: none; color: var(--text-muted);
    padding: 0.5rem; cursor: pointer; font-size: 0.85rem; font-weight: 600;
    transition: all 0.2s;
}
.tab-btn.active { background: var(--primary-color); color: white; }
.tab-content-wrapper { max-height: 250px; overflow-y: auto; }
.tab-content.hidden { display: none; }
.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.leaderboard-table th { text-align: left; color: var(--text-muted); padding: 0.5rem; border-bottom: 1px solid var(--border-color); }
.leaderboard-table td { padding: 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.leaderboard-table tr:nth-child(1) td { color: #fbbf24; font-weight: bold; }

/* Mobile Bottom Navigation (Hidden on Desktop) */
.mobile-nav {
    display: none;
}
.mobile-close-btn {
    display: none;
}

/* Modals & Warnings */
#security-warning {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(220, 38, 38, 0.95); z-index: 9999;
    display: flex; justify-content: center; align-items: center; text-align: center;
}
#security-warning.hidden { display: none; }
.warning-content {
    background: rgba(0, 0, 0, 0.8); padding: 2rem; border-radius: 12px;
    border: 2px solid #f87171; box-shadow: 0 0 30px rgba(220, 38, 38, 0.5);
    animation: pulse 2s infinite;
}
.warning-content h1 { color: #f87171; margin-bottom: 0.5rem; font-size: 1.5rem; }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}
.modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.8); z-index: 1000;
    display: flex; justify-content: center; align-items: center;
}
.modal.hidden { display: none; }
.modal-content {
    width: 90%; max-width: 500px; display: flex; flex-direction: column; gap: 1rem;
}
.modal-content input {
    width: 100%; padding: 0.75rem; border-radius: 8px; border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3); color: white;
}
.error-msg {
    color: var(--danger-color); font-size: 0.9rem; background: rgba(239, 68, 68, 0.1);
    padding: 0.5rem; border-radius: 4px; border: 1px solid rgba(239, 68, 68, 0.3);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 1rem; }
#cancel-upgrade {
    background: transparent; border: 1px solid var(--text-muted); color: var(--text-main);
    padding: 0.5rem 1.5rem; border-radius: 8px; cursor: pointer;
}
.hidden { display: none !important; }


/* Responsive Media Queries (Mobile Friendly No-Scroll 100vh) */
@media (max-width: 900px) {
    body {
        height: 100vh;
        overflow: hidden; /* Force 100vh on mobile */
        display: flex;
        flex-direction: column;
    }
    .main-layout {
        flex-direction: column;
        height: calc(100vh - 60px); /* Leave room for nav */
        padding: 0.5rem;
        margin: 0;
        gap: 0.5rem;
        overflow-y: auto; /* Tambahkan scroll vertikal */
        padding-bottom: 2rem; /* Jarak aman di bawah */
    }
    
    .primary-container {
        flex: none; /* Biarkan tumbuh sesuai konten */
        width: 100%;
    }
    
    .question-text {
        font-size: 0.85rem;
    }
    .option-btn {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    /* Widget Hub becomes an Overlay Drawer */
    .widget-hub {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: calc(100vh - 60px);
        background: var(--bg-color);
        z-index: 100;
        padding: 1rem;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.3s ease-in-out;
        display: flex;
        flex-direction: column;
    }
    .widget-hub.active {
        transform: translateY(0);
    }
    
    .mobile-close-btn {
        display: block;
        align-self: flex-end;
        font-size: 2rem;
        cursor: pointer;
        color: var(--text-muted);
        margin-bottom: 0.5rem;
    }
    
    /* Bottom Nav Bar */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100vw;
        height: 60px;
        background: rgba(30, 41, 59, 0.95);
        border-top: 1px solid var(--border-color);
        backdrop-filter: blur(10px);
        z-index: 200;
    }
    
    .nav-btn {
        flex: 1;
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 0.8rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        cursor: pointer;
    }
    .nav-btn.active {
        color: var(--primary-color);
    }
}

/* GM Broadcast Custom Styling */
.gm-broadcast-container {
    padding: 4px 8px !important; /* Meminimalisir ruang kosong di dalam kotak */
    margin-bottom: 10px !important; /* Jarak dengan elemen di bawahnya */
    display: flex;
    align-items: center;
    border-radius: 4px !important; /* Sudut kotak tidak terlalu bulat agar terlihat tegas */
    min-height: 40px; /* Menjaga agar kotak tidak terlalu tinggi */
}

/* === FIRST-PERSON IMMERSIVE UI === */
.fullscreen-monster {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(circle at center, #1e293b 0%, #000000 100%);
}

#floating-combat-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10;
}

.floating-combat-text {
    position: absolute;
    font-size: 2rem;
    font-weight: 800;
    color: #ef4444;
    text-shadow: 0 0 10px #000, 0 0 20px #ef4444;
    pointer-events: none;
    animation: floatUp 5.0s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: translate(-50%, -50%);
}
.floating-combat-text.critical {
    color: #fbbf24;
    font-size: 3rem;
    text-shadow: 0 0 10px #000, 0 0 20px #fbbf24, 0 0 40px #f59e0b;
}

@keyframes floatUp {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
    15% { opacity: 1; transform: translate(-50%, -80%) scale(1.2); }
    75% { opacity: 0.95; transform: translate(-50%, -140%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -200%) scale(0.8); }
}

.glass-panel-strong {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.1);
    border-radius: 12px;
    padding: 15px;
    color: #fff;
}

.top-center-hud {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 520px;
    z-index: 50;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
}

.bottom-swipe-dock {
    position: fixed !important;
    bottom: 0 !important;
    left: 0;
    width: 100vw;
    max-height: 48vh;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    padding-left: 12px;
    padding-right: 12px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: transparent !important;
    overflow-x: hidden !important;
    box-sizing: border-box;
}

/* Dock Tab Switcher Header (4 Tabs: Soal, Chat, Top Ally, Top Users) */
.dock-tab-nav {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 2px;
    padding: 0 2px;
    flex-shrink: 0;
}

.dock-tab-btn {
    flex: 1;
    max-width: 110px;
    padding: 7px 6px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: #94a3b8;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.dock-tab-btn:hover {
    background: rgba(6, 182, 212, 0.2);
    color: #e2e8f0;
    border-color: rgba(6, 182, 212, 0.4);
}

.dock-tab-btn.active {
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.4) 0%, rgba(6, 182, 212, 0.18) 100%);
    border-color: #06b6d4;
    color: #38bdf8;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dock-tab-btn.active#dock-tab-2 {
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.dock-tab-btn.active#dock-tab-3 {
    border-color: #fbbf24;
    color: #fbbf24;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

.swipe-indicator {
    display: none !important;
}

.swipe-wrapper {
    display: flex;
    width: 400%; /* 4 slides (Soal + Chat + Aliansi + Pioneers) */
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex: 1;
    min-height: 0;
}

/* Thin scrollbar for scrollable content */
.scrollable-content::-webkit-scrollbar,
#chat-messages::-webkit-scrollbar,
.dock-lb-list-container::-webkit-scrollbar {
    width: 4px;
}
.scrollable-content::-webkit-scrollbar-track,
#chat-messages::-webkit-scrollbar-track,
.dock-lb-list-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}
.scrollable-content::-webkit-scrollbar-thumb,
#chat-messages::-webkit-scrollbar-thumb,
.dock-lb-list-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.5);
    border-radius: 4px;
}

.swipe-slide {
    width: 25%; /* 100% / 4 */
    flex-shrink: 0;
    padding: 0 8px;
    box-sizing: border-box;
}

.dock-lb-table-head {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    font-size: 0.65rem;
    font-weight: 800;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.dock-lb-list-container {
    flex: 1;
    overflow-y: auto;
    max-height: 180px;
    padding-right: 4px;
}

.lb-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6rem;
    font-weight: 800;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-aura 1.5s infinite;
}

/* SOLID TEXT FOR TRANSPARENT BG */
.solid-text-container {
    background: rgba(0,0,0,0.4);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(56,189,248,0.2);
    margin-bottom: 10px;
}

.math-solid {
    color: #fff;
    font-weight: bold;
    font-size: 0.95rem;
    text-shadow: 0 2px 4px #000, 0 0 10px #38bdf8;
}

.option-btn-solid {
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid #38bdf8;
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    text-shadow: 0 1px 3px #000;
    transition: all 0.2s;
}
.option-btn-solid:hover { background: #38bdf8; color: #000; text-shadow: none; }
.option-btn-solid.selected { background: #fbbf24; border-color: #fbbf24; color: #000; text-shadow: none; }

.solid-hint {
    background: rgba(0,0,0,0.6);
    padding: 5px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.2);
}

.neon-attack-btn {
    background: #ef4444;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
    border: 2px solid #f87171;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 15px #ef4444, inset 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.1s, box-shadow 0.2s;
    width: 100%;
    margin-top: 10px;
}
.neon-attack-btn:hover:not(:disabled) { box-shadow: 0 0 25px #ef4444, inset 0 0 10px rgba(0,0,0,0.2); }
.neon-attack-btn:active:not(:disabled) { transform: scale(0.98); }
.neon-attack-btn:disabled { background: #475569; border-color: #334155; color: #94a3b8; box-shadow: none; cursor: not-allowed; }

.compact-attack-btn {
    padding: 7px 10px !important;
    font-size: 0.8rem !important;
}

/* TOP-LEFT EXIT BUTTON & HUD */
.top-left-hud {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 50;
}
.btn-exit-glow {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}
.btn-exit-glow:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}
.exit-icon {
    font-size: 0.85rem;
}

/* EXIT CONFIRMATION MODAL */
.raid-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInModal 0.2s ease;
}
.raid-modal.hidden {
    display: none;
}
@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.raid-modal-content {
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    max-width: 360px;
    width: 100%;
    color: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    text-align: center;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}
.modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #fbbf24;
    letter-spacing: 1px;
}
.raid-modal-content p {
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.5;
    margin-bottom: 18px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.btn-modal-cancel {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}
.btn-modal-confirm {
    flex: 1;
    background: #ef4444;
    border: 1px solid #dc2626;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-modal-confirm:hover {
    background: #dc2626;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
}

/* MINI LIVE FEED (100% Frameless Stream: Dari Bawah HUD Boss s.d Atas Tab Dock) */
.mini-live-feed {
    position: fixed !important;
    top: 72px !important;
    bottom: 46vh !important;
    left: 12px !important;
    width: auto !important;
    max-width: 170px !important;
    z-index: 45;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    pointer-events: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    overflow: hidden !important;
}

.battle-feed-container {
    width: 100%;
    height: 100%;
    max-height: 100%;
    overflow-y: hidden;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
    gap: 2px;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* FLOATING MULTI-TAB LEADERBOARD (Maks 1/5 Kanan Layar - Transparan) */
.boss-leaderboard-panel {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 19vw;
    max-width: 20vw;
    min-width: 175px;
    max-height: 58vh;
    z-index: 50;
    background: rgba(10, 15, 30, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 8px 10px;
    color: #fff;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.boss-leaderboard-panel.collapsed {
    max-height: 36px;
    overflow: hidden;
}

.boss-leaderboard-panel .lb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.boss-leaderboard-panel .lb-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 4px;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.lb-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s;
}
.lb-toggle-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

/* Multi-tab Buttons */
.lb-tab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.lb-tab-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    padding: 3px 4px;
    border-radius: 4px;
    font-size: 0.63rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
}

.lb-tab-btn.active {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    color: #38bdf8;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.lb-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lb-tab-content.hidden {
    display: none !important;
}

.lb-table-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.55rem;
    color: #94a3b8;
    font-weight: 700;
    padding: 2px 2px 4px 2px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    margin-bottom: 4px;
}

.lb-list-container {
    flex: 1;
    overflow-y: auto;
    max-height: calc(58vh - 90px);
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-right: 2px;
}

.lb-list-container::-webkit-scrollbar {
    width: 3px;
}
.lb-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
}

.lb-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.62rem;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.25);
    transition: background 0.15s;
    border-left: 2px solid transparent;
}
.lb-item-row:hover {
    background: rgba(255, 255, 255, 0.08);
}
.lb-item-row.rank-1 {
    background: rgba(251, 191, 36, 0.15);
    border-left-color: #fbbf24;
}
.lb-item-row.rank-2 {
    background: rgba(226, 232, 240, 0.12);
    border-left-color: #cbd5e1;
}
.lb-item-row.rank-3 {
    background: rgba(217, 119, 6, 0.15);
    border-left-color: #f59e0b;
}

.lb-item-left {
    display: flex;
    align-items: center;
    gap: 3px;
    overflow: hidden;
    max-width: 65%;
}
.lb-rank-badge {
    font-size: 0.58rem;
    font-weight: bold;
    min-width: 14px;
    color: #94a3b8;
}
.rank-1 .lb-rank-badge { color: #fbbf24; }
.rank-2 .lb-rank-badge { color: #e2e8f0; }
.rank-3 .lb-rank-badge { color: #f59e0b; }
.lb-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f1f5f9;
    font-size: 0.62rem;
}
.lb-item-dmg {
    font-weight: 700;
    color: #fbbf24;
    font-size: 0.62rem;
    white-space: nowrap;
    text-align: right;
}

#mobile-tactical-toggle { display: none; }

/* Mobile & Tablet Adjustments */
@media (max-width: 900px) {
    .mini-live-feed {
        display: flex !important;
        top: 65px !important;
        bottom: 46vh !important;
        left: 8px !important;
        max-width: 140px !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }
    .boss-leaderboard-panel {
        width: 175px;
        max-width: 45vw;
        top: 10px;
        right: 10px;
        max-height: 45vh;
    }
    .top-left-hud {
        top: 10px;
        left: 10px;
    }
    .btn-exit-glow {
        padding: 5px 8px;
        font-size: 0.65rem;
    }
    .top-center-hud {
        top: 10px;
        width: 88vw;
        max-width: 480px;
    }
}

/* Boss Raid Video Hit Effects */
@keyframes hitShake {
    0% { transform: translate(0, 0); filter: brightness(1); }
    20% { transform: translate(-10px, 5px); filter: brightness(1.3) hue-rotate(-10deg) drop-shadow(0 0 20px rgba(239, 68, 68, 0.8)); }
    40% { transform: translate(10px, -5px); filter: brightness(1.3) hue-rotate(-10deg); }
    60% { transform: translate(-5px, 10px); }
    80% { transform: translate(5px, -10px); }
    100% { transform: translate(0, 0); filter: brightness(1); }
}

.hit-shake {
    animation: hitShake 0.4s ease-in-out;
}

.laser-projectile {
    position: absolute;
    bottom: -100px;
    left: 50%;
    width: 6px;
    height: 120px;
    background: #00ffff;
    box-shadow: 0 0 15px #00ffff, 0 0 30px #00ffff;
    border-radius: 10px;
    transform: translateX(-50%);
    animation: shootLaser 0.3s forwards cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 15;
}

@keyframes shootLaser {
    0% { bottom: -100px; opacity: 1; }
    100% { bottom: 50%; opacity: 0; }
}

.explosion-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(0,255,255,0.8) 0%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    animation: explodeEffect 0.5s forwards ease-out;
    z-index: 15;
}

@keyframes explodeEffect {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(3); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(5); opacity: 0; }
}

/* Standby Screen / Scheduler Lock */
.standby-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-out;
}
.standby-content {
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 0 40px rgba(56, 189, 248, 0.1);
    padding: 3rem;
    border-radius: 16px;
    max-width: 90%;
}
.standby-title {
    color: #38bdf8;
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}
.standby-subtitle {
    color: #94a3b8;
    font-size: 1rem;
    margin-bottom: 2rem;
    letter-spacing: 1px;
}
.countdown-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 2rem;
}
.countdown-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(251, 191, 36, 0.5);
    border-radius: 8px;
    padding: 15px;
    min-width: 80px;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}
.countdown-box span {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}
.countdown-box small {
    color: #f8fafc;
    font-size: 0.75rem;
    letter-spacing: 2px;
    margin-top: 5px;
}
.countdown-separator {
    font-size: 2.5rem;
    color: #fbbf24;
    font-weight: bold;
    animation: blink 1s infinite;
}
.standby-footer {
    color: #64748b;
    font-size: 0.85rem;
    font-style: italic;
    animation: pulse-aura 2s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Smartphone Adjustments for Standby Screen */
@media (max-width: 600px) {
    .standby-content {
        padding: 1.5rem;
        width: 95%;
        border-radius: 12px;
    }
    .standby-title {
        font-size: 1.25rem;
        letter-spacing: 2px;
        margin-bottom: 0.5rem;
    }
    .standby-subtitle {
        font-size: 0.8rem;
        margin-bottom: 1.5rem;
        line-height: 1.4;
    }
    .countdown-container {
        gap: 5px;
        flex-wrap: wrap;
    }
    .countdown-box {
        padding: 10px;
        min-width: 60px;
    }
    .countdown-box span {
        font-size: 1.5rem;
    }
/* Floating Combat Text & VFX */
#floating-combat-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 60;
}

.floating-combat-text {
    position: absolute;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.8), 0 0 20px rgba(0, 0, 0, 0.9);
    animation: floatUpNormal 5.0s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: none;
    user-select: none;
}

.floating-combat-text.critical {
    font-size: 2rem;
    color: #fbbf24;
    text-shadow: 0 0 15px #f59e0b, 0 0 30px #d97706, 0 0 45px rgba(0,0,0,0.9);
}

.floating-combat-text.miss-floating-effect {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
    user-select: none;
    z-index: 70;
    animation: floatUpMiss 5.0s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.miss-hud-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(30, 8, 12, 0.94), rgba(15, 3, 6, 0.96));
    border: 1.5px solid rgba(239, 68, 68, 0.85);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.5), inset 0 0 15px rgba(220, 38, 38, 0.25);
    border-radius: 10px;
    padding: 8px 18px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    min-width: 220px;
    text-align: center;
}

.miss-hud-badge {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.5);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.miss-hud-title {
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 900;
    color: #ff3344;
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.9), 0 0 20px rgba(220, 38, 38, 0.6);
    line-height: 1.2;
}

.miss-hud-subtitle {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #cbd5e1;
    margin-top: 3px;
    opacity: 0.85;
}

@keyframes floatUpNormal {
    0% {
        opacity: 0;
        transform: translate(-50%, -20%) scale(0.7);
    }
    8% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.15);
    }
    16% {
        opacity: 1;
        transform: translate(-50%, -60%) scale(1);
    }
    75% {
        opacity: 0.95;
        transform: translate(-50%, -100%) scale(0.95);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -140%) scale(0.8);
    }
}

@keyframes floatUpMiss {
    0% {
        opacity: 0;
        transform: translate(-50%, -20%) scale(0.65);
    }
    8% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.08);
    }
    16% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    75% {
        opacity: 0.95;
        transform: translate(-50%, -65%) scale(0.98);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -95%) scale(0.8);
    }
}

/* ==========================================================================
   FLOATING MULTI-TAB LEADERBOARD (Top Damage - Personal & Aliansi)
   ========================================================================== */
.boss-leaderboard-panel {
    position: fixed;
    top: 65px;
    right: 12px;
    width: 20vw;
    max-width: 260px;
    min-width: 175px;
    max-height: 48vh;
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(6, 182, 212, 0.35);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 15px rgba(6, 182, 212, 0.2);
    z-index: 70 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
}

.boss-leaderboard-panel.collapsed {
    max-height: 42px;
    width: 160px;
}

.lb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(6, 182, 212, 0.15);
    border-bottom: 1px solid rgba(6, 182, 212, 0.25);
}

.lb-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lb-toggle-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.lb-toggle-btn:hover {
    background: rgba(6, 182, 212, 0.3);
    color: #fff;
    border-color: #06b6d4;
}

.lb-tab-nav {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lb-tab-btn {
    flex: 1;
    padding: 6px 4px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.lb-tab-btn.active {
    color: #38bdf8;
    background: rgba(6, 182, 212, 0.12);
    border-bottom-color: #06b6d4;
    font-weight: 700;
}

.lb-tab-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.lb-table-head {
    display: flex;
    justify-content: space-between;
    padding: 4px 10px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

.lb-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 4px 6px;
}

.lb-list-container::-webkit-scrollbar {
    width: 3px;
}
.lb-list-container::-webkit-scrollbar-thumb {
    background: rgba(6, 182, 212, 0.4);
    border-radius: 3px;
}

.lb-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
    margin-bottom: 3px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.68rem;
    transition: background 0.2s ease;
}

.lb-item-row:hover {
    background: rgba(6, 182, 212, 0.1);
}

.lb-item-left {
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: 65%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-rank-badge {
    font-size: 0.65rem;
    font-weight: 800;
    color: #94a3b8;
    min-width: 22px;
}

.lb-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f1f5f9;
}

.lb-item-right {
    font-family: 'Orbitron', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    color: #38bdf8;
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
}

/* Medal Highlights */
.lb-item-row.rank-1 {
    background: rgba(251, 191, 36, 0.12);
    border-left: 2px solid #fbbf24;
}
.lb-item-row.rank-1 .lb-rank-badge,
.lb-item-row.rank-1 .lb-item-right {
    color: #fbbf24;
}

.lb-item-row.rank-2 {
    background: rgba(226, 232, 240, 0.1);
    border-left: 2px solid #cbd5e1;
}
.lb-item-row.rank-2 .lb-rank-badge,
.lb-item-row.rank-2 .lb-item-right {
    color: #cbd5e1;
}

.lb-item-row.rank-3 {
    background: rgba(249, 115, 22, 0.1);
    border-left: 2px solid #f97316;
}
.lb-item-row.rank-3 .lb-rank-badge,
.lb-item-row.rank-3 .lb-item-right {
    color: #f97316;
}

/* Exit Button Styling */
.top-left-hud {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 70;
}

.btn-exit-glow {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
    transition: all 0.2s ease;
}

.btn-exit-glow:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    transform: scale(1.03);
}

.exit-icon {
    font-size: 0.9rem;
}

/* Exit Confirmation Modal */
.raid-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.raid-modal-box {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(6, 182, 212, 0.5);
    border-radius: 12px;
    padding: 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(6, 182, 212, 0.3);
    font-family: 'Inter', sans-serif;
}

.raid-modal-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    color: #38bdf8;
    margin-bottom: 12px;
    font-weight: 800;
}

.raid-modal-desc {
    color: #cbd5e1;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.raid-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-modal-cancel {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-modal-confirm {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.8);
    border: 1px solid #ef4444;
    color: #fff;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

@media (max-width: 600px) {
    .boss-leaderboard-panel {
        width: 32vw;
        min-width: 145px;
        top: 55px;
        right: 6px;
    }
}

/* ==========================================================================
   E-MATH ANTI-AI & ANTI-OCR: STROBOSCOPIC ALTERNATING DIGIT FLICKER ONLY
   ========================================================================== */
@keyframes aocrDigitStrobeAnim {
    0% { opacity: 0.0 !important; filter: blur(2px); }
    32% { opacity: 0.0 !important; filter: blur(2px); }
    35% { opacity: 1; filter: none; }
    97% { opacity: 1; filter: none; }
    100% { opacity: 0.0 !important; filter: blur(2px); }
}

.math-glyph-wave-active .aocr-digit-flicker,
.math-glyph-wave-active mjx-mn,
.math-glyph-wave-active mjx-mn mjx-c {
    display: inline-block !important;
    white-space: nowrap !important;
    animation: aocrDigitStrobeAnim var(--digit-speed, 1.4s) cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
    animation-delay: var(--digit-delay, 0s) !important;
    text-shadow: none !important;
}

.math-glyph-wave-active mjx-c,
.math-glyph-wave-active .aocr-char,
.math-glyph-wave-active .katex-html .mord,
.math-glyph-wave-active .katex-html .mbin,
.math-glyph-wave-active .katex-html .mrel,
.math-glyph-wave-active .katex-html .mop {
    display: inline-block !important;
    white-space: nowrap !important;
    animation: none !important;
    opacity: 1 !important;
    filter: none !important;
    text-shadow: none !important;
}

.aocr-word,
mjx-container,
mjx-math,
mjx-mn,
mjx-mi,
mjx-mo,
mjx-mrow,
mjx-msub,
mjx-msup,
mjx-msubsup {
    display: inline-block !important;
    white-space: nowrap !important;
}

/* ==========================================================================
   HIGH-CLARITY MATH & FRACTION TYPOGRAPHY (SUPER LEGIBLE NUMERATORS & DENOMINATORS)
   ========================================================================== */
.question-text mjx-container,
#question-text mjx-container {
    font-size: 118% !important;
    vertical-align: middle !important;
    margin: 0 2px !important;
}

/* MathJax Fractions: Perbesar angka/huruf pembilang & penyebut agar tidak kekecilan */
mjx-frac {
    font-size: 112% !important;
    padding: 0 4px !important;
    margin: 0 3px !important;
    vertical-align: -0.42em !important;
}

mjx-frac > mjx-num {
    font-size: 94% !important;
    padding-bottom: 2px !important;
    font-weight: 600 !important;
}

mjx-frac > mjx-den {
    font-size: 94% !important;
    padding-top: 2px !important;
    font-weight: 600 !important;
}

mjx-frac > mjx-line {
    border-top: 1.8px solid currentColor !important;
    margin: 1.5px 0 !important;
}

/* Superscripts (Pangkat) & Subscripts (Indeks Bawah) Lebih Jelas */
mjx-sup {
    font-size: 84% !important;
    font-weight: 600 !important;
    vertical-align: 0.42em !important;
}

mjx-sub {
    font-size: 84% !important;
    font-weight: 600 !important;
    vertical-align: -0.28em !important;
}

/* Bentuk Akar (Radicals) */
mjx-sqrt {
    font-size: 110% !important;
    font-weight: 550 !important;
}

/* Opsi Jawaban: Skala Matematika & Tombol Jelas */
.options-container mjx-container,
.option-btn-solid mjx-container,
.option-btn mjx-container {
    font-size: 112% !important;
    vertical-align: middle !important;
}

.option-btn-solid,
.option-btn {
    font-size: 0.98rem !important;
}

.math-glyph-wave-active.paused mjx-c,
.math-glyph-wave-active.paused .aocr-char,
.math-glyph-wave-active.paused .katex-html .mord {
    animation-play-state: paused !important;
}

/* ==========================================================================
   STRICT EXEMPTION: OPTIONS, BUTTONS, & HEADERS (NEVER ANIMATED)
   ========================================================================== */
.options-group mjx-c,
.options-group .aocr-char,
.options-container mjx-c,
.options-container .aocr-char,
.arena-options mjx-c,
.arena-options .aocr-char,
.arena-option mjx-c,
.arena-option .aocr-char,
.option-btn-solid mjx-c,
.option-btn-solid .aocr-char,
.option-btn mjx-c,
.option-btn .aocr-char,
.opt-pill mjx-c,
.opt-pill .aocr-char,
.pill-btn mjx-c,
.pill-btn .aocr-char,
.mcma-grid mjx-c,
.mcma-option mjx-c,
.scout-statement-grid mjx-c,
#farmOptions mjx-c,
#farmOptions .aocr-char,
#boss-options mjx-c,
#boss-options .aocr-char,
#wedOptions mjx-c,
#wedOptions .aocr-char,
#qOptions mjx-c,
#qOptions .aocr-char {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
}

/* ==========================================================================
   HARD DIFFICULTY MODE: CRIMSON DANGER THEME & BOX SHAKE (2X MULTIPLIER)
   ========================================================================== */
@keyframes hardBoxShake {
    0% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(-2px, 1.5px) rotate(-0.3deg); }
    40% { transform: translate(2px, -1.5px) rotate(0.3deg); }
    60% { transform: translate(-1.5px, -1px) rotate(-0.2deg); }
    80% { transform: translate(1.5px, 1.5px) rotate(0.2deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes pulseCrimson {
    0% { box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.9), inset 0 0 15px rgba(239, 68, 68, 0.3); }
    100% { box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }
}

.hard-mode-active #boss-question-container {
    border: 2px solid #ef4444 !important;
    background: rgba(45, 10, 18, 0.9) !important;
    animation: hardBoxShake 0.45s infinite ease-in-out, pulseCrimson 1.5s infinite ease-in-out !important;
}

.hard-mode-active .question-text {
    color: #fee2e2 !important;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5) !important;
}

.hard-mode-active .option-btn,
.hard-mode-active .option-btn-solid {
    border-color: rgba(239, 68, 68, 0.45) !important;
    background: rgba(45, 10, 18, 0.7) !important;
    animation: hardBoxShake 0.55s infinite ease-in-out !important;
}

.hard-mode-active .option-btn:hover,
.hard-mode-active .option-btn.selected,
.hard-mode-active .option-btn-solid:hover,
.hard-mode-active .option-btn-solid.selected {
    border-color: #ef4444 !important;
    background: rgba(220, 38, 38, 0.4) !important;
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.8), inset 0 0 10px rgba(239, 68, 68, 0.4) !important;
    color: #fff !important;
}

.hard-mode-active .neon-attack-btn {
    background: linear-gradient(135deg, #ef4444, #991b1b) !important;
    border-color: #f87171 !important;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.7) !important;
    animation: hardBoxShake 0.7s infinite ease-in-out !important;
}

/* ==========================================================================
   GAME-STYLE COMBAT PARTICLES: OTHER PLAYER IMPACT BURSTS AROUND MONSTER
   ========================================================================== */
@keyframes bossImpactBurst {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    8% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.18) translateY(-6px);
    }
    16% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) translateY(-12px);
    }
    75% {
        opacity: 0.95;
        transform: translate(-50%, -50%) scale(0.95) translateY(-26px);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.75) translateY(-48px);
    }
}

.other-player-impact-burst {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 15;
    animation: bossImpactBurst 5.0s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    font-family: 'Orbitron', 'Inter', sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

.other-player-impact-burst .player-tag {
    font-size: 0.62rem;
    font-weight: 700;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.75);
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    letter-spacing: 0.3px;
    white-space: nowrap;
    text-shadow: 0 1px 2px #000;
}

.other-player-impact-burst .impact-dmg {
    font-size: 1.05rem;
    font-weight: 900;
    color: #38bdf8;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.9), 0 0 16px rgba(14, 165, 233, 0.6);
    letter-spacing: 0.5px;
}

/* ==========================================================================
   BOSS ENRAGED / OVERDRIVE PHASE (HP <= 30%)
   ========================================================================== */
.boss-enrage-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 6;
    box-shadow: inset 0 0 50px rgba(239, 68, 68, 0.6), inset 0 0 120px rgba(220, 38, 38, 0.35);
    opacity: 0;
    transition: opacity 0.8s ease;
    animation: enrageVignettePulse 2s infinite ease-in-out;
}

@keyframes enrageVignettePulse {
    0% { opacity: 0.35; }
    50% { opacity: 0.8; }
    100% { opacity: 0.35; }
}

.boss-enraged #boss-hp-fill {
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 50%, #f59e0b 100%) !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    animation: enrageHpBarPulse 1s infinite alternate !important;
}

@keyframes enrageHpBarPulse {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.35); }
}

/* ==========================================================================
   PERSONAL ANSWER STREAK COUNTER (COMBO METER)
   ========================================================================== */
.personal-streak-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.5);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
    animation: streakPulse 1.2s infinite ease-in-out;
    align-self: center;
    user-select: none;
}

@keyframes streakPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.personal-streak-badge.mega-streak {
    color: #fef08a;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.3), rgba(249, 115, 22, 0.4));
    border-color: #eab308;
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.6), inset 0 0 6px rgba(234, 179, 8, 0.3);
    animation: megaStreakGlow 0.8s infinite alternate ease-in-out;
}

@keyframes megaStreakGlow {
    0% { transform: scale(1.02); filter: drop-shadow(0 0 3px #eab308); }
    100% { transform: scale(1.06); filter: drop-shadow(0 0 8px #f97316); }
}

.personal-streak-badge.ultra-streak,
.personal-streak-badge.master-streak {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4), rgba(245, 158, 11, 0.5));
    border-color: #ef4444;
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.8), inset 0 0 10px rgba(245, 158, 11, 0.5);
    animation: ultraFireGlow 0.65s infinite alternate ease-in-out;
}

@keyframes ultraFireGlow {
    0% { transform: scale(1.03); filter: drop-shadow(0 0 5px #f59e0b); }
    100% { transform: scale(1.10); filter: drop-shadow(0 0 14px #ef4444); }
}

/* ==========================================================================
   LIVE ALLIANCE SYNC BEACON BADGE
   ========================================================================== */
.ally-live-badge {
    background: #10b981;
    color: #020617;
    font-size: 0.6rem;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 10px;
    margin-left: 3px;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
    animation: beaconPulse 1.8s infinite;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

@keyframes beaconPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   SHORT-SCREEN MOBILE RESPONSIVE ADAPTATION (PREVENTS LINE CLIPPING)
   ========================================================================== */
@media (max-height: 760px) {
    #slide-question {
        padding: 4px 6px !important;
    }
    #boss-question-container {
        padding: 6px 10px !important;
        margin-bottom: 3px !important;
        min-height: 48px !important;
        overflow-y: auto !important;
    }
    #question-text, .question-text {
        font-size: 0.96rem !important;
        line-height: 1.42 !important;
    }
    .question-text mjx-container, #question-text mjx-container {
        font-size: 110% !important;
    }
    mjx-frac {
        font-size: 106% !important;
        padding: 0 2px !important;
    }
    .options-container {
        gap: 4px !important;
    }
    .option-btn, .option-btn-solid {
        padding: 0.45rem 0.5rem !important;
        font-size: 0.88rem !important;
        min-height: 38px !important;
    }
    .fixed-bottom-controls {
        gap: 2px !important;
    }
    .neon-attack-btn.compact-attack-btn {
        padding: 8px 12px !important;
        font-size: 0.86rem !important;
    }
    #shield-notification {
        font-size: 0.74rem !important;
        padding: 3px 6px !important;
        min-height: 20px !important;
    }
    .personal-streak-badge {
        font-size: 0.72rem !important;
        padding: 2px 6px !important;
    }
}

@media (max-height: 660px) {
    #boss-question-container {
        padding: 4px 6px !important;
        min-height: 42px !important;
    }
    #question-text, .question-text {
        font-size: 0.88rem !important;
        line-height: 1.35 !important;
    }
    .question-text mjx-container, #question-text mjx-container {
        font-size: 104% !important;
    }
    mjx-frac {
        font-size: 100% !important;
    }
    .option-btn, .option-btn-solid {
        padding: 0.35rem 0.45rem !important;
        font-size: 0.82rem !important;
        min-height: 34px !important;
    }
    .neon-attack-btn.compact-attack-btn {
        padding: 6px 10px !important;
        font-size: 0.80rem !important;
    }
}




