/* =========================================================
   RPV4 RIDER PROFILE — RacePSL
   ========================================================= */

:root {
  --rpv4-red: #C8200E;
  --rpv4-red-hi: #E8291A;

  --rpv4-green: #1A8A3C;
  --rpv4-green-hi: #22AA4A;

  --rpv4-gold: #D49A00;
  --rpv4-gold-hi: #F5B300;

  --rpv4-blue: #1A4E9C;

  --rpv4-ink: #0E0E0C;
  --rpv4-ink-2: #2A2926;
  --rpv4-ink-3: #5A5850;
  --rpv4-ink-4: #8A887E;

  --rpv4-white: #FFFFFF;
  --rpv4-paper: #F1EFE9;
  --rpv4-off: #F8F7F2;
  --rpv4-rule: #E0DDD5;

  --rpv4-display: 'Bebas Neue', sans-serif;
  --rpv4-cond: 'Barlow Condensed', sans-serif;
  --rpv4-body: 'Barlow', sans-serif;
  --rpv4-mono: 'DM Mono', monospace;
}

/* =========================================================
   PAGE SHELL
   ========================================================= */

.rpv4-rider-page {
  background: var(--rpv4-white);
  color: var(--rpv4-ink);
  font-family: var(--rpv4-body);
}

/* =========================================================
   HERO
   ========================================================= */

.rpv4-rider-hero {
  background: var(--rpv4-ink);
  position: relative;
  overflow: hidden;
  padding: 48px 40px 0;
}

.rpv4-rider-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(212,154,0,.15), transparent 60%),
    radial-gradient(circle at 10% 80%, rgba(200,32,14,.12), transparent 60%);
}

.rpv4-rider-hero__grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 40px;
  position: relative;
  z-index: 2;
}

/* NUMBER BLOCK */

.rpv4-rider-number {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  background: rgba(212,154,0,.1);
  border: 1px solid rgba(212,154,0,.4);

  display: flex;
  align-items: center;
  justify-content: center;

  font-family: var(--rpv4-display);
  font-size: 64px;
  color: var(--rpv4-gold-hi);
}

/* NAME */

.rpv4-rider-name {
  font-family: var(--rpv4-display);
  font-size: clamp(48px, 6vw, 110px);
  color: white;
  line-height: 0.9;
}

.rpv4-rider-sub {
  font-family: var(--rpv4-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: 12px;
}

/* BADGES */

.rpv4-rider-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rpv4-rider-badge {
  font-family: var(--rpv4-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.7);
}

/* RIGHT PANEL */

.rpv4-rider-season-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  padding: 20px;
  border-radius: 12px;
  min-width: 220px;
}

.rpv4-rider-season-card__points {
  font-family: var(--rpv4-display);
  font-size: 52px;
  color: var(--rpv4-gold-hi);
}

.rpv4-rider-season-card__row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 6px;
  color: rgba(255,255,255,.6);
}

/* =========================================================
   STATS BAR
   ========================================================= */

.rpv4-rider-stats {
  display: flex;
  gap: 30px;
  padding: 20px 40px;
  border-bottom: 1px solid var(--rpv4-rule);
}

.rpv4-rider-stat {
  display: flex;
  flex-direction: column;
}

.rpv4-rider-stat strong {
  font-family: var(--rpv4-display);
  font-size: 32px;
}

.rpv4-rider-stat span {
  font-size: 10px;
  color: var(--rpv4-ink-4);
  text-transform: uppercase;
}

/* =========================================================
   GRID LAYOUT
   ========================================================= */

.rpv4-rider-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  padding: 30px 40px;
}

/* =========================================================
   CARDS
   ========================================================= */

.rpv4-card {
  background: white;
  border: 1px solid var(--rpv4-rule);
  border-radius: 12px;
  padding: 20px;
}

.rpv4-card h3 {
  font-family: var(--rpv4-cond);
  font-size: 18px;
  margin-bottom: 12px;
}

/* =========================================================
   ROWS (used everywhere)
   ========================================================= */

.rpv4-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--rpv4-rule);
}

.rpv4-row:last-child {
  border-bottom: none;
}

/* =========================================================
   FORM PILLS
   ========================================================= */

.rpv4-form-pills {
  display: flex;
  gap: 6px;
}

.rpv4-form-pill {
  font-family: var(--rpv4-mono);
  font-size: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--rpv4-paper);
}

.rpv4-form-pill.is-win {
  background: var(--rpv4-gold-hi);
  color: black;
}

.rpv4-form-pill.is-podium {
  background: #B0B8C8;
}

.rpv4-form-pill.is-bad {
  background: var(--rpv4-red-hi);
  color: white;
}

/* =========================================================
   PERFORMANCE CHART
   ========================================================= */

.rpv4-performance-chart {
  margin-top: 20px;
}

.rpv4-performance-bar {
  background: linear-gradient(
    180deg,
    var(--rpv4-gold-hi),
    rgba(245,179,0,.5)
  );
  border-radius: 4px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1000px) {
  .rpv4-rider-hero__grid {
    grid-template-columns: 1fr;
  }

  .rpv4-rider-grid {
    grid-template-columns: 1fr;
  }

  .rpv4-rider-stats {
    flex-wrap: wrap;
  }
}

.rpv4-rider-page {
  background: #f6f3eb;
  color: #111827;
}

.rpv4-rider-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(212, 154, 0, 0.12), transparent 28%),
    radial-gradient(circle at left center, rgba(200, 32, 14, 0.08), transparent 24%),
    linear-gradient(180deg, #10141d 0%, #0b1018 100%);
  color: #fff;
  padding-bottom: 28px;
}

.rpv4-rider-hero__rail {
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, #c8200e 0%, #1a8a3c 35%, #d49a00 68%, #1a4e9c 100%);
}

.rpv4-rider-hero__inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 34px 32px 0;
  position: relative;
  z-index: 2;
}

.rpv4-rider-breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 22px;
}

.rpv4-rider-breadcrumb a {
  color: rgba(255,255,255,0.78);
  text-decoration: none;
}

.rpv4-rider-hero__grid {
  display: grid;
  grid-template-columns: 160px 1fr 300px;
  gap: 28px;
  align-items: start;
}

.rpv4-rider-hero__left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rpv4-rider-avatar {
  width: 180px;
  height: 180px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(200,32,14,.18), rgba(245,179,0,.18));
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rpv4-rider-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rpv4-rider-avatar span {
  font-size: 40px;
  font-weight: 800;
  color: #fff;
}

.rpv4-rider-number-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  width: 180px;
}

.rpv4-rider-number-card__number {
  font-size: 28px;
  font-weight: 900;
  color: #f5b300;
  letter-spacing: 0.03em;
}

.rpv4-rider-hero__copy {
  min-width: 0;
}

.rpv4-rider-hero__title {
  font-size: clamp(38px, 5vw, 72px);
  line-height: 0.95;
  font-weight: 900;
  margin: 0 0 12px;
  letter-spacing: -0.03em;
}

.rpv4-rider-hero__subtitle {
  margin: 0 0 18px;
  color: rgba(255,255,255,0.78);
  font-size: 15px;
}

.rpv4-rider-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.rpv4-rider-chip,
.rpv4-rider-mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.86);
}

.rpv4-rider-chip--number {
  background: rgba(200,32,14,0.18);
  border-color: rgba(200,32,14,0.32);
  color: #ff9b8f;
}

.rpv4-rider-chip--active {
  background: rgba(26,138,60,0.16);
  border-color: rgba(26,138,60,0.3);
  color: #8af0a9;
}

.rpv4-rider-hero__stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.rpv4-rider-hero-stat {
  padding: 16px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.rpv4-rider-hero-stat span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.58);
  margin-bottom: 6px;
}

.rpv4-rider-hero-stat strong {
  font-size: 30px;
  line-height: 1;
  color: #fff;
}

.rpv4-rider-hero__sidecard {
  padding: 20px;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
}

.rpv4-rider-sidecard__label,
.rpv4-rider-sidecard__points-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.58);
}

.rpv4-rider-sidecard__points {
  font-size: 56px;
  line-height: 0.95;
  font-weight: 900;
  color: #f5b300;
  margin-top: 10px;
}

.rpv4-rider-sidecard__rows {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.rpv4-rider-sidecard__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
}

.rpv4-rider-sidecard__row span {
  color: rgba(255,255,255,0.6);
  font-size: 12px;
}

.rpv4-rider-sidecard__row strong {
  color: #fff;
  text-align: right;
}

.rpv4-rider-hero__actions {
  margin-top: 22px;
}

.rpv4-rider-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 32px 56px;
}

.rpv4-rider-panel {
  background: #fff;
  border: 1px solid #e7dfd1;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 8px 28px rgba(17,24,39,0.04);
  margin-bottom: 22px;
}

.rpv4-rider-season-select {
  max-width: 360px;
}

.rpv4-rider-season-select label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #5f574a;
}

.rpv4-rider-season-select select {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid #d9cfbe;
  background: #faf7f0;
  padding: 0 14px;
  font-size: 14px;
}

.rpv4-rider-championship-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.rpv4-rider-championship-card {
  border: 1px solid #eadfcd;
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, #fff 0%, #fcfaf6 100%);
}

.rpv4-rider-championship-card.is-primary {
  border-color: rgba(212,154,0,0.46);
  box-shadow: 0 10px 26px rgba(212,154,0,0.1);
}

.rpv4-rider-championship-card__top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.rpv4-rider-championship-card__top h3 {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.1;
}

.rpv4-rider-championship-card__top p {
  margin: 0;
  color: #6d6558;
  font-size: 13px;
}

.rpv4-rider-championship-card__rank {
  font-size: 28px;
  font-weight: 900;
  color: #c8200e;
  white-space: nowrap;
}

.rpv4-rider-championship-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.rpv4-rider-mini-chip {
  background: #f5efe4;
  border-color: #e2d6c2;
  color: #544b3e;
}

.rpv4-rider-championship-card__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.rpv4-rider-championship-card__stats span {
  display: block;
  font-size: 11px;
  color: #7e7568;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.rpv4-rider-championship-card__stats strong {
  font-size: 24px;
  line-height: 1;
}

.rpv4-rider-championship-card__footer {
  margin-top: 14px;
}

.rpv4-rider-inline-link,
.rpv4-rider-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  background: #10141d;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.rpv4-rider-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.75fr);
  gap: 22px;
}

.rpv4-rider-results-list,
.rpv4-rider-career-list {
  display: grid;
  gap: 12px;
}

.rpv4-rider-result-card,
.rpv4-rider-career-card,
.rpv4-rider-rival-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  background: #faf7f0;
  border: 1px solid #ebe2d3;
}

.rpv4-rider-result-card__copy strong,
.rpv4-rider-career-card__standing strong,
.rpv4-rider-rival-row strong {
  display: block;
}

.rpv4-rider-result-card__copy small,
.rpv4-rider-career-card__standing small,
.rpv4-rider-rival-row small {
  display: block;
  color: #72695c;
  margin-top: 4px;
}

.rpv4-rider-result-card__meta,
.rpv4-rider-career-card__standing-meta {
  display: grid;
  gap: 6px;
  text-align: right;
  white-space: nowrap;
  font-weight: 800;
}

.rpv4-rider-career-card {
  align-items: stretch;
}

.rpv4-rider-career-card__year {
  min-width: 120px;
  padding-right: 14px;
  border-right: 1px solid #e8ddcc;
}

.rpv4-rider-career-card__year strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.rpv4-rider-career-card__year span {
  display: block;
  margin-top: 6px;
  color: #6f675b;
  font-size: 13px;
}

.rpv4-rider-career-card__body {
  flex: 1;
  padding-left: 16px;
  display: grid;
  gap: 10px;
}

.rpv4-rider-meta,
.rpv4-rider-machine-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid #efe7db;
}

.rpv4-rider-meta:last-child,
.rpv4-rider-machine-row:last-child {
  border-bottom: 0;
}

.rpv4-rider-meta span {
  color: #6f675b;
}

.rpv4-rider-meta strong {
  text-align: right;
}

.rpv4-rider-form-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rpv4-rider-form-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 38px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  background: #eee7db;
  color: #4f473b;
}

.rpv4-rider-form-pill.is-win {
  background: rgba(26,138,60,0.15);
  color: #157736;
}

.rpv4-rider-form-pill.is-podium {
  background: rgba(212,154,0,0.16);
  color: #8b6200;
}

.rpv4-rider-form-pill.is-finish {
  background: rgba(26,78,156,0.12);
  color: #1a4e9c;
}

.rpv4-rider-form-pill.is-bad {
  background: rgba(200,32,14,0.14);
  color: #b61e0d;
}

.rpv4-rider-panel__cta {
  margin-top: 16px;
}

.rpv4-rider-empty {
  padding: 18px;
  border-radius: 14px;
  background: #faf7f0;
  color: #6f675b;
}

@media (max-width: 1160px) {
  .rpv4-rider-hero__grid {
    grid-template-columns: 140px 1fr;
  }

  .rpv4-rider-hero__sidecard {
    grid-column: 1 / -1;
  }

  .rpv4-rider-hero__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rpv4-rider-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .rpv4-rider-hero__inner,
  .rpv4-rider-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .rpv4-rider-hero__grid {
    grid-template-columns: 1fr;
  }

  .rpv4-rider-hero__left {
    flex-direction: row;
    align-items: center;
  }

  .rpv4-rider-avatar,
  .rpv4-rider-number-card {
    width: 120px;
    height: 120px;
    min-height: 120px;
  }

  .rpv4-rider-number-card__number {
    font-size: 22px;
  }

  .rpv4-rider-hero__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rpv4-rider-championship-grid {
    grid-template-columns: 1fr;
  }

  .rpv4-rider-championship-card__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rpv4-rider-career-card {
    flex-direction: column;
  }

  .rpv4-rider-career-card__year {
    border-right: 0;
    border-bottom: 1px solid #e8ddcc;
    padding-right: 0;
    padding-bottom: 12px;
  }

  .rpv4-rider-career-card__body {
    padding-left: 0;
    padding-top: 12px;
  }
}

.rpv4-rider-headline {
  margin: 8px 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.rpv4-rider-subheadline {
  margin: 0 0 18px;
  font-size: 14px;
  color: rgba(255,255,255,0.78);
}

.rpv4-rider-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.rpv4-rider-context-card {
  border: 1px solid #eadfcd;
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, #fff 0%, #fcfaf6 100%);
}

.rpv4-rider-context-card span {
  display: block;
  font-size: 11px;
  color: #7e7568;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.rpv4-rider-context-card strong {
  display: block;
  font-size: 22px;
  line-height: 1.15;
  margin-bottom: 8px;
  color: #111827;
}

.rpv4-rider-context-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #6f675b;
}

@media (max-width: 760px) {
  .rpv4-rider-context-grid {
    grid-template-columns: 1fr;
  }
}
