/* Make your parade, its own page (make/index.html): two panels, as taylor.fyi/top: the balloon picker on the left, the
   street with the card's backdrop and line and the way out on the right (on a phone the street is pinned at the top
   and the picker is under it).
   public/make.js builds it into #make-root. Uses the page's tokens, .btn and .field. Type 20 (title) 16 (fields)
   14 (labels) 12 (badges). */
.mk-sheet { display: flex; flex-direction: column; padding: 0 0 20px; }
.mk-top { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.mk-top h1 { margin: 0 auto 0 0; font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.mk-surprise { position: relative; height: 36px; padding: 0 14px 0 10px; }
.mk-body { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 12px; margin-top: 12px; min-height: calc(100dvh - 136px); } /* (the panels run to the foot of the screen) */
.mk-tray, .mk-share { border-radius: var(--r-l); background: var(--surface); }
.mk-share { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 20px; }
.mk-h { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }

/* the stage */
.mk-stage { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-m); overflow: hidden; background: var(--fill); user-select: none; -webkit-user-select: none; }
.mk-stage canvas { display: block; width: 100%; height: 100%; }
.mk-hits { position: absolute; inset: 0; }
.mk-hit { position: absolute; }
.mk-grab { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: var(--r-m); background: none; cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent; }
.mk-grab:focus { outline: none; }
.mk-hit.on .mk-grab, .mk-grab:focus-visible { box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px rgba(0, 0, 0, .2), 0 0 0 1px rgba(0, 0, 0, .2); }
.mk-hit.held .mk-grab { cursor: grabbing; box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .mk-hit:not(.on):not(.held) .mk-grab:hover { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); } }
.mk-x { position: absolute; top: -14px; right: -14px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: #131311; display: none; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.mk-x::before { content: ""; position: absolute; inset: -8px; }
.mk-x svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; }
.mk-hit.on:not(.held) .mk-x { display: grid; }
.mk-x:active { transform: scale(.94); }
/* pulled up far enough: let go and it floats off */
.mk-hit.armed::after { content: "Let go"; position: absolute; left: 50%; top: -40px; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px; background: #fff; color: #131311; font-size: 14px; font-weight: 500; white-space: nowrap; pointer-events: none; }
.mk-empty { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); margin: 0; padding: 10px 16px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 16px; font-weight: 500; white-space: nowrap; pointer-events: none; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.mk-empty[hidden] { display: none; }
.mk-snack { position: absolute; left: 50%; top: 12px; display: flex; align-items: center; gap: 4px; max-width: calc(100% - 24px); padding: 4px 4px 4px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 500; opacity: 0; transform: translate(-50%, -8px); transition: opacity .18s var(--ease), transform .18s var(--ease), visibility 0s .18s; pointer-events: none; visibility: hidden; white-space: nowrap; }
.mk-snack.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; visibility: visible; transition-delay: 0s; }
.mk-snack span { overflow: hidden; text-overflow: ellipsis; padding: 6px 0; }
.mk-snack button { position: relative; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: inherit; font-weight: 700; cursor: pointer; }
.mk-snack button[hidden] { display: none; }
.mk-snack button::before, .mk-surprise::before { content: ""; position: absolute; inset: -6px 0; }
.mk-stage:has(.mk-snack.on) .mk-empty { opacity: 0; }
/* saved: a camera flash on the picture */
.mk-stage::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.mk-stage.flash::after { animation: mk-flash .32s var(--ease); }
@keyframes mk-flash { from { opacity: .7; } to { opacity: 0; } }
@media (hover: hover) { .mk-snack button:hover { background: rgba(127, 127, 127, .2); } }
.mk-ghost { position: fixed; left: 0; top: 0; z-index: 5; width: 112px; max-height: 120px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .35)); }
.mk-ghost[hidden] { display: none; }

/* the tray: search, one row of chips (one chosen), balloons */
.mk-tray { display: flex; flex-direction: column; gap: 8px; min-height: 0; padding: 20px 20px 0; contain: size; }
.mk-tray .mk-h { margin-bottom: 4px; }
.mk-chips { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 0 4px; flex: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.mk-chips[hidden] { display: none; }
.mk-chips::-webkit-scrollbar { display: none; }
.mk-chips .chip { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--quiet); font-weight: 500; white-space: nowrap; cursor: pointer; }
.mk-chips .chip:has(.ci) { padding-left: 6px; }
.mk-chips .chip::before { content: ""; position: absolute; inset: -4px 0; }
.mk-chips .chip .ci { width: 26px; height: 26px; display: grid; place-items: center; }
.mk-chips .chip .ci img { max-width: 26px; max-height: 26px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.mk-chips .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
@media (hover: hover) { .mk-chips .chip[aria-pressed="false"]:hover { color: var(--ink); } }
.mk-chips .chip:active { transform: scale(.97); }
#mk-yrs .chip { height: 32px; padding: 0 10px; font-size: 14px; }
/* with room beside the street, every chip shows at once (wrapped); on a phone they scroll sideways */
@media (min-width: 721px) {
  .mk-chips { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; gap: 2px; }
  .mk-chips .chip { height: 32px; padding: 0 10px; }
  .mk-chips .chip:has(.ci) { padding-left: 4px; }
  .mk-chips .chip .ci { width: 24px; height: 24px; } .mk-chips .chip .ci img { max-width: 24px; max-height: 24px; }
  #mk-yrs { padding-top: 6px; border-top: 1px solid var(--line); }
  #mk-yrs .chip { height: 28px; }
}
.mk-count { display: flex; align-items: center; justify-content: space-between; min-height: 28px; color: var(--quiet); flex: none; }
.mk-count button, .mk-none button { position: relative; height: 28px; padding: 0 8px; margin-right: -8px; border: 0; border-radius: var(--r-s); background: none; color: var(--ink); font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.mk-count button::before { content: ""; position: absolute; inset: -8px 0; }
.mk-count button[hidden] { display: none; }
.mk-grid { flex: 1; min-height: 0; padding-bottom: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; grid-auto-rows: max-content; gap: 2px; margin: 0 -4px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.mk-b { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; border: 0; border-radius: var(--r-m); background: none; color: var(--ink); cursor: pointer; text-align: center; touch-action: pan-x pan-y; }
.mk-b .art { width: 100%; height: 72px; display: grid; place-items: center; }
.mk-b img { max-width: 80px; max-height: 72px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3)); }
.mk-b .nm { font-size: 14px; line-height: 18px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mk-b .badge { position: absolute; top: 6px; right: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; line-height: 20px; }
.mk-b .badge:empty { display: none; }
.mk-b[aria-pressed="true"] { background: var(--chosen); }
@media (hover: hover) { .mk-b[aria-pressed="false"]:hover { background: var(--fill); } }
@media (pointer: fine) { .mk-b { cursor: grab; } }
.mk-b:active img { transform: scale(.95); }
.mk-none { grid-column: 1 / -1; margin: 0; padding: 24px 4px; color: var(--quiet); }
.mk-none button { margin: 0; }

/* the card: where, and their line */
.mk-card { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mk-scenes { display: flex; gap: 6px; flex: none; }
.mk-scenes button { position: relative; width: 64px; height: 40px; padding: 0; border: 0; border-radius: var(--r-s); overflow: hidden; background: var(--fill); cursor: pointer; }
.mk-scenes img { width: 100%; height: 100%; object-fit: cover; }
.mk-scenes button[aria-checked="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.mk-scenes button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mk-scenes button:active { transform: scale(.96); }
.mk-msg { flex: 1; min-width: 0; height: 44px; }
.mk-left { flex: none; color: var(--quiet); font-size: 14px; }

/* the way out: one primary */
.mk-keys { display: flex; align-items: center; gap: 8px; }
.mk-hint { margin: 0 auto 0 0; color: var(--quiet); font-size: 14px; }
.mk-save { min-width: 168px; }

@media (max-width: 720px) {
  /* the page scrolls; the street stays at the top and the way out at the bottom */
  .mk-sheet { padding: 0; }
  .mk-top { min-height: 44px; }
  .mk-top h1 { font-size: 20px; }
  .mk-body { display: flex; flex-direction: column; gap: 12px; margin: 12px 0 0; }
  .mk-share { display: contents; }
  .mk-h { display: none; }
  .mk-stage { position: sticky; top: 0; z-index: 3; flex: none; border-radius: var(--r-s); box-shadow: -16px 0 0 var(--bg), 16px 0 0 var(--bg), 0 -12px 0 var(--bg), -16px -12px 0 var(--bg), 16px -12px 0 var(--bg); }
  .mk-stage { order: 1; }
  .mk-card { order: 2; flex-direction: column; align-items: stretch; }
  .mk-tray { order: 3; contain: none; flex: none; padding: 0; border-radius: 0; background: none; scroll-margin-top: calc((100vw - 32px) * 9 / 16 + 12px); }
  .mk-keys { order: 4; align-self: stretch; position: sticky; bottom: 0; z-index: 3; margin: 0 -16px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: var(--bg); box-shadow: 0 -1px 0 var(--line); }
  .mk-grid { flex: none; overflow: visible; padding-bottom: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 -4px; }
  .mk-b { padding: 6px 2px; }
  .mk-b .art { height: 60px; } .mk-b img { max-width: 68px; max-height: 60px; }
  .mk-b .nm { font-size: 12px; line-height: 16px; }
  .mk-scenes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .mk-scenes button { width: auto; height: auto; aspect-ratio: 16 / 10; }
  .mk-msg { flex: none; }
  .mk-hint { display: none; }
  #mk-link span, #mk-x span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #mk-link, #mk-x { width: 44px; padding: 0; flex: none; }
  .mk-save { flex: 1; min-width: 0; }
  .mk-empty { font-size: 14px; }
  .mk-snack { top: 8px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .mk-snack { transition: opacity .12s, visibility 0s .12s; transform: translate(-50%, 0); } .mk-stage.flash::after { animation-duration: .2s; } }
