:root {
  --latar: #0c1530;
  --latar2: #142147;
  --kartu: #1a2a58;
  --garis: #2b3d77;
  --teks: #eef2ff;
  --redup: #9fb0de;
  --emas: #f5b301;
  --merah: #ef5350;
  --hijau: #66bb6a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--latar);
  color: var(--teks);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, p { margin: 0; }
button, input { font: inherit; color: inherit; }
.merek { font-weight: 800; letter-spacing: .04em; color: var(--emas); }
.redup { color: var(--redup); }
.kartu { background: var(--kartu); border: 1px solid var(--garis); border-radius: 16px; padding: 16px; }
.tombol {
  display: block; width: 100%; padding: 16px; border: 0; border-radius: 14px;
  background: var(--emas); color: #1a1400; font-weight: 800; font-size: 18px; cursor: pointer;
  text-align: center; text-decoration: none;
}
.tombol.kedua { background: var(--latar2); color: var(--teks); border: 1px solid var(--garis); }
.pita {
  position: fixed; left: 0; right: 0; top: 0; z-index: 20; padding: 8px 16px; text-align: center;
  background: var(--merah); color: #fff; font-weight: 700; display: none;
}
.pita.tampil { display: block; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--garis); white-space: nowrap; }
th { color: var(--redup); font-weight: 600; font-size: 13px; }
td.angka, th.angka { text-align: right; font-variant-numeric: tabular-nums; }
.titik { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }
.baik { color: var(--hijau); } .sedang { color: var(--emas); } .buruk { color: var(--merah); }

/* ---------- lobi ---------- */
ul.pemain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
ul.pemain li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--latar2); border: 1px solid var(--garis); border-radius: 12px; padding: 10px 12px; }
ul.pemain li.putus { opacity: .5; }
ul.pemain .kanan { margin-left: auto; font-size: 13px; font-variant-numeric: tabular-nums; }
.lencana { font-size: 12px; background: rgba(245, 179, 1, .16); color: var(--emas); border-radius: 999px; padding: 2px 8px; }
.game { display: flex; gap: 12px; align-items: center; background: var(--latar2); border: 1px solid var(--garis); border-radius: 12px; padding: 12px; }
.game.pilih { border-color: var(--emas); }
.game .ikon { font-size: 34px; }
.game .redup { font-size: 14px; }
.hasil { font-size: 26px; font-weight: 900; color: var(--emas); text-align: center; }
.hasil:empty { display: none; }
h2 { font-size: 14px; font-weight: 600; color: var(--redup); text-transform: uppercase; letter-spacing: .08em; }
.tombol[disabled] { opacity: .45; cursor: default; }

/* ---------- panggung game ---------- */
.panggung { position: fixed; inset: 0; display: none; grid-template-rows: 1fr; background: var(--latar); z-index: 10; }
.panggung.tampil { display: grid; }
.panggung canvas { width: 100%; height: 100%; display: block; min-height: 0; }
.panggung.dengan-kontrol { grid-template-rows: 42% 1fr; }
.panggung.hanya-kontrol canvas { display: none; }
.panggung .kontrol { min-height: 0; padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.panggung .kontrol:empty { display: none; }

/* ---------- Tarik Tambang: kontrol ---------- */
.tt { height: 100%; display: grid; grid-template-rows: auto auto 1fr; gap: 10px; touch-action: none; user-select: none; -webkit-user-select: none; }
.tt-atas { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tt-atas b { color: var(--tim); font-size: 20px; }
.tt-info { color: var(--redup); font-size: 14px; }
.tt-batang { height: 18px; border-radius: 9px; background: var(--latar2); border: 1px solid var(--garis); overflow: hidden; }
.tt-batang i { display: block; height: 100%; width: 100%; background: var(--hijau); }
.tt-tombol { border: 0; border-radius: 24px; background: var(--tim); color: #fff; font-size: 44px; font-weight: 900; touch-action: none; box-shadow: 0 8px 0 var(--tim-gelap); }
.tt-tombol[data-k="siap"], .tt-tombol[data-k="selesai"] { background: var(--kartu); box-shadow: none; color: var(--redup); font-size: 30px; }
.tt-tombol[data-k="lelah"] { background: #5d6477; box-shadow: none; font-size: 28px; }
.tt-tombol[data-k="tipis"] { filter: saturate(.6); }
.tt-denyut { animation: tt-denyut .09s; }
@keyframes tt-denyut { 50% { transform: translateY(6px); box-shadow: 0 2px 0 var(--tim-gelap); } }
.tt-tunggu { height: 100%; display: grid; place-items: center; text-align: center; color: var(--redup); font-size: 18px; }
