/* ปรับความสูงและสไตล์ของ Select2 ให้เหมือน .form-select */
.select2-container--default .select2-selection--single {
    height: 38px !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem !important;
    box-sizing: border-box;
}
/* จัดข้อความ Select2 ให้อยู่กลาง */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 26px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
/* ปรับลูกศร dropdown */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
    top: 0 !important;
}

/* แก้ความสูงสำหรับ Theme Bootstrap-5 ของ Select2 ถ้าใช้ */
.select2-container--bootstrap-5 .select2-selection--single {
    height: 38px !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    border-radius: 0.375rem !important;
}

/* card-box สไตล์ */
.card-box {
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 10px;
    width: 290px;
    display: inline-block;
    box-shadow: 0 0 8px rgba(0,0,0,0.15);
}
.card-info {
    font-weight: 600;
    margin-top: 8px;
    font-size: 1rem;
    line-height: 1.2;
}

/* พื้นหลังสนามประลอง */
.bg-arena {
    background-size: cover;
    background-position: center;
    min-height: 90vh;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
@media (max-width: 576px) {
    .bg-arena { padding: 10px 0; }
}

/* ผลลัพธ์การต่อสู้ */
#battle_result {
    font-weight: bold;
    font-size: 1.4rem;
    margin-top: 10px;
    padding: 8px 16px;
    border-radius: 10px;
    color: #fff;
    min-width: 150px;
    text-align: center;
    user-select: none;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease;
}
.result-win {
    background: linear-gradient(45deg, #f6d365, #fda085);
    box-shadow: 0 0 15px #fda085;
}
.result-lose {
    background: linear-gradient(45deg, #f85032, #e73827);
    box-shadow: 0 0 15px #e73827;
}
.result-draw {
    background: linear-gradient(45deg, #a1c4fd, #c2e9fb);
    color: #333;
    box-shadow: 0 0 15px #c2e9fb;
}

/* เว้นขอบการ์ด */
.card-container {
    padding: 0 10px;
    box-sizing: border-box;
}
@media (max-width: 600px) {
    .card-container { padding: 0 15px; }
}
.card-img-wrapper {
  width: 100%;
  height: 230px;             /* ปรับให้ตรงกับ max-width ของ .card-area img */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}
.card-img-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;       /* หรือ object-fit: cover; ตามสไตล์ */
}
/* table style ส่วนของ summaryTable & summaryTablereport */
#summaryTable, #summaryTablereport {
    border-collapse: collapse;
    width: 100%;
}
#summaryTable { font-size: 12px; }
#summaryTablereport { font-size: 12px; table-layout: auto !important; }
#summaryTablereport td { padding: 5px; }
#summaryTable th, #summaryTablereport th {
    background-color: #4CAF50;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1;
}
#summaryTable td, #summaryTablereport td {
    background-color: #fff;
    color: #333;
    border: 1px solid #000;
}
#summaryTablereport tbody td:nth-last-child(-n+3) {
    background-color: #eaf8e1;
    font-weight: bold;
}
#summaryTablereport tr:nth-child(even) {
    background-color: #f9f9f9;
}
#summaryTable tr:hover, #summaryTablereport tr:hover {
    background-color: #f1f1f1;
}
/* จัดให้คอลัมน์ที่ 2 ชิดกลาง */
#summaryTablereport thead th:nth-child(2),
#summaryTablereport th:nth-child(2) {
    text-align: center !important;
}

/* ปุ่ม DataTables */
.dt-button.buttons-copy { background-color: #4CAF50 !important; color: white !important; }
.dt-button.buttons-excel { background-color: #FF9800 !important; color: white !important; }
.dt-button.buttons-print { background-color: #2196F3 !important; color: white !important; }
.dt-buttons .btn { margin-right: 5px; }

/* ปุ่ม approve/reject */
.approve { background-color: #28a745; color: white; }
.approve:hover { background-color: #218838; }
.reject { background-color: #dc3545; color: white; }
.reject:hover { background-color: #c82333; }

/* อื่น ๆ */
td[contenteditable="true"] { background-color: #ffffcc; }
.table-container { margin-top: 30px; }
.btn-container { margin-bottom: 20px; }
.dropdown-item:hover { background-color: #d4edda; color: #155724; }
form { display: inline-block; }
.highlight-row { background-color: #ffff99 !important; }
.top-area { display: flex; justify-content: space-between; margin-bottom: 5px; }
.dataTables_length, .dataTables_filter { margin-bottom: 0; }
.card-primary { padding: 10px; }
