/* mobile-mode.css - Hanya aktif di layar sempit yang posisinya tegak/tinggi */
@media screen and (max-width: 767px) and (min-height:380px) {

    /* ==========================================
       1. GLOBAL LOCK & RESET (DYNAMIC CYBER AMBIENT)
       ========================================== */
    html, body, .master-frame {
        position: fixed !important; 
        inset: 0 !important;
        overflow: hidden !important;
        width: 100vw;
        height: 100dvh;
        
        background-color: var(--bg-dark) !important; 
        background-image: 
            /* TEXTURE SYNC: Titik matriks cyber dari root */
            radial-gradient(rgba(168, 85, 247, 0.15) 1px, transparent 1px), 
            /* AMBIENT LIGHT SYNC: Pancaran ungu meluas di latar belakang */
            radial-gradient(circle at 50% -10%, #1e113c 0%, #0f172a 50%, var(--bg-dark) 100%) !important;
        
        background-size: 6px 6px, 100% 100% !important;
        background-blend-mode: normal !important;
        transition: background 0.4s ease; 
    }

    /* DYNAMIC DIMMING: Jika Chatbox/Mailbox mekar, redupkan background biar popup depan fokus */
    body:has(#chat-popup.show),
    body:has(#mail-modal.show) {
        background-image: 
            radial-gradient(rgba(168, 85, 247, 0.10) 1px, transparent 1px), 
            radial-gradient(circle at 50% -10%, #0c071a 0%, #05030a 60%, var(--bg-dark) 100%) !important;
    }

    /* Pembersihan Elemen Desktop */
    .sidebar-brand, .pc-header-text, .pc-footer-text, .slogan-text, .logo-wrapper {
        display: none !important;
    }

    /* ==========================================
       2. MOBILE STACKER (KARTU UTAMA - PC GLOW SINKRON)
       ========================================== */
    .stacker-card {
        position: absolute !important;
        top: 47px;
        bottom: 57px;
        left: 50%;
        width: 92vw; 
        height: auto;
        
        border: 1px solid var(--border-line) !important; 
        transform: translateX(-50%);
        background: var(--bg-mobile-gradient) !important;
        
        backdrop-filter: blur(12px) saturate(160%); 
        -webkit-backdrop-filter: blur(12px) saturate(160%);
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
        
        border-radius: 20px; 
        padding: 25px;       
        display: flex;
        flex-direction: column;
        opacity: 0;
        visibility: hidden;
        z-index: 1;
        
        /* Proteksi agar kilatan cahaya tidak bocor keluar dari lengkungan sudut kartu */
        overflow: hidden; 
        transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    }

    /* LAYER KILATAN CAHAYA DI MOBILE (PINJAM RUMUS PC) */
    .stacker-card::before {
        content: '';
        position: absolute;
        top: -150%;
        left: -150%;
        width: 300%;
        height: 300%;
        background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.08), transparent);
        transform: rotate(45deg);
        pointer-events: none;
    }

    /* KONDISI KARTU AKTIF (Pindah ke Depan) */
    .stacker-card.is-active { 
        opacity: 1; 
        visibility: visible; 
        z-index: 500; 
        border-color: var(--border-line-hover) !important; 
        box-shadow: var(--shadow-neon-glow) !important; 
        
        /* Jalankan denyut border neon halus */
        animation: card-pulse 4s infinite ease-in-out;
    }

    /* AMUKAN KILATAN OTOMATIS: Dipicu ulang saat JS nembak class 'is-active' */
    .stacker-card.is-active::before {
        animation: mobile-shine 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }
    
    /* KEYFRAMES SAPUAN CAHAYA MOBILE */
    @keyframes mobile-shine {
        0% { left: -150%; top: -150%; }
        100% { left: 100%; top: 100%; }
    }

    /* ANIMASI DENYUT KARTU UTAMA */
    @keyframes card-pulse {
        0% { 
            border-color: var(--border-line); 
            box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 15px rgba(168, 85, 247, 0.2); 
        }
        50% { 
            border-color: var(--border-line-hover); 
            box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), var(--shadow-neon-glow); 
        }
        100% { 
            border-color: var(--border-line); 
            box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 15px rgba(168, 85, 247, 0.2); 
        }
    }

    /* Efek Feedback Tap Sentuhan Jari */
    .stacker-card:active {
        transform: translate(-50%, 0) scale(0.97) !important;
        background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(11, 11, 14, 0.95)) !important; 
        transition: 0.1s;
    }
    
    /* ==========================================
       🎯 ANTI-TEMBUS GULIRAN SAAT CHAT POPUP AKTIF
       ========================================== */
    has(#chat-popup.show) .stacker-card,
    body:has(#chat-popup.show) .stacker-card {
        pointer-events: none !important;
    }

    #chat-popup.show ~ .master-frame .stacker-card,
    #chat-popup.show ~ #app-container .stacker-card {
        pointer-events: none !important;
    }

    /* ==========================================
       3. KONTEN DALAM KARTU (CARD ELEMENTS)
       ========================================== */
    .card-header-logo {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 15px;
        border-bottom: 1px solid var(--border-divider); 
        padding-bottom: 12px;
        flex-shrink: 0;
    }

    .inner-card-logo { 
        width: 10dvh; 
        height: auto; 
    }

    .header-text-group {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .card-title {
        font-size: clamp(3.0dvh, 3.5dvh, 4dvh);
        line-height: 1.2;
        margin: 0;
        color: var(--color-primary); 
        font-weight: 800;
        text-transform: uppercase;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Body Konten Kartu */
    .card-content-wrapper {
        flex: 1; 
        overflow: hidden;
        margin-bottom: 10px;
        display: flex;
        flex-direction: column;
    }
    
    .card-text {
        font-size: 2.8dvh;
        line-height: 1.5;
        color: var(--text-main); 
        overflow: hidden; 
    }

    /* ==========================================
       NAVIGATOR STACKER (PANAH TRANSPARAN, ANIMASI GERAK)
       ========================================== */
    .stacker-nav-up,
    .stacker-nav-down {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        background: transparent;  /* ← background transparan */
        border: none;
        padding: 12px 20px;  /* ← area klik luas */
        cursor: pointer;
        z-index: 1000;
    }
    
    /* Ikon panah */
    .stacker-nav-up i,
    .stacker-nav-down i {
        font-size: 1.8rem;
        color: var(--color-primary);
        opacity: 0.5;
        transition: all 0.2s;
        display: block;
    }
    
    .stacker-nav-up {
        top: 15px;
        animation: moveUp 2s infinite ease-in-out;
    }
    
    .stacker-nav-down {
        bottom: 15px;
        animation: moveDown 2s infinite ease-in-out;
    }
    
    /* Efek hover pada IKON (bukan background) */
    .stacker-nav-up:hover i,
    .stacker-nav-down:hover i {
        opacity: 1;
        transform: scale(1.2);
        color: var(--color-primary);
        text-shadow: 0 0 8px var(--color-primary);
    }
    
    /* Efek klik pada IKON */
    .stacker-nav-up:active i,
    .stacker-nav-down:active i {
        transform: scale(0.9);
        color: white;
        text-shadow: none;
    }
    
    @keyframes moveUp {
        0%, 100% { transform: translateX(-50%) translateY(0); }
        50% { transform: translateX(-50%) translateY(-6px); }
    }
    
    @keyframes moveDown {
        0%, 100% { transform: translateX(-50%) translateY(0); }
        50% { transform: translateX(-50%) translateY(6px); }
    }
    
    /* ==========================================
        Indikator Footer Kartu (Baca Selengkapnya)
       ========================================== */
    .read-more-indicator {
        display: flex;
        justify-content: center;
        align-items: center;
        padding-top: 10px;
        margin-top: auto;
        border-top: 1px solid var(--border-divider); 
    }
    
    .read-more-text {
        font-size: 0.75rem;
        color: var(--color-primary);
        font-style: italic;
        opacity: 0.8;
    }

    /* ==========================================
       4. ELEMEN ANTARMUKA (UI OVERLAYS)
       ========================================== */
    /* 🎯 WIDGET KOTAK SURAT (TOP RIGHT) - MASTER CLEAN OUTLINE DETAILED */
    .mail-container {
        position: fixed;
        top: 22px;
        right: 22px;
        height: 50px;
        z-index: 1100;
        
        /* SINKRONISASI OUTLINE: Tebal 1px solid menggunakan garis pembatas identik dengan kartu */
        border: 1px solid var(--color-primary) ; 
        padding: 0 18px;
        border-radius: 30px;
        display: flex;
        align-items: center;
        gap: 10px;
        color: white;
        font-size: 0.8rem;
        font-weight: bold;
        
        background: var(--bg-mobile-gradient) !important; 
        backdrop-filter: blur(12px) saturate(160%);
        -webkit-backdrop-filter: blur(12px) saturate(160%);
        
        /* 🎯 FIX ANTI-BIAS: Kita suntik mati pendaran cahaya neonnya di sini. 
           Gua ganti dengan drop-shadow murni warna hitam pekat tipis untuk efek dimensi gantung saja! */
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    }

    /* Running Text (Top Left) */
    .running-text-wrapper {
        position: fixed;
        top: 29px;
        left: 22px;
        right: 185px; 
        overflow: hidden;
        white-space: nowrap;
        z-index: 1090;
        -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
        mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
        pointer-events: none;
    }

    .running-text-content {
        display: inline-block;
        font-size: 0.75rem;
        color: #fff;
        text-transform: uppercase;
        letter-spacing: 1px;
        font-weight: 500;
        animation: marquee 20s linear infinite;
        padding-left: 20px;
    }

    /* Sosmed Corner (Bottom Left) */
    .sosmed-corner {
        position: fixed;
        bottom: 30px;
        left: 130px;
        display: flex;
        gap: 15px;
        z-index: 1100;
    }

    .sosmed-link {
        color: rgba(255,255,255,0.6);
        font-size: 1.2rem;
        transition: 0.2s;
    }

    /* Tombol Bulat Widget Chat (Bottom Right) */
    .chat-container {
        position: fixed;
        bottom: 20px;
        right: 25px;
        z-index: 1100;
        width: 55px;
        height: 55px;
        background: var(--color-primary);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        box-shadow: 0 0 15px var(--color-primary-glow); 
    }

    .chat-container:active, .mail-container:active {
        transform: scale(0.9);
        filter: brightness(1.2);
        transition: 0.1s;
    }
    
    /* Label ID Player (Top Left Absolute) */
    #ign-label-container {
        position: fixed;
        top: 5px;
        left: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        font-size: 1.0rem;
        font-weight: bold;
        color: #fff;
        z-index: 9900;
        letter-spacing: 1.2px;
        text-shadow: 0 0 8px var(--color-primary-glow);
    }

    #ign-label-container:active {
        transform: scale(0.9);
        opacity: 0.7;
    }

    /* ==========================================
       5. MODAL DETAIL NEWS SYSTEM
       ========================================== */
    .detail-modal {
        position: fixed;
        inset: 0;
        background: var(--bg-overlay); 
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 10000;
        padding: 20px;
    }
    
    .modal-content {
        background: var(--bg-popup); 
        border: 1px solid var(--color-primary);
        width: 100%;
        max-width: 600px;
        border-radius: 20px; 
        padding: 30px;
        position: relative;
        box-shadow: 0 0 30px var(--color-primary-glow); 
    }
    
    .modal-header {
        display: flex;
        justify-content: space-between;
        align-items: top;
        margin-bottom: 20px;
    }
    
    #modalTitle {
        color: var(--color-primary);
        margin: 0;
        font-size: 1.5rem;
        font-weight: 800;
        letter-spacing: 0.5px;
    }
    
    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
        color: var(--text-main); 
        line-height: 1.7;
        font-size: 1rem;
        padding-right: 10px;
    }
    
    /* Modal Scrollbar Premium Minimalis */
    .modal-body::-webkit-scrollbar { width: 4px; }
    .modal-body::-webkit-scrollbar-track { background: transparent; }
    .modal-body::-webkit-scrollbar-thumb { 
        background: var(--color-primary-glow); 
        border-radius: 10px; 
    }

    /* ==========================================
       6. KEYFRAMES
       ========================================== */
    @keyframes marquee {
        0% { transform: translateX(0); }
        100% { transform: translateX(-50%); }
    }
    
   /* ==========================================
       6. SHARE
    ========================================== */ 
   .share-container {
       position: fixed;
       z-index: 1500;
       cursor: pointer;
       transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
       background: var(--color-primary);
       color: white;
       border-radius: 30px;
       display: flex;
       align-items: center;
       gap: 8px;
       padding: 8px 16px;
       font-weight: bold;
       font-size: 0.8rem;
       box-shadow: 0 4px 15px var(--color-primary-glow);
   }
   .share-container:hover {
       transform: scale(1.05);
       background: white;
       color: var(--color-primary);
   }
    .share-container {
        bottom: 27px;
        left: 20px;
        padding: 6px 12px;
        font-size: 0.7rem;
    }
}
