/* Pasar Ucup — Gaya Hangat, Ringan, & Lega ala Besarkan Ucup
   Pil lembut tanpa bingkai tebal kaku, 75% layar penuh dunia 3D Pasar Ucup.
   Mobile-first (360–430px), tanpa scroll horizontal, tombol >= 44px. */

:root {
  --kayu-tua: #3b2a14;
  --kayu-garis: #e3d3b1;
  --bambu: #f0dfba;
  --krem: #fffaf0;
  --kuning: #ffd23a;
  --kuning-bayang: #c99714;
  --tinta: #3b2a14;
  --tinta-redup: #7a6349;
  --hijau: #299453;
  --hijau-bayang: #1d6b3b;
  --biru: #2f7ad1;
  --biru-bayang: #1f589c;
  --merah: #d43f33;
  --pastel-sudut: #fff2c4;
  --pastel-kartu: #e3f0f8;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: clip;
  background: #9bd7f2;
  color: var(--tinta);
  font-family: "Baloo 2", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.25;
}

button,
input {
  font-family: inherit;
}

/* === KANVAS 3D LAYAR PENUH === */
.kanvas-3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  z-index: 1;
}

.lapisan-ui {
  position: relative;
  z-index: 2;
  width: min(440px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  pointer-events: none;
}

.lapisan-ui button,
.lapisan-ui input,
.lapisan-ui .kartu-form,
.lapisan-ui .kartu-tunggu-utama,
.lapisan-ui .bar-atas,
.lapisan-ui .baris-pemain,
.lapisan-ui .bar-aksi,
.lapisan-ui .nav-bawah,
.lapisan-ui .kartu-popup,
.lapisan-ui .lelang-popup,
.lapisan-ui .detail-petak,
.lapisan-ui .log-sheet,
.lapisan-ui .layar-akhir {
  pointer-events: auto;
}

/* === TOMBOL PIL LEMBUT (ALA BESARKAN UCUP) === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border: 0;
  border-radius: 22px;
  font-size: 16.5px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  background: var(--kayu-tua);
  box-shadow: 0 4px 0 #23180a;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.15s ease;
  touch-action: manipulation;
}

.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #23180a;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-utama {
  background: var(--kuning);
  color: var(--kayu-tua);
  box-shadow: 0 4px 0 var(--kuning-bayang);
}

.btn-utama:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--kuning-bayang);
}

.btn-hijau {
  background: var(--hijau);
  box-shadow: 0 4px 0 var(--hijau-bayang);
}

.btn-hijau:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--hijau-bayang);
}

.btn-biru {
  background: var(--biru);
  box-shadow: 0 4px 0 var(--biru-bayang);
}

.btn-biru:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--biru-bayang);
}

.btn-bambu {
  background: var(--krem);
  color: var(--kayu-tua);
  box-shadow: 0 4px 0 #c9b795;
}

.btn-bambu:active:not(:disabled) {
  box-shadow: 0 1px 0 #c9b795;
}

.btn-ikon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: rgba(255, 250, 240, 0.94);
  color: var(--kayu-tua);
  box-shadow: 0 3px 0 rgba(59, 42, 20, 0.2);
  cursor: pointer;
  touch-action: manipulation;
}

.btn-ikon.aktif {
  background: var(--kuning);
}

.btn-ikon:active {
  transform: translateY(2px);
}

.btn-ikon svg {
  width: 21px;
  height: 21px;
  display: block;
}

.suara-pojok {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 20;
}

.lencana-kecil {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 99px;
  background: var(--kuning);
  color: var(--kayu-tua);
  box-shadow: 0 2px 0 rgba(59, 42, 20, 0.18);
  font-size: 12px;
  font-weight: 800;
}

.peringatan-koin {
  margin: 4px 0 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--tinta-redup);
  line-height: 1.25;
}

.peringatan-koin.gelap {
  color: rgba(244, 227, 200, 0.72);
  font-size: 10px;
  margin-top: 3px;
}

/* === LAYAR MASUK === */
.panel-masuk {
  min-height: 100dvh;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.judul-lobi {
  text-align: center;
  padding: 0 42px;
}

.judul-lobi h1 {
  margin: 5px 0 0;
  font-size: 27px;
  line-height: 1.06;
  font-weight: 800;
  color: var(--kayu-tua);
  text-shadow: 0 2px 0 rgba(255, 250, 240, 0.95), 0 4px 12px rgba(255, 250, 240, 0.8);
}

.kartu-form {
  background: var(--krem);
  border-radius: 24px;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(59, 42, 20, 0.22), 0 3px 0 rgba(59, 42, 20, 0.12);
}

.sub-form {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tinta-redup);
  text-align: center;
}

.label-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 800;
  color: var(--kayu-tua);
  font-size: 13.5px;
}

input {
  min-height: 46px;
  padding: 10px 14px;
  border: 2px solid var(--kayu-garis);
  border-radius: 14px;
  background: #fff;
  color: var(--tinta);
  font-size: 16px;
  font-weight: 700;
  outline: none;
}

input:focus {
  border-color: var(--kuning-bayang);
}

.pemisah {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--tinta-redup);
  font-size: 12.5px;
  font-weight: 700;
}

.pemisah::before,
.pemisah::after {
  content: "";
  flex: 1;
  height: 1.5px;
  background: var(--kayu-garis);
}

.baris-gabung {
  display: flex;
  gap: 8px;
}

.baris-dua {
  display: flex;
  gap: 8px;
}

.baris-dua .btn {
  flex: 1;
  font-size: 14.5px;
  padding: 10px 10px;
}

#kode {
  width: 118px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-align: center;
  font-weight: 800;
  font-size: 18px;
}

.baris-gabung .btn {
  flex: 1;
}

.pesan {
  margin: 0;
  min-height: 1.1em;
  color: var(--merah);
  font-weight: 800;
  font-size: 13.5px;
  text-align: center;
}

/* === RUANG TUNGGU === */
.panel-tunggu {
  min-height: 100dvh;
  padding: 14px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.kartu-tunggu-utama {
  background: var(--krem);
  border-radius: 24px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  box-shadow: 0 8px 24px rgba(59, 42, 20, 0.22), 0 3px 0 rgba(59, 42, 20, 0.12);
}

.papan-kode {
  text-align: center;
}

.label-kode {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--tinta-redup);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kode-besar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 11px;
}

.huruf-kode {
  width: 50px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--pastel-sudut);
  box-shadow: 0 3px 0 #e0c56a;
  font-size: 29px;
  font-weight: 800;
  color: var(--kayu-tua);
}

.papan-kode .btn {
  width: 100%;
}

.ikon-bagikan svg {
  width: 18px;
  height: 18px;
  display: block;
}

.info-salin {
  margin: 4px 0 0;
  min-height: 1em;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--hijau);
}

.kartu-daftar-tunggu {
  background: #f5ebd4;
  border-radius: 16px;
  padding: 10px;
}

.kepala-daftar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--kayu-tua);
}

.pil-jumlah {
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--kuning);
  font-weight: 800;
  font-size: 12px;
}

.daftar-pemain-tunggu {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.item-tunggu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 12px;
  background: #fff;
  border-left: 5px solid var(--w);
  box-shadow: 0 2px 0 rgba(59, 42, 20, 0.08);
  min-width: 0;
}

.item-tunggu.kosong {
  border-left: 0;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: none;
  color: var(--tinta-redup);
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
}

.avatar-tunggu {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--w);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.nama-tunggu {
  font-weight: 800;
  font-size: 14px;
  color: var(--tinta);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-tunggu {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 800;
  background: var(--kuning);
  color: var(--kayu-tua);
  flex-shrink: 0;
}

.tag-tunggu.bot {
  background: #dcebf7;
  color: #1f589c;
}

.btn-hapus-bot {
  min-width: 44px;
  min-height: 44px;
  margin: -7px -6px -7px 0;
  border: 0;
  background: transparent;
  color: var(--merah);
  font-size: 19px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.tunggu-aksi {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tunggu-aksi .btn {
  width: 100%;
  min-height: 50px;
  font-size: 17px;
}

.info-menunggu-host {
  text-align: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--pastel-sudut);
  color: var(--kayu-tua);
  font-weight: 700;
  font-size: 13.5px;
}

/* === MEJA PERMAINAN 3D (LEGA, RINGAN, TANPA TUMPUKAN KOTAK) === */
.panel-meja {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hud-atas {
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.bar-atas {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pil-gelap {
  padding: 6px 11px;
  border-radius: 99px;
  background: var(--kayu-tua);
  color: var(--kuning);
  font-weight: 800;
  font-size: 12.5px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
  white-space: nowrap;
}

.pil-krem {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 11px;
  border: 0;
  border-radius: 15px;
  background: rgba(255, 250, 240, 0.94);
  color: var(--kayu-tua);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(59, 42, 20, 0.18);
  cursor: pointer;
  white-space: nowrap;
}

.pil-celengan {
  margin-left: auto;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--pastel-sudut);
  cursor: default;
}

.ikon-koin svg {
  width: 15px;
  height: 15px;
  display: block;
}

/* === SKOR PEMAIN RINGKAS MELAYANG DI ATAS === */
.baris-pemain {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.kartu-pm {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 16px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: 0 3px 0 rgba(59, 42, 20, 0.16);
  overflow: visible;
  min-width: 0;
}

.kartu-pm.aktif {
  background: #fff7d4;
  box-shadow: 0 0 0 2.5px var(--kuning), 0 3px 0 rgba(59, 42, 20, 0.2);
}

.kartu-pm.keluar {
  opacity: 0.5;
}

.pm-bulat {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--w);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.16);
}

.pm-info {
  flex: 1;
  min-width: 0;
}

.pm-nama {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--tinta);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
}

.pm-meta {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--tinta-redup);
  line-height: 1.1;
}

.pm-koin-pil {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--kayu-tua);
  color: var(--kuning);
  font-size: 12.5px;
  font-weight: 800;
  flex-shrink: 0;
}

.koin-delta {
  position: absolute;
  right: 8px;
  bottom: -14px;
  z-index: 20;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 800;
  pointer-events: none;
  box-shadow: 0 3px 6px rgba(59, 42, 20, 0.28);
  animation: koin-melayang 1.35s ease-out forwards;
}

.koin-delta.naik {
  background: var(--hijau);
  color: #fff;
}

.koin-delta.turun {
  background: var(--merah);
  color: #fff;
}

@keyframes koin-melayang {
  0% { opacity: 0; transform: translateY(-4px) scale(0.85); }
  20% { opacity: 1; transform: translateY(4px) scale(1.08); }
  75% { opacity: 1; transform: translateY(18px) scale(1); }
  100% { opacity: 0; transform: translateY(26px) scale(0.95); }
}

/* === GELEMBUNG CELOTEH UCUP (GAYA .bub BESARKAN UCUP) === */
.baris-ucup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.gelembung-ucup {
  position: relative;
  max-width: 74%;
  padding: 6px 12px;
  border-radius: 16px;
  background: #fff;
  color: var(--tinta);
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 3px 0 rgba(59, 42, 20, 0.14);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pil-dadu {
  padding: 5px 11px;
  border-radius: 99px;
  background: var(--kayu-tua);
  color: var(--kuning);
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
  white-space: nowrap;
  flex-shrink: 0;
}

.pil-dadu.kembar {
  background: var(--kuning);
  color: var(--kayu-tua);
}

/* === POPUP LELANG CEPAT 10 DETIK === */
.lelang-popup {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 16px);
  max-width: 340px;
  z-index: 26;
  background: var(--krem);
  border-radius: 22px;
  padding: 13px 14px 14px;
  box-shadow: 0 12px 32px rgba(59, 42, 20, 0.34), 0 0 0 3px var(--kuning);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lelang-atas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lelang-label {
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--merah);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
}

.lelang-waktu {
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--kayu-tua);
  color: var(--kuning);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.lelang-lapak {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  padding: 8px 10px;
  border-radius: 14px;
  box-shadow: 0 2px 0 rgba(59, 42, 20, 0.08);
}

.lelang-lapak .ikon-petak {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.lelang-lapak .ikon-petak svg {
  width: 100%;
  height: 100%;
  display: block;
}

.lelang-lapak-info strong {
  display: block;
  font-size: 15.5px;
  color: var(--kayu-tua);
}

.lelang-lapak-info small {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--tinta-redup);
}

.lelang-tawar-tertinggi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 11px;
  border-radius: 13px;
  background: var(--pastel-sudut);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--kayu-tua);
}

.lelang-bar {
  height: 5px;
  border-radius: 99px;
  background: #ead9b3;
  overflow: hidden;
}

.lelang-bar-isi {
  height: 100%;
  background: var(--merah);
  transition: width 0.2s linear;
}

.lelang-tombol {
  display: flex;
  gap: 8px;
}

.lelang-tombol .btn {
  flex: 1;
  min-height: 48px;
  font-size: 15px;
  padding: 8px 10px;
}

.lelang-status {
  text-align: center;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--hijau);
}

/* === MODAL KOPERASI (GADAI / TEBUS) === */
.btn-nav-kecil.koperasi {
  background: var(--kuning);
  color: var(--kayu-tua);
}

.kartu-koperasi {
  max-height: 82dvh;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.judul-koperasi {
  margin: 2px 0 0;
  font-size: 22px;
  color: var(--kayu-tua);
}

.ket-koperasi {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tinta-redup);
}

.daftar-koperasi {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
  max-height: 46dvh;
  text-align: left;
  padding: 2px 0;
}

.item-koperasi {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 0 rgba(59, 42, 20, 0.08);
}

.item-koperasi.digadai {
  background: #f2ece0;
}

.item-koperasi .ikon-petak {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.item-koperasi .ikon-petak svg {
  width: 100%;
  height: 100%;
  display: block;
}

.item-koperasi-info {
  flex: 1;
  min-width: 0;
}

.item-koperasi-info strong {
  display: block;
  font-size: 13.5px;
  color: var(--kayu-tua);
}

.item-koperasi-info small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--tinta-redup);
}

.item-koperasi .btn {
  min-height: 44px;
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 14px;
  flex-shrink: 0;
}

.detail-aksi {
  min-height: 44px;
  padding: 0 11px;
  border: 0;
  border-radius: 12px;
  background: var(--kuning);
  color: var(--kayu-tua);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

/* === AREA 3D TERBUKA DI TENGAH === */
.area-pandang-3d {
  position: relative;
  flex: 1;
  min-height: 200px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
}

/* === POPUP KOMENTAR NETIZEN (GAYA MEDIA SOSIAL) === */
.kartu-popup {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: calc(100% - 24px);
  max-width: 320px;
  z-index: 25;
  background: #fff;
  border-radius: 20px;
  padding: 12px 14px 14px;
  box-shadow: 0 10px 28px rgba(59, 42, 20, 0.28), 0 3px 0 rgba(59, 42, 20, 0.14);
  cursor: pointer;
  animation: kartu-masuk 0.16s ease-out;
}

@keyframes kartu-masuk {
  from {
    opacity: 0.78;
    transform: translate(-50%, -44%) scale(0.93);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.kartu-header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
}

.kartu-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.kartu-avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}

.kartu-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.kartu-meta strong {
  font-size: 14px;
  color: var(--kayu-tua);
}

.kartu-meta span {
  font-size: 11px;
  color: var(--tinta-redup);
  font-weight: 600;
}

.kartu-lencana {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--pastel-kartu);
  color: #205294;
  font-size: 10.5px;
  font-weight: 800;
}

.kartu-teks {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--tinta);
}

.kartu-progres {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 3.5px;
  border-radius: 99px;
  background: #eee4cf;
  overflow: hidden;
}

.kartu-progres-isi {
  height: 100%;
  width: 100%;
  background: var(--kuning);
  transform-origin: left;
  animation: kartu-habis 2.5s linear forwards;
}

@keyframes kartu-habis {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

/* === DETAIL PETAK 3D & SHEET RIWAYAT === */
.detail-petak {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border-radius: 18px;
  background: #fffaf0;
  box-shadow: 0 5px 16px rgba(59, 42, 20, 0.22);
  font-size: 12px;
  margin-bottom: 4px;
}

.detail-petak .ikon-petak {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.detail-petak .ikon-petak svg {
  width: 100%;
  height: 100%;
  display: block;
}

.detail-isi {
  flex: 1;
  min-width: 0;
}

.detail-isi strong {
  display: block;
  font-size: 13.5px;
  color: var(--kayu-tua);
}

.detail-isi span {
  display: block;
  color: var(--tinta-redup);
  font-weight: 600;
}

.detail-tutup {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: var(--bambu);
  color: var(--kayu-tua);
  border-radius: 12px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.log-sheet {
  max-height: 130px;
  overflow-y: auto;
  background: rgba(255, 250, 240, 0.96);
  border-radius: 16px;
  padding: 8px 11px;
  margin-bottom: 4px;
  box-shadow: 0 6px 18px rgba(59, 42, 20, 0.24);
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--tinta-redup);
}

.log-baris:first-child {
  color: var(--tinta);
  font-weight: 800;
}

/* === AKSI MELAYANG + BILAH BAWAH KAYU GELAP (GAYA BESARKAN UCUP) === */
.hud-bawah {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-aksi {
  padding: 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: center;
}

.bar-aksi .btn {
  flex: 1 1 130px;
  min-height: 48px;
  font-size: 15.5px;
  padding: 9px 12px;
}

.bar-aksi .btn.sekunder {
  flex: 0.65 1 100px;
  font-size: 14px;
}

.bar-aksi .btn.penuh-bawah {
  flex: 1 1 100%;
  min-height: 44px;
  font-size: 14px;
}

.banner-tunggu-giliran {
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  border-radius: 22px;
  background: rgba(255, 250, 240, 0.95);
  box-shadow: 0 4px 12px rgba(59, 42, 20, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.banner-tunggu-nama {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--kayu-tua);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.banner-tunggu-detik {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--kayu-tua);
  color: var(--kuning);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.banner-jalan {
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  border-radius: 22px;
  background: var(--pastel-sudut);
  box-shadow: 0 4px 12px rgba(59, 42, 20, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--kayu-tua);
}

.nav-bawah {
  background: var(--kayu-tua);
  color: #f4e3c8;
  padding: 0 10px calc(7px + env(safe-area-inset-bottom, 0px));
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 14px rgba(29, 22, 17, 0.28);
}

.bar-waktu {
  height: 4px;
  width: calc(100% + 20px);
  margin: 0 -10px 4px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  border-radius: 18px 18px 0 0;
}

.bar-waktu-isi {
  height: 100%;
  background: var(--kuning);
  transition: width 0.5s linear, background-color 0.3s ease;
}

.bar-waktu-isi.mepet {
  background: var(--merah);
}

.nav-baris {
  display: flex;
  align-items: center;
  gap: 8px;
}

.log-tombol {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #f4e3c8;
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  cursor: pointer;
}

.badge-waktu {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(255, 210, 58, 0.2);
  color: var(--kuning);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.badge-waktu.mepet {
  background: var(--merah);
  color: #fff;
}

.log-terbaru {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: #fffaf0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-nav-kecil {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--kuning);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

/* === LAYAR AKHIR & KONFETI === */
.layar-akhir {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(29, 22, 17, 0.68);
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
}

.konfeti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.potongan-konfeti {
  position: absolute;
  top: -14px;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  animation: jatuh-konfeti var(--dur, 2.8s) linear var(--tunda, 0s) infinite;
}

@keyframes jatuh-konfeti {
  0% {
    transform: translateY(-10px) rotate(0deg);
    opacity: 1;
  }

  85% {
    opacity: 1;
  }

  100% {
    transform: translateY(105dvh) rotate(520deg);
    opacity: 0;
  }
}

.kartu-akhir {
  position: relative;
  z-index: 2;
  width: min(370px, 100%);
  background: var(--krem);
  border-radius: 26px;
  padding: 22px 18px 18px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.mahkota-akhir {
  width: 52px;
  height: 52px;
  margin: 0 auto 6px;
}

.mahkota-akhir svg {
  width: 100%;
  height: 100%;
  display: block;
}

.judul-pemenang {
  margin: 6px 0 2px;
  font-size: 26px;
  line-height: 1.1;
  color: var(--kayu-tua);
}

.nama-pemenang {
  font-size: 20px;
  font-weight: 800;
  color: var(--hijau);
  margin-bottom: 12px;
}

.peringkat-akhir {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
  text-align: left;
}

.baris-peringkat {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 14px;
  background: #fff;
  border-left: 6px solid var(--w);
  box-shadow: 0 2px 0 rgba(59, 42, 20, 0.08);
}

.baris-peringkat.juara {
  background: var(--pastel-sudut);
}

.nomor-peringkat {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--bambu);
  color: var(--kayu-tua);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.baris-peringkat.juara .nomor-peringkat {
  background: var(--kuning);
}

.peringkat-info {
  flex: 1;
  min-width: 0;
}

.peringkat-info strong {
  display: block;
  font-size: 14.5px;
  color: var(--tinta);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.peringkat-info small {
  display: block;
  font-size: 11.5px;
  color: var(--tinta-redup);
  font-weight: 600;
}

.peringkat-kaya {
  font-weight: 800;
  font-size: 14.5px;
  color: var(--kayu-tua);
  white-space: nowrap;
}

.aksi-akhir {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.aksi-akhir .btn {
  width: 100%;
  min-height: 48px;
}

/* === HORMATI PREFERS-REDUCED-MOTION === */
@media (prefers-reduced-motion: reduce) {

  .bar-waktu-isi,
  .btn {
    transition: none !important;
  }

  .kartu-popup,
  .kartu-progres-isi,
  .koin-delta,
  .potongan-konfeti {
    animation: none !important;
  }

  .konfeti {
    display: none !important;
  }
}
