/* =============================================================================
   r524 — PLAYER PROFILE CARD · GAME-SKIN REDESIGN
   -----------------------------------------------------------------------------
   The inspect card was a flat, generic modal (inline styles, a plain white
   avatar ring, a bare UID chip). This rebuilds it in the game's own visual
   language so it reads as part of the arena:

     · the same card surface, border and radius as .game-hud-bar
     · the same corner-pod seat framing for the avatar (.player-corner-pod)
     · the same accent colours as the board corners (red / green / yellow / sky)
     · the same stat-chip treatment as the in-match HUD
     · a reserved slot for the future "send emote" action (r524-next)
   ========================================================================== */

/* ── the card shell ───────────────────────────────────────────────────── */
#modal-inspect-player .name-modal-box {
  max-width: 440px !important;
  padding: 0 !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-line) !important;
  border-radius: 18px !important;
  overflow: hidden;
  display: block !important;
  text-align: left !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(107, 78, 255, 0.06) !important;
  animation: profCardIn 0.24s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes profCardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── accent bar (uses the player's own board colour) ──────────────────── */
#modal-inspect-player .name-modal-box::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--prof-accent, #6B4EFF) 0%, rgba(107, 78, 255, 0.05) 100%);
}

/* ── header: avatar pod + identity + close ────────────────────────────── */
.pf-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-line);
}

/* the avatar is framed like a board seat, not a bare circle */
.pf-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  padding: 3px;
  background: linear-gradient(150deg, var(--prof-accent, #6B4EFF) 0%, rgba(107, 78, 255, 0.18) 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
#insp-avatar-box {
  width: 100% !important;
  height: 100% !important;
  border-radius: 11px !important;
  border: none !important;
  background: var(--bg-card-inner) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 26px;
  line-height: 1;
}
#insp-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 11px;
}
/* small corner dot — the same "is speaking / is in game" marker language */
.pf-avatar-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--text-dim);
  border: 2px solid var(--bg-card);
}
.pf-avatar-dot.is-online { background: var(--green); box-shadow: 0 0 8px rgba(16, 185, 129, 0.7); }

.pf-ident { flex: 1; min-width: 0; }

.pf-name {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.15;
}
.pf-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* role / badge chip next to the name */
.pf-role {
  flex-shrink: 0;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(107, 78, 255, 0.4);
  background: rgba(107, 78, 255, 0.14);
  color: #A78BFA;
}
.pf-role.is-owner { border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.14); color: var(--gold); }

/* the UID chip — same shape as the in-match chips */
.pf-uid {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.32);
  background: rgba(59, 130, 246, 0.12);
  color: #60A5FA;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pf-uid:active { background: rgba(59, 130, 246, 0.22); border-color: rgba(59, 130, 246, 0.55); }
.pf-uid-label { font-size: 9px; font-weight: 800; opacity: 0.75; letter-spacing: 0.3px; }

/* ── close button ─────────────────────────────────────────────────────── */
.pf-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.pf-close:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.12); color: var(--text-main); }

/* ── stat strip (balance + trophies) ──────────────────────────────────── */
.pf-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 14px 0;
}
.pf-stat {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-line);
}
.pf-stat.is-gold  { border-color: rgba(245, 158, 11, 0.28); background: rgba(245, 158, 11, 0.07); }
.pf-stat.is-sky   { border-color: rgba(56, 189, 248, 0.28); background: rgba(56, 189, 248, 0.07); }
.pf-stat-ico {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.pf-stat.is-gold .pf-stat-ico { background: rgba(245, 158, 11, 0.16); }
.pf-stat.is-sky  .pf-stat-ico { background: rgba(56, 189, 248, 0.16); }
.pf-stat-body { min-width: 0; }
.pf-stat-label {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-dim);
  line-height: 1.2;
}
.pf-stat.is-gold .pf-stat-label { color: rgba(245, 158, 11, 0.85); }
.pf-stat.is-sky  .pf-stat-label { color: rgba(56, 189, 248, 0.85); }
.pf-stat-value {
  font-size: 14px;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.2;
  white-space: nowrap;
}

/* ── form row (matches / wins / win rate) ─────────────────────────────── */
.pf-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 10px 14px 0;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}
.pf-form-cell { position: relative; }
.pf-form-cell + .pf-form-cell::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 12%;
  height: 76%;
  width: 1px;
  background: rgba(255, 255, 255, 0.07);
}
.pf-form-label {
  display: block;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 3px;
}
.pf-form-value {
  display: block;
  font-size: 16px;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.1;
}
.pf-form-cell.is-win .pf-form-value   { color: var(--green); }
.pf-form-cell.is-rate .pf-form-value  { color: var(--gold); }

/* ── recent matches ───────────────────────────────────────────────────── */
.pf-recent {
  padding: 12px 14px 14px;
}
.pf-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}
.pf-recent-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.pf-recent-count {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-dim);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-line);
}
.pf-match-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 168px;
  overflow-y: auto;
}
/* r599 — প্রতিপক্ষের নাম পুরো লাইনে, যাতে \"VS QA Freya\" কেটে না যায় */
.pf-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.032);
  border: 1px solid rgba(255, 255, 255, 0.055);
}
.pf-match.is-win { border-color: rgba(16, 185, 129, 0.26); background: rgba(16, 185, 129, 0.07); }
.pf-match.is-loss { border-color: rgba(239, 68, 68, 0.2); background: rgba(239, 68, 68, 0.05); }
.pf-match-left { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px; min-width: 0; grid-column: 1; }
.pf-match-result {
  flex-shrink: 0;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
}
.pf-match.is-win  .pf-match-result { color: #34D399; background: rgba(16, 185, 129, 0.18); }
.pf-match.is-loss .pf-match-result { color: #F87171; background: rgba(239, 68, 68, 0.18); }
.pf-match-mode {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}
.pf-match-date { font-size: 9px; font-weight: 700; color: var(--text-dim); white-space: nowrap; }
.pf-match-amt { flex-shrink: 0; font-size: 12px; font-weight: 900; grid-column: 2; grid-row: 1 / span 2; }
.pf-match-opp { flex: 0 0 100%; font-size: 10px; font-weight: 800; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-match-opp b { color: var(--text-main); font-weight: 900; }
.pf-match.is-win  .pf-match-amt { color: var(--green); }
.pf-match.is-loss .pf-match-amt { color: var(--red); }
.pf-empty {
  text-align: center;
  padding: 16px 0;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 700;
}

/* ── action row — the reserved slot for the future emote action ──────── */
/* r524-next: the "send emote" button drops in here. The slot is already
   laid out so adding it later needs no re-flow of the card. */
.pf-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 14px;
}
.pf-actions:empty { display: none; }
.pf-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}
.pf-action:active { transform: scale(0.96); }
.pf-action.is-emote {
  border-color: rgba(107, 78, 255, 0.4);
  background: rgba(107, 78, 255, 0.14);
  color: #C4B5FD;
}
.pf-action.is-emote:active { background: rgba(107, 78, 255, 0.24); }

/* ── scrollbar inside the card ────────────────────────────────────────── */
.pf-match-list::-webkit-scrollbar { width: 3px; }
.pf-match-list::-webkit-scrollbar-track { background: transparent; }
.pf-match-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 3px; }
.pf-match-list { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) transparent; }

/* ── the admin / agent fire frame still works on the new square avatar ── */
/* style.css paints #insp-avatar-wrap.role-admin / .role-agent with a
   circular conic-gradient ring. The redesigned avatar is a rounded square,
   so the ring shape and the inner plate are overridden here to match. */
#insp-avatar-wrap.role-admin,
#insp-avatar-wrap.role-agent {
  padding: 3px !important;
  border-radius: 14px !important;
  overflow: visible !important;
}
#insp-avatar-wrap.role-admin::before,
#insp-avatar-wrap.role-agent::before {
  inset: -2px !important;
  border-radius: 16px !important;
  filter: blur(3px) !important;
}
#insp-avatar-wrap.role-admin::after,
#insp-avatar-wrap.role-agent::after {
  inset: 1px !important;
  border-radius: 13px !important;
  background: var(--bg-card-inner) !important;
  z-index: 0 !important;
}
#insp-avatar-wrap.role-admin #insp-avatar-box,
#insp-avatar-wrap.role-agent #insp-avatar-box {
  position: relative;
  z-index: 2;
}

/* ── small screens ────────────────────────────────────────────────────── */
@media (max-width: 400px) {
  #modal-inspect-player .name-modal-box { border-radius: 16px !important; }
  .pf-head { padding: 12px 12px 10px; gap: 10px; }
  .pf-avatar-wrap { width: 50px; height: 50px; border-radius: 13px; }
  #insp-avatar-box { border-radius: 10px !important; font-size: 23px; }
  .pf-stats { padding: 10px 12px 0; gap: 7px; }
  .pf-stat { padding: 8px 9px; gap: 7px; }
  .pf-form { margin: 9px 12px 0; padding: 9px 6px; }
  .pf-recent { padding: 11px 12px 12px; }
  .pf-actions { padding: 0 12px 12px; }
  .pf-form-value { font-size: 15px; }
}
