/* Member profile — BOX OFFICE tickets (paper / neon tokens) */

.g46-profile-page {
  flex: 1;
}

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

.g46-profile-main { min-width: 0; }

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

/* Shelf labels sit on paper, not the night banner */
.g46-shelf-block .g46-aside-label {
  color: var(--g46-muted);
}

.g46-btn-remove,
.g46-btn-clear,
.g46-btn-load-more,
.g46-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid var(--g46-line);
  border-radius: var(--g46-radius);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.g46-btn-remove {
  width: 100%;
  margin-top: 8px;
  color: var(--g46-ink);
  background: var(--g46-paper);
}

.g46-btn-remove:hover {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
}

.g46-btn-clear {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.78rem;
  color: var(--g46-neon);
  background: transparent;
  border-color: var(--g46-line);
}

.g46-btn-clear:hover {
  color: #fff;
  background: var(--g46-neon);
  border-color: var(--g46-neon);
}

.g46-btn-load-more {
  position: relative;
  width: 100%;
  margin-top: 1rem;
  color: #fff;
  background: var(--g46-neon);
  border-color: var(--g46-neon);
}

.g46-btn-load-more:hover {
  filter: brightness(1.08);
}

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

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

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


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

.g46-btn-secondary {
  color: var(--g46-ink);
  background: var(--g46-paper);
}

.g46-btn-secondary:hover {
  color: var(--g46-teal);
  border-color: var(--g46-teal);
  background: rgba(31, 157, 138, 0.08);
}

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

.g46-empty-state p { margin: 0 0 14px; color: var(--g46-muted); }

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

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

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

/* Avatar upload */
.g46-profile-form-block { max-width: 560px; }

.g46-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(--g46-line);
}

.g46-avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(240, 180, 41, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--g46-lantern), var(--g46-neon));
}

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

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

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

.g46-btn-remove--inline {
  width: auto;
  min-height: 36px;
  margin-top: 0;
  color: #b91c1c;
  background: transparent;
  border-color: rgba(185, 28, 28, 0.35);
}

.g46-btn-remove--inline:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: #dc2626;
  color: #991b1b;
}

/* Form */
.g46-profile-form { width: 100%; }

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

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

.g46-profile-form label,
.g46-form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--g46-muted);
}

.g46-profile-form .g46-form-input,
.g46-form-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--g46-ink);
  background: var(--g46-paper);
  border: 1px solid var(--g46-line);
  border-radius: var(--g46-radius);
  outline: none;
}

.g46-profile-form .g46-form-input:focus,
.g46-form-input:focus {
  border-color: var(--g46-teal);
  box-shadow: 0 0 0 3px rgba(31, 157, 138, 0.18);
}

.g46-profile-form .g46-form-input[disabled],
.g46-form-input[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  color: var(--g46-muted);
  background: rgba(26, 23, 20, 0.04);
}

/* Toast */
.g46-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 20px;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
  border: 1px solid transparent;
  border-radius: var(--g46-radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  transition: transform 0.28s ease;
  pointer-events: none;
}

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

.g46-toast.success {
  color: #14532d;
  background: #dcfce7;
  border-color: #22c55e;
}

.g46-toast.error {
  color: #7f1d1d;
  background: #fee2e2;
  border-color: #ef4444;
}

.g46-toast.warning {
  color: #78350f;
  background: #fef3c7;
  border-color: #f59e0b;
}

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

.g46-confirm-overlay.show,
.g46-confirm-overlay[aria-hidden="false"] { display: flex; }

.g46-confirm-modal {
  width: 100%;
  max-width: 380px;
  padding: 1.5rem;
  background: var(--g46-sheet);
  border: 1px solid var(--g46-line);
  border-radius: var(--g46-radius);
  text-align: center;
}

.g46-confirm-title {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--g46-ink);
}

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

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

.g46-confirm-cancel,
.g46-confirm-ok {
  flex: 1;
  min-height: 44px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--g46-line);
  border-radius: var(--g46-radius);
}

.g46-confirm-cancel {
  background: var(--g46-paper);
  color: var(--g46-ink);
}

.g46-confirm-cancel:hover {
  color: var(--g46-teal);
  border-color: var(--g46-teal);
}

.g46-confirm-ok {
  background: var(--g46-neon);
  color: #fff;
  border-color: var(--g46-neon);
}

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

/* Ranked game cards in profile grids */
.g46-fav-grid .g46-ranked-card,
.g46-recent-grid .g46-ranked-card,
.g46-game-grid .g46-ranked-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--g46-paper);
  border: 1px solid var(--g46-line);
  border-radius: var(--g46-radius);
  overflow: hidden;
}

.g46-fav-grid .g46-ranked-card:hover,
.g46-recent-grid .g46-ranked-card:hover {
  border-color: var(--g46-lantern);
  transform: translateY(-2px);
}

.g46-fav-grid .g46-ranked-thumb,
.g46-recent-grid .g46-ranked-thumb,
.g46-game-grid .g46-ranked-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--g46-ph);
}

.g46-fav-grid .g46-ranked-thumb img,
.g46-recent-grid .g46-ranked-thumb img,
.g46-game-grid .g46-ranked-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g46-fav-grid .g46-ranked-body,
.g46-recent-grid .g46-ranked-body {
  padding: 10px 12px 12px;
}

.g46-fav-grid .game-title,
.g46-recent-grid .game-title,
.g46-fav-grid .game-title a,
.g46-recent-grid .game-title a {
  color: var(--g46-ink) !important;
  font-size: 0.875rem;
  text-decoration: none;
}

.g46-fav-grid .brief-comment-game,
.g46-recent-grid .brief-comment-game {
  color: var(--g46-muted);
  font-size: 0.75rem;
  -webkit-line-clamp: 1;
}

@media (min-width: 768px) {
  .g46-game-grid.g46-fav-grid,
  .g46-game-grid.g46-recent-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }
}


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

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

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

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

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