/* พื้นฐานของหน้าเว็บ */
body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  margin: 0;
  padding: 0;
}

/* แถบนำทาง */
nav ul {
  display: flex;
  background-color: #333;
  padding: 10px;
  list-style: none;
  justify-content: center;
}

nav ul li {
  margin-right: 15px;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

nav ul li a:hover {
  text-decoration: underline;
}

/* ช่องค้นหา */
#searchInput {
  margin: 20px auto;
  padding: 10px;
  width: 80%;
  border: 1px solid #ccc;
  border-radius: 5px;
  display: block;
}

/* ตัวกรอง */
#filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

/* ปุ่มกรอง */
.filter-btn {
  background-color: #444;
  border: none;
  border-radius: 10px;
  margin: 5px;
  cursor: pointer;
  width: 60px;
  height: 60px;
  transition: background-color 0.3s, transform 0.2s, opacity 0.3s;
}

.filter-btn.selected {
  background-color: #222;
  opacity: 1;
}

.filter-btn:hover {
  background-color: #555;
  transform: scale(1.1);
}

.filter-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}


.filter-btn.selected img {
  opacity: 1;
}

/* ปุ่มกรองระดับดาว */
.filter-btn.rarity {
  width: 80px;
  height: 80px;
  font-size: 24px;
  color: white;
  background-color: #444;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.filter-btn.rarity.selected {
  background-color: #222;
}

.filter-btn.rarity:hover {
  background-color: #555;
  transform: scale(1.1);
}

/* การ์ดตัวละคร */
#characterGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  padding: 20px;
}

.character-card {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  width: 180px;
  text-align: center;
  padding: 10px;
  transition: transform 0.2s;
}

.character-card:hover {
  transform: scale(1.05);
}

.character-card img {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

/* ไอคอนของตัวละคร */
.icons {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
}

.icons img {
  width: 30px;
  height: 30px;
  object-fit: cover;
}

/* ป๊อปอัป */
.popup.hidden {
  display: none;
}

/* ป๊อปอัป */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 15px; /* ลด padding รอบป๊อปอัป */
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  width: 300px;  /* เพิ่มความกว้างให้พอดีกับการแบ่ง */
  height: 500px;
}

/* เนื้อหาป๊อปอัป */
.popup-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px; /* ลดช่องว่างระหว่างองค์ประกอบ */
  padding: 10px;
}

.character-popup-image {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 5px; /* ลดช่องว่างใต้รูป */
}

/* การจัดกลุ่ม Slider */
.slider-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 5px 0; /* จาก 15px เหลือ 5px */
}

.command-display {
  background-color: #d3d3d3;
  padding: 5px;
  border-radius: 5px;
  width: 100%;
  text-align: center;
}



.close-btn {
  position: absolute;
  top: 5px;
  right: 10px;
  font-size: 36px;
  cursor: pointer;
}

.command-display {
  background-color: #d3d3d3;
  padding: 5px;
  border-radius: 5px;
  margin-top: 10px;
  text-align: center;
}
/* การจัดกลุ่ม Slider */
.slider-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 5px 0; /* จาก 15px เหลือ 5px */
}

.slider-group label {
  margin-bottom: 3px;
}

.slider-group input {
  margin-top: 2px;
}

.command-display {
  margin: 5px 0;
  padding: 5px 10px;
  font-size: 13px;
  line-height: 1.3;
}
/* ปุ่มกรองระดับดาวเมื่อถูกเลือก */
.filter-btn.rarity.selected {
  color: gold; /* เปลี่ยนสีตัวอักษรเป็นทอง */
  font-weight: bold; /* ทำให้ตัวอักษรหนาขึ้น */
  background-color: #333; /* เพิ่มความแตกต่างให้ชัดเจน */
}
/* ปรับแต่งสำหรับอุปกรณ์เล็ก */
@media (max-width: 600px) {
  .container {
    padding: 10px;
  }

  nav ul {
    flex-direction: column;
    text-align: center;
  }

  nav ul li {
    margin-bottom: 10px;
  }

  h1, h2, p {
    font-size: 14px;
  }
}