/* Setup pages for Only Snakes, Colourful Language and Higher or Lower (design "Only Snakes setup"),
   plus game night results. The form carries game_hue_attrs, so --game is the game's colour. */

/* ---------- Page head ---------- */

.gtf-setup-page {
  padding-top: 16px;
}

.gtf-setup-page__title {
  margin-top: 6px;
  font-size: clamp(44px, 6vw, 80px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 900;
}

.gtf-setup-page__lede {
  margin-top: 14px;
  max-width: 34em;
  font-size: 18px;
  line-height: 1.5;
  color: var(--gtf-text-2);
}

/* ---------- Form layout ---------- */

.gtf-setup {
  margin-top: 56px;

  & .gtf-form-errors {
    margin-bottom: 32px;
  }
}

.gtf-setup__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 64px;
  align-items: flex-start;
}

.gtf-setup__basics {
  flex: 1 1 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.gtf-setup__options {
  flex: 1.2 1 400px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.gtf-setup__label {
  font-size: 16px;
  font-weight: 600;
  color: var(--gtf-text-2);
}

p.gtf-setup__label {
  margin-bottom: 10px;
}

.gtf-setup__title-input {
  font-size: 20px;
}

.gtf-setup .gtf-input:focus,
.gtf-setup .gtf-textarea:focus {
  border-color: var(--gtf-yellow);
}

/* ---------- Option blocks (pills, ranges, steppers) ---------- */

.gtf-setup__option-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.gtf-setup__option-title {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;

  & label {
    cursor: pointer;
  }
}

.gtf-setup__unit {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--gtf-text-2);
}

.gtf-setup__note {
  margin: 8px 0 16px;
  max-width: 34em;
  font-size: 16px;
  line-height: 1.5;
  color: var(--gtf-text-2);
}

.gtf-setup__pills {
  gap: 8px;
}

.gtf-setup__pill {
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 0;
  background: var(--gtf-surface-2);
  font-weight: 800;
  font-size: 16px;

  &:hover {
    background: var(--gtf-surface-4);
  }
}

.gtf-setup__pills--fill .gtf-setup__pill {
  flex: 1 1 48px;
  padding: 14px 0;
  font-size: 20px;
}

.gtf-setup .gtf-pill:has(input:checked) {
  background: var(--game);
  border-color: var(--game);
  color: var(--gtf-ink);
}

.gtf-setup__range {
  height: 28px;
  accent-color: var(--game);
}

.gtf-setup__scale {
  margin-top: 4px;
  font-size: 14px;
  color: var(--gtf-text-2);
}

.gtf-setup__stepper {
  margin-top: 4px;

  & .gtf-stepper__btn:hover {
    border-color: var(--game);
  }
}

.gtf-setup__locked {
  max-width: 34em;
  font-size: 16px;
  line-height: 1.5;
  color: var(--gtf-text-2);
}

/* Values that follow a checked pill. Without :has() support, the server-rendered value shows. */
.gtf-setup__when:not(.is-current) {
  display: none;
}

@supports selector(:has(*)) {
  .gtf-setup .gtf-setup__when,
  .gtf-setup .gtf-setup__when.is-current {
    display: none;
  }

  .gtf-setup:has(input[name$="[roll_time_seconds]"][value="5"]:checked) [data-when-roll="5"],
  .gtf-setup:has(input[name$="[roll_time_seconds]"][value="6"]:checked) [data-when-roll="6"],
  .gtf-setup:has(input[name$="[roll_time_seconds]"][value="7"]:checked) [data-when-roll="7"],
  .gtf-setup:has(input[name$="[roll_time_seconds]"][value="8"]:checked) [data-when-roll="8"],
  .gtf-setup:has(input[name$="[roll_time_seconds]"][value="9"]:checked) [data-when-roll="9"],
  .gtf-setup:has(input[name$="[roll_time_seconds]"][value="10"]:checked) [data-when-roll="10"] {
    display: inline;
  }
}

/* ---------- Summary bar ---------- */

.gtf-setup-bar {
  margin-top: 72px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
  padding: 28px clamp(24px, 4vw, 40px);
  border-radius: var(--gtf-radius-card);
  background: var(--game);
  color: var(--gtf-ink);
}

.gtf-setup-bar__text {
  flex: 1 1 300px;
  min-width: 0;
}

.gtf-setup-bar__title {
  font-weight: 900;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.gtf-setup-bar__line {
  margin-top: 6px;
  font-size: 18px;
}

body.gtf .gtf-setup-bar__cancel {
  color: var(--gtf-ink);
  font-weight: 700;
  font-size: 17px;
  text-decoration: underline;

  &:hover {
    color: var(--gtf-ink);
    text-decoration-thickness: 3px;
  }

  &:focus-visible {
    outline: 3px solid var(--gtf-ink);
    outline-offset: 3px;
  }
}

.gtf-setup-bar__submit {
  border: 0;
  border-radius: var(--gtf-radius-btn);
  padding: 16px 28px;
  background: var(--gtf-ink);
  color: var(--gtf-cream);
  font-family: var(--gtf-font);
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.15s;

  &:hover {
    background: var(--gtf-surface-4);
  }

  &:focus-visible {
    outline: 3px solid var(--gtf-ink);
    outline-offset: 3px;
  }
}

@media (max-width: 480px) {
  .gtf-setup-bar__submit {
    flex: 1 1 auto;
  }
}

/* ---------- Game night results ---------- */

.gtf-results {
  padding-top: 16px;
}

.gtf-results__meta {
  margin-top: 10px;
  color: var(--gtf-text-2);
  font-size: 17px;
}

.gtf-results__winner {
  margin-bottom: 40px;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
  letter-spacing: -0.01em;
}

.gtf-results__section {
  margin-bottom: 40px;

  & > .gtf-h3 {
    margin-bottom: 14px;
  }
}

.gtf-results__place {
  flex: none;
  width: 2.2em;
  font-family: var(--gtf-mono);
  font-size: 20px;
  color: var(--gtf-text-2);
}

.gtf-results__row--top .gtf-results__place {
  color: var(--gtf-yellow);
}

.gtf-results__points {
  flex: none;
  font-weight: 900;
  font-size: 18px;
  color: var(--gtf-yellow);
}
