body {
  font-family: 'Noto Sans KR', sans-serif;
  background: #0f1724;
  color: #e5e7eb;
  margin: 0;
  box-sizing: border-box;
}

header {
  background: #0b1220;
  padding: 1rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  border-bottom: 2px solid #3b82f6;
}

header h1 {
  margin: 0;
  font-size: 2rem;
  color: #e5e7eb;
}

.social-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.social-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
}

.social-btn:hover.youtube { color: #FF0000; }
.social-btn:hover.discord { color: #5865F2; }
.social-btn:hover.english { color: #3ffdae; }
.social-btn:hover:not(.youtube):not(.discord) { color: #3b82f6; }

.filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: -0.5rem;
}

.filters select, #search {
  background: #1a2333;
  color: #e5e7eb;
  border: 1px solid #3b82f6;
  border-radius: 0.3rem;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}

#addon-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 2rem;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #1a2333;
  padding: 1rem;
  border-radius: 1rem;
  cursor: pointer;
  transition: 0.2s;
  max-width: 400px;
  margin: 0 auto;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0.5rem;
  margin-bottom: 0.8rem;
}

.card h3, .card p { margin: 0.2rem 0; text-align: center; }

.tags {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  background: #3b82f6;
  color: #fff;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 0.5rem;
}

/* 모달 */
.modal {
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  opacity: 0;
  pointer-events: none; /* 닫힌 상태에서 클릭 방지 */
  transition: opacity 0.3s ease;
}

.modal.show {
  opacity: 1;
  pointer-events: auto; /* 열린 상태에서 클릭 가능 */
}

.modal-content {
  background: #1a2333;
  margin: 10% auto;
  padding: 2rem;
  border-radius: 1rem;
  max-width: 400px;
  text-align: center;
  position: relative;
  color: #e5e7eb;
  transform: translateY(-30px);
  transition: transform 0.3s ease;
}

.modal.show .modal-content {
  transform: translateY(0);
}

/* 닫기 버튼 */
#modal-close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-content img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

/* 모달 제목/버전 */
.modal-content h3 {
  margin: 0.5rem 0;
}

.modal-content p {
  margin: 0.3rem 0;
  font-size: 0.95rem;
}

/* 다운로드 버튼 */
#modal-download button,
#modal-custom-container button {
  width: 100%;
  border: none;
  color: white;
  padding: 0.8rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 0.5rem;
  transition: 0.2s;
}

#modal-download button { background: #3b82f6; }
#modal-download button:hover { background: #2563eb; }

#modal-custom-container button { background: #10b981; }
#modal-custom-container button:hover { background: #059669; }

/* 푸터 */
.footer {
  text-align: center;
  padding: 1rem;
  background-color: #0f1724;
  color: #fff;
  font-size: 0.9rem;
  margin-top: 2rem;
}

/* 데스크탑 그리드 */
@media screen and (min-width: 768px) {
  #addon-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
    padding: 2rem;
  }

  .card { width: 380px; margin: 0 auto; }
  .card img { width: 360px; height: 200px; }

  .modal-content { width: 420px; max-width: 420px; margin: 8% auto; }
  .modal-content img { height: 220px; }
}

/* 모바일 */
@media screen and (max-width: 500px) {
  header {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  header h1 {
    text-align: center;
    font-size: 1.8rem;
  }

  .social-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    order: 1; /* 제목 다음 */
  }

  .social-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  .filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    order: 2; /* 소셜 버튼 다음 */
  }

  .filters select, #search {
    width: 90%;
    max-width: 300px;
  }

  .tags {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: nowrap;  /* 무조건 한 줄 */
    overflow-x: auto;   /* 넘치면 스크롤 */
  }

  .tag {
    flex: 0 0 calc((100% - 1rem) / 3); /* 한 줄에 3개 */
    text-align: center;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

    #addon-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    align-items: center; /* 가운데 정렬 */
  }

  .card {
    width: 90%;          /* 모바일 화면에 맞게 고정 */
    max-width: 400px;
    margin: 0 auto;
  }

  .card img {
    width: 100%;        /* 카드 너비에 맞춤 */
    height: 200px;      /* 높이 고정 */
    object-fit: cover;  /* 비율 유지하며 잘림 */
    border-radius: 0.5rem;
  }
}
