/* ==========================================================================
   Wrench-Studio · Member page
   --------------------------------------------------------------------------
   Scoped to .member-page so it never fights with the shared stylesheet.
   The page reuses styles.css for the header / footer / auth area and only
   adds what the member view needs on top.
   ========================================================================== */

/* The member page is often short (a signed-out visitor sees three lines), so
   the footer would float in the middle of the screen. Making the body a flex
   column pushes it to the bottom instead. */
.member-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.member-body .site-main {
  flex: 1 0 auto;
}

.member-page {
  padding: 56px 0 80px;
}

.member-container {
  width: 100%;
}

/* ----- States (loading / error / signed out) ----- */
.member-state {
  padding: 48px 0 32px;
}
.member-title {
  margin: 0 0 12px;
  font-size: 34px;
  font-weight: 500;
  color: #f4d576;
}
.member-lead {
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.8;
  color: #b4a179;
  max-width: 56ch;
}
.member-state-text {
  margin: 0;
  font-size: 15px;
  color: #b4a179;
}

/* ----- Buttons ----- */
.member-btn {
  display: inline-block;
  padding: 11px 22px;
  border: 1px solid #c9a96166;
  border-radius: 4px;
  background: rgba(201, 169, 97, 0.08);
  color: #f4d576;
  font-size: 14px;
  letter-spacing: 0.06em;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}
.member-btn:hover {
  background: rgba(201, 169, 97, 0.16);
  border-color: #c9a961;
}
.member-btn-small {
  padding: 7px 16px;
  font-size: 13px;
}
.member-btn-danger {
  border-color: rgba(214, 120, 120, 0.45);
  background: rgba(214, 120, 120, 0.08);
  color: #e8a0a0;
}
.member-btn-danger:hover {
  background: rgba(214, 120, 120, 0.16);
  border-color: rgba(214, 120, 120, 0.7);
}

/* ----- Cards ----- */
.member-card {
  padding: 26px 28px;
  margin-bottom: 24px;
  border: 1px solid rgba(201, 169, 97, 0.25);
  border-radius: 8px;
  background: rgba(20, 26, 42, 0.55);
}
.member-card-title {
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 500;
  color: #f4d576;
}
.member-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.member-card-head .member-card-title {
  margin-bottom: 18px;
}
.member-hint {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #8f8064;
}

/* ----- Wallet currency and game score cards ----- */
.member-balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}
.member-balance {
  padding: 20px 22px;
  border: 1px solid rgba(201, 169, 97, 0.2);
  border-radius: 8px;
  background: rgba(10, 14, 26, 0.4);
}
.member-balance-primary {
  border-color: rgba(201, 169, 97, 0.5);
  background: rgba(201, 169, 97, 0.07);
}
.member-balance-name {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: #b4a179;
}
.member-balance-value {
  margin: 8px 0 0;
  font-size: 38px;
  line-height: 1.1;
  font-weight: 500;
  color: #f4d576;
  font-feature-settings: "tnum";
}
.member-balance-tier {
  margin: 12px 0 0;
}
.member-balance-label {
  margin: 8px 0 0;
  font-size: 12px;
  color: #b4a179;
}
.member-balance-empty {
  font-size: 13px;
  color: #8f8064;
}

/* ----- Title badge (Title) ----- */
.member-title-line {
  margin: 14px 0 0;
}
.member-title-badge {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid #c9a96166;
  border-radius: 20px;
  background: rgba(201, 169, 97, 0.1);
  color: #f4d576;
  font-size: 13px;
  letter-spacing: 0.08em;
}

/* ----- Nickname ----- */
.member-detail dd:has(.member-inline-btn) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.member-inline-btn {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #b4a179;
  border-bottom: 1px solid transparent;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}
.member-inline-btn:hover {
  color: #f4d576;
  border-bottom-color: #c9a961;
}
.member-nickname-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0 14px;
  border-bottom: 1px solid rgba(201, 169, 97, 0.12);
}
.member-input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid rgba(201, 169, 97, 0.35);
  border-radius: 4px;
  background: rgba(10, 14, 26, 0.6);
  color: #d4b87a;
  font-family: inherit;
  font-size: 14px;
}
.member-input:focus {
  outline: none;
  border-color: #c9a961;
}

/* ----- Two column grid ----- */
.member-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.member-grid .member-card {
  margin-bottom: 0;
}

/* ----- Details list ----- */
.member-details {
  margin: 0;
}
.member-detail {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(201, 169, 97, 0.12);
}
.member-detail:last-child {
  border-bottom: none;
}
.member-detail dt {
  flex: 0 0 auto;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #8f8064;
}
.member-detail dd {
  margin: 0;
  font-size: 15px;
  color: #d4b87a;
  text-align: right;
  word-break: break-word;
}
.member-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px !important;
  letter-spacing: 0.02em;
}

/* ----- Linked identities ----- */
.member-identity-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.member-identity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(201, 169, 97, 0.12);
}
.member-identity-item:last-child {
  border-bottom: none;
}
.member-identity-provider {
  font-size: 15px;
  color: #d4b87a;
}
.member-identity-date {
  font-size: 12px;
  color: #8f8064;
}

/* ----- Points ledger table ----- */
.member-table-wrap {
  overflow-x: auto;
}
.member-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.member-table th,
.member-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(201, 169, 97, 0.12);
  white-space: nowrap;
}
.member-table th {
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 500;
  color: #8f8064;
}
.member-table tbody tr:last-child td {
  border-bottom: none;
}
.member-table td {
  color: #d4b87a;
}
.member-num {
  text-align: right !important;
  font-feature-settings: "tnum";
}
.member-delta-positive {
  color: #9fd08a !important;
}
.member-delta-negative {
  color: #e8a0a0 !important;
}
.member-empty {
  margin: 18px 0 0;
  font-size: 14px;
  color: #8f8064;
}

/* ----- Mailbox ----- */
.member-mailbox {
  margin: 0;
  padding: 0;
  list-style: none;
}
.member-mailbox-item {
  padding: 16px 18px;
  margin-bottom: 12px;
  border: 1px solid rgba(201, 169, 97, 0.16);
  border-radius: 6px;
  background: rgba(10, 14, 26, 0.4);
}
.member-mailbox-item:last-child {
  margin-bottom: 0;
}
.member-mailbox-unread {
  border-color: rgba(201, 169, 97, 0.45);
  background: rgba(201, 169, 97, 0.06);
}
.member-mailbox-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.member-mailbox-category {
  padding: 3px 10px;
  border: 1px solid #c9a96166;
  border-radius: 20px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f4d576;
}
.member-mailbox-date {
  font-size: 12px;
  color: #8f8064;
}
.member-mailbox-subject {
  margin: 12px 0 0;
  font-size: 16px;
  font-weight: 500;
  color: #f4d576;
}
/* The dot marks a message the player has not opened yet. */
.member-mailbox-unread .member-mailbox-subject::before {
  content: "●";
  margin-right: 8px;
  font-size: 10px;
  vertical-align: middle;
  color: #f4d576;
}
.member-mailbox-body {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.75;
  color: #d4b87a;
  /* Notifications are written with line breaks in mind. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.member-mailbox-item-actions {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}
.member-mailbox-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 20px;
  background: #c9a961;
  color: #0a0e1a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.member-mailbox-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ----- Danger zone ----- */
.member-danger {
  border-color: rgba(214, 120, 120, 0.25);
}
.member-danger .member-card-title {
  color: #e8a0a0;
}
.member-confirm {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid rgba(214, 120, 120, 0.4);
  border-radius: 6px;
  background: rgba(214, 120, 120, 0.06);
}
.member-confirm-title {
  margin: 0 0 8px;
  font-size: 17px;
  color: #e8a0a0;
}
.member-confirm-text {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.7;
  color: #b4a179;
}
.member-confirm-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.member-done {
  margin: 18px 0 0;
  font-size: 15px;
  color: #9fd08a;
}

/* ----- Responsive ----- */
@media (max-width: 720px) {
  .member-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .member-balance-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .member-balance-value {
    font-size: 32px;
  }
  .member-card {
    padding: 22px 20px;
  }
  .member-detail {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .member-detail dd {
    text-align: left;
  }
}
