:root {
  --background: #111111;
  --panel: #1b1b1b;
  --border: #333333;
  --text: #ffffff;
  --muted: #aaaaaa;
  --accent: #4caf50;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.page {
  width: min(1500px, 96%);
  margin: 0 auto;
  padding: 28px 0 50px;
}


/* ==========================================================
   HEADER
========================================================== */

.header {
  margin-bottom: 24px;
}

.header h1 {
  margin: 0 0 8px;
  font-size: 32px;
  color: var(--text);
}

.header p {
  margin: 0;
  color: var(--muted);
}


/* ==========================================================
   FILTER CONTROLS
========================================================== */

.controls {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fit,
      minmax(190px, 1fr)
    );

  gap: 14px;

  padding: 18px;

  background: var(--panel);

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

  border-radius: 10px;
}

.control-group {
  display: flex;

  flex-direction: column;

  gap: 6px;

  min-width: 0;
}

.control-group label {
  font-size: 13px;

  color: var(--muted);
}

.control-group select {
  width: 100%;

  padding: 10px 12px;

  background: #111111;

  color: #ffffff;

  border: 1px solid #444444;

  border-radius: 6px;

  font-size: 15px;

  font-weight: 400;
}

.control-group select:disabled {
  color: #777777;
}


/* ==========================================================
   CHART INFO
========================================================== */

.chart-info {
  display: flex;

  flex-wrap: wrap;

  gap: 28px;

  margin: 18px 0 8px;
}

.chart-info .label {
  color: var(--muted);

  margin-right: 6px;
}

.chart-info strong {
  color: var(--text);
}


/* ==========================================================
   MAIN CHART
========================================================== */

.chart-container {
  width: 100%;

  background: #ffffff;

  border-radius: 10px;

  overflow: hidden;

  margin-top: 12px;
}


/*
 * Fixed vertical height prevents Plotly and
 * Squarespace from creating an iframe-height
 * feedback loop.
 */
#chart {
  width: 100%;

  height: 750px;

  min-height: 750px;

  max-height: 750px;
}

#chart .js-plotly-plot {
  width: 100%;

  height: 100%;
}


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

.section-card {
  margin-top: 30px;

  background: #ffffff;

  border: 1px solid #dddddd;

  border-radius: 12px;

  padding: 24px;

  box-shadow:
    0 1px 3px
    rgba(0, 0, 0, 0.04);
}

.section-heading {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 20px;

  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0 0 6px 0;

  color: #111111;

  font-size: 23px;
}

.section-heading p {
  margin: 0;

  color: #666666;

  font-size: 14px;

  line-height: 1.5;
}


/* ==========================================================
   BUTTONS
========================================================== */

.download-button {
  appearance: none;

  border: none;

  background: #111111;

  color: #ffffff;

  font-weight: 700;

  padding: 12px 18px;

  border-radius: 7px;

  cursor: pointer;

  white-space: nowrap;

  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.download-button:hover {
  transform: translateY(-1px);

  opacity: 0.9;
}

.download-button:active {
  transform: translateY(0);
}

.export-buttons {
  display: flex;

  gap: 12px;

  flex-wrap: wrap;
}


/* ==========================================================
   WEEKLY MOVERS
========================================================== */

.movers-grid {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 24px;
}

.mover-column {
  border: 1px solid #eeeeee;

  border-radius: 10px;

  overflow: hidden;

  background: #ffffff;
}

.mover-column h3 {
  margin: 0;

  padding: 14px 16px;

  background: #111111;

  color: #ffffff;

  font-size: 17px;
}

.mover-row {
  display: grid;

  grid-template-columns:
    42px
    46px
    minmax(120px, 1fr)
    auto
    auto;

  gap: 10px;

  align-items: center;

  padding: 11px 14px;

  border-top: 1px solid #eeeeee;
}

.mover-row:first-child {
  border-top: none;
}

.mover-list-rank {
  font-size: 18px;

  font-weight: 800;

  color: #111111;

  text-align: center;
}

.mover-logo-wrap {
  display: flex;

  align-items: center;

  justify-content: center;
}

.mover-logo {
  width: 38px;

  height: 38px;

  object-fit: contain;
}

.mover-logo-placeholder {
  display: flex;

  align-items: center;

  justify-content: center;

  width: 36px;

  height: 36px;

  border-radius: 50%;

  background: #eeeeee;

  color: #444444;

  font-size: 10px;

  font-weight: 700;
}

.mover-team-block {
  min-width: 0;
}

.mover-team {
  font-weight: 700;

  color: #111111;
}

.mover-rating {
  margin-top: 3px;

  font-size: 12px;

  color: #666666;
}

.mover-stat-block {
  text-align: right;

  min-width: 64px;
}

.mover-primary-change,
.mover-secondary-change {
  font-size: 16px;

  font-weight: 800;
}

.mover-stat-label {
  margin-top: 2px;

  font-size: 10px;

  text-transform: uppercase;

  color: #777777;
}

.mover-primary-change.positive,
.mover-secondary-change.positive {
  color: #15803d;
}

.mover-primary-change.negative,
.mover-secondary-change.negative {
  color: #b91c1c;
}

.mover-empty {
  padding: 18px;

  color: #666666;
}


/* ==========================================================
   POWER RATING HISTORY
========================================================== */

#history-chart {
  width: 100%;

  height: 420px;

  min-height: 420px;

  max-height: 420px;
}

#history-chart .js-plotly-plot {
  width: 100%;

  height: 100%;
}


/* ==========================================================
   PLOTLY SAFETY
========================================================== */

.plot-container,
.svg-container {
  max-width: 100%;
}

.chart-error {
  padding: 40px;

  color: #111111;

  font-family:
    Arial,
    Helvetica,
    sans-serif;
}


/* ==========================================================
   HIDDEN EXPORT AREA
========================================================== */

/*
 * CRITICAL FOR SQUARESPACE:
 *
 * These large graphics are collapsed during normal browsing.
 * app.js only expands the area while a PNG is being generated.
 */
#export-stage {
  position: absolute;

  left: 0;

  top: 0;

  width: 1px;

  height: 1px;

  max-height: 1px;

  overflow: hidden;

  visibility: hidden;

  pointer-events: none;

  z-index: -9999;
}


/* ==========================================================
   EXPORT GRAPHICS
========================================================== */

.export-card {
  width: 1080px;

  min-height: 1080px;

  box-sizing: border-box;

  padding: 48px;

  background:
    radial-gradient(
      circle at 80% 40%,
      #262626 0%,
      #121212 35%,
      #050505 75%
    );

  color: #ffffff;

  font-family:
    Arial,
    Helvetica,
    sans-serif;
}

.export-card-wide {
  width: 1400px;

  min-height: 1080px;
}


/* ==========================================================
   EXPORT HEADER
========================================================== */

.export-header {
  border-bottom: 6px solid #f5d400;

  padding-bottom: 24px;

  margin-bottom: 28px;
}

.export-brand-row {
  display: flex;

  align-items: center;

  gap: 18px;
}

.export-brand-logo {
  width: 150px;

  max-height: 90px;

  object-fit: contain;

  object-position: left center;
}

.export-title {
  margin: 15px 0 0;

  font-size: 58px;

  line-height: 1;

  font-weight: 900;

  text-transform: uppercase;
}

.export-subtitle {
  display: inline-block;

  margin-top: 15px;

  padding: 10px 18px;

  background: #f5d400;

  color: #000000;

  font-size: 25px;

  font-weight: 900;

  text-transform: uppercase;
}


/* ==========================================================
   EXPORT STANDARD RANKING ROWS
========================================================== */

.export-ranking-list {
  display: flex;

  flex-direction: column;

  gap: 7px;
}

.export-rank-row {
  display: grid;

  grid-template-columns:
    78px
    76px
    minmax(0, 1fr)
    150px;

  align-items: center;

  min-height: 70px;

  background:
    rgba(
      255,
      255,
      255,
      0.06
    );

  border:
    1px solid
    rgba(
      255,
      255,
      255,
      0.15
    );
}

.export-rank-number {
  height: 100%;

  min-height: 70px;

  display: flex;

  align-items: center;

  justify-content: center;

  background: #f5d400;

  color: #000000;

  font-size: 37px;

  font-weight: 900;
}

.export-logo-cell {
  display: flex;

  align-items: center;

  justify-content: center;
}

.export-team-logo {
  width: 55px;

  height: 55px;

  object-fit: contain;

  margin: auto;
}

.export-team-name {
  font-size: 29px;

  font-weight: 900;
}

.export-team-meta {
  color: #bbbbbb;

  font-size: 15px;

  margin-top: 3px;
}

.export-power {
  text-align: right;

  padding-right: 20px;

  font-size: 28px;

  font-weight: 900;
}

.export-power-label {
  display: block;

  font-size: 11px;

  color: #bdbdbd;

  text-transform: uppercase;
}


/* ==========================================================
   TOP 10 EXPORT
========================================================== */

.export-top10-row {
  display: grid;

  grid-template-columns:
    78px
    76px
    minmax(0, 1fr)
    130px
    110px
    100px;

  align-items: center;

  min-height: 72px;

  background:
    rgba(
      255,
      255,
      255,
      0.06
    );

  border:
    1px solid
    rgba(
      255,
      255,
      255,
      0.15
    );
}

.export-top10-logo-cell {
  display: flex;

  justify-content: center;

  align-items: center;
}

.export-top10-team {
  min-width: 0;
}

.export-top10-stat {
  text-align: center;

  font-size: 21px;

  font-weight: 900;
}

.export-top10-stat span {
  display: block;

  margin-top: 3px;

  font-size: 10px;

  color: #aaaaaa;

  text-transform: uppercase;

  font-weight: 700;
}

.export-top10-stat-value {
  font-size: 23px;
}

.export-change-positive {
  color: #45d483;
}

.export-change-negative {
  color: #ff6b6b;
}

.export-change-neutral {
  color: #dddddd;
}


/* ==========================================================
   TOP 32 EXPORT
========================================================== */

.export-top32-grid {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 24px;
}


/* ==========================================================
   MOVERS EXPORT
========================================================== */

.export-mover-columns {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 28px;
}

.export-mover-column {
  min-width: 0;
}

.export-mover-column-title {
  margin-bottom: 14px;

  padding: 11px 14px;

  background: #15803d;

  font-size: 24px;

  font-weight: 900;

  text-transform: uppercase;
}

.export-mover-column-title.negative {
  background: #b91c1c;
}

.export-mover-list {
  display: flex;

  flex-direction: column;

  gap: 8px;
}

.export-mover-row {
  display: grid;

  grid-template-columns:
    52px
    62px
    minmax(0, 1fr)
    90px
    90px;

  align-items: center;

  min-height: 78px;

  background:
    rgba(
      255,
      255,
      255,
      0.06
    );

  border:
    1px solid
    rgba(
      255,
      255,
      255,
      0.14
    );
}

.export-mover-rank {
  height: 100%;

  display: flex;

  align-items: center;

  justify-content: center;

  background: #15803d;

  color: #ffffff;

  font-weight: 900;

  font-size: 26px;
}

.export-mover-rank.negative {
  background: #b91c1c;
}

.export-mover-logo-cell {
  display: flex;

  align-items: center;

  justify-content: center;
}

.export-mover-list-logo {
  width: 48px;

  height: 48px;

  object-fit: contain;
}

.export-mover-logo-fallback {
  width: 42px;

  height: 42px;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 50%;

  background: #333333;

  color: #ffffff;

  font-size: 10px;

  font-weight: 700;
}

.export-mover-copy {
  min-width: 0;

  padding-right: 10px;
}

.export-mover-list-team {
  font-size: 20px;

  font-weight: 900;
}

.export-mover-list-meta {
  margin-top: 4px;

  color: #bbbbbb;

  font-size: 12px;
}

.export-mover-stat {
  text-align: center;

  font-weight: 900;

  font-size: 18px;
}

.export-mover-stat span {
  display: block;

  margin-top: 3px;

  color: #aaaaaa;

  font-size: 9px;

  text-transform: uppercase;
}

.export-mover-empty {
  padding: 20px;

  color: #aaaaaa;

  border:
    1px solid
    rgba(
      255,
      255,
      255,
      0.12
    );
}


/* ==========================================================
   EXPORT FOOTER
========================================================== */

.export-footer {
  margin-top: 24px;

  padding-top: 16px;

  border-top:
    1px solid
    rgba(
      255,
      255,
      255,
      0.15
    );

  color: #aaaaaa;

  font-size: 14px;
}


/* ==========================================================
   FOOTER
========================================================== */

.footer {
  margin-top: 18px;

  padding: 18px 4px 30px;

  color: var(--muted);

  font-size: 13px;

  line-height: 1.5;
}

.footer p {
  margin: 5px 0;
}


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

@media (max-width: 800px) {

  .section-heading {
    flex-direction: column;

    align-items: flex-start;
  }


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


  .export-buttons {
    flex-direction: column;
  }


  .download-button {
    width: 100%;
  }

}


@media (max-width: 700px) {

  .header h1 {
    font-size: 25px;
  }


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


  #chart {
    height: 600px;

    min-height: 600px;

    max-height: 600px;
  }


  #history-chart {
    height: 380px;

    min-height: 380px;

    max-height: 380px;
  }


  .mover-row {
    grid-template-columns:
      34px
      40px
      minmax(0, 1fr)
      auto
      auto;

    gap: 7px;

    padding: 10px;
  }


  .mover-logo {
    width: 34px;

    height: 34px;
  }


  .mover-primary-change,
  .mover-secondary-change {
    font-size: 14px;
  }

}
