/*
 * players.css — Players page responsive polish
 * Scoped to html[data-route="/players"] — zero bleed to other pages.
 *
 * Fix: on 2560px+ desktops the .app container stretches to fill the full
 * viewport width, creating a "sea of empty" layout with content floating
 * in a void. Cap the whole page wrapper to 1440px max-width and center it
 * so sidebar + content stay together as a composed unit at ultra-wide sizes.
 *
 * Polish bundle: motion, interaction depth, team-link style, skeleton fade.
 */

/* ─── CARD ENTRANCE ─────────────────────────────────────────────────────── */
@keyframes pl-card-fadein {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pl-card.is-pl-visible {
  animation: pl-card-fadein 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  @keyframes pl-card-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
}

/* ─── MODAL ENTRANCE ────────────────────────────────────────────────────── */
@keyframes pl-modal-fadein {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.pl-modal[open] {
  animation: pl-modal-fadein 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  @keyframes pl-modal-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
}

/* ─── ACTION BUTTONS ────────────────────────────────────────────────────── */
.pl-act-btn:focus-visible {
  outline: 2px solid var(--sns-accent, var(--red-primary, #FF1A1A));
  outline-offset: 2px;
}

.pl-act-btn:active {
  transform: scale(0.96);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Icon inside action buttons (injected by player-actions.js renderButtons()) */
.pl-act-ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.pl-act-ic svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ─── MODAL CLOSE BUTTON ────────────────────────────────────────────────── */
.pl-modal-close {
  min-width: 44px;
  min-height: 44px;
}

.pl-modal-close:hover {
  background: rgba(255, 26, 26, 0.12);
  border-radius: 6px;
}

.pl-modal-close:focus-visible {
  outline: 2px solid var(--sns-accent, var(--red-primary, #FF1A1A));
  outline-offset: 2px;
  border-radius: 6px;
}

/* ─── POSITION CHIPS ────────────────────────────────────────────────────── */
.pl-chip:active {
  transform: scale(0.97);
}

.pl-chip.is-active {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

/* ─── TEAM LINK ─────────────────────────────────────────────────────────── */
.pl-card-school.team-link,
.pl-modal-school.team-link {
  text-decoration: underline;
  text-decoration-color: var(--red-primary, #FF1A1A);
  text-underline-offset: 3px;
}

.pl-card-school.team-link:hover,
.pl-modal-school.team-link:hover {
  color: var(--red-bright, #FF4d4d);
}

/* ─── SKELETON FADE ─────────────────────────────────────────────────────── */
/* Applied by JS as a transition class before clearing the grid */
.pl-loading-banner--fading {
  transition: opacity 0.3s ease;
  opacity: 0 !important;
}

/* ─── DESKTOP MAX-WIDTH CAP ─────────────────────────────────────────────── */
html[data-route="/players"] {

  /* The .app grid is the outermost layout container (sidebar +
     content). Without a cap it fills 100vw on wide monitors
     (2560px+). Applying max-width here keeps the sidebar and
     content column together as a unit, centered on screen. */
  .app {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
  }

} /* end html[data-route="/players"] scope */
