/* ==========================================================================
   The quick video maker - see meme-reel-quick.js. Phone first: one screen,
   steps along the top, big thumb-sized buttons along the bottom.
   ========================================================================== */

.mq {
  position: fixed;
  inset: 0;
  z-index: 2700;
  display: flex;
  flex-direction: column;
  background: var(--tool-panel2, #120f1a);
  color: var(--tool-fg, #f2f0f7);
  font-size: 0.95rem;
}

.mq[hidden] {
  display: none;
}

body.mq-on {
  overflow: hidden;
}

.mq-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  padding-top: max(0.6rem, env(safe-area-inset-top));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mq-x {
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.mq-steps {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mq-steps li {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  color: var(--tool-mute2, #77748a);
  font-size: 0.78rem;
  font-weight: 600;
}

.mq-steps li b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
}

.mq-steps li.is-done {
  color: var(--tool-dim, #b9b4c9);
  cursor: pointer;
}

.mq-steps li.is-done b {
  background: color-mix(in srgb, var(--tool-a2, #19e3ff) 25%, transparent);
  color: var(--tool-a2, #19e3ff);
}

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

.mq-steps li.is-on b {
  background: var(--tool-a1, #ff2d95);
  color: #fff;
}

@media (max-width: 480px) {
  .mq-steps li:not(.is-on) span {
    display: none;
  }
}

.mq-editor {
  flex: none;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--tool-dim, #b9b4c9);
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
}

/* Phones have no room for a timeline: no way to the full editor there. */
@media (max-width: 760px) {
  .mq-editor {
    display: none;
  }
}

.mq-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mq-body section {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem 1rem 1.5rem;
}

.mq-body section[hidden] {
  display: none;
}

.mq-body h2 {
  margin: 0 0 0.8rem;
  font-family: 'Unbounded', 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
}

.mq-body h3 {
  margin: 1.2rem 0 0.5rem;
  color: var(--tool-dim, #b9b4c9);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mq-body h3 small {
  color: var(--tool-mute2, #77748a);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.mq-dim {
  margin: 0.5rem 0;
  color: var(--tool-mute, #8b889b);
  font-size: 0.85rem;
}

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

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

.mq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.9rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--tool-a1, #ff2d95);
  border-radius: 14px;
  background: var(--tool-a1, #ff2d95);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mq-btn:disabled {
  opacity: 0.4;
}

.mq-btn.mq-ghost {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.mq-btn.mq-wide {
  width: 100%;
}

.mq-btn[hidden] {
  display: none;
}

.mq-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mq-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  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.85rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mq-chip.is-on {
  border-color: var(--tool-a1, #ff2d95);
  background: color-mix(in srgb, var(--tool-a1, #ff2d95) 22%, transparent);
  color: #fff;
  font-weight: 600;
}

.mq-shape {
  border: 2px solid currentColor;
  border-radius: 2px;
}
.mq-shape-square { width: 0.9rem; height: 0.9rem; }
.mq-shape-story { width: 0.6rem; height: 1rem; }
.mq-shape-wide { width: 1.1rem; height: 0.62rem; }

.mq-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.9rem 0 0;
  color: var(--tool-fg2, #d9d5e6);
  font-size: 0.9rem;
}

.mq-toggle[hidden] {
  display: none;
}

.mq-toggle input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--tool-a1, #ff2d95);
}

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

.mq-memes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.5rem;
  margin: 0 0 0.8rem;
}

.mq-meme {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
}

.mq-meme img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mq-meme button {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
}

/* ---------------------------------------------------------------- song --- */

.mq-wave {
  display: block;
  width: 100%;
  height: 80px;
  margin-top: 0.8rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  touch-action: none;
}

/* ---------------------------------------------------------------- vibe --- */

.mq-wild {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--tool-dim, #b9b4c9);
  font-size: 0.85rem;
  font-weight: 600;
}

.mq-wild input {
  flex: 1;
  accent-color: var(--tool-a1, #ff2d95);
}

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

.mq-body section.mq-result {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: none;
  padding: 0.6rem 0.6rem 0.4rem;
}

.mq-body section.mq-result[hidden] {
  display: none;
}

.mq-stage {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  cursor: pointer;
}

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

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

.mq-tap {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.5rem;
  pointer-events: none;
}

.mq-stage.is-playing .mq-tap {
  display: none;
}

.mq-made {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 0;
}

.mq-made[hidden] {
  display: none;
}

.mq-made video {
  max-width: 100%;
  max-height: calc(100% - 7rem);
  border-radius: 10px;
  background: #000;
}

.mq-time {
  height: 3px;
  margin: 0.5rem 0.2rem 0;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.mq-time i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--tool-a2, #19e3ff);
}

.mq-take {
  margin: 0.35rem 0.2rem 0;
  font-size: 0.75rem;
  text-align: center;
}

/* ------------------------------------------------------------ the foot --- */

.mq-foot {
  padding: 0.6rem 0.75rem;
  padding-bottom: max(0.6rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--tool-panel, #15121f);
}

.mq-nav {
  flex-wrap: nowrap;
  max-width: 40rem;
  margin: 0 auto;
}

.mq-nav[hidden] {
  display: none;
}

.mq-nav .mq-big {
  flex: 1;
}

.mq-progress {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  max-width: 40rem;
  margin: 0 auto;
  padding: 0.5rem 0.6rem;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
}

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

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

.mq-progress em {
  position: relative;
  flex: 1;
  font-style: normal;
}

.mq-progress .mq-btn {
  position: relative;
  min-height: 2.4rem;
}

.mq-nav [data-back] {
  flex: none;
  min-width: 3.2rem;
}

.mq-time[hidden],
.mq-take[hidden] {
  display: none;
}
