/* =====================================================================
   Tema halaman Free Fire v4: putih, membulat, sederhana.
   Palet: merah (utama), hitam (teks), kuning (aksen kecil), putih (dasar).
   Karakter: gambar dari toko (img/ff/), dianimasikan lewat CSS.
   ===================================================================== */
body.ff-tema {
  --ff-bg: #f6f6f7; --ff-putih: #fff; --ff-garis: #ececee; --ff-teks: #18181b; --ff-redup: #6b6b74;
  --ff-merah: #e3262b; --ff-merah-muda: #fdecec; --ff-hitam: #18181b; --ff-kuning: #ffc400; --ff-kuning-muda: #fff6d6; --ff-hijau: #1f9d55;
  --ff-bayang: 0 4px 18px rgba(24, 24, 27, .06);
  background: var(--ff-bg) !important; color: var(--ff-teks);
}

/* ---------- HERO ---------- */
.ff-hero { position: relative; overflow: hidden; isolation: isolate; margin-bottom: 14px; padding: 22px 20px 18px; color: #fff; border-radius: 28px;
  background: linear-gradient(150deg, #ec3237 0%, #d61f24 100%); box-shadow: 0 14px 32px rgba(227, 38, 43, .22); }
.ff-hero-latar { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ff-bulat { position: absolute; border-radius: 50%; }
.ff-bulat.b1 { right: -60px; bottom: -90px; width: 300px; height: 300px; background: rgba(255, 255, 255, .12); }
.ff-bulat.b2 { right: 40px; top: -70px; width: 170px; height: 170px; background: rgba(24, 24, 27, .14); }
.ff-bulat.b3 { left: -40px; bottom: -50px; width: 140px; height: 140px; background: rgba(255, 255, 255, .08); }

.ff-tokoh { position: absolute; z-index: 0; right: -30px; top: 16px; bottom: 0; pointer-events: none;
  transform: translate3d(calc(var(--px, 0) * -14px), calc(var(--py, 0) * -8px + var(--sy, 0) * .12px), 0); transition: transform .3s ease-out; }
/* tiga lapisan (kiri, kanan, tengah) disusun persis di posisi aslinya */
.ff-panggung { position: relative; height: 100%; aspect-ratio: 1674 / 1253; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .22));
  animation: ffNapas 6s ease-in-out 1.6s infinite; transform-origin: 50% 100%; }
.ff-l { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ff-l-tengah { z-index: 2; transform-origin: 50% 100%; animation: ffMasukTengah .85s cubic-bezier(.34, 1.45, .64, 1) .1s both, ffDada 5s ease-in-out 1.8s infinite; }
.ff-l-kiri { z-index: 1; animation: ffMasukKiri .8s cubic-bezier(.2, .9, .3, 1.1) .45s both; }
.ff-l-kanan { z-index: 1; animation: ffMasukKanan .8s cubic-bezier(.2, .9, .3, 1.1) .6s both; }
/* kilau cahaya yang menyapu hanya di badan karakter (dibentuk oleh siluet gambar) */
.ff-kilau { position: absolute; inset: 0; z-index: 3; pointer-events: none;
  -webkit-mask: url(../img/ff/tim-kecil.webp) center / 100% 100% no-repeat; mask: url(../img/ff/tim-kecil.webp) center / 100% 100% no-repeat;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .45) 50%, transparent 58%) no-repeat; background-size: 260% 100%;
  background-position: 140% 0; animation: ffKilau 6.5s ease-in-out 1.8s infinite; mix-blend-mode: soft-light; }
.ff-bulat { transform: translate3d(calc(var(--px, 0) * 12px), calc(var(--py, 0) * 8px - var(--sy, 0) * .08px), 0); transition: transform .4s ease-out; }

.ff-isi { position: relative; z-index: 1; max-width: 60%; }
.ff-atas { display: flex; align-items: center; gap: 10px; }
.ff-logo { width: 44px; height: 44px; flex: none; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--ff-putih); border-radius: 14px; box-shadow: 0 4px 12px rgba(0, 0, 0, .12); }
.ff-logo img { width: 100%; height: 100%; object-fit: cover; }
.ff-logo .material-symbols-outlined { color: var(--ff-merah); font-size: 24px; }
.ff-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--ff-hitam); background: var(--ff-kuning); padding: 5px 11px; border-radius: 999px; }
.ff-chip i { width: 6px; height: 6px; border-radius: 99px; background: var(--ff-merah); animation: ffKedip 1.6s ease-in-out infinite; }
.ff-judul { margin: 14px 0 0; font: 800 32px/1.02 'Sora', sans-serif; letter-spacing: -.02em; color: #fff; }
.ff-sub { margin: 8px 0 0; font-size: 12.5px; line-height: 1.55; color: rgba(255, 255, 255, .9); }
.ff-stat { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.ff-stat > div { background: rgba(255, 255, 255, .96); padding: 10px 6px; text-align: center; border-radius: 16px; }
.ff-stat b { display: block; font-size: 15px; font-weight: 800; color: var(--ff-hitam); line-height: 1; white-space: nowrap; }
.ff-stat span { display: block; margin-top: 5px; font-size: 10px; color: var(--ff-redup); }
.ff-stat > div:first-child b { color: var(--ff-merah); }
.ff-bara { position: absolute; z-index: 1; left: var(--x); bottom: -6px; width: 5px; height: 5px; border-radius: 50%; pointer-events: none; opacity: 0;
  background: #ffd84d; box-shadow: 0 0 6px 1px rgba(255, 196, 0, .8); animation: ffBara var(--t) linear var(--d) infinite; }
.ff-bara:nth-of-type(even) { width: 3px; height: 3px; background: #fff; box-shadow: 0 0 5px rgba(255, 255, 255, .8); }

/* ---------- INSTAGRAM ---------- */
.ff-ig { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 12px; margin-bottom: 14px; text-decoration: none; color: var(--ff-teks);
  background: var(--ff-putih); border-radius: 20px; box-shadow: var(--ff-bayang); transition: transform .15s; }
.ff-ig:hover { transform: translateY(-2px); }
.ff-ig-ikon { width: 42px; height: 42px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--ff-hitam); border-radius: 14px; }
.ff-ig-ikon svg { width: 20px; height: 20px; }
.ff-ig p { margin: 0; min-width: 0; }
.ff-ig b { font-size: 13px; }
.ff-ig small { display: block; font-size: 11px; color: var(--ff-redup); margin-top: 2px; }
.ff-ig-btn { margin-left: auto; flex: none; font-size: 12px; font-weight: 700; padding: 9px 16px; color: #fff; background: var(--ff-merah); border-radius: 999px; }

/* ---------- LAYANAN ---------- */
.ff-layanan { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 26px; }
.ff-lay { display: flex; flex-direction: column; gap: 8px; padding: 14px 12px; text-decoration: none; color: var(--ff-teks);
  background: var(--ff-putih); border-radius: 20px; box-shadow: var(--ff-bayang); transition: transform .15s, box-shadow .15s; }
.ff-lay:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(24, 24, 27, .08); }
.ff-lay-ikon { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.ff-lay:nth-child(1) .ff-lay-ikon { background: var(--ff-merah-muda); color: var(--ff-merah); }
.ff-lay:nth-child(2) .ff-lay-ikon { background: #f0f0f2; color: var(--ff-hitam); }
.ff-lay:nth-child(3) .ff-lay-ikon { background: var(--ff-kuning-muda); color: #b38600; }
.ff-lay-ikon .material-symbols-outlined { font-size: 20px; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
.ff-lay b { font-size: 13px; }
.ff-lay small { font-size: 10.5px; line-height: 1.45; color: var(--ff-redup); }
.ff-lay em { font-style: normal; margin-top: auto; font-size: 11px; font-weight: 700; color: var(--ff-merah); display: inline-flex; align-items: center; gap: 2px; }
.ff-lay em .material-symbols-outlined { font-size: 15px; }

/* ---------- KATALOG ---------- */
.ff-kepala { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ff-kepala-ikon { width: 38px; height: 38px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--ff-merah); color: #fff; }
.ff-kepala-ikon .material-symbols-outlined { font-size: 20px; }
.ff-kepala h2 { margin: 0; font-size: 16px; font-weight: 800; color: var(--ff-hitam); }
.ff-kepala p { margin: 1px 0 0; font-size: 11px; color: var(--ff-redup); }
.ff-kepala .ff-jml { margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--ff-hitam); background: var(--ff-kuning); padding: 5px 10px; border-radius: 999px; flex: none; }
body.ff-tema #produk-count { color: var(--ff-redup); }
body.ff-tema .sort-chip { background: var(--ff-putih); color: var(--ff-teks); box-shadow: var(--ff-bayang); border: 0; border-radius: 999px; }
body.ff-tema .sort-chip.aktif { background: var(--ff-hitam); color: #fff; }

.ff-kartu { position: relative; display: block; overflow: hidden; text-decoration: none; color: var(--ff-teks); background: var(--ff-putih); border-radius: 20px; box-shadow: var(--ff-bayang); transition: transform .2s, box-shadow .2s; }
.ff-kartu:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(24, 24, 27, .1); }
.ff-kartu:hover .ff-kartu-foto img { transform: scale(1.04); }
.ff-kartu-foto { position: relative; aspect-ratio: 4 / 5; background: #efeff1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ff-kartu-foto > .material-symbols-outlined { font-size: 30px; color: #c6c6cc; }
.ff-kartu-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.ff-tag { position: absolute; left: 8px; top: 8px; z-index: 2; font-size: 9.5px; font-weight: 700; color: #fff; padding: 3px 8px; background: rgba(24, 24, 27, .78); border-radius: 999px; backdrop-filter: blur(4px); }
.ff-tag-akhir { top: auto; bottom: 8px; background: var(--ff-merah); }
.ff-kartu-isi { padding: 10px 12px 12px; }
.ff-kartu-judul { margin: 0 0 7px; font-size: 12px; font-weight: 700; line-height: 1.35; min-height: 2.7em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ff-lencana { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.ff-lencana span { display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.ff-lencana .material-symbols-outlined { font-size: 11px; }
.ff-l-kirim { color: var(--ff-hijau); background: #e8f6ee; }
.ff-l-aman { color: #b38600; background: var(--ff-kuning-muda); }
.ff-harga { padding-top: 8px; border-top: 1px solid var(--ff-garis); }
.ff-harga b { display: block; font-size: 15px; font-weight: 800; color: var(--ff-merah); }
.ff-harga s { font-size: 10px; color: var(--ff-redup); }
.ff-harga s + i { font-style: normal; font-size: 9.5px; font-weight: 700; color: var(--ff-hitam); background: var(--ff-kuning); padding: 1px 6px; margin-left: 4px; border-radius: 999px; }
.ff-bawah { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10px; color: var(--ff-redup); }
.ff-bawah .material-symbols-outlined { font-size: 11px; color: var(--ff-kuning); font-variation-settings: 'FILL' 1; vertical-align: -1px; }
.ff-habis { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .5); }
.ff-habis span { font-size: 10px; font-weight: 700; letter-spacing: .1em; color: #fff; background: var(--ff-hitam); padding: 5px 12px; border-radius: 999px; }
.ff-kartu.terjual { opacity: .65; }
.ff-kartu.terjual img { filter: grayscale(1); }

.ff-kosong { text-align: center; padding: 34px 20px; background: var(--ff-putih); border-radius: 22px; box-shadow: var(--ff-bayang); }
.ff-kosong .material-symbols-outlined { font-size: 38px; color: var(--ff-merah); }
.ff-kosong b { display: block; margin-top: 8px; font-size: 13px; color: var(--ff-hitam); }
.ff-kosong p { margin: 4px 0 0; font-size: 11.5px; color: var(--ff-redup); }
.ff-kosong a { display: inline-flex; margin-top: 12px; font-size: 11.5px; font-weight: 700; color: var(--ff-merah); text-decoration: none; }

@keyframes ffKedip { 50% { opacity: .3; } }
@keyframes ffMasuk { from { opacity: 0; transform: translateY(26px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ffNapas { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-4px) scale(1.008); } }
@keyframes ffMasukTengah { 0% { opacity: 0; transform: translateY(46px) scale(.94); } 55% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes ffMasukKiri { 0% { opacity: 0; transform: translateX(-46px) rotate(-2deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes ffMasukKanan { 0% { opacity: 0; transform: translateX(46px) rotate(2deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
/* karakter tengah hanya membesar sedikit (tidak bergeser) supaya celah di belakangnya tidak pernah terbuka */
@keyframes ffDada { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.012); } }
@keyframes ffKilau { 0% { background-position: 140% 0; } 22%, 100% { background-position: -40% 0; } }
@keyframes ffBara { 0% { transform: translate(0, 0) scale(1); opacity: 0; } 10% { opacity: .95; } 70% { opacity: .7; }
  100% { transform: translate(var(--g), -260px) scale(.4); opacity: 0; } }

@media (min-width: 640px) {
  .ff-hero { min-height: 380px; padding: 32px 32px 28px; border-radius: 32px; }
  .ff-tokoh { right: -10px; top: 10px; }
  .ff-isi { max-width: 52%; }
  .ff-judul { font-size: 48px; }
  .ff-sub { font-size: 13.5px; }
  .ff-stat { max-width: 440px; }
  .ff-stat b { font-size: 18px; }
  .ff-bulat.b1 { width: 420px; height: 420px; right: -40px; bottom: -150px; }
  .ff-lay { padding: 18px 16px; }
  .ff-lay b { font-size: 14px; }
  .ff-lay small { font-size: 11px; }
}
@media (min-width: 1024px) {
  .ff-hero { min-height: 440px; padding: 48px 52px 40px; }
  .ff-tokoh { right: 16px; top: 8px; }
  .ff-isi { max-width: 46%; }
  .ff-judul { font-size: 64px; }
  .ff-bulat.b1 { width: 560px; height: 560px; right: 0; bottom: -220px; }
  .ff-bulat.b2 { right: 420px; top: -90px; width: 220px; height: 220px; }
}
@media (max-width: 380px) {
  .ff-judul { font-size: 28px; }
  .ff-tokoh { right: -46px; }
  .ff-lay small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ff-chip i, .ff-panggung, .ff-l, .ff-kilau { animation: none !important; }
  .ff-tokoh, .ff-bulat { transform: none !important; }
  .ff-bara, .ff-kilau { display: none; }
}

/* HP: tiga karakter tampil lebar di atas, teks di bawahnya */
@media (max-width: 639px) {
  .ff-hero { padding-top: 0; }
  .ff-tokoh { position: relative; right: auto; top: auto; bottom: auto; height: 236px; margin: 0 -20px -34px; overflow: hidden; }
  .ff-panggung { width: 100%; height: auto; filter: none; }
  /* bagian bawah karakter dipudarkan lewat mask (bukan ditimpa warna), jadi tidak ada garis/bocor di tepi bawah */
  .ff-tokoh { -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 94%); mask-image: linear-gradient(to bottom, #000 58%, transparent 94%); }
  .ff-isi { max-width: 100%; }
  .ff-atas { position: relative; z-index: 1; }
  .ff-judul { margin-top: 10px; }
  .ff-bulat.b1 { right: -90px; bottom: auto; top: -60px; width: 280px; height: 280px; }
  .ff-bulat.b2 { right: auto; left: -50px; top: 20px; width: 150px; height: 150px; }
}
@media (max-width: 380px) {
  .ff-tokoh { height: 212px; right: auto; }
}
