/* ===== RESET & GLOBAL ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #fdfcfb 0%, #e2d1c3 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 620px;
    width: 100%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(6px);
    border-radius: 32px;
    padding: 32px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ===== JUDUL ===== */
h1 {
    font-size: 2.4rem;
    text-align: center;
    color: #1e293b;
    margin-bottom: 20px;
    letter-spacing: 1px;
    font-weight: 800;
}

/* ===== ATURAN (kertas/buku) ===== */
.rules-paper {
    background: #fef9f0;
    border-radius: 16px;
    padding: 20px 22px;
    margin-bottom: 24px;
    box-shadow: 0 4px 0 #d4c5b2, 0 8px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8ddd0;
    position: relative;
}

.rules-paper::before {
    content: "📜";
    position: absolute;
    top: -12px;
    right: 16px;
    font-size: 2rem;
    background: #fef9f0;
    padding: 0 8px;
    border-radius: 8px;
}

.rules-inner h2 {
    font-size: 1rem;
    color: #92400e;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.rules-inner ul {
    list-style: none;
    padding: 0;
    color: #3b2a1a;
    font-size: 0.88rem;
    line-height: 1.9;
}

.rules-inner ul li {
    padding-left: 20px;
    position: relative;
}

.rules-inner ul li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #f97316;
    font-weight: 700;
}

.rules-inner ul li strong {
    color: #b45309;
}

/* ===== PLAYER SECTION ===== */
.player-section {
    margin-bottom: 18px;
}

.player-section h2 {
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 10px;
    font-weight: 700;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.input-group input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 14px;
    border: 2px solid #e2d1c3;
    background: #fff;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
    color: #1e293b;
}

.input-group input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
}

.input-group button {
    padding: 12px 22px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.3s;
}

.input-group button:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.35);
}

.player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
    min-height: 32px;
}

.player-tag {
    background: linear-gradient(135deg, #fde68a, #fcd34d);
    color: #78350f;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid #fbbf24;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.player-tag .remove-btn {
    cursor: pointer;
    color: #b45309;
    font-weight: 800;
    font-size: 1rem;
    margin-left: 4px;
}

.player-count {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===== SPIN ===== */
.btn-spin {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 14px;
    letter-spacing: 0.5px;
}

.btn-spin:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.4);
}

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

/* ===== SPIN RESULT ===== */
.spin-result {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 16px;
    padding: 14px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #78350f;
    margin-bottom: 18px;
    border: 2px solid #fbbf24;
    animation: pop 0.6s ease;
}

@keyframes pop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    60% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== GAME HEADER ===== */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.turn-indicator {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    background: #dbeafe;
    padding: 6px 18px;
    border-radius: 30px;
    border: 2px solid #93c5fd;
}

.skip-counter {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    background: #fef3c7;
    padding: 6px 18px;
    border-radius: 30px;
    border: 2px solid #fcd34d;
}

.skip-counter span {
    color: #dc2626;
    font-weight: 800;
}

/* ===== TOMBOL ATURAN ===== */
.btn-rules {
    padding: 6px 16px;
    border: none;
    border-radius: 30px;
    background: #e2e8f0;
    color: #1e293b;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
}

.btn-rules:hover {
    background: #cbd5e1;
    transform: scale(1.03);
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.action-buttons button {
    flex: 1;
    padding: 14px 10px;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    color: #fff;
    letter-spacing: 0.5px;
}

.btn-truth {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 0 #1d4ed8;
}

.btn-truth:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.45);
}

.btn-dare {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 0 #b91c1c;
}

.btn-dare:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(239, 68, 68, 0.45);
}

.btn-skip {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 0 #b45309;
}

.btn-skip:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(245, 158, 11, 0.45);
}

.action-buttons button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== CARD ===== */
.card {
    background: #ffffff;
    border-radius: 20px;
    padding: 28px 20px;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border: 2px solid #e2e8f0;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card p {
    font-size: 1.15rem;
    line-height: 1.7;
    text-align: center;
    color: #0f172a;
    font-weight: 500;
}

.card .placeholder {
    color: #94a3b8;
    font-weight: 400;
    font-size: 0.95rem;
}

/* ===== NEXT BUTTON ===== */
.btn-next {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 12px;
}

.btn-next:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.35);
}

/* ===== RESET / SESI BARU ===== */
.btn-reset {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 16px;
    background: #e2e8f0;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.btn-reset:hover {
    background: #cbd5e1;
    transform: scale(1.02);
}

/* ===== MUSIC ===== */
.music-control {
    text-align: center;
    margin-top: 18px;
}

#musicToggleBtn {
    padding: 10px 28px;
    border: none;
    border-radius: 30px;
    background: #e2e8f0;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

#musicToggleBtn:hover {
    background: #cbd5e1;
    transform: scale(1.03);
}

/* ===== MODAL POP-UP ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    padding: 20px;
}

.modal-content {
    background: #fff;
    border-radius: 24px;
    max-width: 560px;
    width: 100%;
    padding: 30px 28px;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    0% {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 20px;
    font-size: 2rem;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    transition: 0.3s;
    line-height: 1;
}

.modal-close:hover {
    color: #1e293b;
    transform: rotate(90deg);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 500px) {
    .container {
        padding: 20px 16px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        padding: 14px;
    }

    .input-group {
        flex-direction: column;
    }

    .rules-inner ul {
        font-size: 0.8rem;
        line-height: 1.8;
    }

    .game-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .modal-content {
        padding: 24px 18px;
        margin: 16px;
    }
}