/*
 * /marks. The one drawing on this page is a tide staff: a post with the mark across its middle, the band in
 * which stakes change hands ticked above and below it, and the water standing where the market cap is now.
 * It is the payout rule as a picture, and it is drawn for every market with that market's own figures.
 * Colour, type and spacing come from /site/tokens.css only.
 */

/* The statement that has to be read. A sheet of sand over the sea: the strongest surface the palette has,
   and it needs no stripe beside it to be noticed. */
.risk {
  display: grid;
  gap: var(--space-3);
  max-width: 46rem;
  margin-bottom: var(--space-6);
  padding: var(--space-5) var(--space-6) var(--space-4);
  border-radius: var(--radius);
  background: var(--ink);
}

.risk h2 {
  font-size: var(--text-l);
}

.risk p {
  font: 400 var(--text-m) / var(--leading-text) var(--font-display);
}

.risk p.small {
  font: 400 var(--text-s) / 1.4 var(--font-text);
}

.rule {
  display: grid;
  gap: var(--space-3);
  max-width: 46rem;
  margin-top: var(--space-8);
  scroll-margin-top: var(--space-5);
}

.risk a {
  color: inherit;
}

.rule-text {
  display: grid;
  gap: var(--space-2);
}

.markets-head {
  margin-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid currentColor;
}

.group-title {
  margin-top: var(--space-6);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0;
}

/* ---------------------------------------------------------------------------------------------------------
   One market
   --------------------------------------------------------------------------------------------------------- */

.market {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 9.5rem;
  gap: var(--space-4) var(--space-6);
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--line);
}

.market-body {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  justify-items: start;
}

.market-number {
  font-size: var(--text-s);
  font-weight: 500;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}

.market-question {
  font-family: var(--font-display);
  font-size: var(--text-l);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.market-when {
  font-variant-numeric: tabular-nums;
}

.market-clock {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* The two pools, as one bar split where the money is. */
.pools {
  width: 100%;
  max-width: 30rem;
  display: grid;
  gap: var(--space-2);
}

.pools-bar {
  display: flex;
  height: var(--space-3);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}

.pools-bar span:first-child {
  background: var(--ink);
}

.pools-labels {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-s);
  font-variant-numeric: tabular-nums;
}

/* The visitor's own stake wears the bead (module.css): the same mark as "you are here". */
.mine {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.outcome {
  font-weight: 600;
}

/* ---------------------------------------------------------------------------------------------------------
   The tide staff
   --------------------------------------------------------------------------------------------------------- */

.staff {
  width: 100%;
  height: auto;
  color: var(--ink);
  overflow: visible;
}

.staff-post {
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
}

.staff-tick {
  stroke: currentColor;
  stroke-width: 1.5;
  opacity: 0.6;
}

.staff-band {
  stroke: currentColor;
  stroke-width: 2;
}

.staff-mark {
  stroke: var(--light);
  stroke-width: 4;
  stroke-linecap: round;
}

.staff-water {
  fill: currentColor;
  opacity: 0.16;
}

.staff-surface {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.staff-result {
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
}

.staff-if {
  stroke: currentColor;
  stroke-width: 2;
  stroke-dasharray: 5 5;
}

.staff text {
  fill: currentColor;
  font-family: var(--font-text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.staff .staff-mark-label {
  fill: var(--light);
  font-weight: 600;
}

/* On the sand the staff is drawn in the sea's colour; the mark keeps the light. */
.sheet .staff {
  color: var(--field);
}

.sheet .staff .staff-mark-label {
  fill: currentColor;
  font-weight: 600;
}

.staff-caption {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------------------------------------
   In the sheet: the rule with the visitor's own numbers
   --------------------------------------------------------------------------------------------------------- */

.whatif {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: var(--space-4) var(--space-5);
  align-items: start;
  padding-block: var(--space-4);
  border-top: 2px solid currentColor;
  border-bottom: 1px solid var(--line);
}

.whatif-numbers {
  display: grid;
  gap: var(--space-3);
}

.whatif output {
  display: block;
  font-weight: 600;
}

.whatif input[type='range'] {
  width: 100%;
  min-height: var(--target);
  margin: 0;
  accent-color: var(--field);
}

.whatif dl {
  display: grid;
  grid-template-columns: 1fr max-content;
  gap: var(--space-1) var(--space-4);
  font-size: var(--text-s);
}

.whatif dd {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.whatif .yours {
  font-weight: 700;
}


.form-grid {
  display: grid;
  gap: var(--space-4);
}

@media (max-width: 700px) {
  .risk {
    padding: var(--space-4);
  }

  .market {
    grid-template-columns: minmax(0, 1fr) 6.5rem;
    gap: var(--space-3) var(--space-4);
  }

  .whatif {
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: var(--space-3);
  }
}
