.onboarding-shell {
  max-height: min(88dvh, 760px);
  overflow-y: auto;
}

.onboarding-rules {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.onboarding-rules li {
  position: relative;
  padding: 10px 12px 10px 38px;
  border-radius: 7px;
  background: #edf3ef;
  color: #163f32;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.45;
}

.onboarding-rules li::before {
  content: counter(list-item);
  position: absolute;
  left: 12px;
  top: 10px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: #f3cf55;
  color: #133b2f;
  font-size: 11px;
  font-weight: 900;
}

.weekly-review-screen {
  position: fixed;
  inset: 0;
  z-index: 176;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 34, 27, .74);
  backdrop-filter: blur(10px);
}

.weekly-review-screen[hidden] { display: none; }

.weekly-review-shell {
  position: relative;
  width: min(520px, 100%);
  max-height: 92dvh;
  overflow-y: auto;
  padding: 24px;
  border-radius: 8px;
  background: #fbfcf8;
  color: #143c30;
  box-shadow: 0 24px 70px rgba(4, 25, 19, .32);
}

.weekly-review-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #e5eee8;
  color: #143c30;
  font: 700 25px/1 system-ui;
}

.weekly-review-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 112px;
  margin: -4px -4px 18px;
  border-radius: 7px;
  overflow: hidden;
  background: #dce9e1;
}

.weekly-review-visual::before {
  content: "";
  position: absolute;
  inset: 14px 8% 22px;
  border-bottom: 7px solid #795837;
  transform: rotate(-2deg);
}

.weekly-review-visual img {
  position: relative;
  z-index: 1;
  width: 86px;
  height: 86px;
  object-fit: contain;
}

.weekly-review-visual span {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 48px;
  margin-left: -7px;
  border-radius: 50% 50% 44% 44%;
  background: #c89574;
  box-shadow: inset 0 0 0 7px #f4e9d6;
}

.weekly-review-visual span:nth-of-type(2) { background: #8eb6a0; transform: translateY(5px); }
.weekly-review-visual span:nth-of-type(3) { background: #e0b253; transform: translateY(1px); }
.weekly-review-kicker { margin: 0 0 8px; color: #367b61; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.weekly-review-shell h2 { max-width: 440px; margin: 0; font-size: clamp(27px, 5vw, 40px); line-height: 1.05; letter-spacing: 0; }
.weekly-review-copy { margin: 12px 0 14px; color: #4f685e; line-height: 1.55; }
.weekly-review-form { display: grid; gap: 9px; }
.weekly-review-form > label:first-child { font-size: 13px; font-weight: 850; }
.weekly-review-form input[type="email"] { min-height: 50px; padding: 0 14px; border: 0; border-radius: 7px; background: #eaf1ed; color: #143c30; font: 700 16px/1 system-ui; outline: 2px solid transparent; }
.weekly-review-form input[type="email"]:focus { outline-color: #3c8467; }
.weekly-review-unsubscribe { margin: -1px 0 2px; color: #6b7a73; font-size: 12px; line-height: 1.4; }
.weekly-review-message { min-height: 18px; margin: 0; color: #a24437; font-size: 12px; font-weight: 750; }
.weekly-review-message.is-success { color: #267252; }
.weekly-review-submit { width: 100%; }
#weeklyReviewSubmit { min-height: 52px; border: 0; border-radius: 7px; background: #164c3b; color: #fff; font-weight: 900; }
.weekly-review-later { width: 100%; margin-top: 8px; border: 0; background: transparent; color: #607168; font-size: 13px; font-weight: 750; }

@media (max-width: 640px) {
  .onboarding-shell { padding: 20px 18px; }
  .onboarding-rules { gap: 6px; margin: 14px 0; }
  .onboarding-rules li { padding-block: 8px; font-size: 12px; }
  .weekly-review-screen { align-items: end; padding: 0; }
  .weekly-review-shell { max-height: 94dvh; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 8px 8px 0 0; }
  .weekly-review-visual { min-height: 88px; margin-bottom: 14px; }
  .weekly-review-visual img { width: 70px; height: 70px; }
  .weekly-review-visual span { width: 34px; height: 40px; }
  .weekly-review-shell h2 { max-width: calc(100% - 30px); font-size: 27px; }
  .weekly-review-copy { margin-block: 9px 11px; font-size: 14px; }
}

/* Weekly league: weekly performance leads; lifetime guests remain supporting context. */
.leaderboard li,
.summary-league li {
  grid-template-columns: 26px 38px minmax(0, 1fr) minmax(132px, auto);
  min-height: 64px;
  gap: 10px;
  padding: 10px 12px;
  border: 0 !important;
  border-radius: 7px;
  background: #e8f0eb;
  box-shadow: none !important;
}

.leaderboard li.is-player,
.summary-league li.is-player {
  background: #f3e6a7;
}

.leaderboard li.rank-1,
.summary-league li.rank-1 { background: #f3e3a0; }
.leaderboard li.rank-2,
.summary-league li.rank-2 { background: #dce8e1; }
.leaderboard li.rank-3,
.summary-league li.rank-3 { background: #eadfd5; }

.leaderboard li > span:first-child,
.summary-league li > span:first-child {
  font-size: .92rem;
  font-weight: 900;
  text-align: center;
}

.leaderboard li.is-podium .forest-avatar,
.summary-league li.is-podium .forest-avatar {
  width: 36px;
  height: 36px;
  border: 0;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--podium-color, #c79a45), 0 7px 15px rgba(21, 62, 48, .15);
  animation: v47-podium-avatar 2.8s ease-in-out infinite;
}

.leaderboard .league-identity small,
.summary-league .league-identity small {
  display: block;
  margin-top: 3px;
  color: #567066;
  font-size: .62rem;
  font-weight: 760;
  line-height: 1.2;
}

.league-score {
  min-width: 0;
  color: #123f32;
  font-size: .78rem;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

.league-score .league-time {
  font-size: .55rem;
  white-space: normal;
}

@keyframes v47-podium-avatar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@media (max-width: 640px) {
  .leaderboard ol { gap: 7px; }

  .leaderboard li,
  .summary-league li {
    grid-template-columns: 22px 38px minmax(0, 1fr) minmax(94px, 112px);
    min-height: 67px;
    gap: 7px;
    padding: 9px 10px;
  }

  .leaderboard .league-identity b,
  .summary-league .league-identity b {
    font-size: .82rem;
    line-height: 1.12;
  }

  .leaderboard .league-identity small,
  .summary-league .league-identity small {
    font-size: .54rem;
  }

  .league-score {
    font-size: .67rem;
    white-space: normal;
  }

  .league-score .league-time {
    margin-top: 4px;
    font-size: .5rem;
    line-height: 1.25;
  }
}

@media (prefers-reduced-motion: reduce) {
  .leaderboard li.is-podium .forest-avatar,
  .summary-league li.is-podium .forest-avatar { animation: none; }
}
