/* Hey Coach M — /challenges discovery page & /challenges/manage organizer console.
 * Complements /marketing.css (Athletic Editorial System) with vibrant course worlds and scoring visuals.
 * Strict CSP compliant (zero inline styles).
 */

/* ==========================================================================
 * Shared /challenges & /challenges/manage Primitives
 * ========================================================================== */
.ch-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  color: #151d2d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.ch-utility,
.ch-actions,
.ch-row,
.ch-topbar,
.ch-topbar nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ch-utility {
  justify-content: flex-end;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 500;
}

.ch-utility a,
.ch-footer a {
  padding: 10px 0;
}

.ch-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #52637b;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.ch-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.ch-card {
  padding: 26px;
  border: 1px solid #dce4ef;
  border-radius: 16px;
  background: #ffffff;
  min-width: 0;
}

.ch-card h2 {
  font-family: "Inter Tight", Inter, sans-serif;
  font-size: 30px;
  letter-spacing: -0.025em;
  margin: 0 0 10px;
  color: #101d33;
}

.ch-card p {
  line-height: 1.55;
  color: #40516a;
  margin: 0 0 12px;
}

.ch-muted,
.ch-note,
.ch-privacy {
  color: #52637b;
  font-size: 14px;
  line-height: 1.6;
}

.ch-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 20px;
  border: 0;
  border-radius: 10px;
  background: #244de8;
  color: #ffffff;
  font: 600 15px Inter, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease;
}

.ch-button:hover {
  background: #1b3ec4;
  color: #ffffff;
}

.ch-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.ch-secondary {
  color: #1e293b;
  background: #edf0f6;
}

.ch-secondary:hover {
  background: #dfe5ef;
  color: #1e293b;
}

.ch-text-button {
  border: 0;
  background: none;
  color: #244de8;
  min-height: 44px;
  padding: 8px;
  font: 600 14px Inter, sans-serif;
  cursor: pointer;
}

.ch-example {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px solid #101d33;
  font-size: 14px;
  color: #101d33;
}

.ch-row {
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  flex-wrap: wrap;
}

.ch-row strong {
  font-variant-numeric: tabular-nums;
}

.ch-example small {
  display: block;
  color: #657187;
  font-size: 12px;
  margin-top: 14px;
}

.ch-example progress {
  display: block;
  width: 100%;
  height: 6px;
  accent-color: #244de8;
}

.ch-note {
  margin: 22px 0;
}

.ch-join {
  padding: 18px 22px;
  margin: 20px 0;
}

.ch-join summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 28px;
  color: #101d33;
}

.ch-privacy {
  max-width: 820px;
  margin: 0;
}

.ch-page a:not(.ch-button),
.ch-hero-wrap a:not(.ch-button) {
  color: #244de8;
}

.ch-page a.ch-button,
.ch-landing a.ch-button {
  color: #ffffff;
}

.ch-page a.ch-button.ch-secondary,
.ch-landing a.ch-button.ch-secondary {
  color: #1e293b;
}

.ch-page label,
.ch-landing label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin: 18px 0 7px;
  color: #101d33;
}

.ch-page input:not([type="checkbox"]),
.ch-page select,
.ch-page textarea,
.ch-landing input:not([type="checkbox"]),
.ch-landing select,
.ch-landing textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  border: 1px solid #b8c3d4;
  border-radius: 8px;
  padding: 11px 12px;
  background: #ffffff;
  color: #172033;
  font: 16px Inter, sans-serif;
}

.ch-page textarea,
.ch-landing textarea {
  resize: vertical;
  min-height: 100px;
}

.ch-page :focus-visible,
.ch-topbar :focus-visible,
.ch-landing :focus-visible {
  outline: 3px solid #7586f2;
  outline-offset: 3px;
}

.ch-actions {
  flex-wrap: wrap;
  margin-top: 18px;
}

.ch-actions input {
  flex: 1;
  min-width: 180px;
}

.ch-error {
  color: #a51c30;
  font-size: 14px;
  min-height: 20px;
  margin: 8px 0 0;
}

.ch-success {
  color: #176142;
}

/* ==========================================================================
 * /challenges/manage Organizer Console
 * ========================================================================== */
.ch-topbar {
  max-width: 1120px;
  margin: auto;
  padding: 20px 24px;
  justify-content: space-between;
  border-bottom: 1px solid #e1e6ee;
}

.ch-topbar a {
  text-decoration: none;
  color: #1d2738;
}

.ch-wordmark {
  font: 750 23px "Inter Tight", Inter, sans-serif;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.ch-wordmark span {
  color: #244de8;
}

.ch-topbar nav {
  font: 14px Inter, sans-serif;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ch-manager {
  background: #f6f8fc;
  margin: 0;
}

.ch-dashboard {
  max-width: 880px;
  padding-top: 38px;
}

.ch-dashboard:focus {
  outline: none;
}

.ch-dashboard h1 {
  font: 700 clamp(30px, 4.5vw, 44px) / 1.1 "Inter Tight", Inter, sans-serif;
  letter-spacing: -0.035em;
  margin: 10px 0 18px;
}

.ch-dashboard h2 {
  font-size: 24px;
}

.ch-login {
  max-width: 460px;
  margin: 28px auto;
}

.ch-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.ch-full {
  grid-column: 1 / -1;
}

.ch-dashboard details {
  margin: 20px 0;
}

.ch-dashboard summary {
  cursor: pointer;
  padding: 8px 0;
}

.ch-dashboard .ch-card {
  margin-bottom: 20px;
}

.ch-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.ch-event {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.ch-event:hover {
  border-color: #244de8;
}

.ch-event h2 {
  font-size: 23px;
}

.ch-tag {
  font-size: 12px;
  background: #eef1f8;
  border-radius: 5px;
  padding: 5px 8px;
  text-transform: capitalize;
}

.ch-stat {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin: 24px 0;
}

.ch-stat strong {
  font-size: 26px;
  display: block;
}

.ch-stat span {
  font-size: 13px;
  color: #546176;
}

.ch-share {
  overflow-wrap: anywhere;
}

.ch-check {
  display: flex !important;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400 !important;
  line-height: 1.5;
}

.ch-check input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 3px;
  accent-color: #244de8;
}

.ch-team-form {
  padding: 12px 0;
  border-bottom: 1px solid #e1e6ee;
}

.ch-team-form label {
  margin-top: 6px;
}

.ch-footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 24px;
  font: 13px Inter, sans-serif;
}

.ch-callout {
  padding: 16px 18px;
  background: #eef2fb;
  border-radius: 10px;
  line-height: 1.6;
  font-size: 14px;
}

.ch-dashboard [hidden],
.ch-topbar [hidden] {
  display: none;
}

.ch-status:empty {
  display: none;
}

/* ==========================================================================
 * /challenges Public Landing — Top Choice Hero Band
 * ========================================================================== */
.ch-hero-band {
  padding: 24px 0 64px;
}

.ch-hero {
  padding: 18px 0 32px;
}

.ch-hero .mm-display-h1 {
  max-width: 22ch;
}

.ch-hero .mm-lead {
  max-width: 52ch;
  margin-bottom: 0;
}

.ch-choice-card {
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 28px rgb(16 29 51 / 4%);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.ch-choice-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #244de8;
}

.ch-choice-card.is-circles::before {
  background: #059669;
}

.ch-choice-card.is-circles .ch-eyebrow {
  color: #047857;
}

.ch-choice-card.is-teams::before {
  background: #244de8;
}

.ch-choice-card.is-teams .ch-eyebrow {
  color: #244de8;
}

.ch-choice-card .ch-muted {
  margin-bottom: 18px;
}

/* ==========================================================================
 * Band 1: Five Interactive Challenge Courses
 * ========================================================================== */
.ch-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 40px;
  align-items: end;
  margin-bottom: 36px;
}

.ch-section-head .mm-display-h2 {
  margin-bottom: 0;
}

.ch-stage-frame {
  --ch-course-accent: #2563eb;
  --ch-course-pill-bg: rgb(37 99 235 / 92%);
  position: relative;
  background: #0b1324;
  border: 1px solid #1e2f52;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 56px rgb(11 19 36 / 16%);
}

.ch-stage-frame::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--ch-course-accent);
  z-index: 3;
  pointer-events: none;
}

.ch-stage-frame.is-winter,
.ch-course-card.is-winter {
  --ch-course-accent: #2563eb;
  --ch-course-pill-bg: rgb(37 99 235 / 92%);
}

.ch-stage-frame.is-gp,
.ch-course-card.is-gp {
  --ch-course-accent: #dc2626;
  --ch-course-pill-bg: rgb(220 38 38 / 92%);
}

.ch-stage-frame.is-jurassic,
.ch-course-card.is-jurassic {
  --ch-course-accent: #15803d;
  --ch-course-pill-bg: rgb(21 128 61 / 92%);
}

.ch-stage-frame.is-lunar,
.ch-course-card.is-lunar {
  --ch-course-accent: #4f46e5;
  --ch-course-pill-bg: rgb(79 70 229 / 92%);
}

.ch-stage-frame.is-regatta,
.ch-course-card.is-regatta {
  --ch-course-accent: #0d9488;
  --ch-course-pill-bg: rgb(13 148 136 / 92%);
}

.ch-stage-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #070d1d;
  overflow: hidden;
}

.ch-stage-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ch-stage-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 220ms ease;
  cursor: pointer;
}

.ch-stage-canvas.is-ready {
  opacity: 1;
}

.ch-stage-badge-row {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.ch-stage-course-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ch-course-pill-bg);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgb(7 13 29 / 35%);
}

.ch-stage-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px;
  align-items: center;
  padding: 20px 26px;
  background: #0b1324;
  border-top: 1px solid #1d2c4d;
  color: #f8fafc;
}

.ch-stage-meta-copy strong {
  display: block;
  font-family: "Inter Tight", Inter, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin-bottom: 4px;
}

.ch-stage-meta-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #cbd5e1;
}

.ch-stage-route-wrap {
  text-align: right;
}

.ch-stage-route-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 4px;
}

.ch-stage-route {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.5;
}

.ch-course-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.ch-course-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 2px solid #dce4ef;
  border-radius: 14px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  font-family: inherit;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.ch-course-card:hover {
  border-color: var(--ch-course-accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgb(16 29 51 / 9%);
}

.ch-course-card.is-active {
  border-color: var(--ch-course-accent);
  box-shadow: 0 12px 26px rgb(16 29 51 / 12%);
}

.ch-course-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b1324;
  overflow: hidden;
}

.ch-course-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ch-course-pill {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgb(11 19 36 / 82%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ch-course-card.is-active .ch-course-pill {
  background: var(--ch-course-pill-bg);
}

.ch-course-card-body {
  display: grid;
  gap: 3px;
  padding: 12px 13px 14px;
}

.ch-course-card-body strong {
  font-size: 14px;
  font-weight: 700;
  color: #101d33;
  line-height: 1.25;
}

.ch-course-card-body small {
  font-size: 12px;
  color: #52637b;
  line-height: 1.35;
}

/* ==========================================================================
 * Band 2: How People Win Points Spotlight
 * ========================================================================== */
.ch-points-panel {
  width: min(980px, 100%);
}

.ch-cap-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 13px;
  font-weight: 700;
}

.ch-meter {
  display: grid;
  grid-template-columns: 5fr 3fr 2fr;
  gap: 6px;
  margin-bottom: 24px;
}

.ch-meter-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
}

.ch-meter-seg.is-ex {
  background: #244de8;
}

.ch-meter-seg.is-walk {
  background: #059669;
}

.ch-meter-seg.is-eat {
  background: #d97706;
}

.ch-pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ch-pillar-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 22px 20px 20px;
  border-radius: 14px;
  border: 1px solid #dce4ef;
  background: #f8fafd;
}

.ch-pillar-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #244de8;
}

.ch-pillar-card.is-ex {
  background: #f4f7ff;
  border-color: #d4e0fd;
}

.ch-pillar-card.is-ex::before {
  background: #244de8;
}

.ch-pillar-card.is-walk {
  background: #f2fbf7;
  border-color: #c2f0dc;
}

.ch-pillar-card.is-walk::before {
  background: #059669;
}

.ch-pillar-card.is-eat {
  background: #fffaf0;
  border-color: #fae1a5;
}

.ch-pillar-card.is-eat::before {
  background: #d97706;
}

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

.ch-pillar-top h3 {
  margin: 0;
  font-family: "Inter Tight", Inter, sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #101d33;
}

.ch-pts-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.is-ex .ch-pts-chip {
  background: #e0e7ff;
  color: #1d4ed8;
}

.is-walk .ch-pts-chip {
  background: #d1fae5;
  color: #047857;
}

.is-eat .ch-pts-chip {
  background: #fef3c7;
  color: #b45309;
}

.ch-pillar-card p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #40516a;
}

.ch-tier-list {
  list-style: none;
  margin: auto 0 0;
  padding: 10px 0 0;
  border-top: 1px solid rgb(16 29 51 / 9%);
  display: grid;
  gap: 7px;
  font-size: 13px;
}

.ch-tier-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  color: #40516a;
}

.ch-tier-list strong {
  color: #101d33;
  font-weight: 700;
  white-space: nowrap;
}

.ch-team-math {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e8eef7;
}

.ch-team-math > div:first-child strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #101d33;
  margin-bottom: 4px;
}

.ch-team-math > div:first-child p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #40516a;
}

.ch-math-example {
  padding: 14px 20px;
  border-radius: 12px;
  background: #0b1324;
  color: #ffffff;
  text-align: right;
  min-width: 170px;
}

.ch-math-example span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93c5fd;
}

.ch-math-example strong {
  display: block;
  font-family: "Inter Tight", Inter, sans-serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  color: #ffffff;
  margin: 2px 0;
}

.ch-math-example small {
  display: block;
  font-size: 12px;
  color: #cbd5e1;
}

/* ==========================================================================
 * Band 3 & Band 4: Text-to-Score Ledger & Format Moments
 * ========================================================================== */
.ch-ledger-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ch-ledger-rows li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #e8eef7;
}

.ch-ledger-rows strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #101d33;
}

.ch-ledger-rows small {
  display: block;
  font-size: 13px;
  color: #52637b;
}

.ch-moment-circle {
  border-left-color: #059669;
}

.ch-moment-circle .mm-moment-label {
  color: #047857;
}

.ch-moment-team {
  border-left-color: #244de8;
}

/* ==========================================================================
 * Responsive Rules (320px to 1920px)
 * ========================================================================== */
@media (max-width: 960px) {
  .ch-section-head {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ch-stage-meta {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ch-stage-route-wrap {
    text-align: left;
  }

  .ch-course-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ch-pillars-grid {
    grid-template-columns: 1fr;
  }

  .ch-team-math {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ch-math-example {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .ch-hero-band {
    padding: 16px 0 44px;
  }

  .ch-choices {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ch-stage-viewport {
    aspect-ratio: 16 / 10.2;
  }

  .ch-stage-meta {
    padding: 16px 18px;
  }

  .ch-course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .ch-course-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
  }

  .ch-course-card:last-child:nth-child(odd) .ch-course-thumb {
    width: 46%;
    flex: none;
  }

  .ch-meter {
    grid-template-columns: 1fr;
  }

  .ch-meter-seg {
    justify-content: flex-start;
    padding: 6px 12px;
  }
}

@media (max-width: 600px) {
  .ch-page {
    padding: 20px 18px 40px;
  }

  .ch-hero {
    padding: 14px 0 24px;
  }

  .ch-card {
    padding: 20px;
  }

  .ch-example {
    margin-top: 18px;
  }

  .ch-utility {
    justify-content: space-between;
    gap: 8px 14px;
    font-size: 13px;
  }

  .ch-fields {
    grid-template-columns: 1fr;
  }

  .ch-topbar {
    padding: 15px 18px;
    align-items: flex-start;
  }

  .ch-topbar nav {
    font-size: 12px;
    gap: 4px;
  }

  .ch-actions .ch-button {
    flex-grow: 1;
  }

  .ch-login {
    margin: 12px auto;
  }

  .ch-card h2 {
    font-size: 27px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ch-course-card,
  .ch-stage-canvas {
    transition: none;
  }

  .ch-course-card:hover {
    transform: none;
  }
}
