/* ── Profile ─────────────────────────────────────────────────────────────── */

.profile-container {
  max-width: 960px;
  margin: var(--space-12) auto var(--space-8);
  border-radius: var(--material-panel-radius, 1.8rem);
  overflow: visible;
  color: rgb(20 20 30 / 0.92);
}

.profile-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgb(0 0 0 / 0.08);
}

.profile-bar__identity {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex-shrink: 0;
}

.profile-bar__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.1);
  color: rgb(20 20 30 / 0.7);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  overflow: hidden;
}

.profile-bar__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-bar__name {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgb(20 20 30 / 0.9);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
}

.profile-bar__tabs {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  flex: 1;
  justify-content: center;
  min-width: 0;
  flex-wrap: wrap;
}

.profile-bar__tab {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  color: rgb(20 20 30 / 0.7);
  transition: background 0.15s, color 0.15s;
}

.profile-bar__tab:hover:not(.profile-bar__tab--disabled) {
  background: rgb(0 0 0 / 0.06);
  color: rgb(20 20 30 / 0.92);
}

.profile-bar__tab--active {
  background: rgb(0 0 0 / 0.08);
  color: rgb(20 20 30 / 1);
}

.profile-bar__tab--disabled {
  color: rgb(20 20 30 / 0.3);
  cursor: not-allowed;
}

.profile-bar__signout {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgb(0 0 0 / 0.05);
  border: 1px solid rgb(0 0 0 / 0.1);
  color: rgb(20 20 30 / 0.75);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
  letter-spacing: 0.005em;
}

.profile-bar__signout:hover {
  background: rgb(220 60 60 / 0.1);
  color: rgb(200 40 40 / 1);
  border-color: rgb(220 60 60 / 0.25);
}

.profile-bar__signout-icon {
  flex-shrink: 0;
  display: block;
}

.profile-container__body {
  padding: var(--space-6) var(--space-5);
}

/* ── Profile empty state ─────────────────────────────────────── */

.profile-empty {
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

.profile-empty__title {
  font-size: var(--font-size-600);
  font-weight: 600;
  color: rgb(20 20 30 / 0.9);
  margin: 0 0 var(--space-2);
}

.profile-empty__body {
  font-size: var(--font-size-400);
  color: rgb(20 20 30 / 0.6);
  margin: 0 0 var(--space-5);
}

.profile-empty__actions {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.profile-empty__link {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  background: rgb(0 0 0 / 0.08);
  color: rgb(20 20 30 / 0.9);
  text-decoration: none;
  font-size: var(--font-size-300);
  font-weight: 500;
  transition: background 0.15s;
}

.profile-empty__link:hover {
  background: rgb(0 0 0 / 0.14);
}

/* ── Profile edit page ───────────────────────────────────────── */

.profile-edit {
  max-width: 420px;
  margin: 0 auto;
  padding: var(--space-4) 0;
}

.profile-edit__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Avatar section — centered circle + "Choose photo" button below */
.profile-edit__avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.profile-edit__avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: rgb(0 0 0 / 0.06);
  border: 2px solid rgb(0 0 0 / 0.1);
  flex-shrink: 0;
}

.profile-edit__avatar-preview img,
.profile-edit__avatar-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(20 20 30 / 0.6);
  font-size: 1.6rem;
  font-weight: 600;
  text-transform: uppercase;
}

.profile-edit__avatar-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

/* Hide the native file input — the <label> styled as c-btn is the
   click target, and the hidden input still fires the change event
   for the avatar-preview Stimulus controller. */
.profile-edit__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-edit__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* ── Profile owned apps/games list ───────────────────────────── */

.owned-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.owned-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.5);
  border: 1px solid rgb(0 0 0 / 0.08);
}

.owned-list__icon {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.owned-list__icon-img,
.owned-list__icon-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  background: rgb(0 0 0 / 0.06);
  display: block;
}

.owned-list__body {
  flex: 1;
  min-width: 0;
}

.owned-list__title {
  font-size: var(--font-size-500);
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: rgb(20 20 30 / 0.95);
}

.owned-list__subtitle {
  margin: 0;
  font-size: var(--font-size-300);
  color: rgb(20 20 30 / 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.owned-list__actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.owned-list__link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  background: rgb(0 0 0 / 0.06);
  color: rgb(20 20 30 / 0.9);
  text-decoration: none;
  font-size: var(--font-size-300);
  font-weight: 500;
  transition: background 0.15s;
}

.owned-list__link:hover {
  background: rgb(0 0 0 / 0.12);
}

.owned-list__link--primary {
  background: rgb(20 20 30 / 0.92);
  color: rgb(255 255 255 / 0.98);
}

.owned-list__link--primary:hover {
  background: rgb(20 20 30 / 1);
}

.owned-edit {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-4) 0;
}

.owned-edit__subject {
  font-size: var(--font-size-300);
  color: rgb(20 20 30 / 0.65);
  margin: 0 0 var(--space-5);
}

.owned-edit__subject-link {
  color: rgb(20 20 30 / 0.95);
  font-weight: 600;
  text-decoration: none;
}

.owned-edit__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Heading inside .profile-container__body — used by edit forms. */
.profile-section__title {
  margin: 0 0 var(--space-4);
  font-size: var(--font-size-500, 1.1rem);
  font-weight: 600;
  color: rgb(20 20 30 / 0.92);
  letter-spacing: -0.005em;
}

/* Generous breathing room above each "Change …" section header so the
   stacked profile / email / password forms feel like distinct cards. */
.profile-section__title--spaced {
  margin-top: var(--space-9);
}
