/* Fairness: the modal tabs and the verifier, then the provably fair page and its calculator */
.stage__end {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.stage__fairness {
  height: 36px;
  background: var(--surface-3);
  font-size: 13px;
}

.fair-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.fair-text {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.7;
}

.fair-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.fair-steps li {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.6;
}

.fair-steps__number {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 700;
}

.fair-code {
  display: block;
  margin: 0;
  padding: var(--space-3) 14px;
  overflow-x: auto;
  border-radius: var(--radius-md);
  background: var(--surface-0);
  color: var(--ink);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
}

.fair-code code {
  font: inherit;
}

.fair-more {
  align-self: center;
  color: var(--focus);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.fair-more:hover {
  text-decoration: underline;
}

/* Seeds tab */
.fair-seed {
  display: flex;
  gap: var(--space-2);
}

.fair-seed__value {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  min-height: var(--control-md);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-0);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.fair-seed .icon-button {
  flex: none;
  width: var(--control-md);
  height: auto;
  min-height: var(--control-md);
  background: var(--surface-3);
}

.fair-seed .is-done {
  color: var(--win);
}

.fair-nonce {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font-size: 14px;
}

.fair-nonce span {
  color: var(--ink-muted);
}

.fair-rotate {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.fair-rotate__title {
  margin: 0;
  font-size: 15px;
}

.fair-rotate__row {
  display: flex;
  gap: var(--space-2);
}

.fair-rotate__row .field__affix {
  flex: 1;
  min-width: 0;
}

.fair-rotate__row .button {
  flex: none;
}

.fair-rotate .field__toggle:hover {
  background: var(--surface-3);
}

.fair-rotate .copy-field__mono {
  font-size: 13px;
}

.form-status a {
  flex: none;
  margin-left: auto;
  color: var(--focus);
  font-size: 13px;
  text-decoration: none;
}

/* Verifier */
.fair-form {
  display: grid;
  gap: var(--space-3);
}

.fair-form--modal {
  grid-template-areas: "game" "client" "server" "nonce";
}

.fair-form__game { grid-area: game; }
.fair-form__client { grid-area: client; }
.fair-form__server { grid-area: server; }
.fair-form__nonce { grid-area: nonce; }

.fair-form select.field__input {
  padding-right: var(--space-3);
}

.fair-form .copy-field__mono {
  font-size: 13px;
}

.fair-stepper {
  display: flex;
  gap: var(--space-2);
}

.fair-stepper .field__input {
  flex: 1;
  min-width: 0;
}

.fair-stepper .icon-button {
  flex: none;
  width: var(--control-md);
  height: var(--control-md);
  background: var(--surface-3);
}

.fair-result {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface-0);
}

.fair-result__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  text-align: center;
}

.fair-result__label,
.fair-result__caption {
  color: var(--ink-muted);
  font-size: 13px;
}

.fair-result__value {
  font-family: var(--font-display);
  font-size: 40px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.fair-result__match {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--win);
  font-size: 13px;
  font-weight: 600;
}

.fair-result__hash {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100%;
  color: var(--ink-muted);
  font-size: 12px;
}

.fair-result__hash code {
  color: var(--ink);
  font-family: ui-monospace, Menlo, monospace;
  overflow-wrap: anywhere;
}

.fair-result__empty {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  text-align: center;
}

.fair-board {
  display: grid;
  grid-template-columns: repeat(5, 28px);
  gap: 4px;
  margin: var(--space-1) 0;
  padding: 0;
  list-style: none;
}

.fair-board--keno {
  grid-template-columns: repeat(8, 24px);
  gap: 3px;
}

.fair-board li {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.fair-board--mines .is-picked {
  background: var(--danger-fill);
  color: var(--ink);
  font-weight: 700;
}

.fair-board--keno .is-picked {
  background: var(--win);
  color: var(--surface-0);
  font-weight: 700;
}

/* Provably fair page */
.fair-article .settings__title {
  font-size: 22px;
}

.fair-article .fair-text {
  font-size: 15px;
  line-height: 1.8;
}

.fair-article .fair-code {
  font-size: 14px;
}

.fair-games {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.fair-games__item {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.fair-games__item:hover {
  background: var(--surface-3);
}

.fair-terms {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
}

.fair-terms div {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-3) 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.6;
}

.fair-terms dt {
  font-weight: 700;
}

.fair-terms dd {
  margin: 0;
  color: var(--ink-muted);
}

.fair-rules {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.fair-rule {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.fair-rule__title {
  margin: 0;
  font-size: 16px;
}

.fair-pairs {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.fair-pair {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.fair-pair__head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--ink-muted);
  font-size: 13px;
}

.fair-pair__seeds {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
}

.fair-pair__seeds div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: var(--space-3);
  font-size: 13px;
}

.fair-pair__seeds dt {
  color: var(--ink-muted);
}

.fair-pair__seeds dd {
  margin: 0;
  font-family: ui-monospace, Menlo, monospace;
  overflow-wrap: anywhere;
}

.fair-pair .fair-more {
  align-self: flex-start;
}

/* Calculator */
.fair-form--page {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas: "game nonce" "client client" "server server";
}

.fair-result--steps {
  display: grid;
  grid-template-columns: minmax(220px, max-content) minmax(0, 1fr);
  gap: var(--space-4);
}

.fair-result--steps .fair-result__main {
  align-items: flex-start;
  justify-content: center;
  padding-right: var(--space-4);
  border-right: 1px solid var(--surface-3);
  text-align: left;
}

.fair-result__steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  font-size: 14px;
  list-style: none;
}

.fair-result__steps li {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.fair-result__steps span {
  color: var(--ink-muted);
}

.fair-result__steps code {
  font-family: ui-monospace, Menlo, monospace;
  overflow-wrap: anywhere;
}

@media (max-width: 767px) {
  .fair-form--page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "game" "client" "server" "nonce";
  }

  .fair-result--steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .fair-result--steps .fair-result__main {
    padding: 0 0 var(--space-4);
    border-right: 0;
    border-bottom: 1px solid var(--surface-3);
  }

  .fair-terms div,
  .fair-pair__seeds div {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
  }
}
