





.biru-btn,
.ungu-btn,
.merah-btn {
color: #fff; border: none; padding: 12px 24px; font-size: 15px; font-weight: 700; border-radius: 12px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); letter-spacing: 0.3px;
}
.biru-btn {
background: linear-gradient(135deg, #2196f3 0%, #0d47a1 100%); box-shadow: 0 4px 16px rgba(33, 150, 243, 0.3);
}
.biru-btn:hover {
background: linear-gradient(135deg, #42a5f5 0%, #1565c0 100%); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(33, 150, 243, 0.5);
}
.ungu-btn {
background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%); box-shadow: 0 4px 16px rgba(140, 26, 255, 0.3);
}
.ungu-btn:hover {
background: linear-gradient(135deg, #a044ff 0%, #6a11cb 100%); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(140, 26, 255, 0.5);
}
.merah-btn {
background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}
.merah-btn:hover {
background: linear-gradient(135deg, #f87171 0%, #dc2626 100%); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5);
}
.btn-dashboard {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 5px auto;
    max-width: 500px;
    flex-wrap: wrap;
}

/* --- CANVAS RODA --- */
#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);
}

/* --- MODAL POPUP --- */
.modal {
    display: none;
    position: fixed;
    z-index: 5;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.4s;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-content {
    background: linear-gradient(135deg, #1d2671 0%, #c33764 150%);
    opacity: 0.95;
    margin: 100px auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    animation: slideIn 0.4s;
    position: relative;
    overflow: hidden;
	border: 2px solid rgba(212, 175, 55, 0.6);
}
@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-header {
    margin-top: 10px;
    text-align: center;
    color: #fff;
    font-weight: bold;
    font-size: 30px;
}
.modal-body {
    padding: 25px 15px;
    text-align: center;
}
.modal-footer {
    padding: 15px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==========================================
   ★ MODAL "PESERTA TERPILIH!" — ukuran kartu, padding, margin, dan ukuran
   huruf disamakan dengan modal "Peserta Terpilih!" di /online.
   (Hanya modal ini; modal Box tidak ikut berubah.)
   ========================================== */
#winnerModal .modal-content {
    width: 100%;
    border-radius: 10px;
}
#winnerModal .modal-header {
    margin-top: 0;
    padding: 10px;
    font-size: 26px;   /* ★ khusus modal Peserta Terpilih */
}
#winnerModal .modal-body {
    padding: 0;
}
#winnerModal .winner-name {
    font-size: 50px;
    margin: 0;
}
#winnerModal .modal-footer {
    padding: 0;
    margin: 15px 0;
    gap: 10px;
}

/* ==========================================
   ★ MODAL BOX — kartu, header, isi, dan footer disamakan dengan /online
   (ukuran, posisi, warna, tepi).
   ========================================== */
#boxModal .modal-content {
    width: 100%;
    border-radius: 10px;
    border-color: rgba(212, 175, 55, 0.8);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 42px rgba(124, 58, 237, 0.28);
}
#boxModal .modal-header {
    margin-top: 0;
    padding: 10px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 3px 3px 6px rgba(0, 0, 0, 0.6);
}
#boxModal .modal-body {
    padding: 0;
}
#boxModal .modal-footer {
    padding: 0;
    margin: 22px 0;
    gap: 10px;
    align-items: center;
}

/* --- PEMENANG --- */
.winner-name {
    font-size: 40px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 3px 3px 6px rgba(0, 0, 0, 0.8);
    margin: 10px 0 25px 0;
    word-break: break-word;
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* --- DESAIN 3D UNTUK 3 BOX MISTERI --- */
/* ==========================================
   ★ KOTAK MYSTERY — ukuran, posisi, warna, dan animasi disamakan dengan /online
   ========================================== */
.boxes-container {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding: 0 10px;
    box-sizing: border-box;
}
.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;
}
.mystery-box:hover: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.open {
    overflow: visible;
    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);
    animation: boxOpen 0.3s ease-out;
    cursor: default;
}
.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;
}
.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-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 yang
   sudah terbuka, klik dua kali lagi (atau tutup modal) untuk kembali semula. */
.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.box-red .box-title {
    color: #ffffff;
    text-shadow: none;
}

/* ★ Tombol hapus (pojok kanan atas) — gaya bulat sama seperti folder online */
.btn-delete-participant {
    position: absolute;
    top: -8px;
    right: -8px;
    margin-top: 0;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    padding: 0;
    background: #ff4b2b;
    color: #fff;
    border: none;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    z-index: 50;
}
.btn-delete-participant:hover {
    background: #ff1a1a;
    transform: scale(1.2);
}
.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;
    }
}
@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); }
}
@keyframes boxOpen {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
.confetti {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* --- TOMBOL CLOSE (netral) — ★ dibedakan dari tombol Hapus yang merah --- */
.close-btn {
    background: linear-gradient(135deg, #64748b 0%, #334155 100%);
    color: #fff;
    border: none;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.close-btn:hover {
    background: linear-gradient(135deg, #94a3b8 0%, #475569 100%);
    box-shadow: 0 6px 18px rgba(100, 116, 139, 0.55);
}

/* ★ Tombol di modal "Peserta Terpilih!" — Hapus (merah), Hapus Semua (ungu),
   Close (netral). Padding & radius disamakan dengan tombol Close. */
#winnerModal .modal-footer .merah-btn,
#winnerModal .modal-footer .ungu-btn {
    padding: 10px 24px;
    font-size: 15px;
    border-radius: 8px;
}

/* --- INPUT TEXTAREA --- */
.participant-input-container {
    width: 100%;
    max-width: 450px;
    margin: 5px auto;
    display: flex;
    flex-direction: column;
}
/* --- HEADER "DAFTAR PESERTA" (judul kiri, total kanan) --- */
.participant-input-container .participant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px 8px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #aab;
}
.participant-input-container .participant-header #totalParticipants {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}
.participant-input-container textarea#nameList {
    margin-top: -1px;
    width: 100%;
    height: 160px;
    padding: 12px;
    font-size: 15px;
    border-radius: 0 0 8px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #1e2638;
    color: #fff;
    resize: vertical;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.participant-input-container textarea#nameList:focus {
    outline: none;
    border-color: rgba(211, 211, 214, 0.5);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(167, 139, 250, 0.10);
}
.participant-input-container textarea#nameList::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.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.1);
    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;
}
/* ★ Sama PERSIS dengan /online: slider BAWAAN browser (tanpa -webkit-appearance
   dan tanpa thumb custom), tinggi 8px + radius 5px — sama seperti
   `input[type="range"].slider-input` di online.css.
   Aturan thumb lama (14px putih + glow biru) dan gradasi progres DIHAPUS supaya
   ukuran & tampilannya identik dengan /online. */
input[type="range"].slider-input {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

/* ==========================================
   NAVBAR (TEMA BACKGROUND)
   ========================================== */
.praya-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(10, 10, 15, 0.55);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.praya-nav .brand {
    flex: 0 0 auto;
    font-size: 1.7rem;
    line-height: 1.5;
    font-weight: 700;
    letter-spacing: .02em;
    text-decoration: none;
    background: linear-gradient(90deg, #a78bfa, #22d3ee, #f472b6, #a78bfa);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: brandShimmer 6s linear infinite;
    filter: drop-shadow(0 0 12px rgba(167, 139, 250, 0.35));
}
@keyframes brandShimmer {
    to { background-position: 300% 0; }
}
.praya-nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}
@media (max-width: 480px) {
    .praya-nav { padding: 8px 12px; }
    .praya-nav .brand { font-size: 1.4rem; }

    /* --- RODA RESPONSIF DI HP --- */
    .w3-center {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    .biru-btn,
    .ungu-btn,
    .merah-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    .modal-content {
        margin: 40px auto;
    }
    .modal-header {
        font-size: 22px;
    }
    #winnerModal .modal-header {   /* ★ khusus modal Peserta Terpilih */
        font-size: 20px;
    }
    .winner-name {
        font-size: 30px;
    }
    #winnerModal .winner-name {
        font-size: 34px;
    }

    /* ★ Tombol modal Peserta Terpilih: kecilkan supaya 3 tombol tetap muat */
    #winnerModal .modal-footer .merah-btn,
    #winnerModal .modal-footer .ungu-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
}
