/* Gaya khusus halaman game. Pakai variabel warna dari style.css (:root) supaya mode gelap ikut. */

/* ---------- umum ---------- */
.game-hal { max-width: 1040px; }
.game-hal .card { margin-bottom: 14px; }
.game-hal .page-head p { max-width: 640px; }
.game-hal .btn { min-height: 40px; }
.game-hal .btn.sm { min-height: 36px; }
.game-hal .btn.besar { min-height: 48px; padding: 0 22px; font-size: 15px; font-weight: 600; border-radius: 12px; }
.game-hal .btn.penuh, .tamu-hal .btn.penuh { width: 100%; }
.game-kembali { margin-bottom: 14px; }
.game-pesan { text-align: center; padding: 30px 22px; }
.game-pesan h3 { margin-bottom: 6px; }
.game-pesan p { margin: 0 auto 14px; max-width: 460px; }
.game-pesan-ikon { font-size: 40px; margin-bottom: 6px; }
.teks-bahaya { color: var(--danger); }
.paket-isi { flex: 1; min-width: 0; }
.paket-isi .badge { margin-left: 7px; }
.game-hal .game-aturan > p.small { margin-top: -2px; }

.permainan-ikon.g-uno { background: var(--danger-soft); }
.permainan-ikon.g-werewolf { background: var(--surface-2); }
.permainan-kartu:focus-visible, .mode-tombol:focus-visible, .topik-cip:focus-visible,
.kuis-opsi:focus-visible, .orang-tombol:focus-visible, .undang-kode:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.game-ikon { font-size: 26px; }
.game-gabung { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.game-gabung .btn { align-self: center; min-width: 160px; }
.game-kode-isi { min-height: 56px; }
.game-kode-isi:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.game-kode { min-height: 48px; }

/* ---------- undangan ---------- */
.undang { display: flex; gap: 22px; align-items: center; }
.undang-kiri { flex: 1; min-width: 0; }
.undang-label { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.undang-kode {
  display: inline-block; font: inherit; font-size: 44px; font-weight: 800; line-height: 1.1;
  letter-spacing: .18em; color: var(--accent-ink); background: none; border: none; padding: 2px 0;
  cursor: pointer; font-variant-numeric: tabular-nums;
}
.undang-kode:hover { color: var(--accent); }
.undang-ket { margin: 2px 0 12px; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.undang-aksi { display: flex; gap: 8px; flex-wrap: wrap; }
.undang-tautan {
  width: 100%; margin-top: 10px; border: 1px dashed var(--line-2); border-radius: 9px;
  padding: 8px 11px; font: inherit; font-size: 12.5px; color: var(--ink-2); background: var(--paper);
  text-overflow: ellipsis;
}
.undang-qr { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
/* Kode QR harus gelap di atas terang supaya bisa dipindai kamera (warna isi, sengaja tidak mengikuti tema). */
.undang-qr-gambar {
  width: 172px; height: 172px; padding: 6px; border-radius: 12px;
  background: #fff; color: #000; border: 1px solid var(--line);
}
.undang-qr-gambar svg { width: 100%; height: 100%; display: block; }
.undang-qr-tombol { display: none; }
@media (max-width: 700px) {
  .undang { flex-direction: column; align-items: stretch; gap: 12px; }
  .undang-kiri { text-align: center; }
  .undang-aksi { justify-content: center; }
  .undang-aksi .btn { flex: 1 1 auto; }
  .undang-qr-tombol { display: inline-flex; }
  .undang-qr { display: none; }
  .undang-qr.buka { display: flex; animation: game-muncul .18s ease-out; }
  .undang-qr-gambar { width: 210px; height: 210px; }
}

/* ---------- lobi ---------- */
.lobi-kepala { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.lobi-kepala h3 { margin: 0; }
.lobi-kabar { margin: 12px 0 0; }
.lobi-mulai { margin-top: 16px; display: flex; justify-content: center; }
.lobi-mulai .btn { min-width: 240px; max-width: 100%; }
.lobi-tunggu { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--ink-2); text-align: center; }
.pemain-cip { min-height: 40px; }
.pemain-cip.aku { border-color: var(--accent); background: var(--accent-soft); }
.pemain-nama { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pemain-tanda {
  display: inline-block; font-size: 11px; line-height: 1.5; border-radius: 8px; padding: 0 7px;
  margin-left: 6px; vertical-align: middle; font-weight: 600;
}
.pemain-tanda.tamu { background: var(--warn-soft); color: var(--warn-ink); }
.pemain-tanda.kamu { background: var(--accent-soft); color: var(--accent-ink); }
.pemain-tanda.tuan { padding: 0; margin-left: 2px; font-size: 14px; }
.pemain-cip .pemain-tanda { margin-left: 0; }
.titik-tunggu { display: inline-flex; gap: 4px; }
.titik-tunggu i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: game-denyut 1.2s infinite ease-in-out;
}
.titik-tunggu i:nth-child(2) { animation-delay: .15s; }
.titik-tunggu i:nth-child(3) { animation-delay: .3s; }

/* ---------- permainan berjalan ---------- */
.giliran-kabar { margin: -4px 0 10px; }
.petunjuk-baris.aku .petunjuk-nama { color: var(--accent-ink); }
.petunjuk-baris { min-height: 44px; }
.suara-tanda { color: var(--money-in); font-weight: 700; }
.orang-tombol { min-height: 48px; }
.skor-cip.aku { border-color: var(--accent); background: var(--accent-soft); }
.kuis-opsi { min-height: 56px; transition: border-color .15s, background .15s, transform .1s; }
.kuis-opsi:active:not(:disabled) { transform: scale(.98); }
.kuis-teks { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.kuis-opsi.benar { animation: game-sorot .4s ease-out; }
.tebak-isi input, .petunjuk-isi input { min-height: 48px; min-width: 0; }
.tebak-isi .btn, .petunjuk-isi .btn { min-height: 48px; }
.goyang { animation: game-goyang .35s; border-color: var(--danger) !important; }
.tebak-jawaban { animation: game-muncul .25s ease-out; }
.hasil-kartu .hasil-besar { animation: game-muncul .3s ease-out; }
.hasil-besar.batal { color: var(--ink-2); }
.hasil-sub { margin-top: 20px; }
.hasil-atur { margin-top: 18px; text-align: left; }
.hasil-aksi { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 16px 0 6px; }
.podium .pemain-tanda { margin-left: 0; }

/* ---------- animasi ---------- */
@keyframes game-muncul { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes game-denyut { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
@keyframes game-goyang { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes game-sorot { from { transform: scale(1.03); } to { transform: none; } }
.cip-enter-active, .baris-enter-active, .muncul-enter-active { transition: opacity .2s, transform .2s; }
.cip-leave-active { transition: opacity .15s; }
.cip-enter-from, .baris-enter-from, .muncul-enter-from { opacity: 0; transform: scale(.92); }
.cip-leave-to { opacity: 0; }
.baris-move, .cip-move { transition: transform .3s ease; }
.soal-enter-active, .soal-leave-active { transition: opacity .16s, transform .16s; }
.soal-enter-from { opacity: 0; transform: translateX(14px); }
.soal-leave-to { opacity: 0; transform: translateX(-14px); }

/* ---------- HP & tablet ---------- */
@media (max-width: 700px) {
  .game-bar { gap: 10px; padding: 10px 12px; }
  .game-tahap { order: 3; flex-basis: 100%; }
  .game-bar > .btn { margin-left: auto; }
  .undang-kode { font-size: 48px; }
  .lobi-mulai .btn { width: 100%; min-width: 0; }
  .kuis-opsi { font-size: 15.5px; }
  .hasil-aksi .btn { flex: 1 1 auto; }
  .pilih-orang { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
@media (max-width: 420px) {
  .petunjuk-isi, .tebak-isi { flex-direction: row; }
  .kartu { max-width: 300px; }
  .kata-besar { font-size: 28px; }
  .permainan-kisi { grid-template-columns: 1fr; }
}

/* ---------- halaman tamu (tanpa sidebar) ---------- */
.tamu-hal { min-height: 100vh; min-height: 100dvh; background: var(--paper); display: flex; flex-direction: column; }
.tamu-atas {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.tamu-merek { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.tamu-atas-kanan { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tamu-nama { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.tamu-isi { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 18px 16px 40px; }
.tamu-kotak {
  max-width: 420px; margin: 6vh auto 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px 24px 22px; text-align: center; box-shadow: var(--shadow);
  animation: game-muncul .25s ease-out;
}
.tamu-kotak h1 { font-size: 22px; margin: 4px 0 6px; }
.tamu-kotak > p { margin: 0 0 14px; }
.tamu-kotak form { text-align: left; margin-top: 8px; }
.tamu-kotak .field input { min-height: 48px; font-size: 16px; }
.tamu-ikon { font-size: 42px; }
.tamu-kode { display: flex; flex-direction: column; align-items: center; margin: 6px 0 12px; }
.tamu-kode strong { font-size: 38px; letter-spacing: .2em; color: var(--accent-ink); line-height: 1.15; }
.tamu-akun { margin-top: 12px; min-height: 40px; }
.game-tamu .page-head { margin-bottom: 12px; }
@media (max-width: 480px) {
  .tamu-isi { padding: 12px 12px 32px; }
  .tamu-kotak { margin-top: 3vh; padding: 22px 16px 18px; border-radius: 14px; }
  .tamu-merek span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .game-hal *, .tamu-hal * { animation: none !important; transition: none !important; }
}

/* lobi: pengaturan tanpa garis pemisah di atasnya */
.lobi .atur-main { border-top: 0; padding-top: 0; margin-top: 0; }
@media (max-width: 700px) {
  .game-kode { padding: 4px 11px; min-height: 44px; }
  .game-kode-teks { font-size: 19px; }
  .game-hal .page-head p { font-size: 13.5px; }
}

/* kartu kata di mode gelap: latar gelap supaya logo putih dan teks tetap kontras */
:root[data-tema="gelap"] .kartu-belakang {
  background: linear-gradient(140deg, var(--accent-pale), var(--surface-2));
  color: var(--ink); border: 1px solid var(--line-2);
}
.lobi .atur-main + .atur-main, .lobi h3 + p + .atur-main { margin-top: 12px; }
.ww-cek { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-size: 14px; }
.ww-cek input { width: 20px; height: 20px; accent-color: var(--accent); }
