/* ============================================================
   LibraryModules perf.css
   Lapisan performa bersama untuk semua halaman.
   - Aturan di luar html.perf-lite aman dan selalu aktif
   - html.perf-lite dipasang oleh perf.js untuk HP yang lemah
     atau yang terbukti patah saat scroll (backdrop blur dimatikan)
   ============================================================ */

/* Tap langsung diproses tanpa menunggu deteksi double tap zoom
   Pan dan pinch tetap berjalan normal (manipulation tidak memutus scroll) */
a, button, summary, [role="button"] {
    touch-action: manipulation;
}

/* ---- MODE LITE ---- */
/* Backdrop blur di bar yang menempel (header dan navbar) harus dihitung
   ulang di GPU pada setiap frame scroll, ini penyebab utama patah di HP kelas bawah */
html.perf-lite *,
html.perf-lite *::before,
html.perf-lite *::after {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

/* Tanpa blur, latar bar yang tadinya 30 persen transparan akan membuat teks
   susah dibaca, jadi dibuat hampir solid dengan warna dasar yang sama */
html.perf-lite .md3-header,
html.perf-lite .top-bar,
html.perf-lite .rv-header,
html.perf-lite .mu-header,
html.perf-lite .chat-header,
html.perf-lite .selection-header {
    background-color: color-mix(in srgb, var(--md-surface, #1C1B1F) 94%, transparent) !important;
}

html.perf-lite .material-nav {
    background-color: color-mix(in srgb, #28262B 96%, transparent) !important;
}

html.perf-lite .rv-bottom-sticky,
html.perf-lite .chat-input-bar,
html.perf-lite .buy-bar {
    background-color: color-mix(in srgb, var(--md-surface, #1C1B1F) 96%, transparent) !important;
}
