




.biru-btn,
.hijau-btn,
.ungu-btn,
.merah-btn,
.kuning-btn,
.orange-btn
{
color: #fff; border: none; padding: 10px 10px; font-size: 15px; font-weight: 700; border-radius: 10px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); letter-spacing: 0.3px;
}
.kuning-btn {
color: #111;
}
.biru-btn {
background: linear-gradient(135deg, #2196f3 0%, #0d47a1 100%); box-shadow: 0 4px 16px rgba(33, 150, 243, 0.3);
}
/* ★ HOVER = GLOW SAJA (tanpa transform & tanpa ganti background) */
.biru-btn:hover {
box-shadow: 0 0 22px rgba(33, 150, 243, 0.75);
}
.hijau-btn {
background: linear-gradient(135deg, #10b981 0%, #059669 100%); box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}
.hijau-btn:hover {
box-shadow: 0 0 22px rgba(16, 185, 129, 0.75);
}
.ungu-btn {
background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%); box-shadow: 0 4px 16px rgba(140, 26, 255, 0.3);
}
.ungu-btn:hover {
box-shadow: 0 0 22px rgba(140, 26, 255, 0.75);
}
.merah-btn {
background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}
.merah-btn:hover {
box-shadow: 0 0 22px rgba(239, 68, 68, 0.75);
}
.kuning-btn {
background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); box-shadow: 0 4px 16px rgba(251, 191, 36, 0.3);
}
.kuning-btn:hover {
box-shadow: 0 0 22px rgba(251, 191, 36, 0.75);
}
.orange-btn {
background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3);
}
.orange-btn:hover {
box-shadow: 0 0 22px rgba(249, 115, 22, 0.75);
}

/* ★ TOMBOL SAAT MODE OFFLINE — ABU-ABU.
   Mode Offline = tombol Online/Offline (#btnToggleLiveMode) ber-class .is-off.
   Izin klik box (#btnToggleClickBox) juga abu saat izinnya dimatikan admin. */
#btnToggleLiveMode.is-off,
#btnToggleClickBox.is-off {
background: linear-gradient(135deg, #6b7280 0%, #374151 100%);
box-shadow: 0 4px 16px rgba(107, 114, 128, 0.3);
}
#btnToggleLiveMode.is-off:hover,
#btnToggleClickBox.is-off:hover {
background: linear-gradient(135deg, #6b7280 0%, #374151 100%);
box-shadow: 0 0 22px rgba(148, 163, 184, 0.75);
}

/* ★ Desain seragam tombol aksi dalam modal (Close & Hapus) */
.modal-actions {
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
margin: 10px 0;
flex-wrap: wrap;
}

/* ★ Jarak tombol aksi (Close/Hapus) pada modal Box: diberi ruang yang pas
   terhadap deretan box di atasnya dan tepi bawah kartu — Box 1 & Box 2 disamakan. */
#boxModal .modal-actions,
#allBoxModal .modal-actions {
margin-top: 22px;
margin-bottom: 22px;
}

/* ★ Close = disamakan dengan tombol Close di /online (padding, radius, ukuran,
   bayangan, dan hover) supaya kedua halaman tampil seragam. */
.btn-modal-close {
background: linear-gradient(135deg, #64748b 0%, #334155 100%);
color: #fff;
padding: 10px 24px;
font-size: 15px;
font-weight: bold;
border-radius: 8px;
letter-spacing: normal;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
transition: all 0.3s ease;
}
.btn-modal-close:hover {
background: linear-gradient(135deg, #94a3b8 0%, #475569 100%);
box-shadow: 0 6px 18px rgba(100, 116, 139, 0.55);
}

/* ★ Hapus = disamakan dengan tombol Hapus di /online (padding, radius, ukuran,
   bayangan, dan hover) — pasangan Close di atas. */
.btn-modal-delete {
background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
color: #fff;
padding: 10px 24px;
font-size: 15px;
font-weight: bold;
border-radius: 8px;
letter-spacing: 0.3px;
box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ★ Tombol "Hapus Duplikat" di modal Peserta Terpilih — warna ungu seperti /online
   (ukuran & radius sudah ikut .btn-modal-delete). */
#btnDeleteSameName {
    background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
    box-shadow: 0 4px 16px rgba(140, 26, 255, 0.3);
}
#btnDeleteSameName:hover {
    background: linear-gradient(135deg, #a044ff 0%, #6a11cb 100%);
    box-shadow: 0 0 22px rgba(140, 26, 255, 0.75);
}
.btn-modal-delete:hover {
background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5);
}

#canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}
#canvas:hover {
    transform: scale(1.01);
}

input[type="text"] {
    width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2);
    background: #12181f; color: #fff; font-size: 15px; outline: none; box-sizing: border-box;
}
input[type="text"]:focus { border-color: #00c6ff; }

/* ★ Panel "List Peserta" (tampilan peserta) — class KHUSUS, tidak lagi memakai
   class panel Admin (.participant-list-panel / .panel-header / .pl-count)
   supaya bisa diatur sendiri tanpa memengaruhi panel lain. */
.peserta-list-wrapper {
    width: 100%; max-width: 450px; margin: 5px auto;
    display: flex; justify-content: center; align-items: center;
    flex-wrap: wrap; gap: 8px;
}
/* ★ List Peserta (blok publik) DISEMBUNYIKAN saat mode admin aktif — admin sudah
   punya panel "Daftar Peserta" sendiri di #adminToolsSection.
   Statusnya disinkronkan client di `applyAdminPermissions()` supaya saat
   "Sign out" daftarnya langsung muncul lagi tanpa perlu reload. */
.peserta-list-wrapper.admin-hidden { display: none; }
.peserta-list-panel {
    /* ★ Lebar disamakan dengan panel "Daftar Peserta" (admin): penuh 450px */
    flex: 1 1 100%; width: 100%; box-sizing: border-box;
    background: #1e2638; border: 1px solid rgba(255,255,255,0.15); border-radius: 10px;
    overflow: hidden;
}
.peserta-list-panel .peserta-list-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 12px; font-weight: 600; color: #aab;
}
.peserta-list-panel .peserta-list-header .peserta-list-count {
    background: rgba(255,215,0,0.15); color: #ffd700; padding: 2px 8px;
    border-radius: 10px; font-size: 11px; font-weight: 700;
}
.peserta-list-box { max-height: 160px; overflow-y: auto; padding: 4px 0; }
.peserta-list-box ol { margin: 0; padding-left: 34px; color: #dde; font-size: 13px; }
.peserta-list-box::-webkit-scrollbar { width: 5px; }
.peserta-list-box::-webkit-scrollbar-track { background: transparent; }
.peserta-list-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.peserta-list-box li { padding: 4px 12px 4px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.peserta-list-box li.my-name { color: #ffd700; font-weight: bold; }
.peserta-list-empty { color: #777; font-size: 13px; text-align: center; margin: 10px 0; font-style: italic; }

/* Form pendaftaran kompak: input kecil seperti "Tambah peserta" + tombol di samping input */
#formContainer .reg-form-row { display: flex; align-items: stretch; gap: 6px; margin-top: 8px; }
#formContainer .reg-inputs { flex: 1; min-width: 0; }
#formContainer #form2Container,
#formContainer #form1Container { display: flex; flex-direction: column; gap: 6px; }
#formContainer input[type="text"] {
    width: 100%; padding: 7px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.12);
    background: #12181f; color: #fff; font-size: 12.5px; outline: none; box-sizing: border-box;
    transition: border-color 0.2s;
}
#formContainer input[type="text"]:focus { border-color: rgba(100,180,255,0.5); }
#formContainer #btnSubmit.reg-submit-btn {
    flex: 0 0 auto; width: auto; align-self: stretch; white-space: normal; text-align: center;
    padding: 6px 12px; font-size: 12px; font-weight: 700; line-height: 1.2;
    letter-spacing: 0.2px; border-radius: 6px;
}

.participant-input-container { width: 100%; max-width: 450px; margin: 5px auto; display: flex; justify-content: center; align-items: center;
    flex-wrap: wrap; gap: 8px; }

/* ★ Baris tombol admin (Play, Shuffle, Box 1, Box 2, Online, Izin Klik).
   flex + justify-content:center → seluruh tombol berada di TENGAH halaman.
   Lebarnya sengaja TIDAK dibatasi 450px seperti card di bawahnya, supaya keenam
   tombol tetap muat sebaris di desktop; di layar sempit mereka melipat ke bawah
   dan barisnya tetap rata tengah. */
.play-btn-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
}

/* ★ Semua tombol pada baris ini berukuran sama supaya rapi */
.play-btn-row > button {
    flex: 0 0 auto;
    width: 100px;
    height: 40px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Participant List Styles */
.participant-list-panel {
    /* ★ Lebar disamakan dengan panel "List Peserta" (.peserta-list-panel): penuh 450px */
    flex: 1 1 100%; width: 100%; box-sizing: border-box;
    background: #1e2638; border: 1px solid rgba(255,255,255,0.15); border-radius: 10px;
    overflow: hidden;
}
.participant-list-panel .panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; 
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 12px; font-weight: 600; color: #aab;
}
.participant-list-panel .panel-header .pl-count {
    background: rgba(255,215,0,0.15); color: #ffd700; padding: 2px 8px;
    border-radius: 10px; font-size: 11px; font-weight: 700;
}
.participant-list-panel .pl-items {
    max-height: 160px; overflow-y: auto; padding: 2px 0;
}
.participant-list-panel .pl-items::-webkit-scrollbar { width: 5px; }
.participant-list-panel .pl-items::-webkit-scrollbar-track { background: transparent; }
.participant-list-panel .pl-items::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.participant-list-panel .pl-item {
    display: flex; align-items: center; padding: 2px 4px; font-size: 13px; color: #dde;
    transition: background 0.15s;
}
.participant-list-panel .pl-item:hover { background: rgba(255,255,255,0.05); }
.participant-list-panel .pl-item .pl-num {
    color: #667; font-size: 11px; font-weight: 700; min-width: 24px;
}
.participant-list-panel .pl-item .pl-name {
    flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.participant-list-panel .pl-item .pl-del {
    background: none; border: none; color: #f44; cursor: pointer; font-size: 14px;
    opacity: 0; transition: opacity 0.15s; padding: 2px 6px; border-radius: 4px;
}
.participant-list-panel .pl-item:hover .pl-del { opacity: 1; }
.participant-list-panel .pl-item .pl-del:hover { box-shadow: 0 0 10px rgba(255,68,68,0.8); }
/* ★ FIX: tombol & form edit nama peserta (admin) */
.participant-list-panel .pl-item .pl-edit {
    background: none; border: none; color: #4da3ff; cursor: pointer; font-size: 13px;
    opacity: 0; transition: opacity 0.15s; padding: 2px 6px; border-radius: 4px;
}
.participant-list-panel .pl-item:hover .pl-edit { opacity: 1; }
.participant-list-panel .pl-item .pl-edit:hover { box-shadow: 0 0 10px rgba(77,163,255,0.85); }
.participant-list-panel .pl-item .pl-edit-input {
    flex: 1; min-width: 0; box-sizing: border-box; background: rgba(0,0,0,0.35); border: 1px solid #4da3ff;
    color: #fff; border-radius: 5px; padding: 3px 7px; font-size: 12.5px; outline: none;
}
.participant-list-panel .pl-item .pl-save,
.participant-list-panel .pl-item .pl-cancel {
    background: none; border: none; cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 4px;
}
.participant-list-panel .pl-item .pl-save { color: #38d39f; }
.participant-list-panel .pl-item .pl-save:hover { box-shadow: 0 0 10px rgba(56,211,159,0.85); }
.participant-list-panel .pl-item .pl-cancel { color: #f44; }
.participant-list-panel .pl-item .pl-cancel:hover { box-shadow: 0 0 10px rgba(255,68,68,0.8); }
.participant-list-panel .pl-empty {
    text-align: center; color: #556; font-size: 12px; padding: 16px; font-style: italic;
}
/* Baris input peserta: input di kiri, tombol Add & Reset bersebelahan di kanan */
.participant-list-panel .pl-add-row {
    display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center;
    gap: 6px; padding: 8px 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.participant-list-panel .pl-add-row input {
    /* ★ width:auto + flex-basis 0% → input tidak lagi 100% (kalau 100%, flex-wrap
       melempar tombol Add & Reset ke baris bawah). */
    flex: 1 1 0%; width: auto; min-width: 0;
    background: #12181f; border: 1px solid rgba(255,255,255,0.12); border-radius: 6px;
    color: #fff; padding: 6px 10px; font-size: 12px; outline: none;
    transition: border-color 0.2s;
}
.participant-list-panel .pl-add-row input:focus { border-color: rgba(100,180,255,0.5); }
.participant-list-panel .pl-add-row .hijau-btn,
.participant-list-panel .pl-add-row .merah-btn {
    flex: 0 0 auto; padding: 6px 12px; font-size: 12px; font-weight: 700;
    border-radius: 7px; letter-spacing: 0.2px; line-height: 1.2;
}

.pendaftaran-wrapper { max-width: 450px; margin: 0px auto; padding: 10px; background: #1e2638; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; box-sizing: border-box; }
input[type="range"].slider-input { width: 100%; height: 8px; border-radius: 5px; outline: none; cursor: pointer; }

/* ★ CARD SLIDER WAKTU SPIN (di dalam #adminToolsSection).
   Sengaja MENIRU card lain (.pendaftaran-wrapper / .peserta-list-panel) supaya
   seragam: background #1e2638, border tipis, radius 10px, max-width 450px,
   margin 5px auto, box-sizing border-box. Bedanya hanya padding — dibuat lebih
   rapat (6px 10px) karena isinya cuma label + 1 slider.
   Label & slider disusun SEBARIS (flex) supaya card-nya tetap pendek; tanpa
   flex, `input.slider-input { width:100% }` akan turun ke baris kedua. */
.timer-card {
    width: 100%;
    max-width: 450px;
    margin: 5px auto;
    padding: 6px 10px;
    box-sizing: border-box;
    background: #1e2638;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.timer-card .timer-card-value {
    flex: 0 0 auto;
    min-width: 26px;
    color: #ffd700;
    font-size: 11px;
    font-weight: 700;
    text-align: right;
}
/* slider mengisi sisa lebar card (width:100% milik .slider-input di-reset) */
.timer-card .slider-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.modal {
    display: none;
    position: fixed;
    z-index: 500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}
body .praya-nav {
    z-index: 550;
}

/* ★ Warna card modal disesuaikan dengan palet online:
   violet #7c3aed / #a78bfa, cyan #0891b2 / #67e8f9, pink #db2777 / #f9a8d4
   (sebelumnya navy → magenta yang tidak nyambung dengan warna online) */
.modal-content {
    background:
        radial-gradient(120% 100% at 12% 0%, rgba(167, 139, 250, 0.30) 0%, transparent 58%),
        radial-gradient(120% 100% at 88% 100%, rgba(103, 232, 249, 0.22) 0%, transparent 60%),
        radial-gradient(90% 80% at 85% 6%, rgba(249, 168, 212, 0.18) 0%, transparent 62%),
        linear-gradient(150deg, #6202ac 0%, #5056c7 55%, #ac00fc 100%);
    opacity: 0.95;
    margin: 100px auto;
    padding: 0;
    border-radius: 10px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 42px rgba(124, 58, 237, 0.28);
    position: relative;
    overflow: hidden;
    	border: 2px solid rgba(212, 175, 55, 0.8);
}

.modal-header-winner { padding: 10px; font-size: 26px; text-align: center; color: #ffffff; font-weight: bold; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 3px 3px 6px rgba(0, 0, 0, 0.6); }
.modal-header-box1 { padding: 10px; font-size: 30px; text-align: center; color: #ffd700; font-weight: bold; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 3px 3px 6px rgba(0, 0, 0, 0.6); }
.modal-header-box2 { padding-top: 10px; font-size: 30px; text-align: center; color: #ffd700; font-weight: bold; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 3px 3px 6px rgba(0, 0, 0, 0.6); }
.modal-header-box3 { padding: 10px; font-size: 30px; text-align: center; color: #fff; font-weight: bold; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 3px 3px 6px rgba(0, 0, 0, 0.6); }/* ==========================================
   MODAL SIGN IN / PIN ADMIN (ala /portfolio)
   ========================================== */
.pin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 600;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 8, 15, 0.72);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.pin-overlay.active { display: flex; }
.pin-modal {
    position: relative;
    width: 100%;
    max-width: 430px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(167, 139, 250, 0.18);
}
.pin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.pin-header h2 { font-size: 1.2rem; font-weight: 700; color: #fff; letter-spacing: .02em; }
.pin-close {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color .2s, transform .2s;
}
.pin-close:hover { color: #fff; box-shadow: 0 0 14px rgba(167, 139, 250, 0.7); }
.pin-field { margin-bottom: 16px; }
.pin-field label {
    display: block;
    font-size: .85rem;
    color: #cbd5e1;
    margin-bottom: 6px;
}
.pin-field input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(10, 10, 20, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color .25s, box-shadow .25s;
}
.pin-field input:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}
.pin-error {
    color: #f87171;
    font-size: .8rem;
    margin: -8px 0 12px;
    display: none;
}
.pin-error.show { display: block; }
.pin-buttons { display: flex; gap: 10px; }
.pin-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: .9rem;
    letter-spacing: .03em;
    cursor: pointer;
    transition: all .3s ease;
}
.pin-btn-primary {
    background: linear-gradient(135deg, #a78bfa, #ec4899);
    color: #fff;
    box-shadow: 0 8px 24px rgba(167, 139, 250, 0.35);
}
.pin-btn-primary:hover { box-shadow: 0 0 24px rgba(236, 72, 153, 0.7); }
.pin-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}
.pin-btn-secondary:hover { box-shadow: 0 0 18px rgba(255, 255, 255, 0.30); }

.winner-name {
    font-size: 50px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 3px 3px 6px rgba(0, 0, 0, 0.6);
    word-break: break-word;
    animation: pulse 1s infinite;
}
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }

.boxes-container {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding: 0 10px;
    box-sizing: border-box;
}

.all-boxes-container {
    /* ★ MAKSIMAL 10 BOX PER BARIS — pakai CSS Grid, jumlah kolom di-set JS
       (--allbox-cols) = min(jumlah box, 10). Lebih pasti daripada flex-basis,
       yang jumlah box per barisnya berubah-ubah mengikuti lebar modal.
       ★ FIX CENTER: lebar kolom DIBATASI (minmax(0, 100px)) — bukan 1fr yang
       selalu melar memenuhi kartu. Dengan begitu, kalau boxnya sedikit, sisa
       ruangnya dibagi rata oleh `justify-content: center` sehingga kelompok box
       berada tepat di TENGAH kartu. Kalau boxnya banyak (kolom × 100px melebihi
       lebar kartu), kolomnya menyusut otomatis sampai memenuhi baris — persis
       seperti perilaku lama, jadi kerapatannya tidak berubah. */
    display: grid;
    grid-template-columns: repeat(var(--allbox-cols, 10), minmax(0, 100px));
    align-content: start;
    justify-content: center;
    max-height: 224px;
    /* ★ overflow-y:auto memaksa overflow-x jadi auto juga → scroll kiri/kanan
       muncul saat animasi (goyang + pecahan) meluber. Hidden = tidak ada scroll. */
    overflow-y: auto;
    overflow-x: hidden;
    overflow-anchor: none;
    /* ★ both-edges: ruang untuk scrollbar dicadangkan di KEDUA sisi, supaya isi
       grid tetap center terhadap kartu (dengan `stable` saja, ruang hanya
       dicadangkan di kanan sehingga isinya bergeser sedikit ke kiri). */
    scrollbar-gutter: stable both-edges;
    /* ★ ruang ekstra agar glow/shadow box tidak terpotong tepi container —
       KHUSUSNYA padding ATAS. Hover lift Box 2 memakai translateY(-5px), dan
       karena container ini `overflow-y:auto` (yang selalu memotong isi di tepi
       padding-box-nya), tanpa headroom bagian atas box ikut terpotong saat
       di-hover. Padding ini ditaruh di dalam container, jadi ukuran/lebar box
       tidak berubah — hanya area scroll-nya yang bergeser sedikit ke bawah. */

	    gap: 4px;                 /* ← jarak antar box khusus Box 2 */
    padding: 8px 12px 0;      /* atas 5px (headroom hover), kiri/kanan 12px */
}

/* ★ FILL — jumlah box 1–10: satu baris yang MEMENUHI lebar kartu modal (mirip
   Box 1), bukan deretan box 100px yang mengambang di tengah kartu. Kolom memakai
   1fr (melar penuh) dan tinggi container tidak dibatasi supaya box yang ikut
   membesar (lihat applyAllBoxSize di online.js) tidak memunculkan scroll.
   ★ Di atas 10 box class .fill TIDAK dipasang → perilaku lama persis
   (maksimal 10 box per baris, tinggi tetap, bisa di-scroll). */
.all-boxes-container.fill {
    grid-template-columns: repeat(var(--allbox-cols, 10), minmax(0, 1fr));
    max-height: none;
    overflow: visible;
}
/* ★ Ukuran box menyesuaikan JUMLAH box — di-set JS lewat applyAllBoxSize().
   Lebar = lebar kolom grid (maks 100px, lihat grid-template-columns di atas),
   tinggi di-set lewat --allbox-h: 1–9 box tinggi bertingkat (makin banyak makin
   pendek), lalu 10 box ke atas TETAP 62px — sama seperti saat berisi 10 box —
   dan tingginya ikut terskala saat kartu diperkecil.
   Nilai fallback (20px) = ukuran lama kalau JS belum sempat jalan.
   ★ Lebar kolom 100px itu sama dengan `refWidth` Box 2 di autoSizeBoxContent(),
   jadi skala huruf isi box sekarang pas 1.0 (ukuran sesuai desain). */
.all-boxes-container .mystery-box {
    height: var(--allbox-h, 20px);
    width: auto;
	border-radius: 8px; 
}
/* ★ FONT RESPONSIF (fallback CSS) — ukuran final dihitung JS autoSizeBoxContent()
   agar Admin & non-Admin identik; aturan ini hanya cadangan sebelum JS berjalan. */
.all-boxes-container .box-content {
    font-size: clamp(10px, 3.4vw, 15px);
}
.all-boxes-container .mystery-box.open {
    overflow: visible;
}
.all-boxes-container.interactive .mystery-box.open {
    cursor: pointer;
}

.all-boxes-container .mystery-box.winner-clicked {
    background: linear-gradient(135deg, #5c0f0f 0%, #ef5350 100%) !important;
    border: 2px solid #ffffff !important;
}

/* ★ FIX: box yang dipilih pemenang harus TETAP berwarna merah walau box tersebut
   sudah punya class .open. Selector ini spesifisitasnya lebih tinggi dari
   .all-boxes-container .mystery-box.open, jadi tidak bisa ditimpa lagi. */
.all-boxes-container .mystery-box.open.winner-clicked {
    background: linear-gradient(135deg, #5c0f0f 0%, #ef5350 100%) !important;
    border: 2px solid #ffffff !important;
}

.all-boxes-container .mystery-box.winner-clicked .box-title,
.all-boxes-container .mystery-box.winner-clicked .box-content {
    color: #ffffff !important;
}

.mystery-box {
    flex: 1;
    min-width: 0;
    height: 104px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.05));
    border: 2px solid #ffd700;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 8px 15px rgba(0,0,0,0.4), inset 0 2px 3px rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    overflow: hidden;
}
.mystery-box.opening {
    overflow: visible;
    z-index: 11;
    animation: boxShake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes boxShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    12% { transform: translateX(-6px) rotate(-3deg); }
    24% { transform: translateX(6px) rotate(3deg); }
    36% { transform: translateX(-6px) rotate(-3deg); }
    48% { transform: translateX(6px) rotate(3deg); }
    62% { transform: translateX(-4px) rotate(-2deg); }
    76% { transform: translateX(4px) rotate(2deg); }
    88% { transform: translateX(-2px) rotate(-1deg); }
}

.mystery-box.shattering {
    overflow: visible;
    z-index: 11;
    animation: boxShatter 0.45s ease-in forwards;
}

@keyframes boxShatter {
    to { transform: scale(0.75) rotate(8deg); opacity: 0.25; }
}

.shatter-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    background: linear-gradient(135deg, #fff4a3, #ffd700);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
    pointer-events: none;
    z-index: 12;
    animation: shatterExplode 0.6s ease-out forwards;
}

@keyframes shatterExplode {
    to {
        transform: translate(var(--dx), var(--dy)) scale(0) rotate(360deg);
        opacity: 0;
    }
}

.mystery-box.open {
    overflow: visible;
}

/* ★ Hover lift — Box 1 (#boxModal) & Box 2 (#allBoxModal), gayanya SAMA PERSIS.
   Transisi halusnya datang dari `transition` milik `.mystery-box` sendiri,
   karena box-nya sengaja dikecualikan dari larangan transition Box 2. */
#boxModal .mystery-box:hover:not(.locked):not(.open),
#allBoxModal .mystery-box:hover:not(.locked):not(.open) {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 215, 0, 0.6);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.15));
}

.mystery-box.locked {
     cursor: default;
    opacity: 1;
    filter: grayscale(0.8);
}
.mystery-box.locked::after {
    content: ' ';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    z-index: 5;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
}

.mystery-box.open {
    background: #ffffff !important;
    border: 2px solid #ffd700;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 0 25px rgba(255, 215, 0, 0.5);
    filter: none !important;
    animation: boxOpen 0.3s ease-out;
    cursor: default;
}

.mystery-box.open.locked {
    opacity: 1 !important;
    filter: none !important;
    cursor: default;
}

.mystery-box.open.locked::after {
    display: none !important;
}

@keyframes boxOpen {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.box-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 12px rgba(0,0,0,0.9), 0 0 20px rgba(255,215,0,0.5);
    z-index: 2;
    pointer-events: none;
}

/* ★ Angka box (1 / 2 / 3) — tampil sebagai badge kecil di pojok kiri atas saat box dibuka */
.mystery-box.open .box-title {
    top: 4px;
    left: 4px;
    transform: none;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    min-width: 16px;
    padding: 3px 4px;
    text-align: center;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    color: #ffd700;
    text-shadow: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    z-index: 5;
    opacity: 1;
    transition: top .25s ease, left .25s ease, transform .25s ease,
                font-size .25s ease, padding .25s ease, background .25s ease;
}

/* ★ Box 2: saat box DIBUKA, badge angka kecil di pojok kiri atas DIHAPUS.
   Box 1 (#boxModal) TIDAK terpengaruh — badge angkanya tetap tampil. */
#allBoxModal .mystery-box.open .box-title {
    display: none;
}

/* ★ Box 2: box yang SUDAH DIBUKA tidak lagi memakai shadow/glow — grid yang
   sudah terbuka jadi rata & bersih (glow emasnya dulu saling menumpuk antar box
   di grid yang rapat). Box 1 (#boxModal) tetap memakai glow emasnya. */
#allBoxModal .mystery-box.open {
    box-shadow: none;
}

/* ★ Box 2: isi box langsung tampil tanpa scale-in `boxOpen` dan tanpa
   `popText` pada nama. Overlay & .modal-content tidak lagi dianimasikan
   (sudah dihapus global), jadi cukup dua selector ini. */
#allBoxModal .mystery-box,
#allBoxModal .box-content {
    animation: none;
}

/* ★ Box 2: ukuran angka box. Nilainya datang dari JS (`--allbox-num`, di-set
   applyAllBoxSize()): 24px pada kartu acuan, lalu mengecil sebanding lebar box
   saat kartu/jendela diperkecil — jadi angka tidak lagi tetap 24px di dalam box
   yang mengecil. Fallback 24px dipakai kalau JS belum sempat jalan.
   Selector ini lebih spesifik daripada `.box-title` (1 kelas), jadi menang untuk
   Box 2 tapi TIDAK menyentuh Box 1 yang tetap 36px.
   Saat box dibuka, aturan `.mystery-box.open .box-title` (3 kelas) yang berlaku. */
.all-boxes-container .box-title {
    font-size: var(--allbox-num, 24px);
}

.box-content {
    font-size: clamp(11px, 3.5vw, 24px);
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8), 1px 1px 3px rgba(0,0,0,0.8);
    word-break: break-word;
    overflow-wrap: anywhere;
    padding: 0 4px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    line-height: 1.15;
    z-index: 3;
    max-height: 75px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    -webkit-line-clamp: 3;
}

.mystery-box.open .box-content {
    color: #c33764;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
    animation: popText 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popText {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
/* ★ Tanda merah manual — hidupkan dengan KLIK DUA KALI pada mystery box,
   klik dua kali lagi untuk kembali ke warna semula.
   Ditaruh setelah .mystery-box.open supaya menang atas background putihnya. */
.mystery-box.box-red {
    background: linear-gradient(135deg, #5c0f0f 0%, #ef5350 100%) !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 30px rgba(255, 82, 82, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.5) !important;
}
.mystery-box.box-red .box-content {
    color: #ffffff !important;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.9), 2px 2px 4px rgba(0, 0, 0, 0.7) !important;
}

.mystery-box.user-chosen-box {
   background: linear-gradient(135deg, #3d0d1a 0%, #dc143c 100%) !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 30px rgba(220, 20, 60, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.05);
    z-index: 10;
}

.mystery-box.user-chosen-box .box-content {
    color: #ffffff !important;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.9), 2px 2px 4px rgba(0,0,0,0.7) !important;
}

.btn-delete-participant {
    position: absolute; top: -8px; right: -8px;
    background: #ff4b2b; color: white; border: none;
    width: 22px; height: 22px; line-height: 22px; text-align: center;
    padding: 0; font-size: 12px; font-weight: bold;
    border-radius: 50%; cursor: pointer;
    transition: box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    z-index: 50;
}
.btn-delete-participant:hover { box-shadow: 0 0 14px rgba(255, 75, 43, 0.95); }

/* ★ POPUP NAMA PESERTA (Box 2) — kartu modal yang isinya DISUSUN SAMA seperti
   #winnerModal: `modal-header` + nama besar (`.winner-name`) + tombol Hapus/Close.
   Jadi font & animasinya (50px, emas, animasi `pulse`) persis mengikuti
   winnerModal — tidak ada aturan tambahan yang perlu ditulis di sini. */
#boxNameModal {
    /* ★ PENTING: overlay TIDAK mencuri klik. Kalau modal ini memblokir klik,
       fitur klik-2× (tanda merah) & klik box berikutnya di Box 2 mati — karena
       overlay-nya menutupi seluruh grid. Klik di luar kartu diteruskan ke grid,
       sehingga popup ini berlaku seperti kartu mengambang (tutup lewat Close).
       Mau jadi modal yang memblokir? Hapus `pointer-events: none` ini. */
    pointer-events: none;
}
#boxNameModal .modal-content {
    pointer-events: auto;      /* kartu + tombol Hapus/Close tetap bisa diklik */
}

/* ★ Tombol di baris status (buka/tutup pendaftaran & Asli/Samaran)
   - didorong ke sisi kanan baris */
.status-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

/* ★ Tombol "pendaftaran" & "Asli/Samaran" — CLASS KHUSUS (.pendaftaran-btn /
   .regmode-btn), SENGAJA tidak memakai .teal-btn / .biru-btn supaya tidak
   mewarisi animasi hover (translateY + glow) milik tombol lain.
   Tanpa `transition` dan tanpa aturan `:hover` → tidak ada animasi hover.
   Background transparan 10%. */
.pendaftaran-btn,
.regmode-btn {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 10px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    letter-spacing: 0.3px;
    cursor: pointer;
}

.regmode-btn { background: rgba(33, 150, 243, 0.10); }

/* ★ Warna tombol pendaftaran mengikuti statusnya:
   hijau = dibuka, merah = ditutup, abu = status belum diketahui (masih memuat). */
.pendaftaran-btn { background: rgba(20, 184, 166, 0.10); }
.pendaftaran-btn.is-open { background: rgba(46, 204, 113, 0.10); }
.pendaftaran-btn.is-closed { background: rgba(231, 76, 60, 0.10); }
.pendaftaran-btn.is-loading { background: rgba(148, 163, 184, 0.10); }

/* ★ Tombol Admin — glassy pill mengikuti header /portfolio */
.admin-badge {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    min-height: 34px;
    max-width: none;
    border-radius: 8px;
    border: 1px solid rgba(167, 139, 250, 0.45);
    background: rgba(167, 139, 250, 0.12);
    color: #fff;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .03em;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all .3s ease;
}
.admin-badge:hover {
    box-shadow: 0 0 22px rgba(167, 139, 250, 0.45);
}
/* Admin ON — hijau (seperti .auth-btn.logged-in di /portfolio) */
.admin-badge:not(.off) {
    border-color: rgba(52, 211, 153, 0.55);
    background: rgba(52, 211, 153, 0.16);
    box-shadow: 0 0 18px rgba(52, 211, 153, 0.25);
}
.admin-badge:not(.off):hover {
    box-shadow: 0 0 22px rgba(52, 211, 153, 0.5);
}
/* Admin OFF — ungu netral (seperti .btn-signin di /portfolio) */
.admin-badge.off {
    border-color: rgba(167, 139, 250, 0.45);
    background: rgba(167, 139, 250, 0.12);
    color: #fff;
}
.admin-badge.off:hover {
    box-shadow: 0 0 22px rgba(167, 139, 250, 0.45);
}
/* ★ Ikon Bootstrap di tombol Sign in / Sign out (mengikuti pola tombol auth /portfolio) */
.admin-badge .admin-badge-icon {
    margin-right: 8px;
    font-size: 1.05em;
    line-height: 1;
}

#adminToolsSection { display: none; }
#adminToolsSection.admin-visible { display: block; }

.device-info {
    background: rgba(255, 152, 0, 0.10);
    color: #ffb74d;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

/* Navbar dan seluruh state nav-link menggunakan aturan bersama dari /assets/css/navbar.css. */

@media (max-width: 480px) {
    /* --- TAMPILAN RESPONSIF DI HP --- */
    .play-btn-row button {
        padding: 9px 13px;
        font-size: 12px;
    }
    .modal-content {
        margin: 40px auto;
    }
    .modal-header-winner,
    .modal-header-box1,
    .modal-header-box2,
    .modal-header-box3 {
        font-size: 20px;
    }
    .winner-name {
        font-size: 34px;
    }
}
