/* Member profile — game_tgn_0028 */

.g28-profile-page {
  flex: 1;
  padding: 24px 0 48px;
}

/* Profile page: sentence case only — never force all-caps via CSS */
.g28-profile-page button,
.g28-profile-page .g28-stat-badge,
.g28-profile-page .g28-profile-form label,
.g28-profile-page .g28-profile-nav-item,
.g28-profile-page .g28-btn-secondary {
  text-transform: none;
}

.g28-profile-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.g28-profile-sidebar {
  flex: 0 0 280px;
  background: var(--space-blue);
  border: 1px solid var(--line-soft); border-radius: var(--g28-radius);
  padding: 1.5rem;
}

.g28-profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--star-white);
  background: linear-gradient(135deg, #fb7185, #8b5cf6);
}

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

.g28-profile-name {
  margin: 0 0 4px;
  font-family: var(--g28-font);
  font-size: 1.125rem;
  font-weight: 700;
}

.g28-profile-email {
  margin: 0 0 1.25rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
  word-break: break-all;
}

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

.g28-profile-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--star-white);
  text-decoration: none;
  border-left: 3px solid transparent;
  background: transparent;
  border-top: none;
  border-right: none;
  border-bottom: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.g28-profile-nav-item:hover {
  background: var(--space-blue);
}

.g28-profile-nav-item.active {
  color: var(--nebula-pink);
  border-left-color: var(--nebula-pink);
  background: var(--space-blue);
}

.g28-profile-nav-item .g28-nav-icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.g28-profile-nav-item .g28-nav-icon--heart {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
}

.g28-profile-nav-item .g28-nav-icon--clock {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2a10 10 0 100 20 10 10 0 000-20zm0 2a8 8 0 110 16 8 8 0 010-16zm-.5 4v4.25l3.5 2.1.75-1.23-3-1.8V8H11.5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2a10 10 0 100 20 10 10 0 000-20zm0 2a8 8 0 110 16 8 8 0 010-16zm-.5 4v4.25l3.5 2.1.75-1.23-3-1.8V8H11.5z'/%3E%3C/svg%3E");
}

.g28-profile-nav-item .g28-nav-icon--user {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 12a4 4 0 100-8 4 4 0 000 8zm-6 8a6 6 0 0112 0H6z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 12a4 4 0 100-8 4 4 0 000 8zm-6 8a6 6 0 0112 0H6z'/%3E%3C/svg%3E");
}

.g28-profile-nav-item .g28-nav-icon--lock {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M17 9h-1V7a4 4 0 00-8 0v2H7a2 2 0 00-2 2v8a2 2 0 002 2h10a2 2 0 002-2v-8a2 2 0 00-2-2zm-3 0h-4V7a2 2 0 114 0v2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M17 9h-1V7a4 4 0 00-8 0v2H7a2 2 0 00-2 2v8a2 2 0 002 2h10a2 2 0 002-2v-8a2 2 0 00-2-2zm-3 0h-4V7a2 2 0 114 0v2z'/%3E%3C/svg%3E");
}

.g28-profile-main {
  flex: 1;
  min-width: 0;
}

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

.g28-profile-card {
  background: var(--space-blue);
  border: 1px solid var(--line-soft);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.g28-profile-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.g28-profile-card-title {
  margin: 0;
  font-family: var(--g28-font);
  font-size: 1.25rem;
  font-weight: 700;
}

.g28-stat-badge {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
  background: var(--space-blue);
  border: 1px solid var(--line-soft);
}

.g28-game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.g28-profile-card .g28-game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-soft);
  border-radius: var(--g28-radius-sm);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.g28-profile-card .g28-game-card:hover {
  border-color: var(--nebula-pink);
  transform: translateY(-2px);
}

.g28-profile-card .g28-ranked-thumb {
  display: block;
  text-decoration: none;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.g28-profile-card .g28-ranked-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.g28-profile-card .special-card-content,
.g28-profile-card .g28-ranked-body {
  padding: 8px 10px 10px;
}

.g28-profile-card .g28-game-card .game-title {
  font-size: 0.8125rem;
  margin-bottom: 2px;
}

.g28-profile-card .g28-game-card .game-title a {
  color: var(--star-white);
  text-decoration: none;
}

.g28-profile-card .g28-game-card .game-title a:hover {
  color: var(--nebula-pink);
}

.g28-profile-card .g28-game-card .game-star {
  margin-bottom: 4px;
}

.g28-profile-card .g28-game-card .game-star .star-full,
.g28-profile-card .g28-game-card .game-star .star-empty,
.g28-profile-card .g28-game-card .game-star .star-icon,
.g28-profile-card .g28-game-card .game-star i {
  font-size: 0.75rem;
}

.g28-profile-card .g28-game-card .g28-card-tags {
  margin: 2px 0;
  gap: 3px;
}

.g28-profile-card .g28-game-card .g28-tag-chip {
  font-size: 0.6rem;
  padding: 1px 5px;
}

.g28-profile-card .g28-game-card .brief-comment-game {
  margin-top: 2px;
  font-size: 0.75rem;
  -webkit-line-clamp: 1;
}

.g28-profile-card .g28-game-card .g28-card-index {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 1;
  font-size: 0.625rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--star-white);
  background: rgba(26, 15, 46, 0.75);
}

.g28-profile-card .g28-game-card .g28-btn-remove {
  margin-top: 6px;
  width: 100%;
  min-height: 30px;
  padding: 0 8px;
  font-size: 0.625rem;
  letter-spacing: 0.02em;
}

@media (min-width: 768px) {
  .g28-profile-card .g28-ranked-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}

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

.g28-btn-remove,
.g28-btn-clear,
.g28-btn-load-more,
.g28-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
  cursor: pointer;
  border: 1px solid var(--line-soft);
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.g28-btn-remove {
  width: 100%;
  color: var(--star-white);
  background: rgba(26, 15, 46, 0.55);
}

.g28-btn-remove:hover {
  color: #fff;
  background: var(--nebula-pink);
  border-color: var(--nebula-pink);
}

.g28-btn-clear {
  color: var(--nebula-pink);
  background: transparent;
  border-color: var(--nebula-pink);
}

.g28-btn-clear:hover {
  color: #fff;
  background: var(--nebula-pink);
}

.g28-btn-load-more {
  width: 100%;
  margin-top: 1rem;
  color: var(--star-white);
  background: rgba(26, 15, 46, 0.55);
}

.g28-btn-load-more:hover { background: var(--nebula-pink); border-color: var(--nebula-pink); }

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

.g28-btn-secondary {
  color: var(--star-white);
  background: rgba(26, 15, 46, 0.55);
}

.g28-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-muted);
}

.g28-empty-state i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
  opacity: 0.5;
}

.g28-loading {
  text-align: center;
  padding: 2rem;
  color: var(--ink-muted);
}

.g28-loading-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--line-soft);
  border-top-color: var(--nebula-pink);
  border-radius: 50%;
  animation: g28-profile-spin 0.7s linear infinite;
  margin-bottom: 10px;
}

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

/* Avatar upload */
.g28-avatar-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line-soft);
}

.g28-avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--star-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--star-white);
  background: linear-gradient(135deg, #fb7185, #8b5cf6);
}

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

.g28-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.g28-avatar-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

/* Toast */
.g28-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 40000;
  max-width: min(420px, 90vw);
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
  border: 2px solid transparent;
  box-shadow: 4px 4px 0 rgba(26, 26, 26, 0.12);
  transition: transform 0.28s ease;
  pointer-events: none;
}

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

.g28-toast.success {
  color: #1e5631;
  background: #e8f5e9;
  border-color: #27ae60;
}

.g28-toast.error {
  color: #7b1e1e;
  background: #fdecea;
  border-color: var(--nebula-pink);
}

.g28-toast.warning {
  color: #7a5c00;
  background: #fff8e1;
  border-color: #f9a825;
}

.g28-profile-form {
  width: 100%;
  max-width: 100%;
}

.g28-profile-form .g28-form-group { margin-bottom: 1rem; }

.g28-profile-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.g28-profile-form .g28-form-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--star-white);
  background: rgba(26, 15, 46, 0.55);
  border: 1px solid var(--line-soft);
  outline: none;
}

.g28-profile-form .g28-form-input:focus { border-color: var(--nebula-pink); }

.g28-profile-form .g28-form-input[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Confirm modal */
.g28-confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30000;
  background: rgba(26, 26, 26, 0.55);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.g28-confirm-modal {
  width: 100%;
  max-width: 380px;
  padding: 1.75rem;
  background: var(--space-blue);
  border: 1px solid var(--line-soft); border-radius: var(--g28-radius);
  text-align: center;
}

.g28-confirm-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fdecea;
  color: var(--nebula-pink);
  font-size: 1.25rem;
}

.g28-confirm-title {
  margin: 0 0 8px;
  font-family: var(--g28-font);
  font-size: 1.125rem;
}

.g28-confirm-desc {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

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

.g28-confirm-cancel,
.g28-confirm-ok {
  flex: 1;
  min-height: 44px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: none;
  cursor: pointer;
  border: 1px solid var(--line-soft);
}

.g28-confirm-cancel {
  background: var(--space-blue);
  color: var(--star-white);
}

.g28-confirm-ok {
  background: var(--nebula-pink);
  color: #fff;
  border-color: var(--nebula-pink);
}

@media (max-width: 900px) {
  .g28-profile-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .g28-profile-main {
    width: 100%;
    min-width: 0;
  }

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

  .g28-profile-card {
    width: 100%;
    box-sizing: border-box;
  }

  .g28-profile-sidebar {
    width: 100%;
    flex: none;
    display: grid;
    grid-template-columns: 52px 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    padding: 14px 14px 0;
    border-width: 2px;
    overflow: hidden;
  }

  .g28-profile-avatar {
    grid-row: 1 / 3;
    align-self: center;
    width: 52px;
    height: 52px;
    margin-bottom: 0;
    font-size: 1.25rem;
  }

  .g28-profile-name {
    align-self: end;
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
  }

  .g28-profile-email {
    align-self: start;
    margin: 2px 0 0;
    font-size: 0.75rem;
    word-break: break-all;
  }

  .g28-profile-nav {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    margin-top: 12px;
    border-top: 2px solid var(--star-white);
  }

  .g28-profile-nav-item {
    flex: 1;
    width: auto;
    min-width: 0;
    padding: 8px 4px;
    border-left: none;
    border-bottom: 3px solid transparent;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    font-size: 0.5625rem;
    letter-spacing: 0.02em;
  }

  .g28-profile-nav-item .g28-nav-icon {
    width: 1rem;
    height: 1rem;
  }

  .g28-profile-nav-item .g28-nav-label {
    display: block;
    line-height: 1.1;
  }

  .g28-profile-nav-item.active {
    border-left: none;
    border-bottom-color: var(--nebula-pink);
  }
}

@media (max-width: 767px) {
  .g28-profile-page {
    padding: 12px 0 calc(24px + var(64px));
  }

  .g28-profile-sidebar {
    grid-template-columns: 44px 1fr;
    column-gap: 10px;
    padding: 12px 12px 0;
  }

  .g28-profile-avatar {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .g28-profile-name {
    font-size: 0.9375rem;
  }

  .g28-profile-email {
    margin-bottom: 0;
    font-size: 0.6875rem;
  }

  .g28-profile-nav {
    margin: 10px -12px 0;
  }

  .g28-profile-nav-item {
    padding: 8px 2px 10px;
  }

  .g28-profile-card {
    padding: 1rem;
  }

  .g28-profile-card-head {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0.75rem;
    padding-bottom: 8px;
  }

  .g28-profile-card-title {
    font-size: 1.0625rem;
  }

  .g28-stat-badge {
    padding: 4px 10px;
    font-size: 0.6875rem;
  }

  .g28-game-grid {
    gap: 8px;
  }

  .g28-profile-card .g28-ranked-body {
    padding: 6px 8px 8px;
  }

  .g28-profile-card .g28-game-card .game-title {
    font-size: 0.75rem;
  }

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

  .g28-profile-card .g28-game-card .g28-btn-remove {
    min-height: 28px;
    margin-top: 4px;
    font-size: 0.5625rem;
  }

  .g28-btn-clear {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.6875rem;
  }

  .g28-avatar-upload {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
  }

  .g28-avatar-preview {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
  }

  .g28-empty-state {
    padding: 2rem 1rem;
  }

  .g28-empty-state i {
    font-size: 2rem;
  }
}
