.player-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(10, 10, 18, 0.95);
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  position: sticky;
  top: 0;
  z-index: 50;
}

.player-back {
  color: var(--cream-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.player-back:hover { color: var(--gold); }

.player-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.player-brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gold);
}

.player-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.player-loading,
.player-error {
  text-align: center;
  color: var(--cream-muted);
  padding: 3rem 1rem;
}

.card {
  background: linear-gradient(160deg, var(--navy-light), var(--navy));
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
}

/* Pending state */
.player-pending {
  text-align: center;
  padding: 2rem 1.5rem;
}

.pending-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  margin-bottom: 1rem;
}

.player-pending h1 {
  font-family: var(--font-display);
  color: var(--gold-light);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.pending-msg {
  color: var(--cream);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.pending-url-box {
  display: flex;
  gap: 0.5rem;
  margin: 0 auto 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  width: fit-content;
  max-width: 100%;
}

.pending-url-box input {
  flex: 1 1 200px;
  max-width: 420px;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: var(--radius);
  color: var(--cream);
  font-size: 0.82rem;
  text-align: center;
}

.pending-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pending-qr p {
  color: var(--cream-muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.pending-qr img {
  border-radius: 12px;
  border: 4px solid #fff;
  background: #fff;
}

.pending-hint {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--cream-muted);
}

.player-edit-link { margin-top: 1rem; display: inline-block; }

.player-banner {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.player-banner.pending {
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.35);
  color: var(--gold-light);
}

.player-banner.rejected {
  background: rgba(196, 30, 58, 0.12);
  border: 1px solid rgba(196, 30, 58, 0.35);
  color: #f0a0a8;
}

.player-profile-actions {
  margin-bottom: 1rem;
  text-align: right;
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
}

/* Player self-edit */
.player-edit-card h1 {
  font-family: var(--font-display);
  color: var(--gold-light);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.edit-intro, .edit-notice {
  color: var(--cream-muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.edit-notice.pending { color: var(--gold-light); }

.edit-back-link {
  color: var(--cream-muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.edit-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.edit-field { margin-bottom: 0.85rem; }

.edit-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cream-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.edit-field input,
.edit-field select,
.edit-field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius);
  color: var(--cream);
  font-size: 0.88rem;
  font-family: inherit;
}

.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.edit-section { margin-bottom: 1.25rem; }

.edit-section h3 {
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--gold-light);
  margin-bottom: 0.65rem;
}

.edit-role-grid, .edit-fielding-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.edit-role-chip, .edit-field-chip { cursor: pointer; }

.edit-role-chip input, .edit-field-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.edit-role-chip span, .edit-field-chip span {
  display: block;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 50px;
  font-size: 0.75rem;
  color: var(--cream-muted);
}

.edit-role-chip input:checked + span,
.edit-field-chip input:checked + span {
  background: rgba(201, 162, 39, 0.18);
  border-color: var(--gold);
  color: var(--gold-light);
}

.edit-profile-pic {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.edit-profile-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  overflow: hidden;
}

.edit-profile-preview img { width: 100%; height: 100%; object-fit: cover; }

.edit-profile-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.75rem;
  background: var(--navy);
}

.btn-edit-upload {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 50px;
  color: var(--gold);
  font-size: 0.78rem;
  cursor: pointer;
}

.btn-edit-remove {
  background: none;
  border: none;
  color: #f08090;
  font-size: 0.78rem;
  cursor: pointer;
}

.edit-media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.edit-media-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.edit-media-item img { width: 100%; height: 100%; object-fit: cover; }

.edit-media-item.marked-delete { opacity: 0.35; outline: 2px dashed #f08090; }

.edit-media-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(196, 30, 58, 0.9);
  color: #fff;
  cursor: pointer;
}

.edit-video-stack { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 0.65rem; }

.edit-video-item video { width: 100%; border-radius: 8px; background: #000; }

.edit-award-row { display: flex; gap: 0.4rem; margin-bottom: 0.4rem; }

.edit-award-row input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius);
  color: var(--cream);
}

.edit-award-remove {
  width: 32px;
  border: 1px solid rgba(196, 30, 58, 0.35);
  border-radius: 50%;
  background: transparent;
  color: #f08090;
  cursor: pointer;
}

.btn-edit-add {
  background: none;
  border: 1px dashed rgba(201, 162, 39, 0.35);
  color: var(--gold);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.78rem;
  cursor: pointer;
}

.edit-media-hint { font-size: 0.75rem; color: var(--cream-muted); }

.edit-msg { margin-top: 0.75rem; font-size: 0.85rem; }

.edit-msg.error { color: #f08090; }

.edit-msg.success { color: #7dcea0; }

.btn-block { width: 100%; margin-top: 0.5rem; }

@media (max-width: 520px) {
  .edit-grid { grid-template-columns: 1fr; }
  .edit-media-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Full profile */
.player-profile {
  position: relative;
}

.profile-share-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.35rem;
  z-index: 2;
}

.profile-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--cream-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.profile-share-btn svg {
  width: 18px;
  height: 18px;
}

.profile-share-wa:hover {
  color: #25d366;
  border-color: rgba(37, 211, 102, 0.5);
  background: rgba(37, 211, 102, 0.12);
}

.profile-share-qr:hover {
  color: var(--gold-light);
  border-color: rgba(201, 162, 39, 0.55);
  background: rgba(201, 162, 39, 0.12);
}

.player-profile .modal-player-header {
  padding-right: 4.75rem;
}

.player-profile .modal-player-header > div {
  min-width: 0;
}

.player-profile h1 {
  font-family: var(--font-display);
  color: var(--cream);
  font-size: 1.2rem;
  margin: 0.25rem 0;
  line-height: 1.25;
}

@media (max-width: 480px) {
  .player-profile h1 {
    font-size: 0.95rem;
  }

  .player-profile .modal-player-header img {
    width: 72px;
    height: 72px;
  }
}

.profile-photo {
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
}

.profile-about {
  font-size: 0.88rem;
  color: var(--cream-muted);
  line-height: 1.65;
  white-space: pre-wrap;
}

.profile-photo-btn {
  padding: 0;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
}

.profile-photo-btn img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.profile-photo-btn:hover img { transform: scale(1.05); }

/* QR share modal */
.profile-qr-modal {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.profile-qr-modal[hidden] { display: none !important; }

.profile-qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
}

.profile-qr-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 320px);
  padding: 1.5rem 1.25rem 1.25rem;
  background: linear-gradient(160deg, var(--navy-light), var(--navy));
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: var(--radius-lg);
  text-align: center;
}

.profile-qr-panel h3 {
  font-family: var(--font-display);
  color: var(--gold-light);
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.profile-qr-name {
  color: var(--cream-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.profile-qr-panel img {
  display: block;
  margin: 0 auto 1rem;
  border-radius: 12px;
  border: 4px solid #fff;
  background: #fff;
}

.profile-qr-wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
}

.profile-qr-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.profile-qr-close:hover { color: var(--cream); }

/* Lightbox */
.player-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.player-lightbox[hidden] { display: none !important; }

.player-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
}

.player-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

.player-lightbox img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 90svh;
  border-radius: 8px;
}
