/* Profile screen — owned by Agent G.
 *
 * Palette is intentionally aligned with the header (deep navy + cream/slate)
 * so the dropdown → profile transition feels consistent.
 */

.profile {
  max-width: 56rem;
  margin: 1rem auto;
  font-family: "Quicksand", system-ui, sans-serif;
  color: #1e3a5f;
  width: 100%;
  padding: 0 1rem;
  box-sizing: border-box;
}

.profile__back {
  display: inline-block;
  margin-bottom: 1rem;
  color: #2c5475;
  text-decoration: none;
  font-weight: 600;
}
.profile__back:hover {
  text-decoration: underline;
}

.profile__identity {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.2rem;
  align-items: center;
  background: #fff;
  padding: 1.4rem;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.profile__avatar {
  width: 4rem;
  height: 4rem;
  background: #2c5475;
  border-radius: 8px;
}

.profile__name-block {
  min-width: 0;
}

.profile__username {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.4rem;
  color: #1e3a5f;
  font-weight: 800;
}

.profile__edit {
  background: none;
  border: 0;
  cursor: pointer;
  color: #2c5475;
  padding: 0;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  align-self: baseline;
  margin-left: 0.25rem;
}
.profile__edit:hover {
  color: #1e3a5f;
}

.profile__email {
  color: #64748b;
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  word-break: break-all;
}

.profile__headline {
  text-align: right;
}
.profile__headline #profile-headline-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1e3a5f;
  line-height: 1;
}
.profile__headline-label {
  display: block;
  color: #64748b;
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.profile__tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.6rem;
  margin-top: 1rem;
}
.profile__tile {
  background: #1e3a5f;
  color: #fff;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}
.profile__tile-num {
  font-size: 1.4rem;
  font-weight: 700;
}
.profile__tile-lbl {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 0.25rem;
}

.profile__info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.profile__info-card {
  background: #1e3a5f;
  color: #fff;
  padding: 1rem;
  border-radius: 8px;
}
.profile__info-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  opacity: 0.9;
}
.profile__info-card p {
  margin: 0.35rem 0;
  font-size: 0.95rem;
}
.profile__avatar-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.profile__avatar-btn {
  background: #2c5475;
  color: #fff;
  border: 0;
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  opacity: 0.6;
  cursor: not-allowed;
  font-family: inherit;
  margin-top: 0.4rem;
}

.profile__races {
  background: #fff;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.profile__races h3 {
  margin: 0 0 0.6rem;
  color: #1e3a5f;
  font-size: 1.05rem;
}
.profile__table {
  width: 100%;
  border-collapse: collapse;
}
.profile__table th,
.profile__table td {
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: 0.95rem;
}
.profile__table th {
  font-weight: 600;
  color: #1e3a5f;
}
.profile__table tr:last-child td {
  border-bottom: 0;
}
.profile__empty {
  color: #64748b;
  margin: 0.4rem 0 0;
}

.profile__rename {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  z-index: 80;
}
.profile__rename[hidden] {
  display: none;
}
.profile__rename-card {
  background: #fff;
  padding: 1.4rem;
  border-radius: 10px;
  min-width: 22rem;
  max-width: calc(100vw - 2rem);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.3);
}
.profile__rename-card h3 {
  margin: 0 0 0.7rem;
  color: #1e3a5f;
}
.profile__rename-card input {
  width: 100%;
  padding: 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
}
.profile__rename-status {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  min-height: 1.1em;
}
.profile__rename-status.bad {
  color: #b91c1c;
}
.profile__rename-status.ok {
  color: #15803d;
}
.profile__rename-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.8rem;
}
.profile__rename-actions button {
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
#profile-rename-cancel {
  background: #e2e8f0;
  color: #1e3a5f;
}
#profile-rename-cancel:hover {
  background: #cbd5e1;
}
#profile-rename-save {
  background: #1e3a5f;
  color: #fff;
}
#profile-rename-save:hover {
  background: #2c5475;
}
#profile-rename-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .profile__tiles {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile__info-row {
    grid-template-columns: 1fr;
  }
  .profile__identity {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .profile__avatar {
    margin: 0 auto;
  }
  .profile__headline {
    text-align: center;
  }
  .profile__rename-card {
    min-width: 0;
    width: calc(100vw - 2rem);
  }
}
