:root {
    --color-card-start: #83471b;
    --color-card-end: #ab5c10;
}

body {
    background-color: #24252b !important;
    color: white !important;
    font-family: 'Anuphan', sans-serif !important;
}

/* ---------------------- Desktop (Base) ---------------------- */
.character-block {
  max-width: calc((100% - 1.5rem) / 4);
}

.character-block-img {
  width: 100%;
  height: auto;
  overflow: hidden;
  background-position: center center; 
  background-repeat: no-repeat;     
  background-size: cover; 
  position: relative;
  background-image: url('https://raw.githubusercontent.com/kanjanaw/randomteam/main/src/images/bg/card-bg-5.png');
}

.character-block-img.rarity-4 {
  background-image: url('https://raw.githubusercontent.com/kanjanaw/randomteam/main/src/images/bg/card-bg-4.png');
}

.character-block-img.rarity-5 {
  background-image: url('https://raw.githubusercontent.com/kanjanaw/randomteam/main/src/images/bg/card-bg-5.png');
}

.name {
  background-color: white;
  color: black;
  text-align: center;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 4px 15px;
  width: 100%;
}

.elemental {
  width: 35px;
  height: 35px;
  position: absolute;
  left: 5px;
  top: 5px;
}

.character-selector {
  opacity: 0.3;
  width: 100%;
}

.character-selector:hover {
  cursor: pointer;
}

.character-selector .name {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.character-selector .elemental {
  width: 30px;
  height: 30px;
  position: absolute;
  left: 3px;
  top: 5px;
}

.btn-check:checked + .character-selector {
  opacity: 1;
}

.btn-checkbox-icon {
  border-radius: 0px !important;
  border-color: #484950 !important;
  background-color: #36373d !important;
  font-weight: bold;
  color: white;
}

.btn-checkbox-icon:hover {
  background-color: #5f6066 !important;
}

.btn-check:checked + .btn-checkbox-icon {
  background-color: #cd8de3 !important;
  color: white !important;
  border-color: none !important;
}

.text-purple {
  color: #c9aae9 !important;
}

.text-gold {
  color: #fddf49 !important;
}

.text-blue {
  color: #45d4ff !important;
}

.mr-1 {
  margin-right: 12px !important;
}

.img-element-icon {
  width: 28px;
  height: 28px;
}

.btn-check:checked + label.btn-checkbox-icon .img-element-icon {
  filter: brightness(0) invert(1);
}

.dropdown-menu {
  width: 100%;
  background-color: #36373d !important;
  border: 1px solid #484950 !important;
  color: white !important;
  border-radius: 0px !important;
}

#dropdownRegion {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #484950;
  border-radius: 0px;
  background-color: #36373d;
  height: 42px;
  text-align: start;
  position: relative;
  min-width: 300px;
}

#dropdownRegion:hover {
  background-color: #5f6066;
}

#dropdownRegion::after {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0;
}

.btn-purple {
  border-radius: 0px !important;
  border-color: #cd8de3 !important;
  color: #cd8de3 !important;
}

.btn-purple-white {
  border-radius: 0px !important;
  border-color: #cd8de3 !important;
  color: white !important;
  background-color: #cd8de3 !important;
  padding: 10px 15px !important;
}

.btn-purple-white:hover {
  background-color: rgb(218, 157, 239) !important;
}

.btn-purple:hover, .btn-purple:visited, .btn-purple:active, .btn-purple.selected {
  background-color: #cd8de3 !important;
  color: white !important;
}

.form-check-input:checked {
  background-color: #cd8de3 !important;
  border-color: #cd8de3 !important;
}

.form-check-input:focus {
  box-shadow: 0 0 0 .25rem rgba(205, 141, 227, .25) !important;
  border-color: #cd8de3 !important;
}

.form-switch .form-check-input:focus {
    --bs-form-switch-bg: url(data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='#cd8de3'/%3e%3c/svg%3e);
}

.row-cols-10 > * {
  flex: 0 0 10% !important;
  width: 10% !important;
}

.g-2 {
  --bs-gutter-y: 0.5rem !important;
  --bs-gutter-x: 0.5rem !important;
}

.h6, h6 {
  font-size: 1rem !important;
}

.h4, h4 {
  font-size: 1.5rem !important;
}

.filters-container {
  gap: 0px;
}

/* ---------------------- Tablet (≤1199px) ---------------------- */
@media (max-width: 1199px) {
  .row-cols-10 > * {
    flex: 0 0 12.5% !important;
    width: 12.5% !important;
  }

  #dropdownRegion {
    min-width: 200px;
  }
}

/* ---------------------- Mobile (≤575px) ---------------------- */
@media (max-width: 575px) {
  .row-cols-10 > * {
    flex: 0 0 20% !important;
    width: 20% !important;
  }

  .name {
    font-size: 0.8rem;
    padding: 3px 8px;
  }

  .character-selector .name {
    font-size: 0.6rem;
  }

  .character-selector .elemental {
    width: 20px;
    height: 20px;
    left: 2px;
    top: 3px;
  }

  .g-2 {
    --bs-gutter-y: 0.3rem !important;
    --bs-gutter-x: 0.3rem !important;
  }

  .h6 {
    font-size: 0.95rem !important;
  }

  .h4, h4 {
    font-size: 1.4rem !important;
  }

  .mr-1 {
    margin-right: 0px !important;
  }

  #dropdownRegion {
    min-width: 180px;
  }

  .filters-container {
    gap: 10px; /* เพิ่ม gap-y 10px บนมือถือ */
  }
  .g-5 {
    --bs-gutter-y: 2rem !important;
    --bs-gutter-x: 2rem !important;
  }
  .elemental {
    width: 28px;
    height: 28px;
    position: absolute;
    left: 3px;
    top: 3px;
  }
}
