/* --- ห้อง Event & พื้นหลัง --- */
.event-chamber {
    background: radial-gradient(circle, #a2e8ff 0%, #759eff 100%);
    border: 5px solid #ffffff;
    border-radius: 30px;
    padding: 50px 20px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    max-width: 800px;
    margin: 40px auto;
}


/* --- ลูกเต๋า D20 จำลอง --- */
.dice-container {
    perspective: 1000px;
    margin-bottom: 30px;
}

.d20 {
    width: 100px;
    height: 100px;
    background: #dc2626;
    margin: 0 auto;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    animation: roll 0.2s infinite linear; /* ลูกเต๋าหมุนติ้วๆ */
}

@keyframes roll {
    0% { transform: rotateY(0deg) rotateX(0deg); }
    100% { transform: rotateY(360deg) rotateX(360deg); }
}

/* --- ระบบสุ่มด้วย Checkbox/Radio (No JS) --- */
.event-trigger { display: none; }

/* เมื่อกด "หยุด" หรือ "สุ่ม" ให้หยุดอนิเมชั่นและโชว์ผลลัพธ์ */
#roll-btn:checked ~ .dice-container .d20 {
    animation-play-state: paused;
    background: #16a34a;
}

/* ส่วนแสดงผลลัพธ์เหตุการณ์ */
.event-result {
    display: none;
    margin-top: 30px;
    padding: 20px;
    border-radius: 15px;
    background: rgba(255,255,255,0.1);
    border: 2px dashed #fbbf24;
    animation: fadeIn 0.5s ease;
}

#roll-btn:checked ~ .event-result {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ปุ่มกดหน้าตาเหมือนปุ่มในเกม */
.roll-label {
    display: inline-block;
    padding: 15px 40px;
    background: #fbbf24;
    color: #000;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
}
.roll-label:hover { transform: scale(1.1); background: #fcd34d; }