*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --gold: #d4af37;
  --gold-light: #f0d060;
  --gold-bg: #fdf8e8;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-hover: 0 4px 14px rgba(0,0,0,0.1);
  --font: 'Inter', system-ui, sans-serif;
}

body {
  font-family: var(--font);
  background: #fff;
  color: var(--text);
  line-height: 1.6;
}

.page {
  /* Fill the container (e.g. the embedding iframe) instead of self-capping,
     so the host page controls the width. */
  max-width: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* Card list — fixed-width cards, centered and wrapping. Keeps every card the
   same size regardless of how many are on the page (a 2-card page looks the
   same as a 3-card page) and centers the row in wide/embedded containers. */
.news-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

/* News card — tall premium player card */
.sc-card {
  position: relative;
  /* Fixed width so cards never stretch to fill the row; cap at 100% so a single
     card still fits narrow phones. 310px lets a full row of 4 fit common laptop
     widths (~1366px+) — keep in sync with CARD_WIDTH in app.js. */
  flex: 0 0 310px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: #f4f6fa;
  border: 1px solid rgba(15, 39, 71, 0.10);
  box-shadow:
    0 18px 40px rgba(15, 39, 71, 0.12),
    0 4px 10px rgba(15, 39, 71, 0.06);
  text-decoration: none;
  color: inherit;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.sc-card:hover {
  transform: translateY(-5px);
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow:
    0 26px 56px rgba(15, 39, 71, 0.18),
    0 8px 16px rgba(15, 39, 71, 0.08);
}

/* Image area */
.sc-card-media {
  position: relative;
  /* Fixed height (cards are fixed-width now, so this no longer over-crops wide
     embeds). A proportional aspect-ratio shrank the image band — and cropped
     the player's head — whenever a narrow embed forced the card below 340px. */
  height: 200px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 28%, rgba(212, 175, 55, 0.20), rgba(11, 31, 58, 0) 55%),
    linear-gradient(180deg, #123b73 0%, #0b1f3a 100%);
}

.sc-card-media::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.sc-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.sc-card-photo-fallback {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 2px solid rgba(212, 175, 55, 0.9);
  box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.15);
  color: #0b1f3a;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

/* Content section */
.sc-card-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 20px;
  overflow: hidden;
}

/* Faded watermark behind the content (team logo, football fallback) */
.sc-card-body::before {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -40px;
  width: 184px;
  height: 184px;
  opacity: 0.05;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg transform='rotate(-28 60 60)' fill='none' stroke='%230b1f3a' stroke-width='5'%3E%3Cellipse cx='60' cy='60' rx='52' ry='30'/%3E%3Cline x1='44' y1='60' x2='76' y2='60'/%3E%3Cline x1='49' y1='53' x2='49' y2='67' stroke-width='4'/%3E%3Cline x1='57' y1='53' x2='57' y2='67' stroke-width='4'/%3E%3Cline x1='65' y1='53' x2='65' y2='67' stroke-width='4'/%3E%3Cline x1='73' y1='53' x2='73' y2='67' stroke-width='4'/%3E%3C/g%3E%3C/svg%3E");
}

/* When the player's team is known, use the team logo as the watermark */
.sc-card.has-team-logo .sc-card-body::before {
  background-image: var(--sc-team-logo);
  opacity: 0.08;
}

.sc-card-toprow {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.sc-card-label {
  color: #123b73;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sc-card-name {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #0b2347;
  font-size: 1.2rem;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.sc-card-summary {
  position: relative;
  z-index: 1;
  margin: 9px 0 0;
  color: #34465f;
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 600;
}

.sc-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(18, 59, 115, 0.07);
  border: 1px solid rgba(18, 59, 115, 0.12);
  color: #3a4d68;
  font-size: 0.76rem;
  font-weight: 700;
}

.sc-card-cta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 39, 71, 0.10);
  color: #123b73;
  font-size: 0.9rem;
  font-weight: 850;
}

.sc-card-cta span {
  color: #d4af37;
  transition: transform 160ms ease;
}

.sc-card:hover .sc-card-cta span {
  transform: translateX(3px);
}

@media (max-width: 640px) {
  .sc-card-name {
    font-size: 1.08rem;
  }
}

/* Pager */
.sc-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.sc-pager:empty {
  display: none;
}

.sc-pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.08);
  color: #a87905;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 850;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.sc-pager-btn:hover:not(:disabled) {
  background: #d4af37;
  border-color: #d4af37;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(212, 175, 55, 0.32);
}

.sc-pager-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sc-pager-status {
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sc-pager-status span {
  color: #94a3b8;
  font-weight: 600;
}

/* Loading */
.loading-state {
  display: flex;
  justify-content: center;
  padding: 48px 0;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
