/* Member profile — game_tgn_0038 SPLIT-FLAP TERMINAL
   Passenger dossier: ivory flap panels on board black, dark ink text.
   LED amber is accent only (CTA / active / badge) — never body copy on light. */

.g38-body--profile {
  --g38-dossier: var(--g38-flap);
  --g38-dossier-ink: var(--g38-ink);
  --g38-dossier-muted: #4b5563;
  --g38-dossier-line: rgba(18, 18, 18, 0.14);
  --g38-dossier-inset: #f4f1e8;
  --g38-dossier-card: #fffcf5;
}

.g38-profile-page {
  flex: 1;
  min-width: 0;
  padding: 20px 0 40px;
  color: var(--g38-dossier-ink);
}

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

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

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

.g38-profile-aside,
.g38-profile-main {
  background: var(--g38-dossier);
  color: var(--g38-dossier-ink);
  border: 1px solid rgba(61, 90, 91, 0.55);
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(10, 10, 11, 0.35),
    0 12px 32px rgba(0, 0, 0, 0.35);
  min-width: 0;
}

.g38-profile-aside {
  padding: 16px;
}

@media (min-width: 900px) {
  .g38-profile-aside {
    position: sticky;
    top: calc(var(--g38-led-h) + var(--g38-route-h) + 12px);
  }
}

.g38-profile-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--g38-dossier-line);
}

.g38-profile-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--g38-ink);
  background: var(--g38-led);
  border: 1px solid rgba(18, 18, 18, 0.2);
}

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

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

.g38-aside-label {
  margin: 0 0 4px;
  font-family: var(--g38-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--g38-metal);
}

.g38-profile-name {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--g38-dossier-ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g38-profile-email {
  margin: 0;
  font-size: 0.75rem;
  color: var(--g38-dossier-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.g38-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: var(--g38-dossier-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.g38-profile-nav-item:hover {
  background: rgba(18, 18, 18, 0.05);
  color: var(--g38-dossier-ink);
  border-color: var(--g38-dossier-line);
}

.g38-profile-nav-item.active {
  background: var(--g38-led);
  color: var(--g38-ink);
  border-color: var(--g38-led);
  font-weight: 700;
}

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

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

  .g38-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;
  }

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

  .g38-profile-nav-item {
    flex: 0 0 auto;
    width: auto;
    padding: 8px 12px;
    background: rgba(18, 18, 18, 0.05);
    font-size: 0.8125rem;
  }

  .g38-profile-nav-item.active {
    background: var(--g38-led);
    color: var(--g38-ink);
    border-color: var(--g38-led);
  }
}

.g38-profile-main {
  padding: 18px 18px 20px;
}

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

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

.g38-profile-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--g38-dossier-line);
}

.g38-profile-card-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--g38-dossier-ink);
}

.g38-stat-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-family: var(--g38-mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--g38-ink);
  background: var(--g38-led);
  border: 1px solid var(--g38-led);
  border-radius: 2px;
}

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

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

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

.g38-profile-page .g38-game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--g38-dossier-card);
  border: 1px solid var(--g38-dossier-line);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.g38-profile-page .g38-game-card:hover {
  transform: translateY(-2px);
  border-color: var(--g38-metal);
}

/* Full-card hit target → detail; Unfavorite sits above it */
.g38-profile-page .g38-ranked-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

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

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

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

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

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

.g38-profile-page .g38-game-card:hover .game-title {
  color: #8a5a00;
}

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

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

.g38-profile-page .g38-game-card .g38-btn-remove {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  width: 100%;
  min-height: 30px;
  padding: 0 10px;
  align-self: stretch;
  font: inherit;
  font-family: var(--g38-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--g38-dossier-ink);
  background: var(--g38-dossier-inset);
  border: 1px solid rgba(61, 90, 91, 0.55);
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.g38-profile-page .g38-game-card .g38-btn-remove:hover {
  color: var(--g38-ink);
  background: var(--g38-led);
  border-color: var(--g38-led);
  text-decoration: none;
}

.g38-btn-clear,
.g38-btn-load-more,
.g38-btn-secondary,
.g38-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: 600;
  cursor: pointer;
  border-radius: 2px;
  border: 1px solid rgba(61, 90, 91, 0.55);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.g38-btn-clear {
  color: var(--g38-dossier-muted);
  background: transparent;
}

.g38-btn-clear:hover {
  border-color: var(--g38-ink);
  color: var(--g38-dossier-ink);
}

.g38-btn-load-more {
  position: relative;
  width: 100%;
  margin-top: 16px;
  color: var(--g38-dossier-ink);
  background: var(--g38-dossier-inset);
}

.g38-btn-load-more:hover {
  border-color: var(--g38-led);
  color: var(--g38-ink);
  background: var(--g38-led);
}

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

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

.g38-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); }
}


.g38-btn-secondary {
  color: var(--g38-dossier-ink);
  background: var(--g38-dossier-inset);
  cursor: pointer;
}

.g38-btn-secondary:hover {
  border-color: var(--g38-led);
  background: var(--g38-led);
  color: var(--g38-ink);
}

.g38-btn-remove--inline {
  width: auto;
  color: var(--g38-dossier-muted);
  background: transparent;
}

.g38-btn-remove--inline:hover {
  color: #991b1b;
  border-color: #fca5a5;
  background: #fef2f2;
}

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

.g38-profile-page .g38-btn-outline {
  color: var(--g38-dossier-ink);
  background: var(--g38-dossier-inset);
  border: 1px solid rgba(61, 90, 91, 0.55);
}

.g38-profile-page .g38-btn-outline:hover {
  border-color: var(--g38-led);
  background: var(--g38-led);
  color: var(--g38-ink);
}

.g38-profile-page .g38-btn-primary {
  color: var(--g38-ink);
  background: var(--g38-led);
}

.g38-empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--g38-dossier-muted);
  border: 1px dashed rgba(61, 90, 91, 0.45);
  border-radius: 2px;
  background: var(--g38-dossier-inset);
}

.g38-empty-state p {
  margin: 0 0 14px;
}

.g38-loading {
  text-align: center;
  padding: 36px 12px;
  color: var(--g38-dossier-muted);
}

.g38-loading-spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 3px solid rgba(61, 90, 91, 0.35);
  border-top-color: var(--g38-led);
  border-radius: 50%;
  animation: g38-profile-spin 0.7s linear infinite;
  margin-bottom: 8px;
}

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

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

.g38-avatar-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--g38-dossier-line);
}

.g38-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--g38-ink);
  background: var(--g38-led);
  border: 1px solid rgba(18, 18, 18, 0.2);
}

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

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

.g38-avatar-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--g38-dossier-muted);
}

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

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

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

.g38-profile-form label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--g38-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g38-metal);
}

.g38-profile-form .g38-form-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--g38-dossier-ink);
  background: var(--g38-dossier-inset);
  border: 1px solid rgba(61, 90, 91, 0.45);
  border-radius: 2px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.g38-profile-form .g38-form-input:focus {
  border-color: var(--g38-led);
  box-shadow: 0 0 0 2px rgba(240, 162, 2, 0.22);
}

.g38-profile-form .g38-form-input[disabled] {
  background: rgba(18, 18, 18, 0.06);
  color: var(--g38-dossier-muted);
  cursor: not-allowed;
}

.g38-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 40000;
  max-width: min(420px, 90vw);
  padding: 12px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  border-radius: 2px;
  border: 1px solid transparent;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.28s ease;
  pointer-events: none;
}

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

.g38-toast.success {
  color: #14532d;
  background: #ecfdf3;
  border-color: #86efac;
}

.g38-toast.error {
  color: #7f1d1d;
  background: #fef2f2;
  border-color: #fca5a5;
}

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

.g38-confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30000;
  background: rgba(10, 10, 11, 0.78);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.g38-confirm-modal {
  width: 100%;
  max-width: 360px;
  padding: 24px;
  background: var(--g38-dossier);
  border: 1px solid rgba(61, 90, 91, 0.55);
  border-radius: 2px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  text-align: center;
  color: var(--g38-dossier-ink);
}

.g38-confirm-title {
  margin: 0 0 6px;
  font-size: 1.0625rem;
  color: var(--g38-dossier-ink);
}

.g38-confirm-desc {
  margin: 0 0 18px;
  font-size: 0.875rem;
  color: var(--g38-dossier-muted);
}

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

.g38-confirm-cancel,
.g38-confirm-ok {
  flex: 1;
  min-height: 42px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
  border: 1px solid rgba(61, 90, 91, 0.55);
}

.g38-confirm-cancel {
  background: var(--g38-dossier-inset);
  color: var(--g38-dossier-ink);
}

.g38-confirm-cancel:hover {
  border-color: var(--g38-ink);
}

.g38-confirm-ok {
  background: var(--g38-led);
  color: var(--g38-ink);
  border-color: var(--g38-led);
}

.g38-confirm-ok:hover {
  filter: brightness(1.06);
}

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

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

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

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

  .g38-toast {
    transition: none;
  }

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


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

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

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

.g38-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: g38-confirm-spin 0.7s linear infinite;
}

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