/**
 * Shotcaller UI, on top of the Fiction Tribe system.
 *
 * Radius rule for the whole page: interactive controls are pills (--ft-radius-pill),
 * surfaces are 20px (--ft-radius-lg), inputs are 12px (--ft-radius-md). Nothing else.
 * Accent is FT purple, used for one thing at a time: focus, selection, the primary CTA.
 */

/* ---------- shell ---------- */

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* .ft-btn sets display, which outranks the UA rule for [hidden]. Put it back. */
[hidden] {
  display: none !important;
}

#main {
  flex: 1 0 auto;
}

::selection {
  background: var(--ft-purple-deep);
  color: #fff;
}

/* The library drops the outline on focus; put a real one back for keyboards. */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--ft-purple);
  outline-offset: 2px;
  border-radius: 4px;
}

.sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(20px, 4vw, 60px);
}

.sc-header__tagline {
  max-width: 52ch;
  margin: 10px 0 0;
  font-size: var(--ft-text-small, 14px);
  color: var(--text-gray, #6b6b6b);
}

.sc-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.sc-brand__mark {
  display: block;
  width: 91px;
  height: 44px;
  background-color: var(--logo-color);
  -webkit-mask: url("/shotcaller-logo.svg") center / contain no-repeat;
  mask: url("/shotcaller-logo.svg") center / contain no-repeat;
  transition: background-color var(--ft-speed) var(--ft-ease);
}

.sc-brand:hover .sc-brand__mark {
  background-color: var(--ft-purple);
}

.sc-brand__name {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}

/* ---------- shared type ---------- */

.sc-h1 {
  font-size: clamp(36px, 4vw, 62px);
  line-height: 1.05;
  margin: 0 0 18px;
}

.sc-h2 {
  font-size: clamp(26px, 2.4vw, 40px);
  margin: 0 0 20px;
}

.sc-lede {
  font-size: clamp(18px, 1.3vw, 22px);
  color: var(--ft-gray-300);
  max-width: 46ch;
  margin: 0;
}

.sc-label {
  display: block;
  font-size: var(--ft-text-small);
  font-weight: 700;
  margin: 0 0 8px;
  padding: 0;
}

.sc-hint,
.sc-section__note {
  font-size: 15px;
  color: var(--ft-gray-300);
  margin: 8px 0 0;
}

.sc-error {
  font-size: 15px;
  color: var(--ft-red);
  font-weight: 500;
  margin: 8px 0 0;
}

.sc-section {
  margin-top: clamp(48px, 6vw, 88px);
}

/* ---------- intake ---------- */

.sc-intake,
.sc-theater,
.sc-result {
  padding: clamp(24px, 3vw, 48px) 0 clamp(64px, 8vw, 110px);
}

.sc-intake__pitch {
  margin-bottom: clamp(28px, 3.5vw, 44px);
}

.sc-form {
  display: grid;
  gap: clamp(24px, 2.4vw, 34px);
  max-width: 1100px;
}

.sc-field--half {
  max-width: 520px;
}

.sc-textarea {
  min-height: 104px;
  font-size: 18px;
}

.sc-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

/* archetype cards: a radio group that reads as a deck */
.sc-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.sc-cards__loading {
  grid-column: 1 / -1;
  color: var(--ft-gray-300);
  margin: 0;
}

.sc-card {
  position: relative;
  display: block;
  background: var(--panel-color);
  border: 1px solid var(--stroke-color);
  border-radius: var(--ft-radius-lg);
  padding: 22px 24px 20px;
  cursor: pointer;
  transition: border-color var(--ft-speed) var(--ft-ease),
              box-shadow var(--ft-speed) var(--ft-ease),
              transform var(--ft-speed) var(--ft-ease);
}

.sc-card:hover {
  border-color: var(--ft-purple);
}

.sc-card:active {
  transform: translateY(1px);
}

.sc-card input,
.sc-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.sc-card:has(input:focus-visible) {
  outline: 3px solid var(--ft-purple);
  outline-offset: 2px;
}

.sc-card:has(input:checked) {
  border-color: var(--ft-purple);
  box-shadow: inset 0 0 0 2px var(--ft-purple);
}

.sc-card__label {
  display: block;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.sc-card__tagline {
  display: block;
  font-size: 15px;
  color: var(--ft-gray-300);
  line-height: 1.35;
}

/* "Best for" is help for the unsure, not clutter for the sure: it opens the card it
   belongs to and leaves the others alone. */
.sc-card__best {
  display: grid;
  grid-template-rows: 0fr;
  font-family: var(--ft-font-mono);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ft-purple);
  opacity: 0;
  overflow: hidden;
  transition: grid-template-rows var(--ft-speed) var(--ft-ease),
              opacity var(--ft-speed) var(--ft-ease);
}

.sc-card__best > span {
  min-height: 0;
  padding-top: 12px;
}

.sc-card:hover .sc-card__best,
.sc-card:has(input:checked) .sc-card__best,
.sc-card:has(input:focus-visible) .sc-card__best {
  grid-template-rows: 1fr;
  opacity: 1;
}

.sc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 40px;
}

.sc-toggle-set {
  border: 0;
  margin: 0;
  padding: 0;
}

.sc-toggle {
  display: inline-flex;
  border: 1px solid var(--stroke-color);
  border-radius: var(--ft-radius-pill);
  padding: 4px;
  gap: 4px;
  background: var(--panel-color);
}



.sc-toggle label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--ft-radius-pill);
  font-family: var(--ft-font-mono);
  font-size: 15px;
  cursor: pointer;
  transition: background-color var(--ft-speed) var(--ft-ease), color var(--ft-speed) var(--ft-ease);
}

.sc-toggle input:checked + label {
  background: var(--ft-purple);
  color: #fff;
}

.sc-toggle input:focus-visible + label {
  outline: 3px solid var(--ft-purple);
  outline-offset: 2px;
}

.sc-more {
  padding-bottom: 6px;
}

.sc-more__summary {
  cursor: pointer;
  font-weight: 500;
  padding: 10px 0;
  list-style: none;
}

.sc-more__summary::-webkit-details-marker {
  display: none;
}

.sc-more__summary::before {
  content: "+ ";
  color: var(--ft-purple);
  font-weight: 700;
}

.sc-more[open] .sc-more__summary::before {
  content: "- ";
}

.sc-more__body {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 12px;
}

.sc-more__body .sc-field {
  min-width: 190px;
}

.sc-submit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.sc-submit__note {
  font-size: 15px;
  color: var(--ft-gray-300);
  margin: 0;
}

/* ---------- theater ---------- */

.sc-stage {
  font-family: var(--ft-font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ft-purple);
  margin: 0 0 10px;
}

.sc-log {
  list-style: none;
  margin: 24px 0 32px;
  padding: 0;
  display: grid;
  gap: 14px;
}

.sc-log li {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 16px;
  align-items: baseline;
  font-size: 17px;
  color: var(--ft-gray-300);
  animation: sc-line-in 0.25s var(--ft-reveal-ease) both;
}

.sc-log li:last-child {
  color: var(--font-color);
  font-weight: 500;
}

.sc-log__t {
  font-family: var(--ft-font-mono);
  font-size: 13px;
  color: var(--ft-purple);
}

@keyframes sc-line-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.sc-theater__cancel {
  margin-top: 8px;
}

/* ---------- result ---------- */

.sc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.sc-badge {
  border: 1px solid var(--stroke-color);
  background: transparent;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sc-concept__title {
  margin-bottom: 16px;
}

.sc-message {
  display: inline-block;
  margin: 22px 0 0;
  padding: 12px 20px;
  border-radius: var(--ft-radius-lg);
  background: var(--ft-purple);
  color: #fff;
  font-weight: 500;
  font-size: clamp(17px, 1.3vw, 21px);
  max-width: 40ch;
}

.sc-share {
  padding-top: 8px;
}

.sc-share__row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sc-share__row .sc-input {
  font-family: var(--ft-font-mono);
  font-size: 14px;
}

/* Beat strip. Every beat is visible at once where there is room: the whole point is
   the ten-second read, and a beat parked off the right edge is a beat nobody sees. */
.sc-beats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(216px, 1fr));
  gap: 12px;
}

.sc-beat {
  background: var(--panel-color);
  border: 1px solid var(--stroke-color);
  border-radius: var(--ft-radius-lg);
  transition: border-color var(--ft-speed) var(--ft-ease), box-shadow var(--ft-speed) var(--ft-ease);
}

.sc-beat:hover {
  border-color: var(--ft-purple);
}

.sc-beat.is-open {
  border-color: var(--ft-purple);
  box-shadow: inset 0 0 0 2px var(--ft-purple);
}

/* The whole card is the control: a beat and its prompt are the same object. */
.sc-beat__open {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 20px 22px 22px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.sc-beat__cue {
  margin-top: 10px;
  font-family: var(--ft-font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ft-purple);
  opacity: 0;
  transition: opacity var(--ft-speed) var(--ft-ease);
}

.sc-beat:hover .sc-beat__cue,
.sc-beat.is-open .sc-beat__cue,
.sc-beat__open:focus-visible .sc-beat__cue {
  opacity: 1;
}

.sc-beat.is-open .sc-beat__cue {
  color: var(--ft-gray-300);
}

/* The panel sits under the strip so the prompt gets full width to be read in. */
.sc-detail {
  margin-top: 16px;
  padding: 24px;
  border: 1px solid var(--ft-purple);
  border-radius: var(--ft-radius-lg);
  background: var(--panel-color);
}

.sc-detail__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sc-detail__note {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--ft-gray-300);
  max-width: 70ch;
}

.sc-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sc-beat__t {
  font-family: var(--ft-font-mono);
  font-size: 13px;
  color: var(--ft-purple);
}

.sc-beat__fn {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-transform: capitalize;
}

.sc-beat__action {
  font-size: 15px;
  flex: 1 0 auto;
  line-height: 1.45;
  color: var(--ft-gray-300);
  margin: 0;
}

/* mute text sits on the card the way it sits on the frame */
.sc-beat__mute {
  margin-top: auto;
  padding: 10px 14px;
  border-radius: var(--ft-radius-md);
  background: var(--ft-black);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  text-align: center;
}

.sc-beat__mute--none {
  background: transparent;
  border: 1px dashed var(--stroke-color);
  color: var(--ft-gray-200);
  font-weight: 400;
  font-size: 13px;
  font-family: var(--ft-font-mono);
}

/* brand fact chips */
.sc-chips {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sc-chip {
  background: var(--panel-color);
  border: 1px solid var(--stroke-color);
  border-radius: var(--ft-radius-lg);
  padding: 14px 18px;
  min-width: 220px;
  max-width: 380px;
  flex: 1 1 240px;
}

/* The one message is a sentence, not a label: give it the room to be read.
   Declared after .sc-chip so the flex shorthand there cannot reset the basis. */
.sc-chip--wide {
  flex: 1 1 100%;
  max-width: 640px;
}

.sc-chip__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.sc-chip__key {
  font-family: var(--ft-font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ft-gray-300);
}

.sc-chip__source {
  font-family: var(--ft-font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: var(--ft-radius-pill);
  border: 1px solid var(--stroke-color);
  white-space: nowrap;
}

.sc-chip__source[data-source="found"] { color: var(--ft-gray-300); }
.sc-chip__source[data-source="inferred"],
.sc-chip__source[data-source="missing"] { color: var(--ft-purple); border-color: var(--ft-purple); }
.sc-chip__source[data-source="confirmed"] { color: #fff; background: var(--ft-purple); border-color: var(--ft-purple); }

.sc-chip__value {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 4px 0;
  font-family: var(--ft-font);
  font-size: 17px;
  color: var(--font-color);
  border-bottom: 1px solid transparent;
  transition: border-color var(--ft-speed) var(--ft-ease);
}

.sc-chip__value--multiline {
  resize: vertical;
  line-height: 1.35;
  min-height: 52px;
}

.sc-chip__value:hover,
.sc-chip__value:focus {
  border-bottom-color: var(--ft-purple);
  outline: none;
}

.sc-chip__value::placeholder {
  color: var(--ft-gray-200);
  font-style: normal;
}

.sc-chip.is-saving {
  opacity: 0.55;
  pointer-events: none;
}

.sc-chip__hint {
  font-size: 13px;
  color: var(--ft-gray-200);
  margin: 6px 0 0;
}

/* prompts */
.sc-prompt {
  border: 1px solid var(--stroke-color);
  border-radius: var(--ft-radius-lg);
  background: var(--panel-color);
  margin-bottom: 12px;
  overflow: hidden;
}

.sc-prompt__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  font-weight: 700;
  font-size: 19px;
  list-style: none;
}

.sc-prompt__summary::-webkit-details-marker {
  display: none;
}

.sc-prompt__meta {
  font-family: var(--ft-font-mono);
  font-size: 12px;
  color: var(--ft-gray-300);
  font-weight: 400;
}

.sc-prompt__body {
  padding: 0 24px 24px;
}

.sc-prompt__text {
  margin: 0 0 16px;
  padding: 20px;
  border-radius: var(--ft-radius-md);
  background: var(--input-bg);
  font-family: var(--ft-font-mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
}

/* ---------- footer (always dark, per the FT system) ---------- */

.sc-footer {
  background: var(--ft-black);
  color: #fff;
  padding: 44px 0;
  margin-top: auto;
}

.sc-footer__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.sc-footer__kanji {
  margin: 0;
  font-size: 13px;
}

.sc-footer__note {
  margin: 12px 0 0;
  font-size: var(--ft-text-small, 14px);
  color: var(--ft-gray-100, rgba(255, 255, 255, 0.7));
  max-width: 60ch;
}

/* "A product of" credit — the strip every FT product carries */
.sc-product-of {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.18s ease;
  white-space: nowrap;
}

.sc-product-of:hover,
.sc-product-of:focus-visible {
  opacity: 1;
}

.sc-product-of__label {
  font-family: var(--ft-font-mono, 'Space Mono', monospace);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.sc-product-of__logo {
  display: block;
  width: 132px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: url("/ft/logo/ft-wordmark-mono.svg") center / contain no-repeat;
  mask: url("/ft/logo/ft-wordmark-mono.svg") center / contain no-repeat;
}

/* ---------- responsive ---------- */

@media (max-width: 992px) {
  .sc-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sc-share {
    margin-top: 32px;
  }
}

@media (max-width: 680px) {
  .sc-header {
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .sc-cards {
    grid-template-columns: 1fr;
  }
  .sc-beats {
    grid-template-columns: 1fr;
  }
  .sc-log li {
    grid-template-columns: 48px 1fr;
    font-size: 16px;
  }
  .sc-chip {
    max-width: none;
  }
  .sc-submit .ft-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
