.proposal-selection {
  --selection-border: #81b9b46b;
  --selection-lagoon: #265b64;
  padding: clamp(20px, 3.4vw, 32px) clamp(12px, 3vw, 32px) 26px;
}

.selection-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: clamp(8px, 2vw, 18px);
  margin-bottom: clamp(15px, 2.5vw, 26px);
  padding-right: 40px;
}

.selection-heading h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(26px, 4.5vw, 43px);
  font-weight: 850;
  letter-spacing: -.055em;
  line-height: 1.03;
}

.selection-heading p,
.selection-instructions {
  margin: 9px 0 0;
  max-width: 58ch;
  color: var(--modal-muted);
  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.4;
}

.selection-surface { position: relative; }

.selection-instructions {
  margin: 0 0 12px;
  color: var(--modal-text);
  font-weight: 650;
}

.selection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 2vw, 16px);
}

.selection-level,
.selection-runner {
  position: relative;
  min-width: 0;
  border: 2px solid var(--selection-border);
  border-radius: clamp(9px, 1.8vw, 15px);
  color: var(--modal-text);
  background: var(--modal-surface);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.selection-level:hover,
.selection-runner:hover { border-color: #9bccc4; }

.selection-level[aria-pressed="true"],
.selection-runner[aria-pressed="true"] {
  border-color: var(--gold);
  background: var(--selection-lagoon);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.selection-level strong,
.selection-runner strong {
  font-size: clamp(16px, 3.1vw, 29px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.08;
}

.selection-level {
  --meter-color: #72e6b7;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  padding: 0;
  text-align: center;
  background: #103641;
}

.selection-level[data-choice="medium"] { --meter-color: #52c8fa; }
.selection-level[data-choice="hard"] { --meter-color: #ffc54f; }

.selection-level-art {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 388 / 229;
  object-fit: cover;
}

.selection-level-body {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  justify-items: center;
  align-items: start;
  gap: clamp(4px, .8vw, 8px);
  padding: clamp(8px, 1.5vw, 16px) clamp(4px, 1.1vw, 12px);
}

.selection-level-meter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(3px, .8vw, 7px);
  width: min(70%, 132px);
  margin-top: 4px;
  transform: skewX(-27deg);
}

.selection-level-meter > span {
  height: clamp(6px, 1vw, 11px);
  border: 1px solid #81b9b46b;
  border-radius: 2px;
  background: #0b2a35;
}

.selection-level-meter .is-lit {
  border-color: color-mix(in srgb, var(--meter-color), white 38%);
  background: var(--meter-color);
}

.selection-detail {
  color: var(--modal-muted);
  font-size: clamp(11px, 1.4vw, 14px);
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.selection-factor {
  color: var(--gold);
  font-size: clamp(23px, 4.2vw, 46px);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.selection-runner {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  padding: 0;
  text-align: left;
}

.selection-portrait {
  position: relative;
  height: clamp(240px, 37dvh, 360px);
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 34%, #fff8d9, transparent 65%), #eecb86;
}

.selection-runner:nth-child(2) .selection-portrait {
  background: radial-gradient(ellipse at 50% 34%, #deeee3, transparent 65%), #8abdb5;
}

.selection-runner:nth-child(3) .selection-portrait {
  background: radial-gradient(ellipse at 50% 34%, #ffe1db, transparent 65%), #d5a0ba;
}

.selection-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px 0;
}

.selection-runner-name {
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 60px;
  padding: clamp(6px, 1.5vw, 14px);
}

.selection-footer {
  display: flex;
  gap: 9px;
  justify-content: space-between;
  margin-top: clamp(12px, 2vw, 22px);
}

.selection-footer button,
.selection-demo button {
  min-height: 44px;
  border-radius: 9px;
  padding: 8px clamp(11px, 2vw, 17px);
  font: inherit;
  font-weight: 750;
  line-height: 1.15;
  cursor: pointer;
}

.selection-back,
.selection-demo button {
  border: 1px solid var(--selection-border);
  color: var(--modal-text);
  background: var(--modal-surface);
}

.selection-back:hover,
.selection-demo button:hover { border-color: #9bccc4; }

.selection-primary {
  min-width: min(152px, 49%);
  border: 1px solid #c68c17;
  color: var(--ink);
  background: linear-gradient(180deg, #ffd780, var(--gold));
  box-shadow: 0 3px 0 #94611e;
}

.selection-primary:hover:not(:disabled) { background: #ffd36e; }

.selection-primary:disabled {
  border-color: var(--selection-border);
  color: #a9c1c1;
  background: #254651;
  box-shadow: none;
  cursor: default;
}

.selection-status {
  margin: 8px 0 0;
  min-height: 2.5em;
  color: var(--modal-muted);
  font-size: 13px;
  line-height: 1.25;
}

.selection-demo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: clamp(13px, 2.3vw, 24px);
  padding-top: 12px;
  border-top: 1px solid var(--selection-border);
  font-size: 13px;
}

.selection-demo p {
  margin: 3px 0 0;
  color: var(--modal-muted);
  line-height: 1.3;
}

.selection-demo-buttons { display: flex; flex-wrap: wrap; gap: 5px; }

.selection-demo button { padding-inline: clamp(7px, 1.5vw, 13px); }

.selection-demo button[aria-pressed="true"] {
  border-color: #b6e2d1;
  background: var(--selection-lagoon);
}

.selection-hand {
  position: fixed;
  inset: 0 auto auto 0;
  width: 25px;
  height: 31px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px #04141d) drop-shadow(0 2px 6px #04141db3);
}

.selection-hand::before,
.selection-hand::after {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 98% 61%, 59% 63%, 76% 92%, 58% 100%, 42% 71%, 12% 92%);
  scale: var(--pointer-x-direction, 1) var(--pointer-y-direction, 1);
  transform-origin: top left;
  content: "";
}

.selection-hand::before { background: #fcfffd; }

.selection-hand::after {
  transform: translate(3px, 4px) scale(.77);
  background: #143c49;
}

.selection-hand-on-target::after { background: #187766; }
.selection-hand-closed::after { background: #ba6610; }

.selection-aimed { outline: 3px solid #bcf7e2; outline-offset: 3px; }

.proposal-selection button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .selection-heading { margin-bottom: 16px; }
  .selection-grid { gap: 5px; }
  .selection-runner-name { min-height: 50px; }
  .selection-runner-name strong { font-size: clamp(13px, 4vw, 16px); }
}

@media (prefers-reduced-motion: reduce) {
  .selection-level,
  .selection-runner { transition: none; }
}

.proposal:is([data-screen="difficulty"], [data-screen="runner"]) .proposal-selection {
  padding: clamp(18px, 4vw, 38px) clamp(16px, 4vw, 38px) 10px;
}

.proposal:is([data-screen="difficulty"], [data-screen="runner"]) .selection-heading {
  justify-content: center;
  align-items: center;
  padding-inline: 42px;
  text-align: center;
}

.proposal:is([data-screen="difficulty"], [data-screen="runner"]) .selection-heading h1 {
  max-width: none;
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.18;
}

.proposal:is([data-screen="difficulty"], [data-screen="runner"]) .selection-heading p { margin-inline: auto; }
.proposal:is([data-screen="difficulty"], [data-screen="runner"]) .selection-instructions { margin-inline: auto; text-align: center; }

.proposal:is([data-screen="difficulty"], [data-screen="runner"]) .selection-footer {
  display: grid;
  justify-content: center;
  grid-template-columns: minmax(0, 240px);
  gap: 5px;
}

.proposal:is([data-screen="difficulty"], [data-screen="runner"]) .selection-primary {
  background: var(--gold);
  border-color: #ffe4a2;
  box-shadow: none;
}

.proposal:is([data-screen="difficulty"], [data-screen="runner"]) .selection-primary:disabled {
  background: #254651;
  border-color: var(--selection-border);
}

.proposal:is([data-screen="difficulty"], [data-screen="runner"]) .selection-back {
  border-color: transparent;
  background: transparent;
  font-weight: 400;
}

.proposal:is([data-screen="difficulty"], [data-screen="runner"]) .selection-back:hover { text-decoration: underline; }

@media (max-width: 680px) and (orientation: portrait),
       (max-width: 950px) and (max-height: 520px) and (orientation: landscape) {
  .proposal:is([data-screen="difficulty"], [data-screen="runner"]) .proposal-selection {
    padding: 30px calc(16px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom))
      calc(16px + env(safe-area-inset-left));
  }

  .proposal:is([data-screen="difficulty"], [data-screen="runner"]) .selection-heading {
    gap: 8px;
    padding-inline: 36px;
    margin-bottom: 12px;
  }

}

@media (max-width: 950px) and (max-height: 520px) and (orientation: landscape) {
  .selection-level-art { height: clamp(44px, 15dvh, 76px); object-position: center 60%; }
  .selection-level-body { gap: 3px; padding-block: 6px; }
  .selection-level strong { font-size: clamp(16px, 3vw, 22px); }
  .selection-factor { font-size: clamp(21px, 3.3vw, 32px); }
}

@media (max-width: 680px) and (orientation: portrait) {
  .selection-portrait { height: clamp(130px, 48vw, 260px); }
}

@media (max-width: 950px) and (max-height: 520px) and (orientation: landscape) {
  .selection-portrait { height: clamp(100px, calc(100dvh - 280px), 200px); }
  .selection-runner-name { min-height: 0; padding: 6px 8px; }
  .selection-runner-name strong { font-size: 17px; }
}

@media (max-width: 950px) and (max-height: 520px) and (orientation: landscape) {
  .proposal-selection:has(.selection-status) .selection-footer {
    grid-template-columns: repeat(2, minmax(0, 160px));
    margin-top: 10px;
  }

  .proposal-selection:has(.selection-status) .selection-instructions {
    max-width: none;
    font-size: 13px;
  }

  .proposal-selection:has(.selection-status) .selection-level-art {
    height: clamp(44px, 12dvh, 62px);
  }
}
