:root {
  --green: #1aff4c;
  --bg: #08140d;
  --card: #0f1f16;
  --border: rgba(26, 255, 76, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at top, rgba(20, 24, 22, 0.12), transparent),
    var(--bg);
  color: white;
  font-family: "Segoe UI", sans-serif;
  overflow-x: hidden;
}

/* ================= HERO ================= */
.hero {
  position: relative;
  min-height: 320px;
  background: url("../img/member-list.png") center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  /* backdrop-filter: blur(6px); */
}

.hero-overlay {
  position: relative;
  text-align: center;
  color: white;
  z-index: 2;
}

.hero-overlay h1 {
  font-size: 48px;
  color: var(--green);
}

.hero-overlay p {
  margin-top: 10px;
  color: #ccc;
}

/* ================= MEMBER SECTION ================= */
.member-section {
  padding: 20px;
  max-width: 1300px;
  margin: auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 10px;
  background: #0f1f16;
  border: 1px solid rgba(26, 255, 76, 0.15);
  color: var(--green);
  font-weight: bold;
}

/* FILTER */
.filter-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0f1f16;
  color: #aaa;
  cursor: pointer;
  transition: 0.3s;
}

.filter-btn i {
  font-size: 14px;
}

/* ACTIVE STATE */
.filter-btn.active {
  color: black;
  box-shadow: 0 0 15px rgba(26, 255, 76, 0.3);
}

.filter-btn:hover {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 10px rgba(26, 255, 76, 0.2);
}

.filter-btn.active {
  background: var(--green);
  color: black;
  box-shadow: 0 0 15px var(--green);
}

/* SEARCH */
.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--green);
}

.search-box input {
  width: 260px;
  padding: 12px 14px 12px 42px;
  border-radius: 10px;
  border: 1px solid rgba(26, 255, 76, 0.15);
  background: #0f1f16;
  color: white;
  outline: none;
}

/* ================= TABLE ================= */
.table-wrapper {
  margin-bottom: 8px;
  overflow-x: auto;
  border-radius: 18px;
  background: #0d1f16;
  border: 1px solid rgba(26, 255, 76, 0.15);
  box-shadow: 0 0 20px rgba(26, 255, 76, 0.08);
}

.member-table {
  width: 100%;
  border-collapse: collapse;
}

.member-table thead {
  background: rgba(26, 255, 76, 0.08);
}

.member-table th {
  padding: 18px;
  text-align: left;
  color: var(--green);
  font-size: 13px;
  letter-spacing: 1px;
}

.member-table td {
  padding: 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.member-row:hover {
  background: rgba(26, 255, 76, 0.05);
}

/* MEMBER CELL */
.member-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(26, 255, 76, 0.25);
  box-shadow: 0 0 15px rgba(26, 255, 76, 0.15);
}

.member-ign {
  font-size: 16px;
  font-weight: bold;
  color: white;
}

/* POSITION */
.position-badge {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(26, 255, 76, 0.08);
  border: 1px solid rgba(26, 255, 76, 0.15);
  color: var(--green);
  font-size: 12px;
  font-weight: bold;
}

/* BUTTON */
.view-btn {
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(26, 255, 76, 0.15);
  background: #0f1f16;
  color: var(--green);
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s ease;
}

.view-btn:hover {
  background: var(--green);
  color: black;
  box-shadow: 0 0 15px var(--green);
}

/* ================= MODAL ================= */
.modal {
  position: fixed;
  inset: 0;

  /* BLUR BACKGROUND */
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  display: none;
  align-items: center;
  justify-content: center;

  padding: 20px;
  z-index: 999;
}

.modal.active {
  display: flex;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 1200px;

  background: linear-gradient(135deg,
      rgba(26, 255, 76, 0.08),
      rgba(0, 0, 0, 0.4));

  border-radius: 20px;

  overflow: hidden;

  box-shadow: 0 0 50px rgba(26, 255, 76, 0.15);

  max-height: 90vh;
}

/* LEFT */
.profile-left {
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;

  min-width: 0;
  overflow: hidden;
}

.character-image {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  animation: characterSlideIn 0.6s ease-out;
}

@keyframes characterSlideIn {
  from {
    opacity: 0;
    transform: translateX(-60px) scale(0.95);
    filter: blur(8px);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}

/* RIGHT */
.profile-right {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;

  overflow-y: auto;
  max-height: 90vh;
}

/* HEADER */
.profile-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.profile-rank {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-direction: column;
  justify-content: center;
}

.profile-rank h2 {
  font-size: 34px;
  color: var(--green);
}

.profile-rank h2 {
  font-size: 34px;
  color: var(--green);
  text-shadow: 0 0 10px rgba(26, 255, 76, 0.3);
}

.profile-position {
  color: #aaa;
  font-size: 14px;
}

.profile-rank img,
.profile-rank .rank-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 0 6px rgba(26, 255, 76, 0.35));
}

.profile-rank h2,
.member-ign,
.profile-position,
.member-role {
  text-align: center;
  width: 100%;
}

/* BIO */
.profile-bio {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(26, 255, 76, 0.12);
  color: #ccc;
  line-height: 1.6;
}

.bio-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--green);
  margin-bottom: 6px;
}

.bio-title i {
  font-size: 14px;
}

.bio-content {
  font-size: 13px;
  line-height: 1.6;
  color: #cfead6;
  opacity: 0.9;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  min-width: 0;
  max-height: 3.8em;
  overflow: hidden;
  transition: all 0.3s ease;
}

.bio-content.expanded {
  max-height: 500px;
}

.bio-toggle {
  margin-top: 6px;
  background: transparent;
  border: none;
  color: var(--green);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.bio-toggle:hover {
  text-decoration: underline;
}

/* INFO GRID */
.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.info-box span {
  font-size: 10px;
  color: #888;
}

.info-box strong {
  display: block;
  margin-top: 6px;
  color: var(--green);
  font-size: 16px;
}

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-card {
  padding: 14px;
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card span {
  font-size: 10px;
  color: #888;
}

.stat-card h3 {
  margin-top: 6px;
  color: var(--green);
}

.loss-value {
  color: #ff4d4d;
}

.victory-low {
  color: #ff4d4d;
}

.victory-high {
  color: var(--green);
}

.kd-low {
  color: #ff4d4d;
}

.kd-mid {
  color: var(--green);
}

.kd-high {
  color: gold;
}

/* BOTTOM */
.profile-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
  justify-items: center;
  align-items: stretch;
}

.profile-bottom>div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 140px;
}

/* WEAPON */
.weapon-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: none;
  justify-content: center;
  width: 100%;
}

.weapon-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.weapon-section span {
  font-size: 11px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.weapon-box strong {
  color: var(--green);
  font-size: 18px;
  font-weight: 600;
}

.weapon-desc {
  font-size: 12px;
  color: #aaa;
  margin-top: 4px;
}

.weapon-icons {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.weapon-icon-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
}

/* SOCIAL */
.social-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  min-height: 140px;
}

.social-section span {
  font-size: 11px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.social-links a {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 18px;

  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--green);
  transition: 0.3s ease;
}

.social-links a:hover {
  transform: translateY(-3px);
  background: var(--green);
  color: black;
}

/* CLOSE */
.close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 45px;
  height: 45px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--green);
  cursor: pointer;
  z-index: 9999;
  pointer-events: auto;
}

.member-role {
  font-size: 12px;
  color: #aaa;
  margin-top: 4px;
  font-weight: 400;
}

/* =========================
   PROFILE WRAPPER
========================= */

.profile-wrapper {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  width: 100%;
  height: 90vh;
}

.profile-left {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1;
  flex-direction: column;
  gap: 14px;
}

.profile-left .role-badge {
  order: 2;
  margin-top: -10px;
}

.profile-right {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.character-image {
  max-height: 520px;
  width: 100%;
  object-fit: contain;
  order: 1;
}

/* =========================
   ROLE BADGES
========================= */

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
  width: fit-content;
  border: 1px solid transparent;
}

/* MASTER */
.role-master {
  background: rgba(255, 215, 0, 0.12);
  color: gold;
  border-color: rgba(255, 215, 0, 0.3);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.15);
}

/* STAFF */
.role-staff {
  background: rgba(0, 170, 255, 0.12);
  color: #00aaff;
  border-color: rgba(0, 170, 255, 0.3);
  box-shadow: 0 0 10px rgba(0, 170, 255, 0.15);
}

/* MEMBER */
.role-member {
  background: rgba(26, 255, 76, 0.08);
  color: var(--green);
  border-color: rgba(26, 255, 76, 0.2);
}

/* PAGINATION */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.page-nav {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(26, 255, 76, 0.2);
  background: #0f1f16;
  color: var(--green);
  cursor: pointer;
  transition: 0.2s;
}

.page-nav:hover {
  background: var(--green);
  color: black;
}

.page-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-numbers {
  display: flex;
  gap: 6px;
}

.page-number {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(26, 255, 76, 0.15);
  background: #0f1f16;
  color: #ccc;
  cursor: pointer;
  transition: 0.2s;
}

.page-number:hover {
  border-color: var(--green);
  color: var(--green);
}

.page-number.active {
  background: var(--green);
  color: black;
  font-weight: bold;
}

img {
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

/* =========================
   SKELETON LOADING
========================= */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #0f1f16;
}

/* shimmer */
.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150px;
  width: 150px;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(26, 255, 76, 0.12),
      transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  100% {
    left: 100%;
  }
}

/* =========================
   TABLE SKELETON
========================= */
.skeleton-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-skeleton {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0f1f16;
}

.text-skeleton {
  height: 12px;
  border-radius: 4px;
  background: #0f1f16;
}

.button-skeleton {
  width: 90px;
  height: 28px;
  border-radius: 6px;
  background: #0f1f16;
}

.w-40 {
  width: 40px;
}

.w-60 {
  width: 60px;
}

/* =========================
   MODAL SKELETON
========================= */
.skeleton-character {
  width: 100%;
  height: 420px;
  border-radius: 12px;
  background: #0f1f16;
}

.skeleton-title {
  width: 60%;
  height: 28px;
  margin-bottom: 12px;
  background: #0f1f16;
}

.skeleton-bio {
  width: 100%;
  height: 60px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: #0f1f16;
}

.skeleton-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.skeleton-info-box {
  height: 60px;
  border-radius: 10px;
  background: #0f1f16;
}

.skeleton-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.skeleton-stat {
  height: 70px;
  border-radius: 10px;
  background: #0f1f16;
}

.skeleton {
  box-shadow: inset 0 0 0 1px rgba(26, 255, 76, 0.05);
}

/* =========================
   TABLET RESPONSIVE
========================= */
@media (max-width: 950px) {
  .hero {
    min-height: 260px;
    padding: 20px;
  }

  .hero-overlay h1 {
    font-size: 34px;
    line-height: 1.1;
  }

  .hero-overlay p {
    font-size: 14px;
  }

  .member-section {
    padding: 40px 14px;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-buttons {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  .filter-buttons::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    width: 100%;
  }

  /* TABLE */
  .member-table {
    min-width: 750px;
  }

  /* MODAL */
  .modal {
    padding: 12px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .modal-card {
    width: 100%;
    max-height: unset;
    overflow: visible;
    border-radius: 18px;
  }

  .profile-wrapper {
    grid-template-columns: 1fr;
    height: auto;
  }

  .profile-left {
    padding: 20px 20px 0;
  }

  .character-image {
    max-height: 320px;
  }

  .profile-right {
    padding: 20px;
    max-height: unset;
    overflow: visible;
  }

  .profile-rank h2 {
    font-size: 28px;
    line-height: 1.1;
    word-break: break-word;
  }

  .profile-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-bottom {
    grid-template-columns: 1fr;
  }

  .close-btn {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }
}

/* =========================
   MOBILE RESPONSIVE
========================= */
@media (max-width: 600px) {
  .hero {
    min-height: 220px;
  }

  .hero-overlay h1 {
    font-size: 26px;
  }

  .hero-overlay p {
    font-size: 13px;
    padding: 0 10px;
  }

  .section-title {
    width: 100%;
    justify-content: center;
    text-align: center;
    font-size: 14px;
  }

  .filter-buttons {
    gap: 8px;
  }

  .filter-btn {
    padding: 9px 12px;
    font-size: 12px;
  }

  .search-box input {
    height: 46px;
    font-size: 14px;
  }

  .table-wrapper {
    border-radius: 14px;
  }

  .member-table th {
    padding: 14px;
    font-size: 11px;
  }

  .member-table td {
    padding: 14px;
  }

  .member-info {
    gap: 10px;
  }

  .avatar {
    width: 44px;
    height: 44px;
  }

  .member-ign {
    font-size: 14px;
  }

  .member-role {
    font-size: 11px;
  }

  .position-badge {
    padding: 6px 10px;
    font-size: 10px;
  }

  .view-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  /* MODAL */
  .modal {
    padding: 0;
  }

  .modal-card {
    border-radius: 0;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .profile-left {
    padding: 20px 16px 0;
  }

  .character-image {
    max-height: 260px;
  }

  .profile-wrapper {
    width: 100%;
    overflow-x: hidden;
  }

  .profile-right {
    padding: 16px;
    gap: 14px;
    min-width: 0;
    width: 100%;
  }

  .profile-rank {
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
  }

  .profile-rank h2 {
    font-size: 22px;
  }

  .profile-position {
    font-size: 12px;
  }

  .profile-bio {
    padding: 14px;
    font-size: 13px;
  }

  .profile-info-grid {
    grid-template-columns: 1fr;
  }

  .profile-rank img,
  .profile-rank .rank-icon {
    width: 42px;
    height: 42px;
  }

  .profile-rank,
  .member-ign,
  .profile-position,
  .member-role {
    text-align: center;
    width: 100%;
    display: block;
  }

  .profile-header,
  .profile-rank {
    display: flex;
    flex-direction: column;
    align-items: center !important;
    justify-content: center;
    width: 100%;
  }

  .profile-rank h2,
  .member-ign,
  .profile-position,
  .member-role {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .profile-right {
    align-items: center;
  }


  .bio-content {
    font-size: 12px;
    line-height: 1.5;
    width: 100%;
    max-width: 100%;
  }


  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .stat-card {
    min-width: 0;
    word-break: break-word;
  }

  .info-box strong,
  .stat-card h3 {
    font-size: 15px;
  }

  .weapon-section {
    text-align: center;
  }

  .weapon-box {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .weapon-box strong {
    word-break: break-word;
    text-align: center;
  }

  .weapon-icon-img {
    width: 82px;
    height: 82px;
  }

  .weapon-desc {
    font-size: 13px;
  }

  .social-section {
    text-align: center;
  }

  .social-links {
    justify-content: center;
    width: 100%;
  }

  .social-links a {
    width: 38px;
    height: 38px;
  }

  .close-btn {
    top: 10px;
    right: 10px;
  }

  /* PAGINATION */
  .pagination {
    gap: 6px;
    flex-wrap: wrap;
  }

  .page-number,
  .page-nav {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }
}