/* ============================================================
   Sunnie Indonesia — Mobile Safe
   Memastikan tombol aman dipakai di HP: tidak terpotong / keluar layar,
   tidak tertutup bar browser, dan cukup besar untuk jari anak (>= 44px).
   Dimuat PALING AKHIR di setiap halaman (setelah CSS game & portal).
   Tidak mengubah file CSS asli.
   ============================================================ */

/* ---------- 1. Perilaku sentuh umum ---------- */
button,[role="button"],summary,select,
input[type="button"],input[type="submit"]{
  touch-action:manipulation;          /* tanpa jeda 300ms / zoom ketuk-dua-kali */
}
button,[role="button"]{
  -webkit-touch-callout:none;         /* tidak muncul menu saat ditekan lama */
  -webkit-user-select:none;user-select:none;
}

/* ---------- 2. Tinggi layar: pakai dvh agar tidak tertutup bar browser ---------- */
@supports (height:100dvh){
  .min-h-screen{min-height:100dvh}
  .h-screen{height:100dvh}
  .app{min-height:100dvh}
  .min-h-\[60vh\]{min-height:60dvh}
  .min-h-\[52vh\]{min-height:52dvh}
  .h-\[68vh\]{height:68dvh}
  .h-\[60vh\]{height:60dvh}
  .max-h-\[92vh\]{max-height:92dvh}
  .max-h-\[90vh\]{max-height:90dvh}
  .max-h-\[88vh\]{max-height:88dvh}
  .max-h-\[86vh\]{max-height:86dvh}
  .max-h-\[78vh\]{max-height:78dvh}
  .max-h-\[68vh\]{max-height:68dvh}
}

/* ---------- 3. Tombol desain "tactile" (dipakai hampir semua game) ---------- */
.tactile-btn{min-width:44px;min-height:44px}

/* ---------- 4. Header game di layar HP: tombol tidak boleh keluar layar ---------- */
@media (max-width:520px){

  /* 4a. Header game: semua tombol berlabel (Dengarkan lagi, Dengar, ...) jadi tombol ikon.
         Nama tetap ada untuk pembaca layar (teks disembunyikan secara visual saja). */
  header[class*="pointer-events-none"] button:has(> svg + span){
    position:relative;width:48px;min-width:48px;padding-inline:0;gap:0;justify-content:center;
  }
  header[class*="pointer-events-none"] button:has(> svg + span) > span{
    position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;
    overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;
  }
  /* header 2 bagian (Daftar Permainan | aksi): teks tautan boleh menyusut dengan elipsis */
  header[class*="pointer-events-none"] > :first-child{min-width:0;max-width:100%}
  header[class*="pointer-events-none"] > :first-child a{min-width:0;max-width:100%}
  header[class*="pointer-events-none"] a > span{
    min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  }
  /* header 3 bagian di dalam permainan (Kembali | status | aksi): tombol kembali jadi ikon */
  header[class*="pointer-events-none"]:has(> :nth-child(3)) > :first-child a:has(> svg + span){
    position:relative;width:48px;min-width:48px;padding-inline:0;gap:0;justify-content:center;
  }
  header[class*="pointer-events-none"]:has(> :nth-child(3)) > :first-child a:has(> svg + span) > span{
    position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;
    overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;
  }

  /* 4b. Cadangan: baris tombol yang tetap tidak muat turun ke baris kedua, bukan terpotong */
  header > div[class*="justify-between"],
  div[class*="justify-between"][class*="pointer-events-auto"]{
    flex-wrap:wrap;row-gap:.5rem;
  }
  header > div[class*="justify-between"] > :last-child,
  div[class*="justify-between"][class*="pointer-events-auto"] > :last-child{margin-left:auto}

  /* 4c. Runner: tab menu (Main / Masuk Kode / Buat Soal / Guru) ikon di atas teks */
  .grid.grid-cols-4.bg-amber-50 > button{
    flex-direction:column;gap:2px;min-height:52px;padding-inline:2px;line-height:1.15;text-align:center;
  }
}

@media (max-width:400px){
  /* 4b-2. HUD 3 bagian di layar <= 400px: status (Ronde, skor) turun ke baris kedua, tombol tetap di sudut */
  header[class*="pointer-events-none"]:has(> :nth-child(3)){flex-wrap:wrap;row-gap:.25rem}
  header[class*="pointer-events-none"]:has(> :nth-child(3))::after{content:"";order:2;flex:0 0 100%;height:0}
  header[class*="pointer-events-none"]:has(> :nth-child(3)) > :nth-child(2){
    order:3;margin-inline:auto;max-width:100%;
  }
}

/* ---------- 5. Portal (beranda, kategori, login) ---------- */
.topbar .back{min-height:44px;padding-inline:4px}
footer a{display:inline-flex;align-items:center;min-height:44px;padding:0 8px}
.age-pill a{min-height:44px;display:inline-flex;align-items:center}
.banner-cta::after{content:"";position:absolute;inset:-16px -10px}   /* perluas area ketuk tombol di banner */
.nav-link,.btn-primary,.btn-outline{min-height:44px}                  /* Bhinneka Brain */
.btn-primary,.btn-outline{align-items:center}
.nav-link{display:inline-flex;align-items:center}

@media (max-width:520px){
  .topbar .spacer{width:44px}
}
/* hover "menempel" di layar sentuh: matikan efek angkat/zoom */
@media (hover:none){
  .card:hover,.brand .card:hover .cta,.btn-accent:hover,.btn-primary:hover,.logo:hover{transform:none}
  .card:hover .thumb img{transform:none}
}
