/* Public player sheet inside the same 4:3 console as the rest of the game. */
.has-player-profile-open { overflow: hidden; }
.player-profile-modal {
  position: fixed; inset: 0; z-index: 1200; display: none;
  color: var(--screen-ink);
  font-family: 'Jersey 15', sans-serif;
}
.player-profile-modal.is-open { display: grid; place-items: center; }
.player-profile-backdrop {
  position: absolute; inset: 0;
  background: transparent;
}
.player-profile-dialog {
  position: relative; z-index: 1;
  box-sizing: border-box;
  display: flex; flex-direction: column;
  width: var(--arcade-frame-width);
  aspect-ratio: 4 / 3;
  padding: var(--screen-pad);
  overflow: hidden;
  border-radius: var(--arcade-screen-radius);
  background: var(--screen-bg);
  color: var(--screen-ink);
  box-shadow: var(--arcade-screen-lip), var(--arcade-bezel), 0 0 180px 50px color-mix(in srgb, var(--scene-glow) 20%, transparent);
  container-type: inline-size;
}
.player-profile-screen {
  display: flex; flex-direction: column; gap: clamp(12px, 2dvh, 20px);
  flex: 1; min-height: 0;
  animation: arcade-screen-open 260ms steps(7) backwards;
}
.player-profile-header { flex: 0 0 auto; }
body .player-profile-header .arcade-page-title { font-size: clamp(26px, 4dvh, 44px); }
body .player-profile-header .game-brand .game-brand-main { font-size: clamp(22px, 3dvh, 34px); }
.player-profile-state,
.player-profile-content { min-height: 0; overflow-y: auto; scrollbar-color: var(--screen-line) transparent; }
.player-profile-state[hidden], .player-profile-content[hidden] { display: none; }
.player-profile-state {
  flex: 1; display: grid; align-content: center; justify-items: center; gap: 10px;
  color: var(--screen-muted); text-align: center; font-size: 24px;
}
.player-profile-state .fa-solid { color: var(--screen-accent); font-size: 30px; }
.player-profile-state.is-loading .fa-spinner { animation: profileSpin .8s linear infinite; }
.player-profile-state strong { color: var(--screen-ink); font-weight: 400; font-size: 34px; }
.player-profile-state p { margin: 0; }
.player-profile-content {
  flex: 1; display: grid; align-content: start; gap: clamp(12px, 2dvh, 20px);
  padding: 0 4px 4px 0;
}
.player-profile-hero {
  display: grid; grid-template-columns: clamp(90px, 14cqw, 150px) minmax(0, 1fr) auto;
  align-items: center; gap: clamp(14px, 3cqw, 32px);
  padding-bottom: clamp(12px, 2dvh, 20px);
  border-bottom: 1px solid var(--screen-line);
}
.player-profile-avatar-frame {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1;
  background: radial-gradient(ellipse at center, var(--screen-tint), transparent 70%);
}
.player-profile-avatar { width: 95%; transform: translateY(-16.666%); image-rendering: pixelated; }
.player-profile-identity { display: grid; gap: 8px; min-width: 0; }
.player-profile-kicker, .player-profile-section-title, .profile-mode-head, .profile-mode-row, .player-profile-match {
  display: flex; align-items: center;
}
.player-profile-kicker {
  gap: 8px; color: var(--screen-mint); font: 18px/1 'Jersey 15', sans-serif;
  letter-spacing: .09em; text-transform: uppercase;
}
.player-profile-kicker .fa-solid, .player-profile-section-title .fa-solid { color: var(--screen-accent); }
.player-profile-name {
  margin: 0; overflow-wrap: anywhere;
  color: var(--screen-ink); font: clamp(34px, 6cqw, 64px)/.9 'Jersey 15', sans-serif;
  text-shadow: 2px 2px var(--screen-shadow);
}
.player-profile-form { display: flex; flex-wrap: wrap; gap: 5px; min-height: 26px; }
.profile-form-dot {
  display: inline-grid; place-items: center; width: 25px; height: 25px;
  color: var(--screen-mint); background: var(--screen-panel);
  border-bottom: 2px solid var(--screen-mint);
  font: 19px/1 'Jersey 15', sans-serif;
}
.profile-form-dot.is-loss { color: var(--screen-muted); border-bottom-color: var(--screen-muted); }
.profile-form-empty { color: var(--screen-muted); font-size: 18px; }
.player-profile-spotlight {
  display: grid; justify-items: end; gap: 2px; min-width: 0;
  padding-left: clamp(12px, 2cqw, 24px); border-left: 1px solid var(--screen-line);
}
.player-profile-spotlight span, .player-profile-stat span, .profile-mode-row,
.player-profile-match time, .profile-match-main span, .player-profile-spotlight small {
  color: var(--screen-muted);
}
.player-profile-spotlight span, .player-profile-stat span {
  font: 18px/1 'Jersey 15', sans-serif; letter-spacing: .07em; text-transform: uppercase;
}
.player-profile-spotlight strong {
  color: var(--screen-accent); font: clamp(38px, 6cqw, 58px)/1 'Jersey 15', sans-serif;
  letter-spacing: .04em; text-shadow: 0 2px var(--screen-shadow);
}
.player-profile-spotlight small { max-width: 145px; font: 16px/1.1 'Jersey 15', sans-serif; text-align: right; }
.player-profile-summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--screen-line);
}
.player-profile-stat {
  display: grid; gap: 3px; padding: 10px clamp(8px, 2cqw, 20px);
  border-right: 1px solid var(--screen-line);
}
.player-profile-stat:last-child { border-right: 0; }
.player-profile-stat strong {
  color: var(--screen-ink); font: clamp(26px, 4cqw, 38px)/1 'Jersey 15', sans-serif;
  letter-spacing: .04em;
}
.player-profile-stat.is-primary strong { color: var(--screen-accent); }
.player-profile-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2cqw, 20px); }
.player-profile-mode-card {
  display: grid; gap: 8px; min-width: 0; padding: 12px 16px;
  background: var(--screen-panel); border-left: 3px solid var(--screen-line);
}
.profile-mode-head, .profile-mode-row, .player-profile-match { justify-content: space-between; gap: 10px; }
.profile-mode-head span { color: var(--screen-mint); font: 21px/1 'Jersey 15', sans-serif; }
.profile-mode-head strong { color: var(--screen-muted); font: 20px/1 'Jersey 15', sans-serif; }
.profile-mode-elo { color: var(--screen-accent); font: 38px/1 'Jersey 15', sans-serif; letter-spacing: .04em; }
.profile-mode-elo small { color: var(--screen-muted); font-size: .48em; }
.profile-mode-row { flex-wrap: wrap; font: 17px/1 'Jersey 15', sans-serif; }
.player-profile-recent { display: grid; gap: clamp(12px, 1.8dvh, 18px); padding-top: clamp(10px, 1.6dvh, 16px); }
.player-profile-section-title { gap: 10px; padding: 0 4px 10px; border-bottom: 1px solid var(--screen-line); }
.player-profile-section-title h3 { margin: 0; color: var(--screen-mint); font: 24px/1 'Jersey 15', sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.player-profile-match-list { display: grid; }
.player-profile-match { min-height: 50px; padding: 7px 10px; border-bottom: 1px solid var(--screen-line); }
.player-profile-match.is-win { box-shadow: inset 3px 0 var(--screen-mint); }
.player-profile-match.is-loss { box-shadow: inset 3px 0 var(--screen-muted); }
.profile-match-result {
  flex: 0 0 70px; color: var(--screen-mint);
  font: 19px/1 'Jersey 15', sans-serif; text-transform: uppercase;
}
.player-profile-match.is-loss .profile-match-result { color: var(--screen-muted); }
.profile-match-main { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.profile-match-main strong { color: var(--screen-ink); font: 23px/1 'Jersey 15', sans-serif; }
.profile-match-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 17px/1 'Jersey 15', sans-serif; }
.player-profile-match time { flex: 0 0 auto; font: 16px/1 'Jersey 15', sans-serif; }
.player-profile-empty { margin: 0; padding: 14px; color: var(--screen-muted); border-bottom: 1px solid var(--screen-line); }

.player-profile-trigger:not(.home-profile-cta) {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0;
  color: inherit;
  text-align: inherit;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.profile-link-label {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.42rem;
  max-width: 100%;
  min-width: 0;
}

.profile-link-label strong,
.profile-link-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-link-icon {
  display: inline-grid;
  place-items: center;
  min-width: 0;
  height: 1.02rem;
  padding: 0 0.38rem;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  border-radius: 999px;
  color: color-mix(in srgb, currentColor 54%, transparent);
  background: color-mix(in srgb, currentColor 7%, transparent);
  font-family: 'Jersey 15', 'PixelArt', monospace;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1;
  opacity: 0.72;
  text-transform: uppercase;
  transform: translateY(0.01em);
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.player-profile-trigger:not(.home-profile-cta):hover,
.player-profile-trigger:not(.home-profile-cta):focus-visible {
  color: var(--profile-cta, var(--ranking-cta, #ffd84a));
  text-decoration: none;
}

.player-profile-trigger:not(.home-profile-cta):hover .profile-link-icon,
.player-profile-trigger:not(.home-profile-cta):focus-visible .profile-link-icon {
  border-color: color-mix(in srgb, currentColor 38%, transparent);
  background: color-mix(in srgb, currentColor 12%, transparent);
  color: currentColor;
  opacity: 0.92;
  transform: translateY(0.01em);
}

.player-profile-trigger:not(.home-profile-cta):focus-visible {
  outline: 2px solid var(--profile-cta, var(--ranking-cta, #ffd84a));
  outline-offset: 3px;
  border-radius: 5px;
}

.ranking-table .name-cell .player-profile-trigger,
.podium-player .player-profile-trigger {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-table .name-cell .player-profile-trigger {
  width: 100%;
}

.match-player-copy .player-profile-trigger strong {
  color: inherit;
}


@keyframes profileSpin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .player-profile-dialog {
    width: calc(100vw - 24px); height: calc(100dvh - 24px);
    max-height: none; aspect-ratio: auto;
  }
  .player-profile-hero { grid-template-columns: 90px minmax(0, 1fr); }
  .player-profile-spotlight { grid-column: 1 / -1; justify-items: start; border-left: 0; border-top: 1px solid var(--screen-line); padding: 8px 0 0; }
  .player-profile-spotlight small { max-width: none; text-align: left; }
  .player-profile-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-profile-stat:nth-child(2) { border-right: 0; }
  .player-profile-stat:nth-child(-n+2) { border-bottom: 1px solid var(--screen-line); }
}
@media (max-width: 480px) {
  .player-profile-dialog { padding: 16px; }
  .player-profile-mode-grid { grid-template-columns: 1fr; }
  .player-profile-match { flex-wrap: wrap; }
  .player-profile-match time { width: 100%; padding-left: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .player-profile-screen { animation: none; }
}

/* Face-à-face avec le joueur connecté. */
.player-profile-versus {
  margin: 0; padding: 6px 12px; border-left: 3px solid var(--screen-accent); background: var(--screen-tint);
  color: var(--screen-ink); font: clamp(18px, 3cqh, 22px)/1.2 'Jersey 15', sans-serif; letter-spacing: .04em;
}
.player-profile-versus[hidden] { display: none; }
