/* GamePingy shared header — player-settings modal + avatar badges.
 * The top bar itself is styled inline by gp-header.js (identical across games);
 * this file carries the modal/avatar theme that used to live in each game's
 * own styles.css. Loaded by every game page (see /shared/gp-header.js). */

/* ---- avatar badges ---- */
.gp-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #fff; font-weight: 800;
  width: 32px; height: 32px; font-size: 15px; flex-shrink: 0;
}
.gp-avatar.av-1 { background: linear-gradient(135deg, #ff914d, #ff4d62); }
.gp-avatar.av-2 { background: linear-gradient(135deg, #5865f2, #914dff); }
.gp-avatar.av-3 { background: linear-gradient(135deg, #25d366, #12a4c4); }
.gp-avatar.av-4 { background: linear-gradient(135deg, #fbbf24, #f97316); }
.gp-avatar.av-5 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.gp-avatar.av-6 { background: linear-gradient(135deg, #14b8a6, #3b82f6); }
.gp-avatar.av-7 { background: linear-gradient(135deg, #ef4444, #7c2d12); }
.gp-avatar.av-8 { background: linear-gradient(135deg, #64748b, #0f172a); }

/* ---- player settings popup modal ---- */
.gp-modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 6, 20, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.gp-modal-overlay.hidden { display: none; }
.gp-modal {
  background: #171233; color: #eef;
  border: 1px solid #3a2f6b; border-radius: 16px;
  width: 100%; max-width: 380px;
  padding: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.gp-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.gp-modal-head h2 { margin: 0; font-size: 18px; }
.gp-modal-x {
  background: transparent; border: none; color: #a99fd6;
  font-size: 18px; cursor: pointer; padding: 4px 8px;
}
.gp-avatar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
#gp-settings-preview { width: 56px; height: 56px; font-size: 24px; }
.gp-phone-line { font-size: 13px; color: #a99fd6; }
.gp-field-label { display: block; font-size: 12px; color: #a99fd6; margin: 10px 0 6px; font-weight: 700; }
.gp-text-input {
  width: 100%; box-sizing: border-box;
  background: #0f0c24; border: 1px solid #3a2f6b; color: #fff;
  border-radius: 10px; padding: 10px 12px; font-size: 15px;
}
.gp-avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.gp-avatar-pick {
  width: 100%; aspect-ratio: 1; font-size: 14px;
  border: 2px solid transparent; cursor: pointer; padding: 0;
}
.gp-avatar-pick.selected { border-color: #fff; box-shadow: 0 0 0 2px #ff914d; }
.gp-modal-error { color: #ff8f9d; font-size: 13px; margin-top: 10px; min-height: 18px; }
.gp-modal-error.hidden { display: none; }
.gp-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.gp-btn-secondary {
  background: transparent; color: #cbd5ff;
  border: 1px solid #3a2f6b; border-radius: 10px;
  padding: 10px 16px; font-weight: 700; cursor: pointer;
}
.gp-btn-primary {
  background: #ff914d; color: #1a1005; border: none; border-radius: 10px;
  padding: 10px 20px; font-weight: 800; cursor: pointer;
}
.gp-btn-primary:disabled { opacity: 0.6; cursor: default; }

/* ---- phone-width top bar ----
 * A room that also shows the invite button carries five controls (logo,
 * code, name, avatar, copy). At 390px they collided and "Copy Invite" wrapped
 * onto two lines. Drop the wordmark (the logo still links home), tighten the
 * spacing and keep the invite button on one line. */
@media (max-width: 480px) {
  #gp-top-bar { padding: 8px 10px !important; gap: 6px; }
  #gp-top-bar > div { gap: 6px !important; min-width: 0; }
  #gp-top-bar:has(#gp-copy-link) > div:first-child > a > span { display: none; }
  #gp-top-bar #gp-room-code { min-width: 64px; padding: 5px 8px; font-size: 13px; letter-spacing: 1px; }
  #gp-top-bar #gp-user-display {
    max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  #gp-top-bar #gp-copy-link {
    padding: 6px 8px !important; font-size: 11px !important; white-space: nowrap;
  }
}
