/* ==========================================================================
   Make a video from memes - see meme-reel.js.
   ========================================================================== */

/* ------------------------------------------------------- picking memes --- */

/* The same look as picking for a Tag Spree, but numbered: the order they are
   picked in is the order they play in. */
.meme-gallery.mr-picking .meme-item,
#mt-results.mr-picking .meme-item {
  position: relative;
  cursor: copy;
}

.meme-gallery.mr-picking .meme-item::after,
#mt-results.mr-picking .meme-item::after {
  content: '';
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #000;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.meme-gallery.mr-picking .meme-item.mr-picked,
#mt-results.mr-picking .meme-item.mr-picked {
  outline: 4px solid var(--tool-a1, #ff2d95);
  outline-offset: -4px;
  box-shadow: 0 0 0 2px #000, 0 0 26px -4px color-mix(in srgb, var(--tool-a1, #ff2d95) 70%, transparent);
}

.meme-gallery.mr-picking .meme-item.mr-picked::after,
#mt-results.mr-picking .meme-item.mr-picked::after {
  content: attr(data-order);
  border-color: var(--tool-a1, #ff2d95);
  background: var(--tool-a1, #ff2d95);
  color: #fff;
}

/* Picking means picking: the copy and download buttons stand aside. */
.meme-gallery.mr-picking .ma-actions,
#mt-results.mr-picking .ma-actions {
  display: none;
}

.mr-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 2500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: calc(100vw - 24px);
  padding: 0.55rem 0.6rem 0.55rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: var(--tool-panel, #15121f);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
  color: var(--tool-fg, #f2f0f7);
  font-size: 0.85rem;
  transform: translateX(-50%);
}

.mr-bar[hidden] {
  display: none;
}

.mr-bar-title {
  font-weight: 700;
  white-space: nowrap;
}

.mr-count {
  color: var(--tool-dim, #b9b4c9);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .mr-bar {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 16px;
  }
  .mr-bar-title {
    display: none;
  }
}

/* ------------------------------------------------------------- buttons --- */

.mr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--tool-a1, #ff2d95);
  border-radius: 999px;
  background: var(--tool-a1, #ff2d95);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.mr-btn:hover {
  filter: brightness(1.1);
}

.mr-btn:disabled {
  opacity: 0.4;
  cursor: default;
  filter: none;
}

.mr-btn.mr-ghost {
  border-color: rgba(255, 255, 255, 0.22);
  background: transparent;
  color: var(--tool-fg, #f2f0f7);
}

.mr-btn.mr-small {
  padding: 0.35rem 0.8rem;
  font-size: 0.76rem;
}

.mr-btn.mr-big {
  padding: 0.75rem 1.6rem;
  font-size: 0.95rem;
}

.mr-open-wrap {
  margin: 0 auto 0.8rem;
  text-align: center;
}

.mr-open-chip {
  margin-left: 0.4rem;
}

/* --------------------------------------------------------------- panel --- */

.mr-panel {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3vh 12px;
  overflow-y: auto;
  background: color-mix(in srgb, var(--tool-bg, #05030c) 72%, transparent);
}

.mr-panel[hidden] {
  display: none;
}

body.mr-panel-on {
  overflow: hidden;
}

.mr-card {
  width: 100%;
  max-width: 68rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: var(--tool-panel, #15121f);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  color: var(--tool-fg, #f2f0f7);
}

.mr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem 0.4rem;
}

.mr-head h3 {
  margin: 0;
  font-family: 'Unbounded', 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
}

.mr-x {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--tool-mute, #8b889b);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.mr-x:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.mr-body {
  padding: 0.4rem 1.2rem 1.3rem;
}

.mr-body section {
  margin: 0 0 1.1rem;
}

.mr-body h4 {
  margin: 0 0 0.5rem;
  color: var(--tool-dim, #b9b4c9);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mr-dim {
  color: var(--tool-mute, #8b889b);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.mr-dim.is-bad {
  color: #ff8a8a;
}

/* The picked memes, in order, each movable and removable. */
.mr-strip {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  padding: 0.2rem 0 0.4rem;
  overflow-x: auto;
}

.mr-tile {
  position: relative;
  flex: none;
  width: 5.2rem;
  height: 5.2rem;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.mr-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mr-num {
  position: absolute;
  top: 4px;
  left: 4px;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--tool-a1, #ff2d95);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.3rem;
  text-align: center;
}

.mr-tile-btns {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}

.mr-tile-btns button {
  flex: 1;
  padding: 0.2rem 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}

.mr-tile-btns button:disabled {
  opacity: 0.25;
  cursor: default;
}

.mr-tile-btns button:hover:not(:disabled) {
  color: var(--tool-a1, #ff2d95);
}

.mr-song-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.mr-input {
  flex: 1;
  min-width: 12rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--tool-fg, #f2f0f7);
  font: inherit;
  font-size: 0.82rem;
}

.mr-song-info {
  margin: 0.5rem 0 0;
}

.mr-wave {
  margin-top: 0.5rem;
}

.mr-wave[hidden] {
  display: none;
}

.mr-wave canvas {
  display: block;
  width: 100%;
  height: 56px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
}


.mr-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.5rem;
}

.mr-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--tool-fg, #f2f0f7);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mr-choice b {
  font-size: 0.86rem;
}

.mr-choice span {
  color: var(--tool-mute, #8b889b);
  font-size: 0.72rem;
  line-height: 1.35;
}

.mr-choice.is-on {
  border-color: var(--tool-a1, #ff2d95);
  background: color-mix(in srgb, var(--tool-a1, #ff2d95) 12%, transparent);
}

.mr-formats .mr-choice {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
}

/* Little outlines of the three shapes. */
.mr-shape {
  flex: none;
  border: 2px solid currentColor;
  border-radius: 2px;
  opacity: 0.8;
}
.mr-shape-square { width: 1rem; height: 1rem; }
.mr-shape-story { width: 0.65rem; height: 1.15rem; }
.mr-shape-wide { width: 1.25rem; height: 0.7rem; }

.mr-grid {
  display: grid;
  grid-template-columns: 1fr 12rem;
  gap: 0.6rem 1rem;
  align-items: end;
}

.mr-grid label > span {
  display: block;
  margin: 0 0 0.35rem;
  color: var(--tool-dim, #b9b4c9);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mr-grid .mr-input {
  width: 100%;
  min-width: 0;
}

.mr-check {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--tool-fg2, #d9d5e6);
  font-size: 0.82rem;
  cursor: pointer;
}

.mr-check input {
  accent-color: var(--tool-a1, #ff2d95);
}

@media (max-width: 560px) {
  .mr-grid {
    grid-template-columns: 1fr;
  }
}

.mr-estimate {
  margin: 0 0 0.9rem;
  color: var(--tool-a3, #ffc61a);
  font-size: 0.8rem;
}

.mr-make {
  display: flex;
  justify-content: center;
}

.mr-progress {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.mr-progress[hidden] {
  display: none;
}

.mr-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tool-a1, #ff2d95) 35%, transparent), color-mix(in srgb, var(--tool-a3, #ffc61a) 35%, transparent), color-mix(in srgb, var(--tool-a2, #19e3ff) 35%, transparent));
  transition: width 0.2s ease;
}

.mr-progress em {
  position: relative;
  flex: 1;
  font-size: 0.82rem;
  font-style: normal;
}

.mr-progress .mr-btn {
  position: relative;
}

.mr-result {
  margin-top: 1rem;
  text-align: center;
}

.mr-result[hidden] {
  display: none;
}

.mr-result video {
  display: block;
  width: 100%;
  max-height: 60vh;
  margin: 0 auto 0.8rem;
  border-radius: 10px;
  background: #000;
}

.mr-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.mr-result .mr-dim {
  margin: 0.6rem 0 0;
}

/* ------------------------------------------- the controls, and preview --- */

.mr-hint {
  margin: -0.15rem 0 0.55rem;
  line-height: 1.4;
}

.mr-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--tool-a2, #19e3ff);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.mr-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.4rem 0 0;
}

.mr-key {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
}

.mr-key-video { background: var(--tool-a1, #ff2d95); }
.mr-key-drop { background: var(--tool-a3, #ffc61a); margin-left: 0.4rem; }

.mr-wave canvas {
  height: 64px;
  cursor: crosshair;
}

/* The transition between two memes, sitting in the gap between their tiles. */
.mr-strip {
  align-items: center;
}

.mr-cut {
  flex: none;
  position: relative;
}

.mr-cut select {
  width: 4.6rem;
  padding: 0.25rem 0.2rem;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--tool-dim, #b9b4c9);
  font: inherit;
  font-size: 0.64rem;
  cursor: pointer;
}

.mr-cut.is-set select {
  border-style: solid;
  border-color: var(--tool-a1, #ff2d95);
  color: #fff;
}

.mr-tile img {
  cursor: pointer;
}

.mr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.7rem;
}

.mr-chip {
  padding: 0.32rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: transparent;
  color: var(--tool-dim, #b9b4c9);
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
}

.mr-chip.is-on {
  border-color: var(--tool-a1, #ff2d95);
  background: color-mix(in srgb, var(--tool-a1, #ff2d95) 16%, transparent);
  color: #fff;
}

.mr-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  align-items: end;
}

.mr-slider span,
.mr-pick span {
  display: flex;
  justify-content: space-between;
  margin: 0 0 0.3rem;
  color: var(--tool-dim, #b9b4c9);
  font-size: 0.74rem;
}

.mr-slider input {
  width: 100%;
  accent-color: var(--tool-a1, #ff2d95);
}

.mr-pick .mr-input {
  width: 100%;
  min-width: 0;
}

/* One row per effect: on, strength, when. Dimmed while off. */
.mr-fx {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mr-fx-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.5rem 8.5rem;
  gap: 0.6rem;
  align-items: center;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  opacity: 0.55;
}

.mr-fx-row.is-on {
  background: color-mix(in srgb, var(--tool-a1, #ff2d95) 7%, transparent);
  opacity: 1;
}

.mr-fx-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  cursor: pointer;
}

.mr-fx-name input {
  flex: none;
  accent-color: var(--tool-a1, #ff2d95);
}

.mr-fx-name span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mr-fx-name b {
  font-size: 0.82rem;
}

.mr-fx-name small {
  overflow: hidden;
  color: var(--tool-mute, #8b889b);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mr-fx-amount {
  width: 100%;
  accent-color: var(--tool-a1, #ff2d95);
}

.mr-fx-when {
  min-width: 0;
  padding: 0.3rem 0.4rem;
  font-size: 0.72rem;
}

@media (max-width: 560px) {
  .mr-fx-row {
    grid-template-columns: 1fr 1fr;
  }
  .mr-fx-name {
    grid-column: 1 / -1;
  }
}

.mr-preview canvas {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 10px;
  background: #000;
}

.mr-preview-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.5rem 0 0.3rem;
}

.mr-play {
  flex: none;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 50%;
  background: var(--tool-a1, #ff2d95);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
}

.mr-preview-bar input {
  flex: 1;
  accent-color: var(--tool-a2, #19e3ff);
}

.mr-time {
  flex: none;
  color: var(--tool-dim, #b9b4c9);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}


/* The still frame says which effect it is showing. */
.mr-screen {
  position: relative;
}

.mr-peek {
  position: absolute;
  left: 50%;
  bottom: 0.5rem;
  max-width: calc(100% - 1rem);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(10, 10, 16, 0.82);
  color: #fff;
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  pointer-events: none;
}

.mr-peek[hidden] {
  display: none;
}

.mr-loop {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0 0 0.5rem;
}

.mr-loop span {
  margin-right: 0.15rem;
  color: var(--tool-mute, #8b889b);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mr-loop button {
  flex: 1;
  padding: 0.28rem 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: transparent;
  color: var(--tool-dim, #b9b4c9);
  font: inherit;
  font-size: 0.7rem;
  cursor: pointer;
}

.mr-loop button.is-on {
  border-color: var(--tool-a2, #19e3ff);
  background: color-mix(in srgb, var(--tool-a2, #19e3ff) 14%, transparent);
  color: #fff;
}


/* Effects in four foldable groups. */
.mr-fx-group {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.mr-fx-group summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.mr-fx-group summary::-webkit-details-marker {
  display: none;
}

.mr-fx-group summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--tool-mute, #8b889b);
  transition: transform 0.15s;
}

.mr-fx-group:not([open]) summary::after {
  transform: rotate(-90deg);
}

.mr-fx-group summary b {
  font-size: 0.85rem;
}

.mr-fx-group summary small {
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tool-a1, #ff2d95) 18%, transparent);
  color: #ff8ac7;
  font-size: 0.66rem;
}

.mr-fx-group summary small:empty {
  display: none;
}

.mr-fx-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.35rem 0.4rem;
}

/* ------------------------------------------------- shapes while picking --- */

/* Picking shows each meme whole, so its shape can be seen. */
.meme-gallery.mr-picking .meme-thumbnail,
#mt-results.mr-picking .meme-thumbnail {
  object-fit: contain;
  background: var(--tool-bg, #0b0a10);
}

/* A small outline of the meme's shape in the corner. */
.meme-gallery.mr-picking .meme-item[data-shape]::before,
#mt-results.mr-picking .meme-item[data-shape]::before {
  content: '';
  position: absolute;
  left: 0.65rem;
  bottom: 0.65rem;
  z-index: 2;
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid #fff;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.mr-picking .meme-item[data-shape='tall']::before {
  width: 0.55rem;
  height: 0.9rem;
}

.mr-picking .meme-item[data-shape='wide']::before {
  width: 0.95rem;
  height: 0.55rem;
}

.mr-picking .meme-item.mr-off-shape {
  display: none;
}

.mr-shapes {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.15rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.mr-shapes button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--tool-dim, #b9b4c9);
  font: inherit;
  font-size: 0.76rem;
  white-space: nowrap;
  cursor: pointer;
}

.mr-shapes button.is-on {
  background: var(--tool-a2, #19e3ff);
  color: var(--tool-bg, #0b0a10);
  font-weight: 700;
}

.mr-ico {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.mr-ico-tall {
  width: 0.48rem;
  height: 0.78rem;
}

.mr-ico-wide {
  width: 0.82rem;
  height: 0.48rem;
}

/* ------------------------------------------------------ effect tracks --- */

.mr-tl {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.mr-tl-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--tool-dim, #b9b4c9);
  font-size: 0.74rem;
}

.mr-tl-tools label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.mr-tl-tools select {
  padding: 0.3rem 0.45rem;
  font-size: 0.74rem;
}

.mr-tl-tools .mr-tl-add {
  border-color: var(--tool-a1, #ff2d95);
  color: #fff;
  font-weight: 600;
}

.mr-tl-tools input[type='range'] {
  width: 6rem;
  accent-color: var(--tool-a2, #19e3ff);
}

.mr-tl-scroll {
  overflow-x: auto;
  overflow-y: hidden;
}

.mr-tl-inner {
  position: relative;
  min-width: 100%;
}

.mr-tl-row {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* The names stay put while the lanes scroll under them. */
.mr-tl-th {
  position: sticky;
  left: 0;
  z-index: 3;
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.2rem;
  width: 118px;
  padding: 0 0.35rem 0 0.6rem;
  background: #1a1626;
  color: var(--tool-mute, #8b889b);
  font-size: 0.7rem;
}

.mr-tl-lane {
  position: relative;
  flex: none;
  touch-action: none;
}

.mr-tl-lane canvas {
  display: block;
}

.mr-tl-ruler .mr-tl-lane,
.mr-tl-memes .mr-tl-lane,
.mr-tl-music .mr-tl-lane {
  cursor: pointer;
}

.mr-tl-memes .mr-tl-lane {
  height: 36px;
}

.mr-tl-meme {
  position: absolute;
  top: 3px;
  bottom: 3px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  background: #2a2438 center / cover no-repeat;
}

.mr-tl-meme span {
  position: absolute;
  left: 3px;
  top: 2px;
  padding: 0 0.25rem;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
}

.mr-tl-logo {
  background: color-mix(in srgb, var(--tool-a2, #19e3ff) 18%, transparent);
}

.mr-tl-empty .mr-tl-lane {
  display: flex;
  align-items: center;
  height: 40px;
  padding-left: 0.6rem;
  color: var(--tool-mute, #8b889b);
  font-size: 0.74rem;
}

.mr-tl-track .mr-tl-th select {
  flex: 1;
  min-width: 0;
  padding: 0.2rem 0.3rem;
  font-size: 0.7rem;
}

.mr-tl-mini {
  flex: none;
  width: 1.3rem;
  height: 1.3rem;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--tool-dim, #b9b4c9);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}

.mr-tl-mini:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.mr-tl-fxlane {
  height: 34px;
  background: repeating-linear-gradient(90deg, transparent 0 39px, rgba(255, 255, 255, 0.03) 39px 40px);
  cursor: copy;
  --clip: var(--tool-a1, #ff2d95);
}

.mr-tl-fxlane.mr-g-camera { --clip: var(--tool-a2, #19e3ff); }
.mr-tl-fxlane.mr-g-glitch { --clip: var(--tool-a1, #ff2d95); }
.mr-tl-fxlane.mr-g-light { --clip: var(--tool-a3, #ffc61a); }
.mr-tl-fxlane.mr-g-film { --clip: #a67bff; }

.mr-tl-track.is-muted .mr-tl-fxlane {
  opacity: 0.35;
}

.mr-tl-nogo {
  position: absolute;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.35) 0 6px, transparent 6px 12px);
  cursor: not-allowed;
}

.mr-tl-clip {
  position: absolute;
  top: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--clip);
  border-radius: 5px;
  background: color-mix(in srgb, var(--clip) calc(var(--strength, 0.7) * 55%), transparent);
  cursor: grab;
}

.mr-tl-clip:active {
  cursor: grabbing;
}

.mr-tl-clip.is-sel {
  border-color: #fff;
  box-shadow: 0 0 0 2px #fff, 0 0 14px rgba(255, 255, 255, 0.35);
  z-index: 2;
}

.mr-tl-clip em {
  flex: 1;
  overflow: hidden;
  padding: 0 0.15rem;
  color: #fff;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.mr-tl-grip {
  flex: none;
  align-self: stretch;
  width: 7px;
  background: rgba(255, 255, 255, 0.25);
  cursor: ew-resize;
}

.mr-tl-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  width: 2px;
  margin-left: -1px;
  background: var(--tool-a2, #19e3ff);
  box-shadow: 0 0 6px color-mix(in srgb, var(--tool-a2, #19e3ff) 70%, transparent);
  pointer-events: none;
}

/* One clip's own settings. */
.mr-tl-insp {
  padding: 0.7rem 0.75rem 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.mr-tl-insp[hidden] {
  display: none;
}

.mr-tl-insp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
}

.mr-tl-insp-head b {
  font-size: 0.9rem;
}

.mr-tl-insp-head span {
  margin-right: auto;
  color: var(--tool-mute, #8b889b);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.mr-tl-insp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 0.9rem;
  align-items: end;
}

.mr-loop button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ============================================================ the editor ===
   Styles on top, the picture big in the middle, the timeline under it, and
   the rest in tabs at the bottom - one screen, nothing scrolls away. */

.mr-panel {
  align-items: stretch;
  padding: 12px;
}

.mr-editor {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto minmax(0, 30vh);
  max-width: 96rem;
  height: calc(100vh - 24px);
  height: calc(100dvh - 24px);
  margin: 0 auto;
  overflow: hidden;
}

.mr-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  padding: 0.65rem 0.9rem 0.55rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mr-top h3 {
  margin: 0;
  font-family: 'Unbounded', 'Space Grotesk', sans-serif;
  font-size: 1rem;
  white-space: nowrap;
}

.mr-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.mr-preset {
  padding: 0.38rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--tool-fg2, #d9d5e6);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.mr-preset:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.mr-preset.is-on {
  border-color: var(--tool-a1, #ff2d95);
  background: var(--tool-a1, #ff2d95);
  color: #fff;
}

.mr-preset.is-blank {
  border-style: dashed;
}

.mr-preset.is-blank.is-on {
  border-style: solid;
  border-color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.mr-preset-mine {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tool-a2, #19e3ff) 14%, transparent);
  color: var(--tool-a2, #19e3ff);
  font-size: 0.7rem;
}

.mr-top-end {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-left: auto;
}

.mr-top .mr-estimate {
  margin: 0;
  font-size: 0.74rem;
  white-space: nowrap;
}

.mr-top .mr-progress {
  width: 15rem;
  padding: 0.4rem 0.6rem;
}

/* The picture, as big as it fits. */
.mr-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.04), transparent 70%);
}

.mr-stage .mr-screen canvas {
  display: block;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.mr-stage .mr-result {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0.8rem;
  background: color-mix(in srgb, var(--tool-bg, #0c0a12) 97%, transparent);
}

.mr-stage .mr-result[hidden] {
  display: none;
}

.mr-stage .mr-result video {
  width: auto;
  max-width: 100%;
  max-height: calc(100% - 5.5rem);
  margin: 0;
}

.mr-stage .mr-result .mr-dim {
  margin: 0;
}

.mr-transport {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
  padding: 0.45rem 1rem;
}

.mr-transport input[type='range'] {
  flex: 1;
  min-width: 8rem;
  accent-color: var(--tool-a2, #19e3ff);
}

.mr-transport .mr-loop {
  margin: 0;
}

.mr-transport .mr-loop button {
  flex: none;
  padding: 0.28rem 0.7rem;
}

.mr-editor .mr-tl {
  display: flex;
  flex-direction: column;
  max-height: 28vh;
  margin: 0 0.8rem 0.6rem;
}

.mr-editor .mr-tl-scroll {
  min-height: 0;
  overflow: auto;
}

.mr-tl-hint {
  flex: 1;
  min-width: 10rem;
  font-size: 0.72rem;
}

.mr-tl-drop {
  position: absolute;
  top: 2px;
  bottom: 2px;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  border: 1px solid var(--tool-a3, #ffc61a);
  border-radius: 4px;
  background: color-mix(in srgb, var(--tool-a3, #ffc61a) 14%, transparent);
  cursor: grab;
}

.mr-tl-drop span {
  flex: 1;
  padding: 0 0.3rem;
  color: var(--tool-a3, #ffc61a);
  font-size: 0.6rem;
  font-weight: 700;
  pointer-events: none;
}

.mr-tl-drop i {
  flex: none;
  align-self: stretch;
  width: 6px;
  background: color-mix(in srgb, var(--tool-a3, #ffc61a) 45%, transparent);
  cursor: ew-resize;
}

.mr-tl-auto {
  margin-left: auto;
}

/* The tabs at the bottom. */
.mr-dock {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
}

.mr-tabs {
  display: flex;
  flex: none;
  gap: 0.1rem;
  padding: 0 0.6rem;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mr-tabs button {
  flex: none;
  padding: 0.6rem 0.85rem 0.5rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--tool-mute, #8b889b);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.mr-tabs button:hover {
  color: #fff;
}

.mr-tabs button.is-on {
  border-bottom-color: var(--tool-a1, #ff2d95);
  color: #fff;
}

.mr-tabs button[hidden] {
  display: none;
}

.mr-tabs button[data-tab='clip'] {
  color: var(--tool-a2, #19e3ff);
}

.mr-panes {
  flex: 1;
  min-height: 0;
  padding: 0.8rem 1.1rem 1rem;
  overflow-y: auto;
}

.mr-panes section[hidden] {
  display: none;
}

/* Effect groups side by side when there is room. */
.mr-panes .mr-fx {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(25rem, 1fr));
  align-items: start;
  gap: 0.5rem;
}

.mr-panes .mr-tl-insp {
  padding: 0;
  border: 0;
  background: none;
}

.mr-panes .mr-tl-insp-grid {
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.mr-panes .mr-wave canvas {
  height: 72px;
  touch-action: none;
}

/* How long, and how to fill it. */
.mr-len {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin-top: 0.7rem;
  color: var(--tool-dim, #b9b4c9);
  font-size: 0.78rem;
}

.mr-len-label {
  color: var(--tool-dim, #b9b4c9);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mr-len-pick {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.15rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.mr-len-pick button {
  padding: 0.3rem 0.7rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--tool-dim, #b9b4c9);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}

.mr-len-pick button.is-on {
  background: var(--tool-a1, #ff2d95);
  color: #fff;
  font-weight: 700;
}

.mr-len-own,
.mr-len-fill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.mr-len-own .mr-input {
  width: 4.5rem;
  min-width: 0;
  padding: 0.3rem 0.45rem;
}

.mr-len-fill .mr-input {
  min-width: 0;
  padding: 0.3rem 0.45rem;
}

.mr-len-fill[hidden] {
  display: none;
}

.is-muted {
  opacity: 0.45;
}

/* A small screen: one long page instead. */
@media (max-width: 760px), (max-height: 600px) {
  .mr-panel {
    align-items: flex-start;
  }
  .mr-editor {
    display: block;
    height: auto;
    overflow: visible;
  }
  .mr-top-end {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
  .mr-stage {
    height: 52vh;
  }
  .mr-editor .mr-tl {
    max-height: none;
  }
  .mr-panes .mr-fx {
    grid-template-columns: 1fr;
  }
}

/* Your own styles. */
.mr-preset.is-mine {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-color: color-mix(in srgb, var(--tool-a2, #19e3ff) 45%, transparent);
  color: #bff6ff;
}

.mr-preset.is-mine.is-on {
  border-color: var(--tool-a2, #19e3ff);
  background: var(--tool-a2, #19e3ff);
  color: var(--tool-bg, #0b0a10);
}

.mr-preset.is-mine i {
  margin-right: -0.3rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  font-style: normal;
  opacity: 0.55;
}

.mr-preset.is-mine i:hover {
  background: rgba(0, 0, 0, 0.25);
  opacity: 1;
}

.mr-preset.is-save {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--tool-a2, #19e3ff) 50%, transparent);
  color: var(--tool-a2, #19e3ff);
}

.mr-save-form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.mr-save-form .mr-input {
  width: 11rem;
  min-width: 0;
  padding: 0.32rem 0.6rem;
}

/* Each placed clip can be deleted on its own. */
.mr-tl-x {
  display: none;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin: 0 0.1rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
}

.mr-tl-x:hover {
  background: #ff3b5c;
}

.mr-tl-clip:hover .mr-tl-x,
.mr-tl-clip.is-sel .mr-tl-x {
  display: inline-flex;
}

@media (hover: none) {
  .mr-tl-x {
    display: inline-flex;
  }
}

/* How long each meme stays. */
.mr-tile-wrap {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 0.25rem;
  width: 5.2rem;
}

.mr-tile-len {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  width: 100%;
  padding: 0 0.15rem 0 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--tool-mute, #8b889b);
  font-size: 0.66rem;
}

.mr-tile-len input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 0.2rem 0;
  border: 0;
  background: transparent;
  color: var(--tool-fg, #f2f0f7);
  font: inherit;
  font-size: 0.7rem;
  -moz-appearance: textfield;
}

.mr-tile-len input::-webkit-inner-spin-button,
.mr-tile-len input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.mr-tile-len input:focus {
  outline: none;
}

.mr-tile-len:focus-within {
  border-color: var(--tool-a2, #19e3ff);
}

.mr-tile-len button {
  flex: none;
  padding: 0 0.15rem;
  border: 0;
  background: none;
  color: var(--tool-a2, #19e3ff);
  font-size: 0.75rem;
  cursor: pointer;
}

.mr-tile-len button[hidden] {
  display: none;
}

.mr-tl-mgrip {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 7px;
  background: rgba(255, 255, 255, 0.0);
  cursor: ew-resize;
}

.mr-tl-meme:hover .mr-tl-mgrip {
  background: rgba(255, 255, 255, 0.55);
}

.mr-tl-meme.is-own {
  border-color: var(--tool-a2, #19e3ff);
  box-shadow: inset 0 -3px 0 var(--tool-a2, #19e3ff);
}

/* --------------------------------------------- transitions on the cuts --- */

.mr-tl-trans .mr-tl-lane {
  height: 26px;
}

.mr-tl-tr {
  position: absolute;
  top: 3px;
  bottom: 3px;
  z-index: 1;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--tool-a1, #ff2d95);
  border-radius: 5px;
  background: color-mix(in srgb, var(--tool-a1, #ff2d95) 45%, transparent);
  cursor: pointer;
}

.mr-tl-tr.is-auto {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--tool-a1, #ff2d95) 55%, transparent);
  background: color-mix(in srgb, var(--tool-a1, #ff2d95) 10%, transparent);
}

.mr-tl-tr.is-auto em {
  color: #d9a3c4;
}

.mr-tl-tr.is-target {
  border: 2px solid var(--tool-a2, #19e3ff);
  background: color-mix(in srgb, var(--tool-a2, #19e3ff) 35%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--tool-a2, #19e3ff) 60%, transparent);
}

.mr-tl-tr em {
  flex: 1;
  overflow: hidden;
  padding: 0 0.1rem;
  color: #fff;
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.mr-tl-tgrip {
  flex: none;
  align-self: stretch;
  width: 6px;
  background: rgba(255, 255, 255, 0.25);
  cursor: ew-resize;
}

.mr-tl-tr:hover .mr-tl-x {
  display: inline-flex;
}

.mr-tl.is-dropping {
  outline: 2px dashed var(--tool-a2, #19e3ff);
  outline-offset: 2px;
}

/* What is being dragged, under the pointer. */
.mr-drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 4000;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--tool-a1, #ff2d95);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.mr-panes [data-trans] .mr-chip {
  cursor: grab;
  touch-action: none;
}

.mr-top [data-quick] {
  white-space: nowrap;
}
