/* Member profile — game_tgn_0045 Field Notes / Map locker */

.g45-body--profile {
  --g45-locker: #f7f1e4;
  --g45-locker-ink: #1f2a24;
  --g45-locker-muted: #5c6b63;
  --g45-locker-line: rgba(31, 42, 36, 0.14);
  --g45-locker-inset: #ebe4d4;
  --g45-locker-card: #fffdf8;
}

.g45-profile-page {
  flex: 1;
  min-width: 0;
  padding: 20px 0 40px;
  color: #1f2a24;
}

.g45-profile-page button,
.g45-profile-page .g45-stat-badge,
.g45-profile-page .g45-profile-form label,
.g45-profile-page .g45-profile-nav-item,
.g45-profile-page .g45-btn-secondary {
  text-transform: none;
  letter-spacing: normal;
}

.g45-profile-shell,
.g45-profile-layout {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.g45-profile-aside,
.g45-profile-sidebar {
  flex: 0 0 260px;
  padding: 16px;
  background: #f7f1e4;
  color: #1f2a24;
  border: 1px solid rgba(31, 42, 36, 0.14);
  border-radius: 6px;
  min-width: 0;
  height: fit-content;
  position: relative;
}

.g45-profile-aside::before {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #c45c26, transparent);
  opacity: 0.9;
  pointer-events: none;
}

.g45-profile-main {
  flex: 1;
  min-width: 0;
  padding: 18px;
  background: #f7f1e4;
  color: #1f2a24;
  border: 1px solid rgba(31, 42, 36, 0.14);
  border-radius: 6px;
  position: relative;
}

.g45-profile-main::before {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #2a6b5a, transparent);
  opacity: 0.85;
  pointer-events: none;
}

@media (min-width: 900px) {
  .g45-profile-aside,
  .g45-profile-sidebar {
    position: sticky;
    top: 16px;
  }
}

@media (max-width: 899px) {
  .g45-profile-shell,
  .g45-profile-layout {
    flex-direction: column;
  }
  .g45-profile-aside,
  .g45-profile-sidebar {
    flex: none;
    width: 100%;
  }
}

.g45-profile-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(31, 42, 36, 0.14);
}

.g45-profile-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 800;
  color: #fffdf8;
  background: #c45c26;
  border: 1px solid rgba(31, 42, 36, 0.2);
}

.g45-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g45-profile-identity { min-width: 0; }

.g45-aside-label {
  margin: 0 0 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #2a6b5a;
}

.g45-profile-name {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 700;
  color: #1f2a24;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g45-profile-email {
  margin: 0;
  font-size: 0.75rem;
  color: #5c6b63;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g45-profile-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.g45-profile-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #5c6b63;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.g45-profile-nav-item:hover {
  background: rgba(196, 92, 38, 0.1);
  color: #1f2a24;
  border-color: rgba(31, 42, 36, 0.14);
}

.g45-profile-nav-item.active {
  background: #c45c26;
  color: #fffdf8;
  border-color: #c45c26;
  font-weight: 700;
}

@media (max-width: 899px) {
  .g45-profile-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .g45-profile-nav::-webkit-scrollbar { display: none; }
  .g45-profile-nav-item {
    flex: 0 0 auto;
    width: auto;
    padding: 8px 12px;
    background: #ebe4d4;
    border-color: rgba(31, 42, 36, 0.14);
    font-size: 0.8125rem;
    color: #243028;
  }
  .g45-profile-nav-item.active {
    background: #c45c26;
    color: #fffdf8;
    border-color: #c45c26;
  }
}

.g45-profile-panel { display: none; }
.g45-profile-panel.active { display: block; width: 100%; }

.g45-profile-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(31, 42, 36, 0.14);
}

.g45-profile-card-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #1f2a24;
}

.g45-stat-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fffdf8;
  background: #2a6b5a;
  border: 1px solid #2a6b5a;
  border-radius: 6px;
}

.g45-profile-page .g45-game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 640px) {
  .g45-profile-page .g45-ranked-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .g45-profile-page .g45-ranked-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
}

.g45-profile-page .g45-game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fffdf8;
  border: 1px solid rgba(31, 42, 36, 0.14);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.g45-profile-page .g45-game-card:hover {
  transform: translateY(-2px);
  border-color: #c45c26;
}

.g45-profile-page .g45-card-index { display: none; }

.g45-profile-page .g45-ranked-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #ebe4d4;
  text-decoration: none;
}

.g45-profile-page .g45-ranked-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g45-profile-page .g45-ranked-body,
.g45-profile-page .article-list .special-card-content {
  padding: 12px 14px 16px;
  min-width: 0;
}

.g45-profile-page .g45-game-card .game-title {
  display: block;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 4px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1f2a24;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g45-profile-page .g45-game-card .game-title a {
  color: #1f2a24;
  text-decoration: none;
}

.g45-profile-page .g45-game-card .game-title a:hover,
.g45-profile-page .g45-game-card:hover .game-title,
.g45-profile-page .g45-game-card:hover .game-title a {
  color: #c45c26;
}

.g45-profile-page .g45-game-card .game-star { margin: 0; }
.g45-profile-page .g45-game-card .g45-card-tags,
.g45-profile-page .g45-game-card .brief-comment-game { display: none; }

.g45-profile-page .g45-game-card .g45-btn-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: #5c6b63;
  background: transparent;
  border: 1px solid rgba(31, 42, 36, 0.2);
  border-radius: 6px;
  cursor: pointer;
}

.g45-profile-page .g45-game-card .g45-btn-remove:hover {
  color: #fffdf8;
  background: #c45c26;
  border-color: #c45c26;
}

.g45-btn-clear,
.g45-btn-load-more,
.g45-btn-secondary,
.g45-btn-remove--inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid rgba(31, 42, 36, 0.2);
  background: transparent;
  color: #1f2a24;
}

.g45-btn-clear:hover,
.g45-btn-load-more:hover,
.g45-btn-secondary:hover {
  border-color: #c45c26;
  color: #c45c26;
}

.g45-btn-load-more {
  position: relative; width: 100%; margin-top: 16px; }

.g45-btn-load-more.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.g45-btn-load-more:disabled {
  cursor: not-allowed;
  opacity: 0.85;
  filter: none;
}

.g45-btn-load-more.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: profile-load-more-spin 0.7s linear infinite;
}

@keyframes profile-load-more-spin {
  to { transform: rotate(360deg); }
}

.g45-btn-remove--inline { width: auto; color: #5c6b63; }
.g45-btn-remove--inline:hover { color: #1f2a24; border-color: #c45c26; }

.g45-profile-page .g45-btn-outline {
  color: #1f2a24;
  border-color: rgba(31, 42, 36, 0.2);
  background: transparent;
}
.g45-profile-page .g45-btn-outline:hover {
  border-color: #c45c26;
  color: #c45c26;
}

.g45-loading[hidden],
.g45-empty-state[hidden],
.g45-btn-load-more[hidden],
.g45-btn-remove--inline[hidden] {
  display: none !important;
}

.g45-empty-state {
  text-align: center;
  padding: 40px 16px;
  color: #5c6b63;
}
.g45-empty-state p { margin: 0 0 14px; color: #5c6b63; }

.g45-loading {
  text-align: center;
  padding: 36px 12px;
  color: #5c6b63;
}

.g45-loading-spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 3px solid rgba(196, 92, 38, 0.22);
  border-top-color: #c45c26;
  border-radius: 50%;
  animation: g45-profile-spin 0.7s linear infinite;
  margin-bottom: 8px;
}
@keyframes g45-profile-spin { to { transform: rotate(360deg); } }

.g45-profile-form-block { max-width: 480px; }

.g45-avatar-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(31, 42, 36, 0.14);
}

.g45-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fffdf8;
  background: #c45c26;
  border: 1px solid rgba(31, 42, 36, 0.2);
}

.g45-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g45-avatar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.g45-avatar-hint {
  margin: 0;
  font-size: 0.75rem;
  color: #5c6b63;
}

.g45-form-row { display: grid; gap: 12px; }
@media (min-width: 560px) {
  .g45-form-row { grid-template-columns: 1fr 1fr; }
}

.g45-profile-form .g45-form-group { margin-bottom: 14px; }

.g45-profile-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5c6b63;
}

.g45-profile-form .g45-form-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.9375rem;
  color: #1f2a24;
  background: #fffdf8;
  border: 1px solid rgba(31, 42, 36, 0.2);
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
}

.g45-profile-form .g45-form-input:focus {
  border-color: #c45c26;
  box-shadow: 0 0 0 2px rgba(196, 92, 38, 0.2);
}

.g45-profile-form .g45-form-input[disabled] {
  background: #ebe4d4;
  color: #5c6b63;
  cursor: not-allowed;
}

.g45-toast {
  position: fixed;
  top: 20px;
  bottom: auto;
  left: 50%;
  right: auto;
  width: max-content;
  max-width: min(420px, 90vw);
  height: auto;
  transform: translateX(-50%) translateY(-120%);
  z-index: 40000;
  padding: 12px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  border-radius: 6px;
  border: 1px solid transparent;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  transition: transform 0.28s ease;
  pointer-events: none;
}
.g45-toast.show { transform: translateX(-50%) translateY(0); }
.g45-toast.success {
  color: #1f2a24;
  background: #f7f1e4;
  border-color: #2a6b5a;
}
.g45-toast.error {
  color: #1f2a24;
  background: #f7f1e4;
  border-color: #c45c26;
}
.g45-toast.warning {
  color: #1f2a24;
  background: #f7f1e4;
  border-color: #b8860b;
}

.g45-confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30000;
  background: rgba(31, 42, 36, 0.55);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.g45-confirm-overlay.show { display: flex; }

.g45-confirm-modal {
  width: 100%;
  max-width: 360px;
  padding: 24px;
  background: #f7f1e4;
  color: #1f2a24;
  border: 1px solid rgba(31, 42, 36, 0.2);
  border-radius: 6px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.g45-confirm-title { margin: 0 0 6px; font-size: 1.0625rem; color: #1f2a24; }
.g45-confirm-desc { margin: 0 0 18px; font-size: 0.875rem; color: #5c6b63; }
.g45-confirm-actions { display: flex; gap: 10px; }

.g45-confirm-cancel,
.g45-confirm-ok {
  flex: 1;
  min-height: 42px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid rgba(31, 42, 36, 0.2);
}

.g45-confirm-cancel { background: transparent; color: #1f2a24; }
.g45-confirm-cancel:hover { border-color: #c45c26; color: #c45c26; }
.g45-confirm-ok { background: #c45c26; color: #fffdf8; border-color: #c45c26; }
.g45-confirm-ok:hover { filter: brightness(1.05); }

@media (max-width: 767px) {
  .g45-profile-page { padding: 12px 0 24px; }
  .g45-profile-main { padding: 14px; }
  .g45-profile-page .g45-game-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .g45-loading-spinner { animation: none; }
  .g45-toast { transition: none; }
  .g45-profile-page .g45-game-card { transition: none; }
}


.g45-confirm-ok {
  position: relative;
}

.g45-confirm-ok:disabled,
.g45-confirm-cancel:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.g45-confirm-ok.is-loading {
  color: transparent;
  pointer-events: none;
}

.g45-confirm-ok.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: g45-confirm-spin 0.7s linear infinite;
}

@keyframes g45-confirm-spin {
  to { transform: rotate(360deg); }
}
