/* Member profile — game_tgn_0041 Ridge Terrace / Locker */

.g41-body--profile {
  --g41-locker: #1e2a24;
  --g41-locker-ink: #eef2ef;
  --g41-locker-muted: #8a968c;
  --g41-locker-line: rgba(200, 210, 201, 0.18);
  --g41-locker-inset: #12181c;
  --g41-locker-card: #12181c;
}

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

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

.g41-profile-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

@media (min-width: 900px) {
  .g41-profile-shell {
    grid-template-columns: 228px minmax(0, 1fr);
    gap: 16px;
  }
}

.g41-profile-aside,
.g41-profile-main {
  background: #1e2a24;
  color: #eef2ef;
  border: 2px solid #c8d2c9;
  border-radius: 0;
  box-shadow:
    inset 0 1px 0 rgba(238, 242, 239, 0.05),
    0 16px 40px rgba(0, 0, 0, 0.45);
  min-width: 0;
}

.g41-profile-aside {
  padding: 16px;
  position: relative;
}

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

.g41-profile-main {
  position: relative;
  padding: 18px 18px 20px;
}

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

.g41-profile-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(200, 210, 201, 0.18);
}

.g41-profile-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 800;
  color: #eef2ef;
  background: #e85d4c;
  border: 2px solid #c8d2c9;
}

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

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

.g41-aside-label {
  margin: 0 0 4px;
  font-family: var(--g41-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e85d4c;
}

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

.g41-profile-email {
  margin: 0;
  font-size: 0.75rem;
  color: #8a968c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.g41-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: #8a968c;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.g41-profile-nav-item:hover {
  background: rgba(232, 93, 76, 0.12);
  color: #eef2ef;
  border-color: rgba(200, 210, 201, 0.18);
}

.g41-profile-nav-item.active {
  background: #e85d4c;
  color: #eef2ef;
  border-color: #e85d4c;
  font-weight: 700;
}

.g41-profile-nav-item .g41-nav-label {
  min-width: 0;
}

@media (max-width: 899px) {
  .g41-profile-aside {
    padding: 12px;
  }

  .g41-profile-user {
    padding-bottom: 12px;
    margin-bottom: 8px;
  }

  .g41-profile-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px 2px;
  }

  .g41-profile-nav::-webkit-scrollbar {
    display: none;
  }

  .g41-profile-nav-item {
    flex: 0 0 auto;
    width: auto;
    padding: 8px 12px;
    background: #12181c;
    border-color: #c8d2c9;
    font-size: 0.8125rem;
    color: #c8d2c9;
  }

  .g41-profile-nav-item.active {
    background: #e85d4c;
    color: #eef2ef;
    border-color: #e85d4c;
  }
}

.g41-profile-panel {
  display: none;
}

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

.g41-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(200, 210, 201, 0.18);
}

.g41-profile-card-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #eef2ef;
}

.g41-stat-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-family: var(--g41-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #eef2ef;
  background: #e85d4c;
  border: 2px solid #e85d4c;
  border-radius: 0;
}

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

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

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

.g41-profile-page .g41-game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #12181c;
  border: 2px solid #c8d2c9;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

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

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

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

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

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

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

.g41-profile-page .g41-game-card .game-title a {
  color: #eef2ef;
  text-decoration: none;
}

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

.g41-profile-page .g41-game-card .game-star {
  margin: 0;
}

.g41-profile-page .g41-game-card .g41-card-tags,
.g41-profile-page .g41-game-card .brief-comment-game {
  display: none;
}

.g41-profile-page .g41-game-card .g41-btn-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  align-self: stretch;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: #c8d2c9;
  background: transparent;
  border: 2px solid #c8d2c9;
  border-radius: 0;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.g41-profile-page .g41-game-card .g41-btn-remove:hover {
  color: #eef2ef;
  background: #e85d4c;
  border-color: #e85d4c;
  text-decoration: none;
}

.g41-btn-clear,
.g41-btn-load-more,
.g41-btn-secondary,
.g41-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: 0;
  border: 2px solid #c8d2c9;
  background: transparent;
  color: #eef2ef;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

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

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

.g41-btn-remove--inline {
  width: auto;
  color: #8a968c;
  border-color: rgba(200, 210, 201, 0.35);
}

.g41-btn-remove--inline:hover {
  color: #eef2ef;
  border-color: #e85d4c;
}

.g41-profile-page .g41-btn-outline {
  color: #eef2ef;
  border-color: #c8d2c9;
  background: transparent;
}

.g41-profile-page .g41-btn-outline:hover {
  border-color: #e85d4c;
  color: #e85d4c;
}

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

.g41-empty-state {
  text-align: center;
  padding: 40px 16px;
  color: #8a968c;
}

.g41-empty-state p {
  margin: 0 0 14px;
  color: #c8d2c9;
}

.g41-loading {
  text-align: center;
  padding: 36px 12px;
  color: #8a968c;
}

.g41-loading-spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 3px solid rgba(232, 93, 76, 0.22);
  border-top-color: #e85d4c;
  border-radius: 50%;
  animation: g41-profile-spin 0.7s linear infinite;
  margin-bottom: 8px;
}

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

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

.g41-avatar-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(200, 210, 201, 0.18);
}

.g41-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #eef2ef;
  background: #e85d4c;
  border: 2px solid #c8d2c9;
}

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

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

.g41-avatar-hint {
  margin: 0;
  font-size: 0.75rem;
  color: #8a968c;
}

.g41-form-row {
  display: grid;
  gap: 12px;
}

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

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

.g41-profile-form label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--g41-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c8d2c9;
}

.g41-profile-form .g41-form-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.9375rem;
  color: #eef2ef;
  background: #12181c;
  border: 2px solid #c8d2c9;
  border-radius: 0;
  outline: none;
  box-sizing: border-box;
}

.g41-profile-form .g41-form-input:focus {
  border-color: #e85d4c;
  box-shadow: 0 0 0 2px rgba(232, 93, 76, 0.22);
}

.g41-profile-form .g41-form-input[disabled] {
  background: #12181c;
  color: #8a968c;
  border-color: rgba(200, 210, 201, 0.18);
  cursor: not-allowed;
}

.g41-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: 0;
  border: 2px solid transparent;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  transition: transform 0.28s ease;
  pointer-events: none;
}

.g41-toast.show {
  transform: translateX(-50%) translateY(0);
}

.g41-toast.success {
  color: #d1fae5;
  background: #1e2a24;
  border-color: rgba(74, 124, 101, 0.65);
}

.g41-toast.error {
  color: #fecaca;
  background: #1e2a24;
  border-color: rgba(232, 93, 76, 0.75);
}

.g41-toast.warning {
  color: #fde68a;
  background: #1e2a24;
  border-color: #e85d4c;
}

.g41-confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30000;
  background: rgba(12, 18, 20, 0.82);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.g41-confirm-overlay.show {
  display: flex;
}

.g41-confirm-modal {
  width: 100%;
  max-width: 360px;
  padding: 24px;
  background: #1e2a24;
  color: #eef2ef;
  border: 2px solid #c8d2c9;
  border-radius: 0;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  text-align: center;
  position: relative;
}

.g41-confirm-modal::before {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #e85d4c, transparent);
}

.g41-confirm-title {
  margin: 0 0 6px;
  font-size: 1.0625rem;
  color: #eef2ef;
}

.g41-confirm-desc {
  margin: 0 0 18px;
  font-size: 0.875rem;
  color: #8a968c;
}

.g41-confirm-actions {
  display: flex;
  gap: 10px;
}

.g41-confirm-cancel,
.g41-confirm-ok {
  flex: 1;
  min-height: 42px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 0;
  border: 2px solid #c8d2c9;
}

.g41-confirm-cancel {
  background: transparent;
  color: #eef2ef;
}

.g41-confirm-cancel:hover {
  border-color: #e85d4c;
  color: #e85d4c;
}

.g41-confirm-ok {
  background: #e85d4c;
  color: #eef2ef;
  border-color: #e85d4c;
}

.g41-confirm-ok:hover {
  filter: brightness(1.08);
}

@media (max-width: 767px) {
  .g41-profile-page {
    padding: 12px 0 24px;
  }

  .g41-profile-main {
    padding: 14px;
  }

  .g41-profile-page .g41-game-card:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .g41-loading-spinner {
    animation: none;
  }

  .g41-toast {
    transition: none;
  }

  .g41-profile-page .g41-game-card {
    transition: none;
  }
}
