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

:root {
  --awg-crimson: #AB0535;
  --awg-crimson-light: #d40642;
  --awg-crimson-border: rgba(171, 5, 53, 0.28);
  --awg-crimson-border-soft: rgba(171, 5, 53, 0.14);
  --awg-crimson-glow: rgba(171, 5, 53, 0.12);
  --awg-crimson-tint: rgba(171, 5, 53, 0.06);
  --hot: #ff6b35;
  --hot-bg: rgba(255, 107, 53, 0.12);
  --cold: #4dabf7;
  --cold-bg: rgba(77, 171, 247, 0.12);
  --surface-2: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8e8e8;
  --text-muted: rgba(255, 255, 255, 0.55);
  --text-dim: rgba(255, 255, 255, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --page-pad-top: 16px;
  --page-pad-x: 16px;
  --page-pad-bottom: 16px;
}

html.is-card-only {
  --page-pad-top: 8px;
  --page-pad-x: 8px;
  --page-pad-bottom: 8px;
}

html.is-embedded {
  --page-pad-top: 40px;
}

html, body { width: 100%; margin: 0; padding: 0; overflow-x: hidden; background: transparent !important; }
html.is-embedded,
html.is-embedded body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: transparent !important;
  min-height: 100vh;
  padding: var(--page-pad-top) var(--page-pad-x) var(--page-pad-bottom);
  color: var(--text);
}
.container { max-width: 1040px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.container.matchup-mode { max-width: 1080px; }
.hidden { display: none !important; }

/* Card-only mode: embed / share links show just the stat card */
html.is-card-only .page-header,
html.is-card-only .mode-bar,
html.is-card-only .card-controls,
html.is-card-only .player-roster,
html.is-card-only .share-link-panel {
  display: none !important;
}
html.is-card-only .container {
  max-width: 580px;
  gap: 0;
}
html.is-card-only .container.matchup-mode {
  max-width: 720px;
}
html.is-card-only .view-body {
  grid-template-columns: 1fr;
  gap: 0;
}
html.is-card-only .stat-card-wrap {
  padding: 0;
  justify-content: center;
}
html.is-card-only .loading-screen,
html.is-card-only .error-screen {
  padding: 40px 16px;
}

/* Embed picker: card + rankings list with dark shell */
html.is-embed-picker .page-header,
html.is-embed-picker .mode-bar,
html.is-embed-picker .card-controls,
html.is-embed-picker .share-link-panel {
  display: none !important;
}
html.is-embed-picker {
  --page-pad-top: 12px;
  --page-pad-x: 12px;
  --page-pad-bottom: 12px;
}
html.is-embed-picker body {
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, rgba(171, 5, 53, 0.12) 0%, transparent 55%),
    linear-gradient(168deg, #1a1a28 0%, #12121e 100%) !important;
}
html.is-embed-picker .container {
  max-width: 1040px;
  gap: 0;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(18, 18, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
html.is-embed-picker .view-body {
  gap: 16px;
  align-items: stretch;
}
html.is-embed-picker .player-roster {
  background: rgba(0, 0, 0, 0.38);
  border-color: rgba(255, 255, 255, 0.1);
}
html.is-embed-picker .player-roster-list {
  background: rgba(0, 0, 0, 0.15);
}
html.is-embed-picker .roster-chip {
  background: rgba(255, 255, 255, 0.05);
}
html.is-embed-picker .stat-card-wrap {
  padding: 0;
  display: flex;
  align-items: stretch;
}
html.is-embed-picker .stat-card {
  flex: 1;
}
html.is-embed-picker .loading-screen,
html.is-embed-picker .error-screen {
  padding: 40px 16px;
}

.embed-format-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.embed-format-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.embed-format-pills {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
}
.embed-format-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.embed-format-pill:hover { color: #fff; }
.embed-format-pill.active {
  background: var(--awg-crimson);
  color: #fff;
}

.page-header {
  background: linear-gradient(160deg, rgba(255,255,255,0.07) 0%, var(--awg-crimson-tint) 100%);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 20px 24px;
  border: 1px solid var(--awg-crimson-border-soft);
}
.brand-tag { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--awg-crimson-light); margin-bottom: 4px; }
.page-header h1 { font-size: clamp(1.3rem, 3.5vw, 1.75rem); font-weight: 700; color: #fff; }
.header-sub { font-size: 0.88rem; color: var(--text-muted); margin-top: 4px; }
.page-desc { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; margin-top: 12px; }
.page-hint { text-align: center; font-size: 0.8rem; color: var(--text-dim); margin-top: 10px; }

.share-link-panel {
  margin-top: 8px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
.share-link-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.share-link-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
}
.share-link-desc strong { color: rgba(255, 255, 255, 0.75); font-weight: 600; }
.share-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}
.share-link-row input {
  flex: 1;
  min-width: 200px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.76rem;
  padding: 10px 12px;
  outline: none;
}
.btn-copy { font-size: 0.78rem; white-space: nowrap; }

.stat-card-brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brand-lockup-link {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-decoration: none;
  color: inherit;
}
.brand-lockup-link:hover .brand-lockup-mark { color: #fff; }
.stat-card-website {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--awg-crimson-light);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.stat-card-website:hover { text-decoration: underline; color: #fff; }

.loading-screen, .error-screen { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 60px 20px; color: var(--text-muted); }
.loading-spinner { width: 40px; height: 40px; border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--awg-crimson); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-primary { border: 1px solid var(--awg-crimson); background: var(--awg-crimson); color: #fff; font-size: 0.88rem; font-weight: 600; padding: 10px 16px; border-radius: var(--radius-sm); cursor: pointer; }

.card-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.search-wrap { position: relative; flex: 1; min-width: 180px; }
.search-wrap input, #playerSelect {
  width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: #fff; font-size: 0.88rem; padding: 10px 14px; outline: none;
}
#playerSelect { min-width: 200px; width: auto; }
.search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #2a2a3e; border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 240px; overflow-y: auto; z-index: 50; }
.search-result-item { padding: 10px 14px; cursor: pointer; font-size: 0.88rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.search-result-item:hover { background: var(--awg-crimson-tint); }
.card-nav { display: flex; align-items: center; gap: 6px; }
.btn-ghost, .btn-share {
  border: 1px solid var(--border); background: var(--surface-2); color: #fff;
  font-size: 0.88rem; font-weight: 600; padding: 10px 16px; border-radius: var(--radius-sm); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-ghost { padding: 10px 14px; font-size: 1.2rem; line-height: 1; }
.btn-ghost:hover, .btn-share:hover { border-color: var(--awg-crimson-border); background: var(--awg-crimson-glow); }

.mode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.mode-pills {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
}

.mode-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.mode-pill.active {
  background: var(--awg-crimson);
  color: #fff;
  box-shadow: 0 2px 10px rgba(171, 5, 53, 0.35);
}

.player-pickers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.picker-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 180px;
}

.picker-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.picker-group.side-a .picker-label { color: #ffb3c6; }
.picker-group.side-b .picker-label { color: #a8c4e8; }

.matchup-vs-badge {
  align-self: flex-end;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.card-controls.matchup-active .single-only { display: none; }
.card-controls:not(.matchup-active) .matchup-only { display: none; }

.view-body {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
.container.matchup-mode .view-body {
  grid-template-columns: 1fr;
}
.container.matchup-mode .player-roster { display: none; }

.view-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ─── Player roster sidebar ───────────────────────────────────────── */
.player-roster {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  overflow: hidden;
}
.player-roster-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.player-roster-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.player-roster-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.player-roster-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.roster-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.roster-chip:hover {
  border-color: var(--awg-crimson-border-soft);
  background: var(--awg-crimson-tint);
}
.roster-chip.active {
  border-color: var(--awg-crimson-border);
  background: rgba(171, 5, 53, 0.14);
}
.roster-rank {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  min-width: 1.5em;
  flex-shrink: 0;
}
.roster-chip.rank-1 .roster-rank { color: #ffd166; }
.roster-chip.rank-2 .roster-rank { color: #c0c0c0; }
.roster-chip.rank-3 .roster-rank { color: #cd7f32; }
.roster-name {
  flex: 1;
  min-width: 0;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roster-score {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--awg-crimson-light);
  flex-shrink: 0;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(171, 5, 53, 0.12);
}

/* ─── Matchup panel ───────────────────────────────────────────────── */
.matchup-panel {
  position: relative;
  width: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 70% at 0% 0%, rgba(171, 5, 53, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 90% 70% at 100% 0%, rgba(108, 142, 191, 0.12) 0%, transparent 55%),
    linear-gradient(168deg, rgba(34, 34, 52, 0.98) 0%, rgba(18, 18, 30, 0.99) 100%);
  border: 1px solid var(--awg-crimson-border-soft);
  border-radius: 24px;
  padding: 0 0 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 60px var(--awg-crimson-glow);
}

.matchup-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--awg-crimson) 0%, rgba(255,255,255,0.2) 50%, #6c8ebf 100%);
}

.matchup-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.matchup-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--awg-crimson-light);
  margin-bottom: 4px;
}

.matchup-event {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.matchup-players {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 20px 20px 12px;
}

.matchup-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 14px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.matchup-player.side-a {
  border-color: rgba(171, 5, 53, 0.22);
  background: rgba(171, 5, 53, 0.06);
}

.matchup-player.side-b {
  border-color: rgba(108, 142, 191, 0.22);
  background: rgba(108, 142, 191, 0.06);
}

.matchup-player .player-avatar-ring {
  width: 72px;
  height: 72px;
}

.matchup-player .player-monogram { font-size: 1.35rem; }

.matchup-player-name {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.matchup-player-overall {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.matchup-player-overall .overall-ring { width: 64px; height: 64px; }
.matchup-player-overall .overall-ring-svg { width: 64px; height: 64px; }
.matchup-player-overall .overall-ring-value { font-size: 1.05rem; }

.matchup-vs-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.matchup-vs-text {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
}

.matchup-edge-pill {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  white-space: nowrap;
}

.matchup-edge-pill.leads-a {
  background: rgba(171, 5, 53, 0.18);
  color: #ffb3c6;
  border: 1px solid var(--awg-crimson-border-soft);
}

.matchup-edge-pill.leads-b {
  background: rgba(108, 142, 191, 0.15);
  color: #a8c4e8;
  border: 1px solid rgba(108, 142, 191, 0.25);
}

.matchup-edge-pill.tied {
  color: var(--text-muted);
}

.matchup-summary {
  margin: 0 20px 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.matchup-summary strong { color: #fff; }

.matchup-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px;
}

.matchup-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.matchup-row:hover {
  border-color: var(--awg-crimson-border-soft);
  background: rgba(171, 5, 53, 0.03);
}

.mp-pctl {
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  color: var(--text-muted);
}

.mp-pctl.win-a { color: #ffb3c6; }
.mp-pctl.win-b { color: #a8c4e8; }

.mp-center { min-width: 0; }

.mp-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  margin-bottom: 4px;
}

.mp-delta {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.mp-delta.positive { color: #ffb3c6; }
.mp-delta.negative { color: #a8c4e8; }
.mp-delta.neutral { color: var(--text-dim); }

.mp-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.mp-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.mp-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.mp-bar-fill.bar-a { background: linear-gradient(90deg, #9b1028, var(--awg-crimson-light)); }
.mp-bar-fill.bar-b { background: linear-gradient(90deg, #457b9d, #6c8ebf); }

.mp-values {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.6rem;
  color: var(--text-dim);
  align-items: center;
}

.mp-values span:first-child { color: rgba(255, 179, 198, 0.75); }
.mp-raw-edge {
  font-size: 0.58rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  white-space: nowrap;
}
.mp-values span:last-child { color: rgba(168, 196, 232, 0.75); text-align: right; }

.matchup-footer {
  margin-top: 16px;
  padding: 14px 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* ─── Stat card shell ─────────────────────────────────────────────── */
.stat-card-wrap { display: flex; justify-content: flex-start; align-items: stretch; padding: 0; flex: 1; }

.stat-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 80% at 100% -20%, rgba(171, 5, 53, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 80% 60% at -10% 110%, rgba(171, 5, 53, 0.1) 0%, transparent 50%),
    linear-gradient(168deg, rgba(34, 34, 52, 0.98) 0%, rgba(18, 18, 30, 0.99) 55%, rgba(24, 16, 22, 0.98) 100%);
  border: 1px solid var(--awg-crimson-border-soft);
  border-radius: 24px;
  padding: 0 0 22px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 60px var(--awg-crimson-glow);
}

.stat-card-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--awg-crimson) 0%, var(--awg-crimson-light) 45%, rgba(255,255,255,0.25) 100%);
}

.stat-card-watermark {
  position: absolute;
  top: 50%;
  right: -12px;
  transform: translateY(-50%);
  font-size: 7.5rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  color: rgba(255, 255, 255, 0.025);
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

/* ─── Hero header ─────────────────────────────────────────────────── */
.stat-card-hero {
  position: relative;
  padding: 20px 24px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-card-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: rgba(171, 5, 53, 0.12);
  border: 1px solid var(--awg-crimson-border-soft);
}

.brand-mark-icon { font-size: 0.75rem; line-height: 1; opacity: 0.9; }
.brand-mark-text {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--awg-crimson-light);
}

.stat-card-hero-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}

/* Avatar / monogram (headshot-ready) */
.player-avatar-shell { flex-shrink: 0; }

.player-avatar-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(145deg, var(--awg-crimson-light), var(--awg-crimson) 40%, rgba(255,255,255,0.15));
  box-shadow: 0 8px 24px rgba(171, 5, 53, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.player-monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(40, 40, 58, 1) 0%, rgba(22, 22, 34, 1) 100%);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.player-headshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.stat-card-hero-copy { min-width: 0; }

.stat-card-tournament {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card-name {
  font-size: clamp(1.25rem, 3.5vw, 1.65rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 10px;
}

.stat-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hero-badge {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 58px;
}

.hero-badge em {
  font-style: normal;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.hero-badge strong {
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
}

.hero-badge.badge-hot {
  background: rgba(171, 5, 53, 0.14);
  border-color: var(--awg-crimson-border-soft);
}
.hero-badge.badge-hot strong { color: #ffb3c6; }

.hero-badge.badge-cold {
  background: rgba(108, 142, 191, 0.12);
  border-color: rgba(108, 142, 191, 0.25);
}
.hero-badge.badge-cold strong { color: #a8c4e8; }

.hero-badge.badge-fit {
  background: rgba(171, 5, 53, 0.18);
  border-color: var(--awg-crimson-border);
}
.hero-badge.badge-fit strong { color: #ffb3c6; }

/* ─── Form trend strip ────────────────────────────────────────────── */
.form-trend-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.form-trend-strip.trend-hot {
  border-color: rgba(255, 107, 53, 0.22);
  background: linear-gradient(135deg, var(--hot-bg), rgba(255, 255, 255, 0.02));
}
.form-trend-strip.trend-cold {
  border-color: rgba(77, 171, 247, 0.22);
  background: linear-gradient(135deg, var(--cold-bg), rgba(255, 255, 255, 0.02));
}
.form-trend-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.form-trend-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.form-trend-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.form-trend-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.form-trend-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}
.form-trend-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.form-trend-badge.trend-hot {
  background: var(--hot-bg);
  color: var(--hot);
  border: 1px solid rgba(255, 107, 53, 0.25);
}
.form-trend-badge.trend-cold {
  background: var(--cold-bg);
  color: var(--cold);
  border: 1px solid rgba(77, 171, 247, 0.25);
}
.form-trend-badge.trend-flat {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.form-trend-delta {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}
.form-trend-counts {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.sparkline-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}
.sparkline polyline { stroke: rgba(255, 255, 255, 0.35); }
.sparkline.spark-up polyline { stroke: var(--hot); }
.sparkline.spark-down polyline { stroke: var(--cold); }
.spark-dot { fill: rgba(255, 255, 255, 0.5); }
.spark-dot.dot-l4 { fill: var(--awg-crimson-light); }
.spark-dot.dot-l12 { fill: rgba(255, 255, 255, 0.55); }
.spark-dot.dot-l24 { fill: rgba(255, 255, 255, 0.28); }
.sparkline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  padding: 0 2px;
}

.stat-block-highlight {
  border-color: var(--awg-crimson-border-soft);
  background: rgba(171, 5, 53, 0.06);
}

.stat-block-highlight .stat-label { color: #ffb3c6; }

/* Overall profile ring */
.overall-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.overall-ring {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overall-ring-svg { position: absolute; inset: 0; }

.overall-ring-value {
  position: relative;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.overall-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.overall-tier {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.overall-profile.pctl-elite .overall-tier,
.overall-profile.pctl-great .overall-tier { color: var(--awg-crimson-light); }
.overall-profile.pctl-good .overall-tier { color: #52b788; }
.overall-profile.pctl-avg .overall-tier { color: #6c8ebf; }
.overall-profile.pctl-below .overall-tier { color: var(--text-dim); }

/* ─── Stat rows ───────────────────────────────────────────────────── */
.stat-section-label {
  padding: 16px 24px 10px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.stat-section-hint {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  color: rgba(255, 255, 255, 0.28);
}

.stat-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 20px;
}

.stat-block {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s, background 0.2s;
}

.stat-block:hover {
  border-color: var(--awg-crimson-border-soft);
  background: rgba(171, 5, 53, 0.04);
}

.stat-block-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
}

.stat-block-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-tier {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.stat-tier.pctl-elite,
.stat-tier.pctl-great { color: #ffb3c6; background: rgba(171, 5, 53, 0.15); }
.stat-tier.pctl-good { color: #8fdcb0; background: rgba(82, 183, 136, 0.12); }
.stat-tier.pctl-avg { color: #a8c4e8; background: rgba(108, 142, 191, 0.12); }
.stat-tier.pctl-below { color: var(--text-dim); }

.stat-bar-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.stat-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
}

.pctl-elite { background: linear-gradient(90deg, #9b1028, var(--awg-crimson-light)); }
.pctl-great { background: linear-gradient(90deg, #c41e3a, #e63946); }
.pctl-good { background: linear-gradient(90deg, #2a9d8f, #52b788); }
.pctl-avg { background: linear-gradient(90deg, #457b9d, #6c8ebf); }
.pctl-below { background: linear-gradient(90deg, #495057, #6c757d); }

.stat-pctl {
  font-size: 0.92rem;
  font-weight: 800;
  min-width: 28px;
  text-align: right;
  color: #fff;
}

.stat-pctl.pctl-elite,
.stat-pctl.pctl-great { color: #ffb3c6; }
.stat-pctl.pctl-good { color: #8fdcb0; }

.stat-raw-value {
  margin-top: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-dim);
}

.stat-raw-value span {
  font-weight: 500;
  opacity: 0.75;
}

.stat-trend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.stat-trend-chart {
  flex: 1;
  min-width: 0;
  max-width: 88px;
}
.stat-trend-row .sparkline-wrap {
  gap: 0;
}
.stat-trend-row .sparkline-compact .sparkline {
  display: block;
}
.stat-trend-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  flex-shrink: 0;
}
.stat-trend-badge.up {
  background: var(--hot-bg);
  color: var(--hot);
}
.stat-trend-badge.down {
  background: var(--cold-bg);
  color: var(--cold);
}
.stat-trend-badge.neutral {
  color: var(--text-dim);
}

/* ─── Footer ──────────────────────────────────────────────────────── */
.stat-card-footer {
  margin-top: 18px;
  padding: 16px 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.brand-lockup-mark {
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--awg-crimson-light);
}

.brand-lockup-sub {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.stat-card-footnote {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: right;
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #2a2a3e; border: 1px solid var(--awg-crimson-border); color: #fff;
  font-size: 0.88rem; font-weight: 600; padding: 12px 24px; border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 1000;
}

@media (max-width: 768px) {
  html.is-embedded {
    --page-pad-top: 32px;
  }
  body { padding: var(--page-pad-top) 10px var(--page-pad-bottom); }
  .view-body {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .player-roster {
    height: auto !important;
    max-height: 200px;
  }
  .card-controls { flex-direction: column; align-items: stretch; }

  .picker-row { flex-direction: column; align-items: stretch; }
  .matchup-vs-badge { align-self: center; margin: 0; }

  .matchup-players {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .matchup-vs-col { order: 2; flex-direction: row; gap: 10px; }
  .matchup-player.side-b { order: 3; }

  .stat-card-hero-main {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .overall-profile {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    padding-top: 4px;
  }

  .overall-ring { width: 72px; height: 72px; }
  .overall-ring-svg { width: 72px; height: 72px; }
  .overall-ring-value { font-size: 1.15rem; }

  .player-avatar-ring { width: 72px; height: 72px; }
  .player-monogram { font-size: 1.35rem; }

  .stat-rows { padding: 0 14px; }
  .stat-card-hero { padding: 16px 16px 14px; }
  .form-trend-strip { flex-direction: column; align-items: stretch; }
  .form-trend-right { align-items: flex-start; }
  .stat-section-label { padding-left: 16px; padding-right: 16px; }
  .stat-card-footer { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 400px) {
  .stat-block-top { flex-wrap: wrap; }
  .stat-tier { display: none; }
}
