/*
 * Learn player. The play screens use a full-bleed shell (.lp-shell). On the
 * play screen the learn-play Stimulus controller sets data-state on the shell
 * and toggles [data-when] blocks, so each step of a turn (watch, speak, check)
 * only shows what it needs.
 */

.lp-shell {
  --lp-bg: #111214;
  --lp-surface: #18191c;
  --lp-surface-2: #202125;
  --lp-border: rgba(255, 255, 255, 0.08);
  --lp-border-strong: rgba(255, 255, 255, 0.16);
  --lp-text: #ecebe8;
  --lp-muted: #a7a6a2;
  --lp-faint: #75746f;
  --lp-accent: #8fb0cc;
  --lp-primary: #ecebe8;
  --lp-on-primary: #141517;
  --lp-record: #c75b52;
  --lp-match: #7fb394;
  --lp-miss: #cfae6a;
  --lp-block: #c97474;
  --lp-level: 0;
  --lp-radius: 16px;
  --lp-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --lp-sans: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --lp-serif: "Oswald", system-ui, sans-serif;

  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--lp-bg);
  color: var(--lp-text);
  font-family: var(--lp-sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.lp-shell *,
.lp-shell *::before,
.lp-shell *::after {
  box-sizing: border-box;
}

.lp-shell [hidden] {
  display: none !important;
}

.lp-shell [data-when]:not([hidden]) {
  animation: lp-fade 0.18s ease-out both;
}

.lp-display {
  font-family: var(--lp-serif);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.lp-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lp-faint);
}

.lp-shell p,
.lp-shell h1,
.lp-shell h2 {
  margin: 0;
}

/* Top bar ----------------------------------------------------------------- */

.lp-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(17, 18, 20, 0.92);
  border-bottom: 1px solid var(--lp-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (min-width: 768px) {
  .lp-topbar {
    padding: 14px 32px;
  }
}

.lp-topbar__title {
  text-align: center;
  min-width: 0;
}

.lp-topbar__name {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50vw;
}

.lp-brand {
  font-family: var(--lp-serif);
  font-size: 18px;
  color: var(--lp-text);
  text-decoration: none;
}

.lp-nav-link {
  justify-self: end;
  font-size: 13px;
  color: var(--lp-muted);
  text-decoration: none;
}

.lp-nav-link:hover {
  color: var(--lp-text);
}

.lp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--lp-border);
  background: transparent;
  color: var(--lp-muted);
  transition: background 0.15s, color 0.15s;
}

.lp-icon-btn:hover {
  background: var(--lp-surface-2);
  color: var(--lp-text);
}

.lp-icon-btn svg {
  width: 16px;
  height: 16px;
}

.lp-player {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--lp-muted);
  max-width: 100%;
}

.lp-player__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--lp-surface-2);
  border: 1px solid var(--lp-border-strong);
  color: var(--lp-text);
  font-weight: 500;
  font-size: 12px;
}

.lp-player__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .lp-player__name {
    display: none;
  }
}

/* Stage ------------------------------------------------------------------- */

.lp-main {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

@media (min-width: 768px) {
  .lp-main {
    padding: 24px 32px 64px;
  }
}

.lp-stage.is-entering {
  animation: lp-fade 0.22s ease-out both;
}

.lp-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 16px;
  padding: 10px 14px;
  max-width: 640px;
  border-radius: 10px;
  border: 1px solid rgba(201, 116, 116, 0.35);
  background: rgba(201, 116, 116, 0.08);
  color: #e3b7b7;
  font-size: 14px;
}

.lp-trail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.lp-trail__dots {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lp-dot {
  width: 20px;
  height: 4px;
  border-radius: 999px;
  background: var(--lp-surface-2);
}

.lp-dot--match {
  background: var(--lp-match);
}

.lp-dot--miss {
  background: var(--lp-miss);
}

.lp-dot--current {
  width: 32px;
  background: var(--lp-text);
}

.lp-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "screen"
    "dock"
    "brief";
}

@media (min-width: 1024px) {
  .lp-layout {
    gap: 20px;
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-rows: 1fr auto;
    grid-template-areas:
      "screen brief"
      "screen dock";
  }
}

/* Screen (video) ---------------------------------------------------------- */

.lp-screen {
  grid-area: screen;
  position: relative;
  align-self: start;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: var(--lp-radius);
  background: #000;
  border: 1px solid var(--lp-border);
}

/* Generated clips are portrait. The frame follows the clip's real shape. */
.lp-screen.is-portrait {
  aspect-ratio: 9 / 16;
  width: auto;
  max-width: 100%;
  height: min(72dvh, 760px);
  justify-self: center;
}

@media (min-width: 1024px) {
  .lp-layout:has(.lp-screen.is-portrait) {
    grid-template-columns: auto 380px;
    justify-content: center;
  }

  .lp-screen.is-portrait {
    height: min(calc(100dvh - 170px), 820px);
  }

  .lp-scene:has(.lp-screen.is-portrait) {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
  }

  .lp-dock {
    align-self: end;
  }
}

.lp-screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  transition: filter 0.25s ease;
}

.lp-shell[data-state="intro"] .lp-screen video,
.lp-shell[data-state="processing"] .lp-screen video {
  filter: brightness(0.5);
}

.lp-screen__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: var(--lp-muted);
  background: var(--lp-surface);
}

.lp-screen__placeholder svg {
  width: 32px;
  height: 32px;
  opacity: 0.6;
}

.lp-screen__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

.lp-screen__corner {
  position: absolute;
  right: 12px;
  bottom: 16px;
  display: flex;
  gap: 8px;
}

.lp-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: var(--lp-on-primary);
  background: var(--lp-primary);
  transition: transform 0.15s ease, background 0.15s;
}

.lp-play:hover {
  background: #fff;
}

.lp-play:active {
  transform: scale(0.96);
}

.lp-play svg {
  width: 26px;
  height: 26px;
  margin-left: 3px;
}

.lp-play-label {
  font-size: 15px;
  font-weight: 500;
}

.lp-play-hint {
  margin-top: -6px !important;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}

.lp-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(17, 18, 20, 0.75);
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.lp-chip-btn:hover {
  background: rgba(32, 33, 37, 0.95);
}

.lp-chip-btn svg {
  width: 14px;
  height: 14px;
}

.lp-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.lp-progress__bar {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(var(--lp-progress, 0));
  background: var(--lp-accent);
  transition: transform 0.25s linear;
}

.lp-spinner {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--lp-text);
  animation: lp-spin 0.8s linear infinite;
}

.lp-spinner--sm {
  width: 18px;
  height: 18px;
  flex: none;
}

.lp-screen__buffering {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lp-screen.is-buffering .lp-screen__buffering {
  display: flex;
}

/* Brief ------------------------------------------------------------------- */

.lp-card {
  border-radius: var(--lp-radius);
  border: 1px solid var(--lp-border);
  background: var(--lp-surface);
}

.lp-brief {
  grid-area: brief;
  align-self: start;
  padding: 22px;
}

.lp-brief__title {
  margin-top: 8px !important;
  font-size: 24px;
  line-height: 1.3;
}

.lp-brief__lead {
  margin-top: 12px !important;
  font-size: 15px;
  line-height: 1.6;
}

.lp-brief__context {
  margin-top: 10px !important;
  font-size: 13px;
  line-height: 1.6;
  color: var(--lp-faint);
}

.lp-goal {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background: var(--lp-surface-2);
}

.lp-goal__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(143, 176, 204, 0.12);
  color: var(--lp-accent);
}

.lp-goal__icon svg {
  width: 16px;
  height: 16px;
}

.lp-goal__label,
.lp-phrase__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--lp-faint);
}

.lp-goal__text {
  margin-top: 3px !important;
  font-size: 15px;
  line-height: 1.5;
}

.lp-phrase {
  margin-top: 10px;
  padding: 14px 14px 14px 16px;
  border-left: 2px solid var(--lp-accent);
  border-radius: 0 12px 12px 0;
  background: var(--lp-surface-2);
}

.lp-phrase__text {
  margin-top: 6px !important;
  font-size: 16px;
  line-height: 1.5;
}

.lp-recap {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px !important;
  font-size: 13px;
  line-height: 1.5;
  color: var(--lp-muted);
}

.lp-recap__dot {
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--lp-faint);
}

.lp-recap--match .lp-recap__dot {
  background: var(--lp-match);
}

.lp-recap--miss .lp-recap__dot {
  background: var(--lp-miss);
}

.lp-recap--blocked .lp-recap__dot {
  background: var(--lp-block);
}

/* Dock (microphone) ------------------------------------------------------- */

.lp-dock {
  grid-area: dock;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
}

.lp-dock__text {
  flex: 1;
  min-width: 0;
}

.lp-dock__status {
  font-size: 15px;
  font-weight: 500;
}

.lp-dock__hint {
  margin-top: 3px !important;
  font-size: 13px;
  color: var(--lp-faint);
}

.lp-dock__transcript {
  margin-top: 10px !important;
  font-family: var(--lp-serif);
  font-size: 15px;
  line-height: 1.55;
  word-wrap: break-word;
}

.lp-dock__transcript:empty,
.lp-dock__error:empty {
  display: none;
}

.lp-dock__error {
  margin-top: 8px !important;
  font-size: 13px;
  color: #e3a9a9;
}

.lp-kbd {
  display: inline-block;
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid var(--lp-border-strong);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--lp-muted);
}

@media (hover: none) {
  .lp-kbd-hint {
    display: none;
  }
}

.lp-mic {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: var(--lp-on-primary);
  background: var(--lp-primary);
  transition: transform 0.15s ease, background 0.15s, color 0.15s;
}

.lp-mic svg {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
}

.lp-mic__halo {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 2px solid var(--lp-record);
  opacity: 0;
  transform: scale(calc(1.08 + var(--lp-level) * 0.35));
  transition: transform 0.08s linear, opacity 0.15s;
}

.lp-mic:hover {
  background: #fff;
}

.lp-mic:active {
  transform: scale(0.96);
}

.lp-mic:focus-visible,
.lp-play:focus-visible,
.lp-btn:focus-visible,
.lp-chip-btn:focus-visible,
.lp-icon-btn:focus-visible,
.lp-choice input:focus-visible + .lp-choice__card {
  outline: 2px solid var(--lp-accent);
  outline-offset: 3px;
}

.lp-mic .lp-icon-stop,
.lp-mic .lp-icon-wait {
  display: none;
}

.lp-shell[data-state="recording"] .lp-mic {
  background: var(--lp-record);
  color: #fff;
}

.lp-shell[data-state="recording"] .lp-mic__halo {
  opacity: 0.8;
}

.lp-shell[data-state="recording"] .lp-mic .lp-icon-mic,
.lp-shell[data-state="processing"] .lp-mic .lp-icon-mic {
  display: none;
}

.lp-shell[data-state="recording"] .lp-mic .lp-icon-stop {
  display: block;
}

.lp-shell[data-state="processing"] .lp-mic .lp-icon-wait {
  display: block;
  animation: lp-spin 0.8s linear infinite;
}

.lp-shell[data-state="intro"] .lp-mic,
.lp-shell[data-state="watching"] .lp-mic,
.lp-shell[data-state="processing"] .lp-mic,
.lp-mic:disabled {
  cursor: default;
  background: var(--lp-surface-2);
  color: var(--lp-faint);
  transform: none;
}

.lp-timer {
  font-variant-numeric: tabular-nums;
  color: var(--lp-muted);
  font-weight: 400;
}

.lp-rec-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--lp-record);
  vertical-align: middle;
  animation: lp-blink 1.2s ease-in-out infinite;
}

/* Buttons and fields ------------------------------------------------------ */

.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.lp-btn svg {
  width: 16px;
  height: 16px;
}

.lp-btn--primary {
  color: var(--lp-on-primary);
  background: var(--lp-primary);
}

.lp-btn--primary:hover {
  background: #fff;
}

.lp-btn--ghost {
  color: var(--lp-text);
  background: transparent;
  border: 1px solid var(--lp-border-strong);
}

.lp-btn--ghost:hover {
  background: var(--lp-surface-2);
}

.lp-btn--block {
  width: 100%;
}

.lp-field {
  display: block;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--lp-border-strong);
  background: var(--lp-bg);
  color: var(--lp-text);
  font: inherit;
  font-size: 15px;
}

.lp-field:focus {
  outline: none;
  border-color: var(--lp-accent);
}

.lp-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--lp-muted);
}

/* Result toast ------------------------------------------------------------ */

.lp-result {
  --lp-tone: var(--lp-match);
  position: fixed;
  left: 50%;
  top: 76px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 32px);
  max-width: 520px;
  padding: 10px 10px 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--lp-border-strong);
  border-left: 3px solid var(--lp-tone);
  background: rgba(24, 25, 28, 0.97);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -8px);
  transition: opacity 0.18s ease, transform 0.18s var(--lp-ease), visibility 0s linear 0.18s;
}

.lp-result.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 0.18s ease, transform 0.18s var(--lp-ease), visibility 0s;
}

.lp-result[data-outcome="miss"] {
  --lp-tone: var(--lp-miss);
}

.lp-result[data-outcome="blocked"] {
  --lp-tone: var(--lp-block);
}

.lp-result[data-outcome="loading"] {
  --lp-tone: var(--lp-accent);
}

.lp-result__icon {
  display: inline-flex;
  flex: none;
  color: var(--lp-tone);
}

.lp-result__icon svg,
.lp-result__icon .lp-fb-icon-loading {
  width: 18px;
  height: 18px;
  display: none;
}

.lp-result[data-outcome="match"] .lp-fb-icon-match,
.lp-result[data-outcome="done"] .lp-fb-icon-match,
.lp-result[data-outcome="miss"] .lp-fb-icon-miss,
.lp-result[data-outcome="blocked"] .lp-fb-icon-blocked,
.lp-result[data-outcome="loading"] .lp-fb-icon-loading {
  display: block;
}

.lp-result__text {
  flex: 1;
  min-width: 0;
}

.lp-result__title {
  font-size: 14px;
  font-weight: 500;
}

.lp-result__detail {
  margin-top: 2px !important;
  font-size: 13px;
  color: var(--lp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lp-result__scores {
  display: flex;
  flex: none;
  gap: 12px;
  font-size: 12px;
  color: var(--lp-faint);
  text-align: right;
}

.lp-result__scores strong {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--lp-text);
  font-variant-numeric: tabular-nums;
}

.lp-result__close {
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
}

@media (max-width: 480px) {
  .lp-result__scores span:nth-child(2) {
    display: none;
  }
}

/* Meters ------------------------------------------------------------------ */

.lp-meter__track {
  height: 4px;
  border-radius: 999px;
  background: var(--lp-surface-2);
  overflow: hidden;
}

.lp-meter__fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: var(--lp-tone, var(--lp-accent));
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.6s var(--lp-ease);
}

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

.lp-summary {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 0;
  text-align: center;
}

.lp-summary__title {
  margin-top: 12px !important;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.2;
}

.lp-summary__lead {
  margin: 12px auto 0 !important;
  max-width: 460px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--lp-muted);
}

.lp-ring {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 32px auto 0;
}

.lp-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.lp-ring__track {
  fill: none;
  stroke: var(--lp-surface-2);
  stroke-width: 8;
}

.lp-ring__value {
  fill: none;
  stroke: var(--lp-text);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 578;
  stroke-dashoffset: 578;
  transition: stroke-dashoffset 0.9s var(--lp-ease);
}

.lp-ring__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lp-ring__score {
  font-size: 48px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.lp-ring__caption {
  margin-top: 6px;
  font-size: 12px;
  color: var(--lp-faint);
}

.lp-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 28px auto 0;
  max-width: 480px;
  border: 1px solid var(--lp-border);
  border-radius: 12px;
  overflow: hidden;
}

.lp-stat {
  padding: 14px 8px;
  background: var(--lp-surface);
}

.lp-stat + .lp-stat {
  border-left: 1px solid var(--lp-border);
}

.lp-stat__value {
  font-size: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.lp-stat__label {
  margin-top: 2px !important;
  font-size: 12px;
  color: var(--lp-faint);
}

.lp-scores {
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
  display: grid;
  gap: 8px;
}

.lp-score {
  padding: 16px 18px;
}

.lp-score--match {
  --lp-tone: var(--lp-match);
}

.lp-score--miss {
  --lp-tone: var(--lp-miss);
}

.lp-score__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.lp-score__index {
  margin-right: 10px;
  font-size: 12px;
  color: var(--lp-faint);
  font-variant-numeric: tabular-nums;
}

.lp-score__title {
  font-weight: 500;
}

.lp-score__value {
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.lp-score__quote {
  margin-top: 6px !important;
  font-family: var(--lp-serif);
  font-size: 14px;
  line-height: 1.55;
  color: var(--lp-muted);
}

.lp-score .lp-meter__track {
  margin-top: 12px;
}

.lp-score__meta {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.lp-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  background: var(--lp-surface-2);
  color: var(--lp-muted);
}

.lp-pill--match {
  color: var(--lp-match);
}

.lp-pill--miss {
  color: var(--lp-miss);
}

.lp-summary__note {
  margin-top: 14px !important;
  font-size: 12px;
  color: var(--lp-faint);
}

.lp-summary__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}

.lp-summary__actions form {
  display: contents;
}

.lp-empty {
  max-width: 480px;
  margin: 10vh auto 0;
  padding: 36px 28px;
  text-align: center;
}

.lp-empty p:not(.lp-eyebrow) {
  margin: 12px 0 24px;
  color: var(--lp-muted);
}

/* Sequence picker (plays index) ------------------------------------------ */

.lp-hero {
  max-width: 640px;
  margin: 24px 0 32px;
}

.lp-hero__title {
  margin-top: 10px !important;
  font-size: clamp(28px, 4.5vw, 40px);
  line-height: 1.2;
}

.lp-hero__lead {
  margin-top: 12px !important;
  font-size: 16px;
  line-height: 1.6;
  color: var(--lp-muted);
}

.lp-picker {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1024px) {
  .lp-picker {
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
  }
}

.lp-choices {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin: 0;
  padding: 0;
  border: 0;
}

.lp-choices legend {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  padding: 0;
}

.lp-choice__card,
.lp-choice__body,
.lp-choice__title,
.lp-choice__meta {
  display: block;
}

.lp-start__submit {
  margin-top: 16px;
}

/* Email access gate ------------------------------------------------------ */

.lp-access {
  max-width: 420px;
}

.lp-choices > .lp-eyebrow {
  grid-column: 1 / -1;
  margin-bottom: 4px;
}

.lp-choice--static {
  cursor: default;
}

.lp-choice--static:hover .lp-choice__card {
  border-color: var(--lp-border);
}

.lp-main--access .lp-alert {
  margin: 8px 0 0;
}

.lp-alert--notice {
  border-color: var(--lp-border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--lp-text);
}

.lp-choice {
  position: relative;
  display: block;
  cursor: pointer;
}

.lp-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lp-choice__card {
  height: 100%;
  overflow: hidden;
  border-radius: var(--lp-radius);
  border: 1px solid var(--lp-border);
  background: var(--lp-surface);
  transition: border-color 0.15s, background 0.15s;
}

.lp-choice:hover .lp-choice__card {
  border-color: var(--lp-border-strong);
}

.lp-choice input:checked + .lp-choice__card {
  border-color: var(--lp-accent);
  background: var(--lp-surface-2);
}

.lp-choice__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--lp-surface-2);
  color: var(--lp-faint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lp-choice__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lp-choice__media svg {
  width: 28px;
  height: 28px;
}

.lp-choice__check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--lp-accent);
  color: var(--lp-on-primary);
  opacity: 0;
  transition: opacity 0.15s;
}

.lp-choice__check svg {
  width: 14px;
  height: 14px;
}

.lp-choice input:checked + .lp-choice__card .lp-choice__check {
  opacity: 1;
}

.lp-choice__body {
  padding: 14px 16px 16px;
}

.lp-choice__title {
  font-family: var(--lp-serif);
  font-size: 16px;
  line-height: 1.4;
}

.lp-choice__description {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--lp-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lp-choice__meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--lp-faint);
}

.lp-start {
  padding: 22px;
}

@media (min-width: 1024px) {
  .lp-start {
    position: sticky;
    top: 88px;
  }
}

.lp-start__title {
  font-size: 18px;
  line-height: 1.35;
}

.lp-start__steps {
  margin: 16px 0 20px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--lp-muted);
}

.lp-start__steps li {
  display: flex;
  gap: 10px;
}

.lp-start__steps span {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--lp-border-strong);
  font-size: 11px;
  color: var(--lp-text);
}

/* Preload pool keeps upcoming clips buffering off screen. */
.lp-pool {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
  left: -10px;
  top: -10px;
}

.lp-pool video {
  opacity: 0;
}

.lp-pool__status {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--lp-border-strong);
  background: rgba(24, 25, 28, 0.96);
  color: var(--lp-muted);
  font-size: 13px;
  pointer-events: none;
  transform: translateX(-50%);
}

/* Keyframes --------------------------------------------------------------- */

@keyframes lp-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes lp-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes lp-blink {
  50% {
    opacity: 0.3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lp-shell *,
  .lp-shell *::before,
  .lp-shell *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
