html, body { margin: 0; height: 100%; background: #000; overflow: hidden; font-family: "Segoe UI", system-ui, sans-serif; }

/* layar 9:16 di tengah jendela (buat LIVE Studio: sumber jendela/browser 1080x1920) */
#panggung { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  height: 100vh; aspect-ratio: 9 / 16; max-width: 100vw; overflow: hidden; container-type: size; background: #0b1220; }
@media (max-aspect-ratio: 9/16) { #panggung { width: 100vw; height: auto; } }
#kanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* label nama di atas kepala */
#label { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.jangkar { position: absolute; left: 0; top: 0; will-change: transform; }
.lbl { transform-origin: 50% 100%; white-space: nowrap; padding: .3cqh .9cqh; border-radius: 99px;
  font-size: 1.3cqh; color: #fff; background: rgba(8, 16, 28, .66); border: 1px solid rgba(255,255,255,.3);
  text-shadow: 0 1px 2px #000; }
.lbl.L { border-color: #8fd6ff; }
.lbl.P { border-color: #ffb3d9; }
.lbl i { font-style: normal; opacity: .85; margin-left: .45em; font-size: .85em; }
.lbl.baru { background: rgba(214, 172, 82, .92); color: #1b1205; text-shadow: none; font-weight: 700; }
.lbl.selesai { background: rgba(40, 110, 70, .85); }

/* atas */
#atas { position: absolute; top: 2.2cqh; left: 0; right: 0; text-align: center; color: #fff; text-shadow: 0 2px 10px #000; pointer-events: none; }
.judul { font-size: 3.1cqh; font-weight: 800; letter-spacing: .28em; padding-left: .28em; }
.sub { font-size: 1.2cqh; opacity: .85; margin-top: .2cqh; letter-spacing: .05em; }
#hitung { display: inline-flex; gap: .8cqh; margin-top: 1cqh; font-size: 1.4cqh; background: rgba(0,0,0,.45);
  padding: .45cqh 1.5cqh; border-radius: 99px; }
#hitung b { color: #f3d27d; }
#ajak { margin: 1cqh auto 0; width: fit-content; max-width: 86%; font-size: 1.55cqh; padding: .7cqh 1.6cqh;
  border-radius: 1cqh; background: rgba(214, 172, 82, .2); border: 1px solid rgba(243, 210, 125, .55);
  transition: background .3s; }
#ajak b { color: #f3d27d; font-size: 1.15em; }
#ajak.sapa { background: rgba(214, 172, 82, .9); color: #1b1205; text-shadow: none; }
#ajak.sapa b { color: #1b1205; }

/* kolom pop nama: kiri laki-laki, kanan perempuan */
.kolom { position: absolute; top: 33cqh; width: 46%; display: flex; flex-direction: column; gap: .7cqh; pointer-events: none; }
.kiri { left: 2%; align-items: flex-start; }
.kanan { right: 2%; align-items: flex-end; }
.judulKolom { font-size: 1.05cqh; letter-spacing: .15em; color: #fff; opacity: .7; text-shadow: 0 1px 4px #000; }
.pop { display: flex; align-items: center; gap: .8cqh; padding: .6cqh 1.3cqh .6cqh .7cqh; border-radius: 1.4cqh;
  color: #fff; font-size: 1.5cqh; max-width: 100%; box-shadow: 0 .4cqh 1.2cqh rgba(0,0,0,.35);
  animation: popMasuk .45s cubic-bezier(.2,1.3,.4,1) both, popKeluar .6s ease-in 5.6s forwards; }
.kanan .pop { flex-direction: row-reverse; padding: .6cqh .7cqh .6cqh 1.3cqh; text-align: right; }
.pop.L { background: linear-gradient(90deg, rgba(18, 92, 140, .92), rgba(18, 92, 140, .6)); }
.pop.P { background: linear-gradient(270deg, rgba(148, 48, 108, .92), rgba(148, 48, 108, .6)); }
.pop.emas { background: linear-gradient(90deg, #b8862e, #ecc96c); color: #1b1205; }
.pop .av { flex: none; width: 3cqh; height: 3cqh; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.22); font-weight: 800; font-size: 1.5cqh; }
.pop b { display: block; max-width: 17cqh; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop small { display: block; opacity: .88; font-size: .78em; }
@keyframes popMasuk { from { opacity: 0; transform: translateY(-1cqh) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes popKeluar { to { opacity: 0; transform: translateY(-.6cqh); } }

/* sorotan jamaah baru */
#sorot { position: absolute; left: 50%; bottom: 40cqh; transform: translateX(-50%); color: #1b1205; font-size: 1.8cqh;
  font-weight: 700; background: rgba(236, 201, 108, .94); padding: .8cqh 2cqh; border-radius: 99px; white-space: nowrap;
  opacity: 0; transition: opacity .4s; pointer-events: none; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
#sorot.on { opacity: 1; }

#status { position: absolute; left: 1.5cqh; bottom: 1cqh; font-size: 1cqh; color: rgba(255,255,255,.55); pointer-events: none; }

/* panel uji (di luar layar 9:16, nggak ikut ke live) */
#debug { position: fixed; left: 10px; top: 10px; z-index: 10; width: 220px; padding: 10px; border-radius: 10px;
  background: rgba(20, 24, 32, .92); color: #dfe6f0; font-size: 12px; }
#debug .tombol { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 8px; }
#debug button { font: inherit; padding: 6px 4px; border: 0; border-radius: 6px; background: #2f3a4c; color: #fff; cursor: pointer; }
#debug button:hover { background: #41506a; }
#info { margin-top: 8px; line-height: 1.5; opacity: .85; }
body.siaran #debug, #debug.sembunyi { display: none; }

/* terjemahan Inggris (subtitle) */
.en { display: block; font-size: .78em; opacity: .8; font-style: italic; font-weight: 400; letter-spacing: 0; }
.judul + .sub .en { margin-top: .1cqh; }
#hitung i { font-style: italic; opacity: .75; font-size: .85em; }

#sorot .en { color: #3a2a0c; }
.pop .en { font-size: .7em; opacity: .75; }

/* pengingat & keterangan sholat */
#sholat { display: none; margin: .8cqh auto 0; width: fit-content; max-width: 90%; padding: .7cqh 1.6cqh; border-radius: 1cqh;
  font-size: 1.5cqh; background: rgba(16, 86, 58, .88); border: 1px solid #9fe0b8; }
#sholat.on { display: block; }
#sholat.sholat { background: rgba(10, 60, 40, .92); font-size: 1.65cqh; }

/* keterangan suara yang lagi diputer */
#suara { display: none; margin: .6cqh auto 0; width: fit-content; max-width: 80%; padding: .35cqh 1.2cqh; border-radius: 99px;
  font-size: 1.15cqh; background: rgba(0,0,0,.45); }
#suara.on { display: block; }

/* jam Makkah & WIB */
#jam { margin-top: .8cqh; display: flex; flex-wrap: wrap; justify-content: center; gap: .8cqh; }
#jam .waktu { display: inline-flex; flex-direction: column; align-items: center; min-width: 11cqh; padding: .4cqh 1.2cqh;
  border-radius: 1cqh; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.18); font-size: 1.05cqh; letter-spacing: .12em; }
#jam .waktu b { font-size: 2.3cqh; letter-spacing: .04em; color: #fff; font-variant-numeric: tabular-nums; }
#jam .waktu .en { letter-spacing: 0; font-size: .85em; }
#jam .berikut { flex-basis: 100%; font-size: 1.05cqh; opacity: .9; }

/* bayangan lembut di belakang tulisan atas biar kebaca waktu siang (lantai putih) */
#atas { top: 0; padding: 2.2cqh 0 3cqh; background: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,.28) 65%, transparent); }

/* bendera negara (label, pop, daftar) */
.bendera { display: inline-grid; place-items: center; flex: none; vertical-align: -.15em; margin-right: .35em; }
.bendera img { height: 1em; width: 1.33em; object-fit: cover; border-radius: .15em; box-shadow: 0 0 0 1px rgba(255,255,255,.35); display: block; }
.bendera.kode { font-size: .7em; font-weight: 800; padding: 0 .35em; border-radius: .25em; background: rgba(255,255,255,.22); letter-spacing: .04em; }
.bendera.kosong { font-size: .9em; }
.lbl .bendera img { height: 1.05em; width: 1.4em; }
.pop .bendera { width: 3cqh; height: 3cqh; margin: 0; }
.pop .bendera img { height: 2.1cqh; width: 2.8cqh; }
#sorot .bendera img { height: 1.5cqh; width: 2cqh; }

/* kolom: judul -> top gift (dipin) -> daftar nama bergulir -> pop kejadian */
.kolom { width: 40%; }
.pin { display: none; flex-direction: column; gap: .45cqh; width: 100%; }
.pin.on { display: flex; }
.kanan .pin { align-items: flex-end; }
.juara { display: flex; align-items: center; gap: .3cqh; width: fit-content; max-width: 100%; padding: .45cqh 1.2cqh .45cqh .5cqh;
  border-radius: 99px; font-size: 1.45cqh; color: #1b1205; box-shadow: 0 .3cqh 1cqh rgba(0,0,0,.35);
  animation: popMasuk .5s cubic-bezier(.2,1.3,.4,1) both; }
.kanan .juara { flex-direction: row-reverse; padding: .45cqh .5cqh .45cqh 1.2cqh; }
.kanan .juara .bendera { margin: 0 0 0 .35em; }
.juara.j1 { background: linear-gradient(90deg, #c99a3c, #f2d68a); }
.juara.j2 { background: linear-gradient(90deg, #a9b0b8, #e4e8ec); }
.juara.j3 { background: linear-gradient(90deg, #a8714a, #e0b088); }
.juara .no { flex: none; width: 2.3cqh; height: 2.3cqh; border-radius: 50%; display: grid; place-items: center; margin: 0 .3cqh;
  background: rgba(255,255,255,.55); font-weight: 800; font-size: 1.25cqh; }
.juara b { max-width: 15cqh; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gulir { width: 100%; height: 19cqh; overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 85%, transparent); mask-image: linear-gradient(transparent, #000 12%, #000 85%, transparent); }
.gulir .isi { will-change: transform; }
.putaran { display: flex; flex-direction: column; gap: .45cqh; padding: .6cqh 0; }
.kanan .putaran { align-items: flex-end; }
.baris { display: flex; align-items: center; gap: .2cqh; max-width: 100%; padding: .3cqh 1cqh; border-radius: 99px; font-size: 1.3cqh;
  color: #fff; text-shadow: 0 1px 2px #000; width: fit-content; }
.kiri .baris { background: rgba(18, 92, 140, .55); }
.kanan .baris { background: rgba(148, 48, 108, .55); flex-direction: row-reverse; }
.kanan .baris .bendera { margin: 0 0 0 .35em; }
.baris b { font-weight: 600; max-width: 14cqh; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.baris small { opacity: .75; font-size: .8em; margin: 0 .2em 0 .5em; font-variant-numeric: tabular-nums; }
.kanan .baris small { margin: 0 .5em 0 .2em; }
.popArea { display: flex; flex-direction: column; gap: .6cqh; width: 100%; }
.kiri .popArea { align-items: flex-start; }
.kanan .popArea { align-items: flex-end; }
#label { z-index: 0; }   /* label nama selalu di bawah daftar & pin */
#suara .kredit { display: block; font-size: .75em; opacity: .7; letter-spacing: .02em; }   /* kredit pembaca (lisensi CC BY-SA) */

/* selebrasi selesai 7 putaran: kartu besar biar penonton screenshot + ajakan tulis doa */
#selesai { position: absolute; left: 50%; bottom: 9cqh; transform: translateX(-50%) translateY(2cqh); width: 82%; box-sizing: border-box;
  padding: 2cqh 2.4cqh 1.6cqh; border-radius: 2.2cqh; text-align: center; color: #fff; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, rgba(20, 16, 6, .82), rgba(20, 16, 6, .9)); border: 1px solid rgba(243, 210, 125, .75);
  box-shadow: 0 1cqh 4cqh rgba(0,0,0,.5), 0 0 3cqh rgba(236, 201, 108, .25); transition: opacity .5s, transform .5s; overflow: hidden; }
#selesai.on { opacity: 1; transform: translateX(-50%); }
#selesai .atas { font-size: 1.6cqh; font-weight: 800; letter-spacing: .3em; color: #f3d27d; }
#selesai .nama { font-size: 3.2cqh; font-weight: 800; margin-top: .6cqh; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#selesai .nama .bendera img { height: 2.4cqh; width: 3.2cqh; }
#selesai .ket { font-size: 1.7cqh; margin-top: .3cqh; opacity: .95; }
#selesai .ajak { display: flex; flex-direction: column; gap: .8cqh; margin-top: 1.4cqh; padding-top: 1.2cqh; border-top: 1px solid rgba(243, 210, 125, .35);
  font-size: 1.75cqh; font-weight: 700; }
#selesai .waktu { position: absolute; left: 0; bottom: 0; height: .5cqh; width: 100%; background: #f3d27d; transform-origin: left; }
#selesai.on .waktu { animation: habisWaktu var(--dur, 8s) linear forwards; }
@keyframes habisWaktu { from { transform: scaleX(1); } to { transform: scaleX(0); } }
