/* =========================================================
   RALLY SCHOOL — PRO LAB
   ========================================================= */

:root {
  --lab-bg: #080b10;
  --lab-surface: #11161d;
  --lab-surface-2: #171e27;
  --lab-surface-3: #1d2631;

  --lab-border: rgba(255,255,255,.09);
  --lab-border-strong: rgba(255,255,255,.16);

  --lab-text: #f7f9fc;
  --lab-muted: #9ca8b7;

  --lab-green: #67df7a;
  --lab-green-soft: rgba(103,223,122,.12);

  --player-1: #58a6ff;
  --player-1-soft: rgba(88,166,255,.12);

  --player-2: #ffb84d;
  --player-2-soft: rgba(255,184,77,.12);

  --danger: #ff6b72;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
}


/* -----------------------------
   HARD RESET FOR CONTRAST
----------------------------- */

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(43,100,72,.18), transparent 32%),
    radial-gradient(circle at 85% 5%, rgba(38,83,138,.16), transparent 30%),
    var(--lab-bg);

  color: var(--lab-text);
}

.pro-lab,
.pro-lab h1,
.pro-lab h2,
.pro-lab h3,
.pro-lab h4,
.pro-lab p,
.pro-lab span,
.pro-lab strong,
.pro-lab label,
.pro-lab li {
  color: var(--lab-text);
}

.pro-lab {
  width: min(1180px, calc(100% - 36px));
  margin: auto;
  padding: 28px 0 90px;
}


/* -----------------------------
   TOP LINK
----------------------------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  color: var(--lab-muted) !important;
  text-decoration: none;

  padding: 8px 0;
  font-size: .92rem;
}

.back-link:hover {
  color: white !important;
}


/* -----------------------------
   HERO
----------------------------- */

.lab-hero {
  text-align: center;
  padding: 70px 0 60px;
}

.eyebrow {
  margin: 0 0 12px;

  color: var(--lab-green) !important;

  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .17em;
}

.lab-hero h1 {
  margin: 0;

  color: white !important;

  font-size: clamp(3rem, 8vw, 6.4rem);
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.055em;
}

.hero-copy {
  max-width: 640px;
  margin: 22px auto 0;

  color: var(--lab-muted) !important;

  font-size: 1.08rem;
  line-height: 1.7;
}


/* -----------------------------
   PLAYER PICKER
----------------------------- */

.battle-picker {
  display: grid;
  grid-template-columns: minmax(0,1fr) 80px minmax(0,1fr);
  align-items: stretch;
  gap: 18px;

  max-width: 900px;
  margin: 48px auto 24px;
}

.player-picker {
  position: relative;

  padding: 22px;

  text-align: left;

  background: var(--lab-surface);
  border: 1px solid var(--lab-border);
  border-radius: var(--radius-md);

  box-shadow: 0 18px 50px rgba(0,0,0,.2);
}

.player-picker:first-child {
  border-top: 3px solid var(--player-1);
}

.player-picker:last-child {
  border-top: 3px solid var(--player-2);
}

.player-picker label {
  display: block;

  margin-bottom: 10px;

  color: var(--lab-muted) !important;

  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.player-picker select {
  width: 100%;

  padding: 15px 42px 15px 15px;

  appearance: none;

  background: var(--lab-surface-2);
  color: white;

  border: 1px solid var(--lab-border-strong);
  border-radius: var(--radius-sm);

  font-size: 1.02rem;
  font-weight: 700;

  cursor: pointer;
}

.player-picker select:focus {
  outline: 2px solid var(--lab-green);
  outline-offset: 2px;
}

.player-info {
  margin-top: 10px;

  color: var(--lab-muted) !important;

  font-size: .82rem;
}

.versus {
  display: flex;
  align-items: center;
  justify-content: center;

  color: white !important;

  font-size: 1.1rem;
  font-weight: 1000;
  letter-spacing: .08em;
}


/* -----------------------------
   START BATTLE BUTTON
----------------------------- */

.battle-button {
  border: 0;
  border-radius: 999px;

  padding: 16px 34px;

  background:
    linear-gradient(135deg, #54cf6b, #38a84d);

  color: #061009;

  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .015em;

  cursor: pointer;

  box-shadow:
    0 10px 30px rgba(71,200,93,.25);

  transition:
    transform .18s ease,
    box-shadow .18s ease;
}

.battle-button:hover {
  transform: translateY(-2px);

  box-shadow:
    0 14px 36px rgba(71,200,93,.34);
}

.battle-error {
  min-height: 24px;

  color: var(--danger) !important;

  margin-top: 14px;
}

.hidden {
  display: none !important;
}


/* =========================================================
   BATTLE RESULT HERO
   ========================================================= */

.battle-results {
  margin-top: 10px;
}

.battle-title {
  position: relative;
  overflow: hidden;

  display: grid;
  grid-template-columns: 1fr 250px 1fr;
  gap: 20px;
  align-items: center;

  padding: 42px 38px;

  background:
    linear-gradient(
      90deg,
      var(--player-1-soft) 0%,
      transparent 38%,
      transparent 62%,
      var(--player-2-soft) 100%
    ),
    var(--lab-surface);

  border: 1px solid var(--lab-border);
  border-radius: var(--radius-lg);

  box-shadow: 0 30px 80px rgba(0,0,0,.22);
}

.battle-title > div:first-child {
  text-align: left;
}

.battle-title > div:last-child {
  text-align: right;
}

.battle-title h2 {
  margin: 8px 0 0;

  color: white !important;

  font-size: clamp(1.7rem, 3vw, 2.7rem);
  font-weight: 900;
  letter-spacing: -.035em;
}

.ranking {
  display: inline-block;

  color: var(--lab-green) !important;

  font-size: .9rem;
  font-weight: 900;
}

.battle-score {
  text-align: center;
}

.battle-score > span {
  color: var(--lab-muted) !important;

  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .13em;
}

.battle-score strong {
  display: block;

  margin: 9px 0 5px;

  color: white !important;

  font-size: 3.5rem;
  font-weight: 1000;
  line-height: 1;
}

.battle-score small {
  color: var(--lab-muted) !important;
}


/* =========================================================
   PANELS
   ========================================================= */

.lab-panel {
  margin-top: 24px;
  padding: 34px;

  background: var(--lab-surface);

  border: 1px solid var(--lab-border);
  border-radius: var(--radius-lg);
}

.lab-panel > h2 {
  margin: 6px 0 0;

  color: white !important;

  font-size: clamp(1.65rem, 3vw, 2.2rem);
  font-weight: 850;
  letter-spacing: -.025em;
}

.section-copy {
  margin-top: 12px;

  color: var(--lab-muted) !important;

  line-height: 1.65;
}


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

.metric-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(185px,1fr));

  gap: 14px;
  margin-top: 26px;
}

.metric-card {
  position: relative;

  padding: 20px;

  background: var(--lab-surface-2);

  border: 1px solid var(--lab-border);
  border-radius: var(--radius-md);
}

.metric-card h3 {
  min-height: 42px;
  margin: 0 0 18px;

  color: white !important;

  font-size: .96rem;
  font-weight: 800;
}

.metric-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric-values > div {
  min-width: 0;
}

.metric-values span {
  display: block;

  margin-bottom: 5px;

  color: var(--lab-muted) !important;

  font-size: .74rem;
  line-height: 1.35;
}

.metric-values strong {
  display: block;

  color: white !important;

  font-size: 1.55rem;
  font-weight: 900;
}

.metric-values > div:first-child strong {
  color: var(--player-1) !important;
}

.metric-values > div:last-child strong {
  color: var(--player-2) !important;
}

.metric-values strong.edge {
  color: var(--lab-green) !important;
}


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

.surface-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);

  gap: 15px;
  margin-top: 26px;
}

.surface-card {
  padding: 24px;

  background: var(--lab-surface-2);

  border: 1px solid var(--lab-border);
  border-radius: var(--radius-md);
}

.surface-card h3 {
  margin: 0 0 20px;

  color: white !important;

  font-size: 1.3rem;
  font-weight: 900;
}

.surface-card small {
  display: block;

  margin-top: 16px;

  color: var(--lab-muted) !important;
}


/* =========================================================
   PATH TO VICTORY
   ========================================================= */

.path-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;

  gap: 16px;
  margin-top: 26px;
}

.path-card {
  padding: 26px;

  background: var(--lab-surface-2);

  border: 1px solid var(--lab-border);
  border-radius: var(--radius-md);
}

.path-card:first-child {
  border-left: 4px solid var(--player-1);
}

.path-card:last-child {
  border-left: 4px solid var(--player-2);
}

.path-card h3 {
  margin: 0 0 18px;

  color: white !important;

  font-size: 1.3rem;
}

.path-card ul {
  margin: 0;
  padding-left: 20px;
}

.path-card li {
  margin-bottom: 13px;

  color: #dce3ec !important;

  line-height: 1.6;
}

.methodology {
  margin: 25px 0 0;

  padding-top: 20px;

  border-top: 1px solid var(--lab-border);

  color: var(--lab-muted) !important;

  font-size: .83rem;
  line-height: 1.6;
}


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

@media (max-width: 820px) {

  .battle-picker {
    grid-template-columns: 1fr;
  }

  .versus {
    height: 38px;
  }

  .battle-title {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .battle-title > div:first-child,
  .battle-title > div:last-child {
    text-align: center;
  }

  .battle-score {
    order: -1;
  }

  .surface-grid,
  .path-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 520px) {

  .pro-lab {
    width: min(100% - 20px, 1180px);
  }

  .lab-hero {
    padding: 48px 0;
  }

  .lab-panel,
  .battle-title {
    padding: 22px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

}

/* =========================================================
   INTERACTIVE BATTLEFIELD
   ========================================================= */

.battlefield-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.battlefield-button {
  padding: 11px 18px;

  background: var(--lab-surface-2);
  color: var(--lab-muted);

  border: 1px solid var(--lab-border-strong);
  border-radius: 999px;

  font-weight: 800;
  cursor: pointer;

  transition:
    background .18s ease,
    border-color .18s ease,
    color .18s ease,
    transform .18s ease;
}

.battlefield-button:hover {
  color: white;
  transform: translateY(-1px);
}

.battlefield-button.active {
  background: var(--lab-green-soft);
  border-color: var(--lab-green);
  color: var(--lab-green);
}

/* =========================================================
   PLAYER IDENTITY
   ========================================================= */

.player-identity {
  margin-top: 10px;

  color: var(--lab-muted) !important;

  font-size: .85rem;
  line-height: 1.6;
}

.player-identity .identity-main {
  display: block;

  color: #dce3ec !important;
  font-weight: 700;
}

.player-identity .identity-secondary {
  display: block;

  margin-top: 2px;

  color: var(--lab-muted) !important;
}

.player-identity .flag {
  margin-right: 5px;
}


/* =========================================================
   PRO LAB PLAYER PHOTOS
   ========================================================= */

.player-photo {
  width: 132px;
  height: 132px;
  margin-bottom: 18px;

  overflow: hidden;

  background: #1b222c;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;

  box-shadow: 0 16px 36px rgba(0,0,0,.3);
}

.battle-title > div:first-child .player-photo {
  margin-right: auto;
}

.battle-title > div:last-child .player-photo {
  margin-left: auto;
}

.player-photo img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center top;
}

.player-photo-fallback {
  width: 100%;
  height: 100%;

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

  font-size: 3rem;

  background:
    radial-gradient(
      circle,
      rgba(103,223,122,.12),
      transparent 65%
    );
}

@media (max-width: 820px) {

  .player-photo {
    width: 105px;
    height: 105px;

    margin-left: auto !important;
    margin-right: auto !important;
  }

}

/* =========================================================
   VISUAL METRIC COMPARISON BARS
   ========================================================= */

.metric-visual,
.surface-visual {
  display: flex;
  flex-direction: column;
}

.comparison-bars {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 8px;
}

.comparison-row {
  min-width: 0;
}

.comparison-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 7px;
}

.comparison-label span {
  min-width: 0;
  color: var(--lab-muted) !important;
  font-size: .78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comparison-label strong {
  flex-shrink: 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.player-one-row .comparison-label strong {
  color: var(--player-1) !important;
}

.player-two-row .comparison-label strong {
  color: var(--player-2) !important;
}

.comparison-track {
  width: 100%;
  height: 12px;
  overflow: hidden;

  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 999px;
}

.comparison-fill {
  height: 100%;
  border-radius: inherit;
  transition: width .4s ease;
}

.player-one-fill {
  background: linear-gradient(
    90deg,
    rgba(88,166,255,.6),
    var(--player-1)
  );
}

.player-two-fill {
  background: linear-gradient(
    90deg,
    rgba(255,184,77,.6),
    var(--player-2)
  );
}

.metric-edge {
  margin-top: 16px;
  padding-top: 12px;

  border-top: 1px solid var(--lab-border);

  color: var(--lab-green) !important;

  font-size: .72rem;
  font-weight: 800;
}

.metric-grid .metric-card,
.surface-grid .surface-card {
  min-height: 0;
}

.surface-visual small {
  display: block;
  margin-top: 8px;

  color: var(--lab-muted) !important;
}

@media (max-width: 700px) {

  .comparison-track {
    height: 10px;
  }

  .comparison-label strong {
    font-size: 1.05rem;
  }

}

/* =========================================================
   BEHIND THE PROJECT — FINAL SECTION
   ========================================================= */

.pro-story-cta {
  margin-top: 34px;
  margin-bottom: 64px;
}

.pro-story-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;

  padding: 44px 46px;

  background: var(--lab-surface);
  border: 1px solid var(--lab-border);
  border-radius: var(--radius-lg);

  box-shadow: 0 24px 60px rgba(0,0,0,.16);
}

.pro-story-copy {
  max-width: 760px;
}

.pro-story-label {
  display: block;
  margin-bottom: 15px;

  color: var(--lab-green) !important;

  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .15em;
}

.pro-story-cta h2 {
  margin: 0 0 14px;

  color: white !important;

  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -.02em;
}

.pro-story-cta p {
  max-width: 700px;
  margin: 0 0 23px;

  color: var(--lab-muted) !important;

  line-height: 1.65;
}

.pro-story-link {
  display: inline-flex;
  align-items: center;

  padding: 11px 18px;

  background: var(--lab-green-soft);
  color: var(--lab-green) !important;

  border: 1px solid rgba(103,223,122,.28);
  border-radius: 999px;

  font-size: .86rem;
  font-weight: 850;
  text-decoration: none;

  transition:
    transform .18s ease,
    background .18s ease,
    border-color .18s ease;
}

.pro-story-link:hover {
  transform: translateY(-1px);

  background: rgba(103,223,122,.16);
  border-color: var(--lab-green);
}

.pro-story-journey {
  flex-shrink: 0;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 18px 20px;

  background: var(--lab-surface-2);
  border: 1px solid var(--lab-border);
  border-radius: 18px;

  font-size: 1.25rem;
}

.pro-story-journey b {
  color: var(--lab-green) !important;
  font-size: .85rem;
}

@media (max-width: 850px) {

  .pro-story-cta {
    margin-top: 28px;
  }

  .pro-story-cta-inner {
    flex-direction: column;
    align-items: flex-start;

    gap: 26px;
    padding: 34px 30px;
  }

  .pro-story-journey {
    width: 100%;
    justify-content: center;
  }

}

@media (max-width: 520px) {

  .pro-story-cta-inner {
    padding: 28px 22px;
  }

  .pro-story-journey {
    gap: 7px;
    padding: 14px;
    font-size: 1rem;
  }

}
