/* Player page. Hero with headshot + info, then a big-number averages grid.
   Uses the shared tokens in styles.css; nothing here overrides them.
   Team theming follows the Your Team page: --t1/--t2/--t1-text are set by
   js/player.js from the player's team colors; chrome stays shared navy. */

:root {
  --t1: #000000;        /* team primary */
  --t2: #ffffff;        /* team secondary */
  --t1-text: #ffffff;   /* contrast text on primary (picked by js/player.js) */
  --t2-safe: #ffffff;   /* contrast-safe secondary for text (set by js/player.js) */
  --scrim-strong: rgba(0, 0, 0, 0.55); /* hero text-zone scrim (set by js/player.js) */
  --scrim-soft: rgba(0, 0, 0, 0.30);
  --scrim-clear: rgba(0, 0, 0, 0);
}

.player-hero {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  border: 1px solid var(--t1);
  background:
    linear-gradient(100deg, var(--scrim-strong) 0%, var(--scrim-strong) 40%, var(--scrim-soft) 65%, var(--scrim-clear) 85%),
    linear-gradient(135deg, var(--t1) 0%, var(--t2) 130%);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  color: var(--t1-text);
}
.player-hero.my-team {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.player-shot {
  width: 150px;
  height: 150px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: var(--radius-card);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.player-name {
  margin: 0;
  font-size: var(--fs-3xl);
  letter-spacing: -0.01em;
}
.player-sub {
  color: var(--t1-text);
  opacity: 0.85;
  font-size: var(--fs-sm);
  margin-top: 0.25rem;
}

.info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 0.9rem;
}
.info-item {
  display: flex;
  flex-direction: column;
}
.info-label {
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--t1-text);
  opacity: 0.7;
}
.info-value {
  font-size: var(--fs-base);
  font-weight: 700;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.75rem;
}
.section-head h2 {
  margin: 0;
  border-left: 4px solid var(--t1);
  padding-left: 0.6rem;
}

.season-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  padding: 0.45rem 0.7rem;
  font-size: var(--fs-sm);
  font-weight: 700;
}

/* Season averages — one unified stat-line panel: label over value,
   hairline dividers, fixed 5x2 grid so the eye tracks it like a table. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: linear-gradient(180deg, #151231 0%, #100e20 100%);
  border: 1px solid #2e2952;
  border-radius: var(--radius-card);
  overflow: hidden;
}
.stat-box {
  padding: 0.8rem 0.4rem 0.9rem;
  text-align: center;
}
.stat-box:not(:nth-child(5n)) { border-right: 1px solid var(--border); }
.stat-box:nth-child(n + 6) { border-top: 1px solid var(--border); }
.stat-val {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.15;
}
.stat-label {
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.stat-note {
  margin-top: 0.75rem;
}

/* ---- Last 10 games ---- */
/* This table used the shared .nice class but its base styles live in
   team.css, which this page doesn't load — so it rendered nearly bare.
   It carries its full styling here now: ruled rows, zebra striping,
   roomier cells and aligned numbers so a row tracks cleanly across. */
table.nice.gamelog { width: 100%; border-collapse: collapse; background: var(--surface); font-size: var(--fs-sm); }
table.nice.gamelog th, table.nice.gamelog td { padding: 0.65rem 0.7rem; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.nice.gamelog th:first-child, table.nice.gamelog td:first-child,
table.nice.gamelog th:nth-child(2), table.nice.gamelog td:nth-child(2) { text-align: left; }
table.nice.gamelog th:nth-child(3), table.nice.gamelog td:nth-child(3) { text-align: center; }
table.nice.gamelog thead th { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid var(--border-strong); }
table.nice.gamelog tbody tr { border-top: 1px solid var(--border); }
table.nice.gamelog tbody tr:first-child { border-top: none; }
table.nice.gamelog tbody tr:nth-child(even) { background: rgba(147, 160, 196, 0.05); }
table.nice.gamelog tbody tr:hover { background: var(--surface-2); }
table.nice.gamelog td.hl { font-weight: 800; }
/* The best scoring night in the 10 gets a gold edge so the ceiling game pops. */
table.nice.gamelog tbody tr.best td:first-child { box-shadow: inset 3px 0 0 #ffb020; }
table.nice.gamelog td.gdate { font-weight: 700; }
table.nice.gamelog td.gdate a { color: inherit; text-decoration: none; }
table.nice.gamelog td.gdate a:hover { color: var(--accent); text-decoration: underline; }
.wl-w { color: var(--green); font-weight: 800; }
.wl-l { color: var(--red); font-weight: 800; }


@media (max-width: 560px) {
  .player-hero { flex-direction: column; align-items: flex-start; }
  .player-shot { width: 120px; height: 120px; }
  .player-name { font-size: var(--fs-2xl); }
  .stat-box { padding: 0.65rem 0.2rem 0.7rem; }
  .stat-val { font-size: var(--fs-lg); }
  .stat-label { letter-spacing: 0.06em; }
}

/* ---- Personality: game-log visuals ---- */
.gamelog-visual {
  margin-bottom: 1rem;
}
.trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.tbar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}
.tbar-val {
  font-size: var(--fs-xs);
  font-weight: 700;
  margin-bottom: 2px;
}
.tbar-fill {
  width: 100%;
  height: var(--h);
  min-height: 6px;
  background: linear-gradient(to top, var(--accent, #f97316), #fdba74);
  border-radius: 3px 3px 0 0;
}
.tbar-opp {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
}

.gamelog-controls {
  margin-bottom: 0.75rem;
}

/* ---- Latest game: styled like one of Tobias's X stat posts ---- */
.tweet-card {
  background: #000;
  border: 1px solid #2f3336;
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  max-width: 38rem;
  color: #e7e9ea;
}
.tweet-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.tweet-avatar {
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent, #f97316);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
}
.tweet-name {
  font-weight: 800;
  font-size: var(--fs-base);
  line-height: 1.25;
}
.tweet-handle {
  color: #71767b;
  font-size: var(--fs-sm);
}
.tweet-body {
  white-space: pre-line;
  font-size: 1.15rem;
  line-height: 1.55;
}
.tweet-foot {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid #2f3336;
  display: flex;
  justify-content: flex-end;
}
.tweet-copy {
  background: transparent;
  color: #e7e9ea;
  border: 1px solid #536471;
  border-radius: 9999px;
  padding: 0.35rem 0.9rem;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}
.tweet-copy:hover {
  background: rgba(231, 233, 234, 0.1);
}
.tweet-copy:disabled {
  opacity: 0.7;
  cursor: default;
}
/* Live-game markers: the Latest game card and the log's first row while
   the player's team is still playing. */
.tweet-live {
  margin-left: auto;
  flex: 0 0 auto;
  color: #f4212e;
  border: 1px solid #f4212e;
  border-radius: 9999px;
  padding: 0.15rem 0.6rem;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.live-tag {
  color: var(--red);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
}
