/* =========================================================
 * Member page - dark fire theme (same palette as auth.css)
 * Needs auth.css loaded first (uses its --auth-* tokens via .auth-page).
 * All classes are km-* so nothing else on the site changes.
 * ======================================================= */

.km-card {
  max-width: 1040px;
}

/* ---------- header ---------- */

.km-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 26px 28px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: radial-gradient(520px 160px at 0% 0%, rgba(255, 140, 40, .16), transparent 75%);
}

.km-head__icon {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: #2a0a02;
  background: linear-gradient(180deg, #ffe08a 0%, #f5a547 55%, #e07325 100%);
  box-shadow: 0 0 0 3px rgba(255, 211, 107, .18), 0 0 22px rgba(255, 122, 26, .35);
}

.km-head__title {
  margin: 0;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 600;
  line-height: 1.25;
  color: var(--auth-ink);
  word-break: break-word;
}

.km-head__title b {
  background: linear-gradient(180deg, #fff3cf 0%, var(--auth-gold) 45%, var(--auth-line-hot) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.km-head__sub {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--auth-muted);
}

.km-body {
  padding: 18px 28px 28px;
}

/* ---------- tabs ---------- */

.km-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 22px;
  padding: 6px;
  list-style: none;
  border-radius: 14px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--auth-line);
  overflow-x: auto;
  scrollbar-width: none;
}

.km-tabs::-webkit-scrollbar {
  display: none;
}

.km-tabs .nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  color: var(--auth-muted);
  font-size: 14.5px;
  font-weight: 500;
  background: transparent;
  transition: color .15s ease, background .15s ease;
}

.km-tabs .nav-link i {
  color: #a8662d;
  transition: color .15s ease;
}

.km-tabs .nav-link:hover {
  color: var(--auth-ink);
  background: rgba(255, 255, 255, .04);
}

.km-tabs .nav-link.active {
  color: #2a0a02;
  background: linear-gradient(180deg, #ffe08a 0%, #f5a547 55%, #e07325 100%);
  box-shadow: 0 4px 14px rgba(224, 115, 37, .35);
}

.km-tabs .nav-link.active i {
  color: #2a0a02;
}

/* ---------- section title ---------- */

.km-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 14px;
  padding-left: 12px;
  border-left: 3px solid var(--auth-line-hot);
  font-size: 17px;
  font-weight: 600;
  color: var(--auth-ink);
}

.km-title .en {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--auth-muted);
}

.km-section + .km-section {
  margin-top: 28px;
}

/* ---------- stat tiles ---------- */

.km-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 991.98px) {
  .km-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .km-stats {
    grid-template-columns: minmax(0, 1fr);
  }
}

.km-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--auth-field);
  border: 1px solid var(--auth-line);
  transition: border-color .15s ease, box-shadow .2s ease;
}

.km-stat:hover {
  border-color: #6b2a0e;
  box-shadow: 0 0 14px rgba(255, 122, 26, .12);
}

.km-stat > i {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--auth-gold);
  background: rgba(217, 136, 61, .12);
  border: 1px solid rgba(217, 136, 61, .25);
}

.km-stat__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.km-stat__label {
  font-size: 12.5px;
  color: var(--auth-muted);
}

.km-stat__value {
  font-size: 17px;
  font-weight: 600;
  color: var(--auth-ink);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- member rank ---------- */

.km-rank {
  position: relative;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--auth-line);
  background:
    radial-gradient(600px 180px at 100% 0%, rgba(255, 122, 26, .12), transparent 70%),
    linear-gradient(160deg, rgba(58, 20, 6, .7) 0%, rgba(18, 1, 0, .7) 100%);
  overflow: hidden;
}

.km-rank__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.km-rank__lv {
  display: flex;
  align-items: center;
  gap: 14px;
}

.km-rank__badge {
  position: relative;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 26px;
  font-weight: 700;
  color: #2a0a02;
  background: linear-gradient(180deg, #ffe08a 0%, #f5a547 55%, #e07325 100%);
  box-shadow: 0 0 0 4px rgba(255, 211, 107, .15), 0 0 26px rgba(255, 122, 26, .4);
}

.km-rank__badge.is-zero {
  color: var(--auth-muted);
  background: linear-gradient(180deg, #3a1a0e 0%, #2a1008 100%);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .04);
}

.km-rank__lv-label {
  display: block;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--auth-muted);
}

.km-rank__lv-name {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: var(--auth-ink);
}

.km-rank__pt {
  text-align: right;
}

.km-rank__pt-num {
  display: block;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--auth-gold);
  font-variant-numeric: tabular-nums;
}

.km-rank__pt-label {
  font-size: 12.5px;
  color: var(--auth-muted);
}

.km-rank__bar {
  height: 10px;
  margin: 18px 0 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .06);
  overflow: hidden;
}

.km-rank__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e07325 0%, #f5a547 60%, #ffe08a 100%);
  box-shadow: 0 0 12px rgba(255, 140, 40, .55);
}

.km-rank__next {
  margin: 0;
  font-size: 14px;
  color: #d8c4b2;
}

.km-rank__next strong {
  color: var(--auth-gold);
}

.km-rank__perk {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(255, 255, 255, .06);
  border-left: 3px solid var(--auth-line-hot);
}

.km-rank__perk-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--auth-muted);
}

.km-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.km-perks li {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: #ffe9c2;
  background: rgba(217, 136, 61, .14);
  border: 1px solid rgba(217, 136, 61, .3);
}

.km-perks--none li {
  color: var(--auth-muted);
  background: transparent;
  border-style: dashed;
}

.km-rank__note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--auth-muted);
}

.km-rank__note i {
  color: var(--auth-line-hot);
}

.km-btn-ghost {
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--auth-gold);
  background: transparent;
  border: 1px solid #6b2a0e;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.km-btn-ghost:hover,
.km-btn-ghost:focus-visible {
  border-color: var(--auth-line-hot);
  background: rgba(217, 136, 61, .08);
  outline: none;
}

/* level table */
.km-table {
  width: 100%;
  margin-top: 14px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  overflow: hidden;
}

.km-table th {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--auth-muted);
  background: rgba(0, 0, 0, .45);
  white-space: nowrap;
}

.km-table td {
  padding: 10px 12px;
  color: #d8c4b2;
  border-top: 1px solid rgba(255, 255, 255, .05);
  vertical-align: top;
}

.km-table td.num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.km-table tr.is-current td {
  color: #fff3cf;
  background: rgba(255, 122, 26, .12);
}

.km-table tr.is-current td:first-child {
  box-shadow: inset 3px 0 0 var(--auth-line-hot);
}

/* ---------- characters ---------- */

/* Swiper's own CSS gives the wrapper height:100%, which here resolved against
   the page and stretched every card to ~1400px. Let it size to the cards. */
.km-chars .swiper-wrapper {
  height: auto;
}

.km-chars .swiper-slide {
  height: auto;
}

.km-char {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--auth-line);
  background: linear-gradient(170deg, #2a0c06 0%, #120100 100%);
}

.km-char__head {
  position: relative;
  padding: 16px 16px 12px;
  text-align: center;
  background: radial-gradient(220px 120px at 50% 80%, rgba(255, 122, 26, .2), transparent 70%);
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.km-char__job {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #2a0a02;
  background: linear-gradient(180deg, #ffe08a 0%, #f5a547 100%);
}

.km-char__avatar {
  height: 110px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.km-char__avatar img {
  max-height: 100%;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .6));
}

.km-char__name {
  margin: 8px 0 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--auth-ink);
  word-break: break-word;
}

.km-char__rows {
  flex: 1;
  padding: 10px 16px;
}

.km-char__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px dashed rgba(255, 255, 255, .06);
}

.km-char__row:last-child {
  border-bottom: 0;
}

.km-char__row .k {
  color: var(--auth-muted);
}

.km-char__row .v {
  color: var(--auth-ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.km-char__row .v.zeny {
  color: var(--auth-gold);
}

.km-char__foot {
  padding: 10px 16px 14px;
  text-align: center;
}

.km-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--auth-muted);
  background: rgba(0, 0, 0, .4);
  border: 1px solid rgba(255, 255, 255, .08);
}

.km-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b5a4e;
}

.km-status.is-online {
  color: #8ff0b0;
  border-color: rgba(60, 200, 120, .35);
}

.km-status.is-online .km-status__dot {
  background: #3cd27a;
  box-shadow: 0 0 8px #3cd27a;
}

.km-chars .swiper-pagination-bullet {
  background: #6b2a0e;
  opacity: 1;
}

.km-chars .swiper-pagination-bullet-active {
  background: var(--auth-gold);
}

.km-chars .swiper-button-prev,
.km-chars .swiper-button-next {
  color: var(--auth-gold);
}

.km-chars .swiper {
  padding-bottom: 34px;
}

.km-empty {
  padding: 18px;
  text-align: center;
  border-radius: 12px;
  color: var(--auth-muted);
  border: 1px dashed var(--auth-line);
}

/* ---------- forms inside tabs ---------- */

.km-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 14px;
}

.km-form-grid > .full {
  grid-column: 1 / -1;
}

@media (max-width: 767.98px) {
  .km-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.km-note {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  color: #e9cfae;
  background: rgba(255, 170, 60, .07);
  border: 1px solid rgba(255, 170, 60, .2);
}

.km-note i {
  color: var(--auth-gold);
}

.km-select {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 12px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--auth-ink);
  font-family: inherit;
  font-size: 15px;
  color-scheme: dark;
  cursor: pointer;
}

.km-select option {
  background: #1d0603;
  color: var(--auth-ink);
}

.km-pay-history {
  margin-top: 18px;
  color: #d8c4b2;
}

.km-pay-history .table {
  --bs-table-bg: transparent;
  --bs-table-color: #d8c4b2;
  --bs-table-border-color: rgba(255, 255, 255, .08);
}

/* ---------- logout ---------- */

.km-logout {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.btn-auth.km-btn-danger {
  color: #fff;
  background: linear-gradient(180deg, #c8402c 0%, #8e1f12 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .25) inset,
    0 8px 22px rgba(156, 17, 17, .35);
}

.btn-auth.km-btn-danger:hover:not(:disabled) {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .25) inset,
    0 12px 28px rgba(200, 40, 30, .45);
}

@media (max-width: 575.98px) {
  .km-head {
    padding: 20px 18px 16px;
  }

  .km-body {
    padding: 14px 16px 22px;
  }

  .km-rank__pt {
    text-align: left;
  }
}
