.player-profile-form {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  color: #17324d;
}
.player-profile-card,
.player-identity-card,
.player-identity-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  text-align: center;
}
.player-profile-card h4,
.player-identity-card h4,
.player-identity-empty h4 { margin: 12px 0 8px; color: #17324d; font-size: 1.25rem; }
.player-profile-avatar {
  display: block;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  background: #eef2f7;
}
.player-profile-avatar-placeholder {
  display: grid;
  place-items: center;
  font-size: 42px;
}
.player-identity-stats { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.player-identity-card .player-identity-stats { margin-top: 12px; }
.player-identity-card .player-identity-stats h4 { margin: 0; overflow-wrap: anywhere; }
.player-profile-card > h4:first-of-type { margin-top: 0; }
.player-level-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 4px 14px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-weight: 700;
}
.player-profile-action,
.player-checkin-action,
.player-join-action,
.player-profile-photo-button,
.player-portal-search button {
  min-height: 48px;
  border-radius: 999px;
}
.player-profile-card .player-profile-action { width: 100%; margin-top: 20px; }
.player-portal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 480px;
  margin: 16px auto 0;
}
.player-portal-actions button { width: 100%; min-width: 0; min-height: 48px; border-radius: 999px; }
.player-portal-actions .player-profile-action,
.player-portal-actions .player-checkin-action {
  width: 100%;
  padding: 10px 12px;
  font-size: clamp(14px, 3.5vw, 16px);
}
.player-portal-actions .player-join-action { width: 100%; }
.player-portal-actions .player-identity-switch {
  grid-column: 1 / -1;
  justify-self: center;
  width: auto;
}
.player-portal-actions .player-profile-action,
.player-portal-actions .player-checkin-action,
.player-portal-actions .player-search-action,
.player-portal-actions .player-join-action,
.player-profile-card .player-profile-action,
.player-identity-change-action,
.player-identity-actions button {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #334155;
  font: inherit;
  font-weight: 700;
}
.player-portal-actions .player-checkin-action:not(:disabled):hover,
.player-portal-actions .player-search-action:not(:disabled):hover,
.player-profile-card .player-profile-action:hover,
.player-identity-change-action:hover,
.player-identity-actions button:hover { background: #f8fafc; }
.player-portal-actions .player-join-action {
  border-color: #166534;
  background: linear-gradient(135deg, #16803d, #14532d);
  color: #fff;
}
.player-portal-actions .player-join-action:not(:disabled):hover {
  background: linear-gradient(135deg, #166534, #123d26);
}
.player-claim-label {
  margin-left: auto;
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #334155;
  font-weight: 700;
}
.player-claim-suggestion { width: 100%; margin: 12px 0; }
.player-profile-kicker { margin: 0; color: #64748b; font-weight: 700; }
.player-identity-switch {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font: inherit;
}
.player-identity-empty-icon { font-size: 40px; }
.player-identity-empty p { margin: 4px 0 10px; color: #64748b; line-height: 1.5; }
.player-checkin-message { grid-column: 1 / -1; margin: 12px 0 0; color: #92400e; line-height: 1.5; text-align: center; }
.player-checkin-message span { white-space: nowrap; }
.player-portal-search { position: relative; max-width: 480px; margin: 16px auto 12px; }
.player-portal-search .history-search { min-width: 0; }
.player-portal-list-title { max-width: 480px; margin: 0 auto 8px; color: #334155; font-size: 1rem; }
.player-portal-list { display: grid; max-width: 480px; gap: 8px; margin: 0 auto; }
.player-portal-list-empty { margin: 0; color: #64748b; }
.player-identity-confirm {
  width: min(100%, 480px);
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  color: #17324d;
}
.player-identity-confirm-avatar {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  box-sizing: border-box;
  background: #eef2f7;
  object-fit: cover;
}
.player-identity-confirm-avatar.player-profile-avatar-placeholder { display: grid; place-items: center; font-size: 32px; }
.player-identity-confirm h4 { margin: 0 0 16px; font-size: 1.15rem; }
.player-identity-confirm dl { display: grid; gap: 10px; margin: 0; }
.player-identity-confirm dl>div { display: flex; justify-content: space-between; gap: 12px; }
.player-identity-confirm dt { color: #64748b; }
.player-identity-confirm dd { margin: 0; font-weight: 700; }
.player-identity-confirm p { margin: 16px 0; text-align: center; }
.player-identity-actions { display: grid; gap: 12px; }
.player-identity-actions button { min-height: 48px; width: 100%; border-radius: 999px; cursor: pointer; }
.player-identity-confirm .player-identity-actions button:first-child {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}
.player-identity-confirm .player-identity-actions button:first-child:hover { background: #1d4ed8; }
.player-identity-error { color: #b42318; }
.player-identity-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .45);
}
.player-identity-dialog-backdrop .player-identity-actions button:first-child {
  border-color: #d1d5db;
  background: #fff;
  color: #334155;
}
.player-identity-dialog-backdrop .player-identity-actions button:first-child:hover { background: #f8fafc; }
.player-profile-card .player-identity-change-action { width: 100%; min-height: 48px; margin-top: 12px; border-radius: 999px; cursor: pointer; }
.player-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  text-align: left;
}
.player-card-row > .history-table-avatar,
.player-card-row > .history-table-avatar-placeholder { width: 40px; height: 40px; flex: 0 0 40px; }
.player-card-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.player-card-details { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.player-card-details .player-level-chip, .player-card-details .power-pill, .player-card-details .player-claim-label { flex: 0 0 auto; }
.player-profile-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.player-profile-field { display: block; margin: 0 0 6px; font-weight: 600; }
#playerProfileName {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #d7dfd7;
  border-radius: 16px;
  box-sizing: border-box;
  background: #fff;
  color: #17324d;
  font: inherit;
}
.player-profile-levels { padding: 0; margin: 16px 0 14px; border: 0; min-width: 0; }
.player-profile-levels legend { margin-bottom: 8px; }
.player-profile-levels > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.player-profile-level { position: relative; min-width: 0; text-align: center; }
.player-profile-level input { position: absolute; opacity: 0; }
.player-profile-level span {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  box-sizing: border-box;
  font-size: 15px;
}
.player-profile-level small {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}
.player-profile-level input:checked + span {
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff;
}
.player-profile-power { padding: 16px 18px; border-radius: 20px; background: #f8fafc; }
#playerProfilePower { width: 100%; accent-color: #2563eb; }
.player-profile-range { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
#playerProfilePowerValue { color: #2563eb; font-size: 24px; font-weight: 700; }
#playerProfileMessage:empty { display: none; }
#playerProfileMessage { color: #b42318; line-height: 1.45; }
.player-profile-form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.player-profile-form-actions .player-profile-action { width: 100%; margin-top: 16px; }
.player-profile-action:disabled { background: #bfc9d5; color: #fff; opacity: 1; cursor: not-allowed; }

@media (max-width: 520px) {
  .player-card-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "avatar name" "avatar details"; gap: 6px 10px; padding: 10px 12px; }
  .player-card-row > .history-table-avatar, .player-card-row > .history-table-avatar-placeholder { grid-area: avatar; }
  .player-card-row .player-card-name { grid-area: name; }
  .player-card-details { grid-area: details; min-width: 0; }
  .player-card-details .player-claim-label { margin-left: auto; }
}
